activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dej...@apache.org
Subject svn commit: r794240 - /activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/ThreeBrokerQueueNetworkTest.java
Date Wed, 15 Jul 2009 11:56:39 GMT
Author: dejanb
Date: Wed Jul 15 11:56:39 2009
New Revision: 794240

URL: http://svn.apache.org/viewvc?rev=794240&view=rev
Log:
modifying the tests so we can verify that all proxy consumers are closed

Modified:
    activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/ThreeBrokerQueueNetworkTest.java

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/ThreeBrokerQueueNetworkTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/ThreeBrokerQueueNetworkTest.java?rev=794240&r1=794239&r2=794240&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/ThreeBrokerQueueNetworkTest.java
(original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/ThreeBrokerQueueNetworkTest.java
Wed Jul 15 11:56:39 2009
@@ -468,7 +468,7 @@
 
         // Setup consumers
         String brokerName = "BrokerA";
-        createConsumer(brokerName, dest);
+        MessageConsumer consumer = createConsumer(brokerName, dest);
         
         // wait for advisories
         Thread.sleep(2000);
@@ -479,8 +479,18 @@
             BrokerService broker = i.next().broker;
             verifyConsumerCount(broker, 1, dest);
         }
+        
+        consumer.close();
+        
+        // wait for advisories
+        Thread.sleep(2000);
+        
+        // verify there is no more consumers
+        for (Iterator<BrokerItem> i = brokerList.iterator(); i.hasNext();) {
+            BrokerService broker = i.next().broker;
+            verifyConsumerCount(broker, 0, dest);
+        }
     }
-
     
 
     public void testNoDuplicateQueueSubsHasLowestPriority() throws Exception {
@@ -552,7 +562,7 @@
 
         // Setup consumers
         String brokerName = "BrokerA";
-        createConsumer(brokerName, dest);
+        MessageConsumer consumer = createConsumer(brokerName, dest);
         
         // wait for advisories
         Thread.sleep(2000);
@@ -569,6 +579,16 @@
                 verifyConsumePriority(broker, ConsumerInfo.NORMAL_PRIORITY, dest);
             }
         }
+        
+        consumer.close();
+        
+        // wait for advisories
+        Thread.sleep(2000);
+        
+        for (Iterator<BrokerItem> i = brokerList.iterator(); i.hasNext();) {
+            BrokerService broker = i.next().broker;
+            verifyConsumerCount(broker, 0, dest);
+        }
     }
 
     private void verifyConsumerCount(BrokerService broker, int count, final Destination dest)
throws Exception {



Mime
View raw message