diff options
author | Aidan Skinner <aidan@apache.org> | 2008-02-20 17:12:32 +0000 |
---|---|---|
committer | Aidan Skinner <aidan@apache.org> | 2008-02-20 17:12:32 +0000 |
commit | 3aed99f65d795c234faa9b584182cf3ea8c67b4a (patch) | |
tree | 8ef844f3a6ad1810a8e37a13c87ca23ddf51b603 /java | |
parent | bc9cf0d495598b359fc1a67d03f4636ca610c6a9 (diff) | |
download | qpid-python-3aed99f65d795c234faa9b584182cf3ea8c67b4a.tar.gz |
QPID-786 Remove bogus Failover timeout, add test.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/branches/M2.1@629540 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java')
-rw-r--r-- | java/client/src/main/java/org/apache/qpid/jms/FailoverPolicy.java | 12 | ||||
-rw-r--r-- | java/systests/src/main/java/org/apache/qpid/test/client/failover/FailoverTest.java | 16 |
2 files changed, 16 insertions, 12 deletions
diff --git a/java/client/src/main/java/org/apache/qpid/jms/FailoverPolicy.java b/java/client/src/main/java/org/apache/qpid/jms/FailoverPolicy.java index 6ec883ff0b..8e3ccc3b02 100644 --- a/java/client/src/main/java/org/apache/qpid/jms/FailoverPolicy.java +++ b/java/client/src/main/java/org/apache/qpid/jms/FailoverPolicy.java @@ -34,7 +34,6 @@ public class FailoverPolicy private static final long MINUTE = 60000L; private static final long DEFAULT_METHOD_TIMEOUT = 1 * MINUTE; - private static final long DEFAULT_FAILOVER_TIMEOUT = 4 * MINUTE; private FailoverMethod[] _methods = new FailoverMethod[1]; @@ -161,16 +160,7 @@ public class FailoverPolicy } else { - if ((now - _lastFailTime) >= DEFAULT_FAILOVER_TIMEOUT) - { - _logger.info("Failover timeout"); - - return false; - } - else - { - _lastMethodTime = now; - } + _lastMethodTime = now; } } else diff --git a/java/systests/src/main/java/org/apache/qpid/test/client/failover/FailoverTest.java b/java/systests/src/main/java/org/apache/qpid/test/client/failover/FailoverTest.java index fffe073362..9d1e461f05 100644 --- a/java/systests/src/main/java/org/apache/qpid/test/client/failover/FailoverTest.java +++ b/java/systests/src/main/java/org/apache/qpid/test/client/failover/FailoverTest.java @@ -7,6 +7,7 @@ import org.apache.qpid.client.AMQQueue; import org.apache.qpid.client.transport.TransportConnection; import org.apache.qpid.jms.ConnectionListener; import org.apache.qpid.server.registry.ApplicationRegistry; +import org.apache.qpid.url.URLSyntaxException; import org.apache.log4j.Logger; import javax.jms.Connection; @@ -49,7 +50,6 @@ public class FailoverTest extends TestCase implements ConnectionListener TransportConnection.createVMBroker(usedBrokers); } - //undo last addition conFactory = new AMQConnectionFactory(String.format(BROKER, usedBrokers - 1, usedBrokers)); _logger.info("Connecting on:" + conFactory.getConnectionURL()); @@ -197,6 +197,20 @@ public class FailoverTest extends TestCase implements ConnectionListener assertNotNull("Exception should be thrown", failure); } + // This test disabled so that it doesn't add 4 minnutes to the length of time it takes to run, which would be lame + public void txest4MinuteFailover() throws Exception + { + conFactory = new AMQConnectionFactory("amqp://guest:guest@/test?brokerlist='vm://:"+(usedBrokers-1)+"?connectdelay='60000'&retries='2''"); + _logger.info("Connecting on:" + conFactory.getConnectionURL()); + con = conFactory.createConnection(); + ((AMQConnection) con).setConnectionListener(this); + con.start(); + + long failTime = System.currentTimeMillis() + 60000; + causeFailure(); + assertTrue("Failover did not take long enough", System.currentTimeMillis() > failTime); + } + public void bytesSent(long count) { } |