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;
28 import static org.junit.Assert.*;
30 import java.util.HashMap;
33 import org.junit.Test;
34 import org.onap.appc.dg.mock.instance.MockConfigureNodeExecutor;
35 import org.onap.appc.dg.mock.instance.MockSvcLogicJavaPlugin;
37 import com.att.eelf.configuration.EELFLogger;
38 import com.att.eelf.configuration.EELFManager;
39 /* need to move to opensource
40 import com.att.sdnctl.dgtestlibrary.AbstractDGTestCase;
41 import com.att.sdnctl.dgtestlibrary.DGTestCase;
42 import com.att.sdnctl.dgtestlibrary.GraphKey;
44 import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
46 public class TestGenerateTemplateConfig /* extends AbstractDGTestCase */ {
47 private static final EELFLogger logger = EELFManager.getInstance().getLogger(TestGenerateTemplateConfig.class);
49 public static String generateConfigXML = "src/main/resources/xml/APPC_GenerateTemplateConfig.xml";
52 public void testGenerateTemplateConfigWithParameters() {
55 String propertyfileName = "APPC/GenerateTemplateConfig/GenerateTemplateConfigWithParams.properties";
56 Map<String, Object> serviceReferences = new HashMap<String, Object>();
59 serviceReferences.put("org.onap.appc.data.services.node.ConfigResourceNode", new MockSvcLogicJavaPlugin());
60 serviceReferences.put("org.onap.sdnc.config.generator.merge.MergeNode", new org.onap.sdnc.config.generator.merge.MergeNode());
62 // Register Call graphs
63 String injectGraphXmls[] = new String[] { generateConfigXML };
65 GraphKey graphKey = new GraphKey("APPC", null, "GenerateTemplateConfig", null);
66 DGTestCase tc = new DGTestCase(graphKey);
67 tc.setInjectGraphXmls(injectGraphXmls);
68 tc.setServiceReferences(serviceReferences);
69 tc.setPropertyfileName(propertyfileName);
71 SvcLogicContext ctx = new SvcLogicContext();
72 processTestCase(tc, ctx);
76 } catch (Exception e) {
84 public void testGenerateTemplateConfigWithNoParameters() {
87 String propertyfileName = "APPC/GenerateTemplateConfig/GenerateTemplateConfigNoParams.properties";
88 Map<String, Object> serviceReferences = new HashMap<String, Object>();
91 serviceReferences.put("org.onap.appc.data.services.node.ConfigResourceNode", new MockSvcLogicJavaPlugin());
92 serviceReferences.put("org.onap.sdnc.config.generator.merge.MergeNode", new org.onap.sdnc.config.generator.merge.MergeNode());
94 // Register Call graphs
95 String injectGraphXmls[] = new String[] { generateConfigXML };
97 GraphKey graphKey = new GraphKey("APPC", null, "GenerateTemplateConfig", null);
98 DGTestCase tc = new DGTestCase(graphKey);
99 tc.setInjectGraphXmls(injectGraphXmls);
100 tc.setServiceReferences(serviceReferences);
101 tc.setPropertyfileName(propertyfileName);
103 SvcLogicContext ctx = new SvcLogicContext();
104 processTestCase(tc, ctx);
109 } catch (Exception e) {