activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clebertsuco...@apache.org
Subject [08/21] activemq-artemis git commit: More test-suite refactoring
Date Thu, 28 May 2015 15:18:59 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/jms/cluster/JMSFailoverTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/JMSFailoverTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/JMSFailoverTest.java
index bdb0126..a9697c8 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/JMSFailoverTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/JMSFailoverTest.java
@@ -16,22 +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.ExceptionListener;
-import javax.jms.JMSException;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageProducer;
-import javax.jms.Queue;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.atomic.AtomicBoolean;
-
 import org.apache.activemq.artemis.api.core.ActiveMQException;
 import org.apache.activemq.artemis.api.core.Interceptor;
 import org.apache.activemq.artemis.api.core.SimpleString;
@@ -39,9 +23,6 @@ import org.apache.activemq.artemis.api.core.TransportConfiguration;
 import org.apache.activemq.artemis.api.core.client.ClientSession;
 import org.apache.activemq.artemis.api.jms.ActiveMQJMSClient;
 import org.apache.activemq.artemis.api.jms.JMSFactoryType;
-import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger;
-import org.apache.activemq.artemis.tests.unit.util.InVMNamingContext;
-import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.apache.activemq.artemis.core.client.impl.ClientSessionInternal;
 import org.apache.activemq.artemis.core.config.Configuration;
 import org.apache.activemq.artemis.core.config.ha.ReplicaPolicyConfiguration;
@@ -51,7 +32,6 @@ import org.apache.activemq.artemis.core.config.ha.SharedStoreSlavePolicyConfigur
 import org.apache.activemq.artemis.core.protocol.core.Packet;
 import org.apache.activemq.artemis.core.protocol.core.impl.wireformat.SessionReceiveContinuationMessage;
 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;
@@ -62,21 +42,39 @@ import org.apache.activemq.artemis.jms.client.ActiveMQSession;
 import org.apache.activemq.artemis.jms.server.JMSServerManager;
 import org.apache.activemq.artemis.jms.server.impl.JMSServerManagerImpl;
 import org.apache.activemq.artemis.spi.core.protocol.RemotingConnection;
+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.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.ExceptionListener;
+import javax.jms.JMSException;
+import javax.jms.MessageConsumer;
+import javax.jms.MessageProducer;
+import javax.jms.Queue;
+import javax.jms.Session;
+import javax.jms.TextMessage;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicBoolean;
+
 /**
  * A JMSFailoverTest
  * <p/>
  * A simple test to test failover when using the JMS API.
  * Most of the failover tests are done on the Core API.
  */
-public class JMSFailoverTest extends ServiceTestBase
+public class JMSFailoverTest extends ActiveMQTestBase
 {
    private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER;
 
@@ -92,13 +90,13 @@ public class JMSFailoverTest 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>();
 
@@ -119,7 +117,7 @@ public class JMSFailoverTest extends ServiceTestBase
    @Test
    public void testCreateQueue() throws Exception
    {
-      liveJMSService.createQueue(true, "queue1", null, true, "/queue/queue1");
+      liveJMSServer.createQueue(true, "queue1", null, true, "/queue/queue1");
       assertNotNull(ctx1.lookup("/queue/queue1"));
 
       ActiveMQConnectionFactory jbcf = ActiveMQJMSClient.createConnectionFactoryWithHA(JMSFactoryType.CF, livetc);
@@ -136,7 +134,7 @@ public class JMSFailoverTest extends ServiceTestBase
 
          ClientSession coreSession = ((ActiveMQSession) sess).getCoreSession();
 
-         JMSUtil.crash(liveService, coreSession);
+         JMSUtil.crash(liveServer, coreSession);
 
          assertNotNull(ctx2.lookup("/queue/queue1"));
       }
@@ -152,7 +150,7 @@ public class JMSFailoverTest extends ServiceTestBase
    @Test
    public void testCreateTopic() throws Exception
    {
-      liveJMSService.createTopic(true, "topic", "/topic/t1");
+      liveJMSServer.createTopic(true, "topic", "/topic/t1");
       assertNotNull(ctx1.lookup("//topic/t1"));
 
       ActiveMQConnectionFactory jbcf = ActiveMQJMSClient.createConnectionFactoryWithHA(JMSFactoryType.CF, livetc);
@@ -169,7 +167,7 @@ public class JMSFailoverTest extends ServiceTestBase
 
          ClientSession coreSession = ((ActiveMQSession) sess).getCoreSession();
 
-         JMSUtil.crash(liveService, coreSession);
+         JMSUtil.crash(liveServer, coreSession);
 
          assertNotNull(ctx2.lookup("/topic/t1"));
       }
@@ -239,7 +237,7 @@ public class JMSFailoverTest extends ServiceTestBase
 
       Thread.sleep(2000);
 
-      JMSUtil.crash(liveService, ((ActiveMQSession) sess).getCoreSession());
+      JMSUtil.crash(liveServer, ((ActiveMQSession) sess).getCoreSession());
 
       for (int i = 0; i < numMessages; i++)
       {
@@ -310,7 +308,7 @@ public class JMSFailoverTest 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);
 
       connLive.close();
 
@@ -408,7 +406,7 @@ public class JMSFailoverTest extends ServiceTestBase
             {
                System.out.println("Killing server...");
 
-               JMSUtil.crash(liveService, coreSession);
+               JMSUtil.crash(liveServer, coreSession);
             }
             catch (Exception e)
             {
@@ -520,7 +518,7 @@ public class JMSFailoverTest 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)
@@ -536,17 +534,17 @@ public class JMSFailoverTest extends ServiceTestBase
          .setHAPolicyConfiguration(sharedStore ? new SharedStoreSlavePolicyConfiguration() : new ReplicaPolicyConfiguration())
          .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())
          .setSecurityEnabled(false)
@@ -562,45 +560,18 @@ public class JMSFailoverTest extends ServiceTestBase
          .setHAPolicyConfiguration(sharedStore ? new SharedStoreMasterPolicyConfiguration() : new ReplicatedPolicyConfiguration())
          .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 -------------------------------------------------------

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/JMSReconnectTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/JMSReconnectTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/JMSReconnectTest.java
index f991245..94fb4c3 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/JMSReconnectTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/JMSReconnectTest.java
@@ -15,12 +15,25 @@
  * limitations under the License.
  */
 package org.apache.activemq.artemis.tests.integration.jms.cluster;
+
 import org.apache.activemq.artemis.api.core.ActiveMQException;
 import org.apache.activemq.artemis.api.core.ActiveMQNotConnectedException;
-import org.apache.activemq.artemis.tests.util.ServiceTestBase;
+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;
+import org.apache.activemq.artemis.api.jms.ActiveMQJMSClient;
+import org.apache.activemq.artemis.api.jms.JMSFactoryType;
+import org.apache.activemq.artemis.core.client.impl.ClientSessionInternal;
+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.ActiveMQSession;
+import org.apache.activemq.artemis.spi.core.protocol.RemotingConnection;
+import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
+import org.apache.activemq.artemis.tests.util.RandomUtil;
+import org.junit.Assert;
 import org.junit.Before;
-import org.junit.After;
-
 import org.junit.Test;
 
 import javax.jms.BytesMessage;
@@ -36,28 +49,10 @@ import javax.jms.Session;
 import javax.jms.TextMessage;
 import javax.jms.Topic;
 
-import org.junit.Assert;
-
-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;
-import org.apache.activemq.artemis.api.jms.ActiveMQJMSClient;
-import org.apache.activemq.artemis.api.jms.JMSFactoryType;
-import org.apache.activemq.artemis.core.client.impl.ClientSessionInternal;
-import org.apache.activemq.artemis.core.config.Configuration;
-import org.apache.activemq.artemis.core.remoting.impl.invm.InVMRegistry;
-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.ActiveMQSession;
-import org.apache.activemq.artemis.spi.core.protocol.RemotingConnection;
-import org.apache.activemq.artemis.tests.util.RandomUtil;
-
-public class JMSReconnectTest extends ServiceTestBase
+public class JMSReconnectTest extends ActiveMQTestBase
 {
 
-   private ActiveMQServer liveService;
+   private ActiveMQServer server;
 
    //In this test we re-attach to the same node without restarting the server
    @Test
@@ -75,7 +70,7 @@ public class JMSReconnectTest extends ServiceTestBase
 
    private void testReconnectOrReattachSameNode(boolean reattach) throws Exception
    {
-      ActiveMQConnectionFactory jbcf = ActiveMQJMSClient.createConnectionFactoryWithoutHA(JMSFactoryType.CF, new TransportConfiguration("org.apache.activemq.artemis.core.remoting.impl.invm.InVMConnectorFactory"));
+      ActiveMQConnectionFactory jbcf = ActiveMQJMSClient.createConnectionFactoryWithoutHA(JMSFactoryType.CF, new TransportConfiguration(INVM_CONNECTOR_FACTORY));
 
       jbcf.setBlockOnDurableSend(true);
       jbcf.setBlockOnNonDurableSend(true);
@@ -179,7 +174,7 @@ public class JMSReconnectTest extends ServiceTestBase
    //Test that non durable JMS sub gets recreated in auto reconnect
    private void testReconnectSameNodeServerRestartedWithNonDurableSubOrTempQueue(final boolean nonDurableSub) throws Exception
    {
-      ActiveMQConnectionFactory jbcf = ActiveMQJMSClient.createConnectionFactoryWithoutHA(JMSFactoryType.CF, new TransportConfiguration("org.apache.activemq.artemis.core.remoting.impl.invm.InVMConnectorFactory"));
+      ActiveMQConnectionFactory jbcf = ActiveMQJMSClient.createConnectionFactoryWithoutHA(JMSFactoryType.CF, new TransportConfiguration(INVM_CONNECTOR_FACTORY));
 
       jbcf.setReconnectAttempts(-1);
 
@@ -211,9 +206,9 @@ public class JMSReconnectTest extends ServiceTestBase
       //Create a non durable subscriber
       MessageConsumer consumer = sess.createConsumer(dest);
 
-      this.liveService.stop();
+      this.server.stop();
 
-      this.liveService.start();
+      this.server.start();
 
       //Allow client some time to reconnect
       Thread.sleep(3000);
@@ -255,7 +250,7 @@ public class JMSReconnectTest extends ServiceTestBase
    @Test
    public void testNoReconnectCloseAfterFailToReconnectWithTopicConsumer() throws Exception
    {
-      ActiveMQConnectionFactory jbcf = ActiveMQJMSClient.createConnectionFactoryWithoutHA(JMSFactoryType.CF, new TransportConfiguration("org.apache.activemq.artemis.core.remoting.impl.invm.InVMConnectorFactory"));
+      ActiveMQConnectionFactory jbcf = ActiveMQJMSClient.createConnectionFactoryWithoutHA(JMSFactoryType.CF, new TransportConfiguration(INVM_CONNECTOR_FACTORY));
 
       jbcf.setReconnectAttempts(0);
 
@@ -274,9 +269,9 @@ public class JMSReconnectTest extends ServiceTestBase
 
       Thread.sleep(2000);
 
-      this.liveService.stop();
+      this.server.stop();
 
-      this.liveService.start();
+      this.server.start();
 
       sess.close();
 
@@ -287,7 +282,7 @@ public class JMSReconnectTest extends ServiceTestBase
    @Test
    public void testNoReconnectCloseAfterFailToReconnectWithTempQueue() throws Exception
    {
-      ActiveMQConnectionFactory jbcf = ActiveMQJMSClient.createConnectionFactoryWithoutHA(JMSFactoryType.CF, new TransportConfiguration("org.apache.activemq.artemis.core.remoting.impl.invm.InVMConnectorFactory"));
+      ActiveMQConnectionFactory jbcf = ActiveMQJMSClient.createConnectionFactoryWithoutHA(JMSFactoryType.CF, new TransportConfiguration(INVM_CONNECTOR_FACTORY));
 
       jbcf.setReconnectAttempts(0);
 
@@ -299,9 +294,9 @@ public class JMSReconnectTest extends ServiceTestBase
 
       Thread.sleep(2000);
 
-      this.liveService.stop();
+      this.server.stop();
 
-      this.liveService.start();
+      this.server.start();
 
       sess.close();
 
@@ -319,30 +314,8 @@ public class JMSReconnectTest extends ServiceTestBase
    {
       super.setUp();
 
-      Configuration liveConf = createBasicConfig()
-         .setJournalType(getDefaultJournalType())
-         .addAcceptorConfiguration(new TransportConfiguration("org.apache.activemq.artemis.core.remoting.impl.invm.InVMAcceptorFactory"))
-         .setBindingsDirectory(getBindingsDir())
-         .setJournalMinFiles(2)
-         .setJournalDirectory(getJournalDir())
-         .setPagingDirectory(getPageDir())
-         .setLargeMessagesDirectory(getLargeMessagesDir());
-
-      liveService = ActiveMQServers.newActiveMQServer(liveConf, true);
-      liveService.start();
-   }
-
-   @Override
-   @After
-   public void tearDown() throws Exception
-   {
-      liveService.stop();
-
-      Assert.assertEquals(0, InVMRegistry.instance.size());
-
-      liveService = null;
-
-      super.tearDown();
+      server = addServer(ActiveMQServers.newActiveMQServer(createDefaultInVMConfig(), true));
+      server.start();
    }
 
    // Private -------------------------------------------------------

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/LargeMessageOverBridgeTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/LargeMessageOverBridgeTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/LargeMessageOverBridgeTest.java
index 5b751f5..14c8438 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/LargeMessageOverBridgeTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/LargeMessageOverBridgeTest.java
@@ -16,18 +16,6 @@
  */
 package org.apache.activemq.artemis.tests.integration.jms.cluster;
 
-import javax.jms.BytesMessage;
-import javax.jms.Connection;
-import javax.jms.MapMessage;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageProducer;
-import javax.jms.Queue;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-
-import java.util.Arrays;
-import java.util.Collection;
-
 import org.apache.activemq.artemis.api.core.TransportConfiguration;
 import org.apache.activemq.artemis.api.jms.ActiveMQJMSClient;
 import org.apache.activemq.artemis.api.jms.JMSFactoryType;
@@ -40,6 +28,17 @@ import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.junit.runners.Parameterized;
 
+import javax.jms.BytesMessage;
+import javax.jms.Connection;
+import javax.jms.MapMessage;
+import javax.jms.MessageConsumer;
+import javax.jms.MessageProducer;
+import javax.jms.Queue;
+import javax.jms.Session;
+import javax.jms.TextMessage;
+import java.util.Arrays;
+import java.util.Collection;
+
 @RunWith(value = Parameterized.class)
 public class LargeMessageOverBridgeTest extends JMSClusteredTestBase
 {
@@ -168,16 +167,6 @@ public class LargeMessageOverBridgeTest extends JMSClusteredTestBase
    }
 
 
-   protected Configuration createConfigServer2()
-   {
-      Configuration config = super.createConfigServer2();
-
-      installHack(config);
-
-      return config;
-   }
-
-
    /**
     * the hack to create the failing condition in certain tests
     *
@@ -194,13 +183,12 @@ public class LargeMessageOverBridgeTest extends JMSClusteredTestBase
       }
    }
 
-   protected Configuration createConfigServer1()
+   protected Configuration createConfigServer(final int source, final int destination) throws Exception
    {
-      Configuration config = super.createConfigServer1();
+      Configuration config = super.createConfigServer(source, destination);
 
       installHack(config);
 
-
       return config;
    }
 
@@ -273,7 +261,7 @@ public class LargeMessageOverBridgeTest extends JMSClusteredTestBase
       Queue queue = (Queue) context1.lookup("queue/Q1");
 
 
-      ActiveMQConnectionFactory cf1 = ActiveMQJMSClient.createConnectionFactoryWithHA(JMSFactoryType.CF, new TransportConfiguration(INVM_CONNECTOR_FACTORY, generateInVMParams(0)));
+      ActiveMQConnectionFactory cf1 = ActiveMQJMSClient.createConnectionFactoryWithHA(JMSFactoryType.CF, new TransportConfiguration(INVM_CONNECTOR_FACTORY, generateInVMParams(1)));
       cf1.setMinLargeMessageSize(200 * 1024);
 
       Connection conn1 = cf1.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/MultipleThreadsOpeningTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/MultipleThreadsOpeningTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/MultipleThreadsOpeningTest.java
index 4c5f9d0..893b747 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/MultipleThreadsOpeningTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/MultipleThreadsOpeningTest.java
@@ -34,7 +34,7 @@ public class MultipleThreadsOpeningTest extends JMSClusteredTestBase
    public void testMultipleOpen() throws Exception
    {
       cf1 = ActiveMQJMSClient.createConnectionFactoryWithHA(JMSFactoryType.CF, new TransportConfiguration(InVMConnectorFactory.class.getName(),
-                                                                                                          generateInVMParams(0)));
+                                                                                                          generateInVMParams(1)));
 
       final int numberOfOpens = 2000;
       int numberOfThreads = 20;

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/ReplicatedJMSFailoverTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/ReplicatedJMSFailoverTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/ReplicatedJMSFailoverTest.java
index 8ff4233..366181f 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/ReplicatedJMSFailoverTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/ReplicatedJMSFailoverTest.java
@@ -45,18 +45,18 @@ public class ReplicatedJMSFailoverTest extends JMSFailoverTest
          .setLargeMessagesDirectory(getLargeMessagesDir(0, true))
          .setHAPolicyConfiguration(new ReplicaPolicyConfiguration());
 
-      backupService = ActiveMQServers.newActiveMQServer(backupConf, true);
+      backupServer = addServer(ActiveMQServers.newActiveMQServer(backupConf, true));
 
-      backupJMSService = new JMSServerManagerImpl(backupService);
+      backupJMSServer = new JMSServerManagerImpl(backupServer);
 
-      backupJMSService.setRegistry(new JndiBindingRegistry(ctx2));
+      backupJMSServer.setRegistry(new JndiBindingRegistry(ctx2));
 
-      backupJMSService.start();
+      backupJMSServer.start();
 
       liveConf = createBasicConfig()
          .setJournalType(getDefaultJournalType())
          .addConnectorConfiguration("toBackup", new TransportConfiguration(INVM_CONNECTOR_FACTORY, backupParams))
-         .addAcceptorConfiguration(new TransportConfiguration("org.apache.activemq.artemis.core.remoting.impl.invm.InVMAcceptorFactory"))
+         .addAcceptorConfiguration(new TransportConfiguration(INVM_ACCEPTOR_FACTORY))
          .setBindingsDirectory(getBindingsDir(0, false))
          .setJournalMinFiles(2)
          .setJournalDirectory(getJournalDir(0, false))
@@ -64,13 +64,13 @@ public class ReplicatedJMSFailoverTest extends JMSFailoverTest
          .setLargeMessagesDirectory(getLargeMessagesDir(0, false))
          .setHAPolicyConfiguration(new ReplicatedPolicyConfiguration());
 
-      liveService = ActiveMQServers.newActiveMQServer(liveConf, true);
+      liveServer = addServer(ActiveMQServers.newActiveMQServer(liveConf, true));
 
-      liveJMSService = new JMSServerManagerImpl(liveService);
+      liveJMSServer = new JMSServerManagerImpl(liveServer);
 
-      liveJMSService.setRegistry(new JndiBindingRegistry(ctx1));
+      liveJMSServer.setRegistry(new JndiBindingRegistry(ctx1));
 
-      liveJMSService.start();
+      liveJMSServer.start();
    }
 
    // Private -------------------------------------------------------

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/TemporaryQueueClusterTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/TemporaryQueueClusterTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/TemporaryQueueClusterTest.java
index 02ae169..cdc6536 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/TemporaryQueueClusterTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/TemporaryQueueClusterTest.java
@@ -15,9 +15,8 @@
  * limitations under the License.
  */
 package org.apache.activemq.artemis.tests.integration.jms.cluster;
-import org.junit.Before;
-import org.junit.After;
 
+import org.apache.activemq.artemis.tests.util.JMSClusteredTestBase;
 import org.junit.Test;
 
 import javax.jms.Connection;
@@ -27,8 +26,6 @@ import javax.jms.Queue;
 import javax.jms.Session;
 import javax.jms.TextMessage;
 
-import org.apache.activemq.artemis.tests.util.JMSClusteredTestBase;
-
 public class TemporaryQueueClusterTest extends JMSClusteredTestBase
 {
 
@@ -42,20 +39,6 @@ public class TemporaryQueueClusterTest extends JMSClusteredTestBase
 
    // Public --------------------------------------------------------
 
-   @After
-   public void tearDown() throws Exception
-   {
-      super.tearDown();
-   }
-
-   @Before
-   public void setUp() throws Exception
-   {
-      super.setUp();
-   }
-
-
-
    @Test
    public void testClusteredQueue() 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/TopicClusterTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/TopicClusterTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/TopicClusterTest.java
index 70ca080..264a338 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/TopicClusterTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/TopicClusterTest.java
@@ -16,6 +16,9 @@
  */
 package org.apache.activemq.artemis.tests.integration.jms.cluster;
 
+import org.apache.activemq.artemis.tests.util.JMSClusteredTestBase;
+import org.junit.Test;
+
 import javax.jms.Connection;
 import javax.jms.DeliveryMode;
 import javax.jms.MessageConsumer;
@@ -24,11 +27,6 @@ import javax.jms.Session;
 import javax.jms.TextMessage;
 import javax.jms.Topic;
 
-import org.apache.activemq.artemis.tests.util.JMSClusteredTestBase;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
 public class TopicClusterTest extends JMSClusteredTestBase
 {
 
@@ -42,20 +40,6 @@ public class TopicClusterTest extends JMSClusteredTestBase
 
    // Public --------------------------------------------------------
 
-
-   @After
-   public void tearDown() throws Exception
-   {
-      super.tearDown();
-   }
-
-
-   @Before
-   public void setUp() throws Exception
-   {
-      super.setUp();
-   }
-
    @Test
    public void testDeleteTopicAfterClusteredSend() 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/connection/CloseConnectionFactoryOnGCest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/connection/CloseConnectionFactoryOnGCest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/connection/CloseConnectionFactoryOnGCest.java
index 3cabc2d..3d0ba1c 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/connection/CloseConnectionFactoryOnGCest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/connection/CloseConnectionFactoryOnGCest.java
@@ -53,7 +53,7 @@ public class CloseConnectionFactoryOnGCest extends JMSTestBase
          for (int i = 0; i < 100; i++)
          {
             ActiveMQConnectionFactory cf = ActiveMQJMSClient.createConnectionFactoryWithoutHA(JMSFactoryType.CF,
-                                                                                              new TransportConfiguration("org.apache.activemq.artemis.core.remoting.impl.invm.InVMConnectorFactory"));
+                                                                                              new TransportConfiguration(INVM_CONNECTOR_FACTORY));
             Connection conn = cf.createConnection();
             cf = null;
             conn.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/jms/connection/CloseConnectionOnGCTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/connection/CloseConnectionOnGCTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/connection/CloseConnectionOnGCTest.java
index a47eb6a..3e49f3a 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/connection/CloseConnectionOnGCTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/connection/CloseConnectionOnGCTest.java
@@ -15,30 +15,26 @@
  * limitations under the License.
  */
 package org.apache.activemq.artemis.tests.integration.jms.connection;
+
+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.remoting.CloseListener;
+import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
+import org.apache.activemq.artemis.spi.core.protocol.RemotingConnection;
+import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
 import org.apache.activemq.artemis.tests.util.JMSTestBase;
-import org.apache.activemq.artemis.tests.util.ServiceTestBase;
+import org.junit.Assert;
 import org.junit.Before;
-import org.junit.After;
-
 import org.junit.Test;
 
+import javax.jms.Connection;
+import javax.jms.Session;
 import java.lang.ref.WeakReference;
 import java.util.Iterator;
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.TimeUnit;
 
-import javax.jms.Connection;
-import javax.jms.Session;
-
-import org.junit.Assert;
-
-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.remoting.CloseListener;
-import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
-import org.apache.activemq.artemis.spi.core.protocol.RemotingConnection;
-
 /**
  *
  * A CloseConnectionOnGCTest
@@ -53,21 +49,11 @@ public class CloseConnectionOnGCTest extends JMSTestBase
    {
       super.setUp();
 
-      cf = ActiveMQJMSClient.createConnectionFactoryWithoutHA(JMSFactoryType.CF, new TransportConfiguration("org.apache.activemq.artemis.core.remoting.impl.invm.InVMConnectorFactory"));
+      cf = ActiveMQJMSClient.createConnectionFactoryWithoutHA(JMSFactoryType.CF, new TransportConfiguration(INVM_CONNECTOR_FACTORY));
       cf.setBlockOnDurableSend(true);
       cf.setPreAcknowledge(true);
    }
 
-   @Override
-   @After
-   public void tearDown() throws Exception
-   {
-      if (cf != null)
-         cf.close();
-
-      super.tearDown();
-   }
-
    @Test
    public void testCloseOneConnectionOnGC() throws Exception
    {
@@ -93,7 +79,7 @@ public class CloseConnectionOnGCTest extends JMSTestBase
 
       conn = null;
 
-      ServiceTestBase.checkWeakReferences(wr);
+      ActiveMQTestBase.checkWeakReferences(wr);
 
       latch.await(5000, TimeUnit.MILLISECONDS);
       Assert.assertEquals(0, server.getRemotingService().getConnections().size());
@@ -130,7 +116,7 @@ public class CloseConnectionOnGCTest extends JMSTestBase
       conn2 = null;
       conn3 = null;
 
-      ServiceTestBase.checkWeakReferences(wr1, wr2, wr3);
+      ActiveMQTestBase.checkWeakReferences(wr1, wr2, wr3);
 
       latch.await(5000, TimeUnit.MILLISECONDS);
 
@@ -174,7 +160,7 @@ public class CloseConnectionOnGCTest extends JMSTestBase
       conn2 = null;
       conn3 = null;
 
-      ServiceTestBase.checkWeakReferences(wr1, wr2, wr3);
+      ActiveMQTestBase.checkWeakReferences(wr1, wr2, wr3);
 
       latch.await(5000, TimeUnit.MILLISECONDS);
 

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/connection/CloseDestroyedConnectionTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/connection/CloseDestroyedConnectionTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/connection/CloseDestroyedConnectionTest.java
index 983a252..5cf9932 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/connection/CloseDestroyedConnectionTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/connection/CloseDestroyedConnectionTest.java
@@ -15,21 +15,10 @@
  * limitations under the License.
  */
 package org.apache.activemq.artemis.tests.integration.jms.connection;
+
 import org.apache.activemq.artemis.api.core.ActiveMQException;
 import org.apache.activemq.artemis.api.core.ActiveMQExceptionType;
 import org.apache.activemq.artemis.api.core.ActiveMQInternalErrorException;
-import org.junit.Before;
-import org.junit.After;
-
-import org.junit.Test;
-
-import javax.jms.Connection;
-import javax.jms.JMSException;
-import javax.jms.Queue;
-import javax.jms.Session;
-
-import org.junit.Assert;
-
 import org.apache.activemq.artemis.api.core.TransportConfiguration;
 import org.apache.activemq.artemis.api.core.client.ClientSession;
 import org.apache.activemq.artemis.api.jms.ActiveMQJMSClient;
@@ -40,6 +29,14 @@ import org.apache.activemq.artemis.jms.client.ActiveMQSession;
 import org.apache.activemq.artemis.jms.client.ActiveMQTemporaryTopic;
 import org.apache.activemq.artemis.spi.core.protocol.RemotingConnection;
 import org.apache.activemq.artemis.tests.util.JMSTestBase;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+import javax.jms.Connection;
+import javax.jms.JMSException;
+import javax.jms.Queue;
+import javax.jms.Session;
 
 public class CloseDestroyedConnectionTest extends JMSTestBase
 {
@@ -61,23 +58,6 @@ public class CloseDestroyedConnectionTest extends JMSTestBase
       cf.setPreAcknowledge(true);
    }
 
-   @Override
-   @After
-   public void tearDown() throws Exception
-   {
-      if (session1 != null)
-         session1.close();
-      if (session2 != null)
-         session2.close();
-      if (conn != null)
-         conn.close();
-      if (conn2 != null)
-         conn2.close();
-      cf = null;
-
-      super.tearDown();
-   }
-
    @Test
    public void testClosingTemporaryTopicDeletesQueue() throws JMSException, ActiveMQException
    {

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/connection/ConcurrentSessionCloseTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/connection/ConcurrentSessionCloseTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/connection/ConcurrentSessionCloseTest.java
index 88cc9e2..df1c8b1 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/connection/ConcurrentSessionCloseTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/connection/ConcurrentSessionCloseTest.java
@@ -15,21 +15,18 @@
  * limitations under the License.
  */
 package org.apache.activemq.artemis.tests.integration.jms.connection;
+
+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.jms.client.ActiveMQConnectionFactory;
 import org.apache.activemq.artemis.tests.util.JMSTestBase;
 import org.junit.Before;
-import org.junit.After;
-
 import org.junit.Test;
 
-import java.util.concurrent.atomic.AtomicBoolean;
-
 import javax.jms.Connection;
 import javax.jms.Session;
-
-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.jms.client.ActiveMQConnectionFactory;
+import java.util.concurrent.atomic.AtomicBoolean;
 
 /**
  *
@@ -45,21 +42,7 @@ public class ConcurrentSessionCloseTest extends JMSTestBase
    {
       super.setUp();
 
-      cf =
-               ActiveMQJMSClient.createConnectionFactoryWithoutHA(JMSFactoryType.CF,
-                                                                  new TransportConfiguration(INVM_CONNECTOR_FACTORY));
-
-   }
-
-   @Override
-   @After
-   public void tearDown() throws Exception
-   {
-      if (cf != null)
-         cf.close();
-      cf = null;
-
-      super.tearDown();
+      cf = ActiveMQJMSClient.createConnectionFactoryWithoutHA(JMSFactoryType.CF, new TransportConfiguration(INVM_CONNECTOR_FACTORY));
    }
 
    // https://jira.jboss.org/browse/HORNETQ-525
@@ -112,8 +95,5 @@ public class ConcurrentSessionCloseTest extends JMSTestBase
 
          assertFalse(failed.get());
       }
-
-      jmsServer.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/jms/connection/ExceptionListenerTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/connection/ExceptionListenerTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/connection/ExceptionListenerTest.java
index 4f4724c..c8ff01e 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/connection/ExceptionListenerTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/connection/ExceptionListenerTest.java
@@ -15,29 +15,13 @@
  * limitations under the License.
  */
 package org.apache.activemq.artemis.tests.integration.jms.connection;
-import org.apache.activemq.artemis.api.core.ActiveMQInternalErrorException;
-import org.apache.activemq.artemis.tests.util.ServiceTestBase;
-import org.apache.activemq.artemis.core.registry.JndiBindingRegistry;
-import org.junit.Before;
-import org.junit.After;
-
-import org.junit.Test;
-
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.TimeUnit;
-
-import javax.jms.Connection;
-import javax.jms.ExceptionListener;
-import javax.jms.JMSException;
-import javax.jms.Session;
-
-import org.junit.Assert;
 
+import org.apache.activemq.artemis.api.core.ActiveMQInternalErrorException;
 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.client.impl.ClientSessionInternal;
-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.ActiveMQConnection;
@@ -45,12 +29,23 @@ import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
 import org.apache.activemq.artemis.jms.client.ActiveMQSession;
 import org.apache.activemq.artemis.jms.server.impl.JMSServerManagerImpl;
 import org.apache.activemq.artemis.tests.integration.jms.server.management.NullInitialContext;
+import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+import javax.jms.Connection;
+import javax.jms.ExceptionListener;
+import javax.jms.JMSException;
+import javax.jms.Session;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
 
 /**
  *
  * A ExceptionListenerTest
  */
-public class ExceptionListenerTest extends ServiceTestBase
+public class ExceptionListenerTest extends ActiveMQTestBase
 {
    private ActiveMQServer server;
 
@@ -66,32 +61,16 @@ public class ExceptionListenerTest extends ServiceTestBase
    {
       super.setUp();
 
-      Configuration conf = createBasicConfig()
-         .addAcceptorConfiguration(new TransportConfiguration("org.apache.activemq.artemis.core.remoting.impl.invm.InVMAcceptorFactory"));
-      server = addServer(ActiveMQServers.newActiveMQServer(conf, false));
+      server = addServer(ActiveMQServers.newActiveMQServer(createDefaultInVMConfig(), false));
       jmsServer = new JMSServerManagerImpl(server);
       jmsServer.setRegistry(new JndiBindingRegistry(new NullInitialContext()));
       jmsServer.start();
       jmsServer.createQueue(false, ExceptionListenerTest.Q_NAME, null, true, ExceptionListenerTest.Q_NAME);
-      cf = ActiveMQJMSClient.createConnectionFactoryWithoutHA(JMSFactoryType.CF, new TransportConfiguration("org.apache.activemq.artemis.core.remoting.impl.invm.InVMConnectorFactory"));
+      cf = ActiveMQJMSClient.createConnectionFactoryWithoutHA(JMSFactoryType.CF, new TransportConfiguration(INVM_CONNECTOR_FACTORY));
       cf.setBlockOnDurableSend(true);
       cf.setPreAcknowledge(true);
    }
 
-   @Override
-   @After
-   public void tearDown() throws Exception
-   {
-      jmsServer.stop();
-      cf = null;
-
-      server = null;
-      jmsServer = null;
-      cf = null;
-
-      super.tearDown();
-   }
-
    private class MyExceptionListener implements ExceptionListener
    {
       volatile int numCalls;

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/connection/InvalidConnectorTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/connection/InvalidConnectorTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/connection/InvalidConnectorTest.java
index 893154c..0ab3aee 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/connection/InvalidConnectorTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/connection/InvalidConnectorTest.java
@@ -15,10 +15,6 @@
  * limitations under the License.
  */
 package org.apache.activemq.artemis.tests.integration.jms.connection;
-import org.junit.Before;
-import org.junit.After;
-
-import org.junit.Test;
 
 import org.apache.activemq.artemis.api.core.TransportConfiguration;
 import org.apache.activemq.artemis.api.core.client.ActiveMQClient;
@@ -26,6 +22,7 @@ import org.apache.activemq.artemis.api.jms.JMSFactoryType;
 import org.apache.activemq.artemis.core.remoting.impl.netty.TransportConstants;
 import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
 import org.apache.activemq.artemis.tests.util.JMSTestBase;
+import org.junit.Test;
 
 import java.net.InetAddress;
 import java.util.ArrayList;
@@ -35,22 +32,6 @@ import java.util.Map;
 
 public class InvalidConnectorTest extends JMSTestBase
 {
-   @Override
-   @Before
-   public void setUp() throws Exception
-   {
-      super.setUp();
-   }
-
-   @Override
-   @After
-   public void tearDown() throws Exception
-   {
-      cf = null;
-
-      super.tearDown();
-   }
-
    @Test
    public void testInvalidConnector() 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/consumer/ConsumerTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/consumer/ConsumerTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/consumer/ConsumerTest.java
index 06632d9..908d6c7 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/consumer/ConsumerTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/consumer/ConsumerTest.java
@@ -16,6 +16,21 @@
  */
 package org.apache.activemq.artemis.tests.integration.jms.consumer;
 
+import org.apache.activemq.artemis.api.core.SimpleString;
+import org.apache.activemq.artemis.api.core.TransportConfiguration;
+import org.apache.activemq.artemis.api.jms.ActiveMQJMSClient;
+import org.apache.activemq.artemis.api.jms.ActiveMQJMSConstants;
+import org.apache.activemq.artemis.api.jms.JMSFactoryType;
+import org.apache.activemq.artemis.core.server.Queue;
+import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
+import org.apache.activemq.artemis.jms.client.ActiveMQDestination;
+import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger;
+import org.apache.activemq.artemis.tests.util.JMSTestBase;
+import org.apache.activemq.artemis.utils.ReusableLatch;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
 import javax.jms.Connection;
 import javax.jms.JMSConsumer;
 import javax.jms.JMSContext;
@@ -28,26 +43,9 @@ import javax.jms.MessageProducer;
 import javax.jms.QueueBrowser;
 import javax.jms.Session;
 import javax.jms.TextMessage;
-
 import java.util.Enumeration;
 import java.util.concurrent.atomic.AtomicInteger;
 
-import org.apache.activemq.artemis.api.core.SimpleString;
-import org.apache.activemq.artemis.api.core.TransportConfiguration;
-import org.apache.activemq.artemis.api.jms.ActiveMQJMSClient;
-import org.apache.activemq.artemis.api.jms.ActiveMQJMSConstants;
-import org.apache.activemq.artemis.api.jms.JMSFactoryType;
-import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger;
-import org.apache.activemq.artemis.tests.util.JMSTestBase;
-import org.apache.activemq.artemis.core.server.Queue;
-import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
-import org.apache.activemq.artemis.jms.client.ActiveMQDestination;
-import org.apache.activemq.artemis.utils.ReusableLatch;
-import org.junit.After;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-
 public class ConsumerTest extends JMSTestBase
 {
    private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER;
@@ -68,24 +66,13 @@ public class ConsumerTest extends JMSTestBase
    {
       super.setUp();
 
-
       topic = ActiveMQJMSClient.createTopic(T_NAME);
       topic2 = ActiveMQJMSClient.createTopic(T2_NAME);
 
-
       jmsServer.createQueue(false, ConsumerTest.Q_NAME, null, true, ConsumerTest.Q_NAME);
       jmsServer.createTopic(true, T_NAME, "/topic/" + T_NAME);
       jmsServer.createTopic(true, T2_NAME, "/topic/" + T2_NAME);
-      cf = ActiveMQJMSClient.createConnectionFactoryWithoutHA(JMSFactoryType.CF, new TransportConfiguration("org.apache.activemq.artemis.core.remoting.impl.invm.InVMConnectorFactory"));
-   }
-
-   @Override
-   @After
-   public void tearDown() throws Exception
-   {
-      cf = null;
-
-      super.tearDown();
+      cf = ActiveMQJMSClient.createConnectionFactoryWithoutHA(JMSFactoryType.CF, new TransportConfiguration(INVM_CONNECTOR_FACTORY));
    }
 
    @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/divert/DivertAndACKClientTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/divert/DivertAndACKClientTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/divert/DivertAndACKClientTest.java
index 5f44531..1bd9556 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/divert/DivertAndACKClientTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/divert/DivertAndACKClientTest.java
@@ -16,26 +16,22 @@
  */
 package org.apache.activemq.artemis.tests.integration.jms.divert;
 
+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.core.config.Configuration;
+import org.apache.activemq.artemis.core.config.DivertConfiguration;
 import org.apache.activemq.artemis.tests.util.JMSTestBase;
+import org.junit.Assert;
 import org.junit.Test;
 
-import java.util.ArrayList;
-import java.util.List;
-
 import javax.jms.Connection;
 import javax.jms.MessageConsumer;
 import javax.jms.MessageProducer;
 import javax.jms.Queue;
 import javax.jms.Session;
 import javax.jms.TextMessage;
-
-import org.junit.Assert;
-
-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.core.config.Configuration;
-import org.apache.activemq.artemis.core.config.DivertConfiguration;
+import java.util.List;
 
 /**
  * A DivertAndACKClientTest
@@ -102,8 +98,6 @@ public class DivertAndACKClientTest extends JMSTestBase
    @Override
    protected Configuration createDefaultConfig(final boolean netty) throws Exception
    {
-      Configuration config = super.createDefaultConfig(netty);
-
       DivertConfiguration divert = new DivertConfiguration()
          .setName("local-divert")
          .setRoutingName("some-name")
@@ -111,10 +105,8 @@ public class DivertAndACKClientTest extends JMSTestBase
          .setForwardingAddress("jms.queue.Dest")
          .setExclusive(true);
 
-      ArrayList<DivertConfiguration> divertList = new ArrayList<DivertConfiguration>();
-      divertList.add(divert);
-
-      config.setDivertConfigurations(divertList);
+      Configuration config = super.createDefaultConfig(netty)
+              .addDivertConfiguration(divert);
 
       return config;
    }

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/largemessage/JMSLargeMessageTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/largemessage/JMSLargeMessageTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/largemessage/JMSLargeMessageTest.java
index 8c63be5..884f266 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/largemessage/JMSLargeMessageTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/largemessage/JMSLargeMessageTest.java
@@ -16,6 +16,13 @@
  */
 package org.apache.activemq.artemis.tests.integration.jms.largemessage;
 
+import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
+import org.apache.activemq.artemis.tests.util.JMSTestBase;
+import org.apache.activemq.artemis.utils.UUIDGenerator;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
 import javax.jms.BytesMessage;
 import javax.jms.JMSException;
 import javax.jms.MessageConsumer;
@@ -30,14 +37,6 @@ import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.atomic.AtomicInteger;
 import java.util.concurrent.atomic.AtomicLong;
 
-import org.apache.activemq.artemis.tests.util.JMSTestBase;
-import org.apache.activemq.artemis.tests.util.ServiceTestBase;
-import org.apache.activemq.artemis.utils.UUIDGenerator;
-import org.junit.After;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-
 public class JMSLargeMessageTest extends JMSTestBase
 {
    // Constants -----------------------------------------------------
@@ -66,14 +65,6 @@ public class JMSLargeMessageTest extends JMSTestBase
       queue1 = createQueue("queue1");
    }
 
-   @Override
-   @After
-   public void tearDown() throws Exception
-   {
-      queue1 = null;
-      super.tearDown();
-   }
-
    @Test
    public void testSimpleLargeMessage() throws Exception
    {
@@ -86,7 +77,7 @@ public class JMSLargeMessageTest extends JMSTestBase
 
       BytesMessage m = session.createBytesMessage();
 
-      m.setObjectProperty("JMS_AMQ_InputStream", ServiceTestBase.createFakeLargeStream(1024 * 1024));
+      m.setObjectProperty("JMS_AMQ_InputStream", ActiveMQTestBase.createFakeLargeStream(1024 * 1024));
 
       prod.send(m);
 
@@ -112,7 +103,7 @@ public class JMSLargeMessageTest extends JMSTestBase
          Assert.assertEquals(1024, numberOfBytes);
          for (int j = 0; j < 1024; j++)
          {
-            Assert.assertEquals(ServiceTestBase.getSamplebyte(i + j), data[j]);
+            Assert.assertEquals(ActiveMQTestBase.getSamplebyte(i + j), data[j]);
          }
       }
 
@@ -130,7 +121,7 @@ public class JMSLargeMessageTest extends JMSTestBase
 
       BytesMessage m = session.createBytesMessage();
 
-      m.setObjectProperty("JMS_AMQ_InputStream", ServiceTestBase.createFakeLargeStream(10));
+      m.setObjectProperty("JMS_AMQ_InputStream", ActiveMQTestBase.createFakeLargeStream(10));
 
       prod.send(m);
 
@@ -154,7 +145,7 @@ public class JMSLargeMessageTest extends JMSTestBase
       Assert.assertEquals(10, numberOfBytes);
       for (int j = 0; j < numberOfBytes; j++)
       {
-         Assert.assertEquals(ServiceTestBase.getSamplebyte(j), data[j]);
+         Assert.assertEquals(ActiveMQTestBase.getSamplebyte(j), data[j]);
       }
 
       Assert.assertNotNull(rm);
@@ -171,7 +162,7 @@ public class JMSLargeMessageTest extends JMSTestBase
 
       try
       {
-         msg.setObjectProperty("JMS_AMQ_InputStream", ServiceTestBase.createFakeLargeStream(10));
+         msg.setObjectProperty("JMS_AMQ_InputStream", ActiveMQTestBase.createFakeLargeStream(10));
          Assert.fail("Exception was expected");
       }
       catch (JMSException e)
@@ -232,7 +223,7 @@ public class JMSLargeMessageTest extends JMSTestBase
 
       BytesMessage m = session.createBytesMessage();
 
-      m.setObjectProperty("JMS_AMQ_InputStream", ServiceTestBase.createFakeLargeStream(msgSize));
+      m.setObjectProperty("JMS_AMQ_InputStream", ActiveMQTestBase.createFakeLargeStream(msgSize));
 
       prod.send(m);
 
@@ -262,7 +253,7 @@ public class JMSLargeMessageTest extends JMSTestBase
          public void write(final int b) throws IOException
          {
             numberOfBytes.incrementAndGet();
-            if (ServiceTestBase.getSamplebyte(position++) != b)
+            if (ActiveMQTestBase.getSamplebyte(position++) != b)
             {
                System.out.println("Wrong byte at position " + position);
                numberOfErrors.incrementAndGet();
@@ -273,7 +264,7 @@ public class JMSLargeMessageTest extends JMSTestBase
 
       try
       {
-         rm.setObjectProperty("JMS_AMQ_InputStream", ServiceTestBase.createFakeLargeStream(100));
+         rm.setObjectProperty("JMS_AMQ_InputStream", ActiveMQTestBase.createFakeLargeStream(100));
          Assert.fail("Exception expected!");
       }
       catch (MessageNotWriteableException expected)
@@ -318,7 +309,7 @@ public class JMSLargeMessageTest extends JMSTestBase
 
       conn.close();
 
-      validateNoFilesOnLargeDir(1);
+      validateNoFilesOnLargeDir(server.getConfiguration().getLargeMessagesDirectory(), 1);
 
       conn = cf.createConnection();
 
@@ -334,7 +325,7 @@ public class JMSLargeMessageTest extends JMSTestBase
       String str = rm.getText();
       Assert.assertEquals(originalString, str);
       conn.close();
-      validateNoFilesOnLargeDir(0);
+      validateNoFilesOnLargeDir(server.getConfiguration().getLargeMessagesDirectory(), 0);
 
    }
 

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/server/JMSServerDeployerTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/JMSServerDeployerTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/JMSServerDeployerTest.java
index 4f31da2..558c161 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/JMSServerDeployerTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/JMSServerDeployerTest.java
@@ -16,28 +16,27 @@
  */
 package org.apache.activemq.artemis.tests.integration.jms.server;
 
-import javax.jms.Queue;
-import javax.jms.Topic;
-import javax.naming.Context;
-
 import org.apache.activemq.artemis.api.core.DiscoveryGroupConfiguration;
 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.unit.util.InVMNamingContext;
-import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 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.jms.server.JMSServerManager;
 import org.apache.activemq.artemis.jms.server.impl.JMSServerManagerImpl;
-import org.junit.After;
+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.Test;
 
-public class JMSServerDeployerTest extends ServiceTestBase
+import javax.jms.Queue;
+import javax.jms.Topic;
+import javax.naming.Context;
+
+public class JMSServerDeployerTest extends ActiveMQTestBase
 {
    // Constants -----------------------------------------------------
 
@@ -138,18 +137,6 @@ public class JMSServerDeployerTest extends ServiceTestBase
       jmsServer.start();
    }
 
-   @Override
-   @After
-   public void tearDown() throws Exception
-   {
-      jmsServer.stop();
-      jmsServer = null;
-      context = null;
-      config = 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/server/JMSServerStartStopTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/JMSServerStartStopTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/JMSServerStartStopTest.java
index 88c67f7..047dc0c 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/JMSServerStartStopTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/JMSServerStartStopTest.java
@@ -16,20 +16,9 @@
  */
 package org.apache.activemq.artemis.tests.integration.jms.server;
 
-import javax.jms.Connection;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageProducer;
-import javax.jms.Queue;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-import java.util.HashSet;
-import java.util.Set;
-
 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.integration.IntegrationTestLogger;
-import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.apache.activemq.artemis.core.config.FileDeploymentManager;
 import org.apache.activemq.artemis.core.config.impl.FileConfiguration;
 import org.apache.activemq.artemis.core.server.ActiveMQServer;
@@ -40,21 +29,51 @@ import org.apache.activemq.artemis.jms.server.config.impl.FileJMSConfiguration;
 import org.apache.activemq.artemis.jms.server.impl.JMSServerManagerImpl;
 import org.apache.activemq.artemis.spi.core.security.ActiveMQSecurityManager;
 import org.apache.activemq.artemis.spi.core.security.ActiveMQSecurityManagerImpl;
-import org.junit.After;
+import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger;
+import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
 import org.junit.Assert;
+import org.junit.Before;
 import org.junit.Test;
 
-public class JMSServerStartStopTest extends ServiceTestBase
+import javax.jms.Connection;
+import javax.jms.MessageConsumer;
+import javax.jms.MessageProducer;
+import javax.jms.Queue;
+import javax.jms.Session;
+import javax.jms.TextMessage;
+import java.util.HashSet;
+import java.util.Set;
+
+public class JMSServerStartStopTest extends ActiveMQTestBase
 {
    private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER;
 
-   private JMSServerManager liveJMSServer;
+   private JMSServerManager jmsServer;
 
    private Connection conn;
 
    private ActiveMQConnectionFactory jbcf;
    private final Set<ActiveMQConnectionFactory> connectionFactories = new HashSet<ActiveMQConnectionFactory>();
 
+   @Override
+   @Before
+   public void setUp() throws Exception
+   {
+      FileConfiguration fc = new FileConfiguration();
+      FileJMSConfiguration fileConfiguration = new FileJMSConfiguration();
+      FileDeploymentManager deploymentManager = new FileDeploymentManager("server-start-stop-config1.xml");
+      deploymentManager.addDeployable(fc);
+      deploymentManager.addDeployable(fileConfiguration);
+      deploymentManager.readConfiguration();
+
+      ActiveMQSecurityManager sm = new ActiveMQSecurityManagerImpl();
+
+      ActiveMQServer server = addServer(new ActiveMQServerImpl(fc, sm));
+
+      jmsServer = new JMSServerManagerImpl(server, fileConfiguration);
+      jmsServer.setRegistry(null);
+   }
+
    @Test
    public void testStopStart1() throws Exception
    {
@@ -64,7 +83,7 @@ public class JMSServerStartStopTest extends ServiceTestBase
       {
          JMSServerStartStopTest.log.info("Iteration " + j);
 
-         start();
+         jmsServer.start();
 
          ActiveMQConnectionFactory jbcf = createConnectionFactory();
 
@@ -90,11 +109,11 @@ public class JMSServerStartStopTest extends ServiceTestBase
 
             jbcf.close();
 
-            stop();
+            jmsServer.stop();
          }
       }
 
-      start();
+      jmsServer.start();
 
       jbcf = createConnectionFactory();
 
@@ -123,15 +142,13 @@ public class JMSServerStartStopTest extends ServiceTestBase
       conn.close();
 
       jbcf.close();
-
-      stop();
    }
 
    // https://jira.jboss.org/jira/browse/HORNETQ-315
    @Test
    public void testCloseConnectionAfterServerIsShutdown() throws Exception
    {
-      start();
+      jmsServer.start();
 
       jbcf = createConnectionFactory();
 
@@ -141,7 +158,7 @@ public class JMSServerStartStopTest extends ServiceTestBase
 
       conn = jbcf.createConnection();
 
-      stop();
+      jmsServer.stop();
       conn.close();
    }
 
@@ -157,60 +174,4 @@ public class JMSServerStartStopTest extends ServiceTestBase
       connectionFactories.add(cf);
       return cf;
    }
-
-   @Override
-   @After
-   public void tearDown() throws Exception
-   {
-      if (conn != null)
-         conn.close();
-      if (jbcf != null)
-         jbcf.close();
-      for (ActiveMQConnectionFactory cf : connectionFactories)
-      {
-         try
-         {
-            cf.close();
-         }
-         catch (Exception ignored)
-         {
-            // no-op
-         }
-      }
-      connectionFactories.clear();
-      if (liveJMSServer != null)
-         liveJMSServer.stop();
-      liveJMSServer = null;
-      super.tearDown();
-   }
-
-   // Private -------------------------------------------------------
-
-   private void stop() throws Exception
-   {
-      liveJMSServer.stop();
-   }
-
-   private void start() throws Exception
-   {
-      FileConfiguration fc = new FileConfiguration();
-      FileJMSConfiguration fileConfiguration = new FileJMSConfiguration();
-      FileDeploymentManager deploymentManager = new FileDeploymentManager("server-start-stop-config1.xml");
-      deploymentManager.addDeployable(fc);
-      deploymentManager.addDeployable(fileConfiguration);
-      deploymentManager.readConfiguration();
-
-      ActiveMQSecurityManager sm = new ActiveMQSecurityManagerImpl();
-
-      ActiveMQServer liveServer = addServer(new ActiveMQServerImpl(fc, sm));
-
-      liveJMSServer = new JMSServerManagerImpl(liveServer, fileConfiguration);
-      addActiveMQComponent(liveJMSServer);
-      liveJMSServer.setRegistry(null);
-
-      liveJMSServer.start();
-   }
-
-   // 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/server/config/JMSConfigurationTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/config/JMSConfigurationTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/config/JMSConfigurationTest.java
index 048e710..ac72ded 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/config/JMSConfigurationTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/config/JMSConfigurationTest.java
@@ -16,24 +16,8 @@
  */
 package org.apache.activemq.artemis.tests.integration.jms.server.config;
 
-import org.apache.activemq.artemis.tests.unit.util.InVMNamingContext;
-import org.apache.activemq.artemis.tests.util.ServiceTestBase;
-import org.apache.activemq.artemis.core.registry.JndiBindingRegistry;
-import org.junit.Test;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.jms.Connection;
-import javax.jms.ConnectionFactory;
-import javax.jms.Queue;
-import javax.jms.Topic;
-import javax.naming.Context;
-
-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.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.impl.ActiveMQServerImpl;
@@ -46,18 +30,28 @@ 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.config.impl.TopicConfigurationImpl;
 import org.apache.activemq.artemis.jms.server.impl.JMSServerManagerImpl;
+import org.apache.activemq.artemis.tests.unit.util.InVMNamingContext;
+import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
 import org.apache.activemq.artemis.tests.util.RandomUtil;
+import org.junit.Assert;
+import org.junit.Test;
 
-public class JMSConfigurationTest extends ServiceTestBase
-{
+import javax.jms.Connection;
+import javax.jms.ConnectionFactory;
+import javax.jms.Queue;
+import javax.jms.Topic;
+import javax.naming.Context;
+import java.util.ArrayList;
+import java.util.List;
 
+public class JMSConfigurationTest extends ActiveMQTestBase
+{
    @Test
    public void testSetupJMSConfiguration() throws Exception
    {
       Context context = new InVMNamingContext();
 
-      Configuration coreConfiguration = createDefaultConfig();
-      ActiveMQServer coreServer = new ActiveMQServerImpl(coreConfiguration);
+      ActiveMQServer coreServer = new ActiveMQServerImpl(createDefaultInVMConfig());
 
       JMSConfiguration jmsConfiguration = new JMSConfigurationImpl();
       TransportConfiguration connectorConfig = new TransportConfiguration(InVMConnectorFactory.class.getName());

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/server/config/JMSServerConfigParserTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/config/JMSServerConfigParserTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/config/JMSServerConfigParserTest.java
index 1e95872..f4ed48d 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/config/JMSServerConfigParserTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/config/JMSServerConfigParserTest.java
@@ -24,9 +24,9 @@ import org.apache.activemq.artemis.api.core.TransportConfiguration;
 import org.apache.activemq.artemis.core.config.Configuration;
 import org.apache.activemq.artemis.jms.server.config.JMSQueueConfiguration;
 import org.apache.activemq.artemis.jms.server.config.TopicConfiguration;
-import org.apache.activemq.artemis.tests.util.ServiceTestBase;
+import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
 
-public class JMSServerConfigParserTest extends ServiceTestBase
+public class JMSServerConfigParserTest extends ActiveMQTestBase
 {
 
    // Constants -----------------------------------------------------
@@ -43,7 +43,7 @@ public class JMSServerConfigParserTest extends ServiceTestBase
    @Test
    public void testParsing() throws Exception
    {
-      Configuration config = createDefaultConfig()
+      Configuration config = createDefaultInVMConfig()
          // anything so the parsing will work
          .addConnectorConfiguration("netty", new TransportConfiguration());
 

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/server/management/ConnectionFactoryControlTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/management/ConnectionFactoryControlTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/management/ConnectionFactoryControlTest.java
index d810dbf..a004bb3 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/management/ConnectionFactoryControlTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/management/ConnectionFactoryControlTest.java
@@ -23,11 +23,9 @@ import javax.management.Notification;
 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.tests.util.ServiceTestBase;
 import org.apache.activemq.artemis.core.registry.JndiBindingRegistry;
 import org.junit.Assert;
 import org.junit.Before;
-import org.junit.After;
 import org.junit.Test;
 import org.apache.activemq.artemis.api.core.TransportConfiguration;
 import org.apache.activemq.artemis.api.core.management.ObjectNameBuilder;
@@ -53,7 +51,7 @@ public class ConnectionFactoryControlTest extends ManagementTestBase
 
    private ActiveMQServer server;
 
-   private JMSServerManagerImpl serverManager;
+   private JMSServerManagerImpl jmsServerManager;
 
    private InVMNamingContext ctx;
 
@@ -80,9 +78,9 @@ public class ConnectionFactoryControlTest extends ManagementTestBase
       cf = (ActiveMQConnectionFactory)ctx.lookup("test");
       Assert.assertTrue(cf.isCompressLargeMessage());
 
-      stopServer();
+      server.stop();
 
-      Thread.sleep(500);
+      waitForServerToStop(server);
 
       startServer();
 
@@ -102,18 +100,18 @@ public class ConnectionFactoryControlTest extends ManagementTestBase
       List<String> connectors = new ArrayList<String>();
       connectors.add("invm");
 
-      this.serverManager.createConnectionFactory("NewCF",
-                                                  false,
-                                                  JMSFactoryType.CF,
-                                                  connectors,
-                                                  "/NewConnectionFactory");
+      this.jmsServerManager.createConnectionFactory("NewCF",
+                                                 false,
+                                                 JMSFactoryType.CF,
+                                                 connectors,
+                                                 "/NewConnectionFactory");
 
       Notification notif = listener.getNotification();
 
       Assert.assertEquals(JMSNotificationType.CONNECTION_FACTORY_CREATED.toString(), notif.getType());
       Assert.assertEquals("NewCF", notif.getMessage());
 
-      this.serverManager.destroyConnectionFactory("NewCF");
+      this.jmsServerManager.destroyConnectionFactory("NewCF");
 
       notif = listener.getNotification();
       Assert.assertEquals(JMSNotificationType.CONNECTION_FACTORY_DESTROYED.toString(), notif.getType());
@@ -155,44 +153,19 @@ public class ConnectionFactoryControlTest extends ManagementTestBase
     */
    protected void startServer() throws Exception
    {
-      Configuration conf = createDefaultConfig()
+      Configuration config = createDefaultInVMConfig()
          .addConnectorConfiguration("invm", new TransportConfiguration(INVM_CONNECTOR_FACTORY))
-         .setSecurityEnabled(false)
-         .setJMXManagementEnabled(true)
-         .addAcceptorConfiguration(new TransportConfiguration(ServiceTestBase.INVM_ACCEPTOR_FACTORY));
-      server = ActiveMQServers.newActiveMQServer(conf, mbeanServer, true);
+         .setJMXManagementEnabled(true);
+      server = addServer(ActiveMQServers.newActiveMQServer(config, mbeanServer, true));
       server.start();
 
-      serverManager = new JMSServerManagerImpl(server);
-      serverManager.start();
+      jmsServerManager = new JMSServerManagerImpl(server);
+      jmsServerManager.start();
 
       ctx = new InVMNamingContext();
 
-      serverManager.setRegistry(new JndiBindingRegistry(ctx));
-      serverManager.activated();
-   }
-
-   @Override
-   @After
-   public void tearDown() throws Exception
-   {
-      stopServer();
-
-      super.tearDown();
-   }
-
-   /**
-    * @throws Exception
-    */
-   protected void stopServer() throws Exception
-   {
-      serverManager.stop();
-
-      server.stop();
-
-      serverManager = null;
-
-      server = null;
+      jmsServerManager.setRegistry(new JndiBindingRegistry(ctx));
+      jmsServerManager.activated();
    }
 
    protected ConnectionFactoryControl createCFControl(String name) 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/server/management/JMSQueueControlTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/management/JMSQueueControlTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/management/JMSQueueControlTest.java
index 6e61753..ed6c645 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/management/JMSQueueControlTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/management/JMSQueueControlTest.java
@@ -16,21 +16,6 @@
  */
 package org.apache.activemq.artemis.tests.integration.jms.server.management;
 
-import javax.jms.Connection;
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageProducer;
-import javax.jms.Session;
-import javax.management.Notification;
-import javax.naming.Context;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-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.core.client.ClientConsumer;
@@ -44,7 +29,6 @@ import org.apache.activemq.artemis.api.jms.ActiveMQJMSClient;
 import org.apache.activemq.artemis.api.jms.JMSFactoryType;
 import org.apache.activemq.artemis.api.jms.management.JMSQueueControl;
 import org.apache.activemq.artemis.api.jms.management.JMSServerControl;
-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.remoting.impl.invm.InVMConnectorFactory;
@@ -59,14 +43,28 @@ 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.tests.util.RandomUtil;
 import org.apache.activemq.artemis.utils.UUIDGenerator;
 import org.apache.activemq.artemis.utils.json.JSONArray;
-import org.junit.After;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
 
+import javax.jms.Connection;
+import javax.jms.JMSException;
+import javax.jms.Message;
+import javax.jms.MessageConsumer;
+import javax.jms.MessageProducer;
+import javax.jms.Session;
+import javax.management.Notification;
+import javax.naming.Context;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
 /**
  * A QueueControlTest
  * <p/>
@@ -486,8 +484,7 @@ public class JMSQueueControlTest extends ManagementTestBase
 
       Assert.assertNull(queueControl.getExpiryAddress());
 
-      AddressSettings addressSettings = new AddressSettings();
-      addressSettings.setExpiryAddress(new SimpleString(expiryAddress));
+      AddressSettings addressSettings = new AddressSettings().setExpiryAddress(new SimpleString(expiryAddress));
       server.getAddressSettingsRepository().addMatch(queue.getAddress(), addressSettings);
 
       Assert.assertEquals(expiryAddress, queueControl.getExpiryAddress());
@@ -520,8 +517,7 @@ public class JMSQueueControlTest extends ManagementTestBase
       ActiveMQQueue expiryQueue = (ActiveMQQueue) ActiveMQJMSClient.createQueue(expiryQueueName);
       serverManager.createQueue(false, expiryQueueName, null, true, expiryQueueName);
 
-      AddressSettings addressSettings = new AddressSettings();
-      addressSettings.setExpiryAddress(new SimpleString(expiryQueue.getAddress()));
+      AddressSettings addressSettings = new AddressSettings().setExpiryAddress(new SimpleString(expiryQueue.getAddress()));
       server.getAddressSettingsRepository().addMatch(queue.getAddress(), addressSettings);
 //      queueControl.setExpiryAddress(expiryQueue.getAddress());
 
@@ -649,8 +645,7 @@ public class JMSQueueControlTest extends ManagementTestBase
 
       Assert.assertNull(queueControl.getDeadLetterAddress());
 
-      AddressSettings addressSettings = new AddressSettings();
-      addressSettings.setDeadLetterAddress(new SimpleString(deadLetterAddress));
+      AddressSettings addressSettings = new AddressSettings().setDeadLetterAddress(new SimpleString(deadLetterAddress));
       server.getAddressSettingsRepository().addMatch(queue.getAddress(), addressSettings);
 
       Assert.assertEquals(deadLetterAddress, queueControl.getDeadLetterAddress());
@@ -663,8 +658,7 @@ public class JMSQueueControlTest extends ManagementTestBase
       serverManager.createQueue(false, deadLetterQueue, null, true, deadLetterQueue);
       ActiveMQQueue dlq = (ActiveMQQueue) ActiveMQJMSClient.createQueue(deadLetterQueue);
 
-      AddressSettings addressSettings = new AddressSettings();
-      addressSettings.setDeadLetterAddress(new SimpleString(dlq.getAddress()));
+      AddressSettings addressSettings = new AddressSettings().setDeadLetterAddress(new SimpleString(dlq.getAddress()));
       server.getAddressSettingsRepository().addMatch(queue.getAddress(), addressSettings);
 
       Connection conn = createConnection();
@@ -730,8 +724,7 @@ public class JMSQueueControlTest extends ManagementTestBase
       serverManager.createQueue(false, deadLetterQueue, null, true, deadLetterQueue);
       ActiveMQQueue dlq = (ActiveMQQueue) ActiveMQJMSClient.createQueue(deadLetterQueue);
 
-      AddressSettings addressSettings = new AddressSettings();
-      addressSettings.setDeadLetterAddress(new SimpleString(dlq.getAddress()));
+      AddressSettings addressSettings = new AddressSettings().setDeadLetterAddress(new SimpleString(dlq.getAddress()));
       server.getAddressSettingsRepository().addMatch(queue.getAddress(), addressSettings);
 
       Connection conn = createConnection();
@@ -1137,10 +1130,10 @@ public class JMSQueueControlTest extends ManagementTestBase
    @Test
    public void testDeleteWithPaging() throws Exception
    {
-      AddressSettings pagedSetting = new AddressSettings();
-      pagedSetting.setAddressFullMessagePolicy(AddressFullMessagePolicy.PAGE);
-      pagedSetting.setPageSizeBytes(10 * 1024);
-      pagedSetting.setMaxSizeBytes(100 * 1024);
+      AddressSettings pagedSetting = new AddressSettings()
+              .setAddressFullMessagePolicy(AddressFullMessagePolicy.PAGE)
+              .setPageSizeBytes(10 * 1024)
+              .setMaxSizeBytes(100 * 1024);
       server.getAddressSettingsRepository().addMatch("#", pagedSetting);
 
       serverManager.createQueue(true, "pagedTest", null, true, "/queue/pagedTest");
@@ -1186,10 +1179,10 @@ public class JMSQueueControlTest extends ManagementTestBase
    @Test
    public void testDeleteWithPagingAndFilter() throws Exception
    {
-      AddressSettings pagedSetting = new AddressSettings();
-      pagedSetting.setAddressFullMessagePolicy(AddressFullMessagePolicy.PAGE);
-      pagedSetting.setPageSizeBytes(10 * 1024);
-      pagedSetting.setMaxSizeBytes(100 * 1024);
+      AddressSettings pagedSetting = new AddressSettings()
+              .setAddressFullMessagePolicy(AddressFullMessagePolicy.PAGE)
+              .setPageSizeBytes(10 * 1024)
+              .setMaxSizeBytes(100 * 1024);
       server.getAddressSettingsRepository().addMatch("#", pagedSetting);
 
       serverManager.createQueue(true, "pagedTest", null, true, "/queue/pagedTest");
@@ -1386,9 +1379,9 @@ public class JMSQueueControlTest extends ManagementTestBase
    {
       super.setUp();
 
-      Configuration conf = createBasicConfig()
-         .addAcceptorConfiguration(new TransportConfiguration(INVM_ACCEPTOR_FACTORY));
-      server = createServer(this.getName().contains("WithRealData"), conf);
+      Configuration config = createDefaultInVMConfig()
+              .setJMXManagementEnabled(true);
+      server = createServer(this.getName().contains("WithRealData"), config);
       server.setMBeanServer(mbeanServer);
 
       serverManager = new JMSServerManagerImpl(server);
@@ -1402,24 +1395,6 @@ public class JMSQueueControlTest extends ManagementTestBase
       queue = (ActiveMQQueue) ActiveMQJMSClient.createQueue(queueName);
    }
 
-   @Override
-   @After
-   public void tearDown() throws Exception
-   {
-      stopComponent(serverManager);
-      serverManager = null;
-
-      server = null;
-
-      queue = null;
-
-      context.close();
-
-      context = null;
-
-      super.tearDown();
-   }
-
    protected JMSQueueControl createManagementControl() throws Exception
    {
       return createManagementControl(queue);


Mime
View raw message