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