Update the test so that its not dependent on port 61617.

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1084379 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Timothy A. Bish 2011-03-22 22:23:14 +00:00
parent 41424a41b9
commit cad663a1e9
1 changed files with 5 additions and 4 deletions

View File

@ -42,7 +42,8 @@ public class AMQ2751Test extends EmbeddedBrokerTestSupport {
public void testRecoverRedelivery() throws Exception {
final CountDownLatch redelivery = new CountDownLatch(6);
final ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory("failover:(" + this.bindAddress + ")");
final ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory(
"failover:(" + broker.getTransportConnectors().get(0).getConnectUri() + ")");
try {
Connection connection = factory.createConnection();
@ -62,7 +63,7 @@ public class AMQ2751Test extends EmbeddedBrokerTestSupport {
if (message.getJMSRedelivered()) {
LOG.info("It's a redelivery.");
redelivery.countDown();
}
}
LOG.info("calling recover() on the session to force redelivery.");
session.recover();
} catch (JMSException e) {
@ -76,7 +77,7 @@ public class AMQ2751Test extends EmbeddedBrokerTestSupport {
MessageProducer producer = session.createProducer(queue);
producer.send(session.createTextMessage("test"));
assertTrue("we got 6 redeliveries", redelivery.await(20, TimeUnit.SECONDS));
} finally {
@ -87,7 +88,7 @@ public class AMQ2751Test extends EmbeddedBrokerTestSupport {
@Override
protected void setUp() throws Exception {
bindAddress = "tcp://0.0.0.0:61617";
bindAddress = "tcp://localhost:0";
super.setUp();
}
}