activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gtu...@apache.org
Subject svn commit: r1449080 - in /activemq/trunk: activemq-console/src/main/java/org/apache/activemq/console/command/ activemq-console/src/main/java/org/apache/activemq/console/util/ activemq-unit-tests/src/test/java/org/apache/activemq/console/command/
Date Fri, 22 Feb 2013 15:47:36 GMT
Author: gtully
Date: Fri Feb 22 15:47:36 2013
New Revision: 1449080

URL: http://svn.apache.org/r1449080
Log:
https://issues.apache.org/jira/browse/AMQ-4333 - fix and ensure existing test is executed

Added:
    activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/console/command/AMQ3410Test.java
  (contents, props changed)
      - copied, changed from r1448809, activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/console/command/TestAMQ3410.java
    activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/console/command/AMQ3411Test.java
  (contents, props changed)
      - copied, changed from r1448809, activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/console/command/TestAMQ3411.java
    activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/console/command/PurgeCommandTest.java
  (contents, props changed)
      - copied, changed from r1448809, activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/console/command/TestPurgeCommand.java
Removed:
    activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/console/command/TestAMQ3410.java
    activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/console/command/TestAMQ3411.java
    activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/console/command/TestPurgeCommand.java
Modified:
    activemq/trunk/activemq-console/src/main/java/org/apache/activemq/console/command/PurgeCommand.java
    activemq/trunk/activemq-console/src/main/java/org/apache/activemq/console/util/JmxMBeansUtil.java

Modified: activemq/trunk/activemq-console/src/main/java/org/apache/activemq/console/command/PurgeCommand.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-console/src/main/java/org/apache/activemq/console/command/PurgeCommand.java?rev=1449080&r1=1449079&r2=1449080&view=diff
==============================================================================
--- activemq/trunk/activemq-console/src/main/java/org/apache/activemq/console/command/PurgeCommand.java
(original)
+++ activemq/trunk/activemq-console/src/main/java/org/apache/activemq/console/command/PurgeCommand.java
Fri Feb 22 15:47:36 2013
@@ -96,7 +96,7 @@ public class PurgeCommand extends Abstra
 
             // Iterate through the queue names
             for (Iterator<String> i = tokens.iterator(); i.hasNext();) {
-                List queueList = JmxMBeansUtil.queryMBeans(createJmxConnection(), "destinationType=Queue,destinationName="
+ i.next() + ",*");
+                List queueList = JmxMBeansUtil.queryMBeans(createJmxConnection(), "type=Broker,brokerName=*,destinationType=Queue,destinationName="
+ i.next());
 
                 for (Iterator j = queueList.iterator(); j.hasNext();) {
                     ObjectName queueName = ((ObjectInstance)j.next()).getObjectName();

Modified: activemq/trunk/activemq-console/src/main/java/org/apache/activemq/console/util/JmxMBeansUtil.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-console/src/main/java/org/apache/activemq/console/util/JmxMBeansUtil.java?rev=1449080&r1=1449079&r2=1449080&view=diff
==============================================================================
--- activemq/trunk/activemq-console/src/main/java/org/apache/activemq/console/util/JmxMBeansUtil.java
(original)
+++ activemq/trunk/activemq-console/src/main/java/org/apache/activemq/console/util/JmxMBeansUtil.java
Fri Feb 22 15:47:36 2013
@@ -57,7 +57,7 @@ public final class JmxMBeansUtil {
         return (new MBeansAttributeQueryFilter(jmxConnection, attributes, new MBeansObjectNameQueryFilter(jmxConnection))).query("type=Broker,brokerName="
+ brokerName);
     }
 
-    public static List queryMBeans(MBeanServerConnection jmxConnection, List queryList) throws
Exception {
+    public static List x_queryMBeans(MBeanServerConnection jmxConnection, List queryList)
throws Exception {
         // If there is no query defined get all mbeans
         if (queryList == null || queryList.size() == 0) {
             return createMBeansObjectNameQuery(jmxConnection).query("");
@@ -106,10 +106,7 @@ public final class JmxMBeansUtil {
     }
 
     public static QueryFilter createMBeansObjectNameQuery(MBeanServerConnection jmxConnection)
{
-        // Let us be able to accept wildcard queries
-        // Use regular expressions to filter the query results
-        // Let us retrieve the mbeans object name specified by the query
-        return new WildcardToRegExTransformFilter(new MBeansRegExQueryFilter(new MBeansObjectNameQueryFilter(jmxConnection)));
+        return new MBeansObjectNameQueryFilter(jmxConnection);
     }
 
     public static QueryFilter createMBeansAttributeQuery(MBeanServerConnection jmxConnection,
Set attributes) {

Copied: activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/console/command/AMQ3410Test.java
(from r1448809, activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/console/command/TestAMQ3410.java)
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/console/command/AMQ3410Test.java?p2=activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/console/command/AMQ3410Test.java&p1=activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/console/command/TestAMQ3410.java&r1=1448809&r2=1449080&rev=1449080&view=diff
==============================================================================
--- activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/console/command/TestAMQ3410.java
(original)
+++ activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/console/command/AMQ3410Test.java
Fri Feb 22 15:47:36 2013
@@ -32,10 +32,10 @@ import org.slf4j.LoggerFactory;
 import org.springframework.context.support.AbstractApplicationContext;
 import org.springframework.context.support.ClassPathXmlApplicationContext;
 
-public class TestAMQ3410 extends TestCase {
+public class AMQ3410Test extends TestCase {
 	@SuppressWarnings("unused")
 	private static final Logger LOG = LoggerFactory
-			.getLogger(TestPurgeCommand.class);
+			.getLogger(PurgeCommandTest.class);
 	private static final Collection<String> DEFAULT_OPTIONS = Arrays
 			.asList(new String[] { "--amqurl", "tcp://localhost:61616", });
 

Propchange: activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/console/command/AMQ3410Test.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/console/command/AMQ3410Test.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Copied: activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/console/command/AMQ3411Test.java
(from r1448809, activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/console/command/TestAMQ3411.java)
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/console/command/AMQ3411Test.java?p2=activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/console/command/AMQ3411Test.java&p1=activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/console/command/TestAMQ3411.java&r1=1448809&r2=1449080&rev=1449080&view=diff
==============================================================================
--- activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/console/command/TestAMQ3411.java
(original)
+++ activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/console/command/AMQ3411Test.java
Fri Feb 22 15:47:36 2013
@@ -31,10 +31,10 @@ import org.slf4j.LoggerFactory;
 import org.springframework.context.support.AbstractApplicationContext;
 import org.springframework.context.support.ClassPathXmlApplicationContext;
 
-public class TestAMQ3411 extends TestCase {
+public class AMQ3411Test extends TestCase {
 	@SuppressWarnings("unused")
 	private static final Logger LOG = LoggerFactory
-			.getLogger(TestPurgeCommand.class);
+			.getLogger(AMQ3411Test.class);
 	private static final Collection<String> DEFAULT_OPTIONS = Arrays
 			.asList(new String[] { "--amqurl", "tcp://localhost:61616", });
 

Propchange: activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/console/command/AMQ3411Test.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/console/command/AMQ3411Test.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Copied: activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/console/command/PurgeCommandTest.java
(from r1448809, activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/console/command/TestPurgeCommand.java)
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/console/command/PurgeCommandTest.java?p2=activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/console/command/PurgeCommandTest.java&p1=activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/console/command/TestPurgeCommand.java&r1=1448809&r2=1449080&rev=1449080&view=diff
==============================================================================
--- activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/console/command/TestPurgeCommand.java
(original)
+++ activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/console/command/PurgeCommandTest.java
Fri Feb 22 15:47:36 2013
@@ -51,9 +51,9 @@ import org.slf4j.LoggerFactory;
 import org.springframework.context.support.AbstractApplicationContext;
 import org.springframework.context.support.ClassPathXmlApplicationContext;
 
-public class TestPurgeCommand extends TestCase {
+public class PurgeCommandTest extends TestCase {
     private static final Logger LOG = LoggerFactory
-            .getLogger(TestPurgeCommand.class);
+            .getLogger(PurgeCommandTest.class);
 
     protected static final int MESSAGE_COUNT = 10;
     protected static final String PROPERTY_NAME = "XTestProperty";
@@ -155,11 +155,8 @@ public class TestPurgeCommand extends Te
 
     @SuppressWarnings("unchecked")
     public void purgeAllMessages() throws IOException, Exception {
-        List<String> tokens = Arrays.asList(new String[] { "*" });
-        for (String token : tokens) {
             List<ObjectInstance> queueList = JmxMBeansUtil.queryMBeans(
-                    createJmxConnection(), "Type=Queue,Destination=" + token
-                            + ",*");
+                    createJmxConnection(), "type=Broker,brokerName=localbroker,destinationType=Queue,destinationName=*");
             for (ObjectInstance oi : queueList) {
                 ObjectName queueName = oi.getObjectName();
                 LOG.info("Purging all messages in queue: "
@@ -167,7 +164,6 @@ public class TestPurgeCommand extends Te
                 createJmxConnection().invoke(queueName, "purge",
                         new Object[] {}, new String[] {});
             }
-        }
     }
 
     public void addMessages() throws IOException, Exception {
@@ -231,8 +227,8 @@ public class TestPurgeCommand extends Te
             List<String> tokens = Arrays.asList(new String[] { "*" });
             for (String token : tokens) {
                 List<ObjectInstance> queueList = JmxMBeansUtil.queryMBeans(
-                        createJmxConnection(), "Type=Queue,Destination="
-                                + token + ",*");
+                        createJmxConnection(), "type=Broker,brokerName=localbroker,destinationType=Queue,destinationName="
+                                + token);
 
                 for (ObjectInstance queue : queueList) {
                     ObjectName queueName = queue

Propchange: activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/console/command/PurgeCommandTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/console/command/PurgeCommandTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date



Mime
View raw message