This test could get stuck - now only wait 2 seconds for a message

and use Memory Message Store

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@607186 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Davies 2007-12-28 08:11:14 +00:00
parent 2a538388fc
commit c493b87f0a
1 changed files with 17 additions and 3 deletions

View File

@ -17,7 +17,9 @@
package org.apache.activemq.usecases;
import java.util.Date;
import java.util.Map;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
import javax.jms.Connection;
import javax.jms.Destination;
@ -56,7 +58,7 @@ public final class TransactionTest extends TestCase {
public void testTransaction() throws Exception {
ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory("vm://localhost");
ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory("vm://localhost?broker.persistent=false");
connection = factory.createConnection();
queue = new ActiveMQQueue(getClass().getName() + "." + getName());
@ -104,8 +106,20 @@ public final class TransactionTest extends TestCase {
}
LOG.info("Waiting for latch");
latch.await();
latch.await(2,TimeUnit.SECONDS);
if (receivedText==null) {
/*
Map<Thread,StackTraceElement[]> map = Thread.getAllStackTraces();
for (Map.Entry<Thread,StackTraceElement[]> entry: map.entrySet()) {
System.out.println(entry.getKey());
for (StackTraceElement element :entry.getValue()) {
System.out.println(element);
}
}
*/
fail("No message received");
}
assertNotNull(receivedText);
LOG.info("test completed, destination=" + receivedText);
}