diff --git a/activemq-unit-tests/src/test/java/org/apache/activemq/transport/discovery/DiscoveryTransportBrokerTest.java b/activemq-unit-tests/src/test/java/org/apache/activemq/transport/discovery/DiscoveryTransportBrokerTest.java index 38f7cdbed5..339cdaae43 100755 --- a/activemq-unit-tests/src/test/java/org/apache/activemq/transport/discovery/DiscoveryTransportBrokerTest.java +++ b/activemq-unit-tests/src/test/java/org/apache/activemq/transport/discovery/DiscoveryTransportBrokerTest.java @@ -144,7 +144,7 @@ public class DiscoveryTransportBrokerTest extends NetworkTestSupport { } protected StubConnection createFailoverConnection() throws Exception { - URI failoverURI = new URI("discovery:" + getDiscoveryUri()); + URI failoverURI = new URI("discovery:(" + getDiscoveryUri() + ")?startupMaxReconnectAttempts=5"); Transport transport = TransportFactory.connect(failoverURI); StubConnection connection = new StubConnection(transport); connections.add(connection); diff --git a/activemq-unit-tests/src/test/java/org/apache/activemq/transport/discovery/DiscoveryTransportNoBrokerTest.java b/activemq-unit-tests/src/test/java/org/apache/activemq/transport/discovery/DiscoveryTransportNoBrokerTest.java index ffb5051aeb..812632797b 100644 --- a/activemq-unit-tests/src/test/java/org/apache/activemq/transport/discovery/DiscoveryTransportNoBrokerTest.java +++ b/activemq-unit-tests/src/test/java/org/apache/activemq/transport/discovery/DiscoveryTransportNoBrokerTest.java @@ -64,7 +64,7 @@ public class DiscoveryTransportNoBrokerTest extends CombinationTestSupport { final int noConnectionToCreate = 10; for (int i=0; i<10;i++) { ActiveMQConnectionFactory factory = - new ActiveMQConnectionFactory("discovery:(multicast://239.255.2.3:6155?group=" + group +")?closeAsync=false"); + new ActiveMQConnectionFactory("discovery:(multicast://239.255.2.3:6155?group=" + group +")?closeAsync=false&startupMaxReconnectAttempts=5"); LOG.info("Connecting."); Connection connection = factory.createConnection(); connection.setClientID("test");