Fixed a few of the broken durable subscription tests.

git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@377937 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Hiram R. Chirino 2006-02-15 04:35:20 +00:00
parent 0f502fae3d
commit 7b945f9d92
1 changed files with 9 additions and 9 deletions

View File

@ -28,6 +28,7 @@ import javax.jms.TextMessage;
import javax.jms.Topic;
import javax.jms.TopicSubscriber;
import org.apache.activemq.ActiveMQConnectionFactory;
import org.apache.activemq.TestSupport;
import org.apache.activemq.broker.BrokerService;
import org.apache.activemq.store.PersistenceAdapter;
@ -42,7 +43,10 @@ abstract public class DurableSubscriptionTestSupport extends TestSupport {
private TopicSubscriber consumer;
private MessageProducer producer;
private BrokerService broker;
private boolean init;
protected ActiveMQConnectionFactory createConnectionFactory() throws Exception {
return new ActiveMQConnectionFactory("vm://durable-broker");
}
protected Connection createConnection() throws Exception {
Connection rc = super.createConnection();
@ -55,8 +59,8 @@ abstract public class DurableSubscriptionTestSupport extends TestSupport {
super.setUp();
}
protected void tearDown() throws Exception {
destroyBroker();
super.tearDown();
destroyBroker();
}
protected void restartBroker() throws Exception {
destroyBroker();
@ -65,13 +69,10 @@ abstract public class DurableSubscriptionTestSupport extends TestSupport {
private void createBroker() throws Exception {
try {
broker = new BrokerService();
broker.setBrokerName("durable_broker");
broker.setBrokerName("durable-broker");
broker.setDeleteAllMessagesOnStartup(true);
broker.setPersistenceAdapter(createPersistenceAdapter());
broker.setPersistent(true);
broker.addConnector("vm://localhost");
init = true;
broker.start();
} catch (Exception e) {
e.printStackTrace();
@ -83,11 +84,10 @@ abstract public class DurableSubscriptionTestSupport extends TestSupport {
private void createRestartedBroker() throws Exception {
try {
broker = new BrokerService();
broker.setBrokerName("durable_broker");
broker.setBrokerName("durable-broker");
broker.setDeleteAllMessagesOnStartup(false);
broker.setPersistenceAdapter(createPersistenceAdapter());
broker.setPersistent(true);
broker.addConnector("vm://localhost");
broker.start();
} catch (Exception e) {