+ public String jsonPath = "src/main/resources/json";
+ public String xmlpath = "src/main/resources/xml";
+
+ @Test
+ public void testCommonConfig() {
+ try {
+ //DGXMLGenerator generator = new DGXMLGenerator();
+ //generator.generateXMLFromJSON(jsonPath, xmlpath, null);
+
+ String propertyfileName = "APPC/CommonConfiguration/APPC_method_CommonConfiguration_TC2.properties";
+
+ String commonConfigureXML = "src/main/resources/xml/APPC_CommonConfiguration.xml";
+ String callGraph1XML = "src/main/resources/xml/APPC_GetConfigParams.xml";
+ String callGraph2XML = "src/main/resources/xml/APPC_Configure.xml";
+ String callGraph3XML = "src/main/resources/xml/APPC_SetStatus.xml";
+ String callGraph4XML = "src/main/resources/xml/APPC_DownloadRestconfConfig.xml";
+ String callGraph5XML = "src/main/resources/xml/APPC_GenerateConfig.xml";
+ String callGraph6XML = "src/main/resources/xml/APPC_DownloadXmlConfig.xml";
+
+ // Register Call graphs
+ String injectGraphXmls[] = new String[] { commonConfigureXML,
+ callGraph1XML,
+ callGraph2XML,
+ callGraph3XML,
+ callGraph4XML,
+ callGraph5XML,
+ callGraph6XML };
+
+
+ Map<String, Object> serviceReferences = new HashMap<String, Object>();
+ serviceReferences.put("org.onap.sdnc.config.generator.convert.ConvertNode",new org.onap.sdnc.config.generator.convert.ConvertNode());
+ serviceReferences.put("org.onap.sdnc.config.generator.merge.MergeNode", new org.onap.sdnc.config.generator.merge.MergeNode());
+ serviceReferences.put("org.onap.appc.ccadaptor.ConfigComponentAdaptor", new MockConfigureNodeExecutor());
+
+ GraphKey graphKey = new GraphKey("APPC", null, "CommonConfiguration", null);
+ DGTestCase tc = new DGTestCase(graphKey);
+ tc.setInjectGraphXmls(injectGraphXmls);
+ tc.setServiceReferences(serviceReferences);
+ tc.setPropertyfileName(propertyfileName);
+
+ SvcLogicContext ctx = new SvcLogicContext();
+ processTestCase(tc, ctx);
+
+
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+
+ }
+
+
+
+
+ @Test
+ public void testGetConfigParamsFailure() {
+ try {
+ //DGXMLGenerator generator = new DGXMLGenerator();
+ //generator.generateXMLFromJSON(jsonPath, xmlpath, null);
+
+ String propertyfileName = "APPC/CommonConfiguration/GetConfigParamsFail.properties";
+
+ String commonConfigureXML = "src/main/resources/xml/APPC_CommonConfiguration.xml";
+
+
+ // Register Call graphs
+ String injectGraphXmls[] = new String[] { commonConfigureXML };
+
+ Map<String, Object> serviceReferences = new HashMap<String, Object>();
+
+
+
+ GraphKey graphKey = new GraphKey("APPC", null, "CommonConfiguration", null);
+ DGTestCase tc = new DGTestCase(graphKey);
+ tc.setInjectGraphXmls(injectGraphXmls);
+ tc.setServiceReferences(serviceReferences);
+ tc.setPropertyfileName(propertyfileName);
+
+
+
+ SvcLogicContext ctx = new SvcLogicContext();
+ processTestCase(tc, ctx);
+
+
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+
+ }
+
+
+ @Test
+ public void testInvalidRequestAction() {
+ try {
+ //DGXMLGenerator generator = new DGXMLGenerator();
+ //generator.generateXMLFromJSON(jsonPath, xmlpath, null);
+
+ String propertyfileName = "APPC/CommonConfiguration/InvalidRequestAction.properties";
+
+ String commonConfigureXML = "src/main/resources/xml/APPC_CommonConfiguration.xml";
+
+
+ // Register Call graphs
+ String injectGraphXmls[] = new String[] { commonConfigureXML };
+
+ Map<String, Object> serviceReferences = new HashMap<String, Object>();
+
+
+
+ GraphKey graphKey = new GraphKey("APPC", null, "CommonConfiguration", null);
+ DGTestCase tc = new DGTestCase(graphKey);
+ tc.setInjectGraphXmls(injectGraphXmls);
+ tc.setServiceReferences(serviceReferences);
+ tc.setPropertyfileName(propertyfileName);
+
+ SvcLogicContext ctx = new SvcLogicContext();
+ processTestCase(tc, ctx);
+
+
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+
+ }
+
+ @Test
+ public void testCommonConfigISBCTemplateSuccess() {
+ try {
+ //DGXMLGenerator generator = new DGXMLGenerator();
+ //generator.generateXMLFromJSON(jsonPath, xmlpath, null);
+
+ String propertyfileName = "APPC/CommonConfiguration/ISBCTemplateSuccess.properties";
+
+ String commonConfigureXML = "src/main/resources/xml/APPC_CommonConfiguration.xml";
+ String callGraph1XML = "src/main/resources/xml/APPC_GetConfigParams.xml";
+ String callGraph2XML = "src/main/resources/xml/APPC_Configure.xml";
+ String callGraph3XML = "src/main/resources/xml/APPC_SetStatus.xml";
+ String callGraph4XML = "src/main/resources/xml/APPC_GenerateTemplateConfig.xml";
+ String callGraph5XML = "src/main/resources/xml/APPC_CheckConfigStatus.xml";
+ String callGraph6XML = "src/main/resources/xml/APPC_DownloadIsbcConfig.xml";
+ String callGraph7XML = "src/main/resources/xml/APPC_UpdateAaiInfo.xml";
+ String callGraph8XML = "src/main/resources/xml/APPC_GetVfModuleInfo.xml";
+ String callGraph9XML = "src/main/resources/xml/APPC_SaveRunningConfig.xml";
+ String callGraph10XML = "src/main/resources/xml/APPC_GetDeviceRunningConfig.xml";
+
+ // Register Call graphs
+ String injectGraphXmls[] = new String[] { commonConfigureXML,
+ callGraph1XML,
+ callGraph2XML,
+ callGraph3XML,
+ callGraph4XML,
+ callGraph5XML,
+ callGraph6XML,
+ callGraph7XML,
+ callGraph8XML,
+ callGraph9XML,
+ callGraph10XML };
+
+ Map<String, Object> serviceReferences = new HashMap<String, Object>();
+ serviceReferences.put("org.onap.sdnc.config.generator.convert.ConvertNode",new org.onap.sdnc.config.generator.convert.ConvertNode());
+ serviceReferences.put("org.onap.sdnc.config.generator.merge.MergeNode", new org.onap.sdnc.config.generator.merge.MergeNode());
+
+
+
+ GraphKey graphKey = new GraphKey("APPC", null, "CommonConfiguration", null);
+ DGTestCase tc = new DGTestCase(graphKey);
+ tc.setInjectGraphXmls(injectGraphXmls);
+ tc.setServiceReferences(serviceReferences);
+ tc.setPropertyfileName(propertyfileName);
+
+ Map<String, Object> resourceReferences = new HashMap<String, Object>();
+ tc.setResourceReferences(resourceReferences);
+
+ SvcLogicContext ctx = new SvcLogicContext();
+ processTestCase(tc, ctx);
+