Second part of onap rename
[appc.git] / appc-directed-graph / appc-dgraph / provider / src / test / java / org / onap / appc / dg / TestGenerateConfig.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * ONAP : APP-C
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
10  * 
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  * 
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=========================================================
19  */
20
21 package org.onap.appc.dg;
22
23
24 import static org.junit.Assert.*;
25
26 import java.util.HashMap;
27 import java.util.Map;
28
29 import org.junit.Before;
30 import org.junit.Test;
31 import org.mockito.Mockito;
32 import org.onap.appc.dg.mock.instance.MockConfigureNodeExecutor;
33 import org.onap.appc.dg.mock.instance.MockSvcLogicJavaPlugin;
34 import org.osgi.framework.BundleContext;
35 import org.osgi.framework.FrameworkUtil;
36 import org.powermock.api.mockito.PowerMockito;
37 import org.slf4j.Logger;
38 import org.slf4j.LoggerFactory;
39
40 import com.att.eelf.configuration.EELFLogger;
41 import com.att.eelf.configuration.EELFManager;
42 /* need to move to open source
43 import com.att.sdnctl.dgtestlibrary.AbstractDGTestCase;
44 import com.att.sdnctl.dgtestlibrary.DGTestCase;
45 import com.att.sdnctl.dgtestlibrary.GraphKey;
46 import org.apache.sling.testing.mock.osgi.MockOsgi;
47 */
48 import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
49 import org.onap.ccsdk.sli.core.sli.provider.ExecuteNodeExecutor;
50 import org.onap.ccsdk.sli.core.sli.provider.SvcLogicAdaptorFactory;
51
52
53 public class TestGenerateConfig /* extends AbstractDGTestCase */ {
54         private static final EELFLogger logger = EELFManager.getInstance().getLogger(TestGenerateConfig.class);
55         public static String generateConfigXML = "src/main/resources/xml/APPC_GenerateConfig.xml";
56
57 /*
58
59         @Test
60         public void testGenerateConfigWithParameters() {
61                 try {
62
63                         String propertyfileName = "APPC/GenerateConfig/GenerateConfigWithParams.properties";
64                         //String generateConfigXML = "src/main/resources/xml/APPC_GenerateConfig.xml";
65
66                         // Register Call graphs
67                         String injectGraphXmls[] = new String[] { generateConfigXML };
68
69                         Map<String, Object> serviceReferences = new HashMap<String, Object>();
70         
71                         serviceReferences.put("org.openecomp.sdnc.config.generator.merge.MergeNode", new org.openecomp.sdnc.config.generator.merge.MergeNode());
72                         //serviceReferences.put("com.att.appc.config.generator.node.ConfigResourceNode", new MockConfigResourceNode());
73                         
74                         serviceReferences.put("org.onap.appc.data.services.node.ConfigResourceNode", new MockSvcLogicJavaPlugin());
75
76                 
77                         GraphKey  graphKey = new GraphKey("APPC", null, "GenerateConfig", null);
78                         DGTestCase tc = new DGTestCase(graphKey);
79                         tc.setInjectGraphXmls(injectGraphXmls);
80                         tc.setServiceReferences(serviceReferences);
81                         tc.setPropertyfileName(propertyfileName);
82
83
84                         SvcLogicContext ctx = new SvcLogicContext();
85                         processTestCase(tc, ctx);
86
87
88
89                 } catch (Exception e) {
90                         e.printStackTrace();
91                 }
92         }
93
94
95
96         @Test
97         public void testGenerateConfigWithNoParameters() {
98                 try {
99
100                         String propertyfileName = "APPC/GenerateConfig/GenerateConfigNoParams.properties";
101                         //String generateConfigXML = "src/main/resources/xml/APPC_GenerateConfig.xml";
102
103                         // Register Call graphs
104                         String injectGraphXmls[] = new String[] { generateConfigXML };
105
106                         Map<String, Object> serviceReferences = new HashMap<String, Object>();
107         
108                         serviceReferences.put("org.openecomp.sdnc.config.generator.merge.MergeNode", new org.openecomp.sdnc.config.generator.merge.MergeNode());
109                         //serviceReferences.put("com.att.appc.config.generator.node.ConfigResourceNode", new MockConfigResourceNode());
110                         
111                         serviceReferences.put("org.onap.appc.data.services.node.ConfigResourceNode", new MockSvcLogicJavaPlugin());
112
113
114                         GraphKey  graphKey = new GraphKey("APPC", null, "GenerateConfig", null);
115                         DGTestCase tc = new DGTestCase(graphKey);
116                         tc.setInjectGraphXmls(injectGraphXmls);
117                         tc.setServiceReferences(serviceReferences);
118                         tc.setPropertyfileName(propertyfileName);
119
120
121                         SvcLogicContext ctx = new SvcLogicContext();
122                         processTestCase(tc, ctx);
123
124
125
126                 } catch (Exception e) {
127                         e.printStackTrace();
128                 }
129         }
130
131
132 */
133 }