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;
24 import static org.junit.Assert.*;
26 import java.util.HashMap;
29 import org.junit.Test;
30 import org.openecomp.appc.dg.mock.instance.MockConfigureNodeExecutor;
31 import org.openecomp.appc.dg.mock.instance.MockSvcLogicJavaPlugin;
33 import com.att.eelf.configuration.EELFLogger;
34 import com.att.eelf.configuration.EELFManager;
35 /* need to move to opensource
36 import com.att.sdnctl.dgtestlibrary.AbstractDGTestCase;
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 TestGenerateTemplateConfig /* extends AbstractDGTestCase */ {
43 private static final EELFLogger logger = EELFManager.getInstance().getLogger(TestGenerateTemplateConfig.class);
45 public static String generateConfigXML = "src/main/resources/xml/APPC_GenerateTemplateConfig.xml";
48 public void testGenerateTemplateConfigWithParameters() {
51 String propertyfileName = "APPC/GenerateTemplateConfig/GenerateTemplateConfigWithParams.properties";
52 Map<String, Object> serviceReferences = new HashMap<String, Object>();
55 serviceReferences.put("org.openecomp.appc.data.services.node.ConfigResourceNode", new MockSvcLogicJavaPlugin());
56 serviceReferences.put("org.openecomp.sdnc.config.generator.merge.MergeNode", new org.openecomp.sdnc.config.generator.merge.MergeNode());
58 // Register Call graphs
59 String injectGraphXmls[] = new String[] { generateConfigXML };
61 GraphKey graphKey = new GraphKey("APPC", null, "GenerateTemplateConfig", null);
62 DGTestCase tc = new DGTestCase(graphKey);
63 tc.setInjectGraphXmls(injectGraphXmls);
64 tc.setServiceReferences(serviceReferences);
65 tc.setPropertyfileName(propertyfileName);
67 SvcLogicContext ctx = new SvcLogicContext();
68 processTestCase(tc, ctx);
72 } catch (Exception e) {
80 public void testGenerateTemplateConfigWithNoParameters() {
83 String propertyfileName = "APPC/GenerateTemplateConfig/GenerateTemplateConfigNoParams.properties";
84 Map<String, Object> serviceReferences = new HashMap<String, Object>();
87 serviceReferences.put("org.openecomp.appc.data.services.node.ConfigResourceNode", new MockSvcLogicJavaPlugin());
88 serviceReferences.put("org.openecomp.sdnc.config.generator.merge.MergeNode", new org.openecomp.sdnc.config.generator.merge.MergeNode());
90 // Register Call graphs
91 String injectGraphXmls[] = new String[] { generateConfigXML };
93 GraphKey graphKey = new GraphKey("APPC", null, "GenerateTemplateConfig", null);
94 DGTestCase tc = new DGTestCase(graphKey);
95 tc.setInjectGraphXmls(injectGraphXmls);
96 tc.setServiceReferences(serviceReferences);
97 tc.setPropertyfileName(propertyfileName);
99 SvcLogicContext ctx = new SvcLogicContext();
100 processTestCase(tc, ctx);
105 } catch (Exception e) {