activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r1427881 - in /activemq/trunk/activemq-core/src/test/java/org/apache/activemq/bugs: AMQ3157Test.java AMQ3405Test.java AMQ3445Test.java
Date Wed, 02 Jan 2013 17:57:23 GMT
Author: tabish
Date: Wed Jan  2 17:57:22 2013
New Revision: 1427881

URL: http://svn.apache.org/viewvc?rev=1427881&view=rev
Log:
fix test cases after changes in https://issues.apache.org/jira/browse/AMQ-4237 broker the
tests queue MBean lookup

Modified:
    activemq/trunk/activemq-core/src/test/java/org/apache/activemq/bugs/AMQ3157Test.java
    activemq/trunk/activemq-core/src/test/java/org/apache/activemq/bugs/AMQ3405Test.java
    activemq/trunk/activemq-core/src/test/java/org/apache/activemq/bugs/AMQ3445Test.java

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/bugs/AMQ3157Test.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/bugs/AMQ3157Test.java?rev=1427881&r1=1427880&r2=1427881&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/bugs/AMQ3157Test.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/bugs/AMQ3157Test.java Wed
Jan  2 17:57:22 2013
@@ -154,14 +154,17 @@ public class AMQ3157Test extends Embedde
         String domain = "org.apache.activemq";
         ObjectName name;
         if (destination.isQueue()) {
-            name = new ObjectName(domain + ":BrokerName=localhost,Type=Queue,Destination="
+ destination.getPhysicalName());
+            name = new ObjectName(domain + ":type=Broker,brokerName=localhost," +
+                                  "destinationType=Queue,destinationName=" + destination.getPhysicalName());
         } else {
-            name = new ObjectName(domain + ":BrokerName=localhost,Type=Topic,Destination="
+ destination.getPhysicalName());
+            name = new ObjectName(domain + ":type=Broker,brokerName=localhost," +
+                                  "destinationType=Topic,destinationName=" + destination.getPhysicalName());
         }
 
         return name;
     }
 
+    @Override
     protected void tearDown() throws Exception {
         if (connection != null) {
             connection.close();

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/bugs/AMQ3405Test.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/bugs/AMQ3405Test.java?rev=1427881&r1=1427880&r2=1427881&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/bugs/AMQ3405Test.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/bugs/AMQ3405Test.java Wed
Jan  2 17:57:22 2013
@@ -36,6 +36,7 @@ import javax.management.ObjectName;
 import org.apache.activemq.ActiveMQConnection;
 import org.apache.activemq.ActiveMQConnectionFactory;
 import org.apache.activemq.RedeliveryPolicy;
+import org.apache.activemq.TestSupport;
 import org.apache.activemq.broker.BrokerService;
 import org.apache.activemq.broker.jmx.QueueViewMBean;
 import org.apache.activemq.broker.region.policy.AbstractDeadLetterStrategy;
@@ -43,7 +44,6 @@ import org.apache.activemq.broker.region
 import org.apache.activemq.broker.region.policy.PolicyEntry;
 import org.apache.activemq.broker.region.policy.PolicyMap;
 import org.apache.activemq.command.ActiveMQQueue;
-import org.apache.activemq.TestSupport;
 import org.apache.activemq.util.Wait;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -117,6 +117,7 @@ public class AMQ3405Test extends TestSup
         for (int i = 0; i < 2; ++i) {
 
             assertTrue("DLQ was not filled as expected", Wait.waitFor(new Wait.Condition()
{
+                @Override
                 public boolean isSatisified() throws Exception {
                     return dlqView.getQueueSize() == messageCount;
                 }
@@ -137,6 +138,7 @@ public class AMQ3405Test extends TestSup
             dlqView.moveMatchingMessagesTo("", moveTo);
 
             assertTrue("DLQ was not emptied as expected", Wait.waitFor(new Wait.Condition()
{
+                @Override
                 public boolean isSatisified() throws Exception {
                     return dlqView.getQueueSize() == 0;
                 }
@@ -163,6 +165,7 @@ public class AMQ3405Test extends TestSup
         dlqConsumer = dlqSession.createConsumer(dlqDestination);
     }
 
+    @Override
     protected void setUp() throws Exception {
         broker = createBroker();
         broker.start();
@@ -177,6 +180,7 @@ public class AMQ3405Test extends TestSup
         dlqSession = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
     }
 
+    @Override
     protected void tearDown() throws Exception {
         dlqConsumer.close();
         dlqSession.close();
@@ -188,6 +192,7 @@ public class AMQ3405Test extends TestSup
         }
     };
 
+    @Override
     protected ActiveMQConnectionFactory createConnectionFactory()
             throws Exception {
         ActiveMQConnectionFactory answer = super.createConnectionFactory();
@@ -226,9 +231,9 @@ public class AMQ3405Test extends TestSup
     }
 
     private QueueViewMBean getProxyToDLQ() throws MalformedObjectNameException, JMSException
{
-        ObjectName queueViewMBeanName = new ObjectName("org.apache.activemq"
-                + ":Type=Queue,Destination=ActiveMQ.DLQ"
-                + ",BrokerName=localhost");
+        ObjectName queueViewMBeanName = new ObjectName(
+            "org.apache.activemq:type=Broker,brokerName=localhost," +
+            "destinationType=Queue,destinationName=ActiveMQ.DLQ");
         QueueViewMBean proxy = (QueueViewMBean) broker.getManagementContext()
                 .newProxyInstance(queueViewMBeanName, QueueViewMBean.class, true);
         return proxy;
@@ -256,6 +261,7 @@ public class AMQ3405Test extends TestSup
             deliveryCount = delvery;
         }
 
+        @Override
         public void onMessage(Message message) {
             try {
                 int expectedMessageId = rollbacks.get() / deliveryCount;

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/bugs/AMQ3445Test.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/bugs/AMQ3445Test.java?rev=1427881&r1=1427880&r2=1427881&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/bugs/AMQ3445Test.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/bugs/AMQ3445Test.java Wed
Jan  2 17:57:22 2013
@@ -16,7 +16,8 @@
  */
 package org.apache.activemq.bugs;
 
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
 
 import javax.jms.Connection;
 import javax.jms.ConnectionFactory;
@@ -121,8 +122,8 @@ public class AMQ3445Test {
 
     private QueueViewMBean getProxyToQueueViewMBean() throws Exception {
         ObjectName queueViewMBeanName = new ObjectName("org.apache.activemq"
-                + ":Type=Queue,Destination=" + queueName
-                + ",BrokerName=localhost");
+                + ":destinationType=Queue,destinationName=" + queueName
+                + ",type=Broker,brokerName=localhost");
         QueueViewMBean proxy = (QueueViewMBean) broker.getManagementContext()
                 .newProxyInstance(queueViewMBeanName, QueueViewMBean.class, true);
         return proxy;



Mime
View raw message