activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clebertsuco...@apache.org
Subject [09/21] activemq-artemis git commit: More test-suite refactoring
Date Thu, 28 May 2015 15:19:00 GMT
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/328611fd/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/topology/IsolatedTopologyTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/topology/IsolatedTopologyTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/topology/IsolatedTopologyTest.java
index e27e103..893b3af 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/topology/IsolatedTopologyTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/topology/IsolatedTopologyTest.java
@@ -23,7 +23,7 @@ import org.apache.activemq.artemis.core.config.ClusterConnectionConfiguration;
 import org.apache.activemq.artemis.core.config.Configuration;
 import org.apache.activemq.artemis.core.remoting.impl.netty.TransportConstants;
 import org.apache.activemq.artemis.core.server.ActiveMQServer;
-import org.apache.activemq.artemis.tests.util.ServiceTestBase;
+import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
 import org.junit.Assert;
 import org.junit.Test;
 
@@ -32,7 +32,7 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
-public class IsolatedTopologyTest extends ServiceTestBase
+public class IsolatedTopologyTest extends ActiveMQTestBase
 {
 
    @Test
@@ -108,7 +108,7 @@ public class IsolatedTopologyTest extends ServiceTestBase
       params.put(TransportConstants.CLUSTER_CONNECTION, "cc1");
       params.put(org.apache.activemq.artemis.core.remoting.impl.invm.TransportConstants.SERVER_ID_PROP_NAME, "1");
 
-      TransportConfiguration acceptor1VM1 = new TransportConfiguration(ServiceTestBase.INVM_ACCEPTOR_FACTORY,
+      TransportConfiguration acceptor1VM1 = new TransportConfiguration(ActiveMQTestBase.INVM_ACCEPTOR_FACTORY,
                                                                        params,
                                                                        "acceptor-cc1");
 
@@ -116,7 +116,7 @@ public class IsolatedTopologyTest extends ServiceTestBase
       params.put(TransportConstants.CLUSTER_CONNECTION, "cc2");
       params.put(org.apache.activemq.artemis.core.remoting.impl.invm.TransportConstants.SERVER_ID_PROP_NAME, "2");
 
-      TransportConfiguration acceptor2VM1 = new TransportConfiguration(ServiceTestBase.INVM_ACCEPTOR_FACTORY,
+      TransportConfiguration acceptor2VM1 = new TransportConfiguration(ActiveMQTestBase.INVM_ACCEPTOR_FACTORY,
                                                                        params,
                                                                        "acceptor-cc2");
 
@@ -145,7 +145,7 @@ public class IsolatedTopologyTest extends ServiceTestBase
       // Server1 with two acceptors, each acceptor on a different cluster connection
       // talking to a different connector.
       // i.e. two cluster connections isolated on the same node
-      Configuration config1 = createBasicConfig(0)
+      Configuration config1 = createBasicConfig(1)
          .addConnectorConfiguration("local-cc1", createInVMTransportConnectorConfig(1, "local-cc1"))
          .addConnectorConfiguration("local-cc2", createInVMTransportConnectorConfig(2, "local-cc2"))
          .addConnectorConfiguration("other-cc1", createInVMTransportConnectorConfig(3, "other-cc1"))
@@ -165,7 +165,7 @@ public class IsolatedTopologyTest extends ServiceTestBase
       params.put(TransportConstants.CLUSTER_CONNECTION, "cc1");
       params.put(org.apache.activemq.artemis.core.remoting.impl.invm.TransportConstants.SERVER_ID_PROP_NAME, "3");
 
-      TransportConfiguration acceptor1VM1 = new TransportConfiguration(ServiceTestBase.INVM_ACCEPTOR_FACTORY,
+      TransportConfiguration acceptor1VM1 = new TransportConfiguration(ActiveMQTestBase.INVM_ACCEPTOR_FACTORY,
                                                                        params,
                                                                        "acceptor-cc1");
 
@@ -173,7 +173,7 @@ public class IsolatedTopologyTest extends ServiceTestBase
       params.put(TransportConstants.CLUSTER_CONNECTION, "cc2");
       params.put(org.apache.activemq.artemis.core.remoting.impl.invm.TransportConstants.SERVER_ID_PROP_NAME, "4");
 
-      TransportConfiguration acceptor2VM1 = new TransportConfiguration(ServiceTestBase.INVM_ACCEPTOR_FACTORY,
+      TransportConfiguration acceptor2VM1 = new TransportConfiguration(ActiveMQTestBase.INVM_ACCEPTOR_FACTORY,
                                                                        params,
                                                                        "acceptor-cc2");
 
@@ -199,10 +199,10 @@ public class IsolatedTopologyTest extends ServiceTestBase
          .setConfirmationWindowSize(1024)
          .setStaticConnectors(connectTo2);
 
-      // Server1 with two acceptors, each acceptor on a different cluster connection
+      // Server2 with two acceptors, each acceptor on a different cluster connection
       // talking to a different connector.
       // i.e. two cluster connections isolated on the same node
-      Configuration config1 = createBasicConfig(3)
+      Configuration config1 = createBasicConfig(2)
          .addAcceptorConfiguration(acceptor1VM1)
          .addAcceptorConfiguration(acceptor2VM1)
          .addConnectorConfiguration("local-cc1", createInVMTransportConnectorConfig(3, "local-cc1"))

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/328611fd/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/topology/NonHATopologyTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/topology/NonHATopologyTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/topology/NonHATopologyTest.java
index df305f6..544993f 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/topology/NonHATopologyTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/topology/NonHATopologyTest.java
@@ -30,7 +30,7 @@ import org.apache.activemq.artemis.core.config.Configuration;
 import org.apache.activemq.artemis.core.remoting.impl.invm.InVMConnectorFactory;
 import org.apache.activemq.artemis.core.remoting.impl.netty.NettyConnectorFactory;
 import org.apache.activemq.artemis.core.server.ActiveMQServer;
-import org.apache.activemq.artemis.tests.util.ServiceTestBase;
+import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
 
 /**
  * I have added this test to help validate if the connectors from Recovery will be
@@ -38,7 +38,7 @@ import org.apache.activemq.artemis.tests.util.ServiceTestBase;
  *
  * Created to verify HORNETQ-913 / AS7-4548
  */
-public class NonHATopologyTest extends ServiceTestBase
+public class NonHATopologyTest extends ActiveMQTestBase
 {
 
    @Test

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/328611fd/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/topology/TopologyClusterTestBase.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/topology/TopologyClusterTestBase.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/topology/TopologyClusterTestBase.java
index 54c3734..23d5216 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/topology/TopologyClusterTestBase.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/topology/TopologyClusterTestBase.java
@@ -34,9 +34,8 @@ import org.apache.activemq.artemis.core.server.cluster.ClusterConnection;
 import org.apache.activemq.artemis.core.server.cluster.ClusterManager;
 import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger;
 import org.apache.activemq.artemis.tests.integration.cluster.distribution.ClusterTestBase;
+import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
 import org.apache.activemq.artemis.tests.util.RandomUtil;
-import org.apache.activemq.artemis.tests.util.ServiceTestBase;
-import org.junit.After;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
@@ -113,15 +112,6 @@ public abstract class TopologyClusterTestBase extends ClusterTestBase
       setupCluster();
    }
 
-   @Override
-   @After
-   public void tearDown() throws Exception
-   {
-      stopServers(0, 1, 2, 3, 4);
-
-      super.tearDown();
-   }
-
    /**
     * Check that the actual list of received nodeIDs correspond to the expected order of nodes
     */
@@ -224,7 +214,7 @@ public abstract class TopologyClusterTestBase extends ClusterTestBase
 
          Thread.sleep(10);
       }
-      while (System.currentTimeMillis() - start < ServiceTestBase.WAIT_TIMEOUT);
+      while (System.currentTimeMillis() - start < ActiveMQTestBase.WAIT_TIMEOUT);
 
       log.error(clusterDescription(servers[node]));
       Assert.assertEquals("Timed out waiting for cluster connections for server " + node, expected, nodesCount);
@@ -395,7 +385,7 @@ public abstract class TopologyClusterTestBase extends ClusterTestBase
             s.getConfiguration().setSecurityEnabled(true);
          }
       }
-      Assert.assertEquals(ServiceTestBase.CLUSTER_PASSWORD, config.getClusterPassword());
+      Assert.assertEquals(ActiveMQTestBase.CLUSTER_PASSWORD, config.getClusterPassword());
       config.setClusterPassword(config.getClusterPassword() + "-1-2-3-");
       startServers(0, 1, 2, 4, 3);
       int n = 0;
@@ -411,7 +401,7 @@ public abstract class TopologyClusterTestBase extends ClusterTestBase
       final String address = "foo1235";
       ServerLocator locator = createNonHALocator(isNetty());
       ClientSessionFactory sf = createSessionFactory(locator);
-      ClientSession session = sf.createSession(config.getClusterUser(), ServiceTestBase.CLUSTER_PASSWORD, false, true, true, false, 1);
+      ClientSession session = sf.createSession(config.getClusterUser(), ActiveMQTestBase.CLUSTER_PASSWORD, false, true, true, false, 1);
       session.createQueue(address, address, true);
       ClientProducer producer = session.createProducer(address);
       sendMessages(session, producer, 100);

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/328611fd/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/util/MultiServerTestBase.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/util/MultiServerTestBase.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/util/MultiServerTestBase.java
index 1b20bee..9cb7209 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/util/MultiServerTestBase.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/util/MultiServerTestBase.java
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 package org.apache.activemq.artemis.tests.integration.cluster.util;
-import org.apache.activemq.artemis.tests.util.ServiceTestBase;
+import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
 import org.apache.activemq.artemis.core.config.ha.ReplicaPolicyConfiguration;
 import org.apache.activemq.artemis.core.config.ha.ReplicatedPolicyConfiguration;
 import org.apache.activemq.artemis.core.config.ha.SharedStoreMasterPolicyConfiguration;
@@ -36,7 +36,7 @@ import org.apache.activemq.artemis.core.server.ActiveMQServers;
 import org.apache.activemq.artemis.core.server.NodeManager;
 import org.apache.activemq.artemis.core.server.impl.InVMNodeManager;
 
-public class MultiServerTestBase extends ServiceTestBase
+public class MultiServerTestBase extends ActiveMQTestBase
 {
 
 
@@ -131,7 +131,7 @@ public class MultiServerTestBase extends ServiceTestBase
 
       for (ActiveMQServer server: servers)
       {
-         waitForServer(server);
+         waitForServerToStart(server);
       }
 
       if (backupServers != null)
@@ -143,7 +143,7 @@ public class MultiServerTestBase extends ServiceTestBase
 
          for (ActiveMQServer server: backupServers)
          {
-            waitForServer(server);
+            waitForServerToStart(server);
          }
 
       }
@@ -159,7 +159,7 @@ public class MultiServerTestBase extends ServiceTestBase
       for (int s : serverID)
       {
          servers[s].start();
-         waitForServer(servers[s]);
+         waitForServerToStart(servers[s]);
       }
    }
 
@@ -168,7 +168,7 @@ public class MultiServerTestBase extends ServiceTestBase
       for (int s : serverID)
       {
          backupServers[s].start();
-         waitForServer(backupServers[s]);
+         waitForServerToStart(backupServers[s]);
       }
 
    }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/328611fd/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/discovery/DiscoveryBaseTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/discovery/DiscoveryBaseTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/discovery/DiscoveryBaseTest.java
index 0cc4e4c..993d2ec 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/discovery/DiscoveryBaseTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/discovery/DiscoveryBaseTest.java
@@ -28,7 +28,7 @@ import org.apache.activemq.artemis.api.core.SimpleString;
 import org.apache.activemq.artemis.api.core.TransportConfiguration;
 import org.apache.activemq.artemis.api.core.UDPBroadcastEndpointFactory;
 import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger;
-import org.apache.activemq.artemis.tests.util.ServiceTestBase;
+import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
 import org.apache.activemq.artemis.core.cluster.DiscoveryEntry;
 import org.apache.activemq.artemis.core.cluster.DiscoveryGroup;
 import org.apache.activemq.artemis.core.cluster.DiscoveryListener;
@@ -39,7 +39,7 @@ import org.apache.activemq.artemis.core.server.management.NotificationService;
 import org.apache.activemq.artemis.utils.UUIDGenerator;
 import org.junit.Assert;
 
-public class DiscoveryBaseTest extends ServiceTestBase
+public class DiscoveryBaseTest extends ActiveMQTestBase
 {
    protected static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER;
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/328611fd/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/divert/DivertTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/divert/DivertTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/divert/DivertTest.java
index 7868237..7a6b12f 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/divert/DivertTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/divert/DivertTest.java
@@ -16,9 +16,6 @@
  */
 package org.apache.activemq.artemis.tests.integration.divert;
 
-import java.util.ArrayList;
-import java.util.List;
-
 import org.apache.activemq.artemis.api.core.SimpleString;
 import org.apache.activemq.artemis.api.core.client.ClientConsumer;
 import org.apache.activemq.artemis.api.core.client.ClientMessage;
@@ -32,18 +29,17 @@ import org.apache.activemq.artemis.core.message.impl.MessageImpl;
 import org.apache.activemq.artemis.core.server.ActiveMQServer;
 import org.apache.activemq.artemis.core.server.ActiveMQServers;
 import org.apache.activemq.artemis.core.settings.impl.AddressSettings;
-import org.apache.activemq.artemis.tests.util.ServiceTestBase;
+import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
 import org.junit.Assert;
 import org.junit.Test;
 
-public class DivertTest extends ServiceTestBase
+public class DivertTest extends ActiveMQTestBase
 {
    private static final int TIMEOUT = 500;
 
    @Test
    public void testSingleNonExclusiveDivert() throws Exception
    {
-      Configuration conf = createDefaultConfig();
       final String testAddress = "testAddress";
 
       final String forwardAddress = "forwardAddress";
@@ -54,15 +50,12 @@ public class DivertTest extends ServiceTestBase
          .setAddress(testAddress)
          .setForwardingAddress(forwardAddress);
 
-      List<DivertConfiguration> divertConfs = new ArrayList<DivertConfiguration>();
-
-      divertConfs.add(divertConf);
-
-      conf.setDivertConfigurations(divertConfs);
+      Configuration config = createDefaultInVMConfig()
+              .addDivertConfiguration(divertConf);
 
-      ActiveMQServer messagingService = addServer(ActiveMQServers.newActiveMQServer(conf, false));
+      ActiveMQServer server = addServer(ActiveMQServers.newActiveMQServer(config, false));
 
-      messagingService.start();
+      server.start();
 
       ServerLocator locator = createInVMNonHALocator();
 
@@ -124,31 +117,20 @@ public class DivertTest extends ServiceTestBase
       }
 
       Assert.assertNull(consumer2.receiveImmediate());
-
-      session.close();
-
-      sf.close();
-
-      messagingService.stop();
    }
 
 
    @Test
    public void testSingleDivertWithExpiry() throws Exception
    {
-      Configuration conf = createDefaultConfig();
       final String testAddress = "testAddress";
 
       final String forwardAddress = "forwardAddress";
 
       final String expiryAddress = "expiryAddress";
 
-      conf.getAddressesSettings().clear();
-
-      AddressSettings expirySettings = new AddressSettings();
-      expirySettings.setExpiryAddress(new SimpleString(expiryAddress));
-
-      conf.getAddressesSettings().put("#", expirySettings);
+      AddressSettings expirySettings = new AddressSettings()
+              .setExpiryAddress(new SimpleString(expiryAddress));
 
       DivertConfiguration divertConf = new DivertConfiguration()
          .setName("divert1")
@@ -156,16 +138,14 @@ public class DivertTest extends ServiceTestBase
          .setAddress(testAddress)
          .setForwardingAddress(forwardAddress);
 
-      List<DivertConfiguration> divertConfs = new ArrayList<DivertConfiguration>();
-
-      divertConfs.add(divertConf);
+      Configuration config = createDefaultInVMConfig()
+              .addDivertConfiguration(divertConf)
+              .clearAddressesSettings()
+              .addAddressesSetting("#", expirySettings);
 
-      conf.setDivertConfigurations(divertConfs);
-
-      ActiveMQServer messagingService = addServer(ActiveMQServers.newActiveMQServer(conf, true));
-
-      messagingService.start();
+      ActiveMQServer server = addServer(ActiveMQServers.newActiveMQServer(config, true));
 
+      server.start();
 
       ServerLocator locator = createInVMNonHALocator();
 
@@ -263,18 +243,11 @@ public class DivertTest extends ServiceTestBase
 
       assertEquals(numMessages, countOriginal1);
       assertEquals(numMessages, countOriginal2);
-
-      session.close();
-
-      sf.close();
-
-      messagingService.stop();
    }
 
    @Test
    public void testSingleNonExclusiveDivert2() throws Exception
    {
-      Configuration conf = createDefaultConfig();
       final String testAddress = "testAddress";
 
       final String forwardAddress = "forwardAddress";
@@ -285,15 +258,12 @@ public class DivertTest extends ServiceTestBase
          .setAddress(testAddress)
          .setForwardingAddress(forwardAddress);
 
-      List<DivertConfiguration> divertConfs = new ArrayList<DivertConfiguration>();
-
-      divertConfs.add(divertConf);
+      Configuration config = createDefaultInVMConfig()
+              .addDivertConfiguration(divertConf);
 
-      conf.setDivertConfigurations(divertConfs);
+      ActiveMQServer server = addServer(ActiveMQServers.newActiveMQServer(config, false));
 
-      ActiveMQServer messagingService = addServer(ActiveMQServers.newActiveMQServer(conf, false));
-
-      messagingService.start();
+      server.start();
 
       ServerLocator locator = createInVMNonHALocator();
 
@@ -393,18 +363,11 @@ public class DivertTest extends ServiceTestBase
       }
 
       Assert.assertNull(consumer4.receiveImmediate());
-
-      session.close();
-
-      sf.close();
-
-      messagingService.stop();
    }
 
    @Test
    public void testSingleNonExclusiveDivert3() throws Exception
    {
-      Configuration conf = createDefaultConfig();
       final String testAddress = "testAddress";
 
       final String forwardAddress = "forwardAddress";
@@ -415,15 +378,12 @@ public class DivertTest extends ServiceTestBase
          .setAddress(testAddress)
          .setForwardingAddress(forwardAddress);
 
-      List<DivertConfiguration> divertConfs = new ArrayList<DivertConfiguration>();
-
-      divertConfs.add(divertConf);
-
-      conf.setDivertConfigurations(divertConfs);
+      Configuration config = createDefaultInVMConfig()
+              .addDivertConfiguration(divertConf);
 
-      ActiveMQServer messagingService = addServer(ActiveMQServers.newActiveMQServer(conf, false));
+      ActiveMQServer server = addServer(ActiveMQServers.newActiveMQServer(config, false));
 
-      messagingService.start();
+      server.start();
 
       ServerLocator locator = createInVMNonHALocator();
       ClientSessionFactory sf = createSessionFactory(locator);
@@ -465,18 +425,11 @@ public class DivertTest extends ServiceTestBase
       }
 
       Assert.assertNull(consumer1.receiveImmediate());
-
-      session.close();
-
-      sf.close();
-
-      messagingService.stop();
    }
 
    @Test
    public void testSingleExclusiveDivert() throws Exception
    {
-      Configuration conf = createDefaultConfig();
       final String testAddress = "testAddress";
 
       final String forwardAddress = "forwardAddress";
@@ -488,15 +441,12 @@ public class DivertTest extends ServiceTestBase
          .setForwardingAddress(forwardAddress)
          .setExclusive(true);
 
-      List<DivertConfiguration> divertConfs = new ArrayList<DivertConfiguration>();
-
-      divertConfs.add(divertConf);
+      Configuration config = createDefaultInVMConfig()
+              .addDivertConfiguration(divertConf);
 
-      conf.setDivertConfigurations(divertConfs);
+      ActiveMQServer server = addServer(ActiveMQServers.newActiveMQServer(config, false));
 
-      ActiveMQServer messagingService = addServer(ActiveMQServers.newActiveMQServer(conf, false));
-
-      messagingService.start();
+      server.start();
 
       ServerLocator locator = createInVMNonHALocator();
       ClientSessionFactory sf = createSessionFactory(locator);
@@ -560,19 +510,11 @@ public class DivertTest extends ServiceTestBase
       Assert.assertNull(consumer3.receiveImmediate());
 
       Assert.assertNull(consumer4.receiveImmediate());
-
-      session.close();
-
-      sf.close();
-
-      messagingService.stop();
    }
 
    @Test
    public void testMultipleNonExclusiveDivert() throws Exception
    {
-      Configuration conf = createDefaultConfig();
-
       final String testAddress = "testAddress";
 
       final String forwardAddress1 = "forwardAddress1";
@@ -597,17 +539,14 @@ public class DivertTest extends ServiceTestBase
          .setAddress(testAddress)
          .setForwardingAddress(forwardAddress3);
 
-      List<DivertConfiguration> divertConfs = new ArrayList<DivertConfiguration>();
-
-      divertConfs.add(divertConf1);
-      divertConfs.add(divertConf2);
-      divertConfs.add(divertConf3);
+      Configuration config = createDefaultInVMConfig()
+              .addDivertConfiguration(divertConf1)
+              .addDivertConfiguration(divertConf2)
+              .addDivertConfiguration(divertConf3);
 
-      conf.setDivertConfigurations(divertConfs);
+      ActiveMQServer server = addServer(ActiveMQServers.newActiveMQServer(config, false));
 
-      ActiveMQServer messagingService = addServer(ActiveMQServers.newActiveMQServer(conf, false));
-
-      messagingService.start();
+      server.start();
 
       ServerLocator locator = createInVMNonHALocator();
       ClientSessionFactory sf = createSessionFactory(locator);
@@ -706,18 +645,11 @@ public class DivertTest extends ServiceTestBase
       }
 
       Assert.assertNull(consumer4.receiveImmediate());
-
-      session.close();
-
-      sf.close();
-
-      messagingService.stop();
    }
 
    @Test
    public void testMultipleExclusiveDivert() throws Exception
    {
-      Configuration conf = createDefaultConfig();
       final String testAddress = "testAddress";
 
       final String forwardAddress1 = "forwardAddress1";
@@ -745,19 +677,17 @@ public class DivertTest extends ServiceTestBase
          .setForwardingAddress(forwardAddress3)
          .setExclusive(true);
 
-      List<DivertConfiguration> divertConfs = new ArrayList<DivertConfiguration>();
-
-      divertConfs.add(divertConf1);
-      divertConfs.add(divertConf2);
-      divertConfs.add(divertConf3);
+      Configuration config = createDefaultInVMConfig()
+              .addDivertConfiguration(divertConf1)
+              .addDivertConfiguration(divertConf2)
+              .addDivertConfiguration(divertConf3);
 
-      conf.setDivertConfigurations(divertConfs);
+      ActiveMQServer server = addServer(ActiveMQServers.newActiveMQServer(config, false));
 
-      ActiveMQServer messagingService = addServer(ActiveMQServers.newActiveMQServer(conf, false));
-
-      messagingService.start();
+      server.start();
 
       ServerLocator locator = createInVMNonHALocator();
+
       ClientSessionFactory sf = createSessionFactory(locator);
 
       ClientSession session = sf.createSession(false, true, true);
@@ -843,19 +773,11 @@ public class DivertTest extends ServiceTestBase
       Assert.assertNull(consumer3.receiveImmediate());
 
       Assert.assertNull(consumer4.receiveImmediate());
-
-      session.close();
-
-      sf.close();
-
-      messagingService.stop();
    }
 
    @Test
    public void testMixExclusiveAndNonExclusiveDiverts() throws Exception
    {
-      Configuration conf = createDefaultConfig();
-
       final String testAddress = "testAddress";
 
       final String forwardAddress1 = "forwardAddress1";
@@ -882,17 +804,14 @@ public class DivertTest extends ServiceTestBase
          .setAddress(testAddress)
          .setForwardingAddress(forwardAddress3);
 
-      List<DivertConfiguration> divertConfs = new ArrayList<DivertConfiguration>();
+      Configuration config = createDefaultInVMConfig()
+              .addDivertConfiguration(divertConf1)
+              .addDivertConfiguration(divertConf2)
+              .addDivertConfiguration(divertConf3);
 
-      divertConfs.add(divertConf1);
-      divertConfs.add(divertConf2);
-      divertConfs.add(divertConf3);
+      ActiveMQServer server = addServer(ActiveMQServers.newActiveMQServer(config, false));
 
-      conf.setDivertConfigurations(divertConfs);
-
-      ActiveMQServer messagingService = addServer(ActiveMQServers.newActiveMQServer(conf, false));
-
-      messagingService.start();
+      server.start();
 
       ServerLocator locator = createInVMNonHALocator();
       ClientSessionFactory sf = createSessionFactory(locator);
@@ -969,19 +888,12 @@ public class DivertTest extends ServiceTestBase
       Assert.assertNull(consumer3.receiveImmediate());
 
       Assert.assertNull(consumer4.receiveImmediate());
-
-      session.close();
-
-      sf.close();
-
-      messagingService.stop();
    }
 
    // If no exclusive diverts match then non exclusive ones should be called
    @Test
    public void testSingleExclusiveNonMatchingAndNonExclusiveDiverts() throws Exception
    {
-      Configuration conf = createDefaultConfig();
       final String testAddress = "testAddress";
 
       final String forwardAddress1 = "forwardAddress1";
@@ -1010,19 +922,17 @@ public class DivertTest extends ServiceTestBase
          .setAddress(testAddress)
          .setForwardingAddress(forwardAddress3);
 
-      List<DivertConfiguration> divertConfs = new ArrayList<DivertConfiguration>();
-
-      divertConfs.add(divertConf1);
-      divertConfs.add(divertConf2);
-      divertConfs.add(divertConf3);
+      Configuration config = createDefaultInVMConfig()
+              .addDivertConfiguration(divertConf1)
+              .addDivertConfiguration(divertConf2)
+              .addDivertConfiguration(divertConf3);
 
-      conf.setDivertConfigurations(divertConfs);
+      ActiveMQServer server = addServer(ActiveMQServers.newActiveMQServer(config, false));
 
-      ActiveMQServer messagingService = addServer(ActiveMQServers.newActiveMQServer(conf, false));
-
-      messagingService.start();
+      server.start();
 
       ServerLocator locator = createInVMNonHALocator();
+
       ClientSessionFactory sf = createSessionFactory(locator);
 
       ClientSession session = sf.createSession(false, true, true);
@@ -1151,18 +1061,11 @@ public class DivertTest extends ServiceTestBase
       Assert.assertNull(consumer3.receiveImmediate());
 
       Assert.assertNull(consumer4.receiveImmediate());
-
-      session.close();
-
-      sf.close();
-
-      messagingService.stop();
    }
 
    @Test
    public void testRoundRobinDiverts() throws Exception
    {
-      Configuration conf = createDefaultConfig();
       final String testAddress = "testAddress";
 
       final String forwardAddress1 = "forwardAddress1";
@@ -1187,19 +1090,17 @@ public class DivertTest extends ServiceTestBase
          .setAddress(testAddress)
          .setForwardingAddress(forwardAddress3);
 
-      List<DivertConfiguration> divertConfs = new ArrayList<DivertConfiguration>();
-
-      divertConfs.add(divertConf1);
-      divertConfs.add(divertConf2);
-      divertConfs.add(divertConf3);
+      Configuration config = createDefaultInVMConfig()
+              .addDivertConfiguration(divertConf1)
+              .addDivertConfiguration(divertConf2)
+              .addDivertConfiguration(divertConf3);
 
-      conf.setDivertConfigurations(divertConfs);
+      ActiveMQServer server = addServer(ActiveMQServers.newActiveMQServer(config, false));
 
-      ActiveMQServer messagingService = addServer(ActiveMQServers.newActiveMQServer(conf, false));
-
-      messagingService.start();
+      server.start();
 
       ServerLocator locator = createInVMNonHALocator();
+
       ClientSessionFactory sf = createSessionFactory(locator);
 
       ClientSession session = sf.createSession(false, true, true);
@@ -1304,19 +1205,11 @@ public class DivertTest extends ServiceTestBase
       }
 
       Assert.assertNull(consumer4.receiveImmediate());
-
-      session.close();
-
-      sf.close();
-
-      messagingService.stop();
    }
 
    @Test
    public void testDeployDivertsSameUniqueName() throws Exception
    {
-      Configuration conf = createDefaultConfig();
-
       final String testAddress = "testAddress";
 
       final String forwardAddress1 = "forwardAddress1";
@@ -1341,21 +1234,19 @@ public class DivertTest extends ServiceTestBase
          .setAddress(testAddress)
          .setForwardingAddress(forwardAddress3);
 
-      List<DivertConfiguration> divertConfs = new ArrayList<DivertConfiguration>();
-
-      divertConfs.add(divertConf1);
-      divertConfs.add(divertConf2);
-      divertConfs.add(divertConf3);
-
-      conf.setDivertConfigurations(divertConfs);
+      Configuration config = createDefaultInVMConfig()
+              .addDivertConfiguration(divertConf1)
+              .addDivertConfiguration(divertConf2)
+              .addDivertConfiguration(divertConf3);
 
-      ActiveMQServer messagingService = addServer(ActiveMQServers.newActiveMQServer(conf, false));
+      ActiveMQServer server = addServer(ActiveMQServers.newActiveMQServer(config, false));
 
-      messagingService.start();
+      server.start();
 
       // Only the first and third should be deployed
 
       ServerLocator locator = createInVMNonHALocator();
+
       ClientSessionFactory sf = createSessionFactory(locator);
 
       ClientSession session = sf.createSession(false, true, true);
@@ -1441,12 +1332,6 @@ public class DivertTest extends ServiceTestBase
       }
 
       Assert.assertNull(consumer4.receiveImmediate());
-
-      session.close();
-
-      sf.close();
-
-      messagingService.stop();
    }
 
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/328611fd/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/divert/PersistentDivertTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/divert/PersistentDivertTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/divert/PersistentDivertTest.java
index fa3d076..62a1914 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/divert/PersistentDivertTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/divert/PersistentDivertTest.java
@@ -28,14 +28,11 @@ import org.apache.activemq.artemis.core.config.Configuration;
 import org.apache.activemq.artemis.core.config.DivertConfiguration;
 import org.apache.activemq.artemis.core.server.ActiveMQServer;
 import org.apache.activemq.artemis.core.server.ActiveMQServers;
-import org.apache.activemq.artemis.tests.util.ServiceTestBase;
+import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
 import org.junit.Assert;
 import org.junit.Test;
 
-import java.util.ArrayList;
-import java.util.List;
-
-public class PersistentDivertTest extends ServiceTestBase
+public class PersistentDivertTest extends ActiveMQTestBase
 {
    final int minLargeMessageSize = ActiveMQClient.DEFAULT_MIN_LARGE_MESSAGE_SIZE * 2;
 
@@ -53,8 +50,6 @@ public class PersistentDivertTest extends ServiceTestBase
 
    public void doTestPersistentDivert(final boolean largeMessage) throws Exception
    {
-      Configuration conf = createDefaultConfig();
-
       final String testAddress = "testAddress";
 
       final String forwardAddress1 = "forwardAddress1";
@@ -81,23 +76,19 @@ public class PersistentDivertTest extends ServiceTestBase
          .setAddress(testAddress)
          .setForwardingAddress(forwardAddress3);
 
-      List<DivertConfiguration> divertConfs = new ArrayList<DivertConfiguration>();
-
-      divertConfs.add(divertConf1);
-      divertConfs.add(divertConf2);
-      divertConfs.add(divertConf3);
-
-      conf.setDivertConfigurations(divertConfs);
-
-      ActiveMQServer messagingService = addServer(ActiveMQServers.newActiveMQServer(conf));
+      Configuration config = createDefaultInVMConfig()
+              .addDivertConfiguration(divertConf1)
+              .addDivertConfiguration(divertConf2)
+              .addDivertConfiguration(divertConf3);
 
-      messagingService.start();
+      ActiveMQServer server = addServer(ActiveMQServers.newActiveMQServer(config));
 
-      ServerLocator locator = createInVMNonHALocator();
+      server.start();
 
-      locator.setBlockOnAcknowledge(true);
-      locator.setBlockOnNonDurableSend(true);
-      locator.setBlockOnDurableSend(true);
+      ServerLocator locator = createInVMNonHALocator()
+              .setBlockOnAcknowledge(true)
+              .setBlockOnNonDurableSend(true)
+              .setBlockOnDurableSend(true);
 
       ClientSessionFactory sf = createSessionFactory(locator);
 
@@ -141,7 +132,7 @@ public class PersistentDivertTest extends ServiceTestBase
 
          if (largeMessage)
          {
-            message.setBodyInputStream(ServiceTestBase.createFakeLargeStream(minLargeMessageSize));
+            message.setBodyInputStream(ActiveMQTestBase.createFakeLargeStream(minLargeMessageSize));
          }
 
          message.putIntProperty(propKey, i);
@@ -220,9 +211,6 @@ public class PersistentDivertTest extends ServiceTestBase
       }
 
       Assert.assertNull(consumer4.receiveImmediate());
-      session.close();
-
-      sf.close();
    }
 
    /**
@@ -232,7 +220,7 @@ public class PersistentDivertTest extends ServiceTestBase
    {
       for (int j = 0; j < minLargeMessageSize; j++)
       {
-         Assert.assertEquals(ServiceTestBase.getSamplebyte(j), message.getBodyBuffer().readByte());
+         Assert.assertEquals(ActiveMQTestBase.getSamplebyte(j), message.getBodyBuffer().readByte());
       }
    }
 
@@ -250,8 +238,6 @@ public class PersistentDivertTest extends ServiceTestBase
 
    public void doTestPersistentDivertRestartBeforeConsume(final boolean largeMessage) throws Exception
    {
-      Configuration conf = createDefaultConfig();
-
       final String testAddress = "testAddress";
 
       final String forwardAddress1 = "forwardAddress1";
@@ -278,22 +264,19 @@ public class PersistentDivertTest extends ServiceTestBase
          .setAddress(testAddress)
          .setForwardingAddress(forwardAddress3);
 
-      List<DivertConfiguration> divertConfs = new ArrayList<DivertConfiguration>();
+      Configuration config = createDefaultInVMConfig()
+              .addDivertConfiguration(divertConf1)
+              .addDivertConfiguration(divertConf2)
+              .addDivertConfiguration(divertConf3);
 
-      divertConfs.add(divertConf1);
-      divertConfs.add(divertConf2);
-      divertConfs.add(divertConf3);
+      ActiveMQServer server = addServer(ActiveMQServers.newActiveMQServer(config));
 
-      conf.setDivertConfigurations(divertConfs);
+      server.start();
 
-      ActiveMQServer messagingService = addServer(ActiveMQServers.newActiveMQServer(conf));
-
-      messagingService.start();
-
-      ServerLocator locator = createInVMNonHALocator();
-      locator.setBlockOnAcknowledge(true);
-      locator.setBlockOnNonDurableSend(true);
-      locator.setBlockOnDurableSend(true);
+      ServerLocator locator = createInVMNonHALocator()
+              .setBlockOnAcknowledge(true)
+              .setBlockOnNonDurableSend(true)
+              .setBlockOnDurableSend(true);
 
       ClientSessionFactory sf = createSessionFactory(locator);
 
@@ -329,7 +312,7 @@ public class PersistentDivertTest extends ServiceTestBase
 
          if (largeMessage)
          {
-            message.setBodyInputStream(ServiceTestBase.createFakeLargeStream(minLargeMessageSize));
+            message.setBodyInputStream(ActiveMQTestBase.createFakeLargeStream(minLargeMessageSize));
          }
 
          producer.send(message);
@@ -339,12 +322,14 @@ public class PersistentDivertTest extends ServiceTestBase
 
       sf.close();
 
-      messagingService.stop();
+      server.stop();
 
-      messagingService.start();
+      waitForServerToStop(server);
 
-      ServerLocator locator2 = createInVMNonHALocator();
-      locator2.setBlockOnDurableSend(true);
+      server.start();
+
+      ServerLocator locator2 = createInVMNonHALocator()
+              .setBlockOnDurableSend(true);
 
       sf = createSessionFactory(locator2);
       session = sf.createSession(false, true, true);
@@ -435,12 +420,14 @@ public class PersistentDivertTest extends ServiceTestBase
 
       sf.close();
 
-      messagingService.stop();
+      server.stop();
+
+      waitForServerToStop(server);
 
-      messagingService.start();
+      server.start();
 
-      ServerLocator locator3 = createInVMNonHALocator();
-      locator3.setBlockOnDurableSend(true);
+      ServerLocator locator3 = createInVMNonHALocator()
+              .setBlockOnDurableSend(true);
 
       sf = createSessionFactory(locator3);
 
@@ -461,10 +448,6 @@ public class PersistentDivertTest extends ServiceTestBase
       Assert.assertNull(consumer3.receiveImmediate());
 
       Assert.assertNull(consumer4.receiveImmediate());
-
-      session.close();
-
-      sf.close();
    }
 
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/328611fd/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/embedded/ValidateAIOTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/embedded/ValidateAIOTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/embedded/ValidateAIOTest.java
index afc2129..8131fb6 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/embedded/ValidateAIOTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/embedded/ValidateAIOTest.java
@@ -20,22 +20,21 @@ import org.apache.activemq.artemis.core.config.Configuration;
 import org.apache.activemq.artemis.core.server.ActiveMQServer;
 import org.apache.activemq.artemis.core.server.ActiveMQServers;
 import org.apache.activemq.artemis.core.server.JournalType;
-import org.apache.activemq.artemis.tests.util.ServiceTestBase;
+import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
 import org.junit.Test;
 
 /**
  * Validate if the embedded server will start even with AIO selected
  */
-public class ValidateAIOTest extends ServiceTestBase
+public class ValidateAIOTest extends ActiveMQTestBase
 {
-
    @Test
    public void testValidateAIO() throws Exception
    {
-      Configuration config = createDefaultConfig()
+      Configuration config = createDefaultInVMConfig()
          // This will force AsyncIO
          .setJournalType(JournalType.ASYNCIO);
-      ActiveMQServer server = ActiveMQServers.newActiveMQServer(config, true);
+      ActiveMQServer server = addServer(ActiveMQServers.newActiveMQServer(config, true));
       try
       {
          server.start();
@@ -44,6 +43,5 @@ public class ValidateAIOTest extends ServiceTestBase
       {
          server.stop();
       }
-
    }
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/328611fd/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/http/CoreClientOverHttpTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/http/CoreClientOverHttpTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/http/CoreClientOverHttpTest.java
index 611bcb5..98e7df9 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/http/CoreClientOverHttpTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/http/CoreClientOverHttpTest.java
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 package org.apache.activemq.artemis.tests.integration.http;
-import org.apache.activemq.artemis.tests.util.ServiceTestBase;
+import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
 import org.junit.Before;
 
 import org.junit.Test;
@@ -40,7 +40,7 @@ import org.apache.activemq.artemis.core.server.ActiveMQServer;
 import org.apache.activemq.artemis.core.server.ActiveMQServers;
 import org.apache.activemq.artemis.jms.client.ActiveMQTextMessage;
 
-public class CoreClientOverHttpTest extends ServiceTestBase
+public class CoreClientOverHttpTest extends ActiveMQTestBase
 {
    private static final SimpleString QUEUE = new SimpleString("CoreClientOverHttpTestQueue");
    private Configuration conf;
@@ -55,15 +55,13 @@ public class CoreClientOverHttpTest extends ServiceTestBase
       HashMap<String, Object> params = new HashMap<String, Object>();
       params.put(TransportConstants.HTTP_ENABLED_PROP_NAME, true);
 
-      conf = createDefaultConfig()
-         .setSecurityEnabled(false)
-         .addAcceptorConfiguration(new TransportConfiguration(NETTY_ACCEPTOR_FACTORY));
+      conf = createDefaultInVMConfig()
+              .clearAcceptorConfigurations()
+              .addAcceptorConfiguration(new TransportConfiguration(NETTY_ACCEPTOR_FACTORY, params));
 
       server = addServer(ActiveMQServers.newActiveMQServer(conf, false));
-
       server.start();
-      locator = ActiveMQClient.createServerLocatorWithoutHA(new TransportConfiguration(NETTY_CONNECTOR_FACTORY, params));
-      addServerLocator(locator);
+      locator = addServerLocator(ActiveMQClient.createServerLocatorWithoutHA(new TransportConfiguration(NETTY_CONNECTOR_FACTORY, params)));
    }
 
    @Test

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/328611fd/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/ActiveMQConnectionFactoryTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/ActiveMQConnectionFactoryTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/ActiveMQConnectionFactoryTest.java
index 15d1428..e39e4da 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/ActiveMQConnectionFactoryTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/ActiveMQConnectionFactoryTest.java
@@ -16,7 +16,7 @@
  */
 package org.apache.activemq.artemis.tests.integration.jms;
 import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger;
-import org.apache.activemq.artemis.tests.util.ServiceTestBase;
+import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
 import org.apache.activemq.artemis.core.config.ha.SharedStoreMasterPolicyConfiguration;
 import org.junit.Before;
 
@@ -50,7 +50,7 @@ import org.apache.activemq.artemis.tests.util.RandomUtil;
  *
  * A ActiveMQConnectionFactoryTest
  */
-public class ActiveMQConnectionFactoryTest extends ServiceTestBase
+public class ActiveMQConnectionFactoryTest extends ActiveMQTestBase
 {
    private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER;
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/328611fd/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/FloodServerTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/FloodServerTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/FloodServerTest.java
index 68f93d2..c8cab6c 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/FloodServerTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/FloodServerTest.java
@@ -15,16 +15,23 @@
  * limitations under the License.
  */
 package org.apache.activemq.artemis.tests.integration.jms;
-import org.apache.activemq.artemis.tests.unit.util.InVMNamingContext;
+
+import org.apache.activemq.artemis.api.core.TransportConfiguration;
+import org.apache.activemq.artemis.api.core.client.ActiveMQClient;
+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.netty.NettyConnectorFactory;
+import org.apache.activemq.artemis.core.server.ActiveMQServer;
+import org.apache.activemq.artemis.core.server.ActiveMQServers;
+import org.apache.activemq.artemis.jms.server.impl.JMSServerManagerImpl;
+import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger;
+import org.apache.activemq.artemis.tests.unit.util.InVMNamingContext;
+import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
 import org.junit.Before;
-import org.junit.After;
-
 import org.junit.Test;
 
-import java.util.ArrayList;
-import java.util.List;
-
 import javax.jms.BytesMessage;
 import javax.jms.Connection;
 import javax.jms.ConnectionFactory;
@@ -33,25 +40,14 @@ import javax.jms.Message;
 import javax.jms.MessageConsumer;
 import javax.jms.MessageProducer;
 import javax.jms.Session;
-
-import org.apache.activemq.artemis.api.core.TransportConfiguration;
-import org.apache.activemq.artemis.api.core.client.ActiveMQClient;
-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.remoting.impl.netty.NettyAcceptorFactory;
-import org.apache.activemq.artemis.core.remoting.impl.netty.NettyConnectorFactory;
-import org.apache.activemq.artemis.core.server.ActiveMQServer;
-import org.apache.activemq.artemis.core.server.ActiveMQServers;
-import org.apache.activemq.artemis.jms.server.impl.JMSServerManagerImpl;
-import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger;
-import org.apache.activemq.artemis.tests.util.ServiceTestBase;
+import java.util.ArrayList;
+import java.util.List;
 
 /**
  *
  * A FloodServerTest
  */
-public class FloodServerTest extends ServiceTestBase
+public class FloodServerTest extends ActiveMQTestBase
 {
    // Constants -----------------------------------------------------
 
@@ -85,9 +81,8 @@ public class FloodServerTest extends ServiceTestBase
    {
       super.setUp();
 
-      Configuration conf = createBasicConfig()
-         .addAcceptorConfiguration(new TransportConfiguration(NettyAcceptorFactory.class.getName()));
-      server = ActiveMQServers.newActiveMQServer(conf, false);
+      Configuration config = createDefaultNettyConfig();
+      server = addServer(ActiveMQServers.newActiveMQServer(config, false));
       server.start();
 
       serverManager = new JMSServerManagerImpl(server);
@@ -100,22 +95,6 @@ public class FloodServerTest extends ServiceTestBase
       registerConnectionFactory();
    }
 
-   @Override
-   @After
-   public void tearDown() throws Exception
-   {
-
-      serverManager.stop();
-
-      server.stop();
-
-      server = null;
-
-      serverManager = null;
-
-      super.tearDown();
-   }
-
    // Private -------------------------------------------------------
 
    // Inner classes -------------------------------------------------

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/328611fd/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/ManualReconnectionToSingleServerTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/ManualReconnectionToSingleServerTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/ManualReconnectionToSingleServerTest.java
index cf44121..3c89b2f 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/ManualReconnectionToSingleServerTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/ManualReconnectionToSingleServerTest.java
@@ -15,19 +15,24 @@
  * limitations under the License.
  */
 package org.apache.activemq.artemis.tests.integration.jms;
-import org.apache.activemq.artemis.tests.unit.util.InVMNamingContext;
+
+import org.apache.activemq.artemis.api.core.TransportConfiguration;
 import org.apache.activemq.artemis.core.registry.JndiBindingRegistry;
+import org.apache.activemq.artemis.core.server.ActiveMQServer;
+import org.apache.activemq.artemis.jms.server.JMSServerManager;
+import org.apache.activemq.artemis.jms.server.config.ConnectionFactoryConfiguration;
+import org.apache.activemq.artemis.jms.server.config.JMSConfiguration;
+import org.apache.activemq.artemis.jms.server.config.impl.ConnectionFactoryConfigurationImpl;
+import org.apache.activemq.artemis.jms.server.config.impl.JMSConfigurationImpl;
+import org.apache.activemq.artemis.jms.server.config.impl.JMSQueueConfigurationImpl;
+import org.apache.activemq.artemis.jms.server.impl.JMSServerManagerImpl;
+import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger;
+import org.apache.activemq.artemis.tests.unit.util.InVMNamingContext;
+import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
+import org.junit.Assert;
 import org.junit.Before;
-import org.junit.After;
-
 import org.junit.Test;
 
-import static java.util.concurrent.TimeUnit.SECONDS;
-
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.concurrent.CountDownLatch;
-
 import javax.jms.Connection;
 import javax.jms.ConnectionFactory;
 import javax.jms.Destination;
@@ -40,23 +45,13 @@ import javax.jms.MessageProducer;
 import javax.jms.Queue;
 import javax.jms.Session;
 import javax.naming.Context;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.concurrent.CountDownLatch;
 
-import org.junit.Assert;
-
-import org.apache.activemq.artemis.api.core.TransportConfiguration;
-import org.apache.activemq.artemis.core.config.Configuration;
-import org.apache.activemq.artemis.core.server.ActiveMQServer;
-import org.apache.activemq.artemis.jms.server.JMSServerManager;
-import org.apache.activemq.artemis.jms.server.config.ConnectionFactoryConfiguration;
-import org.apache.activemq.artemis.jms.server.config.JMSConfiguration;
-import org.apache.activemq.artemis.jms.server.config.impl.ConnectionFactoryConfigurationImpl;
-import org.apache.activemq.artemis.jms.server.config.impl.JMSConfigurationImpl;
-import org.apache.activemq.artemis.jms.server.config.impl.JMSQueueConfigurationImpl;
-import org.apache.activemq.artemis.jms.server.impl.JMSServerManagerImpl;
-import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger;
-import org.apache.activemq.artemis.tests.util.ServiceTestBase;
+import static java.util.concurrent.TimeUnit.SECONDS;
 
-public class ManualReconnectionToSingleServerTest extends ServiceTestBase
+public class ManualReconnectionToSingleServerTest extends ActiveMQTestBase
 {
    // Constants -----------------------------------------------------
 
@@ -152,10 +147,7 @@ public class ManualReconnectionToSingleServerTest extends ServiceTestBase
 
       context = new InVMNamingContext();
 
-      Configuration conf = createBasicConfig()
-         .addAcceptorConfiguration(new TransportConfiguration(NETTY_ACCEPTOR_FACTORY));
-
-      server = createServer(false, conf);
+      server = createServer(false, createDefaultNettyConfig());
 
       JMSConfiguration configuration = new JMSConfigurationImpl();
       serverManager = new JMSServerManagerImpl(server, configuration);
@@ -181,26 +173,6 @@ public class ManualReconnectionToSingleServerTest extends ServiceTestBase
       allMessagesReceived = new CountDownLatch(1);
    }
 
-   @Override
-   @After
-   public void tearDown() throws Exception
-   {
-      try
-      {
-         serverManager.stop();
-         serverManager = null;
-         if (connection != null)
-         {
-            connection.close();
-         }
-         connection = null;
-      }
-      finally
-      {
-         super.tearDown();
-      }
-   }
-
    // Private -------------------------------------------------------
 
    // Inner classes -------------------------------------------------

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/328611fd/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/SimpleJNDIClientTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/SimpleJNDIClientTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/SimpleJNDIClientTest.java
index ed0c9bb..3924c8d 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/SimpleJNDIClientTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/SimpleJNDIClientTest.java
@@ -40,7 +40,7 @@ import org.apache.activemq.artemis.api.core.JGroupsPropertiesBroadcastEndpointFa
 import org.apache.activemq.artemis.api.core.TransportConfiguration;
 import org.apache.activemq.artemis.api.core.UDPBroadcastEndpointFactory;
 import org.apache.activemq.artemis.api.jms.JMSFactoryType;
-import org.apache.activemq.artemis.tests.util.ServiceTestBase;
+import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
 import org.apache.activemq.artemis.core.config.Configuration;
 import org.apache.activemq.artemis.core.config.ha.SharedStoreMasterPolicyConfiguration;
 import org.apache.activemq.artemis.core.remoting.impl.netty.TransportConstants;
@@ -56,7 +56,7 @@ import org.junit.Test;
  *
  * A ActiveMQConnectionFactoryTest
  */
-public class SimpleJNDIClientTest extends ServiceTestBase
+public class SimpleJNDIClientTest extends ActiveMQTestBase
 {
    private final String groupAddress = getUDPDiscoveryAddress();
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/328611fd/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/ConnectionTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/ConnectionTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/ConnectionTest.java
index 4249868..1bff609 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/ConnectionTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/ConnectionTest.java
@@ -16,6 +16,11 @@
  */
 package org.apache.activemq.artemis.tests.integration.jms.client;
 
+import org.apache.activemq.artemis.tests.util.JMSTestBase;
+import org.junit.After;
+import org.junit.Assert;
+import org.junit.Test;
+
 import javax.jms.Connection;
 import javax.jms.ConnectionFactory;
 import javax.jms.InvalidClientIDException;
@@ -31,11 +36,6 @@ import java.io.ByteArrayOutputStream;
 import java.io.ObjectInputStream;
 import java.io.ObjectOutputStream;
 
-import org.apache.activemq.artemis.tests.util.JMSTestBase;
-import org.junit.After;
-import org.junit.Assert;
-import org.junit.Test;
-
 public class ConnectionTest extends JMSTestBase
 {
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/328611fd/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/ExpiryMessageTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/ExpiryMessageTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/ExpiryMessageTest.java
index 74a96b4..394bd59 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/ExpiryMessageTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/ExpiryMessageTest.java
@@ -43,16 +43,13 @@ public class ExpiryMessageTest extends JMSTestBase
    @Override
    protected Configuration createDefaultConfig(boolean netty) throws Exception
    {
-      Configuration conf = super.createDefaultConfig(netty)
-         .setMessageExpiryScanPeriod(1000);
-
-      return conf;
+      return super.createDefaultConfig(netty)
+              .setMessageExpiryScanPeriod(1000);
    }
 
    @Test
    public void testSendTopicNoSubscription() throws Exception
    {
-
       Topic topic = createTopic("test-topic");
       TopicControl control = ManagementControlHelper.createTopicControl(topic, mbeanServer);
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/328611fd/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/GroupingTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/GroupingTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/GroupingTest.java
index 41bbc6d..bab0030 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/GroupingTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/GroupingTest.java
@@ -15,28 +15,28 @@
  * limitations under the License.
  */
 package org.apache.activemq.artemis.tests.integration.jms.client;
-import javax.jms.Connection;
-import javax.jms.ConnectionFactory;
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageProducer;
-import javax.jms.Queue;
-import javax.jms.Session;
-import javax.jms.TextMessage;
 
 import org.apache.activemq.artemis.api.core.ActiveMQNotConnectedException;
 import org.apache.activemq.artemis.api.core.SimpleString;
-import org.apache.activemq.artemis.tests.util.JMSTestBase;
 import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
 import org.apache.activemq.artemis.jms.client.ActiveMQMessage;
 import org.apache.activemq.artemis.jms.client.ActiveMQTextMessage;
 import org.apache.activemq.artemis.spi.core.protocol.RemotingConnection;
-import org.junit.After;
+import org.apache.activemq.artemis.tests.util.JMSTestBase;
 import org.junit.Assume;
 import org.junit.Before;
 import org.junit.Test;
 
+import javax.jms.Connection;
+import javax.jms.ConnectionFactory;
+import javax.jms.JMSException;
+import javax.jms.Message;
+import javax.jms.MessageConsumer;
+import javax.jms.MessageProducer;
+import javax.jms.Queue;
+import javax.jms.Session;
+import javax.jms.TextMessage;
+
 /**
  * GroupingTest
  */
@@ -53,15 +53,6 @@ public class GroupingTest extends JMSTestBase
       queue = createQueue("TestQueue");
    }
 
-   @Override
-   @After
-   public void tearDown() throws Exception
-   {
-      jmsServer.destroyQueue("TestQueue");
-
-      super.tearDown();
-   }
-
    protected void setProperty(Message message)
    {
       ((ActiveMQMessage)message).getCoreMessage().putStringProperty(org.apache.activemq.artemis.api.core.Message.HDR_GROUP_ID, new SimpleString("foo"));

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/328611fd/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/PreACKJMSTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/PreACKJMSTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/PreACKJMSTest.java
index 65747b1..51c6295 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/PreACKJMSTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/PreACKJMSTest.java
@@ -16,6 +16,13 @@
  */
 package org.apache.activemq.artemis.tests.integration.jms.client;
 
+import org.apache.activemq.artemis.api.core.TransportConfiguration;
+import org.apache.activemq.artemis.api.core.client.ActiveMQClient;
+import org.apache.activemq.artemis.api.jms.JMSFactoryType;
+import org.apache.activemq.artemis.tests.util.JMSTestBase;
+import org.junit.Before;
+import org.junit.Test;
+
 import javax.jms.MessageConsumer;
 import javax.jms.MessageProducer;
 import javax.jms.Queue;
@@ -24,14 +31,6 @@ import javax.jms.TextMessage;
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.activemq.artemis.api.core.TransportConfiguration;
-import org.apache.activemq.artemis.api.core.client.ActiveMQClient;
-import org.apache.activemq.artemis.api.jms.JMSFactoryType;
-import org.apache.activemq.artemis.tests.util.JMSTestBase;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
 public class PreACKJMSTest extends JMSTestBase
 {
 
@@ -154,14 +153,6 @@ public class PreACKJMSTest extends JMSTestBase
    }
 
    @Override
-   @After
-   public void tearDown() throws Exception
-   {
-      queue = null;
-      super.tearDown();
-   }
-
-   @Override
    protected void createCF(final List<TransportConfiguration> connectorConfigs,
                            final String... jndiBindings) throws Exception
    {

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/328611fd/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/ReSendMessageTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/ReSendMessageTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/ReSendMessageTest.java
index fb6f125..549c7a2 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/ReSendMessageTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/ReSendMessageTest.java
@@ -16,6 +16,16 @@
  */
 package org.apache.activemq.artemis.tests.integration.jms.client;
 
+import org.apache.activemq.artemis.api.core.TransportConfiguration;
+import org.apache.activemq.artemis.api.core.client.ActiveMQClient;
+import org.apache.activemq.artemis.api.jms.ActiveMQJMSConstants;
+import org.apache.activemq.artemis.api.jms.JMSFactoryType;
+import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
+import org.apache.activemq.artemis.tests.util.JMSTestBase;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
 import javax.jms.BytesMessage;
 import javax.jms.MapMessage;
 import javax.jms.Message;
@@ -29,17 +39,6 @@ import java.io.Serializable;
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.activemq.artemis.api.core.TransportConfiguration;
-import org.apache.activemq.artemis.api.core.client.ActiveMQClient;
-import org.apache.activemq.artemis.api.jms.ActiveMQJMSConstants;
-import org.apache.activemq.artemis.api.jms.JMSFactoryType;
-import org.apache.activemq.artemis.tests.util.JMSTestBase;
-import org.apache.activemq.artemis.tests.util.ServiceTestBase;
-import org.junit.After;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-
 /**
  * Receive Messages and resend them, like the bridge would do
  */
@@ -71,7 +70,7 @@ public class ReSendMessageTest extends JMSTestBase
       {
          BytesMessage bm = sess.createBytesMessage();
          bm.setObjectProperty(ActiveMQJMSConstants.JMS_ACTIVEMQ_INPUT_STREAM,
-                              ServiceTestBase.createFakeLargeStream(2 * ActiveMQClient.DEFAULT_MIN_LARGE_MESSAGE_SIZE));
+                              ActiveMQTestBase.createFakeLargeStream(2 * ActiveMQClient.DEFAULT_MIN_LARGE_MESSAGE_SIZE));
          msgs.add(bm);
 
          MapMessage mm = sess.createMapMessage();
@@ -168,7 +167,7 @@ public class ReSendMessageTest extends JMSTestBase
 
             for (int i = 0; i < copiedBytes.getBodyLength(); i++)
             {
-               Assert.assertEquals(ServiceTestBase.getSamplebyte(i), copiedBytes.readByte());
+               Assert.assertEquals(ActiveMQTestBase.getSamplebyte(i), copiedBytes.readByte());
             }
          }
          else if (copiedMessage instanceof MapMessage)
@@ -315,14 +314,6 @@ public class ReSendMessageTest extends JMSTestBase
       queue = createQueue("queue1");
    }
 
-   @Override
-   @After
-   public void tearDown() throws Exception
-   {
-      queue = null;
-      super.tearDown();
-   }
-
    // Private -------------------------------------------------------
 
    // Inner classes -------------------------------------------------

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/328611fd/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/ReceiveNoWaitTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/ReceiveNoWaitTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/ReceiveNoWaitTest.java
index c3557d0..ba50154 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/ReceiveNoWaitTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/ReceiveNoWaitTest.java
@@ -15,10 +15,9 @@
  * limitations under the License.
  */
 package org.apache.activemq.artemis.tests.integration.jms.client;
+
 import org.apache.activemq.artemis.tests.util.JMSTestBase;
 import org.junit.Before;
-import org.junit.After;
-
 import org.junit.Test;
 
 import javax.jms.Connection;
@@ -46,16 +45,6 @@ public class ReceiveNoWaitTest extends JMSTestBase
       queue = createQueue("TestQueue");
    }
 
-   @Override
-   @After
-   public void tearDown() throws Exception
-   {
-      jmsServer.destroyQueue("TestQueue");
-
-      super.tearDown();
-   }
-
-
    /*
     * Test that after sending persistent messages to a queue (these will be sent blocking)
     * that all messages are available for consumption by receiveNoWait()

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/328611fd/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/RemoteConnectionStressTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/RemoteConnectionStressTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/RemoteConnectionStressTest.java
index 801467b..6b6d1ca 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/RemoteConnectionStressTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/RemoteConnectionStressTest.java
@@ -16,36 +16,32 @@
  */
 package org.apache.activemq.artemis.tests.integration.jms.client;
 
-import javax.jms.Connection;
-import javax.jms.MessageProducer;
-import javax.jms.Queue;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-import javax.management.MBeanServer;
-import javax.management.MBeanServerFactory;
-
 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.tests.unit.util.InVMNamingContext;
-import org.apache.activemq.artemis.core.config.Configuration;
 import org.apache.activemq.artemis.core.registry.JndiBindingRegistry;
 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.server.impl.JMSServerManagerImpl;
-import org.apache.activemq.artemis.tests.util.ServiceTestBase;
-import org.junit.After;
+import org.apache.activemq.artemis.tests.unit.util.InVMNamingContext;
+import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
 import org.junit.Before;
 import org.junit.Test;
 
+import javax.jms.Connection;
+import javax.jms.MessageProducer;
+import javax.jms.Queue;
+import javax.jms.Session;
+import javax.jms.TextMessage;
+import javax.management.MBeanServer;
+import javax.management.MBeanServerFactory;
+
 /**
  * test Written to replicate https://issues.jboss.org/browse/HORNETQ-1312
  */
-public class RemoteConnectionStressTest extends ServiceTestBase
+public class RemoteConnectionStressTest extends ActiveMQTestBase
 {
-
-
    ActiveMQServer server;
    MBeanServer mbeanServer;
    JMSServerManagerImpl jmsServer;
@@ -55,12 +51,9 @@ public class RemoteConnectionStressTest extends ServiceTestBase
    {
       super.setUp();
 
-      Configuration conf = ServiceTestBase.createBasicConfigNoDataFolder();
-      conf.getAcceptorConfigurations().add(new TransportConfiguration("org.apache.activemq.artemis.core.remoting.impl.netty.NettyAcceptorFactory"));
-
       mbeanServer = MBeanServerFactory.createMBeanServer();
 
-      server = ActiveMQServers.newActiveMQServer(conf, mbeanServer, false);
+      server = addServer(ActiveMQServers.newActiveMQServer(createDefaultNettyConfig(), mbeanServer, false));
 
       InVMNamingContext namingContext = new InVMNamingContext();
       jmsServer = new JMSServerManagerImpl(server);
@@ -71,14 +64,6 @@ public class RemoteConnectionStressTest extends ServiceTestBase
       jmsServer.createQueue(true, "SomeQueue", null, true, "/jms/SomeQueue");
    }
 
-   @After
-   public void tearDown() throws Exception
-   {
-      jmsServer.stop();
-
-      super.tearDown();
-   }
-
    @Test
    public void testSimpleRemoteConnections() throws Exception
    {

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/328611fd/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/TextMessageTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/TextMessageTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/TextMessageTest.java
index 5d13018..62f5f8e 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/TextMessageTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/TextMessageTest.java
@@ -16,23 +16,22 @@
  */
 package org.apache.activemq.artemis.tests.integration.jms.client;
 
-import javax.jms.MessageConsumer;
-import javax.jms.MessageProducer;
-import javax.jms.Queue;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-import java.util.List;
-
 import org.apache.activemq.artemis.api.core.TransportConfiguration;
 import org.apache.activemq.artemis.api.core.client.ActiveMQClient;
 import org.apache.activemq.artemis.api.jms.JMSFactoryType;
 import org.apache.activemq.artemis.tests.util.JMSTestBase;
 import org.apache.activemq.artemis.tests.util.RandomUtil;
-import org.junit.After;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
 
+import javax.jms.MessageConsumer;
+import javax.jms.MessageProducer;
+import javax.jms.Queue;
+import javax.jms.Session;
+import javax.jms.TextMessage;
+import java.util.List;
+
 public class TextMessageTest extends JMSTestBase
 {
 
@@ -192,14 +191,6 @@ public class TextMessageTest extends JMSTestBase
    }
 
    @Override
-   @After
-   public void tearDown() throws Exception
-   {
-      queue = null;
-      super.tearDown();
-   }
-
-   @Override
    protected void createCF(final List<TransportConfiguration> connectorConfigs,
                            final String... jndiBindings) throws Exception
    {

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/328611fd/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/BindingsClusterTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/BindingsClusterTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/BindingsClusterTest.java
index d6992ec..b576fcd 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/BindingsClusterTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/BindingsClusterTest.java
@@ -139,7 +139,7 @@ public class BindingsClusterTest extends JMSClusteredTestBase
          prod1.send(session1.createTextMessage("m3"));
 
          cf2 = ActiveMQJMSClient.createConnectionFactoryWithoutHA(JMSFactoryType.CF, new TransportConfiguration(InVMConnectorFactory.class.getName(),
-                                                                                                                generateInVMParams(1)));
+                                                                                                                generateInVMParams(2)));
 
          conn2 = cf2.createConnection();
 
@@ -250,7 +250,7 @@ public class BindingsClusterTest extends JMSClusteredTestBase
          prod1.send(session1.createTextMessage("m6"));
 
          cf2 = ActiveMQJMSClient.createConnectionFactoryWithoutHA(JMSFactoryType.CF, new TransportConfiguration(InVMConnectorFactory.class.getName(),
-                                                                                                                generateInVMParams(1)));
+                                                                                                                generateInVMParams(2)));
 
          conn2 = cf2.createConnection();
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/328611fd/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/JMSFailoverListenerTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/JMSFailoverListenerTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/JMSFailoverListenerTest.java
index f2d4726..b618d4d 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/JMSFailoverListenerTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/JMSFailoverListenerTest.java
@@ -16,20 +16,6 @@
  */
 package org.apache.activemq.artemis.tests.integration.jms.cluster;
 
-import javax.jms.BytesMessage;
-import javax.jms.Connection;
-import javax.jms.DeliveryMode;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageProducer;
-import javax.jms.Queue;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
 import org.apache.activemq.artemis.api.core.SimpleString;
 import org.apache.activemq.artemis.api.core.TransportConfiguration;
 import org.apache.activemq.artemis.api.core.client.ClientSession;
@@ -37,12 +23,10 @@ import org.apache.activemq.artemis.api.core.client.FailoverEventListener;
 import org.apache.activemq.artemis.api.core.client.FailoverEventType;
 import org.apache.activemq.artemis.api.jms.ActiveMQJMSClient;
 import org.apache.activemq.artemis.api.jms.JMSFactoryType;
-import org.apache.activemq.artemis.tests.unit.util.InVMNamingContext;
 import org.apache.activemq.artemis.core.config.Configuration;
 import org.apache.activemq.artemis.core.config.ha.SharedStoreMasterPolicyConfiguration;
 import org.apache.activemq.artemis.core.config.ha.SharedStoreSlavePolicyConfiguration;
 import org.apache.activemq.artemis.core.registry.JndiBindingRegistry;
-import org.apache.activemq.artemis.core.remoting.impl.invm.InVMRegistry;
 import org.apache.activemq.artemis.core.remoting.impl.invm.TransportConstants;
 import org.apache.activemq.artemis.core.server.ActiveMQServer;
 import org.apache.activemq.artemis.core.server.NodeManager;
@@ -55,20 +39,34 @@ import org.apache.activemq.artemis.jms.server.JMSServerManager;
 import org.apache.activemq.artemis.jms.server.impl.JMSServerManagerImpl;
 import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger;
 import org.apache.activemq.artemis.tests.integration.jms.server.management.JMSUtil;
+import org.apache.activemq.artemis.tests.unit.util.InVMNamingContext;
+import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
 import org.apache.activemq.artemis.tests.util.InVMNodeManagerServer;
 import org.apache.activemq.artemis.tests.util.RandomUtil;
-import org.apache.activemq.artemis.tests.util.ServiceTestBase;
-import org.junit.After;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
 
+import javax.jms.BytesMessage;
+import javax.jms.Connection;
+import javax.jms.DeliveryMode;
+import javax.jms.MessageConsumer;
+import javax.jms.MessageProducer;
+import javax.jms.Queue;
+import javax.jms.Session;
+import javax.jms.TextMessage;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
 /**
  * A JMSFailoverTest
  * <p/>
  * A simple test to test setFailoverListener when using the JMS API.
  */
-public class JMSFailoverListenerTest extends ServiceTestBase
+public class JMSFailoverListenerTest extends ActiveMQTestBase
 {
    private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER;
 
@@ -84,13 +82,13 @@ public class JMSFailoverListenerTest extends ServiceTestBase
 
    protected Configuration liveConf;
 
-   protected JMSServerManager liveJMSService;
+   protected JMSServerManager liveJMSServer;
 
-   protected ActiveMQServer liveService;
+   protected ActiveMQServer liveServer;
 
-   protected JMSServerManager backupJMSService;
+   protected JMSServerManager backupJMSServer;
 
-   protected ActiveMQServer backupService;
+   protected ActiveMQServer backupServer;
 
    protected Map<String, Object> backupParams = new HashMap<String, Object>();
 
@@ -166,7 +164,7 @@ public class JMSFailoverListenerTest extends ServiceTestBase
 
       Thread.sleep(2000);
 
-      JMSUtil.crash(liveService, ((ActiveMQSession) sess).getCoreSession());
+      JMSUtil.crash(liveServer, ((ActiveMQSession) sess).getCoreSession());
 
       Assert.assertEquals(FailoverEventType.FAILURE_DETECTED, listener.get(0));
       for (int i = 0; i < numMessages; i++)
@@ -237,7 +235,7 @@ public class JMSFailoverListenerTest extends ServiceTestBase
 
       // Note we block on P send to make sure all messages get to server before failover
 
-      JMSUtil.crash(liveService, coreSessionLive);
+      JMSUtil.crash(liveServer, coreSessionLive);
       Assert.assertEquals(FailoverEventType.FAILURE_DETECTED, listener.get(0));
       connLive.close();
 
@@ -294,7 +292,7 @@ public class JMSFailoverListenerTest extends ServiceTestBase
 
       backupParams.put(TransportConstants.SERVER_ID_PROP_NAME, 1);
 
-      backupConf = createBasicConfig(0)
+      backupConf = createBasicConfig()
          .addAcceptorConfiguration(backupAcceptortc)
          .addConnectorConfiguration(livetc.getName(), livetc)
          .addConnectorConfiguration(backuptc.getName(), backuptc)
@@ -309,17 +307,17 @@ public class JMSFailoverListenerTest extends ServiceTestBase
          .setHAPolicyConfiguration(new SharedStoreSlavePolicyConfiguration())
          .addClusterConfiguration(basicClusterConnectionConfig(backuptc.getName(), livetc.getName()));
 
-      backupService = new InVMNodeManagerServer(backupConf, nodeManager);
+      backupServer = addServer(new InVMNodeManagerServer(backupConf, nodeManager));
 
-      backupJMSService = new JMSServerManagerImpl(backupService);
+      backupJMSServer = new JMSServerManagerImpl(backupServer);
 
-      backupJMSService.setRegistry(new JndiBindingRegistry(ctx2));
+      backupJMSServer.setRegistry(new JndiBindingRegistry(ctx2));
 
-      backupJMSService.getActiveMQServer().setIdentity("JMSBackup");
+      backupJMSServer.getActiveMQServer().setIdentity("JMSBackup");
       log.info("Starting backup");
-      backupJMSService.start();
+      backupJMSServer.start();
 
-      liveConf = createBasicConfig(0)
+      liveConf = createBasicConfig()
          .setJournalDirectory(getJournalDir())
          .setBindingsDirectory(getBindingsDir())
          .addAcceptorConfiguration(liveAcceptortc)
@@ -334,45 +332,18 @@ public class JMSFailoverListenerTest extends ServiceTestBase
          .setHAPolicyConfiguration(new SharedStoreMasterPolicyConfiguration())
          .addClusterConfiguration(basicClusterConnectionConfig(livetc.getName()));
 
-      liveService = new InVMNodeManagerServer(liveConf, nodeManager);
+      liveServer = addServer(new InVMNodeManagerServer(liveConf, nodeManager));
 
-      liveJMSService = new JMSServerManagerImpl(liveService);
+      liveJMSServer = new JMSServerManagerImpl(liveServer);
 
-      liveJMSService.setRegistry(new JndiBindingRegistry(ctx1));
+      liveJMSServer.setRegistry(new JndiBindingRegistry(ctx1));
 
-      liveJMSService.getActiveMQServer().setIdentity("JMSLive");
+      liveJMSServer.getActiveMQServer().setIdentity("JMSLive");
       log.info("Starting life");
 
-      liveJMSService.start();
-
-      JMSUtil.waitForServer(backupService);
-   }
-
-   @Override
-   @After
-   public void tearDown() throws Exception
-   {
-      backupJMSService.stop();
-
-      liveJMSService.stop();
-
-      Assert.assertEquals(0, InVMRegistry.instance.size());
-
-      liveService = null;
-
-      liveJMSService = null;
-
-      backupJMSService = null;
-
-      ctx1 = null;
-
-      ctx2 = null;
-
-      backupService = null;
-
-      backupParams = null;
+      liveJMSServer.start();
 
-      super.tearDown();
+      JMSUtil.waitForServer(backupServer);
    }
 
    // Private -------------------------------------------------------


Mime
View raw message