mirror of https://github.com/apache/activemq.git
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
git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@942025 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
79d303d802
commit
aa3110e26c
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue