activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rajdav...@apache.org
Subject svn commit: r490807 - in /incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/region/cursors: CursorSupport.java KahaCursorDurableTest.java
Date Thu, 28 Dec 2006 21:00:36 GMT
Author: rajdavies
Date: Thu Dec 28 13:00:36 2006
New Revision: 490807

URL: http://svn.apache.org/viewvc?view=rev&rev=490807
Log:
tidy up the tests

Modified:
    incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/region/cursors/CursorSupport.java
    incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/region/cursors/KahaCursorDurableTest.java

Modified: incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/region/cursors/CursorSupport.java
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/region/cursors/CursorSupport.java?view=diff&rev=490807&r1=490806&r2=490807
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/region/cursors/CursorSupport.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/region/cursors/CursorSupport.java
Thu Dec 28 13:00:36 2006
@@ -127,12 +127,25 @@
             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{

Modified: incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/region/cursors/KahaCursorDurableTest.java
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/region/cursors/KahaCursorDurableTest.java?view=diff&rev=490807&r1=490806&r2=490807
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/region/cursors/KahaCursorDurableTest.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/region/cursors/KahaCursorDurableTest.java
Thu Dec 28 13:00:36 2006
@@ -35,6 +35,6 @@
         KahaPersistenceAdapter adaptor = new KahaPersistenceAdapter(new File("activemq-data/durableTest"));
         answer.setPersistenceAdapter(adaptor);
         answer.addConnector(bindAddress);
-        //answer.setDeleteAllMessagesOnStartup(true);
+        answer.setDeleteAllMessagesOnStartup(true);
     }
 }



Mime
View raw message