Platform Hardening for DG - Part 8
[appc.git] / appc-directed-graph / appc-dgraph / provider / src / test / java / org / onap / appc / dg / TestUpdateAaiInfo.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.Before;
34 import org.junit.Test;
35 import org.mockito.Mockito;
36 import org.onap.appc.dg.mock.instance.MockAaiResource;
37 import org.onap.appc.dg.mock.instance.MockConfigureNodeExecutor;
38 import org.onap.appc.dg.mock.instance.MockSvcLogicJavaPlugin;
39 import org.osgi.framework.BundleContext;
40 import org.osgi.framework.FrameworkUtil;
41 import org.powermock.api.mockito.PowerMockito;
42 import org.slf4j.Logger;
43 import org.slf4j.LoggerFactory;
44
45 import com.att.eelf.configuration.EELFLogger;
46 import com.att.eelf.configuration.EELFManager;
47 /* move to open source
48 import org.apache.sling.testing.mock.osgi.MockOsgi;
49 import com.att.sdnctl.dgtestlibrary.AbstractDGTestCase;
50 import com.att.sdnctl.dgtestlibrary.DGTestCase;
51 import com.att.sdnctl.dgtestlibrary.GraphKey;
52 */
53 import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
54 import org.onap.ccsdk.sli.core.sli.provider.ExecuteNodeExecutor;
55 import org.onap.ccsdk.sli.core.sli.provider.SvcLogicAdaptorFactory;
56
57
58 public class TestUpdateAaiInfo /* extends AbstractDGTestCase */ {
59     //private final static Logger logger = LoggerFactory.getLogger(TestGetParams.class);
60     private static final EELFLogger logger = EELFManager.getInstance().getLogger(TestUpdateAaiInfo.class);
61     public static String UpdateAaiInfoXML = "src/main/resources/xml/APPC_UpdateAaiInfo.xml";
62
63 /*
64
65     @Test
66     public void testUpdateAaiInfoSuccess() {
67         try {
68
69             String propertyfileName = "APPC/UpdateAaiInfo/Update_Success.properties";
70             Map<String, Object> serviceReferences = new HashMap<String, Object>();
71
72             // Register Call graphs
73             String injectGraphXmls[] = new String[] { UpdateAaiInfoXML };
74
75
76             Map<String, Object> resourceReferences = new HashMap<String, Object>();
77
78
79             resourceReferences.put("org.openecomp.sdnc.sli.aai.AAIService", new MockAaiResource());
80
81             GraphKey  graphKey = new GraphKey("APPC", null, "UpdateAaiInfo", null);
82             DGTestCase tc = new DGTestCase(graphKey);
83             tc.setInjectGraphXmls(injectGraphXmls);
84             tc.setServiceReferences(serviceReferences);
85             tc.setPropertyfileName(propertyfileName);
86             tc.setResourceReferences(resourceReferences);
87
88             SvcLogicContext ctx = new SvcLogicContext();
89             processTestCase(tc, ctx);
90
91
92         } catch (Exception e) {
93             e.printStackTrace();
94         }
95
96     }
97
98
99
100     @Test
101     public void testUpdateAaiInfoFail() {
102         try {
103
104             String propertyfileName = "APPC/UpdateAaiInfo/Update_Fail.properties";
105             Map<String, Object> serviceReferences = new HashMap<String, Object>();
106
107
108
109             // Register Call graphs
110             String injectGraphXmls[] = new String[] { UpdateAaiInfoXML };
111
112
113             GraphKey  graphKey = new GraphKey("APPC", null, "UpdateAaiInfo", null);
114             DGTestCase tc = new DGTestCase(graphKey);
115             tc.setInjectGraphXmls(injectGraphXmls);
116             tc.setServiceReferences(serviceReferences);
117             tc.setPropertyfileName(propertyfileName);
118
119
120             Map<String, Object> resourceReferences = new HashMap<String, Object>();
121             tc.setResourceReferences(resourceReferences);
122
123             SvcLogicContext ctx = new SvcLogicContext();
124             processTestCase(tc, ctx);
125
126
127
128         } catch (Exception e) {
129             e.printStackTrace();
130         }
131
132     }
133
134
135
136     @Test
137     public void testGetVnfcRefFail() {
138         try {
139
140             String propertyfileName = "APPC/UpdateAaiInfo/GetVnfcRef_Fail.properties";
141             Map<String, Object> serviceReferences = new HashMap<String, Object>();
142
143
144
145             // Register Call graphs
146             String injectGraphXmls[] = new String[] { UpdateAaiInfoXML };
147
148
149             GraphKey  graphKey = new GraphKey("APPC", null, "UpdateAaiInfo", null);
150             DGTestCase tc = new DGTestCase(graphKey);
151             tc.setInjectGraphXmls(injectGraphXmls);
152             tc.setServiceReferences(serviceReferences);
153             tc.setPropertyfileName(propertyfileName);
154
155             Map<String, Object> resourceReferences = new HashMap<String, Object>();
156             tc.setResourceReferences(resourceReferences);
157
158             SvcLogicContext ctx = new SvcLogicContext();
159             processTestCase(tc, ctx);
160
161
162
163         } catch (Exception e) {
164             e.printStackTrace();
165         }
166
167     }
168
169 */
170 }