qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rob...@apache.org
Subject svn commit: r1179965 - in /qpid/trunk/qpid/java: client/src/main/java/org/apache/qpid/client/AMQSession.java systests/src/main/java/org/apache/qpid/client/failover/FailoverBehaviourTest.java
Date Fri, 07 Oct 2011 08:55:59 GMT
Author: robbie
Date: Fri Oct  7 08:55:58 2011
New Revision: 1179965

URL: http://svn.apache.org/viewvc?rev=1179965&view=rev
Log:
QPID-3526: ensure that the session is marked clean after message.acknowledge() is used, add
test to verify behaviour

Modified:
    qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession.java
    qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/client/failover/FailoverBehaviourTest.java

Modified: qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession.java?rev=1179965&r1=1179964&r2=1179965&view=diff
==============================================================================
--- qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession.java (original)
+++ qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession.java Fri Oct
 7 08:55:58 2011
@@ -630,6 +630,7 @@ public abstract class AMQSession<C exten
         try
         {
             acknowledgeImpl();
+            markClean();
         }
         catch (TransportException e)
         {

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/client/failover/FailoverBehaviourTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/client/failover/FailoverBehaviourTest.java?rev=1179965&r1=1179964&r2=1179965&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/client/failover/FailoverBehaviourTest.java
(original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/client/failover/FailoverBehaviourTest.java
Fri Oct  7 08:55:58 2011
@@ -463,6 +463,31 @@ public class FailoverBehaviourTest exten
     }
 
     /**
+     * Test that calling acknowledge before failover leaves the session
+     * clean for use after failover.
+     */
+    public void testAcknowledgeBeforeFailover() throws Exception
+    {
+        init(Session.CLIENT_ACKNOWLEDGE, true);
+
+        produceMessages();
+
+        // consume messages and acknowledge them
+        Message lastMessage = consumeMessages();
+        lastMessage.acknowledge();
+
+        causeFailure();
+
+        assertFailoverException();
+
+        produceMessages();
+
+        // tests whether receiving and acknowledgment is working after recover
+        lastMessage = consumeMessages();
+        lastMessage.acknowledge();
+    }
+
+    /**
      * Test that receiving of messages after failover prior to calling
      * {@link Message#acknowledge()} still results in acknowledge throwing an exception.
      */



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


Mime
View raw message