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