activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r1239283 - /activemq/trunk/activemq-core/src/test/java/org/apache/activemq/bugs/TempStorageBlockedBrokerTest.java
Date Wed, 01 Feb 2012 19:37:30 GMT
Author: tabish
Date: Wed Feb  1 19:37:29 2012
New Revision: 1239283

URL: http://svn.apache.org/viewvc?rev=1239283&view=rev
Log:
Update test so that its not using a fixed port for the brokerUri.

Modified:
    activemq/trunk/activemq-core/src/test/java/org/apache/activemq/bugs/TempStorageBlockedBrokerTest.java

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/bugs/TempStorageBlockedBrokerTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/bugs/TempStorageBlockedBrokerTest.java?rev=1239283&r1=1239282&r2=1239283&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/bugs/TempStorageBlockedBrokerTest.java
(original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/bugs/TempStorageBlockedBrokerTest.java
Wed Feb  1 19:37:29 2012
@@ -59,11 +59,13 @@ public class TempStorageBlockedBrokerTes
 
     Destination destination = new ActiveMQTopic("FooTwo");
 
+    private String connectionUri;
+
     public void testRunProducerWithHungConsumer() throws Exception {
 
         final long origTempUsage = broker.getSystemUsage().getTempUsage().getUsage();
 
-        ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory("tcp://localhost:61618");
+        ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory(connectionUri);
         // ensure messages are spooled to disk for this consumer
         ActiveMQPrefetchPolicy prefetch = new ActiveMQPrefetchPolicy();
         prefetch.setTopicPrefetch(10);
@@ -107,7 +109,7 @@ public class TempStorageBlockedBrokerTes
         producingThread.start();
 
         assertTrue("producer has sent 10 in a reasonable time", producerHasSentTenMessages.await(30,
TimeUnit.SECONDS));
-        
+
         int count = 0;
 
         Message m = null;
@@ -169,7 +171,7 @@ public class TempStorageBlockedBrokerTes
         broker.getSystemUsage().setSendFailIfNoSpace(true);
         destination = new ActiveMQQueue("Foo");
 
-        ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory("tcp://localhost:61618");
+        ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory(connectionUri);
         final ActiveMQConnection producerConnection = (ActiveMQConnection) factory.createConnection();
         // so we can easily catch the ResourceAllocationException on send
         producerConnection.setAlwaysSyncSend(true);
@@ -247,8 +249,10 @@ public class TempStorageBlockedBrokerTes
         broker.setDestinationPolicy(policyMap);
         broker.setSystemUsage(sysUsage);
 
-        broker.addConnector("tcp://localhost:61618").setName("Default");
+        broker.addConnector("tcp://localhost:0").setName("Default");
         broker.start();
+
+        connectionUri = broker.getTransportConnectors().get(0).getPublishableConnectString();
     }
 
     @Override



Mime
View raw message