qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rob...@apache.org
Subject svn commit: r952694 - /qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/store/PersistentStoreTest.java
Date Tue, 08 Jun 2010 15:33:42 GMT
Author: robbie
Date: Tue Jun  8 15:33:42 2010
New Revision: 952694

URL: http://svn.apache.org/viewvc?rev=952694&view=rev
Log:
QPID-2650: make PST check the recovered messages more precisely, and more informative about
the unexpected message it recieves when it fails

Modified:
    qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/store/PersistentStoreTest.java

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/store/PersistentStoreTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/store/PersistentStoreTest.java?rev=952694&r1=952693&r2=952694&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/store/PersistentStoreTest.java
(original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/store/PersistentStoreTest.java
Tue Jun  8 15:33:42 2010
@@ -32,6 +32,7 @@ import javax.jms.MessageConsumer;
 import javax.jms.MessageProducer;
 import javax.jms.Queue;
 import javax.jms.Session;
+
 import java.util.ArrayList;
 import java.util.List;
 
@@ -49,7 +50,7 @@ public class PersistentStoreTest extends
         super.setUp();
         _con = getConnection();
         _con.start();
-        _session = _con.createSession(true, Session.AUTO_ACKNOWLEDGE);
+        _session = _con.createSession(true, Session.SESSION_TRANSACTED);
         _destination = _session.createQueue(getTestQueueName());
         _consumer = _session.createConsumer(_destination);
         _consumer.close();
@@ -69,8 +70,14 @@ public class PersistentStoreTest extends
         {
             Message msg = _consumer.receive(RECEIVE_TIMEOUT);
             assertNotNull("Message " + i + " not received", msg);
+            assertEquals("Did not recieve the expected message", i, msg.getIntProperty(INDEX));
+        }
+        
+        Message msg = _consumer.receive(100);
+        if(msg != null)
+        {
+            fail("No more messages should be received, but received message: " + msg.getIntProperty(INDEX));
         }
-        assertNull("No more messages should be received", _consumer.receive(100));
     }
 
 //    /**
@@ -119,6 +126,7 @@ public class PersistentStoreTest extends
     public void testForcibleStartStopMidTransaction() throws Exception
     {
         sendMessage(_session, _destination, 5);
+        //sync to ensure that the above messages have reached the broker
         ((AMQSession) _session).sync();
         restartBroker();
         checkMessages();



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


Mime
View raw message