8670b9445edc0e17801762ede3a5379d3b64d224
[appc.git] / appc-directed-graph / appc-dgraph / provider / src / test / java / org / onap / appc / dg / TestGenerateConfig.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * ONAP : APPC
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
12  * 
13  *      http://www.apache.org/licenses/LICENSE-2.0
14  * 
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.
20  * 
21  * ============LICENSE_END=========================================================
22  */
23
24 package org.onap.appc.dg;
25
26
27 import static org.junit.Assert.*;
28
29 import java.util.HashMap;
30 import java.util.Map;
31
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;
42
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;
50 */
51 import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
52 import org.onap.ccsdk.sli.core.sli.provider.SvcLogicAdaptorFactory;
53
54
55 public class TestGenerateConfig /* extends AbstractDGTestCase */ {
56     private static final EELFLogger logger = EELFManager.getInstance().getLogger(TestGenerateConfig.class);
57     public static String generateConfigXML = "src/main/resources/xml/APPC_GenerateConfig.xml";
58
59 /*
60
61     @Test
62     public void testGenerateConfigWithParameters() {
63         try {
64
65             String propertyfileName = "APPC/GenerateConfig/GenerateConfigWithParams.properties";
66             //String generateConfigXML = "src/main/resources/xml/APPC_GenerateConfig.xml";
67
68             // Register Call graphs
69             String injectGraphXmls[] = new String[] { generateConfigXML };
70
71             Map<String, Object> serviceReferences = new HashMap<String, Object>();
72
73             serviceReferences.put("org.onap.sdnc.config.generator.merge.MergeNode", new org.onap.sdnc.config.generator.merge.MergeNode());
74             //serviceReferences.put("org.onap.appc.config.generator.node.ConfigResourceNode", new MockConfigResourceNode());
75
76             serviceReferences.put("org.onap.appc.data.services.node.ConfigResourceNode", new MockSvcLogicJavaPlugin());
77
78
79             GraphKey  graphKey = new GraphKey("APPC", null, "GenerateConfig", null);
80             DGTestCase tc = new DGTestCase(graphKey);
81             tc.setInjectGraphXmls(injectGraphXmls);
82             tc.setServiceReferences(serviceReferences);
83             tc.setPropertyfileName(propertyfileName);
84
85
86             SvcLogicContext ctx = new SvcLogicContext();
87             processTestCase(tc, ctx);
88
89
90
91         } catch (Exception e) {
92             e.printStackTrace();
93         }
94     }
95
96
97
98     @Test
99     public void testGenerateConfigWithNoParameters() {
100         try {
101
102             String propertyfileName = "APPC/GenerateConfig/GenerateConfigNoParams.properties";
103             //String generateConfigXML = "src/main/resources/xml/APPC_GenerateConfig.xml";
104
105             // Register Call graphs
106             String injectGraphXmls[] = new String[] { generateConfigXML };
107
108             Map<String, Object> serviceReferences = new HashMap<String, Object>();
109
110             serviceReferences.put("org.onap.sdnc.config.generator.merge.MergeNode", new org.onap.sdnc.config.generator.merge.MergeNode());
111             //serviceReferences.put("org.onap.appc.config.generator.node.ConfigResourceNode", new MockConfigResourceNode());
112
113             serviceReferences.put("org.onap.appc.data.services.node.ConfigResourceNode", new MockSvcLogicJavaPlugin());
114
115
116             GraphKey  graphKey = new GraphKey("APPC", null, "GenerateConfig", null);
117             DGTestCase tc = new DGTestCase(graphKey);
118             tc.setInjectGraphXmls(injectGraphXmls);
119             tc.setServiceReferences(serviceReferences);
120             tc.setPropertyfileName(propertyfileName);
121
122
123             SvcLogicContext ctx = new SvcLogicContext();
124             processTestCase(tc, ctx);
125
126
127
128         } catch (Exception e) {
129             e.printStackTrace();
130         }
131     }
132
133
134 */
135 }