Repository: qpid-jms
Updated Branches:
  refs/heads/master 7c8f8e1cb -> 39c9dbb05


update rollback tests to account for recent changes


Project: http://git-wip-us.apache.org/repos/asf/qpid-jms/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-jms/commit/39c9dbb0
Tree: http://git-wip-us.apache.org/repos/asf/qpid-jms/tree/39c9dbb0
Diff: http://git-wip-us.apache.org/repos/asf/qpid-jms/diff/39c9dbb0

Branch: refs/heads/master
Commit: 39c9dbb0535c71b1d5d25ea26d26aba1d212fd65
Parents: 7c8f8e1
Author: Robert Gemmell <[email protected]>
Authored: Fri Dec 5 15:21:04 2014 +0000
Committer: Robert Gemmell <[email protected]>
Committed: Fri Dec 5 15:21:04 2014 +0000

----------------------------------------------------------------------
 .../jms/integration/SessionIntegrationTest.java   | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/39c9dbb0/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/SessionIntegrationTest.java
----------------------------------------------------------------------
diff --git 
a/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/SessionIntegrationTest.java
 
b/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/SessionIntegrationTest.java
index 087d77e..a6e3569 100644
--- 
a/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/SessionIntegrationTest.java
+++ 
b/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/SessionIntegrationTest.java
@@ -57,6 +57,7 @@ import 
org.apache.qpid.jms.test.testpeer.describedtypes.sections.AmqpValueDescri
 import org.apache.qpid.jms.test.testpeer.matchers.AcceptedMatcher;
 import org.apache.qpid.jms.test.testpeer.matchers.CoordinatorMatcher;
 import org.apache.qpid.jms.test.testpeer.matchers.ModifiedMatcher;
+import org.apache.qpid.jms.test.testpeer.matchers.ReleasedMatcher;
 import org.apache.qpid.jms.test.testpeer.matchers.SourceMatcher;
 import org.apache.qpid.jms.test.testpeer.matchers.TargetMatcher;
 import org.apache.qpid.jms.test.testpeer.matchers.TransactionalStateMatcher;
@@ -66,7 +67,6 @@ import 
org.apache.qpid.jms.test.testpeer.matchers.sections.TransferPayloadCompos
 import 
org.apache.qpid.jms.test.testpeer.matchers.types.EncodedAmqpValueMatcher;
 import org.apache.qpid.proton.amqp.Binary;
 import org.apache.qpid.proton.amqp.Symbol;
-import org.junit.Ignore;
 import org.junit.Test;
 
 public class SessionIntegrationTest extends QpidJmsTestCase {
@@ -467,13 +467,11 @@ public class SessionIntegrationTest extends 
QpidJmsTestCase {
         }
     }
 
-    @Ignore //TODO: fix test expectations after rollback updates
     @Test(timeout=5000)
     public void 
testRollbackTransactedSessionWithConsumerReceivingAllMessages() throws 
Exception {
         doRollbackTransactedSessionWithConsumerTestImpl(1, 1);
     }
 
-    @Ignore //TODO: fix test expectations after rollback updates
     @Test(timeout=5000)
     public void 
testRollbackTransactedSessionWithConsumerReceivingSomeMessages() throws 
Exception {
         doRollbackTransactedSessionWithConsumerTestImpl(5, 2);
@@ -519,6 +517,9 @@ public class SessionIntegrationTest extends QpidJmsTestCase 
{
                 assertTrue(receivedMessage instanceof TextMessage);
             }
 
+            // Expect the consumer to be 'stopped' prior to rollback
+            testPeer.expectLinkFlow(true);
+
             // Expect an unsettled 'discharge' transfer to the txn coordinator 
containing the txnId,
             // and reply with accepted and settled disposition to indicate the 
rollback succeeded
             Discharge discharge = new Discharge();
@@ -528,9 +529,16 @@ public class SessionIntegrationTest extends 
QpidJmsTestCase {
             dischargeMatcher.setMessageContentMatcher(new 
EncodedAmqpValueMatcher(discharge));
             testPeer.expectTransfer(dischargeMatcher, false, new Accepted(), 
true);
 
-            session.rollback();
+            // Expect the messages that were not consumed to be released
+            int unconsumed = transferCount - consumeCount;
+            for (int i = 1; i <= unconsumed; i++) {
+                testPeer.expectDisposition(true, new ReleasedMatcher());
+            }
 
-            //TODO: what about messages not received by the consumer?
+            // Expect the consumer to be 'started' again as rollback completes
+            testPeer.expectLinkFlow(false);
+
+            session.rollback();
 
             testPeer.waitForAllHandlersToComplete(1000);
         }


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to