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 static org.junit.Assert.assertNotNull;
26 import org.junit.Test;
28 import com.att.eelf.configuration.EELFLogger;
29 import com.att.eelf.configuration.EELFManager;
30 /* need to move to open source
31 import com.att.sdnctl.dgtestlibrary.AbstractDGTestCase;
32 import com.att.sdnctl.dgtestlibrary.DGTestCase;
33 import com.att.sdnctl.dgtestlibrary.GraphKey;
35 import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
37 public class TestGetDeviceRunningConfig /* extends AbstractDGTestCase */ {
38 private static final EELFLogger logger = EELFManager.getInstance().getLogger(TestGetConfigParams.class);
40 public String jsonPath = "src/main/resources/json";
41 public String xmlpath = "src/main/resources/xml";
44 public void testChefRunningConfigSuccess() {
46 logger.info("********************************* testChefRunningConfigSuccess *************************************");
47 //DGMockUtils.generateXMLFile(jsonPath, xmlpath);
49 String propertyfileName = "APPC/GetDeviceRunningConfig/Chef_Success.properties";
51 String getDeviceRunningConfigXML = "src/main/resources/xml/APPC_GetDeviceRunningConfig.xml";
52 // Register Call graphs
53 String injectGraphXmls[] = new String[] { getDeviceRunningConfigXML };
56 GraphKey graphKey = new GraphKey("APPC", null, "GetDeviceRunningConfig", null);
57 DGTestCase tc = new DGTestCase(graphKey);
58 tc.setInjectGraphXmls(injectGraphXmls);
59 tc.setPropertyfileName(propertyfileName);
61 SvcLogicContext ctx = new SvcLogicContext();
62 processTestCase(tc, ctx);
64 assertContextWithProperty(ctx);
67 } catch (Exception e) {
73 public void testChefRunningConfigFailure() {
76 logger.info("********************************* testChefRunningConfigFailure *************************************");
77 String propertyfileName = "APPC/GetDeviceRunningConfig/Chef_Failure.properties";
79 String getDeviceRunningConfigXML = "src/main/resources/xml/APPC_GetDeviceRunningConfig.xml";
80 // Register Call graphs
81 String injectGraphXmls[] = new String[] { getDeviceRunningConfigXML };
84 GraphKey graphKey = new GraphKey("APPC", null, "GetDeviceRunningConfig", null);
85 DGTestCase tc = new DGTestCase(graphKey);
86 tc.setInjectGraphXmls(injectGraphXmls);
87 tc.setPropertyfileName(propertyfileName);
90 SvcLogicContext ctx = new SvcLogicContext();
91 processTestCase(tc, ctx);
93 assertContextWithProperty(ctx);
95 //DGMockUtils.printContext(ctx);
97 } catch (Exception e) {
103 public void testChefRunningConfigOthers() {
105 logger.info("********************************* testChefRunningConfigOthers *************************************");
106 String propertyfileName = "APPC/GetDeviceRunningConfig/Chef_Others.properties";
108 String getDeviceRunningConfigXML = "src/main/resources/xml/APPC_GetDeviceRunningConfig.xml";
109 // Register Call graphs
110 String injectGraphXmls[] = new String[] { getDeviceRunningConfigXML };
113 GraphKey graphKey = new GraphKey("APPC", null, "GetDeviceRunningConfig", null);
114 DGTestCase tc = new DGTestCase(graphKey);
115 tc.setInjectGraphXmls(injectGraphXmls);
116 tc.setPropertyfileName(propertyfileName);
119 SvcLogicContext ctx = new SvcLogicContext();
120 processTestCase(tc, ctx);
122 assertContextWithProperty(ctx);
124 //DGMockUtils.printContext(ctx);
126 } catch (Exception e) {