activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clebertsuco...@apache.org
Subject [14/21] activemq-artemis git commit: More test-suite refactoring
Date Thu, 28 May 2015 15:19:05 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/client/FailureDeadlockTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/FailureDeadlockTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/FailureDeadlockTest.java
index eef85eb..b022750 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/FailureDeadlockTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/FailureDeadlockTest.java
@@ -15,15 +15,23 @@
  * limitations under the License.
  */
 package org.apache.activemq.artemis.tests.integration.client;
+
 import org.apache.activemq.artemis.api.core.ActiveMQNotConnectedException;
+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.registry.JndiBindingRegistry;
+import org.apache.activemq.artemis.core.server.ActiveMQServer;
+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.spi.core.protocol.RemotingConnection;
 import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger;
 import org.apache.activemq.artemis.tests.integration.jms.server.management.NullInitialContext;
-import org.apache.activemq.artemis.tests.util.ServiceTestBase;
-import org.apache.activemq.artemis.core.registry.JndiBindingRegistry;
+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 javax.jms.Connection;
@@ -31,18 +39,7 @@ import javax.jms.ExceptionListener;
 import javax.jms.JMSException;
 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.core.client.impl.ClientSessionInternal;
-import org.apache.activemq.artemis.core.config.Configuration;
-import org.apache.activemq.artemis.core.server.ActiveMQServer;
-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.spi.core.protocol.RemotingConnection;
-
-public class FailureDeadlockTest extends ServiceTestBase
+public class FailureDeadlockTest extends ActiveMQTestBase
 {
    private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER;
 
@@ -59,38 +56,13 @@ public class FailureDeadlockTest extends ServiceTestBase
    public void setUp() throws Exception
    {
       super.setUp();
-
-      Configuration conf = createDefaultConfig()
-         .setSecurityEnabled(false)
-         .addAcceptorConfiguration(new TransportConfiguration(INVM_ACCEPTOR_FACTORY));
-      server = createServer(false, conf);
+      server = createServer(false, createDefaultInVMConfig());
       jmsServer = new JMSServerManagerImpl(server);
       jmsServer.setRegistry(new JndiBindingRegistry(new NullInitialContext()));
       jmsServer.start();
 
-      cf1 =
-               ActiveMQJMSClient.createConnectionFactoryWithoutHA(JMSFactoryType.CF,
-                                                                  new TransportConfiguration(INVM_CONNECTOR_FACTORY));
-      cf2 =
-               ActiveMQJMSClient.createConnectionFactoryWithoutHA(JMSFactoryType.CF,
-                                                                  new TransportConfiguration(INVM_CONNECTOR_FACTORY));
-   }
-
-   @Override
-   @After
-   public void tearDown() throws Exception
-   {
-
-      cf1.close();
-
-      cf2.close();
-
-      if (jmsServer != null && jmsServer.isStarted())
-      {
-         jmsServer.stop();
-      }
-
-      super.tearDown();
+      cf1 = ActiveMQJMSClient.createConnectionFactoryWithoutHA(JMSFactoryType.CF, new TransportConfiguration(INVM_CONNECTOR_FACTORY));
+      cf2 = ActiveMQJMSClient.createConnectionFactoryWithoutHA(JMSFactoryType.CF, new TransportConfiguration(INVM_CONNECTOR_FACTORY));
    }
 
    // https://jira.jboss.org/jira/browse/JBMESSAGING-1702

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/328611fd/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/HangConsumerTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/HangConsumerTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/HangConsumerTest.java
index dbac194..7967d06 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/HangConsumerTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/HangConsumerTest.java
@@ -15,14 +15,6 @@
  * limitations under the License.
  */
 package org.apache.activemq.artemis.tests.integration.client;
-import javax.management.MBeanServer;
-import java.lang.management.ManagementFactory;
-import java.util.LinkedList;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.Executor;
-import java.util.concurrent.ScheduledExecutorService;
-import java.util.concurrent.Semaphore;
-import java.util.concurrent.TimeUnit;
 
 import org.apache.activemq.artemis.api.core.ActiveMQException;
 import org.apache.activemq.artemis.api.core.Interceptor;
@@ -63,20 +55,28 @@ import org.apache.activemq.artemis.spi.core.protocol.SessionCallback;
 import org.apache.activemq.artemis.spi.core.remoting.ReadyListener;
 import org.apache.activemq.artemis.spi.core.security.ActiveMQSecurityManager;
 import org.apache.activemq.artemis.spi.core.security.ActiveMQSecurityManagerImpl;
-import org.apache.activemq.artemis.tests.util.ServiceTestBase;
+import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
 import org.apache.activemq.artemis.utils.ExecutorFactory;
 import org.apache.activemq.artemis.utils.ReusableLatch;
-import org.junit.After;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
 
+import javax.management.MBeanServer;
+import java.lang.management.ManagementFactory;
+import java.util.LinkedList;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.Executor;
+import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.Semaphore;
+import java.util.concurrent.TimeUnit;
+
 /**
  * This test will simulate a consumer hanging on the delivery packet due to unbehaved clients
  * and it will make sure we can still perform certain operations on the queue such as produce
  * and verify the counters
  */
-public class HangConsumerTest extends ServiceTestBase
+public class HangConsumerTest extends ActiveMQTestBase
 {
 
    private ActiveMQServer server;
@@ -93,28 +93,18 @@ public class HangConsumerTest extends ServiceTestBase
    {
       super.setUp();
 
-      Configuration config = createDefaultConfig()
+      Configuration config = createDefaultInVMConfig()
          .setMessageExpiryScanPeriod(10);
 
       ActiveMQSecurityManager securityManager = new ActiveMQSecurityManagerImpl();
 
-      config.setPersistenceEnabled(true);
-
-      server = new MyActiveMQServer(config, ManagementFactory.getPlatformMBeanServer(), securityManager);
+      server = addServer(new MyActiveMQServer(config, ManagementFactory.getPlatformMBeanServer(), securityManager));
 
       server.start();
 
       locator = createInVMNonHALocator();
    }
 
-   @After
-   public void tearDown() throws Exception
-   {
-      server.stop();
-      locator.close();
-      super.tearDown();
-   }
-
    @Test
    public void testHangOnDelivery() throws Exception
    {
@@ -378,7 +368,7 @@ public class HangConsumerTest extends ServiceTestBase
 
       // a duplicate binding would impede the server from starting
       server.start();
-      waitForServer(server);
+      waitForServerToStart(server);
 
       server.stop();
 
@@ -415,7 +405,7 @@ public class HangConsumerTest extends ServiceTestBase
 
       // a duplicate binding would impede the server from starting
       server.start();
-      waitForServer(server);
+      waitForServerToStart(server);
 
       server.stop();
 
@@ -490,7 +480,7 @@ public class HangConsumerTest extends ServiceTestBase
 
             server.stop();
 
-            SequentialFileFactory messagesFF = new NIOSequentialFileFactory(getBindingsDir(), null);
+            SequentialFileFactory messagesFF = new NIOSequentialFileFactory(server.getConfiguration().getBindingsDirectory(), null);
 
             JournalImpl messagesJournal = new JournalImpl(1024 * 1024,
                                                           2,

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/328611fd/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/HeuristicXATest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/HeuristicXATest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/HeuristicXATest.java
index 389bf8d..80ef6e0 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/HeuristicXATest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/HeuristicXATest.java
@@ -29,8 +29,7 @@ import org.apache.activemq.artemis.core.server.ActiveMQServer;
 import org.apache.activemq.artemis.core.server.Queue;
 import org.apache.activemq.artemis.core.transaction.impl.XidImpl;
 import org.apache.activemq.artemis.tests.integration.management.ManagementControlHelper;
-import org.apache.activemq.artemis.tests.util.ServiceTestBase;
-import org.junit.After;
+import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
@@ -40,7 +39,7 @@ import javax.management.MBeanServerFactory;
 import javax.transaction.xa.XAResource;
 import javax.transaction.xa.Xid;
 
-public class HeuristicXATest extends ServiceTestBase
+public class HeuristicXATest extends ActiveMQTestBase
 {
    // Constants -----------------------------------------------------
    final SimpleString ADDRESS = new SimpleString("ADDRESS");
@@ -62,7 +61,7 @@ public class HeuristicXATest extends ServiceTestBase
    @Test
    public void testInvalidCall() throws Exception
    {
-      Configuration configuration = createDefaultConfig()
+      Configuration configuration = createDefaultInVMConfig()
          .setJMXManagementEnabled(true);
 
       ActiveMQServer server = createServer(false, configuration);
@@ -88,7 +87,7 @@ public class HeuristicXATest extends ServiceTestBase
 
    private void internalTest(final boolean isCommit) throws Exception
    {
-      Configuration configuration = createDefaultConfig()
+      Configuration configuration = createDefaultInVMConfig()
          .setJMXManagementEnabled(true);
 
       ActiveMQServer server = createServer(false, configuration);
@@ -184,7 +183,7 @@ public class HeuristicXATest extends ServiceTestBase
 
    private void doHeuristicCompletionWithRestart(final boolean isCommit) throws Exception
    {
-      Configuration configuration = createDefaultConfig()
+      Configuration configuration = createDefaultInVMConfig()
          .setJMXManagementEnabled(true);
 
       ActiveMQServer server = createServer(true, configuration);
@@ -285,7 +284,7 @@ public class HeuristicXATest extends ServiceTestBase
 
    private void doRecoverHeuristicCompletedTxWithRestart(final boolean heuristicCommit) throws Exception
    {
-      Configuration configuration = createDefaultConfig()
+      Configuration configuration = createDefaultInVMConfig()
          .setJMXManagementEnabled(true);
 
       ActiveMQServer server = createServer(true, configuration);
@@ -356,7 +355,7 @@ public class HeuristicXATest extends ServiceTestBase
       server.stop();
 
       server.start();
-      // we need to recreate the locator and session factory
+      // we need to recreate the locator and session sf
       sf = createSessionFactory(locator);
       jmxServer = ManagementControlHelper.createActiveMQServerControl(mbeanServer);
       if (heuristicCommit)
@@ -395,7 +394,7 @@ public class HeuristicXATest extends ServiceTestBase
 
    private void doForgetHeuristicCompletedTxAndRestart(final boolean heuristicCommit) throws Exception
    {
-      Configuration configuration = createDefaultConfig()
+      Configuration configuration = createDefaultInVMConfig()
          .setJMXManagementEnabled(true);
 
       ActiveMQServer server = createServer(true, configuration);
@@ -481,15 +480,6 @@ public class HeuristicXATest extends ServiceTestBase
    // Protected -----------------------------------------------------
 
    @Override
-   @After
-   public void tearDown() throws Exception
-   {
-      locator.close();
-      MBeanServerFactory.releaseMBeanServer(mbeanServer);
-      super.tearDown();
-   }
-
-   @Override
    @Before
    public void setUp() 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/client/InVMNonPersistentMessageBufferTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/InVMNonPersistentMessageBufferTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/InVMNonPersistentMessageBufferTest.java
index 48c5a82..107e47d 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/InVMNonPersistentMessageBufferTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/InVMNonPersistentMessageBufferTest.java
@@ -15,13 +15,6 @@
  * limitations under the License.
  */
 package org.apache.activemq.artemis.tests.integration.client;
-import org.apache.activemq.artemis.tests.util.ServiceTestBase;
-import org.junit.Before;
-import org.junit.After;
-
-import org.junit.Test;
-
-import org.junit.Assert;
 
 import org.apache.activemq.artemis.api.core.client.ClientConsumer;
 import org.apache.activemq.artemis.api.core.client.ClientMessage;
@@ -31,10 +24,14 @@ import org.apache.activemq.artemis.api.core.client.ClientSessionFactory;
 import org.apache.activemq.artemis.api.core.client.ServerLocator;
 import org.apache.activemq.artemis.core.protocol.core.impl.PacketImpl;
 import org.apache.activemq.artemis.core.server.ActiveMQServer;
+import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
 import org.apache.activemq.artemis.tests.util.RandomUtil;
 import org.apache.activemq.artemis.utils.DataConstants;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
 
-public class InVMNonPersistentMessageBufferTest extends ServiceTestBase
+public class InVMNonPersistentMessageBufferTest extends ActiveMQTestBase
 {
    public static final String address = "testaddress";
 
@@ -262,22 +259,6 @@ public class InVMNonPersistentMessageBufferTest extends ServiceTestBase
       session.start();
    }
 
-   @Override
-   @After
-   public void tearDown() throws Exception
-   {
-      if (session != null)
-      {
-         consumer.close();
-
-         session.deleteQueue(InVMNonPersistentMessageBufferTest.queueName);
-
-         session.close();
-      }
-
-      super.tearDown();
-   }
-
    private ClientMessage sendAndReceive(final ClientMessage message) throws Exception
    {
       producer.send(message);

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/328611fd/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/IncompatibleVersionTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/IncompatibleVersionTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/IncompatibleVersionTest.java
index 3be1789..ced1dcb 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/IncompatibleVersionTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/IncompatibleVersionTest.java
@@ -41,7 +41,7 @@ import org.apache.activemq.artemis.core.server.ActiveMQServer;
 import org.apache.activemq.artemis.core.server.ActiveMQServers;
 import org.apache.activemq.artemis.core.version.impl.VersionImpl;
 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.utils.VersionLoader;
 import org.junit.After;
 import org.junit.Before;
@@ -49,7 +49,7 @@ import org.junit.Test;
 
 import static org.apache.activemq.artemis.tests.util.RandomUtil.randomString;
 
-public class IncompatibleVersionTest extends ServiceTestBase
+public class IncompatibleVersionTest extends ActiveMQTestBase
 {
    private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER;
    // Constants -----------------------------------------------------
@@ -251,10 +251,10 @@ public class IncompatibleVersionTest extends ServiceTestBase
    {
       public void perform(String startedString) throws Exception
       {
-         Configuration conf = new ConfigurationImpl()
+         Configuration config = new ConfigurationImpl()
             .setSecurityEnabled(false)
-            .addAcceptorConfiguration(new TransportConfiguration("org.apache.activemq.artemis.core.remoting.impl.netty.NettyAcceptorFactory"));
-         ActiveMQServer server = ActiveMQServers.newActiveMQServer(conf, false);
+            .addAcceptorConfiguration(new TransportConfiguration(NETTY_ACCEPTOR_FACTORY));
+         ActiveMQServer server = ActiveMQServers.newActiveMQServer(config, false);
          server.start();
 
          log.info("### server: " + startedString);

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/328611fd/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/InterruptedLargeMessageTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/InterruptedLargeMessageTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/InterruptedLargeMessageTest.java
index 60592f9..6e36dd4 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/InterruptedLargeMessageTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/InterruptedLargeMessageTest.java
@@ -38,7 +38,7 @@ import org.apache.activemq.artemis.api.core.client.ActiveMQClient;
 import org.apache.activemq.artemis.api.core.client.ServerLocator;
 import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger;
 import org.apache.activemq.artemis.tests.integration.largemessage.LargeMessageTestBase;
-import org.apache.activemq.artemis.tests.util.ServiceTestBase;
+import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
 import org.apache.activemq.artemis.core.filter.Filter;
 import org.apache.activemq.artemis.core.paging.cursor.PageSubscription;
 import org.apache.activemq.artemis.core.persistence.StorageManager;
@@ -102,8 +102,8 @@ public class InterruptedLargeMessageTest extends LargeMessageTestBase
 
       server.start();
 
-      locator.setBlockOnNonDurableSend(false);
-      locator.setBlockOnDurableSend(false);
+      locator.setBlockOnNonDurableSend(false)
+              .setBlockOnDurableSend(false);
 
       ClientSessionFactory sf = createSessionFactory(locator);
 
@@ -128,7 +128,7 @@ public class InterruptedLargeMessageTest extends LargeMessageTestBase
 
       server.stop(false);
 
-      ServiceTestBase.forceGC();
+      ActiveMQTestBase.forceGC();
 
       server.start();
 
@@ -146,9 +146,9 @@ public class InterruptedLargeMessageTest extends LargeMessageTestBase
 
       server.start();
 
-      locator.setBlockOnNonDurableSend(false);
-      locator.setBlockOnDurableSend(false);
-      locator.addIncomingInterceptor(new LargeMessageTestInterceptorIgnoreLastPacket());
+      locator.setBlockOnNonDurableSend(false)
+              .setBlockOnDurableSend(false)
+              .addIncomingInterceptor(new LargeMessageTestInterceptorIgnoreLastPacket());
 
       ClientSessionFactory sf = createSessionFactory(locator);
 
@@ -226,8 +226,8 @@ public class InterruptedLargeMessageTest extends LargeMessageTestBase
 
       server.start();
 
-      locator.setBlockOnNonDurableSend(true);
-      locator.setBlockOnDurableSend(true);
+      locator.setBlockOnNonDurableSend(true)
+              .setBlockOnDurableSend(true);
 
       ClientSessionFactory sf = createSessionFactory(locator);
 
@@ -261,7 +261,7 @@ public class InterruptedLargeMessageTest extends LargeMessageTestBase
             Assert.assertNotNull(clientMessage);
             for (int countByte = 0; countByte < LARGE_MESSAGE_SIZE; countByte++)
             {
-               Assert.assertEquals(ServiceTestBase.getSamplebyte(countByte), clientMessage.getBodyBuffer().readByte());
+               Assert.assertEquals(ActiveMQTestBase.getSamplebyte(countByte), clientMessage.getBodyBuffer().readByte());
             }
             clientMessage.acknowledge();
          }
@@ -293,8 +293,8 @@ public class InterruptedLargeMessageTest extends LargeMessageTestBase
 
       server.start();
 
-      locator.setBlockOnNonDurableSend(true);
-      locator.setBlockOnDurableSend(true);
+      locator.setBlockOnNonDurableSend(true)
+              .setBlockOnDurableSend(true);
 
       ClientSessionFactory sf = createSessionFactory(locator);
 
@@ -314,7 +314,7 @@ public class InterruptedLargeMessageTest extends LargeMessageTestBase
       }
       session.commit();
 
-      validateNoFilesOnLargeDir(10);
+      validateNoFilesOnLargeDir(server.getConfiguration().getLargeMessagesDirectory(), 10);
 
       for (int h = 0; h < 5; h++)
       {
@@ -340,7 +340,7 @@ public class InterruptedLargeMessageTest extends LargeMessageTestBase
             Assert.assertNotNull(clientMessage);
             for (int countByte = 0; countByte < LARGE_MESSAGE_SIZE; countByte++)
             {
-               Assert.assertEquals(ServiceTestBase.getSamplebyte(countByte), clientMessage.getBodyBuffer().readByte());
+               Assert.assertEquals(ActiveMQTestBase.getSamplebyte(countByte), clientMessage.getBodyBuffer().readByte());
             }
             clientMessage.acknowledge();
          }
@@ -367,8 +367,6 @@ public class InterruptedLargeMessageTest extends LargeMessageTestBase
    @Test
    public void testSendPreparedXA() throws Exception
    {
-
-
       ClientSession session = null;
 
       LargeMessageTestInterceptorIgnoreLastPacket.disableInterrupt();
@@ -382,8 +380,8 @@ public class InterruptedLargeMessageTest extends LargeMessageTestBase
 
       server.start();
 
-      locator.setBlockOnNonDurableSend(true);
-      locator.setBlockOnDurableSend(true);
+      locator.setBlockOnNonDurableSend(true)
+              .setBlockOnDurableSend(true);
 
       ClientSessionFactory sf = createSessionFactory(locator);
 
@@ -469,7 +467,7 @@ public class InterruptedLargeMessageTest extends LargeMessageTestBase
       }
       server.stop();
 
-      validateNoFilesOnLargeDir(10);
+      validateNoFilesOnLargeDir(server.getConfiguration().getLargeMessagesDirectory(), 10);
 
       server.start();
 
@@ -615,8 +613,8 @@ public class InterruptedLargeMessageTest extends LargeMessageTestBase
                                                                                  server.getAddressSettingsRepository(),
                                                                                  server.getExecutorFactory()));
 
-      locator.setBlockOnNonDurableSend(true);
-      locator.setBlockOnDurableSend(true);
+      locator.setBlockOnNonDurableSend(true)
+              .setBlockOnDurableSend(true);
 
       ClientSessionFactory sf = createSessionFactory(locator);
 
@@ -678,8 +676,8 @@ public class InterruptedLargeMessageTest extends LargeMessageTestBase
 
       QueueFactory original = server.getQueueFactory();
 
-      locator.setBlockOnNonDurableSend(true);
-      locator.setBlockOnDurableSend(true);
+      locator.setBlockOnNonDurableSend(true)
+              .setBlockOnDurableSend(true);
 
       ClientSessionFactory sf = createSessionFactory(locator);
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/328611fd/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/JMSPagingFileDeleteTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/JMSPagingFileDeleteTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/JMSPagingFileDeleteTest.java
index 5bd5268..a74ef0e 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/JMSPagingFileDeleteTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/JMSPagingFileDeleteTest.java
@@ -16,6 +16,14 @@
  */
 package org.apache.activemq.artemis.tests.integration.client;
 
+import org.apache.activemq.artemis.api.core.SimpleString;
+import org.apache.activemq.artemis.core.paging.PagingStore;
+import org.apache.activemq.artemis.core.settings.impl.AddressSettings;
+import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger;
+import org.apache.activemq.artemis.tests.util.JMSTestBase;
+import org.junit.Before;
+import org.junit.Test;
+
 import javax.jms.BytesMessage;
 import javax.jms.Connection;
 import javax.jms.Message;
@@ -24,15 +32,6 @@ import javax.jms.MessageProducer;
 import javax.jms.Session;
 import javax.jms.Topic;
 
-import org.apache.activemq.artemis.api.core.SimpleString;
-import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger;
-import org.apache.activemq.artemis.tests.util.JMSTestBase;
-import org.apache.activemq.artemis.core.paging.PagingStore;
-import org.apache.activemq.artemis.core.settings.impl.AddressSettings;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
 /**
  * This will perform cleanup tests on paging while using JMS topics
  */
@@ -77,21 +76,12 @@ public class JMSPagingFileDeleteTest extends JMSTestBase
       topic1 = createTopic("topic1");
 
       // Paging Setting
-      AddressSettings setting = new AddressSettings();
-      setting.setPageSizeBytes(JMSPagingFileDeleteTest.PAGE_SIZE);
-      setting.setMaxSizeBytes(JMSPagingFileDeleteTest.PAGE_MAX);
+      AddressSettings setting = new AddressSettings()
+              .setPageSizeBytes(JMSPagingFileDeleteTest.PAGE_SIZE)
+              .setMaxSizeBytes(JMSPagingFileDeleteTest.PAGE_MAX);
       server.getAddressSettingsRepository().addMatch("#", setting);
    }
 
-   @Override
-   @After
-   public void tearDown() throws Exception
-   {
-      log.info("#tearDown");
-      topic1 = null;
-      super.tearDown();
-   }
-
    /**
     * Test replicating issue JBPAPP-9603
     *

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/328611fd/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/JmsNettyNioStressTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/JmsNettyNioStressTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/JmsNettyNioStressTest.java
index 484f654..889d09c 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/JmsNettyNioStressTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/JmsNettyNioStressTest.java
@@ -28,7 +28,7 @@ import org.apache.activemq.artemis.core.remoting.impl.netty.TransportConstants;
 import org.apache.activemq.artemis.core.server.ActiveMQServer;
 import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
 import org.apache.activemq.artemis.jms.client.ActiveMQDestination;
-import org.apache.activemq.artemis.tests.util.ServiceTestBase;
+import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
 import org.junit.Assert;
 import org.junit.Test;
 
@@ -62,7 +62,7 @@ import java.util.concurrent.atomic.AtomicInteger;
  * counting strategy is used to verify that the count has reached the expected
  * value.
  */
-public class JmsNettyNioStressTest extends ServiceTestBase
+public class JmsNettyNioStressTest extends ActiveMQTestBase
 {
 
    // Constants -----------------------------------------------------
@@ -92,8 +92,8 @@ public class JmsNettyNioStressTest extends ServiceTestBase
       // minimize threads to maximize possibility for deadlock
       params.put(TransportConstants.NIO_REMOTING_THREADS_PROPNAME, 1);
       params.put(TransportConstants.BATCH_DELAY, 50);
-      TransportConfiguration transportConfig = new TransportConfiguration(ServiceTestBase.NETTY_ACCEPTOR_FACTORY, params);
-      Configuration config = createBasicConfig(-1)
+      TransportConfiguration transportConfig = new TransportConfiguration(ActiveMQTestBase.NETTY_ACCEPTOR_FACTORY, params);
+      Configuration config = createBasicConfig()
               .setJMXManagementEnabled(false)
               .clearAcceptorConfigurations()
               .addAcceptorConfiguration(transportConfig);

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/328611fd/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/JournalCrashTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/JournalCrashTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/JournalCrashTest.java
index 95cc3e4..371f5bf 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/JournalCrashTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/JournalCrashTest.java
@@ -34,11 +34,11 @@ import org.apache.activemq.artemis.core.journal.RecordInfo;
 import org.apache.activemq.artemis.core.journal.impl.JournalImpl;
 import org.apache.activemq.artemis.core.journal.impl.NIOSequentialFileFactory;
 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;
 
-public class JournalCrashTest extends ServiceTestBase
+public class JournalCrashTest extends ActiveMQTestBase
 {
    private static final int FIRST_RUN = 4;
 
@@ -58,7 +58,7 @@ public class JournalCrashTest extends ServiceTestBase
 
    protected void startServer() throws Exception
    {
-      Configuration config = createDefaultConfig()
+      Configuration config = createDefaultInVMConfig()
          .setJournalFileSize(ActiveMQDefaultConfiguration.getDefaultJournalFileSize())
          .setJournalCompactMinFiles(ActiveMQDefaultConfiguration.getDefaultJournalCompactMinFiles())
          .setJournalCompactPercentage(ActiveMQDefaultConfiguration.getDefaultJournalCompactPercentage())

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/328611fd/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/LargeMessageAvoidLargeMessagesTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/LargeMessageAvoidLargeMessagesTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/LargeMessageAvoidLargeMessagesTest.java
index e43ba04..86d12bb 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/LargeMessageAvoidLargeMessagesTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/LargeMessageAvoidLargeMessagesTest.java
@@ -25,7 +25,7 @@ import org.apache.activemq.artemis.api.core.client.ClientSession;
 import org.apache.activemq.artemis.api.core.client.ClientSessionFactory;
 import org.apache.activemq.artemis.api.core.client.ActiveMQClient;
 import org.apache.activemq.artemis.api.core.client.ServerLocator;
-import org.apache.activemq.artemis.tests.util.ServiceTestBase;
+import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
 import org.apache.activemq.artemis.core.server.ActiveMQServer;
 import org.apache.activemq.artemis.core.settings.impl.AddressSettings;
 import org.junit.Assert;
@@ -52,10 +52,9 @@ public class LargeMessageAvoidLargeMessagesTest extends LargeMessageTest
    @Override
    protected ServerLocator createFactory(final boolean isNetty) throws Exception
    {
-      ServerLocator locator1 = super.createFactory(isNetty);
-      locator1.setMinLargeMessageSize(10240);
-      locator1.setCompressLargeMessage(true);
-      return locator1;
+      return super.createFactory(isNetty)
+              .setMinLargeMessageSize(10240)
+              .setCompressLargeMessage(true);
    }
 
    @Test
@@ -194,7 +193,7 @@ public class LargeMessageAvoidLargeMessagesTest extends LargeMessageTest
       session.start();
 
       //no file should be in the dir as we send it as regular
-      validateNoFilesOnLargeDir(num);
+      validateNoFilesOnLargeDir(server.getConfiguration().getLargeMessagesDirectory(), num);
 
       ClientConsumer consumer = session.createConsumer(ADDRESS);
       for (int j = 0; j < num; j++)
@@ -259,7 +258,7 @@ public class LargeMessageAvoidLargeMessagesTest extends LargeMessageTest
       session.start();
 
       //half the messages are sent as large
-      validateNoFilesOnLargeDir(num / 2);
+      validateNoFilesOnLargeDir(server.getConfiguration().getLargeMessagesDirectory(), num / 2);
 
       ClientConsumer consumer = session.createConsumer(ADDRESS);
       for (int j = 0; j < num; j++)
@@ -316,10 +315,9 @@ public class LargeMessageAvoidLargeMessagesTest extends LargeMessageTest
 
       SimpleString ADDRESS_DLA = ADDRESS.concat("-dla");
 
-      AddressSettings addressSettings = new AddressSettings();
-
-      addressSettings.setDeadLetterAddress(ADDRESS_DLA);
-      addressSettings.setMaxDeliveryAttempts(1);
+      AddressSettings addressSettings = new AddressSettings()
+              .setDeadLetterAddress(ADDRESS_DLA)
+              .setMaxDeliveryAttempts(1);
 
       server.getAddressSettingsRepository().addMatch("*", addressSettings);
 
@@ -350,7 +348,7 @@ public class LargeMessageAvoidLargeMessagesTest extends LargeMessageTest
 
       for (int i = 0; i < messageSize; i++)
       {
-         Assert.assertEquals(ServiceTestBase.getSamplebyte(i), msg1
+         Assert.assertEquals(ActiveMQTestBase.getSamplebyte(i), msg1
             .getBodyBuffer().readByte());
       }
 
@@ -375,7 +373,7 @@ public class LargeMessageAvoidLargeMessagesTest extends LargeMessageTest
 
       for (int i = 0; i < messageSize; i++)
       {
-         Assert.assertEquals(ServiceTestBase.getSamplebyte(i), msg1
+         Assert.assertEquals(ActiveMQTestBase.getSamplebyte(i), msg1
             .getBodyBuffer().readByte());
       }
 
@@ -384,7 +382,7 @@ public class LargeMessageAvoidLargeMessagesTest extends LargeMessageTest
       session.commit();
 
       //large message becomes a regular at server.
-      validateNoFilesOnLargeDir(0);
+      validateNoFilesOnLargeDir(server.getConfiguration().getLargeMessagesDirectory(), 0);
 
       consumer = session.createConsumer(ADDRESS.concat("-2"));
 
@@ -394,7 +392,7 @@ public class LargeMessageAvoidLargeMessagesTest extends LargeMessageTest
 
       for (int i = 0; i < messageSize; i++)
       {
-         Assert.assertEquals(ServiceTestBase.getSamplebyte(i), msg1
+         Assert.assertEquals(ActiveMQTestBase.getSamplebyte(i), msg1
             .getBodyBuffer().readByte());
       }
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/328611fd/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/LargeMessageCompressTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/LargeMessageCompressTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/LargeMessageCompressTest.java
index 7ef09ba..e5f52d9 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/LargeMessageCompressTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/LargeMessageCompressTest.java
@@ -59,9 +59,8 @@ public class LargeMessageCompressTest extends LargeMessageTest
    @Override
    protected ServerLocator createFactory(final boolean isNetty) throws Exception
    {
-      ServerLocator locator1 = super.createFactory(isNetty);
-      locator1.setCompressLargeMessage(true);
-      return locator1;
+      return super.createFactory(isNetty)
+              .setCompressLargeMessage(true);
    }
 
    @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/client/LargeMessageTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/LargeMessageTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/LargeMessageTest.java
index 65bdea8..c96e09e 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/LargeMessageTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/LargeMessageTest.java
@@ -49,7 +49,7 @@ import org.apache.activemq.artemis.core.settings.impl.AddressFullMessagePolicy;
 import org.apache.activemq.artemis.core.settings.impl.AddressSettings;
 import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger;
 import org.apache.activemq.artemis.tests.util.RandomUtil;
-import org.apache.activemq.artemis.tests.util.ServiceTestBase;
+import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
@@ -299,7 +299,7 @@ public class LargeMessageTest extends LargeMessageTestBase
       final int PAGE_SIZE = 10 * 1024;
       final int MESSAGE_SIZE = 1024; // 1k
 
-      Configuration config = createDefaultConfig()
+      Configuration config = createDefaultInVMConfig()
          .setJournalSyncNonTransactional(false);
 
       ActiveMQServer server = createServer(true,
@@ -312,11 +312,10 @@ public class LargeMessageTest extends LargeMessageTestBase
 
       server.getAddressSettingsRepository().getMatch("#").setAddressFullMessagePolicy(AddressFullMessagePolicy.DROP);
 
-      locator = createInVMNonHALocator();
-
-      locator.setBlockOnNonDurableSend(true);
-      locator.setBlockOnDurableSend(true);
-      locator.setBlockOnAcknowledge(true);
+      locator = createInVMNonHALocator()
+              .setBlockOnNonDurableSend(true)
+              .setBlockOnDurableSend(true)
+              .setBlockOnAcknowledge(true);
 
       ClientSessionFactory sf = createSessionFactory(locator);
 
@@ -456,10 +455,9 @@ public class LargeMessageTest extends LargeMessageTestBase
 
       SimpleString ADDRESS_DLA = ADDRESS.concat("-dla");
 
-      AddressSettings addressSettings = new AddressSettings();
-
-      addressSettings.setDeadLetterAddress(ADDRESS_DLA);
-      addressSettings.setMaxDeliveryAttempts(1);
+      AddressSettings addressSettings = new AddressSettings()
+              .setDeadLetterAddress(ADDRESS_DLA)
+              .setMaxDeliveryAttempts(1);
 
       server.getAddressSettingsRepository().addMatch("*", addressSettings);
 
@@ -490,7 +488,7 @@ public class LargeMessageTest extends LargeMessageTestBase
 
       for (int i = 0; i < messageSize; i++)
       {
-         Assert.assertEquals(ServiceTestBase.getSamplebyte(i), msg1.getBodyBuffer().readByte());
+         Assert.assertEquals(ActiveMQTestBase.getSamplebyte(i), msg1.getBodyBuffer().readByte());
       }
 
       session.close();
@@ -514,14 +512,14 @@ public class LargeMessageTest extends LargeMessageTestBase
 
       for (int i = 0; i < messageSize; i++)
       {
-         Assert.assertEquals(ServiceTestBase.getSamplebyte(i), msg1.getBodyBuffer().readByte());
+         Assert.assertEquals(ActiveMQTestBase.getSamplebyte(i), msg1.getBodyBuffer().readByte());
       }
 
       msg1.acknowledge();
 
       session.commit();
 
-      validateNoFilesOnLargeDir(isCompressedTest ? 0 : 1);
+      validateNoFilesOnLargeDir(server.getConfiguration().getLargeMessagesDirectory(), isCompressedTest ? 0 : 1);
 
       consumer = session.createConsumer(ADDRESS.concat("-2"));
 
@@ -531,7 +529,7 @@ public class LargeMessageTest extends LargeMessageTestBase
 
       for (int i = 0; i < messageSize; i++)
       {
-         Assert.assertEquals(ServiceTestBase.getSamplebyte(i), msg1.getBodyBuffer().readByte());
+         Assert.assertEquals(ActiveMQTestBase.getSamplebyte(i), msg1.getBodyBuffer().readByte());
       }
 
       msg1.acknowledge();
@@ -580,7 +578,7 @@ public class LargeMessageTest extends LargeMessageTestBase
 
       for (int i = 0; i < messageSize; i++)
       {
-         Assert.assertEquals(ServiceTestBase.getSamplebyte(i), msg.getBodyBuffer().readByte());
+         Assert.assertEquals(ActiveMQTestBase.getSamplebyte(i), msg.getBodyBuffer().readByte());
       }
       session.rollback();
 
@@ -595,7 +593,7 @@ public class LargeMessageTest extends LargeMessageTestBase
       msg.acknowledge();
       for (int i = 0; i < messageSize; i++)
       {
-         Assert.assertEquals(ServiceTestBase.getSamplebyte(i), msg.getBodyBuffer().readByte());
+         Assert.assertEquals(ActiveMQTestBase.getSamplebyte(i), msg.getBodyBuffer().readByte());
       }
       Assert.assertEquals(2, msg.getDeliveryCount());
       msg.acknowledge();
@@ -623,11 +621,10 @@ public class LargeMessageTest extends LargeMessageTestBase
       SimpleString ADDRESS_DLA = ADDRESS.concat("-dla");
       SimpleString ADDRESS_EXPIRY = ADDRESS.concat("-expiry");
 
-      AddressSettings addressSettings = new AddressSettings();
-
-      addressSettings.setDeadLetterAddress(ADDRESS_DLA);
-      addressSettings.setExpiryAddress(ADDRESS_EXPIRY);
-      addressSettings.setMaxDeliveryAttempts(1);
+      AddressSettings addressSettings = new AddressSettings()
+              .setDeadLetterAddress(ADDRESS_DLA)
+              .setExpiryAddress(ADDRESS_EXPIRY)
+              .setMaxDeliveryAttempts(1);
 
       server.getAddressSettingsRepository().addMatch("*", addressSettings);
 
@@ -663,7 +660,7 @@ public class LargeMessageTest extends LargeMessageTestBase
 
       for (int j = 0; j < messageSize; j++)
       {
-         Assert.assertEquals(ServiceTestBase.getSamplebyte(j), msg1.getBodyBuffer().readByte());
+         Assert.assertEquals(ActiveMQTestBase.getSamplebyte(j), msg1.getBodyBuffer().readByte());
       }
 
       session.rollback();
@@ -681,7 +678,7 @@ public class LargeMessageTest extends LargeMessageTestBase
 
          for (int j = 0; j < messageSize; j++)
          {
-            Assert.assertEquals(ServiceTestBase.getSamplebyte(j), msg1.getBodyBuffer().readByte());
+            Assert.assertEquals(ActiveMQTestBase.getSamplebyte(j), msg1.getBodyBuffer().readByte());
          }
 
          session.rollback();
@@ -705,7 +702,7 @@ public class LargeMessageTest extends LargeMessageTestBase
 
       for (int i = 0; i < messageSize; i++)
       {
-         Assert.assertEquals(ServiceTestBase.getSamplebyte(i), msg1.getBodyBuffer().readByte());
+         Assert.assertEquals(ActiveMQTestBase.getSamplebyte(i), msg1.getBodyBuffer().readByte());
       }
 
       session.commit();
@@ -740,11 +737,10 @@ public class LargeMessageTest extends LargeMessageTestBase
       SimpleString ADDRESS_DLA = ADDRESS.concat("-dla");
       SimpleString ADDRESS_EXPIRY = ADDRESS.concat("-expiry");
 
-      AddressSettings addressSettings = new AddressSettings();
-
-      addressSettings.setDeadLetterAddress(ADDRESS_DLA);
-      addressSettings.setExpiryAddress(ADDRESS_EXPIRY);
-      addressSettings.setMaxDeliveryAttempts(1);
+      AddressSettings addressSettings = new AddressSettings()
+              .setDeadLetterAddress(ADDRESS_DLA)
+              .setExpiryAddress(ADDRESS_EXPIRY)
+              .setMaxDeliveryAttempts(1);
 
       server.getAddressSettingsRepository().addMatch("*", addressSettings);
 
@@ -779,7 +775,7 @@ public class LargeMessageTest extends LargeMessageTestBase
 
       for (int j = 0; j < messageSize; j++)
       {
-         Assert.assertEquals(ServiceTestBase.getSamplebyte(j), msg1.getBodyBuffer().readByte());
+         Assert.assertEquals(ActiveMQTestBase.getSamplebyte(j), msg1.getBodyBuffer().readByte());
       }
 
       session.rollback();
@@ -796,7 +792,7 @@ public class LargeMessageTest extends LargeMessageTestBase
 
          for (int j = 0; j < messageSize; j++)
          {
-            Assert.assertEquals(ServiceTestBase.getSamplebyte(j), msg1.getBodyBuffer().readByte());
+            Assert.assertEquals(ActiveMQTestBase.getSamplebyte(j), msg1.getBodyBuffer().readByte());
          }
 
          session.rollback();
@@ -825,7 +821,7 @@ public class LargeMessageTest extends LargeMessageTestBase
 
       for (int i = 0; i < messageSize; i++)
       {
-         Assert.assertEquals(ServiceTestBase.getSamplebyte(i), msg1.getBodyBuffer().readByte());
+         Assert.assertEquals(ActiveMQTestBase.getSamplebyte(i), msg1.getBodyBuffer().readByte());
       }
 
       session.commit();
@@ -852,11 +848,9 @@ public class LargeMessageTest extends LargeMessageTestBase
 
          server.start();
 
-         AddressSettings addressSettings = new AddressSettings();
-
          SimpleString ADDRESS_EXPIRY = ADDRESS.concat("-expiry");
 
-         addressSettings.setExpiryAddress(ADDRESS_EXPIRY);
+         AddressSettings addressSettings = new AddressSettings().setExpiryAddress(ADDRESS_EXPIRY);
 
          server.getAddressSettingsRepository().addMatch("*", addressSettings);
 
@@ -892,7 +886,7 @@ public class LargeMessageTest extends LargeMessageTestBase
 
          for (int i = 0; i < messageSize; i++)
          {
-            Assert.assertEquals(ServiceTestBase.getSamplebyte(i), msg1.getBodyBuffer().readByte());
+            Assert.assertEquals(ActiveMQTestBase.getSamplebyte(i), msg1.getBodyBuffer().readByte());
          }
 
          session.close();
@@ -916,7 +910,7 @@ public class LargeMessageTest extends LargeMessageTestBase
 
          for (int i = 0; i < messageSize; i++)
          {
-            Assert.assertEquals(ServiceTestBase.getSamplebyte(i), msg1.getBodyBuffer().readByte());
+            Assert.assertEquals(ActiveMQTestBase.getSamplebyte(i), msg1.getBodyBuffer().readByte());
          }
 
          msg1.acknowledge();
@@ -1128,9 +1122,8 @@ public class LargeMessageTest extends LargeMessageTestBase
 
          server.start();
 
-         locator.setMinLargeMessageSize(200);
-
-         locator.setCacheLargeMessagesClient(true);
+         locator.setMinLargeMessageSize(200)
+                 .setCacheLargeMessagesClient(true);
 
          ClientSessionFactory sf = addSessionFactory(createSessionFactory(locator));
 
@@ -1196,7 +1189,7 @@ public class LargeMessageTest extends LargeMessageTestBase
       assertNotNull(msg);
       for (long i = 0; i < messageSize; i++)
       {
-         Assert.assertEquals("position " + i, ServiceTestBase.getSamplebyte(i), msg.getBodyBuffer().readByte());
+         Assert.assertEquals("position " + i, ActiveMQTestBase.getSamplebyte(i), msg.getBodyBuffer().readByte());
       }
    }
 
@@ -2434,8 +2427,8 @@ public class LargeMessageTest extends LargeMessageTestBase
 
          server.start();
 
-         locator.setMinLargeMessageSize(1024);
-         locator.setConsumerWindowSize(1024 * 1024);
+         locator.setMinLargeMessageSize(1024)
+                 .setConsumerWindowSize(1024 * 1024);
 
          ClientSessionFactory sf = addSessionFactory(createSessionFactory(locator));
 
@@ -2448,7 +2441,7 @@ public class LargeMessageTest extends LargeMessageTestBase
          for (int i = 0; i < NUMBER_OF_MESSAGES; i++)
          {
             ClientMessage clientFile = session.createMessage(true);
-            clientFile.setBodyInputStream(ServiceTestBase.createFakeLargeStream(SIZE));
+            clientFile.setBodyInputStream(ActiveMQTestBase.createFakeLargeStream(SIZE));
             producer.send(clientFile);
 
          }
@@ -2481,7 +2474,7 @@ public class LargeMessageTest extends LargeMessageTestBase
                {
                   for (int byteRead = 0; byteRead < SIZE; byteRead++)
                   {
-                     Assert.assertEquals(ServiceTestBase.getSamplebyte(byteRead), msg.getBodyBuffer().readByte());
+                     Assert.assertEquals(ActiveMQTestBase.getSamplebyte(byteRead), msg.getBodyBuffer().readByte());
                   }
                }
 
@@ -2538,8 +2531,8 @@ public class LargeMessageTest extends LargeMessageTestBase
 
          server.start();
 
-         locator.setMinLargeMessageSize(1024);
-         locator.setConsumerWindowSize(1024 * 1024);
+         locator.setMinLargeMessageSize(1024)
+                 .setConsumerWindowSize(1024 * 1024);
 
          ClientSessionFactory sf = addSessionFactory(createSessionFactory(locator));
 
@@ -2552,7 +2545,7 @@ public class LargeMessageTest extends LargeMessageTestBase
          for (int i = 0; i < NUMBER_OF_MESSAGES; i++)
          {
             ClientMessage clientFile = session.createMessage(true);
-            clientFile.setBodyInputStream(ServiceTestBase.createFakeLargeStream(SIZE));
+            clientFile.setBodyInputStream(ActiveMQTestBase.createFakeLargeStream(SIZE));
             producer.send(clientFile);
 
          }
@@ -2584,7 +2577,7 @@ public class LargeMessageTest extends LargeMessageTestBase
                {
                   for (int byteRead = 0; byteRead < SIZE; byteRead++)
                   {
-                     Assert.assertEquals(ServiceTestBase.getSamplebyte(byteRead), msg.getBodyBuffer().readByte());
+                     Assert.assertEquals(ActiveMQTestBase.getSamplebyte(byteRead), msg.getBodyBuffer().readByte());
                   }
                }
 
@@ -2649,9 +2642,9 @@ public class LargeMessageTest extends LargeMessageTestBase
 
       final int numberOfBytesBigMessage = 400000;
 
-      locator.setBlockOnNonDurableSend(true);
-      locator.setBlockOnDurableSend(true);
-      locator.setBlockOnAcknowledge(true);
+      locator.setBlockOnNonDurableSend(true)
+              .setBlockOnDurableSend(true)
+              .setBlockOnAcknowledge(true);
 
       ClientSessionFactory sf = addSessionFactory(createSessionFactory(locator));
 
@@ -2788,10 +2781,10 @@ public class LargeMessageTest extends LargeMessageTestBase
 
       final int numberOfBytesBigMessage = 400000;
 
-      locator.setBlockOnNonDurableSend(true);
-      locator.setBlockOnDurableSend(true);
-      locator.setBlockOnAcknowledge(true);
-      locator.setCompressLargeMessage(true);
+      locator.setBlockOnNonDurableSend(true)
+              .setBlockOnDurableSend(true)
+              .setBlockOnAcknowledge(true)
+              .setCompressLargeMessage(true);
 
       ClientSessionFactory sf = addSessionFactory(createSessionFactory(locator));
 
@@ -2911,7 +2904,7 @@ public class LargeMessageTest extends LargeMessageTestBase
          session.createQueue(ADDRESS, ADDRESS, null, true);
 
          ClientMessage clientFile = session.createMessage(true);
-         clientFile.setBodyInputStream(ServiceTestBase.createFakeLargeStream(SIZE));
+         clientFile.setBodyInputStream(ActiveMQTestBase.createFakeLargeStream(SIZE));
 
          ClientProducer producer = session.createProducer(ADDRESS);
 
@@ -2990,7 +2983,7 @@ public class LargeMessageTest extends LargeMessageTestBase
       for (int i = 0; i < NUMBER_OF_MESSAGES; i++)
       {
          ClientMessage msg = session.createMessage(true);
-         msg.setBodyInputStream(ServiceTestBase.createFakeLargeStream(SIZE));
+         msg.setBodyInputStream(ActiveMQTestBase.createFakeLargeStream(SIZE));
          msg.putIntProperty(new SimpleString("key"), i);
          producer.send(msg);
 
@@ -3048,7 +3041,7 @@ public class LargeMessageTest extends LargeMessageTestBase
 
       for (int i = 0; i < LARGE_MESSAGE_SIZE; i++)
       {
-         fileMessage.addBytes(new byte[]{ServiceTestBase.getSamplebyte(i)});
+         fileMessage.addBytes(new byte[]{ActiveMQTestBase.getSamplebyte(i)});
       }
 
       // The server would be doing this
@@ -3078,7 +3071,7 @@ public class LargeMessageTest extends LargeMessageTestBase
 
       for (int i = 0; i < LARGE_MESSAGE_SIZE; i++)
       {
-         Assert.assertEquals(ServiceTestBase.getSamplebyte(i), msg.getBodyBuffer().readByte());
+         Assert.assertEquals(ActiveMQTestBase.getSamplebyte(i), msg.getBodyBuffer().readByte());
       }
 
       msg.acknowledge();
@@ -3121,9 +3114,9 @@ public class LargeMessageTest extends LargeMessageTestBase
 
       if (sendBlocking)
       {
-         sf.getServerLocator().setBlockOnNonDurableSend(true);
-         sf.getServerLocator().setBlockOnDurableSend(true);
-         sf.getServerLocator().setBlockOnAcknowledge(true);
+         sf.getServerLocator().setBlockOnNonDurableSend(true)
+                 .setBlockOnDurableSend(true)
+                 .setBlockOnAcknowledge(true);
       }
 
       ClientSession session = sf.createSession(null, null, false, true, true, false, 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/client/LibaioDependencyCheckTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/LibaioDependencyCheckTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/LibaioDependencyCheckTest.java
index 8a11973..18c3bf1 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/LibaioDependencyCheckTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/LibaioDependencyCheckTest.java
@@ -19,7 +19,7 @@ package org.apache.activemq.artemis.tests.integration.client;
 import org.junit.Test;
 
 import org.apache.activemq.artemis.core.asyncio.impl.AsynchronousFileImpl;
-import org.apache.activemq.artemis.tests.util.ServiceTestBase;
+import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
 
 /**
  * This tests is placed in duplication here to validate that the libaio module is properly loaded on this
@@ -27,7 +27,7 @@ import org.apache.activemq.artemis.tests.util.ServiceTestBase;
  *
  * This test should be placed on each one of the tests modules to make sure the library is loaded correctly.
  */
-public class LibaioDependencyCheckTest extends ServiceTestBase
+public class LibaioDependencyCheckTest extends ActiveMQTestBase
 {
 
    // Constants -----------------------------------------------------

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/328611fd/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MessageConcurrencyTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MessageConcurrencyTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MessageConcurrencyTest.java
index 8203ad9..0b95fc7 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MessageConcurrencyTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MessageConcurrencyTest.java
@@ -16,11 +16,6 @@
  */
 package org.apache.activemq.artemis.tests.integration.client;
 
-import java.util.HashSet;
-import java.util.Set;
-import java.util.concurrent.BlockingQueue;
-import java.util.concurrent.LinkedBlockingQueue;
-
 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;
@@ -29,15 +24,19 @@ import org.apache.activemq.artemis.api.core.client.ClientSession;
 import org.apache.activemq.artemis.api.core.client.ClientSessionFactory;
 import org.apache.activemq.artemis.api.core.client.MessageHandler;
 import org.apache.activemq.artemis.api.core.client.ServerLocator;
-import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger;
 import org.apache.activemq.artemis.core.server.ActiveMQServer;
+import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger;
+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.Before;
 import org.junit.Test;
 
-public class MessageConcurrencyTest extends ServiceTestBase
+import java.util.HashSet;
+import java.util.Set;
+import java.util.concurrent.BlockingQueue;
+import java.util.concurrent.LinkedBlockingQueue;
+
+public class MessageConcurrencyTest extends ActiveMQTestBase
 {
    private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER;
 
@@ -62,19 +61,6 @@ public class MessageConcurrencyTest extends ServiceTestBase
       locator = createInVMNonHALocator();
    }
 
-   @Override
-   @After
-   public void tearDown() throws Exception
-   {
-      locator.close();
-
-      server.stop();
-
-      server = null;
-
-      super.tearDown();
-   }
-
    // Test that a created message can be sent via multiple producers on different sessions concurrently
    @Test
    public void testMessageConcurrency() 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/client/MessageConsumerRollbackTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MessageConsumerRollbackTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MessageConsumerRollbackTest.java
index b90540a..c999665 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MessageConsumerRollbackTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MessageConsumerRollbackTest.java
@@ -28,22 +28,21 @@ import org.apache.activemq.artemis.api.core.client.ClientSession;
 import org.apache.activemq.artemis.api.core.client.ClientSessionFactory;
 import org.apache.activemq.artemis.api.core.client.MessageHandler;
 import org.apache.activemq.artemis.api.core.client.ServerLocator;
-import org.apache.activemq.artemis.tests.util.ServiceTestBase;
+import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
 import org.apache.activemq.artemis.core.server.ActiveMQServer;
 import org.apache.activemq.artemis.core.settings.impl.AddressSettings;
 import org.apache.activemq.artemis.jms.client.ActiveMQTextMessage;
-import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 
-public class MessageConsumerRollbackTest extends ServiceTestBase
+public class MessageConsumerRollbackTest extends ActiveMQTestBase
 {
 
    ActiveMQServer server;
 
    ServerLocator locator;
 
-   ClientSessionFactory factory;
+   ClientSessionFactory sf;
 
    private static final String inQueue = "inqueue";
 
@@ -56,17 +55,16 @@ public class MessageConsumerRollbackTest extends ServiceTestBase
 
       server = createServer(true, true);
 
-      AddressSettings settings = new AddressSettings();
-      settings.setRedeliveryDelay(100);
+      AddressSettings settings = new AddressSettings().setRedeliveryDelay(100);
       server.getConfiguration().getAddressesSettings().put("#", settings);
 
       server.start();
 
       locator = createNettyNonHALocator();
 
-      factory = createSessionFactory(locator);
+      sf = createSessionFactory(locator);
 
-      ClientSession session = factory.createTransactedSession();
+      ClientSession session = sf.createTransactedSession();
 
       session.createQueue(inQueue, inQueue, true);
 
@@ -75,23 +73,6 @@ public class MessageConsumerRollbackTest extends ServiceTestBase
       session.close();
    }
 
-   @After
-   public void tearDown() throws Exception
-   {
-      try
-      {
-         factory.close();
-         locator.close();
-      }
-      catch (Exception ignored)
-      {
-      }
-
-      server.stop();
-
-      super.tearDown();
-   }
-
    // Constants -----------------------------------------------------
 
    // Attributes ----------------------------------------------------
@@ -109,7 +90,7 @@ public class MessageConsumerRollbackTest extends ServiceTestBase
       int numberOfMessages = 3000;
       int numberOfConsumers = 10;
 
-      ClientSession session = factory.createTransactedSession();
+      ClientSession session = sf.createTransactedSession();
 
       sendMessages(numberOfMessages, session);
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/328611fd/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MessageCounterTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MessageCounterTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MessageCounterTest.java
index 5ae4760..7805824 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MessageCounterTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MessageCounterTest.java
@@ -29,9 +29,9 @@ import org.apache.activemq.artemis.api.core.client.ClientSession;
 import org.apache.activemq.artemis.api.core.client.ClientSessionFactory;
 import org.apache.activemq.artemis.api.core.client.ServerLocator;
 import org.apache.activemq.artemis.core.server.ActiveMQServer;
-import org.apache.activemq.artemis.tests.util.ServiceTestBase;
+import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
 
-public class MessageCounterTest extends ServiceTestBase
+public class MessageCounterTest extends ActiveMQTestBase
 {
    private ActiveMQServer server;
 
@@ -54,9 +54,8 @@ public class MessageCounterTest extends ServiceTestBase
    @Test
    public void testMessageCounter() throws Exception
    {
-
-      locator.setBlockOnNonDurableSend(true);
-      locator.setBlockOnDurableSend(true);
+      locator.setBlockOnNonDurableSend(true)
+              .setBlockOnDurableSend(true);
 
       ClientSessionFactory sf = createSessionFactory(locator);
       ClientSession session = sf.createSession(null, null, false, false, false, false, 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/client/MessageDurabilityTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MessageDurabilityTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MessageDurabilityTest.java
index 5992390..4dc97ae 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MessageDurabilityTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MessageDurabilityTest.java
@@ -27,12 +27,12 @@ import org.apache.activemq.artemis.api.core.client.ClientSessionFactory;
 import org.apache.activemq.artemis.api.core.client.ServerLocator;
 import org.apache.activemq.artemis.core.server.ActiveMQServer;
 import org.apache.activemq.artemis.tests.util.RandomUtil;
-import org.apache.activemq.artemis.tests.util.ServiceTestBase;
+import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
 
-public class MessageDurabilityTest extends ServiceTestBase
+public class MessageDurabilityTest extends ActiveMQTestBase
 {
 
    // Constants -----------------------------------------------------
@@ -149,7 +149,7 @@ public class MessageDurabilityTest extends ServiceTestBase
 
       session.start();
 
-      ServiceTestBase.expectActiveMQException(ActiveMQExceptionType.QUEUE_DOES_NOT_EXIST, new ActiveMQAction()
+      ActiveMQTestBase.expectActiveMQException(ActiveMQExceptionType.QUEUE_DOES_NOT_EXIST, new ActiveMQAction()
       {
          public void run() throws ActiveMQException
          {
@@ -177,7 +177,7 @@ public class MessageDurabilityTest extends ServiceTestBase
       restart();
 
       session.start();
-      ServiceTestBase.expectActiveMQException(ActiveMQExceptionType.QUEUE_DOES_NOT_EXIST, new ActiveMQAction()
+      ActiveMQTestBase.expectActiveMQException(ActiveMQExceptionType.QUEUE_DOES_NOT_EXIST, new ActiveMQAction()
       {
          public void run() throws 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/client/MessageExpirationTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MessageExpirationTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MessageExpirationTest.java
index beca5e6..af7bb6c 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MessageExpirationTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MessageExpirationTest.java
@@ -33,9 +33,9 @@ import org.apache.activemq.artemis.core.server.ActiveMQServer;
 import org.apache.activemq.artemis.core.server.Queue;
 import org.apache.activemq.artemis.core.settings.impl.AddressSettings;
 import org.apache.activemq.artemis.tests.util.RandomUtil;
-import org.apache.activemq.artemis.tests.util.ServiceTestBase;
+import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
 
-public class MessageExpirationTest extends ServiceTestBase
+public class MessageExpirationTest extends ActiveMQTestBase
 {
 
    private static final int EXPIRATION = 1000;
@@ -87,8 +87,7 @@ public class MessageExpirationTest extends ServiceTestBase
       ClientProducer producer = session.createProducer(address);
       ClientMessage message = session.createMessage(false);
 
-      AddressSettings addressSettings = new AddressSettings();
-      addressSettings.setExpiryDelay((long) MessageExpirationTest.EXPIRATION);
+      AddressSettings addressSettings = new AddressSettings().setExpiryDelay((long) MessageExpirationTest.EXPIRATION);
       server.getAddressSettingsRepository().addMatch(address.toString(), addressSettings);
 
       producer.send(message);

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/328611fd/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MessageGroupingConnectionFactoryTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MessageGroupingConnectionFactoryTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MessageGroupingConnectionFactoryTest.java
index dc96d10..1166f1c 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MessageGroupingConnectionFactoryTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MessageGroupingConnectionFactoryTest.java
@@ -18,8 +18,6 @@ package org.apache.activemq.artemis.tests.integration.client;
 
 import org.apache.activemq.artemis.api.core.ActiveMQException;
 import org.apache.activemq.artemis.api.core.SimpleString;
-import org.apache.activemq.artemis.api.core.TransportConfiguration;
-import org.apache.activemq.artemis.api.core.client.ActiveMQClient;
 import org.apache.activemq.artemis.api.core.client.ClientConsumer;
 import org.apache.activemq.artemis.api.core.client.ClientMessage;
 import org.apache.activemq.artemis.api.core.client.ClientProducer;
@@ -27,10 +25,9 @@ import org.apache.activemq.artemis.api.core.client.ClientSession;
 import org.apache.activemq.artemis.api.core.client.ClientSessionFactory;
 import org.apache.activemq.artemis.api.core.client.MessageHandler;
 import org.apache.activemq.artemis.api.core.client.ServerLocator;
-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.tests.util.ServiceTestBase;
+import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
@@ -39,7 +36,7 @@ import java.util.ArrayList;
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.TimeUnit;
 
-public class MessageGroupingConnectionFactoryTest extends ServiceTestBase
+public class MessageGroupingConnectionFactoryTest extends ActiveMQTestBase
 {
    private ActiveMQServer server;
 
@@ -118,22 +115,10 @@ public class MessageGroupingConnectionFactoryTest extends ServiceTestBase
    public void setUp() throws Exception
    {
       super.setUp();
-      TransportConfiguration transportConfig = new TransportConfiguration(ServiceTestBase.INVM_ACCEPTOR_FACTORY);
-
-      Configuration configuration = createDefaultConfig()
-         .setSecurityEnabled(false)
-         .addAcceptorConfiguration(transportConfig);
-      server = addServer(ActiveMQServers.newActiveMQServer(configuration, false));
-      // start the server
+      server = addServer(ActiveMQServers.newActiveMQServer(createDefaultInVMConfig(), false));
       server.start();
-
-      // then we create a client as normal
-
-      ServerLocator locator =
-               addServerLocator(ActiveMQClient.createServerLocatorWithoutHA(new TransportConfiguration(
-                  ServiceTestBase.INVM_CONNECTOR_FACTORY)));
-
-      locator.setGroupID("grp1");
+      ServerLocator locator = createInVMNonHALocator()
+              .setGroupID("grp1");
       ClientSessionFactory sessionFactory = createSessionFactory(locator);
       clientSession = addClientSession(sessionFactory.createSession(false, true, true));
       clientSession.createQueue(qName, qName, null, false);

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/328611fd/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MessageGroupingTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MessageGroupingTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MessageGroupingTest.java
index 48c4590..4d83ef9 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MessageGroupingTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MessageGroupingTest.java
@@ -19,8 +19,6 @@ package org.apache.activemq.artemis.tests.integration.client;
 import org.apache.activemq.artemis.api.core.ActiveMQException;
 import org.apache.activemq.artemis.api.core.Message;
 import org.apache.activemq.artemis.api.core.SimpleString;
-import org.apache.activemq.artemis.api.core.TransportConfiguration;
-import org.apache.activemq.artemis.api.core.client.ActiveMQClient;
 import org.apache.activemq.artemis.api.core.client.ClientConsumer;
 import org.apache.activemq.artemis.api.core.client.ClientMessage;
 import org.apache.activemq.artemis.api.core.client.ClientProducer;
@@ -33,7 +31,7 @@ import org.apache.activemq.artemis.core.server.ActiveMQServer;
 import org.apache.activemq.artemis.core.server.ActiveMQServers;
 import org.apache.activemq.artemis.core.transaction.impl.XidImpl;
 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.junit.Assert;
 import org.junit.Assume;
 import org.junit.Before;
@@ -45,7 +43,7 @@ import java.util.ArrayList;
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.TimeUnit;
 
-public class MessageGroupingTest extends ServiceTestBase
+public class MessageGroupingTest extends ActiveMQTestBase
 {
    private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER;
 
@@ -608,19 +606,10 @@ public class MessageGroupingTest extends ServiceTestBase
    public void setUp() throws Exception
    {
       super.setUp();
-      TransportConfiguration transportConfig = new TransportConfiguration(ServiceTestBase.INVM_ACCEPTOR_FACTORY);
-
-      Configuration configuration = createDefaultConfig()
-         .setSecurityEnabled(false)
-         .addAcceptorConfiguration(transportConfig);
+      Configuration configuration = createDefaultInVMConfig();
       server = addServer(ActiveMQServers.newActiveMQServer(configuration, false));
-      // start the server
       server.start();
-
-      // then we create a client as normal
-      locator =
-               addServerLocator(ActiveMQClient.createServerLocatorWithoutHA(new TransportConfiguration(
-                  INVM_CONNECTOR_FACTORY)));
+      locator = createInVMNonHALocator();
       clientSessionFactory = createSessionFactory(locator);
       clientSession = addClientSession(clientSessionFactory.createSession(false, true, true));
       clientSession.createQueue(qName, qName, null, false);

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/328611fd/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MessageHandlerTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MessageHandlerTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MessageHandlerTest.java
index e2cd355..fc27127 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MessageHandlerTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MessageHandlerTest.java
@@ -34,9 +34,9 @@ import org.apache.activemq.artemis.api.core.client.MessageHandler;
 import org.apache.activemq.artemis.api.core.client.ServerLocator;
 import org.apache.activemq.artemis.core.server.ActiveMQServer;
 import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger;
-import org.apache.activemq.artemis.tests.util.ServiceTestBase;
+import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
 
-public class MessageHandlerTest extends ServiceTestBase
+public class MessageHandlerTest 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/client/MessagePriorityTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MessagePriorityTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MessagePriorityTest.java
index e9b9da0..2694196 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MessagePriorityTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MessagePriorityTest.java
@@ -17,8 +17,6 @@
 package org.apache.activemq.artemis.tests.integration.client;
 
 import org.apache.activemq.artemis.api.core.SimpleString;
-import org.apache.activemq.artemis.api.core.TransportConfiguration;
-import org.apache.activemq.artemis.api.core.client.ActiveMQClient;
 import org.apache.activemq.artemis.api.core.client.ClientConsumer;
 import org.apache.activemq.artemis.api.core.client.ClientMessage;
 import org.apache.activemq.artemis.api.core.client.ClientProducer;
@@ -26,17 +24,16 @@ import org.apache.activemq.artemis.api.core.client.ClientSession;
 import org.apache.activemq.artemis.api.core.client.ClientSessionFactory;
 import org.apache.activemq.artemis.api.core.client.ServerLocator;
 import org.apache.activemq.artemis.core.config.Configuration;
-import org.apache.activemq.artemis.core.remoting.impl.invm.InVMAcceptorFactory;
 import org.apache.activemq.artemis.core.server.ActiveMQServer;
 import org.apache.activemq.artemis.core.server.ActiveMQServers;
 import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger;
+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.Assert;
 import org.junit.Before;
 import org.junit.Test;
 
-public class MessagePriorityTest extends ServiceTestBase
+public class MessagePriorityTest extends ActiveMQTestBase
 {
 
    // Constants -----------------------------------------------------
@@ -334,17 +331,12 @@ public class MessagePriorityTest extends ServiceTestBase
    public void setUp() throws Exception
    {
       super.setUp();
-
-      Configuration config = createDefaultConfig()
-         .addAcceptorConfiguration(new TransportConfiguration(InVMAcceptorFactory.class.getCanonicalName()))
-         .setSecurityEnabled(false);
+      Configuration config = createDefaultInVMConfig();
       server = addServer(ActiveMQServers.newActiveMQServer(config, false));
       server.start();
-      locator =
-         addServerLocator(ActiveMQClient.createServerLocatorWithoutHA(new TransportConfiguration(
-            ServiceTestBase.INVM_CONNECTOR_FACTORY)));
-      locator.setBlockOnNonDurableSend(true);
-      locator.setBlockOnDurableSend(true);
+      locator = createInVMNonHALocator()
+              .setBlockOnNonDurableSend(true)
+              .setBlockOnDurableSend(true);
       sf = createSessionFactory(locator);
       session = addClientSession(sf.createSession(false, true, true));
    }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/328611fd/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MessageRateTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MessageRateTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MessageRateTest.java
index 141836e..9fd79eb 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MessageRateTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MessageRateTest.java
@@ -29,12 +29,12 @@ import org.apache.activemq.artemis.api.core.client.ClientSessionFactory;
 import org.apache.activemq.artemis.api.core.client.MessageHandler;
 import org.apache.activemq.artemis.api.core.client.ServerLocator;
 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.Before;
 import org.junit.Test;
 
-public class MessageRateTest extends ServiceTestBase
+public class MessageRateTest extends ActiveMQTestBase
 {
 
    // Constants -----------------------------------------------------

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/328611fd/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MultipleThreadFilterOneTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MultipleThreadFilterOneTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MultipleThreadFilterOneTest.java
index e6f854b..19e6cc4 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MultipleThreadFilterOneTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MultipleThreadFilterOneTest.java
@@ -17,7 +17,7 @@
 package org.apache.activemq.artemis.tests.integration.client;
 
 import org.apache.activemq.artemis.api.core.ActiveMQException;
-import org.apache.activemq.artemis.tests.util.ServiceTestBase;
+import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
 import org.junit.Assert;
 import org.junit.Test;
 
@@ -38,7 +38,7 @@ import org.apache.activemq.artemis.core.settings.impl.AddressSettings;
  * Multiple Threads producing Messages, with Multiple Consumers with different queues, each queue with a different filter
  * This is similar to MultipleThreadFilterTwoTest but it uses multiple queues
  */
-public class MultipleThreadFilterOneTest extends ServiceTestBase
+public class MultipleThreadFilterOneTest extends ActiveMQTestBase
 {
 
    // Constants -----------------------------------------------------

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/328611fd/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/NIOvsOIOTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/NIOvsOIOTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/NIOvsOIOTest.java
index ede5299..06c37f1 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/NIOvsOIOTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/NIOvsOIOTest.java
@@ -32,7 +32,7 @@ import org.apache.activemq.artemis.core.settings.HierarchicalRepository;
 import org.apache.activemq.artemis.core.settings.impl.AddressFullMessagePolicy;
 import org.apache.activemq.artemis.core.settings.impl.AddressSettings;
 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.utils.UUIDGenerator;
 import org.junit.Test;
 
@@ -42,7 +42,7 @@ import java.util.List;
 import java.util.Map;
 import java.util.concurrent.CountDownLatch;
 
-public class NIOvsOIOTest extends ServiceTestBase
+public class NIOvsOIOTest extends ActiveMQTestBase
 {
    private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER;
 
@@ -153,24 +153,19 @@ public class NIOvsOIOTest extends ServiceTestBase
 
    private void testPerf(boolean nio) throws Exception
    {
-      String acceptorFactoryClassName = "org.apache.activemq.artemis.core.remoting.impl.netty.NettyAcceptorFactory";
-
-      Configuration conf = createDefaultConfig()
-         .setSecurityEnabled(false);
+      Configuration config = createDefaultInVMConfig();
 
       Map<String, Object> params = new HashMap<String, Object>();
 
       params.put(TransportConstants.USE_NIO_PROP_NAME, nio);
 
-      conf.getAcceptorConfigurations().add(new TransportConfiguration(acceptorFactoryClassName, params));
-
-      ActiveMQServer server = ActiveMQServers.newActiveMQServer(conf, false);
+      config.getAcceptorConfigurations().add(new TransportConfiguration(NETTY_ACCEPTOR_FACTORY, params));
 
-      AddressSettings addressSettings = new AddressSettings();
+      ActiveMQServer server = addServer(ActiveMQServers.newActiveMQServer(config, false));
 
-      addressSettings.setAddressFullMessagePolicy(AddressFullMessagePolicy.BLOCK);
-
-      addressSettings.setMaxSizeBytes(10 * 1024 * 1024);
+      AddressSettings addressSettings = new AddressSettings()
+              .setAddressFullMessagePolicy(AddressFullMessagePolicy.BLOCK)
+              .setMaxSizeBytes(10 * 1024 * 1024);
 
       final String dest = "test-destination";
 
@@ -184,8 +179,6 @@ public class NIOvsOIOTest extends ServiceTestBase
       {
          doTest(dest);
       }
-
-      server.stop();
    }
 
    private class Sender extends Thread

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/328611fd/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/NettyConnectorTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/NettyConnectorTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/NettyConnectorTest.java
index 4d018a9..969459e 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/NettyConnectorTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/NettyConnectorTest.java
@@ -21,16 +21,14 @@ import org.apache.activemq.artemis.api.core.TransportConfiguration;
 import org.apache.activemq.artemis.api.core.client.ActiveMQClient;
 import org.apache.activemq.artemis.api.core.client.ServerLocator;
 import org.apache.activemq.artemis.core.client.impl.ClientSessionFactoryImpl;
-import org.apache.activemq.artemis.core.config.Configuration;
 import org.apache.activemq.artemis.core.remoting.impl.netty.NettyConnector;
 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.junit.After;
+import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
 import org.junit.Before;
 import org.junit.Test;
 
-public class NettyConnectorTest extends ServiceTestBase
+public class NettyConnectorTest extends ActiveMQTestBase
 {
    private ActiveMQServer server;
 
@@ -40,8 +38,7 @@ public class NettyConnectorTest extends ServiceTestBase
    {
       super.setUp();
 
-      Configuration config = this.createDefaultConfig(true);
-      server = this.createServer(false, config);
+      server = createServer(false, createDefaultNettyConfig());
       server.start();
    }
 
@@ -65,12 +62,4 @@ public class NettyConnectorTest extends ServiceTestBase
       factory.close();
       locator.close();
    }
-
-   @Override
-   @After
-   public void tearDown() throws Exception
-   {
-      super.tearDown();
-      server.stop();
-   }
 }


Mime
View raw message