activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gtu...@apache.org
Subject svn commit: r906451 - /activemq/branches/activemq-5.3/activemq-core/src/test/java/org/apache/activemq/broker/region/cursors/NegativeQueueTest.java
Date Thu, 04 Feb 2010 11:11:08 GMT
Author: gtully
Date: Thu Feb  4 11:11:07 2010
New Revision: 906451

URL: http://svn.apache.org/viewvc?rev=906451&view=rev
Log:
merge -c 904450 https://svn.apache.org/repos/asf/activemq/trunk - wait for queues to drain,
intermittent failure

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

Modified: activemq/branches/activemq-5.3/activemq-core/src/test/java/org/apache/activemq/broker/region/cursors/NegativeQueueTest.java
URL: http://svn.apache.org/viewvc/activemq/branches/activemq-5.3/activemq-core/src/test/java/org/apache/activemq/broker/region/cursors/NegativeQueueTest.java?rev=906451&r1=906450&r2=906451&view=diff
==============================================================================
--- activemq/branches/activemq-5.3/activemq-core/src/test/java/org/apache/activemq/broker/region/cursors/NegativeQueueTest.java
(original)
+++ activemq/branches/activemq-5.3/activemq-core/src/test/java/org/apache/activemq/broker/region/cursors/NegativeQueueTest.java
Thu Feb  4 11:11:07 2010
@@ -36,7 +36,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;
 
@@ -52,6 +51,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.
@@ -225,8 +225,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