add toggle for whether or not a Flow frame response is sent after a 'drain' 
request is received


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

Branch: refs/heads/master
Commit: b581085b44e883112e0070508c05eda44fcca1a0
Parents: 07c3e99
Author: Robert Gemmell <[email protected]>
Authored: Tue Dec 9 10:43:30 2014 +0000
Committer: Robert Gemmell <[email protected]>
Committed: Tue Dec 9 10:43:30 2014 +0000

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


http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/b581085b/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 67949dd..3303d5d 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
@@ -521,7 +521,7 @@ public class SessionIntegrationTest extends QpidJmsTestCase 
{
             }
 
             // Expect the consumer to be 'stopped' prior to rollback by 
issuing a 'drain'
-            testPeer.expectLinkFlow(true, greaterThan(UnsignedInteger.ZERO));
+            testPeer.expectLinkFlow(true, 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
@@ -539,7 +539,7 @@ public class SessionIntegrationTest extends QpidJmsTestCase 
{
             }
 
             // Expect the consumer to be 'started' again as rollback completes
-            testPeer.expectLinkFlow(false, greaterThan(UnsignedInteger.ZERO));
+            testPeer.expectLinkFlow(false, false, 
greaterThan(UnsignedInteger.ZERO));
 
             session.rollback();
 
@@ -591,7 +591,7 @@ public class SessionIntegrationTest extends QpidJmsTestCase 
{
             Queue queue = session.createQueue("myQueue");
 
             testPeer.expectReceiverAttach();
-            testPeer.expectLinkFlow(false, 
equalTo(UnsignedInteger.valueOf(newPrefetch)));
+            testPeer.expectLinkFlow(false, false, 
equalTo(UnsignedInteger.valueOf(newPrefetch)));
 
             session.createConsumer(queue);
 

http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/b581085b/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 5e7c209..8dd6792 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, Matchers.greaterThan(UnsignedInteger.ZERO));
+        expectLinkFlow(false, false, 
Matchers.greaterThan(UnsignedInteger.ZERO));
     }
 
-    public void expectLinkFlow(boolean drain, Matcher<UnsignedInteger> 
creditMatcher)
+    public void expectLinkFlow(boolean drain, boolean sendDrainFlowResponse, 
Matcher<UnsignedInteger> creditMatcher)
     {
         Matcher<Boolean> drainMatcher = null;
         if(drain)
@@ -722,7 +722,7 @@ public class TestAmqpPeer implements AutoCloseable
                         .withHandle(Matchers.notNullValue())
                         .withDrain(drainMatcher);
 
-        if(drain)
+        if(drain && sendDrainFlowResponse)
         {
             final FlowFrame drainResponse = new FlowFrame();
             drainResponse.setOutgoingWindow(UnsignedInteger.ZERO); //TODO: 
shouldnt be hard coded


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

Reply via email to