2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017-2018 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 * ============LICENSE_END=========================================================
24 package org.onap.appc.dg;
27 import static org.junit.Assert.*;
29 import java.util.HashMap;
32 import org.junit.Before;
33 import org.junit.Test;
34 import org.mockito.Mockito;
35 import org.onap.appc.dg.mock.instance.MockConfigureNodeExecutor;
36 import org.onap.appc.dg.mock.instance.MockSvcLogicJavaPlugin;
37 import org.osgi.framework.BundleContext;
38 import org.osgi.framework.FrameworkUtil;
39 import org.powermock.api.mockito.PowerMockito;
40 import org.slf4j.Logger;
41 import org.slf4j.LoggerFactory;
43 import com.att.eelf.configuration.EELFLogger;
44 import com.att.eelf.configuration.EELFManager;
45 /* need to move to open source
46 import org.onap.sdnc.dgtestlibrary.AbstractDGTestCase;
47 import org.onap.sdnc.dgtestlibrary.DGTestCase;
48 import org.onap.sdnc.dgtestlibrary.GraphKey;
49 import org.apache.sling.testing.mock.osgi.MockOsgi;
51 import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
54 public class TestSaveRunningConfig /* extends AbstractDGTestCase */{
55 //private final static Logger logger = LoggerFactory.getLogger(TestGetParams.class);
56 private static final EELFLogger logger = EELFManager.getInstance().getLogger(TestSaveRunningConfig.class);
57 public static String SaveRunningConfigXML = "src/main/resources/xml/APPC_SaveRunningConfig.xml";
63 public void testSaveRunningConfigSuccess() {
66 String propertyfileName = "APPC/SaveRunningConfig/SaveRunningConfig_Success.properties";
67 Map<String, Object> serviceReferences = new HashMap<String, Object>();
71 // Register Call graphs
72 String injectGraphXmls[] = new String[] { SaveRunningConfigXML };
75 GraphKey graphKey = new GraphKey("APPC", null, "SaveRunningConfig", null);
76 DGTestCase tc = new DGTestCase(graphKey);
77 tc.setInjectGraphXmls(injectGraphXmls);
78 tc.setServiceReferences(serviceReferences);
79 tc.setPropertyfileName(propertyfileName);
81 SvcLogicContext ctx = new SvcLogicContext();
82 processTestCase(tc, ctx);
85 } catch (Exception e) {
95 public void testSaveRunningConfigFailure() {
98 String propertyfileName = "APPC/SaveRunningConfig/SaveRunningConfig_Failure.properties";
99 Map<String, Object> serviceReferences = new HashMap<String, Object>();
102 // Register Call graphs
103 String injectGraphXmls[] = new String[] { SaveRunningConfigXML };
106 GraphKey graphKey = new GraphKey("APPC", null, "SaveRunningConfig", null);
107 DGTestCase tc = new DGTestCase(graphKey);
108 tc.setInjectGraphXmls(injectGraphXmls);
109 tc.setServiceReferences(serviceReferences);
110 tc.setPropertyfileName(propertyfileName);
112 SvcLogicContext ctx = new SvcLogicContext();
113 processTestCase(tc, ctx);
116 } catch (Exception e) {
123 public void testSaveRunningUploadConfigFailure() {
126 String propertyfileName = "APPC/SaveRunningConfig/UploadConfig_Failure.properties";
127 Map<String, Object> serviceReferences = new HashMap<String, Object>();
130 // Register Call graphs
131 String injectGraphXmls[] = new String[] { SaveRunningConfigXML };
134 GraphKey graphKey = new GraphKey("APPC", null, "SaveRunningConfig", null);
135 DGTestCase tc = new DGTestCase(graphKey);
136 tc.setInjectGraphXmls(injectGraphXmls);
137 tc.setServiceReferences(serviceReferences);
138 tc.setPropertyfileName(propertyfileName);
140 SvcLogicContext ctx = new SvcLogicContext();
141 processTestCase(tc, ctx);
144 } catch (Exception e) {