qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rgodf...@apache.org
Subject svn commit: r583105 - /incubator/qpid/branches/M2.1/java/client/src/test/java/org/apache/qpid/test/unit/transacted/CommitRollbackTest.java
Date Tue, 09 Oct 2007 10:48:26 GMT
Author: rgodfrey
Date: Tue Oct  9 03:48:25 2007
New Revision: 583105

URL: http://svn.apache.org/viewvc?rev=583105&view=rev
Log:
QPID-625 : Fix commit rollback test to prevent failures caused by incorrect assertions in
the test

Modified:
    incubator/qpid/branches/M2.1/java/client/src/test/java/org/apache/qpid/test/unit/transacted/CommitRollbackTest.java

Modified: incubator/qpid/branches/M2.1/java/client/src/test/java/org/apache/qpid/test/unit/transacted/CommitRollbackTest.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/M2.1/java/client/src/test/java/org/apache/qpid/test/unit/transacted/CommitRollbackTest.java?rev=583105&r1=583104&r2=583105&view=diff
==============================================================================
--- incubator/qpid/branches/M2.1/java/client/src/test/java/org/apache/qpid/test/unit/transacted/CommitRollbackTest.java
(original)
+++ incubator/qpid/branches/M2.1/java/client/src/test/java/org/apache/qpid/test/unit/transacted/CommitRollbackTest.java
Tue Oct  9 03:48:25 2007
@@ -481,9 +481,16 @@
             assertEquals("2", ((TextMessage) result).getText());
         }
 
-        result = _consumer.receive(1000);
-        assertNotNull("test message was consumed and rolled back, but is gone", result);
-        assertTrue("Messasge is not marked as redelivered" + result, result.getJMSRedelivered());
+        Message result2 = _consumer.receive(1000);
+        assertNotNull("test message was consumed and rolled back, but is gone", result2);
+
+        // if this is message 1 then it should be marked as redelivered
+        if("1".equals(((TextMessage) result2).getText()))
+        {
+            assertTrue("Messasge is not marked as redelivered" + result2, result2.getJMSRedelivered());
+        }
+
+        assertNotSame("Messages should not have the same content",((TextMessage) result2).getText(),
((TextMessage) result).getText() );
 
         result = _consumer.receive(1000);
         assertNull("test message should be null:" + result, result);



Mime
View raw message