From 7df5c3bdccec1c09e1653f317ee15be3bc23138a Mon Sep 17 00:00:00 2001 From: Bosanac Dejan Date: Wed, 11 Apr 2012 15:03:03 +0000 Subject: [PATCH] ClientRebalanceTest - fix the test to avoid occasional hang git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1324799 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/activemq/usecases/ClientRebalanceTest.java | 9 +++++---- .../org/apache/activemq/usecases/rebalance-broker1.xml | 4 ++-- .../org/apache/activemq/usecases/rebalance-broker2.xml | 4 ++-- .../org/apache/activemq/usecases/rebalance-broker3.xml | 4 ++-- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/activemq-core/src/test/java/org/apache/activemq/usecases/ClientRebalanceTest.java b/activemq-core/src/test/java/org/apache/activemq/usecases/ClientRebalanceTest.java index b07cf127f4..e00eb70b10 100644 --- a/activemq-core/src/test/java/org/apache/activemq/usecases/ClientRebalanceTest.java +++ b/activemq-core/src/test/java/org/apache/activemq/usecases/ClientRebalanceTest.java @@ -37,6 +37,7 @@ public class ClientRebalanceTest extends JmsMultipleBrokersTestSupport { super.setUp(); } + public void testRebalance() throws Exception { createBroker(new ClassPathResource("org/apache/activemq/usecases/rebalance-broker1.xml")); createBroker(new ClassPathResource("org/apache/activemq/usecases/rebalance-broker2.xml")); @@ -62,15 +63,15 @@ public class ClientRebalanceTest extends JmsMultipleBrokersTestSupport { // introduce third broker createBroker(new ClassPathResource("org/apache/activemq/usecases/rebalance-broker3.xml")); brokers.get("b3").broker.waitUntilStarted(); - - Thread.sleep(1000); + + Thread.sleep(3000); LOG.info("Stopping broker 1"); brokers.get("b1").broker.stop(); brokers.get("b1").broker.waitUntilStopped(); - - Thread.sleep(1000); + + Thread.sleep(3000); // should reconnect to some of the remaining brokers producer.send(message); msg = consumer.receive(2000); diff --git a/activemq-core/src/test/resources/org/apache/activemq/usecases/rebalance-broker1.xml b/activemq-core/src/test/resources/org/apache/activemq/usecases/rebalance-broker1.xml index 5a12c4ef58..44234ad8ee 100644 --- a/activemq-core/src/test/resources/org/apache/activemq/usecases/rebalance-broker1.xml +++ b/activemq-core/src/test/resources/org/apache/activemq/usecases/rebalance-broker1.xml @@ -1,8 +1,8 @@ - - + + diff --git a/activemq-core/src/test/resources/org/apache/activemq/usecases/rebalance-broker2.xml b/activemq-core/src/test/resources/org/apache/activemq/usecases/rebalance-broker2.xml index 008bace3f0..a9167c9c1a 100644 --- a/activemq-core/src/test/resources/org/apache/activemq/usecases/rebalance-broker2.xml +++ b/activemq-core/src/test/resources/org/apache/activemq/usecases/rebalance-broker2.xml @@ -2,8 +2,8 @@ - - + + diff --git a/activemq-core/src/test/resources/org/apache/activemq/usecases/rebalance-broker3.xml b/activemq-core/src/test/resources/org/apache/activemq/usecases/rebalance-broker3.xml index f770d51a8e..d5655b5052 100644 --- a/activemq-core/src/test/resources/org/apache/activemq/usecases/rebalance-broker3.xml +++ b/activemq-core/src/test/resources/org/apache/activemq/usecases/rebalance-broker3.xml @@ -1,8 +1,8 @@ - - + +