From a5ee130beafd59c5782541a61e56db0c6c3823b2 Mon Sep 17 00:00:00 2001 From: "Hiram R. Chirino" Date: Tue, 21 Mar 2006 16:09:33 +0000 Subject: [PATCH] Allow previous messages to drain before doing the real test. (makes the test more reliable) git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@387563 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/test/java/org/apache/activemq/spring/SpringTest.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/activemq-core/src/test/java/org/apache/activemq/spring/SpringTest.java b/activemq-core/src/test/java/org/apache/activemq/spring/SpringTest.java index 8184be41bb..440a393ffd 100755 --- a/activemq-core/src/test/java/org/apache/activemq/spring/SpringTest.java +++ b/activemq-core/src/test/java/org/apache/activemq/spring/SpringTest.java @@ -95,11 +95,14 @@ public class SpringTest extends TestCase { assertTrue("Found a valid consumer", consumer != null); consumer.start(); + + // Wait a little to drain any left over messages. + Thread.sleep(1000); + consumer.flushMessages(); producer = (SpringProducer) context.getBean("producer"); assertTrue("Found a valid producer", producer != null); - consumer.flushMessages(); producer.start(); // lets sleep a little to give the JMS time to dispatch stuff