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.*;
30 import java.util.HashMap;
33 import org.junit.Before;
34 import org.junit.Test;
35 import org.mockito.Mockito;
36 import org.onap.appc.dg.mock.instance.MockConfigureNodeExecutor;
37 import org.onap.appc.dg.mock.instance.MockSvcLogicJavaPlugin;
38 import org.osgi.framework.BundleContext;
39 import org.osgi.framework.FrameworkUtil;
40 import org.powermock.api.mockito.PowerMockito;
41 import org.slf4j.Logger;
42 import org.slf4j.LoggerFactory;
44 import com.att.eelf.configuration.EELFLogger;
45 import com.att.eelf.configuration.EELFManager;
46 /* need to move to open source
47 import com.att.sdnctl.dgtestlibrary.AbstractDGTestCase;
48 import com.att.sdnctl.dgtestlibrary.DGTestCase;
49 import com.att.sdnctl.dgtestlibrary.GraphKey;
50 import org.apache.sling.testing.mock.osgi.MockOsgi;
52 import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
53 import org.onap.ccsdk.sli.core.sli.provider.ExecuteNodeExecutor;
54 import org.onap.ccsdk.sli.core.sli.provider.SvcLogicAdaptorFactory;
57 public class TestGenerateConfig /* extends AbstractDGTestCase */ {
58 private static final EELFLogger logger = EELFManager.getInstance().getLogger(TestGenerateConfig.class);
59 public static String generateConfigXML = "src/main/resources/xml/APPC_GenerateConfig.xml";
64 public void testGenerateConfigWithParameters() {
67 String propertyfileName = "APPC/GenerateConfig/GenerateConfigWithParams.properties";
68 //String generateConfigXML = "src/main/resources/xml/APPC_GenerateConfig.xml";
70 // Register Call graphs
71 String injectGraphXmls[] = new String[] { generateConfigXML };
73 Map<String, Object> serviceReferences = new HashMap<String, Object>();
75 serviceReferences.put("org.onap.sdnc.config.generator.merge.MergeNode", new org.onap.sdnc.config.generator.merge.MergeNode());
76 //serviceReferences.put("com.att.appc.config.generator.node.ConfigResourceNode", new MockConfigResourceNode());
78 serviceReferences.put("org.onap.appc.data.services.node.ConfigResourceNode", new MockSvcLogicJavaPlugin());
81 GraphKey graphKey = new GraphKey("APPC", null, "GenerateConfig", null);
82 DGTestCase tc = new DGTestCase(graphKey);
83 tc.setInjectGraphXmls(injectGraphXmls);
84 tc.setServiceReferences(serviceReferences);
85 tc.setPropertyfileName(propertyfileName);
88 SvcLogicContext ctx = new SvcLogicContext();
89 processTestCase(tc, ctx);
93 } catch (Exception e) {
101 public void testGenerateConfigWithNoParameters() {
104 String propertyfileName = "APPC/GenerateConfig/GenerateConfigNoParams.properties";
105 //String generateConfigXML = "src/main/resources/xml/APPC_GenerateConfig.xml";
107 // Register Call graphs
108 String injectGraphXmls[] = new String[] { generateConfigXML };
110 Map<String, Object> serviceReferences = new HashMap<String, Object>();
112 serviceReferences.put("org.onap.sdnc.config.generator.merge.MergeNode", new org.onap.sdnc.config.generator.merge.MergeNode());
113 //serviceReferences.put("com.att.appc.config.generator.node.ConfigResourceNode", new MockConfigResourceNode());
115 serviceReferences.put("org.onap.appc.data.services.node.ConfigResourceNode", new MockSvcLogicJavaPlugin());
118 GraphKey graphKey = new GraphKey("APPC", null, "GenerateConfig", null);
119 DGTestCase tc = new DGTestCase(graphKey);
120 tc.setInjectGraphXmls(injectGraphXmls);
121 tc.setServiceReferences(serviceReferences);
122 tc.setPropertyfileName(propertyfileName);
125 SvcLogicContext ctx = new SvcLogicContext();
126 processTestCase(tc, ctx);
130 } catch (Exception e) {