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.onap.appc.dg;
24 import java.util.HashMap;
27 import org.junit.Test;
28 import org.onap.appc.dg.mock.instance.MockConfigureNodeExecutor;
29 import org.onap.appc.dg.mock.instance.MockSvcLogicJavaPlugin;
31 import com.att.eelf.configuration.EELFLogger;
32 import com.att.eelf.configuration.EELFManager;
33 /* move to open source
34 import com.att.sdnctl.dgtestlibrary.AbstractDGTestCase;
35 import com.att.sdnctl.dgtestlibrary.DGTestCase;
36 import com.att.sdnctl.dgtestlibrary.GraphKey;
38 import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
41 public class TestProcessParameterDefinition /* extends AbstractDGTestCase */ {
43 private static final EELFLogger logger = EELFManager.getInstance().getLogger(TestProcessParameterDefinition.class);
44 public static String getProcessPDXML = "src/main/resources/xml/APPC_ProcessParameterDefinition.xml";
50 public void testProcessPD() {
54 String propertyfileName = "APPC/ProcessParameterDefinition/ProcessPD.properties";
55 Map<String, Object> serviceReferences = new HashMap<String, Object>();
59 serviceReferences.put("org.openecomp.sdnc.config.params.parser.PropertyDefinitionNode", new org.openecomp.sdnc.config.params.parser.PropertyDefinitionNode());
63 // Register Call graphs
64 String injectGraphXmls[] = new String[] { getProcessPDXML };
67 GraphKey graphKey = new GraphKey("APPC", null, "ProcessParameterDefinition", null);
68 DGTestCase tc = new DGTestCase(graphKey);
69 tc.setInjectGraphXmls(injectGraphXmls);
70 tc.setServiceReferences(serviceReferences);
71 tc.setPropertyfileName(propertyfileName);
74 SvcLogicContext ctx = new SvcLogicContext();
75 processTestCase(tc, ctx);
77 //System.out.println(ctx.getAttribute("tmp.allParams.configuration-parameters"));
78 } catch (Exception e) {
86 public void testGetPDFail() {
90 String propertyfileName = "APPC/ProcessParameterDefinition/GetPDFail.properties";
91 Map<String, Object> serviceReferences = new HashMap<String, Object>();
95 serviceReferences.put("org.openecomp.sdnc.config.params.parser.PropertyDefinitionNode", new org.openecomp.sdnc.config.params.parser.PropertyDefinitionNode());
99 // Register Call graphs
100 String injectGraphXmls[] = new String[] { getProcessPDXML };
103 GraphKey graphKey = new GraphKey("APPC", null, "ProcessParameterDefinition", null);
104 DGTestCase tc = new DGTestCase(graphKey);
105 tc.setInjectGraphXmls(injectGraphXmls);
106 tc.setServiceReferences(serviceReferences);
107 tc.setPropertyfileName(propertyfileName);
110 SvcLogicContext ctx = new SvcLogicContext();
111 processTestCase(tc, ctx);
113 } catch (Exception e) {
119 public void testNoInstarParams() {
123 String propertyfileName = "APPC/ProcessParameterDefinition/NoInstarParams.properties";
124 Map<String, Object> serviceReferences = new HashMap<String, Object>();
128 serviceReferences.put("org.openecomp.sdnc.config.params.parser.PropertyDefinitionNode", new org.openecomp.sdnc.config.params.parser.PropertyDefinitionNode());
132 // Register Call graphs
133 String injectGraphXmls[] = new String[] { getProcessPDXML };
136 GraphKey graphKey = new GraphKey("APPC", null, "ProcessParameterDefinition", null);
137 DGTestCase tc = new DGTestCase(graphKey);
138 tc.setInjectGraphXmls(injectGraphXmls);
139 tc.setServiceReferences(serviceReferences);
140 tc.setPropertyfileName(propertyfileName);
143 SvcLogicContext ctx = new SvcLogicContext();
144 processTestCase(tc, ctx);
146 } catch (Exception e) {
153 public void testGetInstarParamsFail() {
157 String propertyfileName = "APPC/ProcessParameterDefinition/GetInstarParamsFail.properties";
158 Map<String, Object> serviceReferences = new HashMap<String, Object>();
164 // Register Call graphs
165 String injectGraphXmls[] = new String[] { getProcessPDXML };
168 GraphKey graphKey = new GraphKey("APPC", null, "ProcessParameterDefinition", null);
169 DGTestCase tc = new DGTestCase(graphKey);
170 tc.setInjectGraphXmls(injectGraphXmls);
171 tc.setServiceReferences(serviceReferences);
172 tc.setPropertyfileName(propertyfileName);
175 SvcLogicContext ctx = new SvcLogicContext();
176 processTestCase(tc, ctx);
178 } catch (Exception e) {
185 public void testMergeParamsFail() {
189 String propertyfileName = "APPC/ProcessParameterDefinition/MergeParamsFail.properties";
190 Map<String, Object> serviceReferences = new HashMap<String, Object>();
196 // Register Call graphs
197 String injectGraphXmls[] = new String[] { getProcessPDXML };
200 GraphKey graphKey = new GraphKey("APPC", null, "ProcessParameterDefinition", null);
201 DGTestCase tc = new DGTestCase(graphKey);
202 tc.setInjectGraphXmls(injectGraphXmls);
203 tc.setServiceReferences(serviceReferences);
204 tc.setPropertyfileName(propertyfileName);
207 SvcLogicContext ctx = new SvcLogicContext();
208 processTestCase(tc, ctx);
210 } catch (Exception e) {
217 public void testSaveMdSal() {
221 String propertyfileName = "APPC/ProcessParameterDefinition/SaveMdsalFail.properties";
222 Map<String, Object> serviceReferences = new HashMap<String, Object>();
226 serviceReferences.put("org.openecomp.sdnc.config.params.parser.PropertyDefinitionNode", new org.openecomp.sdnc.config.params.parser.PropertyDefinitionNode());
230 // Register Call graphs
231 String injectGraphXmls[] = new String[] { getProcessPDXML };
234 GraphKey graphKey = new GraphKey("APPC", null, "ProcessParameterDefinition", null);
235 DGTestCase tc = new DGTestCase(graphKey);
236 tc.setInjectGraphXmls(injectGraphXmls);
237 tc.setServiceReferences(serviceReferences);
238 tc.setPropertyfileName(propertyfileName);
241 SvcLogicContext ctx = new SvcLogicContext();
242 processTestCase(tc, ctx);
244 //System.out.println(ctx.getAttribute("tmp.allParams.configuration-parameters"));
245 } catch (Exception e) {