From b28371f57920a2b8546304f2ae74888627c409c7 Mon Sep 17 00:00:00 2001 From: Rajith Muditha Attapattu Date: Mon, 18 Oct 2010 03:45:47 +0000 Subject: QPID-2418 The test "testDurSubSameMessageSelector" fails when run against the cpp.noprefetch profile as the queue depth check is fails for the following reason. The test sends 5 matching and non matching messages to the queue alternatively. Since the C++ broker does not implement selectors all 10 messages are in the queue. When run with the noprefetch profile, messages are fetched one at a time. Therefore when the last matching message is read, there is still one more message (one that does not match) left in the queue. Therefore the queue depth check needs to take this into account. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1023644 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/qpid/test/unit/topic/DurableSubscriptionTest.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'java') diff --git a/java/systests/src/main/java/org/apache/qpid/test/unit/topic/DurableSubscriptionTest.java b/java/systests/src/main/java/org/apache/qpid/test/unit/topic/DurableSubscriptionTest.java index 915eccee3a..d799b141c0 100644 --- a/java/systests/src/main/java/org/apache/qpid/test/unit/topic/DurableSubscriptionTest.java +++ b/java/systests/src/main/java/org/apache/qpid/test/unit/topic/DurableSubscriptionTest.java @@ -657,7 +657,14 @@ public class DurableSubscriptionTest extends QpidBrokerTestCase session.commit(); // Check queue has no messages - assertEquals("Queue should be empty", 0, ((AMQSession) session).getQueueDepth(queue)); + if (isJavaBroker()) + { + assertEquals("Queue should be empty", 0, ((AMQSession) session).getQueueDepth(queue)); + } + else + { + assertTrue("At most the queue should have only 1 message", ((AMQSession) session).getQueueDepth(queue) <= 1); + } // Unsubscribe session.unsubscribe("sameMessageSelector"); -- cgit v1.2.1