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