You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ra...@apache.org on 2007/12/24 10:42:25 UTC

svn commit: r606682 - /activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/ReliableReconnectTest.java

Author: rajdavies
Date: Mon Dec 24 01:42:25 2007
New Revision: 606682

URL: http://svn.apache.org/viewvc?rev=606682&view=rev
Log:
multiple paths try to re-start the broker with vm:// trapnsport -
changed URI to tcp://

Modified:
    activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/ReliableReconnectTest.java

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/ReliableReconnectTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/ReliableReconnectTest.java?rev=606682&r1=606681&r2=606682&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/ReliableReconnectTest.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/ReliableReconnectTest.java Mon Dec 24 01:42:25 2007
@@ -34,6 +34,8 @@
 import org.apache.activemq.ActiveMQConnectionFactory;
 import org.apache.activemq.broker.BrokerFactory;
 import org.apache.activemq.broker.BrokerService;
+import org.apache.activemq.store.PersistenceAdapter;
+import org.apache.activemq.store.amq.AMQPersistenceAdapter;
 import org.apache.activemq.test.TestSupport;
 import org.apache.activemq.util.IdGenerator;
 
@@ -43,7 +45,7 @@
 public class ReliableReconnectTest extends TestSupport {
     
     protected static final int MESSAGE_COUNT = 100;
-    protected static final String DEFAULT_BROKER_URL = "vm://localhost";
+    protected static final String DEFAULT_BROKER_URL = ActiveMQConnectionFactory.DEFAULT_BROKER_URL;
     private static final int RECEIVE_TIMEOUT = 10000;
     
     protected int deliveryMode = DeliveryMode.PERSISTENT;
@@ -80,10 +82,17 @@
         return new ActiveMQConnectionFactory(url);
     }
 
-    protected void startBroker() throws JMSException {
+    protected void startBroker(boolean deleteOnStart) throws JMSException {
         try {
             broker = BrokerFactory.createBroker(new URI("broker://()/localhost"));
             broker.setUseShutdownHook(false);
+            broker.setDeleteAllMessagesOnStartup(deleteOnStart);
+           
+            broker.setUseJmx(false);
+            PersistenceAdapter adaptor = broker.getPersistenceAdapter();
+            if (adaptor instanceof AMQPersistenceAdapter) {
+                ((AMQPersistenceAdapter)adaptor).setDisableLocking(true);
+            }
             broker.addConnector(DEFAULT_BROKER_URL);
             broker.start();
         } catch (Exception e) {
@@ -143,7 +152,7 @@
     }
 
     public void testReconnect() throws Exception {
-        startBroker();
+        startBroker(true);
         // register an interest as a durable subscriber
         Connection consumerConnection = createConsumerConnection();
         createConsumer(consumerConnection);
@@ -168,7 +177,7 @@
         }
         // System.err.println("Stopping broker");
         broker.stop();
-        startBroker();
+        startBroker(false);
         // System.err.println("Started Broker again");
         synchronized (messagesReceived) {
             if (messagesReceived.get() < MESSAGE_COUNT) {