qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From oru...@apache.org
Subject svn commit: r1718497 [3/3] - in /qpid/java/trunk: ./ bdbstore/ bdbstore/jmx/ bdbstore/jmx/src/main/java/org/apache/qpid/server/store/berkeleydb/jmx/ bdbstore/jmx/src/main/resources/META-INF/services/ bdbstore/jmx/src/test/java/org/apache/qpid/server/st...
Date Tue, 08 Dec 2015 00:28:12 GMT
Modified: qpid/java/trunk/systests/src/test/java/org/apache/qpid/server/queue/ProducerFlowControlTest.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/systests/src/test/java/org/apache/qpid/server/queue/ProducerFlowControlTest.java?rev=1718497&r1=1718496&r2=1718497&view=diff
==============================================================================
--- qpid/java/trunk/systests/src/test/java/org/apache/qpid/server/queue/ProducerFlowControlTest.java (original)
+++ qpid/java/trunk/systests/src/test/java/org/apache/qpid/server/queue/ProducerFlowControlTest.java Tue Dec  8 00:28:09 2015
@@ -43,9 +43,9 @@ import org.slf4j.LoggerFactory;
 import org.apache.qpid.QpidException;
 import org.apache.qpid.client.AMQDestination;
 import org.apache.qpid.client.AMQSession;
-import org.apache.qpid.management.common.mbeans.ManagedQueue;
 import org.apache.qpid.server.logging.AbstractTestLogging;
-import org.apache.qpid.test.utils.JMXTestUtils;
+import org.apache.qpid.systest.rest.RestTestHelper;
+import org.apache.qpid.test.utils.TestBrokerConfiguration;
 
 public class ProducerFlowControlTest extends AbstractTestLogging
 {
@@ -53,36 +53,32 @@ public class ProducerFlowControlTest ext
 
     private static final int TIMEOUT = 10000;
 
-    private Connection producerConnection;
-    private Connection consumerConnection;
-    private Session producerSession;
-    private Session consumerSession;
-    private MessageProducer producer;
-    private MessageConsumer consumer;
-    private Queue queue;
+    private Connection _producerConnection;
+    private Connection _consumerConnection;
+    private Session _producerSession;
+    private Session _consumerSession;
+    private MessageProducer _producer;
+    private MessageConsumer _consumer;
+    private Queue _queue;
+    private RestTestHelper _restTestHelper = new RestTestHelper(findFreePort());
 
     private final AtomicInteger _sentMessages = new AtomicInteger(0);
 
-    private JMXTestUtils _jmxUtils;
-    private boolean _jmxUtilConnected;
-
     public void setUp() throws Exception
     {
-        getBrokerConfiguration().addJmxManagementConfiguration();
+        _restTestHelper.enableHttpManagement(getBrokerConfiguration());
 
-        _jmxUtils = new JMXTestUtils(this);
-        _jmxUtilConnected=false;
         super.setUp();
 
         _monitor.markDiscardPoint();
 
-        producerConnection = getConnection();
-        producerSession = producerConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+        _producerConnection = getConnection();
+        _producerSession = _producerConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
 
-        producerConnection.start();
+        _producerConnection.start();
 
-        consumerConnection = getConnection();
-        consumerSession = consumerConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+        _consumerConnection = getConnection();
+        _consumerSession = _consumerConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
 
     }
 
@@ -90,19 +86,15 @@ public class ProducerFlowControlTest ext
     {
         try
         {
-            if(_jmxUtilConnected)
+            try
+            {
+                _producerConnection.close();
+                _consumerConnection.close();
+            }
+            finally
             {
-                try
-                {
-                    _jmxUtils.close();
-                }
-                catch (IOException e)
-                {
-                    _logger.error("Error closing jmxUtils", e);
-                }
+                _restTestHelper.tearDown();
             }
-            producerConnection.close();
-            consumerConnection.close();
         }
         finally
         {
@@ -114,28 +106,28 @@ public class ProducerFlowControlTest ext
     {
         String queueName = getTestQueueName();
 
-        createAndBindQueueWithFlowControlEnabled(producerSession, queueName, 1000, 800);
-        producer = producerSession.createProducer(queue);
+        createAndBindQueueWithFlowControlEnabled(_producerSession, queueName, 1000, 800);
+        _producer = _producerSession.createProducer(_queue);
 
         // try to send 5 messages (should block after 4)
-        sendMessagesAsync(producer, producerSession, 5, 50L);
+        sendMessagesAsync(_producer, _producerSession, 5, 50L);
 
         Thread.sleep(5000);
 
         assertEquals("Incorrect number of message sent before blocking", 4, _sentMessages.get());
 
-        consumer = consumerSession.createConsumer(queue);
-        consumerConnection.start();
+        _consumer = _consumerSession.createConsumer(_queue);
+        _consumerConnection.start();
 
 
-        consumer.receive();
+        _consumer.receive();
 
         Thread.sleep(1000);
 
         assertEquals("Message incorrectly sent after one message received", 4, _sentMessages.get());
 
 
-        consumer.receive();
+        _consumer.receive();
 
         Thread.sleep(1000);
 
@@ -148,21 +140,21 @@ public class ProducerFlowControlTest ext
     {
         String queueName = getTestQueueName();
         
-        createAndBindQueueWithFlowControlEnabled(producerSession, queueName, 1000, 800);
-        producer = producerSession.createProducer(queue);
+        createAndBindQueueWithFlowControlEnabled(_producerSession, queueName, 1000, 800);
+        _producer = _producerSession.createProducer(_queue);
 
         // try to send 5 messages (should block after 4)
-        sendMessagesAsync(producer, producerSession, 5, 50L);
+        sendMessagesAsync(_producer, _producerSession, 5, 50L);
 
         List<String> results = waitAndFindMatches("QUE-1003", 7000);
 
         assertEquals("Did not find correct number of QUE-1003 queue overfull messages", 1, results.size());
 
-        consumer = consumerSession.createConsumer(queue);
-        consumerConnection.start();
+        _consumer = _consumerSession.createConsumer(_queue);
+        _consumerConnection.start();
 
 
-        while(consumer.receive(1000) != null) {};
+        while(_consumer.receive(1000) != null) {};
 
         results = waitAndFindMatches("QUE-1004");
 
@@ -177,13 +169,13 @@ public class ProducerFlowControlTest ext
         setTestClientSystemProperty("qpid.flow_control_wait_failure","3000");
         setTestClientSystemProperty("qpid.flow_control_wait_notify_period","1000");
 
-        Session session = producerConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+        Session session = _producerConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
 
         createAndBindQueueWithFlowControlEnabled(session, queueName, 1000, 800);
-        producer = session.createProducer(queue);
+        _producer = session.createProducer(_queue);
 
         // try to send 5 messages (should block after 4)
-        MessageSender sender = sendMessagesAsync(producer, session, 5, 50L);
+        MessageSender sender = sendMessagesAsync(_producer, session, 5, 50L);
 
         List<String> results = waitAndFindMatches("Message send delayed by", TIMEOUT);
         assertTrue("No delay messages logged by client",results.size()!=0);
@@ -199,21 +191,21 @@ public class ProducerFlowControlTest ext
     {
         String queueName = getTestQueueName();
         
-        createAndBindQueueWithFlowControlEnabled(producerSession, queueName, 1000, 1000);
-        producer = producerSession.createProducer(queue);
+        createAndBindQueueWithFlowControlEnabled(_producerSession, queueName, 1000, 1000);
+        _producer = _producerSession.createProducer(_queue);
 
 
         // try to send 5 messages (should block after 4)
-        sendMessagesAsync(producer, producerSession, 5, 50L);
+        sendMessagesAsync(_producer, _producerSession, 5, 50L);
 
         Thread.sleep(5000);
 
         assertEquals("Incorrect number of message sent before blocking", 4, _sentMessages.get());
 
-        consumer = consumerSession.createConsumer(queue);
-        consumerConnection.start();
+        _consumer = _consumerSession.createConsumer(_queue);
+        _consumerConnection.start();
 
-        consumer.receive();
+        _consumer.receive();
 
         Thread.sleep(1000);
 
@@ -231,9 +223,9 @@ public class ProducerFlowControlTest ext
         final int numProducers = 10;
         final int numMessages = 100;
 
-        createAndBindQueueWithFlowControlEnabled(producerSession, queueName, 6000, 3000);
+        createAndBindQueueWithFlowControlEnabled(_producerSession, queueName, 6000, 3000);
 
-        consumerConnection.start();
+        _consumerConnection.start();
 
         Connection[] producers = new Connection[numProducers];
         for(int i = 0 ; i < numProducers; i ++)
@@ -243,17 +235,17 @@ public class ProducerFlowControlTest ext
             producers[i].start();
             Session session = producers[i].createSession(false, Session.AUTO_ACKNOWLEDGE);
 
-            MessageProducer myproducer = session.createProducer(queue);
+            MessageProducer myproducer = session.createProducer(_queue);
             MessageSender sender = sendMessagesAsync(myproducer, session, numMessages, 50L);
         }
 
-        consumer = consumerSession.createConsumer(queue);
-        consumerConnection.start();
+        _consumer = _consumerSession.createConsumer(_queue);
+        _consumerConnection.start();
 
         for(int j = 0; j < numProducers * numMessages; j++)
         {
         
-            Message msg = consumer.receive(5000);
+            Message msg = _consumer.receive(5000);
             Thread.sleep(50L);
             assertNotNull("Message not received("+j+"), sent: "+_sentMessages.get(), msg);
 
@@ -261,7 +253,7 @@ public class ProducerFlowControlTest ext
 
 
 
-        Message msg = consumer.receive(500);
+        Message msg = _consumer.receive(500);
         assertNull("extra message received", msg);
 
 
@@ -279,13 +271,13 @@ public class ProducerFlowControlTest ext
                 : "Unable to send message for 3 seconds due to broker enforced flow control";
 
         setTestClientSystemProperty("qpid.flow_control_wait_failure","3000");
-        Session session = producerConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+        Session session = _producerConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
 
-        createAndBindQueueWithFlowControlEnabled(producerSession, queueName, 1000, 800);
-        producer = session.createProducer(queue);
+        createAndBindQueueWithFlowControlEnabled(_producerSession, queueName, 1000, 800);
+        _producer = session.createProducer(_queue);
 
         // try to send 5 messages (should block after 4)
-        MessageSender sender = sendMessagesAsync(producer, session, 5, 100L);
+        MessageSender sender = sendMessagesAsync(_producer, session, 5, 100L);
 
         Exception e = sender.awaitSenderException(10000);
 
@@ -296,96 +288,111 @@ public class ProducerFlowControlTest ext
 
     }
 
-    public void testFlowControlAttributeModificationViaJMX() throws Exception
+    public void testFlowControlAttributeModificationViaREST() throws Exception
     {
-        _jmxUtils.open();
-        _jmxUtilConnected = true;
-        
         String queueName = getTestQueueName();
 
-        createAndBindQueueWithFlowControlEnabled(producerSession, queueName, 0, 0);
-        producer = producerSession.createProducer(queue);
-        
-        Thread.sleep(1000);
-        
-        //Create a JMX MBean proxy for the queue
-        ManagedQueue queueMBean = _jmxUtils.getManagedObject(ManagedQueue.class, _jmxUtils.getQueueObjectName("test", queueName));
-        assertNotNull(queueMBean);
+        createAndBindQueueWithFlowControlEnabled(_producerSession, queueName, 0, 0);
+        _producer = _producerSession.createProducer(_queue);
         
+        String queueUrl = String.format("queue/%1$s/%1$s/%2$s", TestBrokerConfiguration.ENTRY_NAME_VIRTUAL_HOST, queueName);
+
         //check current attribute values are 0 as expected
-        assertTrue("Capacity was not the expected value", queueMBean.getCapacity() == 0L);
-        assertTrue("FlowResumeCapacity was not the expected value", queueMBean.getFlowResumeCapacity() == 0L);
+        Map<String, Object> queueAttributes = _restTestHelper.getJsonAsSingletonList(queueUrl);
+        assertEquals("Capacity was not the expected value", 0,
+                     ((Number) queueAttributes.get(org.apache.qpid.server.model.Queue.QUEUE_FLOW_CONTROL_SIZE_BYTES)).intValue());
+        assertEquals("FlowResumeCapacity was not the expected value", 0,
+                     ((Number) queueAttributes.get(org.apache.qpid.server.model.Queue.QUEUE_FLOW_RESUME_SIZE_BYTES)).intValue());
         
         //set new values that will cause flow control to be active, and the queue to become overfull after 1 message is sent
-        queueMBean.setCapacity(250L);
-        queueMBean.setFlowResumeCapacity(250L);
-        assertTrue("Capacity was not the expected value", queueMBean.getCapacity() == 250L);
-        assertTrue("FlowResumeCapacity was not the expected value", queueMBean.getFlowResumeCapacity() == 250L);
-        assertFalse("Queue should not be overfull", queueMBean.isFlowOverfull());
+        setFlowLimits(queueUrl, 250, 250);
+        assertFalse("Queue should not be overfull", isFlowStopped(queueUrl));
         
         // try to send 2 messages (should block after 1)
+        sendMessagesAsync(_producer, _producerSession, 2, 50L);
 
-        sendMessagesAsync(producer, producerSession, 2, 50L);
-
-        Thread.sleep(2000);
+        waitForFlowControlAndMessageCount(queueUrl, 1, 2000);
 
         //check only 1 message was sent, and queue is overfull
         assertEquals("Incorrect number of message sent before blocking", 1, _sentMessages.get());
-        assertTrue("Queue should be overfull", queueMBean.isFlowOverfull());
+        assertTrue("Queue should be overfull", isFlowStopped(queueUrl));
         
         //raise the attribute values, causing the queue to become underfull and allow the second message to be sent.
-        queueMBean.setCapacity(300L);
-        queueMBean.setFlowResumeCapacity(300L);
-        
-        Thread.sleep(2000);
+        setFlowLimits(queueUrl, 300, 300);
+
+        waitForFlowControlAndMessageCount(queueUrl, 2, 2000);
 
         //check second message was sent, and caused the queue to become overfull again
         assertEquals("Second message was not sent after lifting FlowResumeCapacity", 2, _sentMessages.get());
-        assertTrue("Queue should be overfull", queueMBean.isFlowOverfull());
-        
+        assertTrue("Queue should be overfull", isFlowStopped(queueUrl));
+
         //raise capacity above queue depth, check queue remains overfull as FlowResumeCapacity still exceeded
-        queueMBean.setCapacity(700L);
-        assertTrue("Queue should be overfull", queueMBean.isFlowOverfull());
-        
+        setFlowLimits(queueUrl, 700, 300);
+        assertTrue("Queue should be overfull", isFlowStopped(queueUrl));
+
         //receive a message, check queue becomes underfull
         
-        consumer = consumerSession.createConsumer(queue);
-        consumerConnection.start();
+        _consumer = _consumerSession.createConsumer(_queue);
+        _consumerConnection.start();
         
-        consumer.receive();
+        _consumer.receive();
         
         //perform a synchronous op on the connection
-        ((AMQSession<?,?>) consumerSession).sync();
-        
-        assertFalse("Queue should not be overfull", queueMBean.isFlowOverfull());
-        
-        consumer.receive();
+        ((AMQSession<?,?>) _consumerSession).sync();
+
+        assertFalse("Queue should not be overfull", isFlowStopped(queueUrl));
+
+        _consumer.receive();
+    }
+
+    private void waitForFlowControlAndMessageCount(final String queueUrl, final int messageCount, final int timeout) throws InterruptedException, IOException
+    {
+        int timeWaited = 0;
+        while (timeWaited < timeout && (!isFlowStopped(queueUrl) || _sentMessages.get() != messageCount))
+        {
+            Thread.sleep(50);
+            timeWaited += 50;
+        }
+    }
+
+    private void setFlowLimits(final String queueUrl, final int blockValue, final int resumeValue) throws IOException
+    {
+        final Map<String, Object> attributes = new HashMap<>();
+        attributes.put(org.apache.qpid.server.model.Queue.QUEUE_FLOW_CONTROL_SIZE_BYTES, blockValue);
+        attributes.put(org.apache.qpid.server.model.Queue.QUEUE_FLOW_RESUME_SIZE_BYTES, resumeValue);
+        _restTestHelper.submitRequest(queueUrl, "PUT", attributes);
+    }
+
+    private boolean isFlowStopped(final String queueUrl) throws IOException
+    {
+        Map<String, Object> queueAttributes2 = _restTestHelper.getJsonAsSingletonList(queueUrl);
+        return (boolean) queueAttributes2.get(org.apache.qpid.server.model.Queue.QUEUE_FLOW_STOPPED);
     }
 
     public void testQueueDeleteWithBlockedFlow() throws Exception
     {
         String queueName = getTestQueueName();
-        createAndBindQueueWithFlowControlEnabled(producerSession, queueName, 1000, 800, true, false);
+        createAndBindQueueWithFlowControlEnabled(_producerSession, queueName, 1000, 800, true, false);
 
-        producer = producerSession.createProducer(queue);
+        _producer = _producerSession.createProducer(_queue);
 
         // try to send 5 messages (should block after 4)
-        sendMessagesAsync(producer, producerSession, 5, 50L);
+        sendMessagesAsync(_producer, _producerSession, 5, 50L);
 
         Thread.sleep(5000);
 
         assertEquals("Incorrect number of message sent before blocking", 4, _sentMessages.get());
 
         // close blocked producer session and connection
-        producerConnection.close();
+        _producerConnection.close();
 
         // delete queue with a consumer session
-        ((AMQSession<?,?>) consumerSession).sendQueueDelete(queueName);
+        ((AMQSession<?,?>) _consumerSession).sendQueueDelete(queueName);
 
-        consumer = consumerSession.createConsumer(queue);
-        consumerConnection.start();
+        _consumer = _consumerSession.createConsumer(_queue);
+        _consumerConnection.start();
 
-        Message message = consumer.receive(1000l);
+        Message message = _consumer.receive(1000l);
         assertNull("Unexpected message", message);
     }
 
@@ -400,8 +407,8 @@ public class ProducerFlowControlTest ext
         arguments.put("x-qpid-capacity",capacity);
         arguments.put("x-qpid-flow-resume-capacity",resumeCapacity);
         ((AMQSession<?,?>) session).createQueue(queueName, autoDelete, durable, false, arguments);
-        queue = session.createQueue("direct://amq.direct/"+queueName+"/"+queueName+"?durable='" + durable + "'&autodelete='" + autoDelete + "'");
-        ((AMQSession<?,?>) session).declareAndBind((AMQDestination)queue);
+        _queue = session.createQueue("direct://amq.direct/" + queueName + "/" + queueName + "?durable='" + durable + "'&autodelete='" + autoDelete + "'");
+        ((AMQSession<?,?>) session).declareAndBind((AMQDestination) _queue);
     }
 
     private MessageSender sendMessagesAsync(final MessageProducer producer,

Modified: qpid/java/trunk/systests/src/test/java/org/apache/qpid/server/security/acl/AbstractACLTestCase.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/systests/src/test/java/org/apache/qpid/server/security/acl/AbstractACLTestCase.java?rev=1718497&r1=1718496&r2=1718497&view=diff
==============================================================================
--- qpid/java/trunk/systests/src/test/java/org/apache/qpid/server/security/acl/AbstractACLTestCase.java (original)
+++ qpid/java/trunk/systests/src/test/java/org/apache/qpid/server/security/acl/AbstractACLTestCase.java Tue Dec  8 00:28:09 2015
@@ -47,7 +47,6 @@ import java.util.concurrent.TimeUnit;
  * test method to run its own setup code before the broker starts.
  *
  * @see ExternalACLTest
- * @see ExternalACLJMXTest
  * @see ExhaustiveACLTest
  */
 public abstract class AbstractACLTestCase extends QpidBrokerTestCase implements ConnectionListener

Modified: qpid/java/trunk/systests/src/test/java/org/apache/qpid/server/security/auth/manager/ExternalAuthenticationTest.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/systests/src/test/java/org/apache/qpid/server/security/auth/manager/ExternalAuthenticationTest.java?rev=1718497&r1=1718496&r2=1718497&view=diff
==============================================================================
--- qpid/java/trunk/systests/src/test/java/org/apache/qpid/server/security/auth/manager/ExternalAuthenticationTest.java (original)
+++ qpid/java/trunk/systests/src/test/java/org/apache/qpid/server/security/auth/manager/ExternalAuthenticationTest.java Tue Dec  8 00:28:09 2015
@@ -48,7 +48,7 @@ import org.apache.qpid.server.model.Trus
 import org.apache.qpid.server.model.VirtualHostAlias;
 import org.apache.qpid.server.model.VirtualHostNameAlias;
 import org.apache.qpid.server.security.FileTrustStore;
-import org.apache.qpid.test.utils.JMXTestUtils;
+import org.apache.qpid.systest.rest.RestTestHelper;
 import org.apache.qpid.test.utils.QpidBrokerTestCase;
 import org.apache.qpid.test.utils.TestBrokerConfiguration;
 
@@ -251,10 +251,9 @@ public class ExternalAuthenticationTest
      */
     public void testExternalAuthenticationManagerUsernameAsCN() throws Exception
     {
-        JMXTestUtils jmxUtils = new JMXTestUtils(this);
-
+        RestTestHelper restTestHelper = new RestTestHelper(findFreePort());
+        restTestHelper.enableHttpManagement(getBrokerConfiguration());
         setCommonBrokerSSLProperties(true);
-        getBrokerConfiguration().addJmxManagementConfiguration();
 
         super.setUp();
 
@@ -270,12 +269,16 @@ public class ExternalAuthenticationTest
             fail("Should be able to create a connection to the SSL port: " + e.getMessage());
         }
 
-        // Getting the used username using JMX
-        jmxUtils.open();
-        List<ManagedConnection> connections = jmxUtils.getManagedConnections("test");
-        assertNotNull("Connections are null", connections);
-        assertEquals("Unexpected number of connections", 1, connections.size());
-        assertEquals("Wrong authorized ID", "app2@acme.org", connections.get(0).getAuthorizedId());
+        try
+        {
+            // Getting the used username using REST
+            Map<String, Object> connectionAttributes = restTestHelper.getJsonAsSingletonList("connection");
+            assertEquals("Wrong authorized ID", "app2@acme.org", (String) connectionAttributes.get(org.apache.qpid.server.model.Connection.PRINCIPAL));
+        }
+        finally
+        {
+            restTestHelper.tearDown();
+        }
     }
 
     /**
@@ -284,11 +287,15 @@ public class ExternalAuthenticationTest
      */
     public void testExternalAuthenticationManagerUsernameAsDN() throws Exception
     {
-        JMXTestUtils jmxUtils = new JMXTestUtils(this);
+        RestTestHelper restTestHelper = new RestTestHelper(findFreePort());
+        TestBrokerConfiguration brokerConfiguration = getBrokerConfiguration();
+        restTestHelper.enableHttpManagement(brokerConfiguration);
 
         setCommonBrokerSSLProperties(true);
-        getBrokerConfiguration().setObjectAttribute(AuthenticationProvider.class, TestBrokerConfiguration.ENTRY_NAME_EXTERNAL_PROVIDER, ExternalAuthenticationManager.ATTRIBUTE_USE_FULL_DN, "true");
-        getBrokerConfiguration().addJmxManagementConfiguration();
+        brokerConfiguration.setObjectAttribute(AuthenticationProvider.class,
+                                                    TestBrokerConfiguration.ENTRY_NAME_EXTERNAL_PROVIDER,
+                                                    ExternalAuthenticationManager.ATTRIBUTE_USE_FULL_DN,
+                                                    "true");
 
         super.setUp();
 
@@ -304,12 +311,17 @@ public class ExternalAuthenticationTest
             fail("Should be able to create a connection to the SSL port: " + e.getMessage());
         }
 
-        // Getting the used username using JMX
-        jmxUtils.open();
-        List<ManagedConnection> connections = jmxUtils.getManagedConnections("test");
-        assertNotNull("Connections are null", connections);
-        assertEquals("Unexpected number of connections", 1, connections.size());
-        assertEquals("Wrong authorized ID", "CN=app2@acme.org,OU=art,O=acme,L=Toronto,ST=ON,C=CA", connections.get(0).getAuthorizedId());
+        try
+        {
+            // Getting the used username using REST
+            Map<String, Object> connectionAttributes = restTestHelper.getJsonAsSingletonList("connection");
+            assertEquals("Wrong authorized ID", "CN=app2@acme.org,OU=art,O=acme,L=Toronto,ST=ON,C=CA",
+                         (String) connectionAttributes.get(org.apache.qpid.server.model.Connection.PRINCIPAL));
+        }
+        finally
+        {
+            restTestHelper.tearDown();
+        }
     }
 
     private Connection getExternalSSLConnection(boolean includeUserNameAndPassword) throws Exception

Modified: qpid/java/trunk/systests/src/test/java/org/apache/qpid/systest/rest/PortRestTest.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/systests/src/test/java/org/apache/qpid/systest/rest/PortRestTest.java?rev=1718497&r1=1718496&r2=1718497&view=diff
==============================================================================
--- qpid/java/trunk/systests/src/test/java/org/apache/qpid/systest/rest/PortRestTest.java (original)
+++ qpid/java/trunk/systests/src/test/java/org/apache/qpid/systest/rest/PortRestTest.java Tue Dec  8 00:28:09 2015
@@ -35,14 +35,11 @@ import javax.servlet.http.HttpServletRes
 
 import org.apache.qpid.server.BrokerOptions;
 import org.apache.qpid.server.model.AuthenticationProvider;
-import org.apache.qpid.server.model.Plugin;
 import org.apache.qpid.server.model.Port;
 import org.apache.qpid.server.model.Protocol;
 import org.apache.qpid.server.model.State;
 import org.apache.qpid.server.model.Transport;
-import org.apache.qpid.server.model.port.JmxPort;
 import org.apache.qpid.server.security.auth.manager.AnonymousAuthenticationManager;
-import org.apache.qpid.test.utils.PortHelper;
 import org.apache.qpid.test.utils.TestBrokerConfiguration;
 
 public class PortRestTest extends QpidRestTestCase
@@ -105,76 +102,6 @@ public class PortRestTest extends QpidRe
         assertEquals("Unexpected number of ports with name " + portName, 1, portDetails.size());
     }
 
-    public void testPutRmiPortWithMinimumAttributes() throws Exception
-    {
-        String portNameRMI = "test-port-rmi";
-        Map<String, Object> attributes = new HashMap<String, Object>();
-        attributes.put(Port.NAME, portNameRMI);
-        int rmiPort = findFreePort();
-        attributes.put(Port.PORT, rmiPort);
-        attributes.put(Port.PROTOCOLS, Collections.singleton(Protocol.RMI));
-
-        int responseCode = getRestTestHelper().submitRequest("port/" + portNameRMI, "PUT", attributes);
-        assertEquals("Unexpected response code", 201, responseCode);
-
-
-        List<Map<String, Object>> portDetails = getRestTestHelper().getJsonAsList("port/" + portNameRMI);
-        assertNotNull("Port details cannot be null", portDetails);
-        assertEquals("Unexpected number of ports with name " + portNameRMI, 1, portDetails.size());
-        Map<String, Object> port = portDetails.get(0);
-        Asserts.assertPortAttributes(port, State.QUIESCED);
-
-        String portNameJMX = "test-port-jmx";
-        attributes = new HashMap<String, Object>();
-        attributes.put(Port.NAME, portNameJMX);
-        int jmxPort = getNextAvailable(rmiPort + 1);
-        attributes.put(Port.PORT, jmxPort);
-        attributes.put(Port.PROTOCOLS, Collections.singleton(Protocol.JMX_RMI));
-        attributes.put(JmxPort.AUTHENTICATION_PROVIDER, TestBrokerConfiguration.ENTRY_NAME_AUTHENTICATION_PROVIDER);
-
-        responseCode = getRestTestHelper().submitRequest("port/" + portNameJMX, "PUT", attributes);
-        assertEquals("Unexpected response code", 201, responseCode);
-
-
-        portDetails = getRestTestHelper().getJsonAsList("port/" + portNameJMX);
-        assertNotNull("Port details cannot be null", portDetails);
-        assertEquals("Unexpected number of ports with name " + portNameRMI, 1, portDetails.size());
-        port = portDetails.get(0);
-        Asserts.assertPortAttributes(port, State.QUIESCED);
-
-
-        attributes.put(Plugin.TYPE, "MANAGEMENT-JMX");
-        attributes.put(Plugin.NAME, "JmxPlugin");
-        responseCode = getRestTestHelper().submitRequest("plugin/JmxPlugin", "PUT", attributes);
-        assertEquals("Unexpected response code", 201, responseCode);
-
-
-        // make sure that port is there after broker restart
-        stopBroker();
-
-        // We shouldn't need to await the ports to be free, but it seems sometimes an RMI TCP Accept
-        // thread is seen to close the socket *after* the broker has finished stopping.
-        new PortHelper().waitUntilPortsAreFree(new HashSet<Integer>(Arrays.asList(jmxPort, rmiPort)));
-
-        startBroker();
-
-        portDetails = getRestTestHelper().getJsonAsList("port/" + portNameRMI);
-        assertNotNull("Port details cannot be null", portDetails);
-        assertEquals("Unexpected number of ports with name " + portNameRMI, 1, portDetails.size());
-        port = portDetails.get(0);
-        Asserts.assertPortAttributes(port, State.ACTIVE);
-
-        // try to add a second RMI port
-        portNameRMI = portNameRMI + "2";
-        attributes = new HashMap<String, Object>();
-        attributes.put(Port.NAME, portNameRMI);
-        attributes.put(Port.PORT, findFreePort());
-        attributes.put(Port.PROTOCOLS, Collections.singleton(Protocol.RMI));
-
-        responseCode = getRestTestHelper().submitRequest("port/" + portNameRMI, "PUT", attributes);
-        assertEquals("Adding of a second RMI port should fail", 409, responseCode);
-    }
-
     public void testPutCreateAndUpdateAmqpPort() throws Exception
     {
         String portName = "test-port";

Modified: qpid/java/trunk/systests/src/test/java/org/apache/qpid/test/client/message/JMSDestinationTest.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/systests/src/test/java/org/apache/qpid/test/client/message/JMSDestinationTest.java?rev=1718497&r1=1718496&r2=1718497&view=diff
==============================================================================
--- qpid/java/trunk/systests/src/test/java/org/apache/qpid/test/client/message/JMSDestinationTest.java (original)
+++ qpid/java/trunk/systests/src/test/java/org/apache/qpid/test/client/message/JMSDestinationTest.java Tue Dec  8 00:28:09 2015
@@ -21,11 +21,8 @@
 package org.apache.qpid.test.client.message;
 
 import org.apache.qpid.client.AMQDestination;
-import org.apache.qpid.client.AMQTopic;
 import org.apache.qpid.client.CustomJMSXProperty;
 import org.apache.qpid.configuration.ClientProperties;
-import org.apache.qpid.management.common.mbeans.ManagedQueue;
-import org.apache.qpid.test.utils.JMXTestUtils;
 import org.apache.qpid.test.utils.QpidBrokerTestCase;
 
 import javax.jms.Connection;
@@ -38,10 +35,7 @@ import javax.jms.MessageProducer;
 import javax.jms.Queue;
 import javax.jms.Session;
 import javax.jms.Topic;
-import javax.management.openmbean.CompositeDataSupport;
-import javax.management.openmbean.TabularData;
 
-import java.util.Iterator;
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.TimeUnit;
 
@@ -62,8 +56,6 @@ public class JMSDestinationTest extends
 
     public void setUp() throws Exception
     {
-        getBrokerConfiguration().addJmxManagementConfiguration();
-
         super.setUp();
 
         _connection = getConnection();
@@ -125,85 +117,6 @@ public class JMSDestinationTest extends
     }
 
     /**
-     * Test a message sent to a topic then moved on the broker
-     * comes back with JMSDestination queue.
-     *
-     * i.e. The client is not just setting the value to be the same as the
-     * current consumer destination.
-     *
-     * This test can only be run against the Java broker as it uses JMX to move
-     * messages between queues.
-     *
-     * @throws Exception
-     */
-    public void testMovedToQueue() throws Exception
-    {
-        // Setup JMXUtils
-        JMXTestUtils jmxUtils = new JMXTestUtils(this);
-
-        // Open the JMX Connection
-        jmxUtils.open();
-        try
-        {
-
-            Queue queue = _session.createQueue(getTestQueueName());
-
-            _session.createConsumer(queue).close();
-
-            sendMessage(_session, queue, 1);
-
-            Topic topic = _session.createTopic(getTestQueueName() + "Topic");
-
-            MessageConsumer consumer = _session.createConsumer(topic);
-
-            // Use Management to move message.
-
-            ManagedQueue managedQueue = jmxUtils.
-                    getManagedObject(ManagedQueue.class,
-                                     jmxUtils.getQueueObjectName(getConnectionFactory().getVirtualPath().substring(1),
-                                                                 getTestQueueName()));
-
-            // Find the first message on the queue
-            TabularData data = managedQueue.viewMessages(1L, 2L);
-
-            Iterator values = data.values().iterator();
-            assertTrue("No Messages found via JMX", values.hasNext());
-
-            // Get its message ID
-            Long msgID = (Long) ((CompositeDataSupport) values.next()).get("AMQ MessageId");
-
-            // Start the connection and consume message that has been moved to the
-            // queue
-            _connection.start();
-
-            Message message = consumer.receive(1000);
-
-            //Validate we don't have a message on the queue before we start
-            assertNull("Message should be null", message);
-
-            // Move it to from the topic to the queue
-            managedQueue.moveMessages(msgID, msgID, ((AMQTopic) topic).getQueueName());
-
-            // Retrieve the newly moved message
-            message = consumer.receive(1000);
-
-            assertNotNull("Message should not be null", message);
-
-            Destination receivedDestination = message.getJMSDestination();
-
-            assertNotNull("JMSDestination should not be null", receivedDestination);
-
-            assertEquals("Incorrect Destination type", queue.getClass(), receivedDestination.getClass());
-
-        }
-        finally
-        {
-            jmxUtils.close();
-        }
-
-    }
-
-    /**
      * Test a message sent to a queue comes back with JMSDestination queue
      * when received via a message listener
      *

Modified: qpid/java/trunk/systests/src/test/java/org/apache/qpid/test/unit/client/DynamicQueueExchangeCreateTest.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/systests/src/test/java/org/apache/qpid/test/unit/client/DynamicQueueExchangeCreateTest.java?rev=1718497&r1=1718496&r2=1718497&view=diff
==============================================================================
--- qpid/java/trunk/systests/src/test/java/org/apache/qpid/test/unit/client/DynamicQueueExchangeCreateTest.java (original)
+++ qpid/java/trunk/systests/src/test/java/org/apache/qpid/test/unit/client/DynamicQueueExchangeCreateTest.java Tue Dec  8 00:28:09 2015
@@ -20,15 +20,20 @@
  */
 package org.apache.qpid.test.unit.client;
 
+import java.io.FileNotFoundException;
 import java.io.IOException;
+import java.util.List;
+import java.util.Map;
 
 import org.apache.qpid.AMQException;
 import org.apache.qpid.client.AMQSession;
 import org.apache.qpid.configuration.ClientProperties;
-import org.apache.qpid.management.common.mbeans.ManagedExchange;
 import org.apache.qpid.protocol.AMQConstant;
-import org.apache.qpid.test.utils.JMXTestUtils;
+import org.apache.qpid.server.model.Exchange;
+import org.apache.qpid.server.model.LifetimePolicy;
+import org.apache.qpid.systest.rest.RestTestHelper;
 import org.apache.qpid.test.utils.QpidBrokerTestCase;
+import org.apache.qpid.test.utils.TestBrokerConfiguration;
 import org.apache.qpid.url.BindingURL;
 
 import javax.jms.Connection;
@@ -41,19 +46,15 @@ import javax.jms.Session;
 
 public class DynamicQueueExchangeCreateTest extends QpidBrokerTestCase
 {
-    private JMXTestUtils _jmxUtils;
-    private static final String TEST_VHOST = "test";
-
+    private static final String TEST_VHOST = TestBrokerConfiguration.ENTRY_NAME_VIRTUAL_HOST;
+    private RestTestHelper _restTestHelper;
 
     @Override
     public void setUp() throws Exception
     {
-        getBrokerConfiguration().addJmxManagementConfiguration();
-
-        _jmxUtils = new JMXTestUtils(this);
-
+        _restTestHelper = new RestTestHelper(findFreePort());
+        _restTestHelper.enableHttpManagement(getBrokerConfiguration());
         super.setUp();
-        _jmxUtils.open();
     }
 
     @Override
@@ -61,10 +62,7 @@ public class DynamicQueueExchangeCreateT
     {
         try
         {
-            if (_jmxUtils != null)
-            {
-                _jmxUtils.close();
-            }
+            _restTestHelper.tearDown();
         }
         finally
         {
@@ -119,11 +117,10 @@ public class DynamicQueueExchangeCreateT
             checkExceptionErrorCode(e, AMQConstant.NOT_FOUND);
         }
 
-        //verify the exchange was not declared
-        String exchangeObjectName = _jmxUtils.getExchangeObjectName(TEST_VHOST, exchangeName);
-        assertFalse("exchange should not exist", _jmxUtils.doesManagedObjectExist(exchangeObjectName));
+        assertFalse("Exchange exists", exchangeExists(exchangeName));
     }
 
+
     /**
      * Checks that setting {@value ClientProperties#QPID_DECLARE_EXCHANGES_PROP_NAME} false results in
      * disabling implicit ExchangeDeclares during producer creation when using a {@link BindingURL}
@@ -137,14 +134,9 @@ public class DynamicQueueExchangeCreateT
 
         Queue queue = session1.createQueue("direct://" + exchangeName1 + "/queue/queue");
         session1.createProducer(queue);
+        ((AMQSession<?,?>)session1).sync();
 
-        //close the session to ensure any previous commands were fully processed by
-        //the broker before observing their effect
-        session1.close();
-
-        //verify the exchange was declared
-        String exchangeObjectName = _jmxUtils.getExchangeObjectName(TEST_VHOST, exchangeName1);
-        assertTrue("exchange should exist", _jmxUtils.doesManagedObjectExist(exchangeObjectName));
+        assertTrue("Exchange does not exist", exchangeExists(exchangeName1));
 
         //Now disable the implicit exchange declares and try again
         setSystemProperty(ClientProperties.QPID_DECLARE_EXCHANGES_PROP_NAME, "false");
@@ -154,14 +146,8 @@ public class DynamicQueueExchangeCreateT
 
         Queue queue2 = session2.createQueue("direct://" + exchangeName2 + "/queue/queue");
         session2.createProducer(queue2);
-
-        //close the session to ensure any previous commands were fully processed by
-        //the broker before observing their effect
-        session2.close();
-
-        //verify the exchange was not declared
-        String exchangeObjectName2 = _jmxUtils.getExchangeObjectName(TEST_VHOST, exchangeName2);
-        assertFalse("exchange should not exist", _jmxUtils.doesManagedObjectExist(exchangeObjectName2));
+        ((AMQSession<?,?>)session2).sync();
+        assertFalse("Exchange exists", exchangeExists(exchangeName2));
     }
 
     public void testQueueNotBoundDuringConsumerCreation() throws Exception
@@ -209,11 +195,7 @@ public class DynamicQueueExchangeCreateT
         Queue queue = session.createQueue(tmpQueueBoundToTmpExchange);
 
         MessageConsumer consumer = session.createConsumer(queue);
-
-        String exchangeObjectName = _jmxUtils.getExchangeObjectName(TEST_VHOST, exchangeName);
-        assertTrue("Exchange " + exchangeName + " should exist", _jmxUtils.doesManagedObjectExist(exchangeObjectName));
-        ManagedExchange exchange = _jmxUtils.getManagedExchange(exchangeName);
-        assertTrue("Exchange " + exchangeName + " should be autodelete", exchange.isAutoDelete());
+        assertTrue("Exchange does not exist", exchangeExists(exchangeName));
 
         sendMessage(session, queue, 1);
 
@@ -231,7 +213,7 @@ public class DynamicQueueExchangeCreateT
         boolean exchangeExists = true;
         while (timeout > System.currentTimeMillis() && exchangeExists)
         {
-            exchangeExists = _jmxUtils.doesManagedObjectExist(exchangeObjectName);
+            exchangeExists = exchangeExists(exchangeName);
         }
         assertFalse("Exchange " + exchangeName + " should no longer exist",
                     exchangeExists);
@@ -245,70 +227,90 @@ public class DynamicQueueExchangeCreateT
         assertEquals("Error code should be " + code.getCode(), code, ((AMQException) linked).getErrorCode());
     }
 
-    /*
-     * Tests to validate that the custom exchanges declared by the client during
-     * consumer and producer creation have the expected properties.
-     */
+    public void testAutoDeleteExchangeDeclarationByProducer() throws Exception
+    {
+        String exchangeName = createExchange(true, BindingURL.OPTION_EXCHANGE_AUTODELETE);
+        verifyDeclaredExchangeAttribute(exchangeName, Exchange.LIFETIME_POLICY, LifetimePolicy.DELETE_ON_NO_LINKS.name());
+    }
 
-    public void testPropertiesOfCustomExchangeDeclaredDuringProducerCreation() throws Exception
+    public void testDurableExchangeDeclarationByProducer() throws Exception
     {
-        implTestPropertiesOfCustomExchange(true, false);
+        String exchangeName = createExchange(true, BindingURL.OPTION_EXCHANGE_DURABLE);
+        verifyDeclaredExchangeAttribute(exchangeName, Exchange.DURABLE, true);
     }
 
-    public void testPropertiesOfCustomExchangeDeclaredDuringConsumerCreation() throws Exception
+    public void testAutoDeleteExchangeDeclarationByConsumer() throws Exception
     {
-        implTestPropertiesOfCustomExchange(false, true);
+        String exchangeName = createExchange(false, BindingURL.OPTION_EXCHANGE_AUTODELETE);
+        verifyDeclaredExchangeAttribute(exchangeName, Exchange.LIFETIME_POLICY, LifetimePolicy.DELETE_ON_NO_LINKS.name());
     }
 
-    private void implTestPropertiesOfCustomExchange(boolean createProducer, boolean createConsumer) throws Exception
+
+    public void testDurableExchangeDeclarationByConsumer() throws Exception
     {
-        Connection connection = getConnection();
+        String exchangeName = createExchange(false, BindingURL.OPTION_EXCHANGE_DURABLE);
+        verifyDeclaredExchangeAttribute(exchangeName, Exchange.DURABLE, true);
+    }
 
-        Session session1 = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-        String exchangeName1 = getTestQueueName() + "1";
-        String queueName1 = getTestQueueName() + "1";
+    private String createExchange(final boolean createProducer,
+                                  final String optionName)
+            throws Exception
+    {
+        Connection connection = getConnection();
+        Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
 
-        Queue queue = session1.createQueue("direct://" + exchangeName1 + "/" + queueName1 + "/" + queueName1 + "?" + BindingURL.OPTION_EXCHANGE_AUTODELETE + "='true'");
+        String queueName = getTestQueueName() + "1";
+        String exchangeName = getTestQueueName() + "1";
+        Queue queue = session.createQueue("direct://" + exchangeName + "/" + queueName + "/" + queueName + "?" + optionName + "='true'");
         if(createProducer)
         {
-            session1.createProducer(queue);
+            session.createProducer(queue);
         }
-
-        if(createConsumer)
+        else
         {
-            session1.createConsumer(queue);
+            session.createConsumer(queue);
         }
-        session1.close();
-
-        //verify the exchange was declared to expectation
-        verifyDeclaredExchange(exchangeName1, true, false);
+        session.close();
+        return exchangeName;
+    }
 
-        Session session2 = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-        String exchangeName2 = getTestQueueName() + "2";
-        String queueName2 = getTestQueueName() + "2";
+    private void verifyDeclaredExchangeAttribute(String exchangeName, String attributeName, Object expectedAttributeValue) throws IOException
+    {
+        Map<String, Object> attributes = getExchangeAttributes(exchangeName);
+        Object realAttributeValue = attributes.get(attributeName);
+        assertEquals("Unexpected attribute " + attributeName + " value " + realAttributeValue, realAttributeValue, expectedAttributeValue);
+    }
 
-        Queue queue2 = session2.createQueue("direct://" + exchangeName2 + "/" + queueName2 + "/" + queueName2 + "?" + BindingURL.OPTION_EXCHANGE_DURABLE + "='true'");
-        if(createProducer)
+    private Map<String, Object> getExchangeAttributes(final String exchangeName) throws IOException
+    {
+        String exchangeUrl = "exchange/" + TEST_VHOST + "/" + TEST_VHOST + "/" + exchangeName;
+        List<Map<String, Object>> exchanges = _restTestHelper.getJsonAsList(exchangeUrl);
+        int exchangesSize = exchanges.size();
+        if (exchangesSize == 1)
         {
-            session2.createProducer(queue2);
+            return exchanges.get(0);
         }
-
-        if(createConsumer)
+        else if (exchangesSize == 0)
         {
-            session2.createConsumer(queue2);
+            return null;
         }
-        session2.close();
-
-        //verify the exchange was declared to expectation
-        verifyDeclaredExchange(exchangeName2, false, true);
+        else
+        {
+            fail("Exchange REST service returned more then 1 exchange " + exchanges);
+        }
+        return null;
     }
 
-    private void verifyDeclaredExchange(String exchangeName, boolean isAutoDelete, boolean isDurable) throws IOException
+    private boolean exchangeExists(final String exchangeName)
+            throws Exception
     {
-        String exchangeObjectName = _jmxUtils.getExchangeObjectName(TEST_VHOST, exchangeName);
-        assertTrue("exchange should exist", _jmxUtils.doesManagedObjectExist(exchangeObjectName));
-        ManagedExchange exchange = _jmxUtils.getManagedExchange(exchangeName);
-        assertEquals(isAutoDelete, exchange.isAutoDelete());
-        assertEquals(isDurable,exchange.isDurable());
+        try
+        {
+            return getExchangeAttributes(exchangeName) != null;
+        }
+        catch (FileNotFoundException e)
+        {
+            return false;
+        }
     }
 }

Modified: qpid/java/trunk/systests/src/test/java/org/apache/qpid/test/unit/client/MaxDeliveryCountTest.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/systests/src/test/java/org/apache/qpid/test/unit/client/MaxDeliveryCountTest.java?rev=1718497&r1=1718496&r2=1718497&view=diff
==============================================================================
--- qpid/java/trunk/systests/src/test/java/org/apache/qpid/test/unit/client/MaxDeliveryCountTest.java (original)
+++ qpid/java/trunk/systests/src/test/java/org/apache/qpid/test/unit/client/MaxDeliveryCountTest.java Tue Dec  8 00:28:09 2015
@@ -83,9 +83,6 @@ public class MaxDeliveryCountTest extend
         setTestSystemProperty("queue.deadLetterQueueEnabled","true");
         setTestSystemProperty("queue.maximumDeliveryAttempts", String.valueOf(MAX_DELIVERY_COUNT));
 
-        //Ensure management is on
-        brokerConfiguration.addJmxManagementConfiguration();
-
         // Set client-side flag to allow the server to determine if messages
         // dead-lettered or requeued.
         if (!isBroker010())

Modified: qpid/java/trunk/systests/src/test/java/org/apache/qpid/test/unit/client/connection/BrokerClosesClientConnectionTest.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/systests/src/test/java/org/apache/qpid/test/unit/client/connection/BrokerClosesClientConnectionTest.java?rev=1718497&r1=1718496&r2=1718497&view=diff
==============================================================================
--- qpid/java/trunk/systests/src/test/java/org/apache/qpid/test/unit/client/connection/BrokerClosesClientConnectionTest.java (original)
+++ qpid/java/trunk/systests/src/test/java/org/apache/qpid/test/unit/client/connection/BrokerClosesClientConnectionTest.java Tue Dec  8 00:28:09 2015
@@ -121,7 +121,7 @@ public class BrokerClosesClientConnectio
     private void assertConnectionCloseWasReported(JMSException exception, Class<? extends Exception> linkedExceptionClass)
     {
         assertNotNull("Broker shutdown should be reported to the client via the ExceptionListener", exception);
-        assertNotNull("JMXException should have linked exception", exception.getLinkedException());
+        assertNotNull("JMSXException should have linked exception", exception.getLinkedException());
 
         assertEquals("Unexpected linked exception", linkedExceptionClass, exception.getLinkedException().getClass());
     }

Modified: qpid/java/trunk/systests/src/test/java/org/apache/qpid/test/unit/topic/DurableSubscriptionTest.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/systests/src/test/java/org/apache/qpid/test/unit/topic/DurableSubscriptionTest.java?rev=1718497&r1=1718496&r2=1718497&view=diff
==============================================================================
--- qpid/java/trunk/systests/src/test/java/org/apache/qpid/test/unit/topic/DurableSubscriptionTest.java (original)
+++ qpid/java/trunk/systests/src/test/java/org/apache/qpid/test/unit/topic/DurableSubscriptionTest.java Tue Dec  8 00:28:09 2015
@@ -28,7 +28,6 @@ import org.apache.qpid.client.AMQNoRoute
 import org.apache.qpid.client.AMQQueue;
 import org.apache.qpid.client.AMQSession;
 import org.apache.qpid.client.AMQTopic;
-import org.apache.qpid.management.common.JMXConnnectionFactory;
 import org.apache.qpid.test.utils.QpidBrokerTestCase;
 
 import javax.jms.Connection;
@@ -43,11 +42,7 @@ import javax.jms.Session;
 import javax.jms.TextMessage;
 import javax.jms.Topic;
 import javax.jms.TopicSubscriber;
-import javax.management.MBeanServerConnection;
-import javax.management.ObjectName;
-import javax.management.remote.JMXConnector;
-import java.io.IOException;
-import java.util.Set;
+
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.TimeUnit;
 
@@ -72,41 +67,6 @@ public class DurableSubscriptionTest ext
     
     /** Timeout for receive() if we are not expecting a message */
     private static final long NEGATIVE_RECEIVE_TIMEOUT = 1000;
-    
-    private JMXConnector _jmxc;
-    private MBeanServerConnection _mbsc;
-    private static final String USER = "admin";
-    private static final String PASSWORD = "admin";
-    private boolean _jmxConnected;
-
-    public void setUp() throws Exception
-    {
-        getBrokerConfiguration().addJmxManagementConfiguration();
-        _jmxConnected=false;
-        super.setUp();
-    }
-
-    public void tearDown() throws Exception
-    {
-        try
-        {
-            if(_jmxConnected)
-            {
-                try
-                {
-                    _jmxc.close();
-                }
-                catch (IOException e)
-                {
-                    _logger.error("Error closing JMX connection", e);
-                }
-            }
-        }
-        finally
-        {
-            super.tearDown();
-        }
-    }
 
     public void testUnsubscribe() throws Exception
     {
@@ -162,29 +122,7 @@ public class DurableSubscriptionTest ext
         
         if(isJavaBroker())
         {
-            //Verify that the queue was deleted by querying for its JMX MBean
-            _jmxc = JMXConnnectionFactory.getJMXConnection(5000, "127.0.0.1",
-                    getManagementPort(getPort()), USER, PASSWORD);
-
-            _jmxConnected = true;
-            _mbsc = _jmxc.getMBeanServerConnection();
-            
-            //must replace the occurrence of ':' in queue name with '-'
-            String queueObjectNameText = "clientid" + "-" + MY_SUBSCRIPTION;
-            
-            ObjectName objName = new ObjectName("org.apache.qpid:type=VirtualHost.Queue,name=" 
-                                                + queueObjectNameText + ",*");
-            
-            Set<ObjectName> objectInstances = _mbsc.queryNames(objName, null);
-            
-            if(objectInstances.size() != 0)
-            {
-                fail("Queue MBean was found. Expected queue to have been deleted");
-            }
-            else
-            {
-                _logger.info("Underlying dueue for the durable subscription was confirmed deleted.");
-            }
+            assertFalse("Queue " + subQueue + " exists", ((AMQSession<?, ?>) session2).isQueueBound(subQueue));
         }
         
         //verify unsubscribing the durable subscriber did not affect the non-durable one

Modified: qpid/java/trunk/test-profiles/CPPExcludes
URL: http://svn.apache.org/viewvc/qpid/java/trunk/test-profiles/CPPExcludes?rev=1718497&r1=1718496&r2=1718497&view=diff
==============================================================================
--- qpid/java/trunk/test-profiles/CPPExcludes (original)
+++ qpid/java/trunk/test-profiles/CPPExcludes Tue Dec  8 00:28:09 2015
@@ -103,11 +103,7 @@ org.apache.qpid.server.logging.messages.
 org.apache.qpid.server.logging.subjects.*
 org.apache.qpid.server.logging.actors.*
 
-// CPP Broker does not have a JMX interface to test
-org.apache.qpid.server.jmx.mbeans.*
-org.apache.qpid.systest.management.jmx.*
-
-// JMX is used in this test for validation
+// REST management is used in this test for validation
 org.apache.qpid.server.queue.ModelTest#*
 
 // 0-10 is not supported by the MethodRegistry

Modified: qpid/java/trunk/test-profiles/Java010Excludes
URL: http://svn.apache.org/viewvc/qpid/java/trunk/test-profiles/Java010Excludes?rev=1718497&r1=1718496&r2=1718497&view=diff
==============================================================================
--- qpid/java/trunk/test-profiles/Java010Excludes (original)
+++ qpid/java/trunk/test-profiles/Java010Excludes Tue Dec  8 00:28:09 2015
@@ -68,9 +68,6 @@ org.apache.qpid.client.AsynchMessageList
 // Java 0-10 client does not support re-binding the queue to the same exchange
 org.apache.qpid.server.queue.QueueBindTest#testQueueCanBeReboundOnTopicExchange
 
-// Java 0-10 exclusive queues are owned by sessions not by the client-id, so the owner is not meaningful from JMX
-org.apache.qpid.systest.management.jmx.QueueManagementTest#testExclusiveQueueHasJmsClientIdAsOwner
-
 org.apache.qpid.test.unit.client.AMQSessionTest#testQueueDepthForQueueThatDoesNotExistLegacyBehaviour_08_091
 
 org.apache.qpid.client.prefetch.PrefetchBehaviourTest#testPrefetchWindowExpandsOnReceiveTransaction

Modified: qpid/java/trunk/test-profiles/JavaExcludes
URL: http://svn.apache.org/viewvc/qpid/java/trunk/test-profiles/JavaExcludes?rev=1718497&r1=1718496&r2=1718497&view=diff
==============================================================================
--- qpid/java/trunk/test-profiles/JavaExcludes (original)
+++ qpid/java/trunk/test-profiles/JavaExcludes Tue Dec  8 00:28:09 2015
@@ -25,10 +25,4 @@ org.apache.qpid.test.client.queue.QueueP
 org.apache.qpid.test.client.queue.QueuePolicyTest#testRejectPolicy
 
 // Test runs for 2 minutes testing that subtraction works
-org.apache.qpid.util.SerialTest#testCorollary1
-
-// Test fails with new logback sift mechanism for producing log per test.  Issue is the RMI
-// threads linger between tests, so still carry the MDC from a previous test run, meaning that
-// the log statements for MNG-1007/8 get directed to the wrong log.  This is not a general
-// problem because other JMX actions are carried out by configuration threads.
-org.apache.qpid.systest.management.jmx.ManagementLoggingTest#testManagementUserOpenClose
\ No newline at end of file
+org.apache.qpid.util.SerialTest#testCorollary1
\ No newline at end of file

Modified: qpid/java/trunk/test-profiles/JavaPre010Excludes
URL: http://svn.apache.org/viewvc/qpid/java/trunk/test-profiles/JavaPre010Excludes?rev=1718497&r1=1718496&r2=1718497&view=diff
==============================================================================
--- qpid/java/trunk/test-profiles/JavaPre010Excludes (original)
+++ qpid/java/trunk/test-profiles/JavaPre010Excludes Tue Dec  8 00:28:09 2015
@@ -80,11 +80,6 @@ org.apache.qpid.test.unit.ct.DurableSubs
 org.apache.qpid.ra.QpidRAConnectionTest#*
 org.apache.qpid.ra.QpidRAXAResourceTest#*
 
-// These tests rely on new address syntax
-org.apache.qpid.systest.management.jmx.QueueManagementTest#testGetSetAlternateExchange
-org.apache.qpid.systest.management.jmx.QueueManagementTest#testRemoveAlternateExchange
-org.apache.qpid.systest.management.jmx.QueueManagementTest#testAlternateExchangeSurvivesRestart
-
 // QPID-3396
 org.apache.qpid.test.unit.client.connection.ConnectionTest#testExceptionWhenUserPassIsRequired
 

Modified: qpid/java/trunk/test-profiles/JavaTransientExcludes
URL: http://svn.apache.org/viewvc/qpid/java/trunk/test-profiles/JavaTransientExcludes?rev=1718497&r1=1718496&r2=1718497&view=diff
==============================================================================
--- qpid/java/trunk/test-profiles/JavaTransientExcludes (original)
+++ qpid/java/trunk/test-profiles/JavaTransientExcludes Tue Dec  8 00:28:09 2015
@@ -49,11 +49,6 @@ org.apache.qpid.server.store.berkeleydb.
 org.apache.qpid.server.store.berkeleydb.upgrade.*
 org.apache.qpid.server.virtualhostnode.berkeleydb.*
 
-org.apache.qpid.systest.management.jmx.QueueManagementTest#testAlternateExchangeSurvivesRestart
-org.apache.qpid.systest.management.jmx.QueueManagementTest#testQueueDescriptionSurvivesRestart
-org.apache.qpid.systest.management.jmx.QueueManagementTest#testMoveMessageBetweenQueuesWithBrokerRestart
-org.apache.qpid.systest.management.jmx.QueueManagementTest#testCopyMessageBetweenQueuesWithBrokerRestart
-
 org.apache.qpid.test.unit.client.MaxDeliveryCountTest#testWhenBrokerIsRestartedAfterEnqeuingMessages
 
 org.apache.qpid.systest.rest.VirtualHostRestTest#testRecoverVirtualHostInDesiredStateStoppedWithDescription

Modified: qpid/java/trunk/test-profiles/cpp.excludes
URL: http://svn.apache.org/viewvc/qpid/java/trunk/test-profiles/cpp.excludes?rev=1718497&r1=1718496&r2=1718497&view=diff
==============================================================================
--- qpid/java/trunk/test-profiles/cpp.excludes (original)
+++ qpid/java/trunk/test-profiles/cpp.excludes Tue Dec  8 00:28:09 2015
@@ -21,7 +21,7 @@
 //Exclude the following tests when running all cpp test profilies
 //======================================================================
 
-// This test requires JMX interface to move messages
+// This test requires a management interface to move messages
 org.apache.qpid.test.client.message.JMSDestinationTest#testMovedToQueue
 
 // This test requires a broker capable of 0-8/9 and 0-10



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message