2 * ============LICENSE_START=======================================================
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
13 * http://www.apache.org/licenses/LICENSE-2.0
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.
21 * ECOMP is a trademark and service mark of AT&T Intellectual Property.
22 * ============LICENSE_END=========================================================
25 package org.onap.appc.dg;
27 import java.util.HashMap;
30 import org.junit.Test;
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;
40 import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
42 public class TestDownloadCliConfig /* extends AbstractDGTestCase */ {
45 private static final EELFLogger logger = EELFManager.getInstance().getLogger(TestDownloadIsbcConfig.class);
46 public static String DownloadCliConfigXML = "src/main/resources/xml/APPC_DownloadCliConfig.xml";
49 public void testDownloadCliConfigSuccess() {
51 String propertyfileName = "APPC/DownloadCliConfig/DownloadCliConfig_Success.properties";
53 // Register Call graphs
54 String injectGraphXmls[] = new String[] { DownloadCliConfigXML };
56 Map<String, Object> serviceReferences = new HashMap<String, Object>();
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);
64 Map<String, Object> resourceReferences = new HashMap<String, Object>();
65 tc.setResourceReferences(resourceReferences);
67 SvcLogicContext ctx = new SvcLogicContext();
68 processTestCase(tc, ctx);
70 //DGMockUtils.printContext(ctx);
71 } catch (Exception e) {
77 public void testDownloadCliConfigDBFailure() {
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>();
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);
91 Map<String, Object> resourceReferences = new HashMap<String, Object>();
92 tc.setResourceReferences(resourceReferences);
94 SvcLogicContext ctx = new SvcLogicContext();
95 processTestCase(tc, ctx);
97 //DGMockUtils.printContext(ctx);
100 } catch (Exception e) {
106 public void testDownloadCliConfigAdaptorFailure() {
109 String propertyfileName = "APPC/DownloadCliConfig/DownloadCliConfig_Adaptor_Failure.properties";
111 // Register Call graphs
112 String injectGraphXmls[] = new String[] { DownloadCliConfigXML };
114 Map<String, Object> serviceReferences = new HashMap<String, Object>();
116 GraphKey graphKey = new GraphKey("APPC", null, "DownloadCliConfig", null);
117 DGTestCase tc = new DGTestCase(graphKey);
119 tc.setInjectGraphXmls(injectGraphXmls);
120 tc.setServiceReferences(serviceReferences);
121 tc.setPropertyfileName(propertyfileName);
123 Map<String, Object> resourceReferences = new HashMap<String, Object>();
124 tc.setResourceReferences(resourceReferences);
126 SvcLogicContext ctx = new SvcLogicContext();
127 processTestCase(tc, ctx);
129 //DGMockUtils.printContext(ctx);
132 } catch (Exception e) {