summaryrefslogtreecommitdiff
path: root/qpid/java
diff options
context:
space:
mode:
authorMartin Ritchie <ritchiem@apache.org>2009-04-11 01:37:45 +0000
committerMartin Ritchie <ritchiem@apache.org>2009-04-11 01:37:45 +0000
commit863b0182f7e73a157cc8870f03f3ee12347756bc (patch)
tree695c33c65688de882c01381b133d35879aecfff4 /qpid/java
parentdcb301530474a1b66f4f8939c58582c14868f586 (diff)
downloadqpid-python-863b0182f7e73a157cc8870f03f3ee12347756bc.tar.gz
Added comments to help understand the test
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@764139 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java')
-rw-r--r--qpid/java/systests/src/main/java/org/apache/qpid/client/MessageListenerMultiConsumerTest.java10
1 files changed, 8 insertions, 2 deletions
diff --git a/qpid/java/systests/src/main/java/org/apache/qpid/client/MessageListenerMultiConsumerTest.java b/qpid/java/systests/src/main/java/org/apache/qpid/client/MessageListenerMultiConsumerTest.java
index b438304892..784943b404 100644
--- a/qpid/java/systests/src/main/java/org/apache/qpid/client/MessageListenerMultiConsumerTest.java
+++ b/qpid/java/systests/src/main/java/org/apache/qpid/client/MessageListenerMultiConsumerTest.java
@@ -197,13 +197,15 @@ public class MessageListenerMultiConsumerTest extends QpidTestCase
{
_logger.info("Performing Receive only with two consumers on one session ");
- MessageConsumer consumer2 = _clientSession1.createConsumer(_queue);
+ //Create a new consumer on session one that we don't use
+ _clientSession1.createConsumer(_queue);
int msg;
for (msg = 0; msg < (MSG_COUNT / 2); msg++)
{
-
+ // Attempt to receive up to half the messages
+ // The other half may have gone to the consumer above
final Message message = _consumer1.receive(1000);
if(message == null)
{
@@ -213,8 +215,12 @@ public class MessageListenerMultiConsumerTest extends QpidTestCase
}
_consumer1.close();
+ // This will close the unused consumer above.
_clientSession1.close();
+
+ // msg will now have recorded the number received on session 1
+ // attempt to retrieve the rest on session 2
for (; msg < MSG_COUNT ; msg++)
{
assertTrue("Failed at msg id" + msg, _consumer2.receive(1000) != null);