Remove fixed port usage and disable JMX since this test doesn't use it.

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1186833 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Timothy A. Bish 2011-10-20 14:27:07 +00:00
parent 6d077dc7b4
commit 4553ff18ef
1 changed files with 9 additions and 7 deletions

View File

@ -22,8 +22,6 @@ import java.util.concurrent.atomic.AtomicInteger;
import javax.jms.Connection;
import javax.jms.Queue;
import javax.jms.QueueConnection;
import javax.jms.QueueReceiver;
import javax.jms.QueueSender;
import javax.jms.QueueSession;
import javax.jms.Session;
import javax.jms.Topic;
@ -34,10 +32,11 @@ import org.apache.activemq.broker.BrokerService;
/**
* @author Peter Henning
*
*
*/
public class CreateTemporaryQueueBeforeStartTest extends TestCase {
protected String bindAddress = "tcp://localhost:61621";
private final String bindAddress = "tcp://localhost:0";
private String connectionUri;
private Connection connection;
private BrokerService broker = new BrokerService();
@ -51,7 +50,7 @@ public class CreateTemporaryQueueBeforeStartTest extends TestCase {
}
public void testTryToReproduceNullPointerBug() throws Exception {
String url = bindAddress;
String url = connectionUri;
ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory(url);
QueueConnection queueConnection = factory.createQueueConnection();
this.connection = queueConnection;
@ -109,13 +108,16 @@ public class CreateTemporaryQueueBeforeStartTest extends TestCase {
}
protected ActiveMQConnectionFactory createConnectionFactory() throws Exception {
return new ActiveMQConnectionFactory(bindAddress);
return new ActiveMQConnectionFactory(connectionUri);
}
protected void setUp() throws Exception {
broker.setUseJmx(false);
broker.setPersistent(false);
broker.addConnector(bindAddress);
connectionUri = broker.addConnector(bindAddress).getPublishableConnectString();
broker.start();
broker.waitUntilStarted();
super.setUp();
}