activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r377937 - /incubator/activemq/trunk/assembly/src/test/java/org/apache/activemq/usecases/DurableSubscriptionTestSupport.java
Date Wed, 15 Feb 2006 04:35:20 GMT
Author: chirino
Date: Tue Feb 14 20:35:20 2006
New Revision: 377937

URL: http://svn.apache.org/viewcvs?rev=377937&view=rev
Log:
Fixed a few of the broken durable subscription tests.

Modified:
    incubator/activemq/trunk/assembly/src/test/java/org/apache/activemq/usecases/DurableSubscriptionTestSupport.java

Modified: incubator/activemq/trunk/assembly/src/test/java/org/apache/activemq/usecases/DurableSubscriptionTestSupport.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/assembly/src/test/java/org/apache/activemq/usecases/DurableSubscriptionTestSupport.java?rev=377937&r1=377936&r2=377937&view=diff
==============================================================================
--- incubator/activemq/trunk/assembly/src/test/java/org/apache/activemq/usecases/DurableSubscriptionTestSupport.java
(original)
+++ incubator/activemq/trunk/assembly/src/test/java/org/apache/activemq/usecases/DurableSubscriptionTestSupport.java
Tue Feb 14 20:35:20 2006
@@ -28,6 +28,7 @@
 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,8 +43,11 @@
     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();
         rc.setClientID(getName());
@@ -55,8 +59,8 @@
         super.setUp();
     }
     protected void tearDown() throws Exception {
-        destroyBroker();
         super.tearDown();
+        destroyBroker();
     }
     protected void restartBroker() throws Exception {
         destroyBroker();
@@ -65,13 +69,10 @@
     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 @@
     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) {



Mime
View raw message