2 * ============LICENSE_START=======================================================
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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=========================================================
21 package org.openecomp.appc.dg;
23 import java.util.HashMap;
26 import org.junit.Test;
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;
36 import org.openecomp.sdnc.sli.SvcLogicContext;
38 public class TestDownloadCliConfig /* extends AbstractDGTestCase */ {
41 private static final EELFLogger logger = EELFManager.getInstance().getLogger(TestDownloadIsbcConfig.class);
42 public static String DownloadCliConfigXML = "src/main/resources/xml/APPC_DownloadCliConfig.xml";
45 public void testDownloadCliConfigSuccess() {
47 String propertyfileName = "APPC/DownloadCliConfig/DownloadCliConfig_Success.properties";
49 // Register Call graphs
50 String injectGraphXmls[] = new String[] { DownloadCliConfigXML };
52 Map<String, Object> serviceReferences = new HashMap<String, Object>();
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);
60 Map<String, Object> resourceReferences = new HashMap<String, Object>();
61 tc.setResourceReferences(resourceReferences);
63 SvcLogicContext ctx = new SvcLogicContext();
64 processTestCase(tc, ctx);
66 //DGMockUtils.printContext(ctx);
67 } catch (Exception e) {
73 public void testDownloadCliConfigDBFailure() {
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>();
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);
87 Map<String, Object> resourceReferences = new HashMap<String, Object>();
88 tc.setResourceReferences(resourceReferences);
90 SvcLogicContext ctx = new SvcLogicContext();
91 processTestCase(tc, ctx);
93 //DGMockUtils.printContext(ctx);
96 } catch (Exception e) {
102 public void testDownloadCliConfigAdaptorFailure() {
105 String propertyfileName = "APPC/DownloadCliConfig/DownloadCliConfig_Adaptor_Failure.properties";
107 // Register Call graphs
108 String injectGraphXmls[] = new String[] { DownloadCliConfigXML };
110 Map<String, Object> serviceReferences = new HashMap<String, Object>();
112 GraphKey graphKey = new GraphKey("APPC", null, "DownloadCliConfig", null);
113 DGTestCase tc = new DGTestCase(graphKey);
115 tc.setInjectGraphXmls(injectGraphXmls);
116 tc.setServiceReferences(serviceReferences);
117 tc.setPropertyfileName(propertyfileName);
119 Map<String, Object> resourceReferences = new HashMap<String, Object>();
120 tc.setResourceReferences(resourceReferences);
122 SvcLogicContext ctx = new SvcLogicContext();
123 processTestCase(tc, ctx);
125 //DGMockUtils.printContext(ctx);
128 } catch (Exception e) {