Added New Junit Cases for APPC Design Services
[appc.git] / appc-config / appc-data-services / provider / src / test / java / org / openecomp / appc / data / services / db / TestConfigResourceNode.java
1 package org.openecomp.appc.data.services.db;\r
2 \r
3 import java.io.InputStream;\r
4 import java.util.Enumeration;\r
5 import java.util.HashMap;\r
6 import java.util.Map;\r
7 import java.util.Properties;\r
8 \r
9 import org.junit.Test;\r
10 import org.openecomp.appc.data.services.AppcDataServiceConstant;\r
11 import org.openecomp.appc.data.services.db.DGGeneralDBService;\r
12 import org.openecomp.appc.data.services.node.ConfigResourceNode;\r
13 import org.apache.commons.lang.StringEscapeUtils;\r
14 import org.junit.After;\r
15 import org.junit.Before;\r
16 import org.openecomp.sdnc.sli.SvcLogicContext;\r
17 import org.openecomp.sdnc.sli.SvcLogicException;\r
18 import org.openecomp.sdnc.sli.SvcLogicResource;\r
19 import org.openecomp.sdnc.sli.SvcLogicResource.QueryStatus;\r
20 import org.openecomp.sdnc.sli.resource.sql.SqlResource;\r
21 import org.apache.commons.io.FileUtils;\r
22 import org.apache.commons.io.IOUtils;\r
23 \r
24 import java.io.File;\r
25 \r
26 public class TestConfigResourceNode {\r
27         \r
28         @Test(expected = Exception.class)\r
29         public void testGetUploadConfig1() throws SvcLogicException{\r
30         SvcLogicContext ctx = new SvcLogicContext();\r
31         ctx.setAttribute("test","test");\r
32                 ConfigResourceNode dbService = new ConfigResourceNode() ;\r
33                 Map<String,String> map = new HashMap<String,String>();\r
34              dbService.getConfigFileReference(map,ctx);\r
35                 //System.out.println(status);\r
36         \r
37                 \r
38         }\r
39 \r
40 @Test(expected = Exception.class)\r
41 \r
42 public void testGetUploadConfig2() throws SvcLogicException{\r
43 SvcLogicContext ctx = new SvcLogicContext();\r
44 ctx.setAttribute("test","test");\r
45         ConfigResourceNode dbService = new ConfigResourceNode() ;\r
46         Map<String,String> map = new HashMap<String,String>();\r
47      dbService.getTemplate(map,ctx);\r
48         //System.out.println(status);\r
49 }\r
50 \r
51 @Test(expected = Exception.class)\r
52 \r
53 public void testGetUploadConfig3() throws SvcLogicException{\r
54 SvcLogicContext ctx = new SvcLogicContext();\r
55 ctx.setAttribute("test","test");\r
56         ConfigResourceNode dbService = new ConfigResourceNode() ;\r
57         Map<String,String> map = new HashMap<String,String>();\r
58      dbService.getVnfcReference(map, ctx);\r
59         //System.out.println(status);\r
60 \r
61         \r
62 }\r
63 \r
64 @Test(expected = Exception.class)\r
65 \r
66 public void testGetUploadConfig4() throws SvcLogicException{\r
67 SvcLogicContext ctx = new SvcLogicContext();\r
68 ctx.setAttribute("test","test");\r
69         ConfigResourceNode dbService = new ConfigResourceNode() ;\r
70         Map<String,String> map = new HashMap<String,String>();\r
71      dbService.getSmmChainKeyFiles(map, ctx);\r
72         //System.out.println(status);\r
73 \r
74         \r
75 }\r
76 \r
77 @Test(expected = Exception.class)\r
78 \r
79 public void testGetUploadConfig5() throws SvcLogicException{\r
80 SvcLogicContext ctx = new SvcLogicContext();\r
81 ctx.setAttribute("test","test");\r
82         ConfigResourceNode dbService = new ConfigResourceNode() ;\r
83         Map<String,String> map = new HashMap<String,String>();\r
84      dbService.getDownloadConfigTemplateByVnf(map, ctx);\r
85         //System.out.println(status);\r
86 \r
87         \r
88 }\r
89 \r
90 @Test(expected = Exception.class)\r
91 public void testGetUploadConfig6() throws SvcLogicException{\r
92 SvcLogicContext ctx = new SvcLogicContext();\r
93 ctx.setAttribute("test","test");\r
94         ConfigResourceNode dbService = new ConfigResourceNode() ;\r
95         Map<String,String> map = new HashMap<String,String>();\r
96      dbService.getCommonConfigInfo(map, ctx);\r
97         //System.out.println(status);\r
98 \r
99         \r
100 }\r
101 \r
102 @Test(expected = Exception.class)\r
103 public void testGetUploadConfig7() throws SvcLogicException{\r
104 SvcLogicContext ctx = new SvcLogicContext();\r
105 ctx.setAttribute("test","test");\r
106         ConfigResourceNode dbService = new ConfigResourceNode() ;\r
107         Map<String,String> map = new HashMap<String,String>();\r
108      dbService.updateUploadConfig(map, ctx);\r
109         //System.out.println(status);\r
110 \r
111         \r
112 }\r
113 \r
114 \r
115 }\r