activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r1178622 - in /activemq/trunk/activemq-pool/src/test/java/org/apache/activemq/pool: ConnectionExpiryEvictsFromPoolTest.java ConnectionFailureEvictsFromPoolTest.java PooledConnectionFactoryWithTemporaryDestinationsTest.java
Date Mon, 03 Oct 2011 22:32:55 GMT
Author: tabish
Date: Mon Oct  3 22:32:54 2011
New Revision: 1178622

URL: http://svn.apache.org/viewvc?rev=1178622&view=rev
Log:
Turn off JMX for these tests to avoid instance already exists exceptions when creating a brokerService.

Modified:
    activemq/trunk/activemq-pool/src/test/java/org/apache/activemq/pool/ConnectionExpiryEvictsFromPoolTest.java
    activemq/trunk/activemq-pool/src/test/java/org/apache/activemq/pool/ConnectionFailureEvictsFromPoolTest.java
    activemq/trunk/activemq-pool/src/test/java/org/apache/activemq/pool/PooledConnectionFactoryWithTemporaryDestinationsTest.java

Modified: activemq/trunk/activemq-pool/src/test/java/org/apache/activemq/pool/ConnectionExpiryEvictsFromPoolTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-pool/src/test/java/org/apache/activemq/pool/ConnectionExpiryEvictsFromPoolTest.java?rev=1178622&r1=1178621&r2=1178622&view=diff
==============================================================================
--- activemq/trunk/activemq-pool/src/test/java/org/apache/activemq/pool/ConnectionExpiryEvictsFromPoolTest.java
(original)
+++ activemq/trunk/activemq-pool/src/test/java/org/apache/activemq/pool/ConnectionExpiryEvictsFromPoolTest.java
Mon Oct  3 22:32:54 2011
@@ -34,6 +34,7 @@ public class ConnectionExpiryEvictsFromP
 
     protected void setUp() throws Exception {
         broker = new BrokerService();
+        broker.setUseJmx(false);
         broker.setPersistent(false);
         TransportConnector connector = broker.addConnector("tcp://localhost:0");
         broker.start();
@@ -46,32 +47,32 @@ public class ConnectionExpiryEvictsFromP
         pooledFactory.setIdleTimeout(10);
         PooledConnection connection = (PooledConnection) pooledFactory.createConnection();
         ActiveMQConnection amq1 = connection.getConnection();
-        
+
         connection.close();
         // let it idle timeout
         TimeUnit.SECONDS.sleep(1);
-        
+
         PooledConnection connection2 = (PooledConnection) pooledFactory.createConnection();
         ActiveMQConnection amq2 = connection2.getConnection();
         assertTrue("not equal", !amq1.equals(amq2));
     }
-    
-    
+
+
     public void testEvictionOfExpired() throws Exception {
         pooledFactory.setExpiryTimeout(10);
         Connection connection = pooledFactory.createConnection();
         ActiveMQConnection amq1 = ((PooledConnection) connection).getConnection();
-        
+
         // let it expire while in use
         TimeUnit.SECONDS.sleep(1);
         connection.close();
-        
+
         Connection connection2 = pooledFactory.createConnection();
         ActiveMQConnection amq2 = ((PooledConnection) connection2).getConnection();
         assertTrue("not equal", !amq1.equals(amq2));
     }
-    
-    
+
+
     protected void tearDown() throws Exception {
         broker.stop();
     }

Modified: activemq/trunk/activemq-pool/src/test/java/org/apache/activemq/pool/ConnectionFailureEvictsFromPoolTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-pool/src/test/java/org/apache/activemq/pool/ConnectionFailureEvictsFromPoolTest.java?rev=1178622&r1=1178621&r2=1178622&view=diff
==============================================================================
--- activemq/trunk/activemq-pool/src/test/java/org/apache/activemq/pool/ConnectionFailureEvictsFromPoolTest.java
(original)
+++ activemq/trunk/activemq-pool/src/test/java/org/apache/activemq/pool/ConnectionFailureEvictsFromPoolTest.java
Mon Oct  3 22:32:54 2011
@@ -44,6 +44,7 @@ public class ConnectionFailureEvictsFrom
 
     protected void setUp() throws Exception {
         broker = new BrokerService();
+        broker.setUseJmx(false);
         broker.setPersistent(false);
         TransportConnector connector = broker.addConnector("tcp://localhost:0");
         broker.start();
@@ -68,7 +69,7 @@ public class ConnectionFailureEvictsFrom
             public void transportResumed() {
             }
         });
-        
+
         sendMessage(connection);
         LOG.info("sent one message worked fine");
         createConnectionFailure(connection);

Modified: activemq/trunk/activemq-pool/src/test/java/org/apache/activemq/pool/PooledConnectionFactoryWithTemporaryDestinationsTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-pool/src/test/java/org/apache/activemq/pool/PooledConnectionFactoryWithTemporaryDestinationsTest.java?rev=1178622&r1=1178621&r2=1178622&view=diff
==============================================================================
--- activemq/trunk/activemq-pool/src/test/java/org/apache/activemq/pool/PooledConnectionFactoryWithTemporaryDestinationsTest.java
(original)
+++ activemq/trunk/activemq-pool/src/test/java/org/apache/activemq/pool/PooledConnectionFactoryWithTemporaryDestinationsTest.java
Mon Oct  3 22:32:54 2011
@@ -42,6 +42,7 @@ public class PooledConnectionFactoryWith
 
     protected void setUp() throws Exception {
         broker = new BrokerService();
+        broker.setUseJmx(false);
         broker.setPersistent(false);
         TransportConnector connector = broker.addConnector("tcp://localhost:0");
         broker.start();
@@ -60,29 +61,29 @@ public class PooledConnectionFactoryWith
         Session session2 = null;
         Queue tempQueue = null;
         Queue normalQueue = null;
-        
+
         pooledConnection = pooledFactory.createConnection();
         session = pooledConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
         tempQueue = session.createTemporaryQueue();
         LOG.info("Created queue named: " + tempQueue.getQueueName());
-        
+
         assertEquals(1, countBrokerTemporaryQueues());
-        
+
         pooledConnection2 = pooledFactory.createConnection();
         session2 = pooledConnection2.createSession(false, Session.AUTO_ACKNOWLEDGE);
         normalQueue = session2.createQueue("queue:FOO.TEST");
-        LOG.info("Created queue named: " + normalQueue.getQueueName());        
+        LOG.info("Created queue named: " + normalQueue.getQueueName());
 
         // didn't create a temp queue on pooledConnection2 so we should still have a temp
queue
-        pooledConnection2.close();        
+        pooledConnection2.close();
         assertEquals(1, countBrokerTemporaryQueues());
-        
-        // after closing pooledConnection, where we created the temp queue, there should

+
+        // after closing pooledConnection, where we created the temp queue, there should
         // be no temp queues left
-        pooledConnection.close();        
+        pooledConnection.close();
         assertEquals(0, countBrokerTemporaryQueues());
     }
-    
+
     public void testTemporaryQueueLeakAfterConnectionClose() throws Exception {
         Connection pooledConnection = null;
         Session session = null;



Mime
View raw message