You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ri...@apache.org on 2007/11/06 12:40:15 UTC

svn commit: r592388 - /incubator/qpid/branches/M2.1/java/systests/src/main/java/org/apache/qpid/server/txn/TxnTest.java

Author: ritchiem
Date: Tue Nov  6 03:40:13 2007
New Revision: 592388

URL: http://svn.apache.org/viewvc?rev=592388&view=rev
Log:
QPID-662 Transactional state not correctly reported after fail over. We now record if we have sent any messages
from here we can check if we have failed over and so have lost messages from the transaction making it invalid.

Modified:
    incubator/qpid/branches/M2.1/java/systests/src/main/java/org/apache/qpid/server/txn/TxnTest.java

Modified: incubator/qpid/branches/M2.1/java/systests/src/main/java/org/apache/qpid/server/txn/TxnTest.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/M2.1/java/systests/src/main/java/org/apache/qpid/server/txn/TxnTest.java?rev=592388&r1=592387&r2=592388&view=diff
==============================================================================
--- incubator/qpid/branches/M2.1/java/systests/src/main/java/org/apache/qpid/server/txn/TxnTest.java (original)
+++ incubator/qpid/branches/M2.1/java/systests/src/main/java/org/apache/qpid/server/txn/TxnTest.java Tue Nov  6 03:40:13 2007
@@ -351,6 +351,7 @@
         {
             txProducer.send(_clientSession.createTextMessage(MESSAGE_TXT));
             txProducer.send(_clientSession.createTextMessage(MESSAGE_TXT));
+            _clientSession.commit();
         }
         catch (JMSException jmse)
         {
@@ -360,6 +361,17 @@
             }
         }
 
+        received = _consumer.receive(10000);
+        assertNotNull("Message should be received.", received);
+        assertEquals("Incorrect Message Received.", MESSAGE_TXT, ((TextMessage) received).getText());
+
+        received = _consumer.receive(10000);
+        assertNotNull("Message should be received.", received);
+        assertEquals("Incorrect Message Received.", MESSAGE_TXT, ((TextMessage) received).getText());
+
+        //Check that the message isn't received.
+        received = _consumer.receive(1000);
+        assertNull("Additional message received", received);
 
         _consumer.close();
     }