tidy up and enable auto fail as this hangs in 5.3 for some reason. stack trace will help diagnose

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@906861 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Gary Tully 2010-02-05 09:13:39 +00:00
parent e561040c70
commit a866d93b6f
1 changed files with 4 additions and 5 deletions

View File

@ -48,7 +48,7 @@ public class AMQ2413Test extends CombinationTestSupport implements MessageListen
BrokerService broker; BrokerService broker;
private ActiveMQConnectionFactory factory; private ActiveMQConnectionFactory factory;
private static final int HANG_THRESHOLD = 30; private static final int HANG_THRESHOLD = 60;
private static final int SEND_COUNT = 10000; private static final int SEND_COUNT = 10000;
private static final int RECEIVER_THINK_TIME = 1; private static final int RECEIVER_THINK_TIME = 1;
private static final int CONSUMER_COUNT = 1; private static final int CONSUMER_COUNT = 1;
@ -94,7 +94,7 @@ public class AMQ2413Test extends CombinationTestSupport implements MessageListen
factory = new ActiveMQConnectionFactory("tcp://0.0.0.0:2401"); factory = new ActiveMQConnectionFactory("tcp://0.0.0.0:2401");
//factory = new ActiveMQConnectionFactory("vm://localhost?broker.useJmx=false&broker.persistent=false"); //factory = new ActiveMQConnectionFactory("vm://localhost?broker.useJmx=false&broker.persistent=false");
setAutoFail(true);
super.setUp(); super.setUp();
} }
@ -133,7 +133,7 @@ public class AMQ2413Test extends CombinationTestSupport implements MessageListen
producer.start(); producer.start();
services.add(producer); services.add(producer);
} }
waitForMessageReceipt(300000); waitForMessageReceipt();
} finally { } finally {
if (p != null) { if (p != null) {
@ -172,8 +172,7 @@ public class AMQ2413Test extends CombinationTestSupport implements MessageListen
* @throws TimeoutException * @throws TimeoutException
* *
*/ */
private void waitForMessageReceipt(long timeout) throws InterruptedException, TimeoutException { private void waitForMessageReceipt() throws InterruptedException, TimeoutException {
// TODO Auto-generated method stub
try { try {
while (count.get() < SEND_COUNT) { while (count.get() < SEND_COUNT) {
if (!receivedMessages.tryAcquire(HANG_THRESHOLD, TimeUnit.SECONDS)) { if (!receivedMessages.tryAcquire(HANG_THRESHOLD, TimeUnit.SECONDS)) {