You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by cw...@apache.org on 2011/03/04 17:27:09 UTC

svn commit: r1078041 - /uima/uima-as/trunk/uimaj-as-activemq/src/test/java/org/apache/uima/ee/test/utils/ActiveMQSupport.java

Author: cwiklik
Date: Fri Mar  4 16:27:09 2011
New Revision: 1078041

URL: http://svn.apache.org/viewvc?rev=1078041&view=rev
Log:
UIMA-2069 in addConnector() catch IOException instead of BindException to detect unavailable port

Modified:
    uima/uima-as/trunk/uimaj-as-activemq/src/test/java/org/apache/uima/ee/test/utils/ActiveMQSupport.java

Modified: uima/uima-as/trunk/uimaj-as-activemq/src/test/java/org/apache/uima/ee/test/utils/ActiveMQSupport.java
URL: http://svn.apache.org/viewvc/uima/uima-as/trunk/uimaj-as-activemq/src/test/java/org/apache/uima/ee/test/utils/ActiveMQSupport.java?rev=1078041&r1=1078040&r2=1078041&view=diff
==============================================================================
--- uima/uima-as/trunk/uimaj-as-activemq/src/test/java/org/apache/uima/ee/test/utils/ActiveMQSupport.java (original)
+++ uima/uima-as/trunk/uimaj-as-activemq/src/test/java/org/apache/uima/ee/test/utils/ActiveMQSupport.java Fri Mar  4 16:27:09 2011
@@ -19,6 +19,7 @@
 
 package org.apache.uima.ee.test.utils;
 
+import java.io.IOException;
 import java.lang.reflect.Method;
 import java.net.BindException;
 import java.net.URI;
@@ -166,8 +167,12 @@ public class ActiveMQSupport extends Tes
         String uri = type+"://localhost:" + basePort;
         transportConnector = aBroker.addConnector(uri);
         found = true;
-      } catch ( BindException e) {
-        basePort++;
+      } catch ( IOException e) {
+        if ( e.getCause() != null && e.getCause() instanceof BindException ) {
+          basePort++;
+        } else {
+          throw new BrokerConnectionException("Unexpected Exception While Connecting to Broker with URL:"+uri+"\n"+e);
+        }
       } catch( Exception e) {
         throw new BrokerConnectionException("Unexpected Exception While Connecting to Broker with URL:"+uri+"\n"+e);
       }