aboutsummaryrefslogtreecommitdiffstats
path: root/bpmn
diff options
context:
space:
mode:
Diffstat (limited to 'bpmn')
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/SDNOValidator.java11
-rw-r--r--bpmn/MSOCoreBPMN/src/test/java/org/openecomp/mso/bpmn/core/JsonUtilsTest.java16
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/vcpe/workflow/WorkflowAsyncVcpeResource.java45
3 files changed, 11 insertions, 61 deletions
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/SDNOValidator.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/SDNOValidator.java
index 950dc7b83b..eb18e10bc3 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/SDNOValidator.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/SDNOValidator.java
@@ -22,9 +22,16 @@ package org.openecomp.mso.client.sdno;
import java.io.IOException;
-@FunctionalInterface
public interface SDNOValidator {
- void healthDiagnostic(String vnfName, String uuid) throws IOException, Exception;
+ /**
+ * Issues a health diagnostic request for a given vnf to SDN-O
+ *
+ * @param vnfName
+ * @param uuid
+ * @throws IOException
+ * @throws Exception
+ */
+ public void healthDiagnostic(String vnfName, String uuid) throws IOException, Exception;
}
diff --git a/bpmn/MSOCoreBPMN/src/test/java/org/openecomp/mso/bpmn/core/JsonUtilsTest.java b/bpmn/MSOCoreBPMN/src/test/java/org/openecomp/mso/bpmn/core/JsonUtilsTest.java
index 6f65371ef2..7f922ce30e 100644
--- a/bpmn/MSOCoreBPMN/src/test/java/org/openecomp/mso/bpmn/core/JsonUtilsTest.java
+++ b/bpmn/MSOCoreBPMN/src/test/java/org/openecomp/mso/bpmn/core/JsonUtilsTest.java
@@ -162,26 +162,24 @@ public class JsonUtilsTest {
try {
fis = new FileInputStream(file);
BufferedReader br = new BufferedReader(new InputStreamReader(fis));
-// jsonReq = br.readLine();
CharBuffer cbuf = CharBuffer.allocate((int)file.length()+1);
br.read(cbuf);
cbuf.flip();
jsonReq = cbuf.toString();
if (jsonReq != null) {
- System.out.println("initialize(): json request: " + jsonReq);
+ System.out.println("initialize(): json request: " + jsonReq);
} else {
System.out.println("initialize(): failed to read json request from src/test/resources/request.json");
}
fis.close();
fis = new FileInputStream(file2);
br = new BufferedReader(new InputStreamReader(fis));
-// jsonReqArray = br.readLine();
cbuf = CharBuffer.allocate((int)file.length()+1);
br.read(cbuf);
cbuf.flip();
jsonReqArray = cbuf.toString();
if (jsonReq != null) {
- System.out.println("initialize(): json request w/ array: " + jsonReqArray);
+ System.out.println("initialize(): json request w/ array: " + jsonReqArray);
} else {
System.out.println("initialize(): failed to read json request from src/test/resources/request2.json");
}
@@ -220,14 +218,11 @@ public class JsonUtilsTest {
// strip all the non-data whitespace
xmlOut = xmlOut.replaceAll(">\\s*<", "><");
-// System.out.println("testConversion(): xml in: " + xmlIn);
-// System.out.println("testConversion(): xml out: " + xmlOut);
Diff diffXml;
try {
diffXml = new Diff(xmlIn, xmlOut);
Assert.assertTrue(diffXml.similar());
-// Assert.assertTrue(diffXml.identical());
} catch (SAXException e) {
e.printStackTrace();
} catch (IOException e) {
@@ -259,7 +254,6 @@ public class JsonUtilsTest {
Assert.assertEquals(value, null);
// retrieving a parameter/array value (originally a XML attribute)
value = JsonUtils.getJsonParamValue(json, "vnf-request.vnf-params.param", "name");
-// Assert.assertEquals(value, "[{\"content\":\"network1111\",\"name\":\"network\"},{\"content\":\"server1111\",\"name\":\"server\"}]");
Assert.assertEquals(value, "network");
value = JsonUtils.getJsonParamValue(json, "vnf-request.vnf-params.param", "content");
Assert.assertEquals(value, "network1111");
@@ -288,7 +282,6 @@ public class JsonUtilsTest {
System.out.println("testUpdate(): xml request to json: " + json);
// the add should be successful
String jsonUpd = JsonUtils.addJsonValue(json, "vnf-request.request-info.comment", "Some comment");
-// System.out.println("testUpdate(): post add json request: " + jsonUpd);
String value = JsonUtils.getJsonValue(jsonUpd, "vnf-request.request-info.comment");
Assert.assertEquals(value, "Some comment");
// the add should be ignored as the field already exists
@@ -297,12 +290,10 @@ public class JsonUtilsTest {
Assert.assertEquals(value, "STMTN5MMSC21");
// the update should be successful
jsonUpd = JsonUtils.updJsonValue(jsonUpd, "vnf-request.vnf-inputs.vnf-name", "STMTN5MMSC22");
-// System.out.println("testUpdate(): post update json request: " + jsonUpd);
value = JsonUtils.getJsonValue(jsonUpd, "vnf-request.vnf-inputs.vnf-name");
Assert.assertEquals(value, "STMTN5MMSC22");
// the delete should be successful
jsonUpd = JsonUtils.delJsonValue(jsonUpd, "vnf-request.request-info.comment");
-// System.out.println("testUpdate(): post delete json request: " + jsonUpd);
value = JsonUtils.getJsonValue(jsonUpd, "vnf-request.request-info.comment");
Assert.assertEquals(value, null);
// the delete should fail as field 'vnf-model' does not exist
@@ -352,14 +343,11 @@ public class JsonUtilsTest {
xmlOut = xmlOut.replaceAll(">\\s*<", "><");
System.out.println("testConversionArray(): XML after removing whitespace:" + xmlOut);
String xmlTest = xmlArrayReq.replaceAll(">\\s*<", "><");
-// System.out.println("testConversion(): xml test: " + xmlTest);
-// System.out.println("testConversion(): xml out: " + xmlOut);
Diff diffXml;
try {
diffXml = new Diff(xmlTest, xmlOut);
Assert.assertTrue(diffXml.similar());
-// Assert.assertTrue(diffXml.identical());
} catch (SAXException e) {
e.printStackTrace();
} catch (IOException e) {
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/vcpe/workflow/WorkflowAsyncVcpeResource.java b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/vcpe/workflow/WorkflowAsyncVcpeResource.java
deleted file mode 100644
index f1224da30c..0000000000
--- a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/vcpe/workflow/WorkflowAsyncVcpeResource.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-package org.openecomp.mso.bpmn.vcpe.workflow;
-
-import javax.ws.rs.Path;
-
-import org.camunda.bpm.engine.ProcessEngineServices;
-import org.camunda.bpm.engine.ProcessEngines;
-import org.openecomp.mso.bpmn.common.workflow.service.WorkflowAsyncResource;
-
-
-/**
- *
- * @version 1.0
- * Asynchronous Workflow processing using JAX RS RESTeasy implementation
- * Both Synchronous and Asynchronous BPMN process can benefit from this implementation since the workflow gets executed in the background
- * and the server thread is freed up, server scales better to process more incoming requests
- *
- * Usage: For synchronous process, when you are ready to send the response invoke the callback to write the response
- * For asynchronous process - the activity may send a acknowledgement response and then proceed further on executing the process
- */
-@Path("/async")
-public class WorkflowAsyncVcpeResource extends WorkflowAsyncResource {
-
- protected ProcessEngineServices getProcessEngineServices() {
- return pes4junit.orElse(ProcessEngines.getProcessEngine("vcpe"));
- }
-}