activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gtu...@apache.org
Subject svn commit: r904450 - /activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/region/cursors/NegativeQueueTest.java
Date Fri, 29 Jan 2010 10:22:51 GMT
Author: gtully
Date: Fri Jan 29 10:22:47 2010
New Revision: 904450

URL: http://svn.apache.org/viewvc?rev=904450&view=rev
Log:
wait for queues to drain, intermittent failure

Modified:
    activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/region/cursors/NegativeQueueTest.java

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/region/cursors/NegativeQueueTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/region/cursors/NegativeQueueTest.java?rev=904450&r1=904449&r2=904450&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/region/cursors/NegativeQueueTest.java
(original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/region/cursors/NegativeQueueTest.java
Fri Jan 29 10:22:47 2010
@@ -35,7 +35,6 @@
 import javax.jms.Queue;
 import javax.jms.Session;
 import javax.jms.TextMessage;
-import javax.management.MBeanServerInvocationHandler;
 import javax.management.MalformedObjectNameException;
 import javax.management.ObjectName;
 
@@ -51,6 +50,7 @@
 import org.apache.activemq.usage.StoreUsage;
 import org.apache.activemq.usage.SystemUsage;
 import org.apache.activemq.usage.TempUsage;
+import org.apache.activemq.util.Wait;
 
 /**
  * Modified CursorSupport Unit test to reproduce the negative queue issue.
@@ -224,8 +224,17 @@
             System.out.println("Queue2 Size = "+proxyQueue2.getQueueSize());
             System.out.println("Queue2 Memory % Used = "+proxyQueue2.getMemoryPercentUsage());
         }
-        
+
+        Wait.waitFor(new Wait.Condition() {
+            public boolean isSatisified() throws Exception {
+                return 0 == proxyQueue1.getQueueSize();
+            }});
         assertEquals("Queue1 has gone negative,",0, proxyQueue1.getQueueSize());
+        
+        Wait.waitFor(new Wait.Condition() {
+            public boolean isSatisified() throws Exception {
+                return 0 == proxyQueue2.getQueueSize();
+            }});
         assertEquals("Queue2 has gone negative,",0, proxyQueue2.getQueueSize());
         proxyConnection.close();
         



Mime
View raw message