Removing old name references
[appc.git] / appc-directed-graph / appc-dgraph / provider / src / test / java / org / onap / appc / dg / TestProcessParameterDefinition.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 import com.att.eelf.configuration.EELFLogger;
36 import com.att.eelf.configuration.EELFManager;
37 /* move to open source
38 import org.onap.sdnc.dgtestlibrary.AbstractDGTestCase;
39 import org.onap.sdnc.dgtestlibrary.DGTestCase;
40 import org.onap.sdnc.dgtestlibrary.GraphKey;
41 */
42 import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
43
44
45 public class TestProcessParameterDefinition /* extends AbstractDGTestCase */ {
46
47     private static final EELFLogger logger = EELFManager.getInstance().getLogger(TestProcessParameterDefinition.class);
48     public static String getProcessPDXML = "src/main/resources/xml/APPC_ProcessParameterDefinition.xml";
49
50 /*
51
52
53     @Test
54     public void testProcessPD() {
55         try {
56
57
58             String propertyfileName = "APPC/ProcessParameterDefinition/ProcessPD.properties";
59             Map<String, Object> serviceReferences = new HashMap<String, Object>();
60
61
62
63             serviceReferences.put("org.onap.sdnc.config.params.parser.PropertyDefinitionNode", new org.onap.sdnc.config.params.parser.PropertyDefinitionNode());
64
65
66
67             // Register Call graphs
68             String injectGraphXmls[] = new String[] { getProcessPDXML };
69
70
71             GraphKey  graphKey = new GraphKey("APPC", null, "ProcessParameterDefinition", null);
72             DGTestCase tc = new DGTestCase(graphKey);
73             tc.setInjectGraphXmls(injectGraphXmls);
74             tc.setServiceReferences(serviceReferences);
75             tc.setPropertyfileName(propertyfileName);
76
77
78             SvcLogicContext ctx = new SvcLogicContext();
79             processTestCase(tc, ctx);
80
81             //System.out.println(ctx.getAttribute("tmp.allParams.configuration-parameters"));
82         } catch (Exception e) {
83             e.printStackTrace();
84         }
85     }
86
87
88
89     @Test
90     public void testGetPDFail() {
91         try {
92
93
94             String propertyfileName = "APPC/ProcessParameterDefinition/GetPDFail.properties";
95             Map<String, Object> serviceReferences = new HashMap<String, Object>();
96
97
98
99             serviceReferences.put("org.onap.sdnc.config.params.parser.PropertyDefinitionNode", new org.onap.sdnc.config.params.parser.PropertyDefinitionNode());
100
101
102
103             // Register Call graphs
104             String injectGraphXmls[] = new String[] { getProcessPDXML };
105
106
107             GraphKey  graphKey = new GraphKey("APPC", null, "ProcessParameterDefinition", null);
108             DGTestCase tc = new DGTestCase(graphKey);
109             tc.setInjectGraphXmls(injectGraphXmls);
110             tc.setServiceReferences(serviceReferences);
111             tc.setPropertyfileName(propertyfileName);
112
113
114             SvcLogicContext ctx = new SvcLogicContext();
115             processTestCase(tc, ctx);
116
117         } catch (Exception e) {
118             e.printStackTrace();
119         }
120
121     }
122     @Test
123     public void testNoInstarParams() {
124             try {
125
126
127                 String propertyfileName = "APPC/ProcessParameterDefinition/NoInstarParams.properties";
128                 Map<String, Object> serviceReferences = new HashMap<String, Object>();
129
130
131
132                 serviceReferences.put("org.onap.sdnc.config.params.parser.PropertyDefinitionNode", new org.onap.sdnc.config.params.parser.PropertyDefinitionNode());
133
134
135
136                 // Register Call graphs
137                 String injectGraphXmls[] = new String[] { getProcessPDXML };
138
139
140                 GraphKey  graphKey = new GraphKey("APPC", null, "ProcessParameterDefinition", null);
141                 DGTestCase tc = new DGTestCase(graphKey);
142                 tc.setInjectGraphXmls(injectGraphXmls);
143                 tc.setServiceReferences(serviceReferences);
144                 tc.setPropertyfileName(propertyfileName);
145
146
147                 SvcLogicContext ctx = new SvcLogicContext();
148                 processTestCase(tc, ctx);
149
150             } catch (Exception e) {
151                 e.printStackTrace();
152             }
153     }
154
155
156     @Test
157     public void testGetInstarParamsFail() {
158             try {
159
160
161                 String propertyfileName = "APPC/ProcessParameterDefinition/GetInstarParamsFail.properties";
162                 Map<String, Object> serviceReferences = new HashMap<String, Object>();
163
164
165
166
167
168                 // Register Call graphs
169                 String injectGraphXmls[] = new String[] { getProcessPDXML };
170
171
172                 GraphKey  graphKey = new GraphKey("APPC", null, "ProcessParameterDefinition", null);
173                 DGTestCase tc = new DGTestCase(graphKey);
174                 tc.setInjectGraphXmls(injectGraphXmls);
175                 tc.setServiceReferences(serviceReferences);
176                 tc.setPropertyfileName(propertyfileName);
177
178
179                 SvcLogicContext ctx = new SvcLogicContext();
180                 processTestCase(tc, ctx);
181
182             } catch (Exception e) {
183                 e.printStackTrace();
184             }
185     }
186
187
188     @Test
189     public void testMergeParamsFail() {
190             try {
191
192
193                 String propertyfileName = "APPC/ProcessParameterDefinition/MergeParamsFail.properties";
194                 Map<String, Object> serviceReferences = new HashMap<String, Object>();
195
196
197
198
199
200                 // Register Call graphs
201                 String injectGraphXmls[] = new String[] { getProcessPDXML };
202
203
204                 GraphKey  graphKey = new GraphKey("APPC", null, "ProcessParameterDefinition", null);
205                 DGTestCase tc = new DGTestCase(graphKey);
206                 tc.setInjectGraphXmls(injectGraphXmls);
207                 tc.setServiceReferences(serviceReferences);
208                 tc.setPropertyfileName(propertyfileName);
209
210
211                 SvcLogicContext ctx = new SvcLogicContext();
212                 processTestCase(tc, ctx);
213
214             } catch (Exception e) {
215                 e.printStackTrace();
216             }
217     }
218
219
220     @Test
221     public void testSaveMdSal() {
222         try {
223
224
225             String propertyfileName = "APPC/ProcessParameterDefinition/SaveMdsalFail.properties";
226             Map<String, Object> serviceReferences = new HashMap<String, Object>();
227
228
229
230             serviceReferences.put("org.onap.sdnc.config.params.parser.PropertyDefinitionNode", new org.onap.sdnc.config.params.parser.PropertyDefinitionNode());
231
232
233
234             // Register Call graphs
235             String injectGraphXmls[] = new String[] { getProcessPDXML };
236
237
238             GraphKey  graphKey = new GraphKey("APPC", null, "ProcessParameterDefinition", null);
239             DGTestCase tc = new DGTestCase(graphKey);
240             tc.setInjectGraphXmls(injectGraphXmls);
241             tc.setServiceReferences(serviceReferences);
242             tc.setPropertyfileName(propertyfileName);
243
244
245             SvcLogicContext ctx = new SvcLogicContext();
246             processTestCase(tc, ctx);
247
248             //System.out.println(ctx.getAttribute("tmp.allParams.configuration-parameters"));
249         } catch (Exception e) {
250             e.printStackTrace();
251         }
252     }
253 */
254 }
255
256
257
258