You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ta...@apache.org on 2013/01/03 21:37:04 UTC

svn commit: r1428578 - /activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/TwoBrokerTempQueueAdvisoryTest.java

Author: tabish
Date: Thu Jan  3 20:37:04 2013
New Revision: 1428578

URL: http://svn.apache.org/viewvc?rev=1428578&view=rev
Log:
fix test case after changes in https://issues.apache.org/jira/browse/AMQ-4237 broke the test's MBean lookup

Modified:
    activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/TwoBrokerTempQueueAdvisoryTest.java

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/TwoBrokerTempQueueAdvisoryTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/TwoBrokerTempQueueAdvisoryTest.java?rev=1428578&r1=1428577&r2=1428578&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/TwoBrokerTempQueueAdvisoryTest.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/TwoBrokerTempQueueAdvisoryTest.java Thu Jan  3 20:37:04 2013
@@ -33,14 +33,16 @@
 package org.apache.activemq.usecases;
 
 import java.net.URI;
+
 import javax.jms.Connection;
 import javax.jms.ConnectionFactory;
-import javax.jms.Destination;
 import javax.jms.MessageProducer;
 import javax.jms.Session;
 import javax.jms.TemporaryQueue;
 import javax.management.ObjectName;
+
 import junit.framework.Test;
+
 import org.apache.activemq.ActiveMQConnection;
 import org.apache.activemq.ActiveMQConnectionFactory;
 import org.apache.activemq.ActiveMQMessageConsumer;
@@ -60,27 +62,27 @@ public class TwoBrokerTempQueueAdvisoryT
 
     private void sendReceiveTempQueueMessage(String broker) throws Exception {
 
-    	ConnectionFactory factory = getConnectionFactory(broker);
-    	Connection conn = factory.createConnection();
-    	Session session = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
-    	Destination dest = session.createTemporaryQueue();
-    	conn.close();
+        ConnectionFactory factory = getConnectionFactory(broker);
+        Connection conn = factory.createConnection();
+        Session session = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
+        session.createTemporaryQueue();
+        conn.close();
     }
 
     public void testTemporaryQueueAdvisory() throws Exception {
-    	LOG.info("Running testTemporaryQueueAdvisory()");
+        LOG.info("Running testTemporaryQueueAdvisory()");
 
         bridgeBrokers("BrokerA", "BrokerB");
         bridgeBrokers("BrokerB", "BrokerA");
 
-    	startAllBrokers();
+        startAllBrokers();
         waitForBridgeFormation();
         waitForMinTopicRegionConsumerCount("BrokerB", 1);
         waitForMinTopicRegionConsumerCount("BrokerA", 1);
 
         final int iterations = 30;
         for (int i = 0; i < iterations; i++) {
-	        sendReceiveTempQueueMessage("BrokerA");
+            sendReceiveTempQueueMessage("BrokerA");
         }
 
         waitForMinTopicRegionConsumerCount("BrokerB", 1);
@@ -172,14 +174,14 @@ public class TwoBrokerTempQueueAdvisoryT
         String domain = "org.apache.activemq";
         ObjectName name;
         if (type == ActiveMQDestination.QUEUE_TYPE) {
-            name = new ObjectName(domain + ":BrokerName=" + broker + ",Type=Queue,Destination=" + destination);
+            name = new ObjectName(domain + ":type=Broker,brokerName=" + broker + ",destinationType=Queue,destinationName=" + destination);
         } else {
-            name = new ObjectName(domain + ":BrokerName=" + broker + ",Type=Topic,Destination=" + destination);
+            name = new ObjectName(domain + ":type=Broker,brokerName=" + broker + ",destinationType=Topic,destinationName=" + destination);
         }
-        return (DestinationViewMBean) brokers.get(broker).broker.getManagementContext().newProxyInstance(name, DestinationViewMBean.class,
-                true);
+        return (DestinationViewMBean) brokers.get(broker).broker.getManagementContext().newProxyInstance(name, DestinationViewMBean.class, true);
     }
 
+    @Override
     public void setUp() throws Exception {
         super.setAutoFail(true);
         super.setUp();