You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by js...@apache.org on 2007/03/08 14:28:59 UTC

svn commit: r516038 - /activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/XARecoveryBrokerTest.java

Author: jstrachan
Date: Thu Mar  8 05:28:58 2007
New Revision: 516038

URL: http://svn.apache.org/viewvc?view=rev&rev=516038
Log:
fix broken test case

Modified:
    activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/XARecoveryBrokerTest.java

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/XARecoveryBrokerTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/XARecoveryBrokerTest.java?view=diff&rev=516038&r1=516037&r2=516038
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/XARecoveryBrokerTest.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/XARecoveryBrokerTest.java Thu Mar  8 05:28:58 2007
@@ -43,7 +43,7 @@
     
     public void testPreparedTransactionRecoveredOnRestart() throws Exception {
         
-        ActiveMQDestination destination = new ActiveMQQueue("TEST");
+        ActiveMQDestination destination = createDestination();
         
         // Setup the producer and send the message.  
         StubConnection connection = createConnection();
@@ -111,7 +111,7 @@
 
     public void testQueuePersistentCommitedMessagesNotLostOnRestart() throws Exception {
         
-        ActiveMQDestination destination = new ActiveMQQueue("TEST");
+        ActiveMQDestination destination = createDestination();
         
         // Setup the producer and send the message.  
         StubConnection connection = createConnection();
@@ -158,7 +158,7 @@
     
     public void testQueuePersistentCommitedAcksNotLostOnRestart() throws Exception {
         
-        ActiveMQDestination destination = new ActiveMQQueue("TEST");
+        ActiveMQDestination destination = createDestination();
         
         // Setup the producer and send the message.  
         StubConnection connection = createConnection();
@@ -205,13 +205,15 @@
         connection.send(consumerInfo);
 
         // No messages should be delivered.
+        assertNoMessagesLeft(connection);
+
         Message m = receiveMessage(connection);
-        assertNull(m);        
+        assertNull(m);
     }
-    
+
     public void testQueuePersistentUncommittedAcksLostOnRestart() throws Exception {
         
-        ActiveMQDestination destination = new ActiveMQQueue("TEST");
+        ActiveMQDestination destination = createDestination();
         
         // Setup the producer and send the message.  
         StubConnection connection = createConnection();
@@ -273,4 +275,8 @@
         junit.textui.TestRunner.run(suite());
     }
 
+    protected ActiveMQDestination createDestination() {
+        return new ActiveMQQueue(getClass().getName() + "." + getName());
+    }
+    
 }