From f4b277d575a49778ad0e5940a539f0571ac5677d Mon Sep 17 00:00:00 2001 From: Jim Hahn Date: Sun, 5 Nov 2017 18:51:54 -0500 Subject: Moved sleep to macro flow Added new method to "Await AAI Distribution" to macro flow and moved sleep there. Added junit test for new method and updated existing tests. Change-Id: I91c8a787669a0fc8cf2038a4cfb6f6229d3949e2 Issue-Id: SO-303 Signed-off-by: Jim Hahn --- .../vcpe/scripts/CreateVcpeResCustService.groovy | 18 ++++ .../scripts/DoCreateAllottedResourceTXC.groovy | 13 +-- .../process/CreateVcpeResCustService.bpmn | 106 ++++++++++++--------- 3 files changed, 82 insertions(+), 55 deletions(-) (limited to 'bpmn/MSOInfrastructureBPMN/src/main') diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/vcpe/scripts/CreateVcpeResCustService.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/vcpe/scripts/CreateVcpeResCustService.groovy index 85ff43946d..dba1a8b581 100644 --- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/vcpe/scripts/CreateVcpeResCustService.groovy +++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/vcpe/scripts/CreateVcpeResCustService.groovy @@ -363,6 +363,24 @@ public class CreateVcpeResCustService extends AbstractServiceTaskProcessor { } + public void awaitAaiDistribution(Execution execution) { + def isDebugEnabled=execution.getVariable(DebugFlag) + + try { + String tsleep = execution.getVariable("junitSleepMs") + + //workaround for aai replication issue + utils.log("DEBUG", "sleeping while AAI distributes data", isDebugEnabled) + sleep(tsleep == null ? 30000 : tsleep as Long) + + } catch (Exception ex) { + // try error in method block + String exceptionMessage = "Unexpected Error from method awaitAaiDistribution() - " + ex.getMessage() + exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage) + } + } + + public void prepareCreateAllottedResourceTXC(Execution execution) { def isDebugEnabled=execution.getVariable(DebugFlag) diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoCreateAllottedResourceTXC.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoCreateAllottedResourceTXC.groovy index c721ae833b..8a4e591654 100644 --- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoCreateAllottedResourceTXC.groovy +++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoCreateAllottedResourceTXC.groovy @@ -80,18 +80,7 @@ public class DoCreateAllottedResourceTXC extends AbstractServiceTaskProcessor{ try { String msoRequestId = execution.getVariable("msoRequestId") utils.log("DEBUG", " msoRequestId = " + msoRequestId, isDebugEnabled) - - if ((msoRequestId == null) || ("testRequestId".equals(msoRequestId)) || ("testRequestId123".equals(msoRequestId))) - { - utils.log("DEBUG"," ***** NOT sleeping 30 seconds for Junit *****", isDebugEnabled) - } - else - { - utils.log("DEBUG"," ***** sleeping 30 seconds for AAI replication *****", isDebugEnabled) - sleep(30000); - utils.log("DEBUG"," ***** sleep over *****", isDebugEnabled) - } - + execution.setVariable("prefix", Prefix) //Config Inputs diff --git a/bpmn/MSOInfrastructureBPMN/src/main/resources/process/CreateVcpeResCustService.bpmn b/bpmn/MSOInfrastructureBPMN/src/main/resources/process/CreateVcpeResCustService.bpmn index 02f7f4815a..3c5e26874a 100644 --- a/bpmn/MSOInfrastructureBPMN/src/main/resources/process/CreateVcpeResCustService.bpmn +++ b/bpmn/MSOInfrastructureBPMN/src/main/resources/process/CreateVcpeResCustService.bpmn @@ -368,7 +368,7 @@ CreateVcpeResCustService.prepareCreateServiceInstance(execution)]]>SequenceFlow_0vj46ej SequenceFlow_13uceka - + SequenceFlow_1ky2sv9 SequenceFlow_0vj46ej @@ -431,7 +431,7 @@ CreateVcpeResCustService.prepareCreateAllottedResourceTXC(execution)]]> - SequenceFlow_13uceka + SequenceFlow_16acruh @@ -471,36 +471,11 @@ CreateVcpeResCustService.prepareCreateAllottedResourceTXC(execution)]]>SequenceFlow_0e9e6fo SequenceFlow_0hwsm6n - - - - - - - - - - - - - - - - - - - - - - SequenceFlow_0b5ztoe - SequenceFlow_0e9e6fo - - SequenceFlow_15vce9o SequenceFlow_0yecpl2 @@ -616,6 +591,39 @@ def CreateVcpeResCustService= new CreateVcpeResCustService() CreateVcpeResCustService.validateVnfCreate(execution)]]> + + + + + + + + + + + + + + + + + + + + + + SequenceFlow_0b5ztoe + SequenceFlow_0e9e6fo + + + + SequenceFlow_13uceka + SequenceFlow_16acruh + + + @@ -915,9 +923,9 @@ CreateVcpeResCustService.validateVnfCreate(execution)]]> - + - + @@ -1143,9 +1151,9 @@ CreateVcpeResCustService.validateVnfCreate(execution)]]> - + - + @@ -1261,9 +1269,6 @@ CreateVcpeResCustService.validateVnfCreate(execution)]]> - - - @@ -1287,15 +1292,7 @@ CreateVcpeResCustService.validateVnfCreate(execution)]]> - - - - - - - - - + @@ -1500,6 +1497,29 @@ CreateVcpeResCustService.validateVnfCreate(execution)]]> + + + + + + + + + + + + + + + + + + + + + + + -- cgit 1.2.3-korg