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 /* need to move to open source
36 import com.att.sdnctl.dgtestlibrary.AbstractDGTestCase;
37 import com.att.sdnctl.dgtestlibrary.DGTestCase;
38 import com.att.sdnctl.dgtestlibrary.GraphKey;
40 import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
41 import com.att.eelf.configuration.EELFLogger;
42 import com.att.eelf.configuration.EELFManager;
44 public class TestConfigure /* extends AbstractDGTestCase */ {
45 private static final EELFLogger logger = EELFManager.getInstance().getLogger(TestConfigure.class);
46 public static String ConfigureXML = "src/main/resources/xml/APPC_Configure.xml";
50 public void testTemplateConfigureSuccess() {
53 String propertyfileName = "APPC/Configure/Configure_Success.properties";
55 // Register Call graphs
56 String injectGraphXmls[] = new String[] { ConfigureXML };
58 Map<String, Object> serviceReferences = new HashMap<String, Object>();
62 GraphKey graphKey = new GraphKey("APPC", null, "Configure", null);
63 DGTestCase tc = new DGTestCase(graphKey);
66 tc.setInjectGraphXmls(injectGraphXmls);
67 tc.setServiceReferences(serviceReferences);
68 tc.setPropertyfileName(propertyfileName);
72 SvcLogicContext ctx = new SvcLogicContext();
73 processTestCase(tc, ctx);
78 } catch (Exception e) {
85 public void testTemplateConfigureFailure() {
88 String propertyfileName = "APPC/Configure/Configure_Failure.properties";
90 // Register Call graphs
91 String injectGraphXmls[] = new String[] { ConfigureXML };
93 Map<String, Object> serviceReferences = new HashMap<String, Object>();
97 GraphKey graphKey = new GraphKey("APPC", null, "Configure", null);
98 DGTestCase tc = new DGTestCase(graphKey);
101 tc.setInjectGraphXmls(injectGraphXmls);
102 tc.setServiceReferences(serviceReferences);
103 tc.setPropertyfileName(propertyfileName);
107 SvcLogicContext ctx = new SvcLogicContext();
108 processTestCase(tc, ctx);
113 } catch (Exception e) {
120 public void testGetTemplateFailure() {
123 String propertyfileName = "APPC/Configure/GetTemplate_Failure.properties";
125 // Register Call graphs
126 String injectGraphXmls[] = new String[] { ConfigureXML };
128 Map<String, Object> serviceReferences = new HashMap<String, Object>();
132 GraphKey graphKey = new GraphKey("APPC", null, "Configure", null);
133 DGTestCase tc = new DGTestCase(graphKey);
136 tc.setInjectGraphXmls(injectGraphXmls);
137 tc.setServiceReferences(serviceReferences);
138 tc.setPropertyfileName(propertyfileName);
142 SvcLogicContext ctx = new SvcLogicContext();
143 processTestCase(tc, ctx);
148 } catch (Exception e) {
156 public void testGenerateTemplateConfigFailure() {
159 String propertyfileName = "APPC/Configure/GenerateTemplateConfig_Failure.properties";
161 // Register Call graphs
162 String injectGraphXmls[] = new String[] { ConfigureXML };
164 Map<String, Object> serviceReferences = new HashMap<String, Object>();
167 GraphKey graphKey = new GraphKey("APPC", null, "Configure", null);
168 DGTestCase tc = new DGTestCase(graphKey);
171 tc.setInjectGraphXmls(injectGraphXmls);
172 tc.setServiceReferences(serviceReferences);
173 tc.setPropertyfileName(propertyfileName);
177 SvcLogicContext ctx = new SvcLogicContext();
178 processTestCase(tc, ctx);
183 } catch (Exception e) {
189 public void testConfigBlockConfigureSuccess() {
192 String propertyfileName = "APPC/Configure/ConfigBlockConfigure_Success.properties";
194 // Register Call graphs
195 String injectGraphXmls[] = new String[] { ConfigureXML };
197 Map<String, Object> serviceReferences = new HashMap<String, Object>();
200 GraphKey graphKey = new GraphKey("APPC", null, "Configure", null);
201 DGTestCase tc = new DGTestCase(graphKey);
204 tc.setInjectGraphXmls(injectGraphXmls);
205 tc.setServiceReferences(serviceReferences);
206 tc.setPropertyfileName(propertyfileName);
210 SvcLogicContext ctx = new SvcLogicContext();
211 processTestCase(tc, ctx);
216 } catch (Exception e) {
222 public void testConfigBlockConfigureFailure() {
225 String propertyfileName = "APPC/Configure/ConfigBlockConfigure_Failure.properties";
227 // Register Call graphs
228 String injectGraphXmls[] = new String[] { ConfigureXML };
230 Map<String, Object> serviceReferences = new HashMap<String, Object>();
233 GraphKey graphKey = new GraphKey("APPC", null, "Configure", null);
234 DGTestCase tc = new DGTestCase(graphKey);
237 tc.setInjectGraphXmls(injectGraphXmls);
238 tc.setServiceReferences(serviceReferences);
239 tc.setPropertyfileName(propertyfileName);
243 SvcLogicContext ctx = new SvcLogicContext();
244 processTestCase(tc, ctx);
249 } catch (Exception e) {
256 public void testGenerateConfigFailure() {
259 String propertyfileName = "APPC/Configure/GenerateConfig_Failure.properties";
261 // Register Call graphs
262 String injectGraphXmls[] = new String[] { ConfigureXML };
264 Map<String, Object> serviceReferences = new HashMap<String, Object>();
268 GraphKey graphKey = new GraphKey("APPC", null, "Configure", null);
269 DGTestCase tc = new DGTestCase(graphKey);
272 tc.setInjectGraphXmls(injectGraphXmls);
273 tc.setServiceReferences(serviceReferences);
274 tc.setPropertyfileName(propertyfileName);
278 SvcLogicContext ctx = new SvcLogicContext();
279 processTestCase(tc, ctx);
284 } catch (Exception e) {