Platform Hardening for DG - Part 8
[appc.git] / appc-directed-graph / appc-dgraph / provider / src / test / java / org / onap / appc / dg / TestDownloadCliConfig.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 import java.util.HashMap;
28 import java.util.Map;
29
30 import org.junit.Test;
31
32 import com.att.eelf.configuration.EELFLogger;
33 import com.att.eelf.configuration.EELFManager;
34 /* need to move to opensource
35 import com.att.sdnctl.dgtestlibrary.AbstractDGTestCase;
36 import com.att.sdnctl.dgtestlibrary.DGMockUtils;
37 import com.att.sdnctl.dgtestlibrary.DGTestCase;
38 import com.att.sdnctl.dgtestlibrary.GraphKey;
39 */
40 import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
41
42 public class TestDownloadCliConfig /* extends AbstractDGTestCase */ {
43
44 /*
45     private static final EELFLogger logger = EELFManager.getInstance().getLogger(TestDownloadIsbcConfig.class);
46     public static String DownloadCliConfigXML = "src/main/resources/xml/APPC_DownloadCliConfig.xml";
47
48     @Test
49     public void testDownloadCliConfigSuccess() {
50         try {
51             String propertyfileName = "APPC/DownloadCliConfig/DownloadCliConfig_Success.properties";
52
53             // Register Call graphs
54             String injectGraphXmls[] = new String[] { DownloadCliConfigXML };
55
56             Map<String, Object> serviceReferences = new HashMap<String, Object>();
57
58             GraphKey graphKey = new GraphKey("APPC", null, "DownloadCliConfig", null);
59             DGTestCase tc = new DGTestCase(graphKey);
60             tc.setInjectGraphXmls(injectGraphXmls);
61             tc.setServiceReferences(serviceReferences);
62             tc.setPropertyfileName(propertyfileName);
63
64             Map<String, Object> resourceReferences = new HashMap<String, Object>();
65             tc.setResourceReferences(resourceReferences);
66
67             SvcLogicContext ctx = new SvcLogicContext();
68             processTestCase(tc, ctx);
69
70             //DGMockUtils.printContext(ctx);
71         } catch (Exception e) {
72             e.printStackTrace();
73         }
74     }
75
76     @Test
77     public void testDownloadCliConfigDBFailure() {
78         try {
79
80             String propertyfileName = "APPC/DownloadCliConfig/DownloadCliConfig_DB_Failure.properties";
81             // Register Call graphs
82             String injectGraphXmls[] = new String[] { DownloadCliConfigXML };
83             Map<String, Object> serviceReferences = new HashMap<String, Object>();
84
85             GraphKey graphKey = new GraphKey("APPC", null, "DownloadCliConfig", null);
86             DGTestCase tc = new DGTestCase(graphKey);
87             tc.setInjectGraphXmls(injectGraphXmls);
88             tc.setServiceReferences(serviceReferences);
89             tc.setPropertyfileName(propertyfileName);
90
91             Map<String, Object> resourceReferences = new HashMap<String, Object>();
92             tc.setResourceReferences(resourceReferences);
93
94             SvcLogicContext ctx = new SvcLogicContext();
95             processTestCase(tc, ctx);
96
97             //DGMockUtils.printContext(ctx);
98
99
100         } catch (Exception e) {
101             e.printStackTrace();
102         }
103     }
104
105     @Test
106     public void testDownloadCliConfigAdaptorFailure() {
107         try {
108
109             String propertyfileName = "APPC/DownloadCliConfig/DownloadCliConfig_Adaptor_Failure.properties";
110
111             // Register Call graphs
112             String injectGraphXmls[] = new String[] { DownloadCliConfigXML };
113
114             Map<String, Object> serviceReferences = new HashMap<String, Object>();
115
116             GraphKey graphKey = new GraphKey("APPC", null, "DownloadCliConfig", null);
117             DGTestCase tc = new DGTestCase(graphKey);
118
119             tc.setInjectGraphXmls(injectGraphXmls);
120             tc.setServiceReferences(serviceReferences);
121             tc.setPropertyfileName(propertyfileName);
122
123             Map<String, Object> resourceReferences = new HashMap<String, Object>();
124             tc.setResourceReferences(resourceReferences);
125
126             SvcLogicContext ctx = new SvcLogicContext();
127             processTestCase(tc, ctx);
128
129             //DGMockUtils.printContext(ctx);
130
131
132         } catch (Exception e) {
133             e.printStackTrace();
134         }
135     }
136 */
137 }