Change to CCSDK and ODL Carbon
[appc.git] / appc-directed-graph / appc-dgraph / provider / src / test / java / org / openecomp / appc / dg / TestGetConfigParams.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * ONAP : APP-C
4  * ================================================================================
5  * Copyright (C) 2017 AT&T Intellectual Property.  All rights reserved.
6  * ================================================================================
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  * 
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  * 
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  * ============LICENSE_END=========================================================
19  */
20
21 package org.openecomp.appc.dg;
22
23
24 import java.util.HashMap;
25 import java.util.Map;
26
27 import org.junit.Test;
28 import org.openecomp.appc.dg.mock.instance.MockConfigureNodeExecutor;
29 import org.openecomp.appc.dg.mock.instance.MockSvcLogicJavaPlugin;
30
31 /* move to open source
32 import com.att.sdnctl.dgtestlibrary.AbstractDGTestCase;
33 import com.att.sdnctl.dgtestlibrary.DGTestCase;
34 import com.att.sdnctl.dgtestlibrary.GraphKey;
35 */
36 import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
37
38
39 public class TestGetConfigParams /* extends AbstractDGTestCase */ {
40         
41
42 /*
43         
44         public static String getConfigParamsXML = "src/main/resources/xml/APPC_GetConfigParams.xml";
45
46
47
48         @Test
49         public void testGetConfigParamsWithDefaultTemplate() {
50                 try {
51
52                         String propertyfileName = "APPC/GetConfigParams/DefaultTemplate.properties";
53                         Map<String, Object> serviceReferences = new HashMap<String, Object>();
54
55                         
56                         serviceReferences.put("org.openecomp.sdnc.config.generator.convert.ConvertNode", new org.openecomp.sdnc.config.generator.convert.ConvertNode());
57
58                         // Register Call graphs
59                         String injectGraphXmls[] = new String[] { getConfigParamsXML };
60
61
62                         GraphKey  graphKey = new GraphKey("APPC", null, "GetConfigParams", null);
63                         DGTestCase tc = new DGTestCase(graphKey);
64                         tc.setInjectGraphXmls(injectGraphXmls);
65                         tc.setServiceReferences(serviceReferences);
66                         tc.setPropertyfileName(propertyfileName);
67                         
68                         SvcLogicContext ctx = new SvcLogicContext();
69                         processTestCase(tc, ctx);
70
71                         
72
73                 } catch (Exception e) {
74                         e.printStackTrace();
75                 }
76
77         }
78
79
80
81
82         @Test
83         public void testGetConfigParamsWithTemplateName() {
84                 try {
85
86
87                         String propertyfileName = "APPC/GetConfigParams/TemplateName.properties";
88                         Map<String, Object> serviceReferences = new HashMap<String, Object>();
89
90                         serviceReferences.put("org.openecomp.sdnc.config.generator.convert.ConvertNode", new org.openecomp.sdnc.config.generator.convert.ConvertNode());
91
92                         // Register Call graphs
93                         String injectGraphXmls[] = new String[] { getConfigParamsXML };
94
95
96                         GraphKey  graphKey = new GraphKey("APPC", null, "GetConfigParams", null);
97                         DGTestCase tc = new DGTestCase(graphKey);
98                         tc.setInjectGraphXmls(injectGraphXmls);
99                         tc.setServiceReferences(serviceReferences);
100                         tc.setPropertyfileName(propertyfileName);
101                         
102
103                         SvcLogicContext ctx = new SvcLogicContext();
104                         processTestCase(tc, ctx);
105
106
107
108                 
109                 } catch (Exception e) {
110                         e.printStackTrace();
111                 }
112         }
113
114
115         @Test
116         public void testGetConfigParamsWithCliString() {
117                 try {
118
119                         String propertyfileName = "APPC/GetConfigParams/CliString.properties";
120                         Map<String, Object> serviceReferences = new HashMap<String, Object>();
121                         serviceReferences.put("org.openecomp.sdnc.config.generator.convert.ConvertNode", new org.openecomp.sdnc.config.generator.convert.ConvertNode());
122
123                         
124                         // Register Call graphs
125                         String injectGraphXmls[] = new String[] { getConfigParamsXML };
126
127
128                         GraphKey  graphKey = new GraphKey("APPC", null, "GetConfigParams", null);
129                         DGTestCase tc = new DGTestCase(graphKey);
130                         tc.setInjectGraphXmls(injectGraphXmls);
131                         tc.setServiceReferences(serviceReferences);
132                         tc.setPropertyfileName(propertyfileName);
133                         
134
135                         SvcLogicContext ctx = new SvcLogicContext();
136                         processTestCase(tc, ctx);
137
138
139                                 
140                 } catch (Exception e) {
141                         e.printStackTrace();
142                 }
143         }
144
145         @Test
146         public void testGetConfigParamsWithCliJson() {
147                 try {
148
149
150                         String propertyfileName = "APPC/GetConfigParams/CliJson.properties";
151                         Map<String, Object> serviceReferences = new HashMap<String, Object>();
152
153                         
154                 
155                         serviceReferences.put("org.openecomp.sdnc.config.generator.convert.ConvertNode", new org.openecomp.sdnc.config.generator.convert.ConvertNode());
156
157                         // Register Call graphs
158                         String injectGraphXmls[] = new String[] { getConfigParamsXML };
159
160
161                         GraphKey  graphKey = new GraphKey("APPC", null, "GetConfigParams", null);
162                         DGTestCase tc = new DGTestCase(graphKey);
163                         tc.setInjectGraphXmls(injectGraphXmls);
164                         tc.setServiceReferences(serviceReferences);
165                         tc.setPropertyfileName(propertyfileName);
166                         
167
168                         SvcLogicContext ctx = new SvcLogicContext();
169                         processTestCase(tc, ctx);
170
171
172
173                         
174                 } catch (Exception e) {
175                         e.printStackTrace();
176                 }
177         }
178
179
180
181         @Test
182         public void testGetConfigParamsForRestore() {
183                 try {
184                         String propertyfileName = "APPC/GetConfigParams/Restore.properties";
185                         Map<String, Object> serviceReferences = new HashMap<String, Object>();
186
187                 
188                 
189                         serviceReferences.put("org.openecomp.sdnc.config.generator.convert.ConvertNode", new org.openecomp.sdnc.config.generator.convert.ConvertNode());
190
191                         // Register Call graphs
192                         String injectGraphXmls[] = new String[] { getConfigParamsXML };
193
194
195                         GraphKey  graphKey = new GraphKey("APPC", null, "GetConfigParams", null);
196                         DGTestCase tc = new DGTestCase(graphKey);
197                         tc.setInjectGraphXmls(injectGraphXmls);
198                         tc.setServiceReferences(serviceReferences);
199                         tc.setPropertyfileName(propertyfileName);
200                         
201
202                         SvcLogicContext ctx = new SvcLogicContext();
203                         processTestCase(tc, ctx);
204
205                         
206                 } catch (Exception e) {
207                         e.printStackTrace();
208                 }
209         }
210
211
212         @Test
213         public void testGetConfigParamsCommonConfigFail() {
214                 try {
215                         String propertyfileName = "APPC/GetConfigParams/CommonConfigFail.properties";
216                         Map<String, Object> serviceReferences = new HashMap<String, Object>();
217
218                 
219                         serviceReferences.put("org.openecomp.sdnc.config.generator.convert.ConvertNode", new org.openecomp.sdnc.config.generator.convert.ConvertNode());
220
221                         // Register Call graphs
222                         String injectGraphXmls[] = new String[] { getConfigParamsXML };
223
224
225                         GraphKey  graphKey = new GraphKey("APPC", null, "GetConfigParams", null);
226                         DGTestCase tc = new DGTestCase(graphKey);
227                         tc.setInjectGraphXmls(injectGraphXmls);
228                         tc.setServiceReferences(serviceReferences);
229                         tc.setPropertyfileName(propertyfileName);
230                         
231
232                         SvcLogicContext ctx = new SvcLogicContext();
233                         processTestCase(tc, ctx);
234
235
236         
237                         
238                 } catch (Exception e) {
239                         e.printStackTrace();
240                 }
241         }
242
243
244
245         @Test
246         public void testGetConfigParamsJson2DGContextFail() {
247                 try {
248                         String propertyfileName = "APPC/GetConfigParams/Json2DGContextFail.properties";
249                         Map<String, Object> serviceReferences = new HashMap<String, Object>();
250
251                         
252                 
253                         
254                 
255                         // Register Call graphs
256                         String injectGraphXmls[] = new String[] { getConfigParamsXML };
257
258
259                         GraphKey  graphKey = new GraphKey("APPC", null, "GetConfigParams", null);
260                         DGTestCase tc = new DGTestCase(graphKey);
261                         tc.setInjectGraphXmls(injectGraphXmls);
262                         tc.setServiceReferences(serviceReferences);
263                         tc.setPropertyfileName(propertyfileName);
264                         
265
266                         SvcLogicContext ctx = new SvcLogicContext();
267                         processTestCase(tc, ctx);
268
269
270         
271                         
272                 } catch (Exception e) {
273                         e.printStackTrace();
274                 }
275         }
276 */
277 }