X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?p=it%2Fotf.git;a=blobdiff_plain;f=oran-ric-test-head%2Fworkflows%2FDelete_xAPP_Test.bpmn;fp=oran-ric-test-head%2Fworkflows%2FDelete_xAPP_Test.bpmn;h=98be1cc9521e99b7238edc775033ab9000b42554;hp=0000000000000000000000000000000000000000;hb=21c549fb35244f9078cf824908c7c312f2e89f06;hpb=7723a03d56c434459a639e7c85b9225892127640 diff --git a/oran-ric-test-head/workflows/Delete_xAPP_Test.bpmn b/oran-ric-test-head/workflows/Delete_xAPP_Test.bpmn new file mode 100644 index 0000000..98be1cc --- /dev/null +++ b/oran-ric-test-head/workflows/Delete_xAPP_Test.bpmn @@ -0,0 +1,214 @@ + + + + + SequenceFlow_03vt4gu + + + SequenceFlow_03vt4gu + SequenceFlow_1gceb7d + var System = java.lang.System + +var deleteVthId = 'delete' +var testData = execution.getVariable("testData") +var vthInput = execution.getVariable("vthInput") +var validInput = false; +var testResultMessage = ""; + +try{ + + var appName = testData['appName']; + + if(typeof appName !== 'string' || appName.trim() === ''){ + System.out.println("appName is not a string, or empty string") + throw Error("appName is not a string, or empty string") + } + + + validInput = true + + vthInput[deleteVthId].name = appName +} +catch(err){ + System.out.println(err) + validInput = false + testResultMessage = "Invalid input params. error: " + err; + execution.setVariable("testResult", "FAILED"); +} + +execution.setVariable("validInput", validInput) +execution.setVariable("testResultMessage", testResultMessage) + + + SequenceFlow_1gceb7d + SequenceFlow_1xykozf + SequenceFlow_035k1kv + + + + + ${validInput} + + + SequenceFlow_035k1kv + SequenceFlow_11htm0z + SequenceFlow_1ivi698 + execution.setVariable("testResult", "FAILED") + + + SequenceFlow_1fcorq2 + SequenceFlow_1s62i1u + execution.setVariable("testResult", "SUCCESS") + + + SequenceFlow_1czqxne + + + + + + + SequenceFlow_1hq011g + SequenceFlow_1fcorq2 + SequenceFlow_11htm0z + + + + ${deleted} + + + + + SequenceFlow_1rdc2w4 + SequenceFlow_1hq011g + var System = java.lang.System + +var deleteVthId = 'delete' +var testData = execution.getVariable("testData") +var vthInput = execution.getVariable("vthInput") +var deleted = false; +var testResultMessage = "RIC VTH reported that the xapp was not deleted." + + + +try { + //get output from delete call + var testExecution = execution.getVariable('otf-execution-testExecution'); + var data = null; + testExecution.testHeadResults.forEach(function(item, index, array) { + if(item.bpmnVthTaskId == deleteVthId ){ + data = item['testHeadResponse']['vthResponse']['resultData']['statusCode']; + } + }) + + if(data === 204){ + deleted = true + testResultMessage = "RIC VTH reported that the xapp was deleted." + } + +} +catch(err) { + deleted = false +} + +execution.setVariable("deleted", deleted); +execution.setVariable("testResultMessage", testResultMessage); + + + + SequenceFlow_1ivi698 + SequenceFlow_1s62i1u + SequenceFlow_1czqxne + + + SequenceFlow_1xykozf + SequenceFlow_1rdc2w4 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +