Use dynamic ports for the test to avoid clashing with other brokers.
This commit is contained in:
Timothy Bish 2014-09-30 09:56:24 -04:00
parent 025c2316d9
commit 80322ce00d
2 changed files with 25 additions and 21 deletions

View File

@ -43,10 +43,13 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class SimpleAMQPAuthTest {
public static final String SIMPLE_AUTH_AMQP_BROKER_XML = "org/apache/activemq/transport/amqp/simple-auth-amqp-broker.xml";
public BrokerService brokerService;
protected static final Logger LOG = LoggerFactory.getLogger(SimpleAMQPAuthTest.class);
protected int port = 5672;
private static final Logger LOG = LoggerFactory.getLogger(SimpleAMQPAuthTest.class);
private final String SIMPLE_AUTH_AMQP_BROKER_XML =
"org/apache/activemq/transport/amqp/simple-auth-amqp-broker.xml";
private BrokerService brokerService;
private int port;
@Before
public void setUp() throws Exception {
@ -167,6 +170,7 @@ public class SimpleAMQPAuthTest {
public void startBroker() throws Exception {
brokerService = createBroker();
brokerService.start();
port = brokerService.getTransportConnectorByName("amqp").getPublishableConnectURI().getPort();
brokerService.waitUntilStarted();
}
}

View File

@ -39,7 +39,7 @@
<transportConnectors>
<transportConnector name="openwire" uri="vm://localhost" />
<transportConnector name="amqp" uri="amqp://0.0.0.0:5672"/>
<transportConnector name="amqp" uri="amqp://0.0.0.0:0"/>
</transportConnectors>
<plugins>