2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Copyright (C) 2017 Amdocs
8 * =============================================================================
9 * Licensed under the Apache License, Version 2.0 (the "License");
10 * you may not use this file except in compliance with the License.
11 * You may obtain a copy of the License at
13 * http://www.apache.org/licenses/LICENSE-2.0
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
21 * ECOMP is a trademark and service mark of AT&T Intellectual Property.
22 * ============LICENSE_END=========================================================
25 package org.onap.appc.dg;
28 import java.util.HashMap;
31 import org.junit.Test;
32 import org.onap.appc.dg.mock.instance.MockConfigureNodeExecutor;
33 import org.onap.appc.dg.mock.instance.MockSvcLogicJavaPlugin;
35 /* move to open source
36 import org.onap.sdnc.dgtestlibrary.AbstractDGTestCase;
37 import org.onap.sdnc.dgtestlibrary.DGTestCase;
38 import org.onap.sdnc.dgtestlibrary.GraphKey;
40 import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
43 public class TestGetConfigParams /* extends AbstractDGTestCase */ {
48 public static String getConfigParamsXML = "src/main/resources/xml/APPC_GetConfigParams.xml";
53 public void testGetConfigParamsWithDefaultTemplate() {
56 String propertyfileName = "APPC/GetConfigParams/DefaultTemplate.properties";
57 Map<String, Object> serviceReferences = new HashMap<String, Object>();
60 serviceReferences.put("org.onap.sdnc.config.generator.convert.ConvertNode", new org.onap.sdnc.config.generator.convert.ConvertNode());
62 // Register Call graphs
63 String injectGraphXmls[] = new String[] { getConfigParamsXML };
66 GraphKey graphKey = new GraphKey("APPC", null, "GetConfigParams", null);
67 DGTestCase tc = new DGTestCase(graphKey);
68 tc.setInjectGraphXmls(injectGraphXmls);
69 tc.setServiceReferences(serviceReferences);
70 tc.setPropertyfileName(propertyfileName);
72 SvcLogicContext ctx = new SvcLogicContext();
73 processTestCase(tc, ctx);
77 } catch (Exception e) {
87 public void testGetConfigParamsWithTemplateName() {
91 String propertyfileName = "APPC/GetConfigParams/TemplateName.properties";
92 Map<String, Object> serviceReferences = new HashMap<String, Object>();
94 serviceReferences.put("org.onap.sdnc.config.generator.convert.ConvertNode", new org.onap.sdnc.config.generator.convert.ConvertNode());
96 // Register Call graphs
97 String injectGraphXmls[] = new String[] { getConfigParamsXML };
100 GraphKey graphKey = new GraphKey("APPC", null, "GetConfigParams", null);
101 DGTestCase tc = new DGTestCase(graphKey);
102 tc.setInjectGraphXmls(injectGraphXmls);
103 tc.setServiceReferences(serviceReferences);
104 tc.setPropertyfileName(propertyfileName);
107 SvcLogicContext ctx = new SvcLogicContext();
108 processTestCase(tc, ctx);
113 } catch (Exception e) {
120 public void testGetConfigParamsWithCliString() {
123 String propertyfileName = "APPC/GetConfigParams/CliString.properties";
124 Map<String, Object> serviceReferences = new HashMap<String, Object>();
125 serviceReferences.put("org.onap.sdnc.config.generator.convert.ConvertNode", new org.onap.sdnc.config.generator.convert.ConvertNode());
128 // Register Call graphs
129 String injectGraphXmls[] = new String[] { getConfigParamsXML };
132 GraphKey graphKey = new GraphKey("APPC", null, "GetConfigParams", null);
133 DGTestCase tc = new DGTestCase(graphKey);
134 tc.setInjectGraphXmls(injectGraphXmls);
135 tc.setServiceReferences(serviceReferences);
136 tc.setPropertyfileName(propertyfileName);
139 SvcLogicContext ctx = new SvcLogicContext();
140 processTestCase(tc, ctx);
144 } catch (Exception e) {
150 public void testGetConfigParamsWithCliJson() {
154 String propertyfileName = "APPC/GetConfigParams/CliJson.properties";
155 Map<String, Object> serviceReferences = new HashMap<String, Object>();
159 serviceReferences.put("org.onap.sdnc.config.generator.convert.ConvertNode", new org.onap.sdnc.config.generator.convert.ConvertNode());
161 // Register Call graphs
162 String injectGraphXmls[] = new String[] { getConfigParamsXML };
165 GraphKey graphKey = new GraphKey("APPC", null, "GetConfigParams", null);
166 DGTestCase tc = new DGTestCase(graphKey);
167 tc.setInjectGraphXmls(injectGraphXmls);
168 tc.setServiceReferences(serviceReferences);
169 tc.setPropertyfileName(propertyfileName);
172 SvcLogicContext ctx = new SvcLogicContext();
173 processTestCase(tc, ctx);
178 } catch (Exception e) {
186 public void testGetConfigParamsForRestore() {
188 String propertyfileName = "APPC/GetConfigParams/Restore.properties";
189 Map<String, Object> serviceReferences = new HashMap<String, Object>();
193 serviceReferences.put("org.onap.sdnc.config.generator.convert.ConvertNode", new org.onap.sdnc.config.generator.convert.ConvertNode());
195 // Register Call graphs
196 String injectGraphXmls[] = new String[] { getConfigParamsXML };
199 GraphKey graphKey = new GraphKey("APPC", null, "GetConfigParams", null);
200 DGTestCase tc = new DGTestCase(graphKey);
201 tc.setInjectGraphXmls(injectGraphXmls);
202 tc.setServiceReferences(serviceReferences);
203 tc.setPropertyfileName(propertyfileName);
206 SvcLogicContext ctx = new SvcLogicContext();
207 processTestCase(tc, ctx);
210 } catch (Exception e) {
217 public void testGetConfigParamsCommonConfigFail() {
219 String propertyfileName = "APPC/GetConfigParams/CommonConfigFail.properties";
220 Map<String, Object> serviceReferences = new HashMap<String, Object>();
223 serviceReferences.put("org.onap.sdnc.config.generator.convert.ConvertNode", new org.onap.sdnc.config.generator.convert.ConvertNode());
225 // Register Call graphs
226 String injectGraphXmls[] = new String[] { getConfigParamsXML };
229 GraphKey graphKey = new GraphKey("APPC", null, "GetConfigParams", null);
230 DGTestCase tc = new DGTestCase(graphKey);
231 tc.setInjectGraphXmls(injectGraphXmls);
232 tc.setServiceReferences(serviceReferences);
233 tc.setPropertyfileName(propertyfileName);
236 SvcLogicContext ctx = new SvcLogicContext();
237 processTestCase(tc, ctx);
242 } catch (Exception e) {
250 public void testGetConfigParamsJson2DGContextFail() {
252 String propertyfileName = "APPC/GetConfigParams/Json2DGContextFail.properties";
253 Map<String, Object> serviceReferences = new HashMap<String, Object>();
259 // Register Call graphs
260 String injectGraphXmls[] = new String[] { getConfigParamsXML };
263 GraphKey graphKey = new GraphKey("APPC", null, "GetConfigParams", null);
264 DGTestCase tc = new DGTestCase(graphKey);
265 tc.setInjectGraphXmls(injectGraphXmls);
266 tc.setServiceReferences(serviceReferences);
267 tc.setPropertyfileName(propertyfileName);
270 SvcLogicContext ctx = new SvcLogicContext();
271 processTestCase(tc, ctx);
276 } catch (Exception e) {