You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ra...@apache.org on 2010/10/18 05:45:48 UTC

svn commit: r1023644 - /qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/topic/DurableSubscriptionTest.java

Author: rajith
Date: Mon Oct 18 03:45:47 2010
New Revision: 1023644

URL: http://svn.apache.org/viewvc?rev=1023644&view=rev
Log:
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.

Modified:
    qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/topic/DurableSubscriptionTest.java

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/topic/DurableSubscriptionTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/topic/DurableSubscriptionTest.java?rev=1023644&r1=1023643&r2=1023644&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/topic/DurableSubscriptionTest.java (original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/topic/DurableSubscriptionTest.java Mon Oct 18 03:45:47 2010
@@ -657,7 +657,14 @@ public class DurableSubscriptionTest ext
         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");



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org