From 5cf486c97571e2426234f153ae220809a5e1da4e Mon Sep 17 00:00:00 2001 From: "Timothy A. Bish" Date: Wed, 23 Mar 2011 21:24:46 +0000 Subject: [PATCH] Update the test so that its not dependant on port 61616 git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1084751 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/test/java/org/apache/activemq/TimeStampTest.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/activemq-core/src/test/java/org/apache/activemq/TimeStampTest.java b/activemq-core/src/test/java/org/apache/activemq/TimeStampTest.java index 5795137d04..2ec57b5aaf 100644 --- a/activemq-core/src/test/java/org/apache/activemq/TimeStampTest.java +++ b/activemq-core/src/test/java/org/apache/activemq/TimeStampTest.java @@ -27,6 +27,7 @@ import javax.jms.Session; import junit.framework.TestCase; import org.apache.activemq.broker.BrokerPlugin; import org.apache.activemq.broker.BrokerService; +import org.apache.activemq.broker.TransportConnector; import org.apache.activemq.broker.util.UDPTraceBrokerPlugin; import org.apache.activemq.broker.view.ConnectionDotFilePlugin; @@ -36,12 +37,13 @@ public class TimeStampTest extends TestCase { broker.setPersistent(false); broker.setUseJmx(true); broker.setPlugins(new BrokerPlugin[] {new ConnectionDotFilePlugin(), new UDPTraceBrokerPlugin()}); - broker.addConnector("tcp://localhost:61616"); - broker.addConnector("stomp://localhost:61613"); + TransportConnector tcpConnector = broker.addConnector("tcp://localhost:0"); + broker.addConnector("stomp://localhost:0"); broker.start(); // Create a ConnectionFactory - ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory("tcp://localhost:61616"); + ActiveMQConnectionFactory connectionFactory = + new ActiveMQConnectionFactory(tcpConnector.getConnectUri()); // Create a Connection Connection connection = connectionFactory.createConnection();