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 import com.att.eelf.configuration.EELFLogger;
36 import com.att.eelf.configuration.EELFManager;
37 /* move to open source
38 import org.onap.sdnc.dgtestlibrary.AbstractDGTestCase;
39 import org.onap.sdnc.dgtestlibrary.DGTestCase;
40 import org.onap.sdnc.dgtestlibrary.GraphKey;
42 import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
45 public class TestProcessParameterDefinition /* extends AbstractDGTestCase */ {
47 private static final EELFLogger logger = EELFManager.getInstance().getLogger(TestProcessParameterDefinition.class);
48 public static String getProcessPDXML = "src/main/resources/xml/APPC_ProcessParameterDefinition.xml";
54 public void testProcessPD() {
58 String propertyfileName = "APPC/ProcessParameterDefinition/ProcessPD.properties";
59 Map<String, Object> serviceReferences = new HashMap<String, Object>();
63 serviceReferences.put("org.onap.sdnc.config.params.parser.PropertyDefinitionNode", new org.onap.sdnc.config.params.parser.PropertyDefinitionNode());
67 // Register Call graphs
68 String injectGraphXmls[] = new String[] { getProcessPDXML };
71 GraphKey graphKey = new GraphKey("APPC", null, "ProcessParameterDefinition", null);
72 DGTestCase tc = new DGTestCase(graphKey);
73 tc.setInjectGraphXmls(injectGraphXmls);
74 tc.setServiceReferences(serviceReferences);
75 tc.setPropertyfileName(propertyfileName);
78 SvcLogicContext ctx = new SvcLogicContext();
79 processTestCase(tc, ctx);
81 //System.out.println(ctx.getAttribute("tmp.allParams.configuration-parameters"));
82 } catch (Exception e) {
90 public void testGetPDFail() {
94 String propertyfileName = "APPC/ProcessParameterDefinition/GetPDFail.properties";
95 Map<String, Object> serviceReferences = new HashMap<String, Object>();
99 serviceReferences.put("org.onap.sdnc.config.params.parser.PropertyDefinitionNode", new org.onap.sdnc.config.params.parser.PropertyDefinitionNode());
103 // Register Call graphs
104 String injectGraphXmls[] = new String[] { getProcessPDXML };
107 GraphKey graphKey = new GraphKey("APPC", null, "ProcessParameterDefinition", null);
108 DGTestCase tc = new DGTestCase(graphKey);
109 tc.setInjectGraphXmls(injectGraphXmls);
110 tc.setServiceReferences(serviceReferences);
111 tc.setPropertyfileName(propertyfileName);
114 SvcLogicContext ctx = new SvcLogicContext();
115 processTestCase(tc, ctx);
117 } catch (Exception e) {
123 public void testNoInstarParams() {
127 String propertyfileName = "APPC/ProcessParameterDefinition/NoInstarParams.properties";
128 Map<String, Object> serviceReferences = new HashMap<String, Object>();
132 serviceReferences.put("org.onap.sdnc.config.params.parser.PropertyDefinitionNode", new org.onap.sdnc.config.params.parser.PropertyDefinitionNode());
136 // Register Call graphs
137 String injectGraphXmls[] = new String[] { getProcessPDXML };
140 GraphKey graphKey = new GraphKey("APPC", null, "ProcessParameterDefinition", null);
141 DGTestCase tc = new DGTestCase(graphKey);
142 tc.setInjectGraphXmls(injectGraphXmls);
143 tc.setServiceReferences(serviceReferences);
144 tc.setPropertyfileName(propertyfileName);
147 SvcLogicContext ctx = new SvcLogicContext();
148 processTestCase(tc, ctx);
150 } catch (Exception e) {
157 public void testGetInstarParamsFail() {
161 String propertyfileName = "APPC/ProcessParameterDefinition/GetInstarParamsFail.properties";
162 Map<String, Object> serviceReferences = new HashMap<String, Object>();
168 // Register Call graphs
169 String injectGraphXmls[] = new String[] { getProcessPDXML };
172 GraphKey graphKey = new GraphKey("APPC", null, "ProcessParameterDefinition", null);
173 DGTestCase tc = new DGTestCase(graphKey);
174 tc.setInjectGraphXmls(injectGraphXmls);
175 tc.setServiceReferences(serviceReferences);
176 tc.setPropertyfileName(propertyfileName);
179 SvcLogicContext ctx = new SvcLogicContext();
180 processTestCase(tc, ctx);
182 } catch (Exception e) {
189 public void testMergeParamsFail() {
193 String propertyfileName = "APPC/ProcessParameterDefinition/MergeParamsFail.properties";
194 Map<String, Object> serviceReferences = new HashMap<String, Object>();
200 // Register Call graphs
201 String injectGraphXmls[] = new String[] { getProcessPDXML };
204 GraphKey graphKey = new GraphKey("APPC", null, "ProcessParameterDefinition", null);
205 DGTestCase tc = new DGTestCase(graphKey);
206 tc.setInjectGraphXmls(injectGraphXmls);
207 tc.setServiceReferences(serviceReferences);
208 tc.setPropertyfileName(propertyfileName);
211 SvcLogicContext ctx = new SvcLogicContext();
212 processTestCase(tc, ctx);
214 } catch (Exception e) {
221 public void testSaveMdSal() {
225 String propertyfileName = "APPC/ProcessParameterDefinition/SaveMdsalFail.properties";
226 Map<String, Object> serviceReferences = new HashMap<String, Object>();
230 serviceReferences.put("org.onap.sdnc.config.params.parser.PropertyDefinitionNode", new org.onap.sdnc.config.params.parser.PropertyDefinitionNode());
234 // Register Call graphs
235 String injectGraphXmls[] = new String[] { getProcessPDXML };
238 GraphKey graphKey = new GraphKey("APPC", null, "ProcessParameterDefinition", null);
239 DGTestCase tc = new DGTestCase(graphKey);
240 tc.setInjectGraphXmls(injectGraphXmls);
241 tc.setServiceReferences(serviceReferences);
242 tc.setPropertyfileName(propertyfileName);
245 SvcLogicContext ctx = new SvcLogicContext();
246 processTestCase(tc, ctx);
248 //System.out.println(ctx.getAttribute("tmp.allParams.configuration-parameters"));
249 } catch (Exception e) {