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 static org.junit.Assert.assertNotNull;
30 import org.junit.Test;
32 import com.att.eelf.configuration.EELFLogger;
33 import com.att.eelf.configuration.EELFManager;
34 /* need to move to open source
35 import org.onap.sdnc.dgtestlibrary.AbstractDGTestCase;
36 import org.onap.sdnc.dgtestlibrary.DGTestCase;
37 import org.onap.sdnc.dgtestlibrary.GraphKey;
39 import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
41 public class TestGetDeviceRunningConfig /* extends AbstractDGTestCase */ {
42 private static final EELFLogger logger = EELFManager.getInstance().getLogger(TestGetConfigParams.class);
44 public String jsonPath = "src/main/resources/json";
45 public String xmlpath = "src/main/resources/xml";
48 public void testChefRunningConfigSuccess() {
50 logger.info("********************************* testChefRunningConfigSuccess *************************************");
51 //DGMockUtils.generateXMLFile(jsonPath, xmlpath);
53 String propertyfileName = "APPC/GetDeviceRunningConfig/Chef_Success.properties";
55 String getDeviceRunningConfigXML = "src/main/resources/xml/APPC_GetDeviceRunningConfig.xml";
56 // Register Call graphs
57 String injectGraphXmls[] = new String[] { getDeviceRunningConfigXML };
60 GraphKey graphKey = new GraphKey("APPC", null, "GetDeviceRunningConfig", null);
61 DGTestCase tc = new DGTestCase(graphKey);
62 tc.setInjectGraphXmls(injectGraphXmls);
63 tc.setPropertyfileName(propertyfileName);
65 SvcLogicContext ctx = new SvcLogicContext();
66 processTestCase(tc, ctx);
68 assertContextWithProperty(ctx);
71 } catch (Exception e) {
77 public void testChefRunningConfigFailure() {
80 logger.info("********************************* testChefRunningConfigFailure *************************************");
81 String propertyfileName = "APPC/GetDeviceRunningConfig/Chef_Failure.properties";
83 String getDeviceRunningConfigXML = "src/main/resources/xml/APPC_GetDeviceRunningConfig.xml";
84 // Register Call graphs
85 String injectGraphXmls[] = new String[] { getDeviceRunningConfigXML };
88 GraphKey graphKey = new GraphKey("APPC", null, "GetDeviceRunningConfig", null);
89 DGTestCase tc = new DGTestCase(graphKey);
90 tc.setInjectGraphXmls(injectGraphXmls);
91 tc.setPropertyfileName(propertyfileName);
94 SvcLogicContext ctx = new SvcLogicContext();
95 processTestCase(tc, ctx);
97 assertContextWithProperty(ctx);
99 //DGMockUtils.printContext(ctx);
101 } catch (Exception e) {
107 public void testChefRunningConfigOthers() {
109 logger.info("********************************* testChefRunningConfigOthers *************************************");
110 String propertyfileName = "APPC/GetDeviceRunningConfig/Chef_Others.properties";
112 String getDeviceRunningConfigXML = "src/main/resources/xml/APPC_GetDeviceRunningConfig.xml";
113 // Register Call graphs
114 String injectGraphXmls[] = new String[] { getDeviceRunningConfigXML };
117 GraphKey graphKey = new GraphKey("APPC", null, "GetDeviceRunningConfig", null);
118 DGTestCase tc = new DGTestCase(graphKey);
119 tc.setInjectGraphXmls(injectGraphXmls);
120 tc.setPropertyfileName(propertyfileName);
123 SvcLogicContext ctx = new SvcLogicContext();
124 processTestCase(tc, ctx);
126 assertContextWithProperty(ctx);
128 //DGMockUtils.printContext(ctx);
130 } catch (Exception e) {