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