From ead505da9837037beae4e5bd18049971d7d0473d Mon Sep 17 00:00:00 2001 From: "Hiram R. Chirino" Date: Tue, 7 Mar 2006 20:33:02 +0000 Subject: [PATCH] Fixed transport testcase so that it does not fail anymore. tcp transport was being stopped and then oneway was being called on it, and it was throwing an unexpected illegalstate exception witched to ioexception and all was better. git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@384001 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/activemq/transport/TransportThreadSupport.java | 4 ++-- .../apache/activemq/transport/failover/FailoverTransport.java | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/activemq-core/src/main/java/org/apache/activemq/transport/TransportThreadSupport.java b/activemq-core/src/main/java/org/apache/activemq/transport/TransportThreadSupport.java index e9d9a8ffd9..6aa13dd97c 100644 --- a/activemq-core/src/main/java/org/apache/activemq/transport/TransportThreadSupport.java +++ b/activemq-core/src/main/java/org/apache/activemq/transport/TransportThreadSupport.java @@ -83,11 +83,11 @@ public abstract class TransportThreadSupport extends TransportSupport implements protected abstract void doStop(ServiceStopper stopper) throws Exception; - protected void checkStarted(Command command) { + protected void checkStarted(Command command) throws IOException { if (!isStarted()) { // we might try to shut down the transport before it was ever started in some test cases if (!(command instanceof ShutdownInfo)) { - throw new IllegalStateException("The transport " + this + " of type: " + getClass().getName() + " has not been started yet!"); + throw new IOException("The transport " + this + " of type: " + getClass().getName() + " is not running."); } } } diff --git a/activemq-core/src/main/java/org/apache/activemq/transport/failover/FailoverTransport.java b/activemq-core/src/main/java/org/apache/activemq/transport/failover/FailoverTransport.java index e5bb154059..a91db294e5 100755 --- a/activemq-core/src/main/java/org/apache/activemq/transport/failover/FailoverTransport.java +++ b/activemq-core/src/main/java/org/apache/activemq/transport/failover/FailoverTransport.java @@ -239,6 +239,7 @@ public class FailoverTransport implements CompositeTransport { if (connectedTransport != null) { connectedTransport.stop(); + connectedTransport=null; } reconnectMutex.notifyAll(); }