2 * ============LICENSE_START=======================================================
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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=========================================================
21 package org.openecomp.appc.dg;
24 import java.util.HashMap;
27 import org.junit.Test;
28 import org.openecomp.appc.dg.mock.instance.MockConfigureNodeExecutor;
29 import org.openecomp.appc.dg.mock.instance.MockSvcLogicJavaPlugin;
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;
36 import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
39 public class TestGetConfigParams /* extends AbstractDGTestCase */ {
44 public static String getConfigParamsXML = "src/main/resources/xml/APPC_GetConfigParams.xml";
49 public void testGetConfigParamsWithDefaultTemplate() {
52 String propertyfileName = "APPC/GetConfigParams/DefaultTemplate.properties";
53 Map<String, Object> serviceReferences = new HashMap<String, Object>();
56 serviceReferences.put("org.openecomp.sdnc.config.generator.convert.ConvertNode", new org.openecomp.sdnc.config.generator.convert.ConvertNode());
58 // Register Call graphs
59 String injectGraphXmls[] = new String[] { getConfigParamsXML };
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);
68 SvcLogicContext ctx = new SvcLogicContext();
69 processTestCase(tc, ctx);
73 } catch (Exception e) {
83 public void testGetConfigParamsWithTemplateName() {
87 String propertyfileName = "APPC/GetConfigParams/TemplateName.properties";
88 Map<String, Object> serviceReferences = new HashMap<String, Object>();
90 serviceReferences.put("org.openecomp.sdnc.config.generator.convert.ConvertNode", new org.openecomp.sdnc.config.generator.convert.ConvertNode());
92 // Register Call graphs
93 String injectGraphXmls[] = new String[] { getConfigParamsXML };
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);
103 SvcLogicContext ctx = new SvcLogicContext();
104 processTestCase(tc, ctx);
109 } catch (Exception e) {
116 public void testGetConfigParamsWithCliString() {
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());
124 // Register Call graphs
125 String injectGraphXmls[] = new String[] { getConfigParamsXML };
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);
135 SvcLogicContext ctx = new SvcLogicContext();
136 processTestCase(tc, ctx);
140 } catch (Exception e) {
146 public void testGetConfigParamsWithCliJson() {
150 String propertyfileName = "APPC/GetConfigParams/CliJson.properties";
151 Map<String, Object> serviceReferences = new HashMap<String, Object>();
155 serviceReferences.put("org.openecomp.sdnc.config.generator.convert.ConvertNode", new org.openecomp.sdnc.config.generator.convert.ConvertNode());
157 // Register Call graphs
158 String injectGraphXmls[] = new String[] { getConfigParamsXML };
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);
168 SvcLogicContext ctx = new SvcLogicContext();
169 processTestCase(tc, ctx);
174 } catch (Exception e) {
182 public void testGetConfigParamsForRestore() {
184 String propertyfileName = "APPC/GetConfigParams/Restore.properties";
185 Map<String, Object> serviceReferences = new HashMap<String, Object>();
189 serviceReferences.put("org.openecomp.sdnc.config.generator.convert.ConvertNode", new org.openecomp.sdnc.config.generator.convert.ConvertNode());
191 // Register Call graphs
192 String injectGraphXmls[] = new String[] { getConfigParamsXML };
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);
202 SvcLogicContext ctx = new SvcLogicContext();
203 processTestCase(tc, ctx);
206 } catch (Exception e) {
213 public void testGetConfigParamsCommonConfigFail() {
215 String propertyfileName = "APPC/GetConfigParams/CommonConfigFail.properties";
216 Map<String, Object> serviceReferences = new HashMap<String, Object>();
219 serviceReferences.put("org.openecomp.sdnc.config.generator.convert.ConvertNode", new org.openecomp.sdnc.config.generator.convert.ConvertNode());
221 // Register Call graphs
222 String injectGraphXmls[] = new String[] { getConfigParamsXML };
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);
232 SvcLogicContext ctx = new SvcLogicContext();
233 processTestCase(tc, ctx);
238 } catch (Exception e) {
246 public void testGetConfigParamsJson2DGContextFail() {
248 String propertyfileName = "APPC/GetConfigParams/Json2DGContextFail.properties";
249 Map<String, Object> serviceReferences = new HashMap<String, Object>();
255 // Register Call graphs
256 String injectGraphXmls[] = new String[] { getConfigParamsXML };
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);
266 SvcLogicContext ctx = new SvcLogicContext();
267 processTestCase(tc, ctx);
272 } catch (Exception e) {