activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gtu...@apache.org
Subject svn commit: r942025 - /activemq/trunk/activemq-core/src/test/java/org/apache/activemq/ActiveMQConnectionFactoryTest.java
Date Fri, 07 May 2010 08:03:50 GMT
Author: gtully
Date: Fri May  7 08:03:49 2010
New Revision: 942025

URL: http://svn.apache.org/viewvc?rev=942025&view=rev
Log:
add simple test for localport uri notation in a connection factory: http://activemq.apache.org/how-do-i-define-a-local-address-and-local-port-for-tcp-or-ssl.html

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

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/ActiveMQConnectionFactoryTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/ActiveMQConnectionFactoryTest.java?rev=942025&r1=942024&r2=942025&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/ActiveMQConnectionFactoryTest.java
(original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/ActiveMQConnectionFactoryTest.java
Fri May  7 08:03:49 2010
@@ -137,6 +137,20 @@ public class ActiveMQConnectionFactoryTe
         assertCreateConnection("tcp://localhost:61610?wireFormat.tcpNoDelayEnabled=true");
     }
 
+    public void testCreateTcpConnectionUsingKnownLocalPort() throws Exception {
+        broker = new BrokerService();
+        broker.setPersistent(false);
+        TransportConnector connector = broker.addConnector("tcp://localhost:61610?wireFormat.tcpNoDelayEnabled=true");
+        broker.start();
+
+        // This should create the connection.
+        ActiveMQConnectionFactory cf = new ActiveMQConnectionFactory("tcp://localhost:61610/localhost:51610");
+        connection = (ActiveMQConnection)cf.createConnection();
+        assertNotNull(connection);
+
+        broker.stop();
+    }
+
     public void testConnectionFailsToConnectToVMBrokerThatIsNotRunning() throws Exception
{
         ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory("vm://localhost?create=false");
         try {



Mime
View raw message