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
This commit is contained in:
Hiram R. Chirino 2006-03-21 16:09:33 +00:00
parent 4757b273d1
commit a5ee130bea
1 changed files with 4 additions and 1 deletions

View File

@ -95,11 +95,14 @@ public class SpringTest extends TestCase {
assertTrue("Found a valid consumer", consumer != null); assertTrue("Found a valid consumer", consumer != null);
consumer.start(); consumer.start();
// Wait a little to drain any left over messages.
Thread.sleep(1000);
consumer.flushMessages();
producer = (SpringProducer) context.getBean("producer"); producer = (SpringProducer) context.getBean("producer");
assertTrue("Found a valid producer", producer != null); assertTrue("Found a valid producer", producer != null);
consumer.flushMessages();
producer.start(); producer.start();
// lets sleep a little to give the JMS time to dispatch stuff // lets sleep a little to give the JMS time to dispatch stuff