Repository: activemq Updated Branches: refs/heads/master 231679d93 -> d1e2b7680
https://issues.apache.org/jira/browse/AMQ-5621 Update tests to not use hard coded broker port. Project: http://git-wip-us.apache.org/repos/asf/activemq/repo Commit: http://git-wip-us.apache.org/repos/asf/activemq/commit/d1e2b768 Tree: http://git-wip-us.apache.org/repos/asf/activemq/tree/d1e2b768 Diff: http://git-wip-us.apache.org/repos/asf/activemq/diff/d1e2b768 Branch: refs/heads/master Commit: d1e2b768099febfacb9c401c05375b5413ca144a Parents: 231679d Author: Timothy Bish <[email protected]> Authored: Wed May 4 14:39:26 2016 -0400 Committer: Timothy Bish <[email protected]> Committed: Wed May 4 14:39:38 2016 -0400 ---------------------------------------------------------------------- .../activemq/advisory/AdvisoryTempDestinationTests.java | 12 +++++------- .../org/apache/activemq/advisory/AdvisoryTests.java | 5 ++--- 2 files changed, 7 insertions(+), 10 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/activemq/blob/d1e2b768/activemq-unit-tests/src/test/java/org/apache/activemq/advisory/AdvisoryTempDestinationTests.java ---------------------------------------------------------------------- diff --git a/activemq-unit-tests/src/test/java/org/apache/activemq/advisory/AdvisoryTempDestinationTests.java b/activemq-unit-tests/src/test/java/org/apache/activemq/advisory/AdvisoryTempDestinationTests.java index 17044b2..b2bb075 100644 --- a/activemq-unit-tests/src/test/java/org/apache/activemq/advisory/AdvisoryTempDestinationTests.java +++ b/activemq-unit-tests/src/test/java/org/apache/activemq/advisory/AdvisoryTempDestinationTests.java @@ -35,7 +35,6 @@ import javax.jms.Session; import javax.jms.TemporaryQueue; import javax.jms.Topic; -import org.apache.activemq.ActiveMQConnection; import org.apache.activemq.ActiveMQConnectionFactory; import org.apache.activemq.broker.BrokerService; import org.apache.activemq.broker.region.policy.ConstantPendingMessageLimitStrategy; @@ -54,7 +53,7 @@ public class AdvisoryTempDestinationTests { protected BrokerService broker; protected Connection connection; - protected String bindAddress = ActiveMQConnectionFactory.DEFAULT_BROKER_BIND_URL; + protected String connectionURI; protected int topicCount; @Test(timeout = 60000) @@ -174,9 +173,8 @@ public class AdvisoryTempDestinationTests { @Before public void setUp() throws Exception { - if (broker == null) { - broker = createBroker(); - } + broker = createBroker(); + connectionURI = broker.getTransportConnectors().get(0).getPublishableConnectString(); ConnectionFactory factory = createConnectionFactory(); connection = factory.createConnection(); connection.start(); @@ -191,7 +189,7 @@ public class AdvisoryTempDestinationTests { } protected ActiveMQConnectionFactory createConnectionFactory() throws Exception { - ActiveMQConnectionFactory cf = new ActiveMQConnectionFactory(ActiveMQConnection.DEFAULT_BROKER_URL); + ActiveMQConnectionFactory cf = new ActiveMQConnectionFactory(connectionURI); return cf; } @@ -218,7 +216,7 @@ public class AdvisoryTempDestinationTests { pMap.setPolicyEntries(policyEntries); answer.setDestinationPolicy(pMap); - answer.addConnector(bindAddress); + answer.addConnector("tcp://0.0.0.0:0"); answer.setDeleteAllMessagesOnStartup(true); } http://git-wip-us.apache.org/repos/asf/activemq/blob/d1e2b768/activemq-unit-tests/src/test/java/org/apache/activemq/advisory/AdvisoryTests.java ---------------------------------------------------------------------- diff --git a/activemq-unit-tests/src/test/java/org/apache/activemq/advisory/AdvisoryTests.java b/activemq-unit-tests/src/test/java/org/apache/activemq/advisory/AdvisoryTests.java index 9acf7bf..07bed87 100644 --- a/activemq-unit-tests/src/test/java/org/apache/activemq/advisory/AdvisoryTests.java +++ b/activemq-unit-tests/src/test/java/org/apache/activemq/advisory/AdvisoryTests.java @@ -355,8 +355,7 @@ public class AdvisoryTests { } protected ActiveMQConnectionFactory createConnectionFactory() throws Exception { - ActiveMQConnectionFactory cf = new ActiveMQConnectionFactory(ActiveMQConnection.DEFAULT_BROKER_URL); - return cf; + return new ActiveMQConnectionFactory(broker.getTransportConnectorByName("OpenWire").getPublishableConnectString()); } protected BrokerService createBroker() throws Exception { @@ -386,7 +385,7 @@ public class AdvisoryTests { answer.setDestinationPolicy(pMap); answer.addConnector("nio://localhost:0"); - answer.addConnector(bindAddress); + answer.addConnector("tcp://localhost:0").setName("OpenWire"); answer.setDeleteAllMessagesOnStartup(true); }
