git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@942025 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Gary Tully 2010-05-07 08:03:49 +00:00
parent 79d303d802
commit aa3110e26c
1 changed files with 14 additions and 0 deletions

View File

@ -137,6 +137,20 @@ public class ActiveMQConnectionFactoryTest extends CombinationTestSupport {
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 {