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