Give this one just a bit more time to see if its just slow machines that cause it to fail.

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1188146 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Timothy A. Bish 2011-10-24 14:07:29 +00:00
parent 534a44fbd6
commit 0b1b6fa3ca
1 changed files with 3 additions and 8 deletions

View File

@ -22,6 +22,8 @@ import org.apache.activemq.broker.BrokerService;
import org.apache.activemq.util.ConsumerThread; import org.apache.activemq.util.ConsumerThread;
import org.apache.activemq.util.ProducerThread; import org.apache.activemq.util.ProducerThread;
import java.util.concurrent.TimeUnit;
import javax.jms.Connection; import javax.jms.Connection;
import javax.jms.Session; import javax.jms.Session;
import java.net.URI; import java.net.URI;
@ -33,9 +35,7 @@ public class ProxyFailoverTest extends TestCase {
@Override @Override
protected void setUp() throws Exception { protected void setUp() throws Exception {
startRemoteBroker(true); startRemoteBroker(true);
proxyBroker = new BrokerService(); proxyBroker = new BrokerService();
ProxyConnector connector = new ProxyConnector(); ProxyConnector connector = new ProxyConnector();
connector.setBind(new URI("tcp://localhost:51618")); connector.setBind(new URI("tcp://localhost:51618"));
@ -46,14 +46,12 @@ public class ProxyFailoverTest extends TestCase {
proxyBroker.setUseJmx(false); proxyBroker.setUseJmx(false);
proxyBroker.start(); proxyBroker.start();
proxyBroker.waitUntilStarted(); proxyBroker.waitUntilStarted();
} }
@Override @Override
protected void tearDown() throws Exception { protected void tearDown() throws Exception {
proxyBroker.stop(); proxyBroker.stop();
proxyBroker.waitUntilStopped(); proxyBroker.waitUntilStopped();
remoteBroker.stop(); remoteBroker.stop();
remoteBroker.waitUntilStopped(); remoteBroker.waitUntilStopped();
} }
@ -67,8 +65,6 @@ public class ProxyFailoverTest extends TestCase {
producer.setSleep(10); producer.setSleep(10);
producer.start(); producer.start();
//ActiveMQConnectionFactory consumerFactory = new ActiveMQConnectionFactory("tcp://localhost:51618?wireFormat.cacheEnabled=false");
ActiveMQConnectionFactory consumerFactory = new ActiveMQConnectionFactory("tcp://localhost:51618"); ActiveMQConnectionFactory consumerFactory = new ActiveMQConnectionFactory("tcp://localhost:51618");
Connection consumerConnection = consumerFactory.createConnection(); Connection consumerConnection = consumerFactory.createConnection();
consumerConnection.start(); consumerConnection.start();
@ -76,7 +72,7 @@ public class ProxyFailoverTest extends TestCase {
ConsumerThread consumer = new ConsumerThread(consumerSession, consumerSession.createQueue("ProxyTest")); ConsumerThread consumer = new ConsumerThread(consumerSession, consumerSession.createQueue("ProxyTest"));
consumer.start(); consumer.start();
Thread.sleep(10*1000); TimeUnit.SECONDS.sleep(15);
remoteBroker.stop(); remoteBroker.stop();
remoteBroker.waitUntilStopped(); remoteBroker.waitUntilStopped();
@ -86,7 +82,6 @@ public class ProxyFailoverTest extends TestCase {
consumer.join(); consumer.join();
assertEquals(1000, consumer.getReceived()); assertEquals(1000, consumer.getReceived());
} }
protected void startRemoteBroker(boolean delete) throws Exception { protected void startRemoteBroker(boolean delete) throws Exception {