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 /* need to 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;
37 import com.att.eelf.configuration.EELFLogger;
38 import com.att.eelf.configuration.EELFManager;
40 public class TestConfigure /* extends AbstractDGTestCase */ {
41 private static final EELFLogger logger = EELFManager.getInstance().getLogger(TestConfigure.class);
42 public static String ConfigureXML = "src/main/resources/xml/APPC_Configure.xml";
46 public void testTemplateConfigureSuccess() {
49 String propertyfileName = "APPC/Configure/Configure_Success.properties";
51 // Register Call graphs
52 String injectGraphXmls[] = new String[] { ConfigureXML };
54 Map<String, Object> serviceReferences = new HashMap<String, Object>();
58 GraphKey graphKey = new GraphKey("APPC", null, "Configure", null);
59 DGTestCase tc = new DGTestCase(graphKey);
62 tc.setInjectGraphXmls(injectGraphXmls);
63 tc.setServiceReferences(serviceReferences);
64 tc.setPropertyfileName(propertyfileName);
68 SvcLogicContext ctx = new SvcLogicContext();
69 processTestCase(tc, ctx);
74 } catch (Exception e) {
81 public void testTemplateConfigureFailure() {
84 String propertyfileName = "APPC/Configure/Configure_Failure.properties";
86 // Register Call graphs
87 String injectGraphXmls[] = new String[] { ConfigureXML };
89 Map<String, Object> serviceReferences = new HashMap<String, Object>();
93 GraphKey graphKey = new GraphKey("APPC", null, "Configure", null);
94 DGTestCase tc = new DGTestCase(graphKey);
97 tc.setInjectGraphXmls(injectGraphXmls);
98 tc.setServiceReferences(serviceReferences);
99 tc.setPropertyfileName(propertyfileName);
103 SvcLogicContext ctx = new SvcLogicContext();
104 processTestCase(tc, ctx);
109 } catch (Exception e) {
116 public void testGetTemplateFailure() {
119 String propertyfileName = "APPC/Configure/GetTemplate_Failure.properties";
121 // Register Call graphs
122 String injectGraphXmls[] = new String[] { ConfigureXML };
124 Map<String, Object> serviceReferences = new HashMap<String, Object>();
128 GraphKey graphKey = new GraphKey("APPC", null, "Configure", null);
129 DGTestCase tc = new DGTestCase(graphKey);
132 tc.setInjectGraphXmls(injectGraphXmls);
133 tc.setServiceReferences(serviceReferences);
134 tc.setPropertyfileName(propertyfileName);
138 SvcLogicContext ctx = new SvcLogicContext();
139 processTestCase(tc, ctx);
144 } catch (Exception e) {
152 public void testGenerateTemplateConfigFailure() {
155 String propertyfileName = "APPC/Configure/GenerateTemplateConfig_Failure.properties";
157 // Register Call graphs
158 String injectGraphXmls[] = new String[] { ConfigureXML };
160 Map<String, Object> serviceReferences = new HashMap<String, Object>();
163 GraphKey graphKey = new GraphKey("APPC", null, "Configure", null);
164 DGTestCase tc = new DGTestCase(graphKey);
167 tc.setInjectGraphXmls(injectGraphXmls);
168 tc.setServiceReferences(serviceReferences);
169 tc.setPropertyfileName(propertyfileName);
173 SvcLogicContext ctx = new SvcLogicContext();
174 processTestCase(tc, ctx);
179 } catch (Exception e) {
185 public void testConfigBlockConfigureSuccess() {
188 String propertyfileName = "APPC/Configure/ConfigBlockConfigure_Success.properties";
190 // Register Call graphs
191 String injectGraphXmls[] = new String[] { ConfigureXML };
193 Map<String, Object> serviceReferences = new HashMap<String, Object>();
196 GraphKey graphKey = new GraphKey("APPC", null, "Configure", null);
197 DGTestCase tc = new DGTestCase(graphKey);
200 tc.setInjectGraphXmls(injectGraphXmls);
201 tc.setServiceReferences(serviceReferences);
202 tc.setPropertyfileName(propertyfileName);
206 SvcLogicContext ctx = new SvcLogicContext();
207 processTestCase(tc, ctx);
212 } catch (Exception e) {
218 public void testConfigBlockConfigureFailure() {
221 String propertyfileName = "APPC/Configure/ConfigBlockConfigure_Failure.properties";
223 // Register Call graphs
224 String injectGraphXmls[] = new String[] { ConfigureXML };
226 Map<String, Object> serviceReferences = new HashMap<String, Object>();
229 GraphKey graphKey = new GraphKey("APPC", null, "Configure", null);
230 DGTestCase tc = new DGTestCase(graphKey);
233 tc.setInjectGraphXmls(injectGraphXmls);
234 tc.setServiceReferences(serviceReferences);
235 tc.setPropertyfileName(propertyfileName);
239 SvcLogicContext ctx = new SvcLogicContext();
240 processTestCase(tc, ctx);
245 } catch (Exception e) {
252 public void testGenerateConfigFailure() {
255 String propertyfileName = "APPC/Configure/GenerateConfig_Failure.properties";
257 // Register Call graphs
258 String injectGraphXmls[] = new String[] { ConfigureXML };
260 Map<String, Object> serviceReferences = new HashMap<String, Object>();
264 GraphKey graphKey = new GraphKey("APPC", null, "Configure", null);
265 DGTestCase tc = new DGTestCase(graphKey);
268 tc.setInjectGraphXmls(injectGraphXmls);
269 tc.setServiceReferences(serviceReferences);
270 tc.setPropertyfileName(propertyfileName);
274 SvcLogicContext ctx = new SvcLogicContext();
275 processTestCase(tc, ctx);
280 } catch (Exception e) {