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


add support for precisely matching on the link credit indicated by Flow frames


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

Branch: refs/heads/master
Commit: 7daeb8089d545e20b4a6f2e2816345a787de70ce
Parents: 39c9dbb
Author: Robert Gemmell <[email protected]>
Authored: Tue Dec 9 10:32:49 2014 +0000
Committer: Robert Gemmell <[email protected]>
Committed: Tue Dec 9 10:32:49 2014 +0000

----------------------------------------------------------------------
 .../apache/qpid/jms/integration/SessionIntegrationTest.java  | 8 +++++---
 .../java/org/apache/qpid/jms/test/testpeer/TestAmqpPeer.java | 6 +++---
 2 files changed, 8 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/7daeb808/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 a6e3569..3ae8ad5 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
@@ -20,6 +20,7 @@ package org.apache.qpid.jms.integration;
 
 import static org.hamcrest.Matchers.arrayContaining;
 import static org.hamcrest.Matchers.equalTo;
+import static org.hamcrest.Matchers.greaterThan;
 import static org.hamcrest.Matchers.notNullValue;
 import static org.hamcrest.Matchers.nullValue;
 import static org.junit.Assert.assertEquals;
@@ -67,6 +68,7 @@ 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.apache.qpid.proton.amqp.UnsignedInteger;
 import org.junit.Test;
 
 public class SessionIntegrationTest extends QpidJmsTestCase {
@@ -517,8 +519,8 @@ public class SessionIntegrationTest extends QpidJmsTestCase 
{
                 assertTrue(receivedMessage instanceof TextMessage);
             }
 
-            // Expect the consumer to be 'stopped' prior to rollback
-            testPeer.expectLinkFlow(true);
+            // Expect the consumer to be 'stopped' prior to rollback by 
issuing a 'drain'
+            testPeer.expectLinkFlow(true, greaterThan(UnsignedInteger.ZERO));
 
             // Expect an unsettled 'discharge' transfer to the txn coordinator 
containing the txnId,
             // and reply with accepted and settled disposition to indicate the 
rollback succeeded
@@ -536,7 +538,7 @@ public class SessionIntegrationTest extends QpidJmsTestCase 
{
             }
 
             // Expect the consumer to be 'started' again as rollback completes
-            testPeer.expectLinkFlow(false);
+            testPeer.expectLinkFlow(false, greaterThan(UnsignedInteger.ZERO));
 
             session.rollback();
 

http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/7daeb808/qpid-jms-client/src/test/java/org/apache/qpid/jms/test/testpeer/TestAmqpPeer.java
----------------------------------------------------------------------
diff --git 
a/qpid-jms-client/src/test/java/org/apache/qpid/jms/test/testpeer/TestAmqpPeer.java
 
b/qpid-jms-client/src/test/java/org/apache/qpid/jms/test/testpeer/TestAmqpPeer.java
index fc9ec43..5e7c209 100644
--- 
a/qpid-jms-client/src/test/java/org/apache/qpid/jms/test/testpeer/TestAmqpPeer.java
+++ 
b/qpid-jms-client/src/test/java/org/apache/qpid/jms/test/testpeer/TestAmqpPeer.java
@@ -702,10 +702,10 @@ public class TestAmqpPeer implements AutoCloseable
 
     public void expectLinkFlow()
     {
-        expectLinkFlow(false);
+        expectLinkFlow(false, Matchers.greaterThan(UnsignedInteger.ZERO));
     }
 
-    public void expectLinkFlow(boolean drain)
+    public void expectLinkFlow(boolean drain, Matcher<UnsignedInteger> 
creditMatcher)
     {
         Matcher<Boolean> drainMatcher = null;
         if(drain)
@@ -718,7 +718,7 @@ public class TestAmqpPeer implements AutoCloseable
         }
 
         final FlowMatcher flowMatcher = new FlowMatcher()
-                        
.withLinkCredit(Matchers.greaterThan(UnsignedInteger.ZERO))
+                        .withLinkCredit(creditMatcher)
                         .withHandle(Matchers.notNullValue())
                         .withDrain(drainMatcher);
 


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

Reply via email to