Initial add of appc-directed-graph bundles
[appc.git] / appc-directed-graph / appc-dgraph / provider / src / test / java / org / openecomp / appc / dg / TestGetDeviceRunningConfig.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * ONAP : APP-C
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
10  * 
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  * 
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=========================================================
19  */
20
21 package org.openecomp.appc.dg;
22
23
24 import static org.junit.Assert.assertNotNull;
25
26 import org.junit.Test;
27
28 import com.att.eelf.configuration.EELFLogger;
29 import com.att.eelf.configuration.EELFManager;
30 /* need to move to open source
31 import com.att.sdnctl.dgtestlibrary.AbstractDGTestCase;
32 import com.att.sdnctl.dgtestlibrary.DGTestCase;
33 import com.att.sdnctl.dgtestlibrary.GraphKey;
34 */
35 import org.openecomp.sdnc.sli.SvcLogicContext;
36
37 public class TestGetDeviceRunningConfig /* extends AbstractDGTestCase */ {
38         private static final EELFLogger logger = EELFManager.getInstance().getLogger(TestGetConfigParams.class);
39 /*
40         public String jsonPath = "src/main/resources/json";
41         public String xmlpath = "src/main/resources/xml";
42
43         @Test
44         public void testChefRunningConfigSuccess() {
45                 try {
46                         logger.info("********************************* testChefRunningConfigSuccess *************************************");
47                         //DGMockUtils.generateXMLFile(jsonPath, xmlpath);
48
49                         String propertyfileName = "APPC/GetDeviceRunningConfig/Chef_Success.properties";
50
51                         String getDeviceRunningConfigXML = "src/main/resources/xml/APPC_GetDeviceRunningConfig.xml";
52                         // Register Call graphs
53                         String injectGraphXmls[] = new String[] { getDeviceRunningConfigXML };
54
55
56                         GraphKey  graphKey = new GraphKey("APPC", null, "GetDeviceRunningConfig", null);
57                         DGTestCase tc = new DGTestCase(graphKey);
58                         tc.setInjectGraphXmls(injectGraphXmls);
59                         tc.setPropertyfileName(propertyfileName);
60
61                         SvcLogicContext ctx = new SvcLogicContext();
62                         processTestCase(tc, ctx);
63
64                         assertContextWithProperty(ctx);
65
66
67                 } catch (Exception e) {
68                         e.printStackTrace();
69                 }
70         }
71
72         @Test
73         public void testChefRunningConfigFailure() {
74                 try {
75
76                         logger.info("********************************* testChefRunningConfigFailure *************************************");
77                         String propertyfileName = "APPC/GetDeviceRunningConfig/Chef_Failure.properties";
78
79                         String getDeviceRunningConfigXML = "src/main/resources/xml/APPC_GetDeviceRunningConfig.xml";
80                         // Register Call graphs
81                         String injectGraphXmls[] = new String[] { getDeviceRunningConfigXML };
82
83
84                         GraphKey  graphKey = new GraphKey("APPC", null, "GetDeviceRunningConfig", null);
85                         DGTestCase tc = new DGTestCase(graphKey);
86                         tc.setInjectGraphXmls(injectGraphXmls);
87                         tc.setPropertyfileName(propertyfileName);
88
89
90                         SvcLogicContext ctx = new SvcLogicContext();
91                         processTestCase(tc, ctx);
92
93                         assertContextWithProperty(ctx);
94
95                         //DGMockUtils.printContext(ctx);
96
97                 } catch (Exception e) {
98                         e.printStackTrace();
99                 }
100         }
101
102         @Test
103         public void testChefRunningConfigOthers() {
104                 try {
105                         logger.info("********************************* testChefRunningConfigOthers *************************************");
106                         String propertyfileName = "APPC/GetDeviceRunningConfig/Chef_Others.properties";
107
108                         String getDeviceRunningConfigXML = "src/main/resources/xml/APPC_GetDeviceRunningConfig.xml";
109                         // Register Call graphs
110                         String injectGraphXmls[] = new String[] { getDeviceRunningConfigXML };
111
112
113                         GraphKey  graphKey = new GraphKey("APPC", null, "GetDeviceRunningConfig", null);
114                         DGTestCase tc = new DGTestCase(graphKey);
115                         tc.setInjectGraphXmls(injectGraphXmls);
116                         tc.setPropertyfileName(propertyfileName);
117
118
119                         SvcLogicContext ctx = new SvcLogicContext();
120                         processTestCase(tc, ctx);
121
122                         assertContextWithProperty(ctx);
123
124                         //DGMockUtils.printContext(ctx);
125
126                 } catch (Exception e) {
127                         e.printStackTrace();
128                 }
129         }
130 */
131 }