activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r1443038 - /activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/transport/tcp/TcpTransportBindTest.java
Date Wed, 06 Feb 2013 16:16:21 GMT
Author: tabish
Date: Wed Feb  6 16:16:20 2013
New Revision: 1443038

URL: http://svn.apache.org/viewvc?rev=1443038&view=rev
Log:
Don't use a fixed port. 

Modified:
    activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/transport/tcp/TcpTransportBindTest.java

Modified: activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/transport/tcp/TcpTransportBindTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/transport/tcp/TcpTransportBindTest.java?rev=1443038&r1=1443037&r2=1443038&view=diff
==============================================================================
--- activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/transport/tcp/TcpTransportBindTest.java
(original)
+++ activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/transport/tcp/TcpTransportBindTest.java
Wed Feb  6 16:16:20 2013
@@ -20,7 +20,6 @@ import java.util.Timer;
 import java.util.TimerTask;
 
 import javax.jms.Connection;
-import javax.jms.Message;
 import javax.jms.MessageConsumer;
 import javax.jms.Session;
 
@@ -28,29 +27,32 @@ import org.apache.activemq.ActiveMQConne
 import org.apache.activemq.EmbeddedBrokerTestSupport;
 
 public class TcpTransportBindTest extends EmbeddedBrokerTestSupport {
-    final String addr = "tcp://localhost:61617";
-    
+    String addr = "tcp://localhost:0";
+
     /**
      * exercise some server side socket options
      * @throws Exception
      */
-    protected void setUp() throws Exception {   
+    @Override
+    protected void setUp() throws Exception {
         bindAddress = addr + "?transport.reuseAddress=true&transport.soTimeout=1000";
         super.setUp();
+
+        addr = broker.getTransportConnectors().get(0).getPublishableConnectString();
     }
-    
+
     public void testConnect() throws Exception {
         Connection connection = new ActiveMQConnectionFactory(addr).createConnection();
         connection.start();
     }
-    
-    
+
     public void testReceiveThrowsException() throws Exception {
         Connection connection = new ActiveMQConnectionFactory(addr).createConnection();
         connection.start();
         Session sess = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
         MessageConsumer consumer = sess.createConsumer(createDestination());
         class StopTask extends TimerTask {
+            @Override
             public void run() {
                 try {
                     broker.stop();



Mime
View raw message