aboutsummaryrefslogtreecommitdiffstats
path: root/bpmn/MSOInfrastructureBPMN/src/main/groovy
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2017-11-05 18:51:54 -0500
committerJim Hahn <jrh3@att.com>2017-11-05 18:51:54 -0500
commitf4b277d575a49778ad0e5940a539f0571ac5677d (patch)
tree0e6725dbac9fb1ce2ac4a26b5bd8ada6af1c3ace /bpmn/MSOInfrastructureBPMN/src/main/groovy
parent66dc783944bd8883dc8f784c8f223e5f89ee1471 (diff)
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 <jrh3@att.com>
Diffstat (limited to 'bpmn/MSOInfrastructureBPMN/src/main/groovy')
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/vcpe/scripts/CreateVcpeResCustService.groovy18
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoCreateAllottedResourceTXC.groovy13
2 files changed, 19 insertions, 12 deletions
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