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