activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r1186833 - /activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/CreateTemporaryQueueBeforeStartTest.java
Date Thu, 20 Oct 2011 14:27:07 GMT
Author: tabish
Date: Thu Oct 20 14:27:07 2011
New Revision: 1186833

URL: http://svn.apache.org/viewvc?rev=1186833&view=rev
Log:
Remove fixed port usage and disable JMX since this test doesn't use it.

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

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/CreateTemporaryQueueBeforeStartTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/CreateTemporaryQueueBeforeStartTest.java?rev=1186833&r1=1186832&r2=1186833&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/CreateTemporaryQueueBeforeStartTest.java
(original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/CreateTemporaryQueueBeforeStartTest.java
Thu Oct 20 14:27:07 2011
@@ -22,8 +22,6 @@ import java.util.concurrent.atomic.Atomi
 import javax.jms.Connection;
 import javax.jms.Queue;
 import javax.jms.QueueConnection;
-import javax.jms.QueueReceiver;
-import javax.jms.QueueSender;
 import javax.jms.QueueSession;
 import javax.jms.Session;
 import javax.jms.Topic;
@@ -34,10 +32,11 @@ import org.apache.activemq.broker.Broker
 
 /**
  * @author Peter Henning
- * 
+ *
  */
 public class CreateTemporaryQueueBeforeStartTest extends TestCase {
-    protected String bindAddress = "tcp://localhost:61621";
+    private final String bindAddress = "tcp://localhost:0";
+    private String connectionUri;
     private Connection connection;
     private BrokerService broker = new BrokerService();
 
@@ -51,7 +50,7 @@ public class CreateTemporaryQueueBeforeS
     }
 
     public void testTryToReproduceNullPointerBug() throws Exception {
-        String url = bindAddress;
+        String url = connectionUri;
         ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory(url);
         QueueConnection queueConnection = factory.createQueueConnection();
         this.connection = queueConnection;
@@ -109,13 +108,16 @@ public class CreateTemporaryQueueBeforeS
     }
 
     protected ActiveMQConnectionFactory createConnectionFactory() throws Exception {
-        return new ActiveMQConnectionFactory(bindAddress);
+        return new ActiveMQConnectionFactory(connectionUri);
     }
 
     protected void setUp() throws Exception {
+        broker.setUseJmx(false);
         broker.setPersistent(false);
-        broker.addConnector(bindAddress);
+        connectionUri = broker.addConnector(bindAddress).getPublishableConnectString();
         broker.start();
+        broker.waitUntilStarted();
+
         super.setUp();
     }
 



Mime
View raw message