From 0c95a8f5bc9f2785acbf6521df6c8b3efd68fa92 Mon Sep 17 00:00:00 2001 From: Gary Russell Date: Fri, 25 Jan 2013 13:30:41 -0500 Subject: [PATCH] INT-2902 Fix Groovy Test Timing Problem A message could be released by the delayer before the scheduler was destroyed. --- .../groovy/GroovyControlBusIntegrationTests-context.xml | 2 +- .../groovy/GroovyControlBusIntegrationTests.java | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/spring-integration-groovy/src/test/java/org/springframework/integration/groovy/GroovyControlBusIntegrationTests-context.xml b/spring-integration-groovy/src/test/java/org/springframework/integration/groovy/GroovyControlBusIntegrationTests-context.xml index c55ef0b749..fdb9e56692 100644 --- a/spring-integration-groovy/src/test/java/org/springframework/integration/groovy/GroovyControlBusIntegrationTests-context.xml +++ b/spring-integration-groovy/src/test/java/org/springframework/integration/groovy/GroovyControlBusIntegrationTests-context.xml @@ -22,7 +22,7 @@ diff --git a/spring-integration-groovy/src/test/java/org/springframework/integration/groovy/GroovyControlBusIntegrationTests.java b/spring-integration-groovy/src/test/java/org/springframework/integration/groovy/GroovyControlBusIntegrationTests.java index cb1b6b466a..4363f349a4 100644 --- a/spring-integration-groovy/src/test/java/org/springframework/integration/groovy/GroovyControlBusIntegrationTests.java +++ b/spring-integration-groovy/src/test/java/org/springframework/integration/groovy/GroovyControlBusIntegrationTests.java @@ -63,7 +63,8 @@ public class GroovyControlBusIntegrationTests { this.delayerInput.send(testMessage); this.scheduler.destroy(); - assertNull(this.output.receive(100)); + // ensure the delayer did not release any messages + assertNull(this.output.receive(500)); this.scheduler.afterPropertiesSet(); Resource scriptResource = new ClassPathResource("GroovyControlBusDelayerManagementTest.groovy", this.getClass()); @@ -71,7 +72,7 @@ public class GroovyControlBusIntegrationTests { Message message = MessageBuilder.withPayload(scriptSource.getScriptAsString()).build(); this.controlBus.send(message); - assertNotNull(this.output.receive(100)); - assertNotNull(this.output.receive(100)); + assertNotNull(this.output.receive(1000)); + assertNotNull(this.output.receive(1000)); } }