2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017-2018 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 * ============LICENSE_END=========================================================
24 package org.onap.appc.dg;
27 import static org.junit.Assert.*;
29 import java.util.HashMap;
32 import org.junit.Test;
33 import org.onap.appc.dg.mock.instance.MockConfigureNodeExecutor;
34 import org.onap.appc.dg.mock.instance.MockSvcLogicJavaPlugin;
36 import com.att.eelf.configuration.EELFLogger;
37 import com.att.eelf.configuration.EELFManager;
38 /* need to move to opensource
39 import org.onap.sdnc.dgtestlibrary.AbstractDGTestCase;
40 import org.onap.sdnc.dgtestlibrary.DGTestCase;
41 import org.onap.sdnc.dgtestlibrary.GraphKey;
43 import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
45 public class TestGenerateTemplateConfig /* extends AbstractDGTestCase */ {
46 private static final EELFLogger logger = EELFManager.getInstance().getLogger(TestGenerateTemplateConfig.class);
48 public static String generateConfigXML = "src/main/resources/xml/APPC_GenerateTemplateConfig.xml";
51 public void testGenerateTemplateConfigWithParameters() {
54 String propertyfileName = "APPC/GenerateTemplateConfig/GenerateTemplateConfigWithParams.properties";
55 Map<String, Object> serviceReferences = new HashMap<String, Object>();
58 serviceReferences.put("org.onap.appc.data.services.node.ConfigResourceNode", new MockSvcLogicJavaPlugin());
59 serviceReferences.put("org.onap.sdnc.config.generator.merge.MergeNode", new org.onap.sdnc.config.generator.merge.MergeNode());
61 // Register Call graphs
62 String injectGraphXmls[] = new String[] { generateConfigXML };
64 GraphKey graphKey = new GraphKey("APPC", null, "GenerateTemplateConfig", null);
65 DGTestCase tc = new DGTestCase(graphKey);
66 tc.setInjectGraphXmls(injectGraphXmls);
67 tc.setServiceReferences(serviceReferences);
68 tc.setPropertyfileName(propertyfileName);
70 SvcLogicContext ctx = new SvcLogicContext();
71 processTestCase(tc, ctx);
75 } catch (Exception e) {
83 public void testGenerateTemplateConfigWithNoParameters() {
86 String propertyfileName = "APPC/GenerateTemplateConfig/GenerateTemplateConfigNoParams.properties";
87 Map<String, Object> serviceReferences = new HashMap<String, Object>();
90 serviceReferences.put("org.onap.appc.data.services.node.ConfigResourceNode", new MockSvcLogicJavaPlugin());
91 serviceReferences.put("org.onap.sdnc.config.generator.merge.MergeNode", new org.onap.sdnc.config.generator.merge.MergeNode());
93 // Register Call graphs
94 String injectGraphXmls[] = new String[] { generateConfigXML };
96 GraphKey graphKey = new GraphKey("APPC", null, "GenerateTemplateConfig", null);
97 DGTestCase tc = new DGTestCase(graphKey);
98 tc.setInjectGraphXmls(injectGraphXmls);
99 tc.setServiceReferences(serviceReferences);
100 tc.setPropertyfileName(propertyfileName);
102 SvcLogicContext ctx = new SvcLogicContext();
103 processTestCase(tc, ctx);
108 } catch (Exception e) {