060008b3dd9fd8f82326e0f12d5f94321310e6e6
[sdc/sdc-workflow-designer.git] /
1 /**\r
2  * Copyright (c) 2018 ZTE Corporation.\r
3  * All rights reserved. This program and the accompanying materials\r
4  * are made available under the Apache License, Version 2.0\r
5  * and the Eclipse Public License v1.0 which both accompany this distribution,\r
6  * and are available at http://www.eclipse.org/legal/epl-v10.html\r
7  * and http://www.apache.org/licenses/LICENSE-2.0\r
8  *\r
9  * Contributors:\r
10  *     ZTE - initial API and implementation and/or initial documentation\r
11  */\r
12 package org.onap.sdc.workflowdesigner.resources;\r
13 \r
14 import static org.junit.Assert.assertEquals;\r
15 \r
16 import org.junit.After;\r
17 import org.junit.Before;\r
18 import org.junit.Test;\r
19 import org.onap.sdc.workflowdesigner.resources.entity.ExtendActivity;\r
20 import org.onap.sdc.workflowdesigner.utils.FileCommonUtils;\r
21 import org.onap.sdc.workflowdesigner.utils.JsonUtils;\r
22 \r
23 /**\r
24  *\r
25  */\r
26 public class ExtendActivityResourceTest {\r
27   private static final String EXT_ACTIVITIES_FILE_NAME = "..\\distribution\\src\\main\\assembly\\ext-activities.json";\r
28 \r
29   /**\r
30    * @throws java.lang.Exception\r
31    */\r
32   @Before\r
33   public void setUp() throws Exception {}\r
34 \r
35   /**\r
36    * @throws java.lang.Exception\r
37    */\r
38   @After\r
39   public void tearDown() throws Exception {}\r
40 \r
41   /**\r
42    * Test method for {@link org.onap.sdc.workflowdesigner.resources.ExtendActivityResource#retriveExtActivites(java.lang.String)}.\r
43    */\r
44   @Test\r
45   public void testRetriveExtActivites() {\r
46     try {\r
47       String json = FileCommonUtils.readString(EXT_ACTIVITIES_FILE_NAME);\r
48       ExtendActivity[] extActivities = JsonUtils.fromJson(json, ExtendActivity[].class);\r
49       \r
50       FileCommonUtils.write("test.json", JsonUtils.toJson(extActivities));\r
51       assertEquals(extActivities.length == 0, false);\r
52     } catch (Exception e) {\r
53       e.printStackTrace();\r
54     }\r
55 \r
56   }\r
57 \r
58   /**\r
59    * Test method for {@link org.onap.sdc.workflowdesigner.resources.ExtendActivityResource#getDisplayInfo(java.lang.String)}.\r
60    */\r
61   @Test\r
62   public void testGetDisplayInfo() {\r
63 \r
64   }\r
65 \r
66 }\r