You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by gt...@apache.org on 2012/10/22 13:24:23 UTC

svn commit: r1400839 - in /activemq/trunk/activemq-core/src/test/java/org/apache/activemq: ActiveMQConnectionFactoryTest.java ActiveMQXAConnectionFactoryTest.java

Author: gtully
Date: Mon Oct 22 11:24:23 2012
New Revision: 1400839

URL: http://svn.apache.org/viewvc?rev=1400839&view=rev
Log:
polish test shutdown, jdk7 ci builds show regular failure here with jmx reuse

Modified:
    activemq/trunk/activemq-core/src/test/java/org/apache/activemq/ActiveMQConnectionFactoryTest.java
    activemq/trunk/activemq-core/src/test/java/org/apache/activemq/ActiveMQXAConnectionFactoryTest.java

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/ActiveMQConnectionFactoryTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/ActiveMQConnectionFactoryTest.java?rev=1400839&r1=1400838&r2=1400839&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/ActiveMQConnectionFactoryTest.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/ActiveMQConnectionFactoryTest.java Mon Oct 22 11:24:23 2012
@@ -54,7 +54,8 @@ public class ActiveMQConnectionFactoryTe
         assertTrue("should start with Cheese! but was: " + clientID, clientID.startsWith("Cheese"));
     }
 
-    protected void tearDown() throws Exception {
+    @Override
+    public void tearDown() throws Exception {
         // Try our best to close any previously opend connection.
         try {
             connection.close();
@@ -149,6 +150,8 @@ public class ActiveMQConnectionFactoryTe
         connection = (ActiveMQConnection)cf.createConnection();
         assertNotNull(connection);
 
+        connection.close();
+
         broker.stop();
     }
 
@@ -231,7 +234,7 @@ public class ActiveMQConnectionFactoryTe
         URI temp = new URI(uri);
         // URI connectURI = connector.getServer().getConnectURI();
         // TODO this sometimes fails when using the actual local host name
-        URI currentURI = connector.getServer().getConnectURI();
+        URI currentURI = new URI(connector.getPublishableConnectString());
 
         // sometimes the actual host name doesn't work in this test case
         // e.g. on OS X so lets use the original details but just use the actual
@@ -245,8 +248,6 @@ public class ActiveMQConnectionFactoryTe
         ActiveMQConnectionFactory cf = new ActiveMQConnectionFactory(connectURI);
         connection = (ActiveMQConnection)cf.createConnection();
         assertNotNull(connection);
-
-        broker.stop();
     }
 
 }

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/ActiveMQXAConnectionFactoryTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/ActiveMQXAConnectionFactoryTest.java?rev=1400839&r1=1400838&r2=1400839&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/ActiveMQXAConnectionFactoryTest.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/ActiveMQXAConnectionFactoryTest.java Mon Oct 22 11:24:23 2012
@@ -59,7 +59,8 @@ public class ActiveMQXAConnectionFactory
     private ActiveMQConnection connection;
     private BrokerService broker;
 
-    protected void tearDown() throws Exception {
+    @Override
+    public void tearDown() throws Exception {
         // Try our best to close any previously opend connection.
         try {
             connection.close();
@@ -436,7 +437,7 @@ public class ActiveMQXAConnectionFactory
         URI temp = new URI(uri);
         // URI connectURI = connector.getServer().getConnectURI();
         // TODO this sometimes fails when using the actual local host name
-        URI currentURI = connector.getServer().getConnectURI();
+        URI currentURI = new URI(connector.getPublishableConnectString());
 
         // sometimes the actual host name doesn't work in this test case
         // e.g. on OS X so lets use the original details but just use the actual
@@ -460,9 +461,6 @@ public class ActiveMQXAConnectionFactory
         assertXAConnection(connection);
 
         assertNotNull(connection);
-        connection.close();
-
-        broker.stop();
     }
 
     private void assertXAConnection(Connection connection) {