activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gtu...@apache.org
Subject svn commit: r1084902 - /activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/failover/FailoverClusterTest.java
Date Thu, 24 Mar 2011 11:29:26 GMT
Author: gtully
Date: Thu Mar 24 11:29:26 2011
New Revision: 1084902

URL: http://svn.apache.org/viewvc?rev=1084902&view=rev
Log:
remove hard dependency on free ports

Modified:
    activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/failover/FailoverClusterTest.java

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/failover/FailoverClusterTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/failover/FailoverClusterTest.java?rev=1084902&r1=1084901&r2=1084902&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/failover/FailoverClusterTest.java
(original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/failover/FailoverClusterTest.java
Thu Mar 24 11:29:26 2011
@@ -36,8 +36,7 @@ import org.apache.activemq.network.Netwo
 public class FailoverClusterTest extends TestCase {
 
     private static final int NUMBER = 10;
-    private static final String BROKER_A_BIND_ADDRESS = "tcp://0.0.0.0:61616";
-    private static final String BROKER_B_BIND_ADDRESS = "tcp://0.0.0.0:61617";
+    private static final String BROKER_BIND_ADDRESS = "tcp://0.0.0.0:0";
     private static final String BROKER_A_NAME = "BROKERA";
     private static final String BROKER_B_NAME = "BROKERB";
     private BrokerService brokerA;
@@ -50,7 +49,7 @@ public class FailoverClusterTest extends
     public void testClusterConnectedAfterClients() throws Exception {
         createClients();
         if (brokerB == null) {
-            brokerB = createBrokerB(BROKER_B_BIND_ADDRESS);
+            brokerB = createBrokerB(BROKER_BIND_ADDRESS);
         }
         Thread.sleep(3000);
         Set<String> set = new HashSet<String>();
@@ -64,7 +63,7 @@ public class FailoverClusterTest extends
         createClients();
         if (brokerB == null) {
             // add in server side only url param, should not be propagated
-            brokerB = createBrokerB(BROKER_B_BIND_ADDRESS + "?transport.closeAsync=false");
+            brokerB = createBrokerB(BROKER_BIND_ADDRESS + "?transport.closeAsync=false");
         }
         Thread.sleep(3000);
         Set<String> set = new HashSet<String>();
@@ -78,7 +77,7 @@ public class FailoverClusterTest extends
     public void testClusterConnectedBeforeClients() throws Exception {
 
         if (brokerB == null) {
-            brokerB = createBrokerB(BROKER_B_BIND_ADDRESS);
+            brokerB = createBrokerB(BROKER_BIND_ADDRESS);
         }
         Thread.sleep(5000);
         createClients();
@@ -86,7 +85,7 @@ public class FailoverClusterTest extends
         brokerA.stop();
         Thread.sleep(2000);
 
-        URI brokerBURI = new URI(BROKER_B_BIND_ADDRESS);
+        URI brokerBURI = new URI( brokerB.getTransportConnectors().get(0).getPublishableConnectString());
         for (ActiveMQConnection c : connections) {
             String addr = c.getTransportChannel().getRemoteAddress();
             assertTrue(addr.indexOf("" + brokerBURI.getPort()) > 0);
@@ -96,7 +95,7 @@ public class FailoverClusterTest extends
     @Override
     protected void setUp() throws Exception {
         if (brokerA == null) {
-            brokerA = createBrokerA(BROKER_A_BIND_ADDRESS + "?transport.closeAsync=false");
+            brokerA = createBrokerA(BROKER_BIND_ADDRESS + "?transport.closeAsync=false");
             clientUrl = "failover://(" + brokerA.getTransportConnectors().get(0).getPublishableConnectString()
+ ")";
         }
     }
@@ -144,7 +143,7 @@ public class FailoverClusterTest extends
     protected void configureNetwork(BrokerService answer, String uri) throws Exception {
         answer.setBrokerName(BROKER_B_NAME);
         answer.setPersistent(false);
-        NetworkConnector network = answer.addNetworkConnector("static://" + BROKER_A_BIND_ADDRESS);
+        NetworkConnector network = answer.addNetworkConnector("static://" + brokerA.getTransportConnectors().get(0).getPublishableConnectString());
         network.setDuplex(true);
         TransportConnector connector = answer.addConnector(uri);
         connector.setRebalanceClusterClients(true);



Mime
View raw message