444796608839f5bbbdae510ece9f1d76568cf52c
[appc.git] / appc-directed-graph / appc-dgraph / provider / src / test / java / org / openecomp / appc / dg / TestGenerateTemplateConfig.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.openecomp.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.Test;
30 import org.openecomp.appc.dg.mock.instance.MockConfigureNodeExecutor;
31 import org.openecomp.appc.dg.mock.instance.MockSvcLogicJavaPlugin;
32
33 import com.att.eelf.configuration.EELFLogger;
34 import com.att.eelf.configuration.EELFManager;
35 /* need to move to opensource
36 import com.att.sdnctl.dgtestlibrary.AbstractDGTestCase;
37 import com.att.sdnctl.dgtestlibrary.DGTestCase;
38 import com.att.sdnctl.dgtestlibrary.GraphKey;
39 */
40 import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
41
42 public class TestGenerateTemplateConfig /* extends AbstractDGTestCase */ {
43         private static final EELFLogger logger = EELFManager.getInstance().getLogger(TestGenerateTemplateConfig.class);
44 /*
45         public static String generateConfigXML = "src/main/resources/xml/APPC_GenerateTemplateConfig.xml";
46
47         @Test
48         public void testGenerateTemplateConfigWithParameters() {
49                 try {
50
51                         String propertyfileName = "APPC/GenerateTemplateConfig/GenerateTemplateConfigWithParams.properties";
52                         Map<String, Object> serviceReferences = new HashMap<String, Object>();
53
54                         
55                         serviceReferences.put("org.openecomp.appc.data.services.node.ConfigResourceNode", new MockSvcLogicJavaPlugin());
56                         serviceReferences.put("org.openecomp.sdnc.config.generator.merge.MergeNode", new org.openecomp.sdnc.config.generator.merge.MergeNode());
57
58                         // Register Call graphs
59                         String injectGraphXmls[] = new String[] { generateConfigXML };
60
61                         GraphKey  graphKey = new GraphKey("APPC", null, "GenerateTemplateConfig", null);
62                         DGTestCase tc = new DGTestCase(graphKey);
63                         tc.setInjectGraphXmls(injectGraphXmls);
64                         tc.setServiceReferences(serviceReferences);
65                         tc.setPropertyfileName(propertyfileName);
66
67                         SvcLogicContext ctx = new SvcLogicContext();
68                         processTestCase(tc, ctx);
69
70
71                 
72                 } catch (Exception e) {
73                         e.printStackTrace();
74                 }
75         }
76
77
78
79         @Test
80         public void testGenerateTemplateConfigWithNoParameters() {
81                 try {
82
83                         String propertyfileName = "APPC/GenerateTemplateConfig/GenerateTemplateConfigNoParams.properties";
84                         Map<String, Object> serviceReferences = new HashMap<String, Object>();
85
86                 
87                         serviceReferences.put("org.openecomp.appc.data.services.node.ConfigResourceNode", new MockSvcLogicJavaPlugin());
88                         serviceReferences.put("org.openecomp.sdnc.config.generator.merge.MergeNode", new org.openecomp.sdnc.config.generator.merge.MergeNode());
89
90                         // Register Call graphs
91                         String injectGraphXmls[] = new String[] { generateConfigXML };
92
93                         GraphKey  graphKey = new GraphKey("APPC", null, "GenerateTemplateConfig", null);
94                         DGTestCase tc = new DGTestCase(graphKey);
95                         tc.setInjectGraphXmls(injectGraphXmls);
96                         tc.setServiceReferences(serviceReferences);
97                         tc.setPropertyfileName(propertyfileName);
98
99                         SvcLogicContext ctx = new SvcLogicContext();
100                         processTestCase(tc, ctx);
101
102
103
104
105                 } catch (Exception e) {
106                         e.printStackTrace();
107                 }
108         }
109
110 */
111
112 }