diff options
author | Robert Godfrey <rgodfrey@apache.org> | 2012-03-10 19:22:10 +0000 |
---|---|---|
committer | Robert Godfrey <rgodfrey@apache.org> | 2012-03-10 19:22:10 +0000 |
commit | 4eaa4e42093e5524d9552d8fa312c214524b6bb4 (patch) | |
tree | a251d57ee92d9c779fe4455c583be0ed90e69a43 /qpid/java/systests/src/main/java/org/apache/qpid/management/jmx/ManagedConnectionMBeanTest.java | |
parent | 92be7e8f3163c048a8642d2deeaa921bbb65dc9c (diff) | |
download | qpid-python-rg-amqp-1-0-sandbox.tar.gz |
NO-JIRA : AMQP-1-0 sandbox updates - merge from trunkrg-amqp-1-0-sandbox
git-svn-id: https://svn.apache.org/repos/asf/qpid/branches/rg-amqp-1-0-sandbox@1299257 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java/systests/src/main/java/org/apache/qpid/management/jmx/ManagedConnectionMBeanTest.java')
-rw-r--r-- | qpid/java/systests/src/main/java/org/apache/qpid/management/jmx/ManagedConnectionMBeanTest.java | 55 |
1 files changed, 44 insertions, 11 deletions
diff --git a/qpid/java/systests/src/main/java/org/apache/qpid/management/jmx/ManagedConnectionMBeanTest.java b/qpid/java/systests/src/main/java/org/apache/qpid/management/jmx/ManagedConnectionMBeanTest.java index a258e4267d..3fc370dc68 100644 --- a/qpid/java/systests/src/main/java/org/apache/qpid/management/jmx/ManagedConnectionMBeanTest.java +++ b/qpid/java/systests/src/main/java/org/apache/qpid/management/jmx/ManagedConnectionMBeanTest.java @@ -18,10 +18,14 @@ */ package org.apache.qpid.management.jmx; -import java.io.IOException; -import java.util.Date; -import java.util.Iterator; -import java.util.List; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import org.apache.qpid.client.AMQSession; +import org.apache.qpid.common.QpidProperties; +import org.apache.qpid.management.common.mbeans.ManagedConnection; +import org.apache.qpid.test.utils.JMXTestUtils; +import org.apache.qpid.test.utils.QpidBrokerTestCase; import javax.jms.Connection; import javax.jms.Destination; @@ -33,13 +37,10 @@ import javax.jms.TextMessage; import javax.management.JMException; import javax.management.openmbean.CompositeDataSupport; import javax.management.openmbean.TabularData; - -import org.apache.qpid.client.AMQSession; -import org.apache.qpid.management.common.mbeans.ManagedConnection; -import org.apache.qpid.test.utils.JMXTestUtils; -import org.apache.qpid.test.utils.QpidBrokerTestCase; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; +import java.io.IOException; +import java.util.Date; +import java.util.Iterator; +import java.util.List; public class ManagedConnectionMBeanTest extends QpidBrokerTestCase { @@ -242,4 +243,36 @@ public class ManagedConnectionMBeanTest extends QpidBrokerTestCase assertNotNull("Connection MBean is null", mBean); assertEquals("Unexpected authorized id", "guest", mBean.getAuthorizedId()); } + + public void testClientVersion() throws Exception + { + List<ManagedConnection> connections = _jmxUtils.getManagedConnections("test"); + assertNotNull("Connection MBean is not found", connections); + assertEquals("Unexpected number of connection mbeans", 1, connections.size()); + final ManagedConnection mBean = connections.get(0); + assertNotNull("Connection MBean is null", mBean); + + String expectedVersion = QpidProperties.getReleaseVersion(); + assertNotNull("version should not be null", expectedVersion); + assertFalse("version should not be the empty string", expectedVersion.equals("")); + assertFalse("version should not be the string 'null'", expectedVersion.equals("null")); + + assertEquals("Unexpected version", expectedVersion, mBean.getVersion()); + } + + public void testClientId() throws Exception + { + List<ManagedConnection> connections = _jmxUtils.getManagedConnections("test"); + assertNotNull("Connection MBean is not found", connections); + assertEquals("Unexpected number of connection mbeans", 1, connections.size()); + final ManagedConnection mBean = connections.get(0); + assertNotNull("Connection MBean is null", mBean); + + String expectedClientId = _connection.getClientID(); + assertNotNull("ClientId should not be null", expectedClientId); + assertFalse("ClientId should not be the empty string", expectedClientId.equals("")); + assertFalse("ClientId should not be the string 'null'", expectedClientId.equals("null")); + + assertEquals("Unexpected ClientId", expectedClientId, mBean.getClientId()); + } } |