activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gtu...@apache.org
Subject svn commit: r1076283 - /activemq/trunk/activemq-spring/src/test/java/org/apache/activemq/spring/ListenerTest.java
Date Wed, 02 Mar 2011 16:40:23 GMT
Author: gtully
Date: Wed Mar  2 16:40:22 2011
New Revision: 1076283

URL: http://svn.apache.org/viewvc?rev=1076283&view=rev
Log:
remove hard coded wait time, use condition, resolve failure

Modified:
    activemq/trunk/activemq-spring/src/test/java/org/apache/activemq/spring/ListenerTest.java

Modified: activemq/trunk/activemq-spring/src/test/java/org/apache/activemq/spring/ListenerTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-spring/src/test/java/org/apache/activemq/spring/ListenerTest.java?rev=1076283&r1=1076282&r2=1076283&view=diff
==============================================================================
--- activemq/trunk/activemq-spring/src/test/java/org/apache/activemq/spring/ListenerTest.java
(original)
+++ activemq/trunk/activemq-spring/src/test/java/org/apache/activemq/spring/ListenerTest.java
Wed Mar  2 16:40:22 2011
@@ -16,6 +16,7 @@
  */
 package org.apache.activemq.spring;
 
+import org.apache.activemq.util.Wait;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.junit.Assert;
@@ -60,7 +61,11 @@ public class ListenerTest {
     public void testComposite() throws Exception {
         sendMessages("TEST.1,TEST.2,TEST.3,TEST.4,TEST.5,TEST.6", msgNum);
 
-        Thread.sleep(3000);
+        Wait.waitFor(new Wait.Condition() {
+            public boolean isSatisified() throws Exception {
+                return (6 * msgNum) <= listener.messages.size();
+            }
+        });
 
         LOG.info("messages received= " + listener.messages.size());
         Assert.assertEquals(6 * msgNum, listener.messages.size());



Mime
View raw message