Platform Hardening for DG - Part 8
[appc.git] / appc-directed-graph / appc-dgraph / provider / src / test / java / org / onap / appc / dg / TestConfigure.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 java.util.HashMap;
29 import java.util.Map;
30
31 import org.junit.Test;
32 import org.onap.appc.dg.mock.instance.MockConfigureNodeExecutor;
33 import org.onap.appc.dg.mock.instance.MockSvcLogicJavaPlugin;
34
35 /* need to move to open source
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 import com.att.eelf.configuration.EELFLogger;
42 import com.att.eelf.configuration.EELFManager;
43
44 public class TestConfigure /* extends AbstractDGTestCase */ {
45     private static final EELFLogger logger = EELFManager.getInstance().getLogger(TestConfigure.class);
46     public static String ConfigureXML = "src/main/resources/xml/APPC_Configure.xml";
47
48 /*
49     @Test
50     public void testTemplateConfigureSuccess() {
51         try {
52
53             String propertyfileName = "APPC/Configure/Configure_Success.properties";
54
55             // Register Call graphs
56             String injectGraphXmls[] = new String[] { ConfigureXML };
57
58             Map<String, Object> serviceReferences = new HashMap<String, Object>();
59
60
61
62             GraphKey  graphKey = new GraphKey("APPC", null, "Configure", null);
63             DGTestCase tc = new DGTestCase(graphKey);
64
65
66             tc.setInjectGraphXmls(injectGraphXmls);
67             tc.setServiceReferences(serviceReferences);
68             tc.setPropertyfileName(propertyfileName);
69
70
71
72             SvcLogicContext ctx = new SvcLogicContext();
73             processTestCase(tc, ctx);
74
75
76
77
78         } catch (Exception e) {
79             e.printStackTrace();
80         }
81     }
82
83
84     @Test
85     public void testTemplateConfigureFailure() {
86         try {
87
88             String propertyfileName = "APPC/Configure/Configure_Failure.properties";
89
90             // Register Call graphs
91             String injectGraphXmls[] = new String[] { ConfigureXML };
92
93             Map<String, Object> serviceReferences = new HashMap<String, Object>();
94
95
96
97             GraphKey  graphKey = new GraphKey("APPC", null, "Configure", null);
98             DGTestCase tc = new DGTestCase(graphKey);
99
100
101             tc.setInjectGraphXmls(injectGraphXmls);
102             tc.setServiceReferences(serviceReferences);
103             tc.setPropertyfileName(propertyfileName);
104
105
106
107             SvcLogicContext ctx = new SvcLogicContext();
108             processTestCase(tc, ctx);
109
110
111
112
113         } catch (Exception e) {
114             e.printStackTrace();
115         }
116     }
117
118
119     @Test
120     public void testGetTemplateFailure() {
121         try {
122
123             String propertyfileName = "APPC/Configure/GetTemplate_Failure.properties";
124
125             // Register Call graphs
126             String injectGraphXmls[] = new String[] { ConfigureXML };
127
128             Map<String, Object> serviceReferences = new HashMap<String, Object>();
129
130
131
132             GraphKey  graphKey = new GraphKey("APPC", null, "Configure", null);
133             DGTestCase tc = new DGTestCase(graphKey);
134
135
136             tc.setInjectGraphXmls(injectGraphXmls);
137             tc.setServiceReferences(serviceReferences);
138             tc.setPropertyfileName(propertyfileName);
139
140
141
142             SvcLogicContext ctx = new SvcLogicContext();
143             processTestCase(tc, ctx);
144
145
146
147
148         } catch (Exception e) {
149             e.printStackTrace();
150         }
151     }
152
153
154
155     @Test
156     public void testGenerateTemplateConfigFailure() {
157         try {
158
159             String propertyfileName = "APPC/Configure/GenerateTemplateConfig_Failure.properties";
160
161             // Register Call graphs
162             String injectGraphXmls[] = new String[] { ConfigureXML };
163
164             Map<String, Object> serviceReferences = new HashMap<String, Object>();
165
166
167             GraphKey  graphKey = new GraphKey("APPC", null, "Configure", null);
168             DGTestCase tc = new DGTestCase(graphKey);
169
170
171             tc.setInjectGraphXmls(injectGraphXmls);
172             tc.setServiceReferences(serviceReferences);
173             tc.setPropertyfileName(propertyfileName);
174
175
176
177             SvcLogicContext ctx = new SvcLogicContext();
178             processTestCase(tc, ctx);
179
180
181
182
183         } catch (Exception e) {
184             e.printStackTrace();
185         }
186     }
187
188     @Test
189     public void testConfigBlockConfigureSuccess() {
190         try {
191
192             String propertyfileName = "APPC/Configure/ConfigBlockConfigure_Success.properties";
193
194             // Register Call graphs
195             String injectGraphXmls[] = new String[] { ConfigureXML };
196
197             Map<String, Object> serviceReferences = new HashMap<String, Object>();
198
199
200             GraphKey  graphKey = new GraphKey("APPC", null, "Configure", null);
201             DGTestCase tc = new DGTestCase(graphKey);
202
203
204             tc.setInjectGraphXmls(injectGraphXmls);
205             tc.setServiceReferences(serviceReferences);
206             tc.setPropertyfileName(propertyfileName);
207
208
209
210             SvcLogicContext ctx = new SvcLogicContext();
211             processTestCase(tc, ctx);
212
213
214
215
216         } catch (Exception e) {
217             e.printStackTrace();
218         }
219     }
220
221     @Test
222     public void testConfigBlockConfigureFailure() {
223         try {
224
225             String propertyfileName = "APPC/Configure/ConfigBlockConfigure_Failure.properties";
226
227             // Register Call graphs
228             String injectGraphXmls[] = new String[] { ConfigureXML };
229
230             Map<String, Object> serviceReferences = new HashMap<String, Object>();
231
232
233             GraphKey  graphKey = new GraphKey("APPC", null, "Configure", null);
234             DGTestCase tc = new DGTestCase(graphKey);
235
236
237             tc.setInjectGraphXmls(injectGraphXmls);
238             tc.setServiceReferences(serviceReferences);
239             tc.setPropertyfileName(propertyfileName);
240
241
242
243             SvcLogicContext ctx = new SvcLogicContext();
244             processTestCase(tc, ctx);
245
246
247
248
249         } catch (Exception e) {
250             e.printStackTrace();
251         }
252     }
253
254
255     @Test
256     public void testGenerateConfigFailure() {
257         try {
258
259             String propertyfileName = "APPC/Configure/GenerateConfig_Failure.properties";
260
261             // Register Call graphs
262             String injectGraphXmls[] = new String[] { ConfigureXML };
263
264             Map<String, Object> serviceReferences = new HashMap<String, Object>();
265
266
267
268             GraphKey  graphKey = new GraphKey("APPC", null, "Configure", null);
269             DGTestCase tc = new DGTestCase(graphKey);
270
271
272             tc.setInjectGraphXmls(injectGraphXmls);
273             tc.setServiceReferences(serviceReferences);
274             tc.setPropertyfileName(propertyfileName);
275
276
277
278             SvcLogicContext ctx = new SvcLogicContext();
279             processTestCase(tc, ctx);
280
281
282
283
284         } catch (Exception e) {
285             e.printStackTrace();
286         }
287     }
288 */
289 }