You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ro...@apache.org on 2016/03/29 13:07:48 UTC
[1/2] qpid-jms git commit: QPIDJMS-157: remove credit delay,
test doesnt need/use it
Repository: qpid-jms
Updated Branches:
refs/heads/master 3c0f4117b -> cb5abb046
QPIDJMS-157: remove credit delay, test doesnt need/use it
Project: http://git-wip-us.apache.org/repos/asf/qpid-jms/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-jms/commit/fb4c3ab3
Tree: http://git-wip-us.apache.org/repos/asf/qpid-jms/tree/fb4c3ab3
Diff: http://git-wip-us.apache.org/repos/asf/qpid-jms/diff/fb4c3ab3
Branch: refs/heads/master
Commit: fb4c3ab3581512e04d1e6ab177c67b594740b649
Parents: 3c0f411
Author: Robert Gemmell <ro...@apache.org>
Authored: Tue Mar 29 10:23:30 2016 +0100
Committer: Robert Gemmell <ro...@apache.org>
Committed: Tue Mar 29 10:23:30 2016 +0100
----------------------------------------------------------------------
.../org/apache/qpid/jms/integration/ProducerIntegrationTest.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/fb4c3ab3/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/ProducerIntegrationTest.java
----------------------------------------------------------------------
diff --git a/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/ProducerIntegrationTest.java b/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/ProducerIntegrationTest.java
index 4b35a4f..1fa3b91 100644
--- a/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/ProducerIntegrationTest.java
+++ b/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/ProducerIntegrationTest.java
@@ -1005,7 +1005,7 @@ public class ProducerIntegrationTest extends QpidJmsTestCase {
// Expect the producer to attach and grant it some credit, it should send
// a transfer which we will not send any response for which should cause the
// send operation to time out.
- testPeer.expectSenderAttach(100);
+ testPeer.expectSenderAttach();
testPeer.expectTransferButDoNotRespond(messageMatcher);
testPeer.expectClose();
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org
[2/2] qpid-jms git commit: QPIDJMS-159: update to ensure the flow
better reflects previous activity, generalise peer method a little
Posted by ro...@apache.org.
QPIDJMS-159: update to ensure the flow better reflects previous activity, generalise peer method a little
Project: http://git-wip-us.apache.org/repos/asf/qpid-jms/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-jms/commit/cb5abb04
Tree: http://git-wip-us.apache.org/repos/asf/qpid-jms/tree/cb5abb04
Diff: http://git-wip-us.apache.org/repos/asf/qpid-jms/diff/cb5abb04
Branch: refs/heads/master
Commit: cb5abb04623e73baf4bc6f9a0fe8a497198e10a6
Parents: fb4c3ab
Author: Robert Gemmell <ro...@apache.org>
Authored: Tue Mar 29 11:56:57 2016 +0100
Committer: Robert Gemmell <ro...@apache.org>
Committed: Tue Mar 29 11:56:57 2016 +0100
----------------------------------------------------------------------
.../integration/ProducerIntegrationTest.java | 3 +--
.../qpid/jms/test/testpeer/TestAmqpPeer.java | 22 ++++++++++++--------
2 files changed, 14 insertions(+), 11 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/cb5abb04/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/ProducerIntegrationTest.java
----------------------------------------------------------------------
diff --git a/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/ProducerIntegrationTest.java b/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/ProducerIntegrationTest.java
index 1fa3b91..a9b9a45 100644
--- a/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/ProducerIntegrationTest.java
+++ b/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/ProducerIntegrationTest.java
@@ -1269,8 +1269,7 @@ public class ProducerIntegrationTest extends QpidJmsTestCase {
messageMatcher.setHeadersMatcher(headersMatcher);
messageMatcher.setMessageAnnotationsMatcher(msgAnnotationsMatcher);
- // After the first send lets drain off the credit from the sender asking for one
- // more message if it has one.
+ // After the first send lets drain off the remaining credit from the sender
testPeer.expectTransferRespondWithDrain(messageMatcher, 1);
testPeer.expectLinkFlow(true, false, Matchers.equalTo(UnsignedInteger.ZERO));
testPeer.expectDetach(true, true, true);
http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/cb5abb04/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 582a0d2..b4cf921 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
@@ -114,6 +114,7 @@ public class TestAmqpPeer implements AutoCloseable
private static final UnsignedByte SASL_OK = UnsignedByte.valueOf((byte)0);
private static final UnsignedByte SASL_FAIL_AUTH = UnsignedByte.valueOf((byte)1);
private static final int CONNECTION_CHANNEL = 0;
+ private static final int DEFAULT_PRODUCER_CREDIT = 100;
private volatile AssertionError _firstAssertionError = null;
private final TestAmqpPeerRunner _driverRunnable;
@@ -873,7 +874,7 @@ public class TestAmqpPeer implements AutoCloseable
public void expectSenderAttach(long creditFlowDelay)
{
- expectSenderAttach(notNullValue(), notNullValue(), false, false, false, creditFlowDelay, 100, null, null);
+ expectSenderAttach(notNullValue(), notNullValue(), false, false, false, creditFlowDelay, DEFAULT_PRODUCER_CREDIT, null, null);
}
public void expectSenderAttach(final Matcher<?> targetMatcher, final boolean refuseLink, boolean deferAttachResponseWrite)
@@ -888,7 +889,7 @@ public class TestAmqpPeer implements AutoCloseable
public void expectSenderAttach(final Matcher<?> sourceMatcher, final Matcher<?> targetMatcher, final boolean refuseLink, boolean omitDetach, boolean deferAttachResponseWrite, long creditFlowDelay, Symbol errorType, String errorMessage)
{
- expectSenderAttach(sourceMatcher, targetMatcher, refuseLink, omitDetach, deferAttachResponseWrite, creditFlowDelay, 100, errorType, errorMessage);
+ expectSenderAttach(sourceMatcher, targetMatcher, refuseLink, omitDetach, deferAttachResponseWrite, creditFlowDelay, DEFAULT_PRODUCER_CREDIT, errorType, errorMessage);
}
public void expectSenderAttach(final Matcher<?> sourceMatcher, final Matcher<?> targetMatcher, final boolean refuseLink, boolean omitDetach, boolean deferAttachResponseWrite, long creditFlowDelay, int creditAmount, Symbol errorType, String errorMessage)
@@ -1567,7 +1568,12 @@ public class TestAmqpPeer implements AutoCloseable
addHandler(transferMatcher);
}
- public void expectTransferRespondWithDrain(Matcher<Binary> expectedPayloadMatcher, int drainAmount)
+ public void expectTransferRespondWithDrain(Matcher<Binary> expectedPayloadMatcher, int sentMessages)
+ {
+ expectTransferRespondWithDrain(expectedPayloadMatcher, DEFAULT_PRODUCER_CREDIT, sentMessages);
+ }
+
+ public void expectTransferRespondWithDrain(Matcher<Binary> expectedPayloadMatcher, int originalCredit, int sentMessages)
{
Matcher<Boolean> settledMatcher = Matchers.anyOf(equalTo(false), nullValue());
@@ -1591,11 +1597,13 @@ public class TestAmqpPeer implements AutoCloseable
}
});
- final FlowFrame flowFrame = new FlowFrame().setNextIncomingId(UnsignedInteger.ONE) //TODO: shouldnt be hard coded
+ final FlowFrame flowFrame = new FlowFrame().setNextIncomingId(UnsignedInteger.ONE.add(UnsignedInteger.valueOf(sentMessages))) //TODO: start point shouldnt be hard coded
.setIncomingWindow(UnsignedInteger.valueOf(2048))
.setNextOutgoingId(UnsignedInteger.ONE) //TODO: shouldnt be hard coded
.setOutgoingWindow(UnsignedInteger.valueOf(2048))
- .setLinkCredit(UnsignedInteger.valueOf(drainAmount));
+ .setDeliveryCount(UnsignedInteger.valueOf(sentMessages))
+ .setLinkCredit(UnsignedInteger.valueOf(originalCredit - sentMessages))
+ .setDrain(true);
// The flow frame channel will be dynamically set based on the incoming frame. Using the -1 is an illegal placeholder.
final FrameSender flowFrameSender = new FrameSender(this, FrameType.AMQP, -1, flowFrame, null);
@@ -1606,13 +1614,9 @@ public class TestAmqpPeer implements AutoCloseable
{
flowFrameSender.setChannel(transferMatcher.getActualChannel());
flowFrame.setHandle(transferMatcher.getReceivedHandle());
- flowFrame.setDeliveryCount(UnsignedInteger.ONE);
- flowFrame.setDrain(true);
}
});
- flowFrameSender.setSendDelay(0);
-
composite.add(flowFrameSender);
composite.add(dispositionFrameSender);
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org