trun off exponential backoff so that reconnect will happen before the timeout after restart, intermittent failure in hudson

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@892194 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Gary Tully 2009-12-18 09:29:54 +00:00
parent 3a1bdc6249
commit 08d89ff881
1 changed files with 3 additions and 4 deletions

View File

@ -28,7 +28,6 @@ import junit.framework.TestCase;
import org.apache.activemq.ActiveMQConnectionFactory; import org.apache.activemq.ActiveMQConnectionFactory;
import org.apache.activemq.broker.BrokerService; import org.apache.activemq.broker.BrokerService;
import org.apache.activemq.broker.TransportConnector;
public class FailoverTimeoutTest extends TestCase { public class FailoverTimeoutTest extends TestCase {
@ -43,7 +42,7 @@ public class FailoverTimeoutTest extends TestCase {
bs.addConnector(tcpUri); bs.addConnector(tcpUri);
bs.start(); bs.start();
ActiveMQConnectionFactory cf = new ActiveMQConnectionFactory("failover:(" + tcpUri + ")?timeout=" + timeout); ActiveMQConnectionFactory cf = new ActiveMQConnectionFactory("failover:(" + tcpUri + ")?timeout=" + timeout + "&useExponentialBackOff=false");
Connection connection = cf.createConnection(); Connection connection = cf.createConnection();
Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
MessageProducer producer = session.createProducer(session MessageProducer producer = session.createProducer(session
@ -59,11 +58,11 @@ public class FailoverTimeoutTest extends TestCase {
assertEquals("Failover timeout of " + timeout + " ms reached.", jmse.getMessage()); assertEquals("Failover timeout of " + timeout + " ms reached.", jmse.getMessage());
} }
bs = new BrokerService(); bs = new BrokerService();
bs.setUseJmx(false); bs.setUseJmx(false);
bs.addConnector(tcpUri); bs.addConnector(tcpUri);
bs.start(); bs.start();
bs.waitUntilStarted();
producer.send(message); producer.send(message);