Author: rajith
Date: Thu Oct 14 21:21:02 2010
New Revision: 1022722

URL: http://svn.apache.org/viewvc?rev=1022722&view=rev
Log:
QPID-2418
The tests "testResubscribeWithChangedSelectorNoClose" and 
"testDurSubAddMessageSelectorNoClose" are failing against the c++ broker due to 
wrong assumptions made in the test cases.

It creates subscriptions, then sends messages and tries to check the queue 
depth. However the c++ broker (not sure what the java broker behaviour is) will 
imediately send the messages to the java client. All though the messages are 
received in no-acquire mode the broker will not show them as available unless 
the client releases them.

I added a connection stop immediately before the messages were sent, preventing 
the broker from sending them to the consumer.
And then I added a connection start soon after the queue depth is querried.

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=1022722&r1=1022721&r2=1022722&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
 Thu Oct 14 21:21:02 2010
@@ -671,7 +671,7 @@ public class DurableSubscriptionTest ext
      * <li>create another durable subscriber with a different selector and 
same name
      * <li>check first subscriber is now closed
      * <li>create a publisher and send messages
-     * <li>check messages are recieved correctly
+     * <li>check messages are received correctly
      * </ul>
      * <p>
      * QPID-2418
@@ -704,6 +704,8 @@ public class DurableSubscriptionTest ext
             e.printStackTrace();
         }
 
+        conn.stop();
+        
         // Send 1 matching message and 1 non-matching message
         MessageProducer producer = session.createProducer(topic);
         TextMessage msg = 
session.createTextMessage("testResubscribeWithChangedSelectorAndRestart1");
@@ -718,6 +720,8 @@ public class DurableSubscriptionTest ext
         AMQQueue queue = new AMQQueue("amq.topic", "clientid" + ":" + 
"testResubscribeWithChangedSelectorNoClose");
         assertEquals("Queue depth is wrong", isJavaBroker() ? 1 : 2, 
((AMQSession<?, ?>) session).getQueueDepth(queue));
 
+        conn.start();
+        
         Message rMsg = subB.receive(1000);
         assertNotNull(rMsg);
         assertEquals("Content was wrong", 
@@ -768,6 +772,8 @@ public class DurableSubscriptionTest ext
             e.printStackTrace();
         }
 
+        conn.stop();
+        
         // Send 1 matching message and 1 non-matching message
         MessageProducer producer = session.createProducer(topic);
         TextMessage msg = 
session.createTextMessage("testResubscribeWithChangedSelectorAndRestart1");
@@ -782,6 +788,8 @@ public class DurableSubscriptionTest ext
         AMQQueue queue = new AMQQueue("amq.topic", "clientid" + ":" + 
"subscriptionName");
         assertEquals("Queue depth is wrong", isJavaBroker() ? 1 : 2, 
((AMQSession<?, ?>) session).getQueueDepth(queue));
         
+        conn.start();
+        
         Message rMsg = subTwo.receive(1000);
         assertNotNull(rMsg);
         assertEquals("Content was wrong", 



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

Reply via email to