tidy up the tests

git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@490807 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Davies 2006-12-28 21:00:36 +00:00
parent 81920f61cc
commit 63d78acccc
2 changed files with 17 additions and 4 deletions

View File

@ -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{

View File

@ -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);
}
}