qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rob...@apache.org
Subject svn commit: r1103727 - in /qpid/trunk/qpid/java: build.deps build.xml lib/jline-0.9.94.jar lib/junit-4.4.jar management/tools/ systests/src/main/java/org/apache/qpid/test/utils/JMXTestUtils.java
Date Mon, 16 May 2011 13:27:46 GMT
Author: robbie
Date: Mon May 16 13:27:46 2011
New Revision: 1103727

URL: http://svn.apache.org/viewvc?rev=1103727&view=rev
Log:
QPID-3260: remove defunct java/management/tools/qpid-cli module

Removed:
    qpid/trunk/qpid/java/lib/jline-0.9.94.jar
    qpid/trunk/qpid/java/lib/junit-4.4.jar
    qpid/trunk/qpid/java/management/tools/
Modified:
    qpid/trunk/qpid/java/build.deps
    qpid/trunk/qpid/java/build.xml
    qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/JMXTestUtils.java

Modified: qpid/trunk/qpid/java/build.deps
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/build.deps?rev=1103727&r1=1103726&r2=1103727&view=diff
==============================================================================
--- qpid/trunk/qpid/java/build.deps (original)
+++ qpid/trunk/qpid/java/build.deps Mon May 16 13:27:46 2011
@@ -33,9 +33,6 @@ derby-db=lib/derby-10.6.1.0.jar
 geronimo-jms=lib/geronimo-jms_1.1_spec-1.0.jar
 
 junit=lib/junit-3.8.1.jar
-junit4=lib/junit-4.4.jar
-
-jline=lib/jline-0.9.94.jar
 
 log4j=lib/log4j-1.2.12.jar
 
@@ -133,9 +130,6 @@ management-eclipse-plugin.platform-libs=
 
 management-eclipse-plugin.libs=${management-eclipse-plugin.core-libs} ${management-eclipse-plugin.platform-libs}
     
-
-management-tools-qpid-cli.libs=${jline} ${commons-configuration.libs}
-
 common.test.libs=${test.libs}
 broker.test.libs=${test.libs}
 client.test.libs=${test.libs}
@@ -148,5 +142,4 @@ broker-plugins.test.libs=${test.libs} 
 broker-plugins-experimental-info.test.libs=${test.libs} ${servlet-api} ${jetty} ${jetty-util}
${jetty-servlet-tester}
 
 management-eclipse-plugin.test.libs=${systests.libs}
-management-tools-qpid-cli.test.libs=${junit4} ${slf4j-log4j} ${log4j}
 management-common.test.libs=${test.libs}

Modified: qpid/trunk/qpid/java/build.xml
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/build.xml?rev=1103727&r1=1103726&r2=1103727&view=diff
==============================================================================
--- qpid/trunk/qpid/java/build.xml (original)
+++ qpid/trunk/qpid/java/build.xml Mon May 16 13:27:46 2011
@@ -24,16 +24,15 @@
 
 
   <findSubProjects name="broker-plugins" dir="broker-plugins"/>
-  <findSubProjects name="management" dir="management" excludes="common,example,tools/qpid-cli"/>
+  <findSubProjects name="management" dir="management" excludes="common,example"/>
 
   <property name="modules.core"       value="junit-toolkit common management/common broker
client tools"/>
   <property name="modules.examples"   value="client/example management/example"/>
   <property name="modules.tests"      value="systests perftests integrationtests testkit"/>
   <property name="modules.management" value="${management}"/>
   <property name="modules.plugin"     value="${broker-plugins}"/>
-  <property name="modules.management.tools" value="management/tools/qpid-cli"/>
   <property name="modules"            value="${modules.core} ${modules.examples}
-   ${modules.management} ${modules.management.tools} ${modules.tests} ${modules.plugin}"/>
+   ${modules.management} ${modules.tests} ${modules.plugin}"/>
 
   <property name="qpid.jar"           location="${build.lib}/qpid-all.jar"/>
   <basename property="qpid.jar.name"  file="${qpid.jar}"/>

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/JMXTestUtils.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/JMXTestUtils.java?rev=1103727&r1=1103726&r2=1103727&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/JMXTestUtils.java
(original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/JMXTestUtils.java
Mon May 16 13:27:46 2011
@@ -36,7 +36,6 @@ import javax.management.remote.JMXConnec
 import junit.framework.TestCase;
 
 import org.apache.commons.configuration.ConfigurationException;
-import org.apache.qpid.commands.objects.AllObjects;
 import org.apache.qpid.management.common.JMXConnnectionFactory;
 import org.apache.qpid.management.common.mbeans.ManagedBroker;
 import org.apache.qpid.management.common.mbeans.ManagedConnection;
@@ -237,11 +236,10 @@ public class JMXTestUtils
     public ObjectName getVirtualHostManagerObjectName(String vhostName)
     {
         // Get the name of the test manager
-        AllObjects allObject = new AllObjects(_mbsc);
-        allObject.querystring = "org.apache.qpid:type=VirtualHost.VirtualHostManager,VirtualHost="
-                                + ObjectName.quote(vhostName) + ",*";
+        String query = "org.apache.qpid:type=VirtualHost.VirtualHostManager,VirtualHost="
+                       + ObjectName.quote(vhostName) + ",*";
 
-        Set<ObjectName> objectNames = allObject.returnObjects();
+        Set<ObjectName> objectNames = queryObjects(query);
 
         _test.assertNotNull("Null ObjectName Set returned", objectNames);
         _test.assertEquals("Incorrect number test vhosts returned", 1, objectNames.size());
@@ -265,16 +263,14 @@ public class JMXTestUtils
     public ObjectName getQueueObjectName(String virtualHostName, String queue)
     {
         // Get the name of the test manager
-        AllObjects allObject = new AllObjects(_mbsc);
-        allObject.querystring = "org.apache.qpid:type=VirtualHost.Queue,VirtualHost="
-                                 + ObjectName.quote(virtualHostName) + ",name="
-                                 + ObjectName.quote(queue) + ",*";
+        String query = "org.apache.qpid:type=VirtualHost.Queue,VirtualHost="
+                       + ObjectName.quote(virtualHostName) + ",name="
+                       + ObjectName.quote(queue) + ",*";
 
-        Set<ObjectName> objectNames = allObject.returnObjects();
+        Set<ObjectName> objectNames = queryObjects(query);
 
         _test.assertNotNull("Null ObjectName Set returned", objectNames);
-        _test.assertEquals("Incorrect number of queues with name '" + allObject.querystring
+
-                           "' returned", 1, objectNames.size());
+        _test.assertEquals("Incorrect number of queues with name '" + queue + "' returned",
1, objectNames.size());
 
         // We have verified we have only one value in objectNames so return it
         ObjectName objectName = objectNames.iterator().next();
@@ -295,12 +291,11 @@ public class JMXTestUtils
     public ObjectName getExchangeObjectName(String virtualHostName, String exchange)
     {
         // Get the name of the test manager
-        AllObjects allObject = new AllObjects(_mbsc);
-        allObject.querystring = "org.apache.qpid:type=VirtualHost.Exchange,VirtualHost="
-                                + ObjectName.quote(virtualHostName) + ",name="
-                                + ObjectName.quote(exchange) + ",*";
+        String query = "org.apache.qpid:type=VirtualHost.Exchange,VirtualHost="
+                       + ObjectName.quote(virtualHostName) + ",name="
+                       + ObjectName.quote(exchange) + ",*";
 
-        Set<ObjectName> objectNames = allObject.returnObjects();
+        Set<ObjectName> objectNames = queryObjects(query);
 
         _test.assertNotNull("Null ObjectName Set returned", objectNames);
         _test.assertEquals("Incorrect number of exchange with name '" + exchange + "' returned",
1, objectNames.size());
@@ -312,12 +307,9 @@ public class JMXTestUtils
     }
 
     @SuppressWarnings("static-access")
-    public <T> T getManagedObject(Class<T> managedClass, String queryString)
+    public <T> T getManagedObject(Class<T> managedClass, String query)
     {
-        AllObjects allObject = new AllObjects(_mbsc);
-        allObject.querystring = queryString;
-
-        Set<ObjectName> objectNames = allObject.returnObjects();
+        Set<ObjectName> objectNames = queryObjects(query);
 
         _test.assertNotNull("Null ObjectName Set returned", objectNames);
         _test.assertEquals("More than one " + managedClass + " returned", 1, objectNames.size());
@@ -383,10 +375,9 @@ public class JMXTestUtils
     public ServerInformation getServerInformation()
     {
         // Get the name of the test manager
-        AllObjects allObject = new AllObjects(_mbsc);
-        allObject.querystring = "org.apache.qpid:type=ServerInformation,name=ServerInformation,*";
+        String query = "org.apache.qpid:type=ServerInformation,name=ServerInformation,*";
 
-        Set<ObjectName> objectNames = allObject.returnObjects();
+        Set<ObjectName> objectNames = queryObjects(query);
 
         TestCase.assertNotNull("Null ObjectName Set returned", objectNames);
         TestCase.assertEquals("Incorrect number of objects returned", 1, objectNames.size());
@@ -401,10 +392,9 @@ public class JMXTestUtils
     public List<ManagedConnection> getAllManagedConnections()
     {
         // Get the name of the test manager
-        AllObjects allObject = new AllObjects(_mbsc);
-        allObject.querystring = "org.apache.qpid:type=VirtualHost.Connection,VirtualHost=*,name=*";
+        String query = "org.apache.qpid:type=VirtualHost.Connection,VirtualHost=*,name=*";
 
-        Set<ObjectName> objectNames = allObject.returnObjects();
+        Set<ObjectName> objectNames = queryObjects(query);
 
         TestCase.assertNotNull("Null ObjectName Set returned", objectNames);
 
@@ -417,13 +407,29 @@ public class JMXTestUtils
     public List<ManagedConnection> getManagedConnections(String vhost)
     {
         // Get the name of the test manager
-        AllObjects allObject = new AllObjects(_mbsc);
-        allObject.querystring = "org.apache.qpid:type=VirtualHost.Connection,VirtualHost="
+ ObjectName.quote(vhost) + ",name=*";
+        String query = "org.apache.qpid:type=VirtualHost.Connection,VirtualHost=" + ObjectName.quote(vhost)
+ ",name=*";
 
-        Set<ObjectName> objectNames = allObject.returnObjects();
+        Set<ObjectName> objectNames = queryObjects(query);
 
         TestCase.assertNotNull("Null ObjectName Set returned", objectNames);
 
         return getManagedObjectList(ManagedConnection.class, objectNames);
     }
+
+    /**
+     * Returns the Set of ObjectNames returned by the broker for the given query,
+     * or null if there is problem while performing the query.
+     */
+    private Set<ObjectName> queryObjects(String query)
+    {
+        try
+        {
+            return _mbsc.queryNames(new ObjectName(query), null);
+        }
+        catch (Exception e)
+        {
+            e.printStackTrace();
+            return null;
+        }
+    }
 }



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org


Mime
View raw message