activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clebertsuco...@apache.org
Subject [09/55] [abbrv] activemq-artemis git commit: remove JMS JMX Objects and add new Address JMX objects
Date Wed, 07 Dec 2016 18:18:12 GMT
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/2b46f6a4/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/management/TopicControlTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/management/TopicControlTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/management/TopicControlTest.java
deleted file mode 100644
index 9a71e8d..0000000
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/management/TopicControlTest.java
+++ /dev/null
@@ -1,669 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.activemq.artemis.tests.integration.jms.server.management;
-
-import javax.jms.Connection;
-import javax.jms.ConnectionFactory;
-import javax.jms.JMSContext;
-import javax.jms.Message;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageProducer;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-import javax.jms.TopicSubscriber;
-import javax.json.JsonArray;
-import javax.management.Notification;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.activemq.artemis.api.core.JsonUtil;
-import org.apache.activemq.artemis.api.core.client.ActiveMQClient;
-import org.apache.activemq.artemis.api.core.management.ObjectNameBuilder;
-import org.apache.activemq.artemis.api.jms.ActiveMQJMSClient;
-import org.apache.activemq.artemis.api.jms.management.JMSServerControl;
-import org.apache.activemq.artemis.api.jms.management.SubscriptionInfo;
-import org.apache.activemq.artemis.api.jms.management.TopicControl;
-import org.apache.activemq.artemis.core.config.Configuration;
-import org.apache.activemq.artemis.core.postoffice.Binding;
-import org.apache.activemq.artemis.core.postoffice.impl.LocalQueueBinding;
-import org.apache.activemq.artemis.core.registry.JndiBindingRegistry;
-import org.apache.activemq.artemis.core.remoting.impl.invm.InVMConnectorFactory;
-import org.apache.activemq.artemis.core.server.ActiveMQServer;
-import org.apache.activemq.artemis.core.server.ActiveMQServers;
-import org.apache.activemq.artemis.jms.client.ActiveMQDestination;
-import org.apache.activemq.artemis.jms.client.ActiveMQTopic;
-import org.apache.activemq.artemis.jms.server.impl.JMSServerManagerImpl;
-import org.apache.activemq.artemis.jms.server.management.JMSNotificationType;
-import org.apache.activemq.artemis.tests.integration.management.ManagementControlHelper;
-import org.apache.activemq.artemis.tests.integration.management.ManagementTestBase;
-import org.apache.activemq.artemis.tests.unit.util.InVMNamingContext;
-import org.apache.activemq.artemis.utils.RandomUtil;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-
-public class TopicControlTest extends ManagementTestBase {
-
-   // Constants -----------------------------------------------------
-
-   // Attributes ----------------------------------------------------
-
-   private ActiveMQServer server;
-
-   private JMSServerManagerImpl serverManager;
-
-   private String clientID;
-
-   private String subscriptionName;
-
-   protected ActiveMQTopic topic;
-
-   private String topicBinding = "/topic/" + RandomUtil.randomString();
-
-   // Static --------------------------------------------------------
-
-   // Constructors --------------------------------------------------
-
-   // Public --------------------------------------------------------
-
-   @Test
-   public void testGetAttributes() throws Exception {
-      TopicControl topicControl = createManagementControl();
-
-      Assert.assertEquals(topic.getTopicName(), topicControl.getName());
-      Assert.assertEquals(topic.getAddress(), topicControl.getAddress());
-      Assert.assertEquals(topic.isTemporary(), topicControl.isTemporary());
-      Object[] bindings = topicControl.getRegistryBindings();
-      Assert.assertEquals(1, bindings.length);
-      Assert.assertEquals(topicBinding, bindings[0]);
-   }
-
-   @Test
-   public void testGetXXXSubscriptionsCount() throws Exception {
-      Connection connection_1 = JMSUtil.createConnection(InVMConnectorFactory.class.getName());
-
-      // 1 non-durable subscriber, 2 durable subscribers
-      JMSUtil.createConsumer(connection_1, topic);
-
-      Connection connection_2 = JMSUtil.createConnection(InVMConnectorFactory.class.getName());
-      JMSUtil.createDurableSubscriber(connection_2, topic, clientID, subscriptionName);
-      Connection connection_3 = JMSUtil.createConnection(InVMConnectorFactory.class.getName());
-      JMSUtil.createDurableSubscriber(connection_3, topic, clientID + "2", subscriptionName + "2");
-
-      TopicControl topicControl = createManagementControl();
-      Assert.assertEquals(3, topicControl.getSubscriptionCount());
-      Assert.assertEquals(1, topicControl.getNonDurableSubscriptionCount());
-      Assert.assertEquals(2, topicControl.getDurableSubscriptionCount());
-
-      connection_1.close();
-      connection_2.close();
-      connection_3.close();
-   }
-
-   @Test
-   public void testGetXXXMessagesCount() throws Exception {
-      // 1 non-durable subscriber, 2 durable subscribers
-      Connection connection_1 = JMSUtil.createConnection(InVMConnectorFactory.class.getName());
-      JMSUtil.createConsumer(connection_1, topic);
-      Connection connection_2 = JMSUtil.createConnection(InVMConnectorFactory.class.getName());
-      JMSUtil.createDurableSubscriber(connection_2, topic, clientID, subscriptionName);
-      Connection connection_3 = JMSUtil.createConnection(InVMConnectorFactory.class.getName());
-      JMSUtil.createDurableSubscriber(connection_3, topic, clientID + "_2", subscriptionName + "2");
-
-      TopicControl topicControl = createManagementControl();
-
-      Assert.assertEquals(0, topicControl.getMessageCount());
-      Assert.assertEquals(0, topicControl.getNonDurableMessageCount());
-      Assert.assertEquals(0, topicControl.getDurableMessageCount());
-
-      JMSUtil.sendMessages(topic, 2);
-
-      waitForMessageCount(3 * 2, topicControl, 3000);
-      waitForNonDurableMessageCount(1 * 2, topicControl, 3000);
-      waitForDurableMessageCount(2 * 2, topicControl, 3000);
-
-      connection_1.close();
-      connection_2.close();
-      connection_3.close();
-   }
-
-   @Test
-   public void testListXXXSubscriptionsCount() throws Exception {
-      // 1 non-durable subscriber, 2 durable subscribers
-      Connection connection_1 = JMSUtil.createConnection(InVMConnectorFactory.class.getName());
-      MessageConsumer cons = JMSUtil.createConsumer(connection_1, topic);
-      Connection connection_2 = JMSUtil.createConnection(InVMConnectorFactory.class.getName());
-      TopicSubscriber subs1 = JMSUtil.createDurableSubscriber(connection_2, topic, clientID, subscriptionName);
-      Connection connection_3 = JMSUtil.createConnection(InVMConnectorFactory.class.getName());
-      TopicSubscriber subs2 = JMSUtil.createDurableSubscriber(connection_3, topic, clientID + "2", subscriptionName + "2");
-
-      TopicControl topicControl = createManagementControl();
-      Assert.assertEquals(3, topicControl.listAllSubscriptions().length);
-      Assert.assertEquals(1, topicControl.listNonDurableSubscriptions().length);
-      Assert.assertEquals(2, topicControl.listDurableSubscriptions().length);
-
-      String json = topicControl.listAllSubscriptionsAsJSON();
-      System.out.println("Json: " + json);
-      JsonArray jsonArray = JsonUtil.readJsonArray(json);
-
-      Assert.assertEquals(3, jsonArray.size());
-
-      connection_1.close();
-      connection_2.close();
-      connection_3.close();
-   }
-
-   @Test
-   public void testListXXXSubscriptionsAsJSON() throws Exception {
-      // 1 non-durable subscriber, 2 durable subscribers
-      Connection connection_1 = JMSUtil.createConnection(InVMConnectorFactory.class.getName());
-      JMSUtil.createConsumer(connection_1, topic);
-      Connection connection_2 = JMSUtil.createConnection(InVMConnectorFactory.class.getName());
-      JMSUtil.createDurableSubscriber(connection_2, topic, clientID, subscriptionName);
-      Connection connection_3 = JMSUtil.createConnection(InVMConnectorFactory.class.getName());
-      JMSUtil.createDurableSubscriber(connection_3, topic, clientID + "2", subscriptionName + "2");
-
-      TopicControl topicControl = createManagementControl();
-      String jsonString = topicControl.listDurableSubscriptionsAsJSON();
-      SubscriptionInfo[] infos = SubscriptionInfo.from(jsonString);
-      Assert.assertEquals(2, infos.length);
-      List<String> expectedClientIds = Arrays.asList(clientID, clientID + "2");
-      List<String> expectedSubscriptionNames = Arrays.asList(subscriptionName, subscriptionName + "2");
-
-      Assert.assertTrue(expectedClientIds.contains(infos[0].getClientID()));
-      Assert.assertTrue(expectedSubscriptionNames.contains(infos[0].getName()));
-
-      Assert.assertTrue(expectedClientIds.contains(infos[1].getClientID()));
-      Assert.assertTrue(expectedSubscriptionNames.contains(infos[1].getName()));
-
-      jsonString = topicControl.listNonDurableSubscriptionsAsJSON();
-      infos = SubscriptionInfo.from(jsonString);
-      Assert.assertEquals(1, infos.length);
-      Assert.assertNull(infos[0].getClientID());
-      Assert.assertNull(infos[0].getName());
-
-      jsonString = topicControl.listAllSubscriptionsAsJSON();
-      infos = SubscriptionInfo.from(jsonString);
-      Assert.assertEquals(3, infos.length);
-
-      connection_1.close();
-      connection_2.close();
-      connection_3.close();
-   }
-
-   @Test
-   public void testListXXXSubscriptionsAsJSONJMS2() throws Exception {
-      ConnectionFactory cf = JMSUtil.createFactory(InVMConnectorFactory.class.getName(), ActiveMQClient.DEFAULT_CONNECTION_TTL_INVM, ActiveMQClient.DEFAULT_CLIENT_FAILURE_CHECK_PERIOD_INVM);
-      JMSContext jmsContext1 = cf.createContext();
-      jmsContext1.createSharedDurableConsumer(topic, subscriptionName, null);
-      JMSContext jmsContext2 = cf.createContext();
-      jmsContext2.createSharedDurableConsumer(topic, subscriptionName + "2", null);
-      JMSContext jmsContext3 = cf.createContext();
-      jmsContext3.createConsumer(topic);
-
-      TopicControl topicControl = createManagementControl();
-      String jsonString = topicControl.listDurableSubscriptionsAsJSON();
-      SubscriptionInfo[] infos = SubscriptionInfo.from(jsonString);
-      Assert.assertEquals(2, infos.length);
-
-      Assert.assertNull(infos[0].getClientID());
-      Assert.assertTrue(infos[0].getName().equals(subscriptionName));
-
-      Assert.assertNull(infos[1].getClientID());
-      Assert.assertTrue(infos[1].getName().equals(subscriptionName + "2"));
-
-      jsonString = topicControl.listNonDurableSubscriptionsAsJSON();
-      infos = SubscriptionInfo.from(jsonString);
-      Assert.assertEquals(1, infos.length);
-      Assert.assertNull(infos[0].getClientID());
-      Assert.assertNull(infos[0].getName());
-
-      jsonString = topicControl.listAllSubscriptionsAsJSON();
-      infos = SubscriptionInfo.from(jsonString);
-      Assert.assertEquals(3, infos.length);
-
-      jmsContext1.close();
-      jmsContext2.close();
-      jmsContext3.close();
-   }
-
-   @Test
-   public void testListSubscriptionsAsJSONWithHierarchicalTopics() throws Exception {
-      // there are no entries in mappings and nameMap in postOffice.addressManager; something isn't creating them as expected
-      serverManager.createTopic(false, "my.jms.#", "jms/all");
-      serverManager.createTopic(false, "my.jms.A", "jms/A");
-      ActiveMQTopic myTopic = (ActiveMQTopic) ActiveMQJMSClient.createTopic("my.jms.A");
-
-      TopicControl topicControl = ManagementControlHelper.createTopicControl(myTopic, mbeanServer);
-      String jsonString = topicControl.listDurableSubscriptionsAsJSON();
-      SubscriptionInfo[] infos = SubscriptionInfo.from(jsonString);
-      Assert.assertEquals(1, infos.length);
-      Assert.assertEquals("", infos[0].getClientID());
-      Assert.assertEquals("", infos[0].getName());
-   }
-
-   @Test
-   public void testCountMessagesForSubscription() throws Exception {
-      String key = "key";
-      long matchingValue = RandomUtil.randomLong();
-      long unmatchingValue = matchingValue + 1;
-
-      Connection connection = JMSUtil.createConnection(InVMConnectorFactory.class.getName());
-      JMSUtil.createDurableSubscriber(connection, topic, clientID, subscriptionName);
-
-      Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
-      JMSUtil.sendMessageWithProperty(session, topic, key, matchingValue);
-      JMSUtil.sendMessageWithProperty(session, topic, key, unmatchingValue);
-      JMSUtil.sendMessageWithProperty(session, topic, key, matchingValue);
-
-      for (Binding binding : server.getPostOffice().getBindingsForAddress(topic.getSimpleAddress()).getBindings()) {
-         ((LocalQueueBinding) binding).getQueue().flushExecutor();
-      }
-
-      TopicControl topicControl = createManagementControl();
-
-      Assert.assertEquals(3, topicControl.getMessageCount());
-
-      Assert.assertEquals(2, topicControl.countMessagesForSubscription(clientID, subscriptionName, key + " =" +
-         matchingValue));
-      Assert.assertEquals(1, topicControl.countMessagesForSubscription(clientID, subscriptionName, key + " =" +
-         unmatchingValue));
-
-      connection.close();
-   }
-
-   @Test
-   public void testCountMessagesForUnknownSubscription() throws Exception {
-      String unknownSubscription = RandomUtil.randomString();
-
-      TopicControl topicControl = createManagementControl();
-
-      try {
-         topicControl.countMessagesForSubscription(clientID, unknownSubscription, null);
-         Assert.fail();
-      } catch (Exception e) {
-      }
-   }
-
-   @Test
-   public void testCountMessagesForUnknownClientID() throws Exception {
-      String unknownClientID = RandomUtil.randomString();
-
-      TopicControl topicControl = createManagementControl();
-
-      try {
-         topicControl.countMessagesForSubscription(unknownClientID, subscriptionName, null);
-         Assert.fail();
-      } catch (Exception e) {
-      }
-   }
-
-   @Test
-   public void testDropDurableSubscriptionWithExistingSubscription() throws Exception {
-      Connection connection = JMSUtil.createConnection(InVMConnectorFactory.class.getName());
-
-      JMSUtil.createDurableSubscriber(connection, topic, clientID, subscriptionName);
-
-      TopicControl topicControl = createManagementControl();
-      Assert.assertEquals(1, topicControl.getDurableSubscriptionCount());
-
-      connection.close();
-
-      topicControl.dropDurableSubscription(clientID, subscriptionName);
-
-      Assert.assertEquals(0, topicControl.getDurableSubscriptionCount());
-   }
-
-   @Test
-   public void testDropDurableSubscriptionWithUnknownSubscription() throws Exception {
-      Connection connection = JMSUtil.createConnection(InVMConnectorFactory.class.getName());
-
-      JMSUtil.createDurableSubscriber(connection, topic, clientID, subscriptionName);
-
-      TopicControl topicControl = createManagementControl();
-      Assert.assertEquals(1, topicControl.getDurableSubscriptionCount());
-
-      try {
-         topicControl.dropDurableSubscription(clientID, "this subscription does not exist");
-         Assert.fail("should throw an exception");
-      } catch (Exception e) {
-
-      }
-
-      Assert.assertEquals(1, topicControl.getDurableSubscriptionCount());
-
-      connection.close();
-   }
-
-   @Test
-   public void testDropAllSubscriptions() throws Exception {
-      Connection connection_1 = JMSUtil.createConnection(InVMConnectorFactory.class.getName());
-      connection_1.setClientID(clientID);
-      Session sess1 = connection_1.createSession(false, Session.AUTO_ACKNOWLEDGE);
-      TopicSubscriber durableSubscriber_1 = sess1.createDurableSubscriber(topic, subscriptionName);
-
-      Connection connection_2 = JMSUtil.createConnection(InVMConnectorFactory.class.getName());
-      connection_2.setClientID(clientID + "2");
-      Session sess2 = connection_1.createSession(false, Session.AUTO_ACKNOWLEDGE);
-      TopicSubscriber durableSubscriber_2 = sess2.createDurableSubscriber(topic, subscriptionName + "2");
-
-      connection_1.start();
-      connection_2.start();
-
-      Session sess = connection_1.createSession(false, Session.AUTO_ACKNOWLEDGE);
-      MessageProducer prod = sess.createProducer(topic);
-
-      TextMessage msg1 = sess.createTextMessage("tst1");
-      prod.send(msg1);
-
-      Assert.assertNotNull(durableSubscriber_1.receive(5000));
-      Assert.assertNotNull(durableSubscriber_2.receive(5000));
-
-      connection_1.close();
-      connection_2.close();
-
-      TopicControl topicControl = createManagementControl();
-
-      Assert.assertEquals(2, topicControl.getSubscriptionCount());
-      topicControl.dropAllSubscriptions();
-
-      Assert.assertEquals(0, topicControl.getSubscriptionCount());
-
-      connection_1 = JMSUtil.createConnection(InVMConnectorFactory.class.getName());
-      connection_1.setClientID(clientID);
-      sess = connection_1.createSession(false, Session.AUTO_ACKNOWLEDGE);
-      prod = sess.createProducer(topic);
-      TextMessage msg2 = sess.createTextMessage("tst2");
-      prod.send(msg2);
-
-   }
-
-   @Test
-   public void testRemoveAllMessages() throws Exception {
-      Connection connection_1 = JMSUtil.createConnection(InVMConnectorFactory.class.getName());
-      JMSUtil.createDurableSubscriber(connection_1, topic, clientID, subscriptionName);
-      Connection connection_2 = JMSUtil.createConnection(InVMConnectorFactory.class.getName());
-      JMSUtil.createDurableSubscriber(connection_2, topic, clientID + "2", subscriptionName + "2");
-
-      JMSUtil.sendMessages(topic, 3);
-
-      TopicControl topicControl = createManagementControl();
-      waitForMessageCount(3 * 2, topicControl, 3000);
-
-      int removedCount = topicControl.removeMessages(null);
-      Assert.assertEquals(3 * 2, removedCount);
-      Assert.assertEquals(0, topicControl.getMessageCount());
-
-      connection_1.close();
-      connection_2.close();
-   }
-
-   @Test
-   public void testListMessagesForSubscription() throws Exception {
-      Connection connection = JMSUtil.createConnection(InVMConnectorFactory.class.getName());
-
-      JMSUtil.createDurableSubscriber(connection, topic, clientID, subscriptionName);
-
-      JMSUtil.sendMessages(topic, 3);
-
-      TopicControl topicControl = createManagementControl();
-      Map<String, Object>[] messages = topicControl.listMessagesForSubscription(ActiveMQDestination.createQueueNameForDurableSubscription(true, clientID, subscriptionName));
-      Assert.assertEquals(3, messages.length);
-
-      connection.close();
-   }
-
-   @Test
-   public void testListMessagesForSubscriptionAsJSON() throws Exception {
-      Connection connection = JMSUtil.createConnection(InVMConnectorFactory.class.getName());
-
-      JMSUtil.createDurableSubscriber(connection, topic, clientID, subscriptionName);
-
-      String[] ids = JMSUtil.sendMessages(topic, 3);
-
-      TopicControl topicControl = createManagementControl();
-      String jsonString = topicControl.listMessagesForSubscriptionAsJSON(ActiveMQDestination.createQueueNameForDurableSubscription(true, clientID, subscriptionName));
-      Assert.assertNotNull(jsonString);
-      JsonArray array = JsonUtil.readJsonArray(jsonString);
-      Assert.assertEquals(3, array.size());
-      for (int i = 0; i < 3; i++) {
-         Assert.assertEquals(ids[i], array.getJsonObject(i).getString("JMSMessageID"));
-      }
-
-      connection.close();
-   }
-
-   @Test
-   public void testListMessagesForSubscriptionWithUnknownClientID() throws Exception {
-      String unknownClientID = RandomUtil.randomString();
-
-      TopicControl topicControl = createManagementControl();
-
-      try {
-         topicControl.listMessagesForSubscription(ActiveMQDestination.createQueueNameForDurableSubscription(true, unknownClientID, subscriptionName));
-         Assert.fail();
-      } catch (Exception e) {
-      }
-   }
-
-   @Test
-   public void testListMessagesForSubscriptionWithUnknownSubscription() throws Exception {
-      String unknownSubscription = RandomUtil.randomString();
-
-      TopicControl topicControl = createManagementControl();
-
-      try {
-         topicControl.listMessagesForSubscription(ActiveMQDestination.createQueueNameForDurableSubscription(true, clientID, unknownSubscription));
-         Assert.fail();
-      } catch (Exception e) {
-      }
-   }
-
-   @Test
-   public void testGetMessagesAdded() throws Exception {
-      Connection connection_1 = JMSUtil.createConnection(InVMConnectorFactory.class.getName());
-      JMSUtil.createConsumer(connection_1, topic);
-      Connection connection_2 = JMSUtil.createConnection(InVMConnectorFactory.class.getName());
-      JMSUtil.createDurableSubscriber(connection_2, topic, clientID, subscriptionName);
-      Connection connection_3 = JMSUtil.createConnection(InVMConnectorFactory.class.getName());
-      JMSUtil.createDurableSubscriber(connection_3, topic, clientID + "2", subscriptionName + "2");
-
-      TopicControl topicControl = createManagementControl();
-
-      Assert.assertEquals(0, topicControl.getMessagesAdded());
-
-      JMSUtil.sendMessages(topic, 2);
-
-      waitForAddedMessageCount(3 * 2, topicControl, 3000);
-
-      connection_1.close();
-      connection_2.close();
-      connection_3.close();
-   }
-
-   @Test
-   public void testGetMessagesDelivering() throws Exception {
-      Connection connection_1 = JMSUtil.createConnection(InVMConnectorFactory.class.getName());
-      MessageConsumer cons_1 = JMSUtil.createConsumer(connection_1, topic, Session.CLIENT_ACKNOWLEDGE);
-      Connection connection_2 = JMSUtil.createConnection(InVMConnectorFactory.class.getName());
-      MessageConsumer cons_2 = JMSUtil.createDurableSubscriber(connection_2, topic, clientID, subscriptionName, Session.CLIENT_ACKNOWLEDGE);
-      Connection connection_3 = JMSUtil.createConnection(InVMConnectorFactory.class.getName());
-      MessageConsumer cons_3 = JMSUtil.createDurableSubscriber(connection_3, topic, clientID + "2", subscriptionName + "2", Session.CLIENT_ACKNOWLEDGE);
-
-      TopicControl topicControl = createManagementControl();
-
-      Assert.assertEquals(0, topicControl.getDeliveringCount());
-
-      JMSUtil.sendMessages(topic, 2);
-
-      Assert.assertEquals(0, topicControl.getDeliveringCount());
-
-      connection_1.start();
-      connection_2.start();
-      connection_3.start();
-
-      Message msg_1 = null;
-      Message msg_2 = null;
-      Message msg_3 = null;
-      for (int i = 0; i < 2; i++) {
-         msg_1 = cons_1.receive(5000);
-         Assert.assertNotNull(msg_1);
-         msg_2 = cons_2.receive(5000);
-         Assert.assertNotNull(msg_2);
-         msg_3 = cons_3.receive(5000);
-         Assert.assertNotNull(msg_3);
-      }
-
-      Assert.assertEquals(3 * 2, topicControl.getDeliveringCount());
-
-      msg_1.acknowledge();
-      Assert.assertEquals(2 * 2, topicControl.getDeliveringCount());
-      msg_2.acknowledge();
-      Assert.assertEquals(1 * 2, topicControl.getDeliveringCount());
-      msg_3.acknowledge();
-      Assert.assertEquals(0, topicControl.getDeliveringCount());
-
-      connection_1.close();
-      connection_2.close();
-      connection_3.close();
-   }
-
-   //make sure notifications are always received no matter whether
-   //a Topic is created via JMSServerControl or by JMSServerManager directly.
-   @Test
-   public void testCreateTopicNotification() throws Exception {
-      JMSUtil.JMXListener listener = new JMSUtil.JMXListener();
-      this.mbeanServer.addNotificationListener(ObjectNameBuilder.DEFAULT.getJMSServerObjectName(), listener, null, null);
-
-      List<String> connectors = new ArrayList<>();
-      connectors.add("invm");
-
-      String testTopicName = "newTopic";
-      serverManager.createTopic(true, testTopicName, testTopicName);
-
-      Notification notif = listener.getNotification();
-
-      Assert.assertEquals(JMSNotificationType.TOPIC_CREATED.toString(), notif.getType());
-      Assert.assertEquals(testTopicName, notif.getMessage());
-
-      this.serverManager.destroyTopic(testTopicName);
-
-      notif = listener.getNotification();
-      Assert.assertEquals(JMSNotificationType.TOPIC_DESTROYED.toString(), notif.getType());
-      Assert.assertEquals(testTopicName, notif.getMessage());
-
-      JMSServerControl control = ManagementControlHelper.createJMSServerControl(mbeanServer);
-
-      control.createTopic(testTopicName);
-
-      notif = listener.getNotification();
-      Assert.assertEquals(JMSNotificationType.TOPIC_CREATED.toString(), notif.getType());
-      Assert.assertEquals(testTopicName, notif.getMessage());
-
-      control.destroyTopic(testTopicName);
-
-      notif = listener.getNotification();
-      Assert.assertEquals(JMSNotificationType.TOPIC_DESTROYED.toString(), notif.getType());
-      Assert.assertEquals(testTopicName, notif.getMessage());
-   }
-
-   // Package protected ---------------------------------------------
-
-   // Protected -----------------------------------------------------
-
-   @Override
-   @Before
-   public void setUp() throws Exception {
-      super.setUp();
-
-      Configuration config = createDefaultInVMConfig().setJMXManagementEnabled(true);
-      server = addServer(ActiveMQServers.newActiveMQServer(config, mbeanServer, false));
-      server.start();
-
-      serverManager = new JMSServerManagerImpl(server);
-      serverManager.start();
-      serverManager.setRegistry(new JndiBindingRegistry(new InVMNamingContext()));
-      serverManager.activated();
-
-      clientID = RandomUtil.randomString();
-      subscriptionName = RandomUtil.randomString();
-
-      String topicName = RandomUtil.randomString();
-      serverManager.createTopic(false, topicName, topicBinding);
-      topic = (ActiveMQTopic) ActiveMQJMSClient.createTopic(topicName);
-   }
-
-   protected TopicControl createManagementControl() throws Exception {
-      return ManagementControlHelper.createTopicControl(topic, mbeanServer);
-   }
-
-   // Private -------------------------------------------------------
-
-   private void waitForMessageCount(long expected, TopicControl topicControl, long timeout) throws Exception {
-      long timeToWait = System.currentTimeMillis() + timeout;
-
-      while (System.currentTimeMillis() < timeToWait) {
-         if (expected == topicControl.getMessageCount()) {
-            return;
-         }
-         Thread.sleep(100);
-      }
-      assertEquals(expected, topicControl.getMessageCount());
-   }
-
-   private void waitForNonDurableMessageCount(long expected, TopicControl topicControl, long timeout) throws Exception {
-      long timeToWait = System.currentTimeMillis() + timeout;
-
-      while (System.currentTimeMillis() < timeToWait) {
-         if (expected == topicControl.getNonDurableMessageCount()) {
-            return;
-         }
-         Thread.sleep(100);
-      }
-      assertEquals(expected, topicControl.getNonDurableMessageCount());
-   }
-
-   private void waitForDurableMessageCount(long expected, TopicControl topicControl, long timeout) throws Exception {
-      long timeToWait = System.currentTimeMillis() + timeout;
-
-      while (System.currentTimeMillis() < timeToWait) {
-         if (expected == topicControl.getDurableMessageCount()) {
-            return;
-         }
-         Thread.sleep(100);
-      }
-      assertEquals(expected, topicControl.getDurableMessageCount());
-   }
-
-   private void waitForAddedMessageCount(long expected, TopicControl topicControl, long timeout) throws Exception {
-      long timeToWait = System.currentTimeMillis() + timeout;
-
-      while (System.currentTimeMillis() < timeToWait) {
-         if (expected == topicControl.getMessagesAdded()) {
-            return;
-         }
-         Thread.sleep(100);
-      }
-      assertEquals(expected, topicControl.getMessagesAdded());
-   }
-
-   // Inner classes -------------------------------------------------
-
-}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/2b46f6a4/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/management/TopicControlUsingJMSTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/management/TopicControlUsingJMSTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/management/TopicControlUsingJMSTest.java
deleted file mode 100644
index 54c79cc..0000000
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/management/TopicControlUsingJMSTest.java
+++ /dev/null
@@ -1,436 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.activemq.artemis.tests.integration.jms.server.management;
-
-import javax.jms.Connection;
-import javax.jms.Message;
-import javax.jms.MessageConsumer;
-import javax.jms.QueueConnection;
-import javax.jms.QueueSession;
-import javax.jms.Session;
-import javax.jms.TopicSubscriber;
-
-import org.apache.activemq.artemis.api.core.TransportConfiguration;
-import org.apache.activemq.artemis.api.jms.ActiveMQJMSClient;
-import org.apache.activemq.artemis.api.jms.JMSFactoryType;
-import org.apache.activemq.artemis.core.config.Configuration;
-import org.apache.activemq.artemis.core.registry.JndiBindingRegistry;
-import org.apache.activemq.artemis.core.remoting.impl.invm.InVMConnectorFactory;
-import org.apache.activemq.artemis.core.server.ActiveMQServer;
-import org.apache.activemq.artemis.core.server.ActiveMQServers;
-import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
-import org.apache.activemq.artemis.jms.client.ActiveMQDestination;
-import org.apache.activemq.artemis.jms.client.ActiveMQQueue;
-import org.apache.activemq.artemis.jms.client.ActiveMQTopic;
-import org.apache.activemq.artemis.jms.server.impl.JMSServerManagerImpl;
-import org.apache.activemq.artemis.tests.integration.management.ManagementTestBase;
-import org.apache.activemq.artemis.tests.unit.util.InVMNamingContext;
-import org.apache.activemq.artemis.utils.RandomUtil;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-
-import static org.apache.activemq.artemis.tests.util.RandomUtil.randomString;
-
-public class TopicControlUsingJMSTest extends ManagementTestBase {
-
-   // Constants -----------------------------------------------------
-
-   // Attributes ----------------------------------------------------
-
-   private ActiveMQServer server;
-
-   private JMSServerManagerImpl serverManager;
-
-   private String clientID;
-
-   private String subscriptionName;
-
-   protected ActiveMQTopic topic;
-
-   protected JMSMessagingProxy proxy;
-
-   private QueueConnection connection;
-
-   private QueueSession session;
-
-   private final String topicBinding = "/topic/" + randomString();
-
-   // Static --------------------------------------------------------
-
-   // Constructors --------------------------------------------------
-
-   // Public --------------------------------------------------------
-
-   @Test
-   public void testGetAttributes() throws Exception {
-      Assert.assertEquals(topic.getTopicName(), proxy.retrieveAttributeValue("name"));
-      Assert.assertEquals(topic.getAddress(), proxy.retrieveAttributeValue("address"));
-      Assert.assertEquals(topic.isTemporary(), proxy.retrieveAttributeValue("temporary"));
-      Object[] bindings = (Object[]) proxy.retrieveAttributeValue("" + "RegistryBindings");
-      assertEquals(1, bindings.length);
-      Assert.assertEquals(topicBinding, bindings[0]);
-   }
-
-   @Test
-   public void testGetXXXSubscriptionsCount() throws Exception {
-      Connection connection_1 = JMSUtil.createConnection(InVMConnectorFactory.class.getName());
-
-      // 1 non-durable subscriber, 2 durable subscribers
-      JMSUtil.createConsumer(connection_1, topic);
-
-      Connection connection_2 = JMSUtil.createConnection(InVMConnectorFactory.class.getName());
-      JMSUtil.createDurableSubscriber(connection_2, topic, clientID, subscriptionName);
-      Connection connection_3 = JMSUtil.createConnection(InVMConnectorFactory.class.getName());
-      JMSUtil.createDurableSubscriber(connection_3, topic, clientID + "2", subscriptionName + "2");
-
-      Assert.assertEquals(3, proxy.retrieveAttributeValue("subscriptionCount", Integer.class));
-      Assert.assertEquals(1, proxy.retrieveAttributeValue("nonDurableSubscriptionCount", Integer.class));
-      Assert.assertEquals(2, proxy.retrieveAttributeValue("durableSubscriptionCount", Integer.class));
-
-      connection_1.close();
-      connection_2.close();
-      connection_3.close();
-   }
-
-   @Test
-   public void testGetXXXMessagesCount() throws Exception {
-      // 1 non-durable subscriber, 2 durable subscribers
-      Connection connection_1 = JMSUtil.createConnection(InVMConnectorFactory.class.getName());
-      JMSUtil.createConsumer(connection_1, topic);
-      Connection connection_2 = JMSUtil.createConnection(InVMConnectorFactory.class.getName());
-      JMSUtil.createDurableSubscriber(connection_2, topic, clientID, subscriptionName);
-      Connection connection_3 = JMSUtil.createConnection(InVMConnectorFactory.class.getName());
-      JMSUtil.createDurableSubscriber(connection_3, topic, clientID + "2", subscriptionName + "2");
-
-      Assert.assertEquals(0L, proxy.retrieveAttributeValue("messageCount", Long.class));
-      Assert.assertEquals(0, proxy.retrieveAttributeValue("nonDurableMessageCount", Integer.class));
-      Assert.assertEquals(0, proxy.retrieveAttributeValue("durableMessageCount", Integer.class));
-
-      JMSUtil.sendMessages(topic, 2);
-
-      waitForAttributeEqualsValue("messageCount", 3L * 2L, 3000, Long.class);
-      waitForAttributeEqualsValue("nonDurableMessageCount", 1 * 2, 3000, Integer.class);
-      waitForAttributeEqualsValue("durableMessageCount", 2 * 2, 3000, Integer.class);
-
-      connection_1.close();
-      connection_2.close();
-      connection_3.close();
-   }
-
-   @Test
-   public void testListXXXSubscriptionsCount() throws Exception {
-      // 1 non-durable subscriber, 2 durable subscribers
-      Connection connection_1 = JMSUtil.createConnection(InVMConnectorFactory.class.getName());
-      JMSUtil.createConsumer(connection_1, topic);
-      Connection connection_2 = JMSUtil.createConnection(InVMConnectorFactory.class.getName());
-      JMSUtil.createDurableSubscriber(connection_2, topic, clientID, subscriptionName);
-      Connection connection_3 = JMSUtil.createConnection(InVMConnectorFactory.class.getName());
-      JMSUtil.createDurableSubscriber(connection_3, topic, clientID + "2", subscriptionName + "2");
-
-      Assert.assertEquals(3, ((Object[]) proxy.invokeOperation("listAllSubscriptions")).length);
-      Assert.assertEquals(1, ((Object[]) proxy.invokeOperation("listNonDurableSubscriptions")).length);
-      Assert.assertEquals(2, ((Object[]) proxy.invokeOperation("listDurableSubscriptions")).length);
-
-      connection_1.close();
-      connection_2.close();
-      connection_3.close();
-   }
-
-   @Test
-   public void testCountMessagesForSubscription() throws Exception {
-      String key = "key";
-      long matchingValue = RandomUtil.randomLong();
-      long unmatchingValue = matchingValue + 1;
-
-      Connection connection = JMSUtil.createConnection(InVMConnectorFactory.class.getName());
-      JMSUtil.createDurableSubscriber(connection, topic, clientID, subscriptionName);
-
-      Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
-      JMSUtil.sendMessageWithProperty(session, topic, key, matchingValue);
-      JMSUtil.sendMessageWithProperty(session, topic, key, unmatchingValue);
-      JMSUtil.sendMessageWithProperty(session, topic, key, matchingValue);
-
-      waitForAttributeEqualsValue("messageCount", 3L, 3000, Long.class);
-
-      Assert.assertEquals(2, proxy.invokeOperation(Integer.class, "countMessagesForSubscription", clientID, subscriptionName, key + " =" +
-         matchingValue));
-      Assert.assertEquals(1, proxy.invokeOperation(Integer.class, "countMessagesForSubscription", clientID, subscriptionName, key + " =" +
-         unmatchingValue));
-
-      connection.close();
-   }
-
-   @Test
-   public void testCountMessagesForUnknownSubscription() throws Exception {
-      String unknownSubscription = RandomUtil.randomString();
-
-      try {
-         proxy.invokeOperation("countMessagesForSubscription", clientID, unknownSubscription, null);
-         Assert.fail();
-      } catch (Exception e) {
-      }
-   }
-
-   @Test
-   public void testCountMessagesForUnknownClientID() throws Exception {
-      String unknownClientID = RandomUtil.randomString();
-
-      try {
-         proxy.invokeOperation("countMessagesForSubscription", unknownClientID, subscriptionName, null);
-         Assert.fail();
-      } catch (Exception e) {
-      }
-   }
-
-   @Test
-   public void testDropDurableSubscriptionWithExistingSubscription() throws Exception {
-      Connection connection = JMSUtil.createConnection(InVMConnectorFactory.class.getName());
-
-      JMSUtil.createDurableSubscriber(connection, topic, clientID, subscriptionName);
-
-      Assert.assertEquals(1, proxy.retrieveAttributeValue("durableSubscriptionCount", Integer.class));
-
-      connection.close();
-
-      proxy.invokeOperation("dropDurableSubscription", clientID, subscriptionName);
-
-      Assert.assertEquals(0, proxy.retrieveAttributeValue("durableSubscriptionCount", Integer.class));
-   }
-
-   @Test
-   public void testDropDurableSubscriptionWithUnknownSubscription() throws Exception {
-      Connection connection = JMSUtil.createConnection(InVMConnectorFactory.class.getName());
-
-      JMSUtil.createDurableSubscriber(connection, topic, clientID, subscriptionName);
-
-      Assert.assertEquals(1, proxy.retrieveAttributeValue("durableSubscriptionCount", Integer.class));
-
-      try {
-         proxy.invokeOperation("dropDurableSubscription", clientID, "this subscription does not exist");
-         Assert.fail("should throw an exception");
-      } catch (Exception e) {
-
-      }
-
-      Assert.assertEquals(1, proxy.retrieveAttributeValue("durableSubscriptionCount", Integer.class));
-
-      connection.close();
-   }
-
-   @Test
-   public void testDropAllSubscriptions() throws Exception {
-      Connection connection_1 = JMSUtil.createConnection(InVMConnectorFactory.class.getName());
-      TopicSubscriber durableSubscriber_1 = JMSUtil.createDurableSubscriber(connection_1, topic, clientID, subscriptionName);
-      Connection connection_2 = JMSUtil.createConnection(InVMConnectorFactory.class.getName());
-      TopicSubscriber durableSubscriber_2 = JMSUtil.createDurableSubscriber(connection_2, topic, clientID + "2", subscriptionName + "2");
-
-      Assert.assertEquals(2, proxy.retrieveAttributeValue("subscriptionCount", Integer.class));
-
-      durableSubscriber_1.close();
-      durableSubscriber_2.close();
-
-      Assert.assertEquals(2, proxy.retrieveAttributeValue("subscriptionCount", Integer.class));
-      proxy.invokeOperation("dropAllSubscriptions");
-
-      Assert.assertEquals(0, proxy.retrieveAttributeValue("subscriptionCount", Integer.class));
-
-      connection_1.close();
-      connection_2.close();
-   }
-
-   @Test
-   public void testRemoveAllMessages() throws Exception {
-      Connection connection_1 = JMSUtil.createConnection(InVMConnectorFactory.class.getName());
-      JMSUtil.createDurableSubscriber(connection_1, topic, clientID, subscriptionName);
-      Connection connection_2 = JMSUtil.createConnection(InVMConnectorFactory.class.getName());
-      JMSUtil.createDurableSubscriber(connection_2, topic, clientID + "2", subscriptionName + "2");
-
-      JMSUtil.sendMessages(topic, 3);
-
-      waitForAttributeEqualsValue("messageCount", 3L * 2L, 3000, Long.class);
-
-      int removedCount = (Integer) proxy.invokeOperation(Integer.class, "removeMessages", "");
-      Assert.assertEquals(3 * 2, removedCount);
-      Assert.assertEquals(0L, proxy.retrieveAttributeValue("messageCount", Long.class));
-
-      connection_1.close();
-      connection_2.close();
-   }
-
-   @Test
-   public void testListMessagesForSubscription() throws Exception {
-      Connection connection = JMSUtil.createConnection(InVMConnectorFactory.class.getName());
-
-      JMSUtil.createDurableSubscriber(connection, topic, clientID, subscriptionName);
-
-      JMSUtil.sendMessages(topic, 3);
-
-      Object[] data = (Object[]) proxy.invokeOperation("listMessagesForSubscription", ActiveMQDestination.createQueueNameForDurableSubscription(true, clientID, subscriptionName));
-      Assert.assertEquals(3, data.length);
-
-      connection.close();
-   }
-
-   @Test
-   public void testListMessagesForSubscriptionWithUnknownClientID() throws Exception {
-      String unknownClientID = RandomUtil.randomString();
-
-      try {
-         proxy.invokeOperation("listMessagesForSubscription", ActiveMQDestination.createQueueNameForDurableSubscription(true, unknownClientID, subscriptionName));
-         Assert.fail();
-      } catch (Exception e) {
-      }
-   }
-
-   @Test
-   public void testListMessagesForSubscriptionWithUnknownSubscription() throws Exception {
-      String unknownSubscription = RandomUtil.randomString();
-
-      try {
-         proxy.invokeOperation("listMessagesForSubscription", ActiveMQDestination.createQueueNameForDurableSubscription(true, clientID, unknownSubscription));
-         Assert.fail();
-      } catch (Exception e) {
-      }
-   }
-
-   @Test
-   public void testGetMessagesAdded() throws Exception {
-      Connection connection_1 = JMSUtil.createConnection(InVMConnectorFactory.class.getName());
-      JMSUtil.createConsumer(connection_1, topic);
-      Connection connection_2 = JMSUtil.createConnection(InVMConnectorFactory.class.getName());
-      JMSUtil.createDurableSubscriber(connection_2, topic, clientID, subscriptionName);
-      Connection connection_3 = JMSUtil.createConnection(InVMConnectorFactory.class.getName());
-      JMSUtil.createDurableSubscriber(connection_3, topic, clientID + "2", subscriptionName + "2");
-
-      assertEquals(0, proxy.retrieveAttributeValue("messagesAdded", Integer.class));
-
-      JMSUtil.sendMessages(topic, 2);
-
-      waitForAttributeEqualsValue("messagesAdded", 3L * 2L, 3000, Long.class);
-
-      connection_1.close();
-      connection_2.close();
-      connection_3.close();
-   }
-
-   @Test
-   public void testGetMessagesDelivering() throws Exception {
-      Connection connection_1 = JMSUtil.createConnection(InVMConnectorFactory.class.getName());
-      MessageConsumer cons_1 = JMSUtil.createConsumer(connection_1, topic, Session.CLIENT_ACKNOWLEDGE);
-      Connection connection_2 = JMSUtil.createConnection(InVMConnectorFactory.class.getName());
-      MessageConsumer cons_2 = JMSUtil.createDurableSubscriber(connection_2, topic, clientID, subscriptionName, Session.CLIENT_ACKNOWLEDGE);
-      Connection connection_3 = JMSUtil.createConnection(InVMConnectorFactory.class.getName());
-      MessageConsumer cons_3 = JMSUtil.createDurableSubscriber(connection_3, topic, clientID + "2", subscriptionName + "2", Session.CLIENT_ACKNOWLEDGE);
-
-      assertEquals(0, proxy.retrieveAttributeValue("deliveringCount", Integer.class));
-
-      JMSUtil.sendMessages(topic, 2);
-
-      assertEquals(0, proxy.retrieveAttributeValue("deliveringCount", Integer.class));
-
-      connection_1.start();
-      connection_2.start();
-      connection_3.start();
-
-      Message msg_1 = null;
-      Message msg_2 = null;
-      Message msg_3 = null;
-      for (int i = 0; i < 2; i++) {
-         msg_1 = cons_1.receive(5000);
-         assertNotNull(msg_1);
-         msg_2 = cons_2.receive(5000);
-         assertNotNull(msg_2);
-         msg_3 = cons_3.receive(5000);
-         assertNotNull(msg_3);
-      }
-
-      assertEquals(3 * 2, proxy.retrieveAttributeValue("deliveringCount", Integer.class));
-
-      msg_1.acknowledge();
-      assertEquals(2 * 2, proxy.retrieveAttributeValue("deliveringCount", Integer.class));
-      msg_2.acknowledge();
-      assertEquals(1 * 2, proxy.retrieveAttributeValue("deliveringCount", Integer.class));
-      msg_3.acknowledge();
-      assertEquals(0, proxy.retrieveAttributeValue("deliveringCount", Integer.class));
-
-      connection_1.close();
-      connection_2.close();
-      connection_3.close();
-   }
-
-   // Package protected ---------------------------------------------
-
-   // Protected -----------------------------------------------------
-
-   @Override
-   @Before
-   public void setUp() throws Exception {
-      super.setUp();
-
-      Configuration config = createDefaultInVMConfig().setJMXManagementEnabled(true);
-      server = addServer(ActiveMQServers.newActiveMQServer(config, mbeanServer, false));
-      server.start();
-
-      serverManager = new JMSServerManagerImpl(server);
-      serverManager.start();
-      serverManager.setRegistry(new JndiBindingRegistry(new InVMNamingContext()));
-      serverManager.activated();
-
-      clientID = RandomUtil.randomString();
-      subscriptionName = RandomUtil.randomString();
-
-      String topicName = RandomUtil.randomString();
-      serverManager.createTopic(false, topicName, topicBinding);
-      topic = (ActiveMQTopic) ActiveMQJMSClient.createTopic(topicName);
-
-      ActiveMQConnectionFactory cf = ActiveMQJMSClient.createConnectionFactoryWithoutHA(JMSFactoryType.CF, new TransportConfiguration(INVM_CONNECTOR_FACTORY));
-      connection = cf.createQueueConnection();
-      session = connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
-      connection.start();
-
-      ActiveMQQueue managementQueue = (ActiveMQQueue) ActiveMQJMSClient.createQueue("activemq.management");
-      proxy = new JMSMessagingProxy(session, managementQueue, topic.getTopicName());
-   }
-
-   // Private -------------------------------------------------------
-
-   private void waitForAttributeEqualsValue(String attribute, Object expected, long timeout) throws Exception {
-      waitForAttributeEqualsValue(attribute, expected, timeout, null);
-   }
-
-   private void waitForAttributeEqualsValue(String attribute,
-                                            Object expected,
-                                            long timeout,
-                                            Class desiredType) throws Exception {
-      long timeToWait = System.currentTimeMillis() + timeout;
-      Object actual = null;
-
-      while (System.currentTimeMillis() < timeToWait) {
-         actual = proxy.retrieveAttributeValue(attribute, desiredType);
-         if (expected.equals(actual)) {
-            return;
-         }
-         Thread.sleep(100);
-      }
-      Assert.assertEquals(expected, actual);
-   }
-
-   // Inner classes -------------------------------------------------
-
-}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/2b46f6a4/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/AcceptorControlUsingCoreTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/AcceptorControlUsingCoreTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/AcceptorControlUsingCoreTest.java
index 5907f3f..3aa3ddd 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/AcceptorControlUsingCoreTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/AcceptorControlUsingCoreTest.java
@@ -38,7 +38,7 @@ public class AcceptorControlUsingCoreTest extends AcceptorControlTest {
    protected AcceptorControl createManagementControl(final String name) throws Exception {
       return new AcceptorControl() {
 
-         private final CoreMessagingProxy proxy = new CoreMessagingProxy(addServerLocator(createInVMNonHALocator()), ResourceNames.CORE_ACCEPTOR + name);
+         private final CoreMessagingProxy proxy = new CoreMessagingProxy(addServerLocator(createInVMNonHALocator()), ResourceNames.ACCEPTOR + name);
 
          @Override
          public String getFactoryClassName() {

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/2b46f6a4/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlTest.java
index 5dd028e..681c258 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlTest.java
@@ -594,12 +594,12 @@ public class ActiveMQServerControlTest extends ManagementTestBase {
 
       ActiveMQServerControl serverControl = createManagementControl();
 
-      checkNoResource(ObjectNameBuilder.DEFAULT.getDivertObjectName(name));
+      checkNoResource(ObjectNameBuilder.DEFAULT.getDivertObjectName(name, address));
       assertEquals(0, serverControl.getDivertNames().length);
 
       serverControl.createDivert(name.toString(), null, address, forwardingAddress, true, null, null);
 
-      checkResource(ObjectNameBuilder.DEFAULT.getDivertObjectName(name));
+      checkResource(ObjectNameBuilder.DEFAULT.getDivertObjectName(name, address));
    }
 
    @Test
@@ -611,13 +611,13 @@ public class ActiveMQServerControlTest extends ManagementTestBase {
 
       ActiveMQServerControl serverControl = createManagementControl();
 
-      checkNoResource(ObjectNameBuilder.DEFAULT.getDivertObjectName(name));
+      checkNoResource(ObjectNameBuilder.DEFAULT.getDivertObjectName(name, address));
       assertEquals(0, serverControl.getDivertNames().length);
 
       serverControl.createDivert(name.toString(), routingName, address, forwardingAddress, true, null, null);
 
-      checkResource(ObjectNameBuilder.DEFAULT.getDivertObjectName(name));
-      DivertControl divertControl = ManagementControlHelper.createDivertControl(name.toString(), mbeanServer);
+      checkResource(ObjectNameBuilder.DEFAULT.getDivertObjectName(name, address));
+      DivertControl divertControl = ManagementControlHelper.createDivertControl(name.toString(), address, mbeanServer);
       assertEquals(name.toString(), divertControl.getUniqueName());
       assertEquals(address, divertControl.getAddress());
       assertEquals(forwardingAddress, divertControl.getForwardingAddress());
@@ -658,7 +658,7 @@ public class ActiveMQServerControlTest extends ManagementTestBase {
 
       serverControl.destroyDivert(name.toString());
 
-      checkNoResource(ObjectNameBuilder.DEFAULT.getDivertObjectName(name));
+      checkNoResource(ObjectNameBuilder.DEFAULT.getDivertObjectName(name, address));
       assertEquals(0, serverControl.getDivertNames().length);
 
       // check that a message is no longer diverted

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/2b46f6a4/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlUsingCoreTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlUsingCoreTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlUsingCoreTest.java
index 5cc55c3..ad36598 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlUsingCoreTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlUsingCoreTest.java
@@ -66,7 +66,7 @@ public class ActiveMQServerControlUsingCoreTest extends ActiveMQServerControlTes
             throw new UnsupportedOperationException();
          }
 
-         private final CoreMessagingProxy proxy = new CoreMessagingProxy(addServerLocator(createInVMNonHALocator()), ResourceNames.CORE_SERVER);
+         private final CoreMessagingProxy proxy = new CoreMessagingProxy(addServerLocator(createInVMNonHALocator()), ResourceNames.BROKER);
 
          @Override
          public boolean isSharedStore() {
@@ -99,6 +99,16 @@ public class ActiveMQServerControlUsingCoreTest extends ActiveMQServerControlTes
          }
 
          @Override
+         public void createAddress(@Parameter(name = "name", desc = "The name of the address") String name, @Parameter(name = "routingType", desc = "the routing type of the address either 0 for multicast or 1 for anycast") int routingType, @Parameter(name = "defaultDeleteOnNoConsumers", desc = "Whether or not a queue with this address is deleted when it has no consumers") boolean defaultDeleteOnNoConsumers, @Parameter(name = "defaultMaxConsumers", desc = "The maximim number of consumer a queue with this address can have") int defaultMaxConsumers) throws Exception {
+            proxy.invokeOperation("createAddress", name, routingType, defaultDeleteOnNoConsumers, defaultMaxConsumers);
+         }
+
+         @Override
+         public void deleteAddress(@Parameter(name = "name", desc = "The name of the address") String name) throws Exception {
+            proxy.invokeOperation("deleteAddress", name);
+         }
+
+         @Override
          public void createQueue(final String address,
                                  final String name,
                                  final String filter,
@@ -269,6 +279,11 @@ public class ActiveMQServerControlUsingCoreTest extends ActiveMQServerControlTes
          }
 
          @Override
+         public String getNodeID() {
+            return (String) proxy.retrieveAttributeValue("nodeID");
+         }
+
+         @Override
          public String getManagementAddress() {
             return (String) proxy.retrieveAttributeValue("managementAddress");
          }
@@ -612,6 +627,11 @@ public class ActiveMQServerControlUsingCoreTest extends ActiveMQServerControlTes
          }
 
          @Override
+         public String listNetworkTopology() throws Exception {
+            return (String) proxy.invokeOperation("listNetworkTopology");
+         }
+
+         @Override
          public void removeAddressSettings(String addressMatch) throws Exception {
             proxy.invokeOperation("removeAddressSettings", addressMatch);
          }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/2b46f6a4/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/AddressControlUsingCoreTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/AddressControlUsingCoreTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/AddressControlUsingCoreTest.java
index a845253..1587cef 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/AddressControlUsingCoreTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/AddressControlUsingCoreTest.java
@@ -176,7 +176,7 @@ public class AddressControlUsingCoreTest extends ManagementTestBase {
    }
 
    protected CoreMessagingProxy createProxy(final SimpleString address) throws Exception {
-      CoreMessagingProxy proxy = new CoreMessagingProxy(addServerLocator(createInVMNonHALocator()), ResourceNames.CORE_ADDRESS + address);
+      CoreMessagingProxy proxy = new CoreMessagingProxy(addServerLocator(createInVMNonHALocator()), ResourceNames.ADDRESS + address);
 
       return proxy;
    }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/2b46f6a4/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/BridgeControlUsingCoreTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/BridgeControlUsingCoreTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/BridgeControlUsingCoreTest.java
index 208f0ba..e0ff4c8 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/BridgeControlUsingCoreTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/BridgeControlUsingCoreTest.java
@@ -123,7 +123,7 @@ public class BridgeControlUsingCoreTest extends ManagementTestBase {
    }
 
    protected CoreMessagingProxy createProxy(final String name) throws Exception {
-      CoreMessagingProxy proxy = new CoreMessagingProxy(addServerLocator(createInVMNonHALocator()), ResourceNames.CORE_BRIDGE + name);
+      CoreMessagingProxy proxy = new CoreMessagingProxy(addServerLocator(createInVMNonHALocator()), ResourceNames.BRIDGE + name);
 
       return proxy;
    }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/2b46f6a4/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/BroadcastGroupControlUsingCoreTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/BroadcastGroupControlUsingCoreTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/BroadcastGroupControlUsingCoreTest.java
index 6165be4..0533dc5 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/BroadcastGroupControlUsingCoreTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/BroadcastGroupControlUsingCoreTest.java
@@ -24,7 +24,7 @@ public class BroadcastGroupControlUsingCoreTest extends BroadcastGroupControlTes
    @Override
    protected BroadcastGroupControl createManagementControl(final String name) throws Exception {
       return new BroadcastGroupControl() {
-         private final CoreMessagingProxy proxy = new CoreMessagingProxy(addServerLocator(createInVMNonHALocator()), ResourceNames.CORE_BROADCAST_GROUP + name);
+         private final CoreMessagingProxy proxy = new CoreMessagingProxy(addServerLocator(createInVMNonHALocator()), ResourceNames.BROADCAST_GROUP + name);
 
          @Override
          public long getBroadcastPeriod() {

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/2b46f6a4/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/DivertControlTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/DivertControlTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/DivertControlTest.java
index 7311727..109e008 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/DivertControlTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/DivertControlTest.java
@@ -45,9 +45,9 @@ public class DivertControlTest extends ManagementTestBase {
 
    @Test
    public void testAttributes() throws Exception {
-      checkResource(ObjectNameBuilder.DEFAULT.getDivertObjectName(divertConfig.getName()));
+      checkResource(ObjectNameBuilder.DEFAULT.getDivertObjectName(divertConfig.getName(), divertConfig.getAddress()));
 
-      DivertControl divertControl = createManagementControl(divertConfig.getName());
+      DivertControl divertControl = createDivertManagementControl(divertConfig.getName(), divertConfig.getAddress());
 
       Assert.assertEquals(divertConfig.getFilterString(), divertControl.getFilter());
 
@@ -86,7 +86,7 @@ public class DivertControlTest extends ManagementTestBase {
       server.start();
    }
 
-   protected DivertControl createManagementControl(final String name) throws Exception {
-      return ManagementControlHelper.createDivertControl(name, mbeanServer);
+   protected DivertControl createDivertManagementControl(final String name, final String address) throws Exception {
+      return ManagementControlHelper.createDivertControl(name, address, mbeanServer);
    }
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/2b46f6a4/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/DivertControlUsingCoreTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/DivertControlUsingCoreTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/DivertControlUsingCoreTest.java
index cf92cf1..61ecda2 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/DivertControlUsingCoreTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/DivertControlUsingCoreTest.java
@@ -32,9 +32,9 @@ public class DivertControlUsingCoreTest extends DivertControlTest {
    // DivertControlTest overrides --------------------------------
 
    @Override
-   protected DivertControl createManagementControl(final String name) throws Exception {
+   protected DivertControl createDivertManagementControl(final String name, final String address) throws Exception {
       return new DivertControl() {
-         private final CoreMessagingProxy proxy = new CoreMessagingProxy(addServerLocator(createInVMNonHALocator()), ResourceNames.CORE_DIVERT + name);
+         private final CoreMessagingProxy proxy = new CoreMessagingProxy(addServerLocator(createInVMNonHALocator()), ResourceNames.DIVERT + name);
 
          @Override
          public String getAddress() {

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/2b46f6a4/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ManagementControlHelper.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ManagementControlHelper.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ManagementControlHelper.java
index a41c908..0f82222 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ManagementControlHelper.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ManagementControlHelper.java
@@ -16,8 +16,6 @@
  */
 package org.apache.activemq.artemis.tests.integration.management;
 
-import javax.jms.Queue;
-import javax.jms.Topic;
 import javax.management.MBeanServer;
 import javax.management.MBeanServerInvocationHandler;
 import javax.management.ObjectName;
@@ -32,10 +30,6 @@ import org.apache.activemq.artemis.api.core.management.ClusterConnectionControl;
 import org.apache.activemq.artemis.api.core.management.DivertControl;
 import org.apache.activemq.artemis.api.core.management.ObjectNameBuilder;
 import org.apache.activemq.artemis.api.core.management.QueueControl;
-import org.apache.activemq.artemis.api.jms.management.ConnectionFactoryControl;
-import org.apache.activemq.artemis.api.jms.management.JMSQueueControl;
-import org.apache.activemq.artemis.api.jms.management.JMSServerControl;
-import org.apache.activemq.artemis.api.jms.management.TopicControl;
 
 public class ManagementControlHelper {
 
@@ -59,8 +53,8 @@ public class ManagementControlHelper {
       return (BridgeControl) ManagementControlHelper.createProxy(ObjectNameBuilder.DEFAULT.getBridgeObjectName(name), BridgeControl.class, mbeanServer);
    }
 
-   public static DivertControl createDivertControl(final String name, final MBeanServer mbeanServer) throws Exception {
-      return (DivertControl) ManagementControlHelper.createProxy(ObjectNameBuilder.DEFAULT.getDivertObjectName(name), DivertControl.class, mbeanServer);
+   public static DivertControl createDivertControl(final String name, String address, final MBeanServer mbeanServer) throws Exception {
+      return (DivertControl) ManagementControlHelper.createProxy(ObjectNameBuilder.DEFAULT.getDivertObjectName(name, address), DivertControl.class, mbeanServer);
    }
 
    public static ClusterConnectionControl createClusterConnectionControl(final String name,
@@ -83,29 +77,6 @@ public class ManagementControlHelper {
       return (AddressControl) ManagementControlHelper.createProxy(ObjectNameBuilder.DEFAULT.getAddressObjectName(address), AddressControl.class, mbeanServer);
    }
 
-   public static JMSQueueControl createJMSQueueControl(final Queue queue,
-                                                       final MBeanServer mbeanServer) throws Exception {
-      return ManagementControlHelper.createJMSQueueControl(queue.getQueueName(), mbeanServer);
-   }
-
-   public static JMSQueueControl createJMSQueueControl(final String name,
-                                                       final MBeanServer mbeanServer) throws Exception {
-      return (JMSQueueControl) ManagementControlHelper.createProxy(ObjectNameBuilder.DEFAULT.getJMSQueueObjectName(name), JMSQueueControl.class, mbeanServer);
-   }
-
-   public static JMSServerControl createJMSServerControl(final MBeanServer mbeanServer) throws Exception {
-      return (JMSServerControl) ManagementControlHelper.createProxy(ObjectNameBuilder.DEFAULT.getJMSServerObjectName(), JMSServerControl.class, mbeanServer);
-   }
-
-   public static ConnectionFactoryControl createConnectionFactoryControl(final String name,
-                                                                         final MBeanServer mbeanServer) throws Exception {
-      return (ConnectionFactoryControl) ManagementControlHelper.createProxy(ObjectNameBuilder.DEFAULT.getConnectionFactoryObjectName(name), ConnectionFactoryControl.class, mbeanServer);
-   }
-
-   public static TopicControl createTopicControl(final Topic topic, final MBeanServer mbeanServer) throws Exception {
-      return (TopicControl) ManagementControlHelper.createProxy(ObjectNameBuilder.DEFAULT.getJMSTopicObjectName(topic.getTopicName()), TopicControl.class, mbeanServer);
-   }
-
    // Constructors --------------------------------------------------
 
    // Public --------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/2b46f6a4/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ManagementServiceImplTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ManagementServiceImplTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ManagementServiceImplTest.java
index ce95046..1afc732 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ManagementServiceImplTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ManagementServiceImplTest.java
@@ -27,6 +27,7 @@ import org.apache.activemq.artemis.core.server.ActiveMQServer;
 import org.apache.activemq.artemis.core.server.ActiveMQServers;
 import org.apache.activemq.artemis.core.server.Queue;
 import org.apache.activemq.artemis.core.server.ServerMessage;
+import org.apache.activemq.artemis.core.server.impl.AddressInfo;
 import org.apache.activemq.artemis.core.server.impl.ServerMessageImpl;
 import org.apache.activemq.artemis.core.server.management.impl.ManagementServiceImpl;
 import org.apache.activemq.artemis.tests.integration.server.FakeStorageManager;
@@ -50,7 +51,7 @@ public class ManagementServiceImplTest extends ActiveMQTestBase {
 
       // invoke attribute and operation on the server
       ServerMessage message = new ServerMessageImpl(1, 100);
-      ManagementHelper.putOperationInvocation(message, ResourceNames.CORE_SERVER, "createQueue", queue, address);
+      ManagementHelper.putOperationInvocation(message, ResourceNames.BROKER, "createQueue", queue, address);
 
       ServerMessage reply = server.getManagementService().handleMessage(message);
 
@@ -66,7 +67,7 @@ public class ManagementServiceImplTest extends ActiveMQTestBase {
 
       // invoke attribute and operation on the server
       ServerMessage message = new ServerMessageImpl(1, 100);
-      ManagementHelper.putOperationInvocation(message, ResourceNames.CORE_SERVER, "thereIsNoSuchOperation");
+      ManagementHelper.putOperationInvocation(message, ResourceNames.BROKER, "thereIsNoSuchOperation");
 
       ServerMessage reply = server.getManagementService().handleMessage(message);
 
@@ -101,7 +102,7 @@ public class ManagementServiceImplTest extends ActiveMQTestBase {
       // invoke attribute and operation on the server
       ServerMessage message = new ServerMessageImpl(1, 100);
 
-      ManagementHelper.putAttribute(message, ResourceNames.CORE_SERVER, "started");
+      ManagementHelper.putAttribute(message, ResourceNames.BROKER, "started");
 
       ServerMessage reply = server.getManagementService().handleMessage(message);
 
@@ -119,7 +120,7 @@ public class ManagementServiceImplTest extends ActiveMQTestBase {
       // invoke attribute and operation on the server
       ServerMessage message = new ServerMessageImpl(1, 100);
 
-      ManagementHelper.putAttribute(message, ResourceNames.CORE_SERVER, "attribute.Does.Not.Exist");
+      ManagementHelper.putAttribute(message, ResourceNames.BROKER, "attribute.Does.Not.Exist");
 
       ServerMessage reply = server.getManagementService().handleMessage(message);
 
@@ -134,7 +135,7 @@ public class ManagementServiceImplTest extends ActiveMQTestBase {
       managementService.setStorageManager(new NullStorageManager());
 
       SimpleString address = RandomUtil.randomSimpleString();
-      managementService.registerAddress(address);
+      managementService.registerAddress(new AddressInfo(address));
       Queue queue = new FakeQueue(RandomUtil.randomSimpleString());
       managementService.registerQueue(queue, RandomUtil.randomSimpleString(), new FakeStorageManager());
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/2b46f6a4/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ManagementTestBase.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ManagementTestBase.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ManagementTestBase.java
index 8b79e7c..6647c43 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ManagementTestBase.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ManagementTestBase.java
@@ -25,7 +25,6 @@ import org.apache.activemq.artemis.api.core.client.ClientConsumer;
 import org.apache.activemq.artemis.api.core.client.ClientMessage;
 import org.apache.activemq.artemis.api.core.client.ClientSession;
 import org.apache.activemq.artemis.api.core.management.QueueControl;
-import org.apache.activemq.artemis.api.jms.management.JMSQueueControl;
 import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
 import org.junit.After;
 import org.junit.Assert;
@@ -105,16 +104,6 @@ public abstract class ManagementTestBase extends ActiveMQTestBase {
       return queueControl;
    }
 
-   protected long getMessageCount(JMSQueueControl control) throws Exception {
-      control.flushExecutor();
-      return control.getMessageCount();
-   }
-
-   protected long getMessagesAdded(JMSQueueControl control) throws Exception {
-      control.flushExecutor();
-      return control.getMessagesAdded();
-   }
-
    protected long getMessageCount(QueueControl control) throws Exception {
       control.flushExecutor();
       return control.getMessageCount();

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/2b46f6a4/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ManagementWithPagingServerTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ManagementWithPagingServerTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ManagementWithPagingServerTest.java
index 7e10297..e7b95bb 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ManagementWithPagingServerTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ManagementWithPagingServerTest.java
@@ -17,7 +17,11 @@
 package org.apache.activemq.artemis.tests.integration.management;
 
 import javax.json.JsonArray;
+import javax.json.JsonObject;
+import javax.json.JsonValue;
 import java.nio.ByteBuffer;
+import java.util.ArrayList;
+import java.util.List;
 
 import org.apache.activemq.artemis.api.core.ActiveMQBuffer;
 import org.apache.activemq.artemis.api.core.JsonUtil;
@@ -35,6 +39,7 @@ import org.apache.activemq.artemis.core.server.ActiveMQServers;
 import org.apache.activemq.artemis.core.settings.impl.AddressFullMessagePolicy;
 import org.apache.activemq.artemis.core.settings.impl.AddressSettings;
 import org.apache.activemq.artemis.utils.RandomUtil;
+import org.apache.johnzon.core.JsonLongImpl;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
@@ -79,7 +84,16 @@ public class ManagementWithPagingServerTest extends ManagementTestBase {
       String result = queueControl.listMessagesAsJSON(null);
 
       JsonArray array = JsonUtil.readJsonArray(result);
-
+      List<Long> longs = new ArrayList<>();
+      for (JsonValue jsonValue : array) {
+         JsonValue val = ((JsonObject) jsonValue).get("messageID");
+         Long l = ((JsonLongImpl) val).longValue();
+         if (longs.contains(l)) {
+            System.out.println("ManagementWithPagingServerTest.testListMessagesAsJSON");
+         }
+         longs.add(l);
+         System.out.println("jsonValue = " + jsonValue);
+      }
       assertEquals(num, array.size());
 
       //kick off receiver
@@ -235,6 +249,7 @@ public class ManagementWithPagingServerTest extends ManagementTestBase {
 
             for (int i = 0; i < num; i++) {
                ClientMessage message = session1.createMessage(true);
+               message.setPriority((byte) 1);
                ActiveMQBuffer buffer = message.getBodyBuffer();
                buffer.writeBytes(body);
                producer.send(message);

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/2b46f6a4/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ManagementWithStompTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ManagementWithStompTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ManagementWithStompTest.java
index 035d4ca..5c94f1d 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ManagementWithStompTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ManagementWithStompTest.java
@@ -87,7 +87,7 @@ public class ManagementWithStompTest extends ManagementTestBase {
       // retrieve the address of the queue
       frame = "\nSEND\n" + "destination:" + ActiveMQDefaultConfiguration.getDefaultManagementAddress() + "\n" +
          "reply-to:" + address + "\n" +
-         "_AMQ_ResourceName:" + ResourceNames.CORE_QUEUE + queue + "\n" +
+         "_AMQ_ResourceName:" + ResourceNames.QUEUE + queue + "\n" +
          "_AMQ_Attribute: Address\n\n" +
          Stomp.NULL;
       sendFrame(frame);
@@ -129,7 +129,7 @@ public class ManagementWithStompTest extends ManagementTestBase {
       // count number of message with filter "color = 'blue'"
       frame = "\nSEND\n" + "destination:" + ActiveMQDefaultConfiguration.getDefaultManagementAddress() + "\n" +
          "reply-to:" + address + "\n" +
-         "_AMQ_ResourceName:" + ResourceNames.CORE_QUEUE + queue + "\n" +
+         "_AMQ_ResourceName:" + ResourceNames.QUEUE + queue + "\n" +
          "_AMQ_OperationName: countMessages\n\n" +
          "[\"color = 'blue'\"]" +
          Stomp.NULL;

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/2b46f6a4/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/QueueControlTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/QueueControlTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/QueueControlTest.java
index d9377ec..f1c9948 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/QueueControlTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/QueueControlTest.java
@@ -2108,7 +2108,7 @@ public class QueueControlTest extends ManagementTestBase {
 
       QueueControl queueControl = createManagementControl(address, queue);
 
-      queueControl.sendMessage(new HashMap<String, String>(), Message.TEXT_TYPE, Base64.encodeBytes("theBody".getBytes()), "myID", true, "myUser", "myPassword");
+      queueControl.sendMessage(new HashMap<String, String>(), Message.TEXT_TYPE, Base64.encodeBytes("theBody".getBytes()), true, "myUser", "myPassword");
 
       Assert.assertEquals(1, getMessageCount(queueControl));
 
@@ -2133,7 +2133,7 @@ public class QueueControlTest extends ManagementTestBase {
 
       QueueControl queueControl = createManagementControl(address, queue);
 
-      queueControl.sendMessage(new HashMap<String, String>(), Message.TEXT_TYPE, null, "myID", true, "myUser", "myPassword");
+      queueControl.sendMessage(new HashMap<String, String>(), Message.TEXT_TYPE, null, true, "myUser", "myPassword");
 
       Assert.assertEquals(1, getMessageCount(queueControl));
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/2b46f6a4/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/QueueControlUsingCoreTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/QueueControlUsingCoreTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/QueueControlUsingCoreTest.java
index 9b901fc..250289a 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/QueueControlUsingCoreTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/QueueControlUsingCoreTest.java
@@ -30,7 +30,7 @@ public class QueueControlUsingCoreTest extends QueueControlTest {
    protected QueueControl createManagementControl(final SimpleString address,
                                                   final SimpleString queue) throws Exception {
       return new QueueControl() {
-         private final CoreMessagingProxy proxy = new CoreMessagingProxy(addServerLocator(createInVMNonHALocator()), ResourceNames.CORE_QUEUE + queue);
+         private final CoreMessagingProxy proxy = new CoreMessagingProxy(addServerLocator(createInVMNonHALocator()), ResourceNames.QUEUE + queue);
 
          @Override
          public void flushExecutor() {
@@ -316,11 +316,10 @@ public class QueueControlUsingCoreTest extends QueueControlTest {
          public String sendMessage(Map<String, String> headers,
                                    int type,
                                    String body,
-                                   String userID,
                                    boolean durable,
                                    String user,
                                    String password) throws Exception {
-            return (String) proxy.invokeOperation("sendMessage", headers, type, body, userID, durable, user, password);
+            return (String) proxy.invokeOperation("sendMessage", headers, type, body, durable, user, password);
          }
 
          public void setDeadLetterAddress(final String deadLetterAddress) throws Exception {
@@ -352,6 +351,17 @@ public class QueueControlUsingCoreTest extends QueueControlTest {
          }
 
          @Override
+         public CompositeData[] browse() throws Exception {
+            Map map = (Map) proxy.invokeOperation("browse");
+            CompositeData[] compositeDatas = (CompositeData[]) map.get(CompositeData.class.getName());
+            if (compositeDatas == null) {
+               compositeDatas = new CompositeData[0];
+            }
+            return compositeDatas;
+         }
+
+
+         @Override
          public CompositeData[] browse(String filter) throws Exception {
             Map map = (Map) proxy.invokeOperation("browse", filter);
             CompositeData[] compositeDatas = (CompositeData[]) map.get(CompositeData.class.getName());

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/2b46f6a4/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/SecurityManagementTestBase.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/SecurityManagementTestBase.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/SecurityManagementTestBase.java
index c4e27af..b9d7aa7 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/SecurityManagementTestBase.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/SecurityManagementTestBase.java
@@ -75,7 +75,7 @@ public abstract class SecurityManagementTestBase extends ActiveMQTestBase {
          ClientRequestor requestor = new ClientRequestor(session, ActiveMQDefaultConfiguration.getDefaultManagementAddress());
 
          ClientMessage mngmntMessage = session.createMessage(false);
-         ManagementHelper.putAttribute(mngmntMessage, ResourceNames.CORE_SERVER, "started");
+         ManagementHelper.putAttribute(mngmntMessage, ResourceNames.BROKER, "started");
          ClientMessage reply = requestor.request(mngmntMessage, 500);
          if (expectSuccess) {
             Assert.assertNotNull(reply);

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/2b46f6a4/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/OpenWireTestBase.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/OpenWireTestBase.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/OpenWireTestBase.java
index 66706ad..52f090d 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/OpenWireTestBase.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/OpenWireTestBase.java
@@ -26,7 +26,6 @@ import java.util.Set;
 
 import org.apache.activemq.artemis.api.core.SimpleString;
 import org.apache.activemq.artemis.api.core.TransportConfiguration;
-import org.apache.activemq.artemis.api.jms.management.JMSServerControl;
 import org.apache.activemq.artemis.core.config.Configuration;
 import org.apache.activemq.artemis.core.registry.JndiBindingRegistry;
 import org.apache.activemq.artemis.core.security.Role;
@@ -36,7 +35,6 @@ import org.apache.activemq.artemis.jms.server.config.ConnectionFactoryConfigurat
 import org.apache.activemq.artemis.jms.server.config.impl.ConnectionFactoryConfigurationImpl;
 import org.apache.activemq.artemis.jms.server.impl.JMSServerManagerImpl;
 import org.apache.activemq.artemis.spi.core.security.ActiveMQJAASSecurityManager;
-import org.apache.activemq.artemis.tests.integration.management.ManagementControlHelper;
 import org.apache.activemq.artemis.tests.unit.util.InVMNamingContext;
 import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
 import org.junit.After;
@@ -143,10 +141,6 @@ public class OpenWireTestBase extends ActiveMQTestBase {
       jmsServer.createConnectionFactory(false, configuration, jndiBindings);
    }
 
-   protected JMSServerControl getJMSServerControl() throws Exception {
-      return ManagementControlHelper.createJMSServerControl(mbeanServer);
-   }
-
    @Override
    @After
    public void tearDown() throws Exception {

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/2b46f6a4/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/util/JMSTestBase.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/util/JMSTestBase.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/util/JMSTestBase.java
index f02de79..196ea97 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/util/JMSTestBase.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/util/JMSTestBase.java
@@ -36,7 +36,6 @@ import java.util.Set;
 
 import org.apache.activemq.artemis.api.core.TransportConfiguration;
 import org.apache.activemq.artemis.api.core.management.QueueControl;
-import org.apache.activemq.artemis.api.jms.management.JMSQueueControl;
 import org.apache.activemq.artemis.core.config.Configuration;
 import org.apache.activemq.artemis.core.registry.JndiBindingRegistry;
 import org.apache.activemq.artemis.core.server.ActiveMQServer;
@@ -101,11 +100,6 @@ public class JMSTestBase extends ActiveMQTestBase {
       return createTopic(false, topicName);
    }
 
-   protected long getMessageCount(JMSQueueControl control) throws Exception {
-      control.flushExecutor();
-      return control.getMessageCount();
-   }
-
    protected long getMessageCount(QueueControl control) throws Exception {
       control.flushExecutor();
       return control.getMessageCount();


Mime
View raw message