activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r643461 - /activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/MultiBrokersMultiClientsTest.java
Date Tue, 01 Apr 2008 16:02:23 GMT
Author: chirino
Date: Tue Apr  1 09:02:19 2008
New Revision: 643461

URL: http://svn.apache.org/viewvc?rev=643461&view=rev
Log:
Wait for the queue consumers to connect before sending the messages.

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

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/MultiBrokersMultiClientsTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/MultiBrokersMultiClientsTest.java?rev=643461&r1=643460&r2=643461&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/MultiBrokersMultiClientsTest.java
(original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/MultiBrokersMultiClientsTest.java
Tue Apr  1 09:02:19 2008
@@ -35,7 +35,7 @@
     public static final int BROKER_COUNT = 2; // number of brokers to network
     public static final int CONSUMER_COUNT = 3; // consumers per broker
     public static final int PRODUCER_COUNT = 3; // producers per broker
-    public static final int MESSAGE_COUNT = 10; // messages per producer
+    public static final int MESSAGE_COUNT = 20; // messages per producer
 
     protected Map consumerMap;
 
@@ -68,7 +68,7 @@
             }
         }
 
-        assertTrue("Missing " + latch.getCount() + " messages", latch.await(30, TimeUnit.SECONDS));
+        assertTrue("Missing " + latch.getCount() + " messages", latch.await(45, TimeUnit.SECONDS));
 
         // Get message count
         for (int i = 1; i <= BROKER_COUNT; i++) {
@@ -97,7 +97,10 @@
         }
 
         // wait for consumers to get propagated
-        Thread.sleep(5000);
+        for (int i = 1; i <= BROKER_COUNT; i++) {
+        	// all consumers on the remote brokers look like 1 consumer to the local broker.
+        	assertConsumersConnect("Broker" + i, dest, (BROKER_COUNT-1)+CONSUMER_COUNT, 30000);
+        }
 
         // Send messages
         for (int i = 1; i <= BROKER_COUNT; i++) {
@@ -107,7 +110,7 @@
         }
 
         // Wait for messages to be delivered
-        assertTrue("Missing " + latch.getCount() + " messages", latch.await(30, TimeUnit.SECONDS));
+        assertTrue("Missing " + latch.getCount() + " messages", latch.await(45, TimeUnit.SECONDS));
 
         // Get message count
         int totalMsg = 0;



Mime
View raw message