summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--java/client/src/test/java/org/apache/qpid/test/unit/transacted/CommitRollbackTest.java13
1 files changed, 10 insertions, 3 deletions
diff --git a/java/client/src/test/java/org/apache/qpid/test/unit/transacted/CommitRollbackTest.java b/java/client/src/test/java/org/apache/qpid/test/unit/transacted/CommitRollbackTest.java
index 3d5a1096b4..a4c016916e 100644
--- a/java/client/src/test/java/org/apache/qpid/test/unit/transacted/CommitRollbackTest.java
+++ b/java/client/src/test/java/org/apache/qpid/test/unit/transacted/CommitRollbackTest.java
@@ -481,9 +481,16 @@ public class CommitRollbackTest extends TestCase
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);