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