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