diff --git a/activemq-core/src/test/java/org/apache/activemq/broker/region/cursors/CursorSupport.java b/activemq-core/src/test/java/org/apache/activemq/broker/region/cursors/CursorSupport.java index 88a203e951..de20a38051 100644 --- a/activemq-core/src/test/java/org/apache/activemq/broker/region/cursors/CursorSupport.java +++ b/activemq-core/src/test/java/org/apache/activemq/broker/region/cursors/CursorSupport.java @@ -127,12 +127,25 @@ public abstract class CursorSupport extends TestCase{ producer.send(msg); } latch.await(300000,TimeUnit.MILLISECONDS); + producerConnection.close(); + consumerConnection.close(); assertEquals("Still dipatching - count down latch not sprung",latch.getCount(),0); assertEquals("cosumerList - expected: "+MESSAGE_COUNT+" but was: "+consumerList.size(),consumerList.size(), senderList.size()); - assertEquals(senderList,consumerList); - producerConnection.close(); - consumerConnection.close(); + for (int i =0; i < senderList.size(); i++) { + Message sent = (Message)senderList.get(i); + Message consumed = (Message)consumerList.get(i); + if (!sent.equals(consumed)) { + System.err.println("BAD MATCH AT POS " + i); + System.err.println(sent); + System.err.println(consumed); + System.err.println("\n\n\n\n\n"); + for (int j = 0; j < consumerList.size(); j++) { + System.err.println(consumerList.get(j)); + } + } + assertEquals("This should be the same at pos " + i + " in the list",sent.getJMSMessageID(),consumed.getJMSMessageID()); + } } protected Connection getConsumerConnection(ConnectionFactory fac) throws JMSException{ diff --git a/activemq-core/src/test/java/org/apache/activemq/broker/region/cursors/KahaCursorDurableTest.java b/activemq-core/src/test/java/org/apache/activemq/broker/region/cursors/KahaCursorDurableTest.java index 4c2fb8c4e4..745dd4eeda 100644 --- a/activemq-core/src/test/java/org/apache/activemq/broker/region/cursors/KahaCursorDurableTest.java +++ b/activemq-core/src/test/java/org/apache/activemq/broker/region/cursors/KahaCursorDurableTest.java @@ -35,6 +35,6 @@ public class KahaCursorDurableTest extends CursorDurableTest{ KahaPersistenceAdapter adaptor = new KahaPersistenceAdapter(new File("activemq-data/durableTest")); answer.setPersistenceAdapter(adaptor); answer.addConnector(bindAddress); - //answer.setDeleteAllMessagesOnStartup(true); + answer.setDeleteAllMessagesOnStartup(true); } }