activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clebertsuco...@apache.org
Subject [04/21] activemq-artemis git commit: More test-suite refactoring
Date Thu, 28 May 2015 15:18:55 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/replication/ReplicationTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/replication/ReplicationTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/replication/ReplicationTest.java
index ddb0aea..e45a905 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/replication/ReplicationTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/replication/ReplicationTest.java
@@ -68,7 +68,7 @@ import org.apache.activemq.artemis.core.settings.HierarchicalRepository;
 import org.apache.activemq.artemis.core.settings.impl.AddressSettings;
 import org.apache.activemq.artemis.spi.core.protocol.RemotingConnection;
 import org.apache.activemq.artemis.tests.util.ReplicatedBackupUtils;
-import org.apache.activemq.artemis.tests.util.ServiceTestBase;
+import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
 import org.apache.activemq.artemis.tests.util.TransportConfigurationUtils;
 import org.apache.activemq.artemis.utils.ActiveMQThreadFactory;
 import org.apache.activemq.artemis.utils.ExecutorFactory;
@@ -92,7 +92,7 @@ import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicBoolean;
 import java.util.concurrent.atomic.AtomicInteger;
 
-public final class ReplicationTest extends ServiceTestBase
+public final class ReplicationTest extends ActiveMQTestBase
 {
 
    private ThreadFactory tFactory;
@@ -139,9 +139,9 @@ public final class ReplicationTest extends ServiceTestBase
          backupAcceptor = TransportConfigurationUtils.getInVMAcceptor(false);
       }
 
-      Configuration liveConfig = createDefaultConfig();
+      Configuration liveConfig = createDefaultInVMConfig();
 
-      Configuration backupConfig = createDefaultConfig()
+      Configuration backupConfig = createDefaultInVMConfig()
          .setHAPolicyConfiguration(new SharedStoreSlavePolicyConfiguration())
          .setBindingsDirectory(getBindingsDir(0, true))
          .setJournalDirectory(getJournalDir(0, true))
@@ -176,7 +176,7 @@ public final class ReplicationTest extends ServiceTestBase
       backupServer.start();
       if (backup)
       {
-         ServiceTestBase.waitForRemoteBackup(null, 5, true, backupServer);
+         ActiveMQTestBase.waitForRemoteBackup(null, 5, true, backupServer);
       }
       int count = 0;
       waitForReplication(count);
@@ -479,7 +479,7 @@ public final class ReplicationTest extends ServiceTestBase
     */
    private JournalStorageManager getStorage() throws Exception
    {
-      return new JournalStorageManager(createDefaultConfig(), factory, null);
+      return new JournalStorageManager(createDefaultInVMConfig(), factory, null);
    }
 
    /**

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/328611fd/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/scheduling/DelayedMessageTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/scheduling/DelayedMessageTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/scheduling/DelayedMessageTest.java
index cff46fd..065e47d 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/scheduling/DelayedMessageTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/scheduling/DelayedMessageTest.java
@@ -22,22 +22,19 @@ import org.apache.activemq.artemis.api.core.client.ClientProducer;
 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.server.ActiveMQServer;
 import org.apache.activemq.artemis.core.settings.impl.AddressSettings;
 import org.apache.activemq.artemis.jms.client.ActiveMQTextMessage;
 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.Before;
 import org.junit.Test;
 
-public class DelayedMessageTest extends ServiceTestBase
+public class DelayedMessageTest extends ActiveMQTestBase
 {
    private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER;
 
-   private Configuration configuration;
-
    private ActiveMQServer server;
 
    private static final long DELAY = 3000;
@@ -59,15 +56,11 @@ public class DelayedMessageTest extends ServiceTestBase
     */
    protected void initServer() throws Exception
    {
-      configuration = createDefaultConfig()
-         .setSecurityEnabled(false)
-         .setJournalMinFiles(2);
-      server = createServer(true, configuration);
+      server = createServer(true, createDefaultInVMConfig());
       server.start();
 
       AddressSettings qs = server.getAddressSettingsRepository().getMatch("*");
-      AddressSettings newSets = new AddressSettings();
-      newSets.setRedeliveryDelay(DelayedMessageTest.DELAY);
+      AddressSettings newSets = new AddressSettings().setRedeliveryDelay(DelayedMessageTest.DELAY);
       newSets.merge(qs);
       server.getAddressSettingsRepository().addMatch(qName, newSets);
       locator = createInVMNonHALocator();
@@ -87,7 +80,7 @@ public class DelayedMessageTest extends ServiceTestBase
 
       final int NUM_MESSAGES = 5;
 
-      ServiceTestBase.forceGC();
+      ActiveMQTestBase.forceGC();
 
       for (int i = 0; i < NUM_MESSAGES; i++)
       {

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/328611fd/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/scheduling/MultipliedDelayedMessageTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/scheduling/MultipliedDelayedMessageTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/scheduling/MultipliedDelayedMessageTest.java
index 7ffef99..7635920 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/scheduling/MultipliedDelayedMessageTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/scheduling/MultipliedDelayedMessageTest.java
@@ -22,22 +22,19 @@ import org.apache.activemq.artemis.api.core.client.ClientProducer;
 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.server.ActiveMQServer;
 import org.apache.activemq.artemis.core.settings.impl.AddressSettings;
 import org.apache.activemq.artemis.jms.client.ActiveMQTextMessage;
 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.Before;
 import org.junit.Test;
 
-public class MultipliedDelayedMessageTest extends ServiceTestBase
+public class MultipliedDelayedMessageTest extends ActiveMQTestBase
 {
    private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER;
 
-   private Configuration configuration;
-
    private ActiveMQServer server;
 
    private static final long DELAY = 1000;
@@ -63,18 +60,15 @@ public class MultipliedDelayedMessageTest extends ServiceTestBase
     */
    protected void initServer() throws Exception
    {
-      configuration = createDefaultConfig()
-         .setSecurityEnabled(false)
-         .setJournalMinFiles(2);
-      server = createServer(true, configuration);
+      server = createServer(true, createDefaultInVMConfig());
       server.start();
 
       // Create settings to enable multiplied redelivery delay
       AddressSettings addressSettings = server.getAddressSettingsRepository().getMatch("*");
-      AddressSettings newAddressSettings = new AddressSettings();
-      newAddressSettings.setRedeliveryDelay(DELAY);
-      newAddressSettings.setRedeliveryMultiplier(MULTIPLIER);
-      newAddressSettings.setMaxRedeliveryDelay(MAX_DELAY);
+      AddressSettings newAddressSettings = new AddressSettings()
+              .setRedeliveryDelay(DELAY)
+              .setRedeliveryMultiplier(MULTIPLIER)
+              .setMaxRedeliveryDelay(MAX_DELAY);
       newAddressSettings.merge(addressSettings);
       server.getAddressSettingsRepository().addMatch(queueName, newAddressSettings);
       locator = createInVMNonHALocator();
@@ -93,7 +87,7 @@ public class MultipliedDelayedMessageTest extends ServiceTestBase
       // Session for sending the message
       session = sessionFactory.createSession(false, true, true);
       ClientProducer producer = session.createProducer(queueName);
-      ServiceTestBase.forceGC();
+      ActiveMQTestBase.forceGC();
       ClientMessage tm = createDurableMessage(session, "message");
       producer.send(tm);
       session.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/scheduling/ScheduledMessageTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/scheduling/ScheduledMessageTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/scheduling/ScheduledMessageTest.java
index 377166b..2a2bf80 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/scheduling/ScheduledMessageTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/scheduling/ScheduledMessageTest.java
@@ -30,7 +30,7 @@ import org.apache.activemq.artemis.core.settings.impl.AddressSettings;
 import org.apache.activemq.artemis.core.transaction.impl.XidImpl;
 import org.apache.activemq.artemis.jms.client.ActiveMQTextMessage;
 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.Assert;
 import org.junit.Before;
@@ -41,7 +41,7 @@ import javax.transaction.xa.Xid;
 import java.util.ArrayList;
 import java.util.concurrent.atomic.AtomicInteger;
 
-public class ScheduledMessageTest extends ServiceTestBase
+public class ScheduledMessageTest extends ActiveMQTestBase
 {
    private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER;
 
@@ -68,9 +68,7 @@ public class ScheduledMessageTest extends ServiceTestBase
     */
    protected void startServer() throws Exception
    {
-      configuration = createDefaultConfig()
-         .setSecurityEnabled(false)
-         .setJournalMinFiles(2);
+      configuration = createDefaultInVMConfig();
       server = createServer(true, configuration);
       server.start();
       locator = createInVMNonHALocator();
@@ -173,8 +171,7 @@ public class ScheduledMessageTest extends ServiceTestBase
    @Test
    public void testPagedMessageDeliveredMultipleConsumersCorrectly() throws Exception
    {
-      AddressSettings qs = new AddressSettings();
-      qs.setRedeliveryDelay(5000L);
+      AddressSettings qs = new AddressSettings().setRedeliveryDelay(5000L);
       server.getAddressSettingsRepository().addMatch(atestq.toString(), qs);
       // then we create a client as normal
       ClientSessionFactory sessionFactory = createSessionFactory(locator);
@@ -227,8 +224,7 @@ public class ScheduledMessageTest extends ServiceTestBase
    public void testPagedMessageDeliveredMultipleConsumersAfterRecoverCorrectly() throws Exception
    {
 
-      AddressSettings qs = new AddressSettings();
-      qs.setRedeliveryDelay(5000L);
+      AddressSettings qs = new AddressSettings().setRedeliveryDelay(5000L);
       server.getAddressSettingsRepository().addMatch(atestq.toString(), qs);
       // then we create a client as normal
       ClientSessionFactory sessionFactory = createSessionFactory(locator);
@@ -751,8 +747,7 @@ public class ScheduledMessageTest extends ServiceTestBase
    @Test
    public void testRedeliveryAfterPrepare() throws Exception
    {
-      AddressSettings qs = new AddressSettings();
-      qs.setRedeliveryDelay(5000L);
+      AddressSettings qs = new AddressSettings().setRedeliveryDelay(5000L);
       server.getAddressSettingsRepository().addMatch(atestq.toString(), qs);
 
       ClientSessionFactory sessionFactory = createSessionFactory(locator);
@@ -797,9 +792,7 @@ public class ScheduledMessageTest extends ServiceTestBase
 
       server.stop();
 
-      configuration = createDefaultConfig()
-         .setSecurityEnabled(false)
-         .setJournalMinFiles(2)
+      configuration = createDefaultInVMConfig()
          .addAddressesSetting(atestq.toString(), qs);
 
       server = createServer(true, configuration);
@@ -863,7 +856,7 @@ public class ScheduledMessageTest extends ServiceTestBase
 
    private void scheduledDelivery(final boolean tx) throws Exception
    {
-      ServiceTestBase.forceGC();
+      ActiveMQTestBase.forceGC();
 
       Xid xid = new XidImpl("xa1".getBytes(), 1, UUIDGenerator.getInstance().generateStringUUID().getBytes());
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/328611fd/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/security/NettySecurityClientTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/security/NettySecurityClientTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/security/NettySecurityClientTest.java
index 417306b..038ef30 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/security/NettySecurityClientTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/security/NettySecurityClientTest.java
@@ -23,13 +23,13 @@ import java.net.URL;
 import org.apache.activemq.artemis.core.config.impl.ConfigurationImpl;
 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;
 import org.apache.activemq.artemis.tests.util.SpawnedVMSupport;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
 
-public class NettySecurityClientTest extends ServiceTestBase
+public class NettySecurityClientTest extends ActiveMQTestBase
 {
 
    private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER;
@@ -58,7 +58,7 @@ public class NettySecurityClientTest extends ServiceTestBase
          .addAcceptorConfiguration(getNettyAcceptorTransportConfiguration(true));
       messagingService = createServer(false, config);
       messagingService.start();
-      waitForServer(messagingService);
+      waitForServerToStart(messagingService);
    }
 
    private void doTestProducerConsumerClient(final boolean withSecurityManager) 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/security/SecurityTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/security/SecurityTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/security/SecurityTest.java
index 0ad440e..7b6f845 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/security/SecurityTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/security/SecurityTest.java
@@ -31,7 +31,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.ServerLocator;
 import org.apache.activemq.artemis.tests.util.CreateMessage;
-import org.apache.activemq.artemis.tests.util.ServiceTestBase;
+import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
 import org.apache.activemq.artemis.core.config.Configuration;
 import org.apache.activemq.artemis.core.security.Role;
 import org.apache.activemq.artemis.core.server.ActiveMQServer;
@@ -42,7 +42,7 @@ import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
 
-public class SecurityTest extends ServiceTestBase
+public class SecurityTest extends ActiveMQTestBase
 {
    /*
     * create session tests
@@ -92,7 +92,7 @@ public class SecurityTest extends ServiceTestBase
     */
    private ActiveMQServer createServer() throws Exception
    {
-      configuration = createDefaultConfig()
+      configuration = createDefaultInVMConfig()
          .setSecurityEnabled(true);
       ActiveMQServer server = createServer(false, configuration);
       return server;
@@ -569,7 +569,7 @@ public class SecurityTest extends ServiceTestBase
    @Test
    public void testSendMessageUpdateRoleCached() throws Exception
    {
-      Configuration configuration = createDefaultConfig()
+      Configuration configuration = createDefaultInVMConfig()
          .setSecurityEnabled(true)
          .setSecurityInvalidationInterval(10000);
       ActiveMQServer server = createServer(false, configuration);
@@ -625,7 +625,7 @@ public class SecurityTest extends ServiceTestBase
    @Test
    public void testSendMessageUpdateRoleCached2() throws Exception
    {
-      Configuration configuration = createDefaultConfig()
+      Configuration configuration = createDefaultInVMConfig()
          .setSecurityEnabled(true)
          .setSecurityInvalidationInterval(0);
       ActiveMQServer server = createServer(false, configuration);
@@ -695,7 +695,7 @@ public class SecurityTest extends ServiceTestBase
    @Test
    public void testSendMessageUpdateSender() throws Exception
    {
-      Configuration configuration = createDefaultConfig()
+      Configuration configuration = createDefaultInVMConfig()
          .setSecurityEnabled(true)
          .setSecurityInvalidationInterval(-1);
       ActiveMQServer server = createServer(false, configuration);
@@ -919,8 +919,8 @@ public class SecurityTest extends ServiceTestBase
       ClientSession andrewConnection = null;
       ClientSession frankConnection = null;
       ClientSession samConnection = null;
-      locator.setBlockOnNonDurableSend(true);
-      locator.setBlockOnDurableSend(true);
+      locator.setBlockOnNonDurableSend(true)
+              .setBlockOnDurableSend(true);
       ClientSessionFactory factory = createSessionFactory(locator);
 
       ClientSession adminSession = factory.createSession("all", "all", false, true, true, false, -1);
@@ -1059,8 +1059,8 @@ public class SecurityTest extends ServiceTestBase
       ClientSession frankConnection = null;
       ClientSession samConnection = null;
       ClientSessionFactory factory = createSessionFactory(locator);
-      factory.getServerLocator().setBlockOnNonDurableSend(true);
-      factory.getServerLocator().setBlockOnDurableSend(true);
+      factory.getServerLocator().setBlockOnNonDurableSend(true)
+              .setBlockOnDurableSend(true);
 
       ClientSession adminSession = factory.createSession("all", "all", false, true, true, false, -1);
       String genericQueueName = "genericQueue";

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/328611fd/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/AddressFullLoggingTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/AddressFullLoggingTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/AddressFullLoggingTest.java
index d948b88..2438223 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/AddressFullLoggingTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/AddressFullLoggingTest.java
@@ -34,13 +34,13 @@ import org.apache.activemq.artemis.core.server.ActiveMQServer;
 import org.apache.activemq.artemis.core.settings.impl.AddressFullMessagePolicy;
 import org.apache.activemq.artemis.core.settings.impl.AddressSettings;
 import org.apache.activemq.artemis.logs.AssertionLoggerHandler;
-import org.apache.activemq.artemis.tests.util.ServiceTestBase;
+import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
 import org.junit.AfterClass;
 import org.junit.Assert;
 import org.junit.BeforeClass;
 import org.junit.Test;
 
-public class AddressFullLoggingTest extends ServiceTestBase
+public class AddressFullLoggingTest extends ActiveMQTestBase
 {
    @BeforeClass
    public static void prepareLogger()
@@ -62,17 +62,17 @@ public class AddressFullLoggingTest extends ServiceTestBase
 
       ActiveMQServer server = createServer(false);
 
-      AddressSettings defaultSetting = new AddressSettings();
-      defaultSetting.setPageSizeBytes(10 * 1024);
-      defaultSetting.setMaxSizeBytes(20 * 1024);
-      defaultSetting.setAddressFullMessagePolicy(AddressFullMessagePolicy.BLOCK);
+      AddressSettings defaultSetting = new AddressSettings()
+              .setPageSizeBytes(10 * 1024)
+              .setMaxSizeBytes(20 * 1024)
+              .setAddressFullMessagePolicy(AddressFullMessagePolicy.BLOCK);
       server.getAddressSettingsRepository().addMatch("#", defaultSetting);
       server.start();
 
-      ServerLocator locator = createInVMNonHALocator();
-      locator.setBlockOnNonDurableSend(true);
-      locator.setBlockOnDurableSend(true);
-      locator.setBlockOnAcknowledge(true);
+      ServerLocator locator = createInVMNonHALocator()
+              .setBlockOnNonDurableSend(true)
+              .setBlockOnDurableSend(true)
+              .setBlockOnAcknowledge(true);
 
       ClientSessionFactory factory = createSessionFactory(locator);
       ClientSession session = factory.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/server/ConnectionLimitTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/ConnectionLimitTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/ConnectionLimitTest.java
index fc9f5f1..6db7a83 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/ConnectionLimitTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/ConnectionLimitTest.java
@@ -26,14 +26,14 @@ import org.apache.activemq.artemis.core.config.Configuration;
 import org.apache.activemq.artemis.core.remoting.impl.netty.TransportConstants;
 import org.apache.activemq.artemis.core.server.ActiveMQServer;
 import org.apache.activemq.artemis.core.server.ActiveMQServers;
-import org.apache.activemq.artemis.tests.util.ServiceTestBase;
+import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
 import org.junit.Before;
 import org.junit.Test;
 
 import java.util.HashMap;
 import java.util.Map;
 
-public class ConnectionLimitTest extends ServiceTestBase
+public class ConnectionLimitTest extends ActiveMQTestBase
 {
    private ActiveMQServer server;
 
@@ -77,8 +77,8 @@ public class ConnectionLimitTest extends ServiceTestBase
    @Test
    public void testNettyConnectionLimit() throws Exception
    {
-      ServerLocator locator = addServerLocator(createNonHALocator(true));
-      locator.setCallTimeout(3000);
+      ServerLocator locator = createNonHALocator(true)
+              .setCallTimeout(3000);
       ClientSessionFactory clientSessionFactory = locator.createSessionFactory();
       ClientSession clientSession = addClientSession(clientSessionFactory.createSession());
       ClientSessionFactory extraClientSessionFactory = locator.createSessionFactory();

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/328611fd/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/ExpiryRunnerTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/ExpiryRunnerTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/ExpiryRunnerTest.java
index cbeb225..5880012 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/ExpiryRunnerTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/ExpiryRunnerTest.java
@@ -16,9 +16,7 @@
  */
 package org.apache.activemq.artemis.tests.integration.server;
 
-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.ClientConsumer;
 import org.apache.activemq.artemis.api.core.client.ClientMessage;
 import org.apache.activemq.artemis.api.core.client.ClientProducer;
@@ -30,8 +28,7 @@ import org.apache.activemq.artemis.core.server.ActiveMQServer;
 import org.apache.activemq.artemis.core.server.ActiveMQServers;
 import org.apache.activemq.artemis.core.server.Queue;
 import org.apache.activemq.artemis.core.settings.impl.AddressSettings;
-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;
@@ -41,7 +38,7 @@ import java.util.List;
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.TimeUnit;
 
-public class ExpiryRunnerTest extends ServiceTestBase
+public class ExpiryRunnerTest extends ActiveMQTestBase
 {
    private ActiveMQServer server;
 
@@ -78,8 +75,7 @@ public class ExpiryRunnerTest extends ServiceTestBase
    {
       ClientProducer producer = clientSession.createProducer(qName);
       clientSession.createQueue(qName2, qName2, null, false);
-      AddressSettings addressSettings = new AddressSettings();
-      addressSettings.setExpiryAddress(expiryAddress);
+      AddressSettings addressSettings = new AddressSettings().setExpiryAddress(expiryAddress);
       server.getAddressSettingsRepository().addMatch(qName2.toString(), addressSettings);
       ClientProducer producer2 = clientSession.createProducer(qName2);
       int numMessages = 100;
@@ -149,8 +145,7 @@ public class ExpiryRunnerTest extends ServiceTestBase
    @Test
    public void testExpireToExpiryQueue() throws Exception
    {
-      AddressSettings addressSettings = new AddressSettings();
-      addressSettings.setExpiryAddress(expiryAddress);
+      AddressSettings addressSettings = new AddressSettings().setExpiryAddress(expiryAddress);
       server.getAddressSettingsRepository().addMatch(qName2.toString(), addressSettings);
       clientSession.deleteQueue(qName);
       clientSession.createQueue(qName, qName, null, false);
@@ -260,61 +255,27 @@ public class ExpiryRunnerTest extends ServiceTestBase
    {
       super.setUp();
 
-      ConfigurationImpl configuration = createBasicConfig()
-         .setMessageExpiryScanPeriod(1000)
-         .addAcceptorConfiguration(new TransportConfiguration(ServiceTestBase.INVM_ACCEPTOR_FACTORY));
-      server = ActiveMQServers.newActiveMQServer(configuration, false);
+      ConfigurationImpl configuration = (ConfigurationImpl) createDefaultInVMConfig()
+         .setMessageExpiryScanPeriod(1000);
+      server = addServer(ActiveMQServers.newActiveMQServer(configuration, false));
       // start the server
       server.start();
       // then we create a client as normal
-      locator = createInVMNonHALocator();
-      locator.setBlockOnAcknowledge(true);
+      locator = createInVMNonHALocator()
+              .setBlockOnAcknowledge(true);
+
       ClientSessionFactory sessionFactory = createSessionFactory(locator);
 
       clientSession = sessionFactory.createSession(false, true, true);
       clientSession.createQueue(qName, qName, null, false);
       expiryAddress = new SimpleString("EA");
       expiryQueue = new SimpleString("expiryQ");
-      AddressSettings addressSettings = new AddressSettings();
-      addressSettings.setExpiryAddress(expiryAddress);
+      AddressSettings addressSettings = new AddressSettings().setExpiryAddress(expiryAddress);
       server.getAddressSettingsRepository().addMatch(qName.toString(), addressSettings);
       server.getAddressSettingsRepository().addMatch(qName2.toString(), addressSettings);
       clientSession.createQueue(expiryAddress, expiryQueue, null, false);
    }
 
-   @Override
-   @After
-   public void tearDown() throws Exception
-   {
-      if (clientSession != null)
-      {
-         try
-         {
-            clientSession.close();
-         }
-         catch (ActiveMQException e1)
-         {
-            //
-         }
-      }
-      locator.close();
-      if (server != null && server.isStarted())
-      {
-         try
-         {
-            server.stop();
-         }
-         catch (Exception e1)
-         {
-            //
-         }
-      }
-      server = null;
-      clientSession = null;
-
-      super.tearDown();
-   }
-
    private static class DummyMessageHandler implements Runnable
    {
       List<String> payloads = new ArrayList<String>();

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/328611fd/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/FileLockTimeoutTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/FileLockTimeoutTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/FileLockTimeoutTest.java
index edc9f54..6cf0bd7 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/FileLockTimeoutTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/FileLockTimeoutTest.java
@@ -22,7 +22,7 @@ import java.util.concurrent.Future;
 import java.util.concurrent.TimeUnit;
 
 import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger;
-import org.apache.activemq.artemis.tests.util.ServiceTestBase;
+import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
 import org.apache.activemq.artemis.core.asyncio.impl.AsynchronousFileImpl;
 import org.apache.activemq.artemis.core.config.Configuration;
 import org.apache.activemq.artemis.core.config.ha.SharedStoreMasterPolicyConfiguration;
@@ -33,7 +33,7 @@ import org.junit.AfterClass;
 import org.junit.Assert;
 import org.junit.BeforeClass;
 
-public class FileLockTimeoutTest extends ServiceTestBase
+public class FileLockTimeoutTest extends ActiveMQTestBase
 {
    @BeforeClass
    public static void prepareLogger()
@@ -56,7 +56,7 @@ public class FileLockTimeoutTest extends ServiceTestBase
                            AsynchronousFileImpl.isLoaded()
          );
       }
-      Configuration config = super.createDefaultConfig()
+      Configuration config = super.createDefaultInVMConfig()
          .setHAPolicyConfiguration(new SharedStoreMasterPolicyConfiguration())
          .clearAcceptorConfigurations();
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/328611fd/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/GracefulShutdownTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/GracefulShutdownTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/GracefulShutdownTest.java
index ddd2bc0..334d5b1 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/GracefulShutdownTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/GracefulShutdownTest.java
@@ -18,8 +18,6 @@ package org.apache.activemq.artemis.tests.integration.server;
 
 import org.apache.activemq.artemis.api.core.ActiveMQExceptionType;
 import org.apache.activemq.artemis.api.core.ActiveMQSessionCreationException;
-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.ClientProducer;
 import org.apache.activemq.artemis.api.core.client.ClientSession;
 import org.apache.activemq.artemis.api.core.client.ClientSessionFactory;
@@ -27,23 +25,22 @@ 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.Test;
 
-public class GracefulShutdownTest extends ServiceTestBase
+public class GracefulShutdownTest extends ActiveMQTestBase
 {
    @Test
    public void testGracefulShutdown() throws Exception
    {
-      Configuration conf = createDefaultConfig();
+      Configuration config = createDefaultInVMConfig()
+              .setGracefulShutdownEnabled(true);
 
-      conf.setGracefulShutdownEnabled(true);
-
-      final ActiveMQServer server = ActiveMQServers.newActiveMQServer(conf, false);
+      final ActiveMQServer server = addServer(ActiveMQServers.newActiveMQServer(config, false));
 
       server.start();
 
-      ServerLocator locator = ActiveMQClient.createServerLocatorWithoutHA(new TransportConfiguration(ServiceTestBase.INVM_CONNECTOR_FACTORY));
+      ServerLocator locator = createInVMNonHALocator();
 
       ClientSessionFactory sf = createSessionFactory(locator);
 
@@ -117,21 +114,18 @@ public class GracefulShutdownTest extends ServiceTestBase
    {
       long timeout = 10000;
 
-      Configuration conf = createDefaultConfig();
-
-      conf.setGracefulShutdownEnabled(true);
-      conf.setGracefulShutdownTimeout(timeout);
+      Configuration config = createDefaultInVMConfig()
+              .setGracefulShutdownEnabled(true)
+              .setGracefulShutdownTimeout(timeout);
 
-      final ActiveMQServer server = ActiveMQServers.newActiveMQServer(conf, false);
+      final ActiveMQServer server = addServer(ActiveMQServers.newActiveMQServer(config, false));
 
       server.start();
 
-      ServerLocator locator = ActiveMQClient.createServerLocatorWithoutHA(new TransportConfiguration(ServiceTestBase.INVM_CONNECTOR_FACTORY));
+      ServerLocator locator = createInVMNonHALocator();
 
       ClientSessionFactory sf = createSessionFactory(locator);
 
-      ClientSession session = sf.createSession();
-
       Thread t = new Thread(new Runnable()
       {
          public void run()
@@ -179,7 +173,5 @@ public class GracefulShutdownTest extends ServiceTestBase
       }
 
       assertTrue("thread terminated too soon, the graceful shutdown timeout wasn't enforced properly", System.currentTimeMillis() - start >= timeout);
-
-      locator.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/server/LVQRecoveryTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/LVQRecoveryTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/LVQRecoveryTest.java
index de24818..0d94213 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/LVQRecoveryTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/LVQRecoveryTest.java
@@ -16,7 +16,6 @@
  */
 package org.apache.activemq.artemis.tests.integration.server;
 
-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.client.ClientConsumer;
@@ -29,8 +28,7 @@ import org.apache.activemq.artemis.core.config.Configuration;
 import org.apache.activemq.artemis.core.server.ActiveMQServer;
 import org.apache.activemq.artemis.core.settings.impl.AddressSettings;
 import org.apache.activemq.artemis.core.transaction.impl.XidImpl;
-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;
@@ -38,7 +36,7 @@ import org.junit.Test;
 import javax.transaction.xa.XAResource;
 import javax.transaction.xa.Xid;
 
-public class LVQRecoveryTest extends ServiceTestBase
+public class LVQRecoveryTest extends ActiveMQTestBase
 {
    private ActiveMQServer server;
 
@@ -166,72 +164,22 @@ public class LVQRecoveryTest extends ServiceTestBase
    }
 
    @Override
-   @After
-   public void tearDown() throws Exception
-   {
-      if (clientSession != null)
-      {
-         try
-         {
-            clientSession.close();
-         }
-         catch (ActiveMQException e1)
-         {
-            //
-         }
-      }
-      if (clientSessionXa != null)
-      {
-         try
-         {
-            clientSessionXa.close();
-         }
-         catch (ActiveMQException e1)
-         {
-            //
-         }
-      }
-      if (locator != null)
-      {
-         locator.close();
-      }
-      if (server != null && server.isStarted())
-      {
-         try
-         {
-            server.stop();
-         }
-         catch (Exception e1)
-         {
-            //
-         }
-      }
-      server = null;
-      clientSession = null;
-
-      super.tearDown();
-   }
-
-   @Override
    @Before
    public void setUp() throws Exception
    {
       super.setUp();
 
-      configuration = createDefaultConfig()
-         .setSecurityEnabled(false);
+      configuration = createDefaultInVMConfig();
       server = createServer(true, configuration);
-      // start the server
       server.start();
 
-      qs = new AddressSettings();
-      qs.setLastValueQueue(true);
+      qs = new AddressSettings()
+              .setLastValueQueue(true);
       server.getAddressSettingsRepository().addMatch(address.toString(), qs);
       // then we create a client as normal
-      locator = createInVMNonHALocator();
-
-      locator.setBlockOnAcknowledge(true);
-      locator.setAckBatchSize(0);
+      locator = createInVMNonHALocator()
+              .setBlockOnAcknowledge(true)
+              .setAckBatchSize(0);
       ClientSessionFactory sessionFactory = createSessionFactory(locator);
       clientSession = sessionFactory.createSession(false, true, true);
       clientSessionXa = sessionFactory.createSession(true, false, false);
@@ -247,15 +195,13 @@ public class LVQRecoveryTest extends ServiceTestBase
       // start the server
       server.start();
 
-      AddressSettings qs1 = new AddressSettings();
-      qs1.setLastValueQueue(true);
-      server.getAddressSettingsRepository().addMatch(address.toString(), qs1);
+      server.getAddressSettingsRepository().addMatch(address.toString(), new AddressSettings().setLastValueQueue(true));
       // then we create a client as normal
       locator.close();
-      locator = createInVMNonHALocator();
+      locator = createInVMNonHALocator()
+              .setBlockOnAcknowledge(true)
+              .setAckBatchSize(0);
 
-      locator.setBlockOnAcknowledge(true);
-      locator.setAckBatchSize(0);
       ClientSessionFactory sessionFactory = createSessionFactory(locator);
       clientSession = sessionFactory.createSession(false, true, true);
       clientSessionXa = sessionFactory.createSession(true, false, 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/server/LVQTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/LVQTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/LVQTest.java
index 83a432e..4ff6604 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/LVQTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/LVQTest.java
@@ -16,28 +16,24 @@
  */
 package org.apache.activemq.artemis.tests.integration.server;
 
-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.ClientConsumer;
 import org.apache.activemq.artemis.api.core.client.ClientMessage;
 import org.apache.activemq.artemis.api.core.client.ClientProducer;
 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.impl.ConfigurationImpl;
 import org.apache.activemq.artemis.core.server.ActiveMQServer;
 import org.apache.activemq.artemis.core.server.ActiveMQServers;
 import org.apache.activemq.artemis.core.server.Queue;
 import org.apache.activemq.artemis.core.settings.impl.AddressSettings;
-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;
 
-public class LVQTest extends ServiceTestBase
+public class LVQTest extends ActiveMQTestBase
 {
    private ActiveMQServer server;
 
@@ -610,84 +606,25 @@ public class LVQTest extends ServiceTestBase
    }
 
    @Override
-   @After
-   public void tearDown() throws Exception
-   {
-      if (clientSession != null)
-      {
-         try
-         {
-            clientSession.close();
-         }
-         catch (ActiveMQException e1)
-         {
-            //
-         }
-      }
-
-      if (clientSessionTxReceives != null)
-      {
-         try
-         {
-            clientSessionTxReceives.close();
-         }
-         catch (ActiveMQException e1)
-         {
-            //
-         }
-      }
-
-      if (clientSessionTxSends != null)
-      {
-         try
-         {
-            clientSessionTxSends.close();
-         }
-         catch (ActiveMQException e1)
-         {
-            //
-         }
-      }
-      if (server != null && server.isStarted())
-      {
-         try
-         {
-            server.stop();
-         }
-         catch (Exception e1)
-         {
-            //
-         }
-      }
-      server = null;
-      clientSession = null;
-
-      super.tearDown();
-   }
-
-   @Override
    @Before
    public void setUp() throws Exception
    {
       super.setUp();
 
-      ConfigurationImpl configuration = createBasicConfig()
-         .addAcceptorConfiguration(new TransportConfiguration(ServiceTestBase.INVM_ACCEPTOR_FACTORY));
-      server = ActiveMQServers.newActiveMQServer(configuration, false);
+      server = addServer(ActiveMQServers.newActiveMQServer(createDefaultInVMConfig(), false));
       // start the server
       server.start();
 
-      AddressSettings qs = new AddressSettings();
-      qs.setLastValueQueue(true);
-      server.getAddressSettingsRepository().addMatch(address.toString(), qs);
+      server.getAddressSettingsRepository().addMatch(address.toString(), new AddressSettings().setLastValueQueue(true));
       // then we create a client as normalServer
-      ServerLocator locator = createInVMNonHALocator();
-      locator.setBlockOnAcknowledge(true);
-      locator.setAckBatchSize(0);
-      ClientSessionFactory sessionFactory = createSessionFactory(locator);
-      clientSession = sessionFactory.createSession(false, true, true);
-      clientSessionTxReceives = sessionFactory.createSession(false, true, false);
-      clientSessionTxSends = sessionFactory.createSession(false, false, true);
+      ServerLocator locator = createInVMNonHALocator()
+              .setBlockOnAcknowledge(true)
+              .setAckBatchSize(0);
+
+      ClientSessionFactory sf = createSessionFactory(locator);
+      clientSession = addClientSession(sf.createSession(false, true, true));
+      clientSessionTxReceives = addClientSession(sf.createSession(false, true, false));
+      clientSessionTxSends = addClientSession(sf.createSession(false, false, true));
       clientSession.createQueue(address, qName1, null, 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/server/PredefinedQueueTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/PredefinedQueueTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/PredefinedQueueTest.java
index bf20cc8..7fba66a 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/PredefinedQueueTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/PredefinedQueueTest.java
@@ -16,39 +16,46 @@
  */
 package org.apache.activemq.artemis.tests.integration.server;
 
-import java.util.ArrayList;
-import java.util.List;
-
 import org.apache.activemq.artemis.api.core.ActiveMQException;
 import org.apache.activemq.artemis.api.core.ActiveMQQueueExistsException;
 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;
 import org.apache.activemq.artemis.api.core.client.ClientMessage;
 import org.apache.activemq.artemis.api.core.client.ClientProducer;
 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.integration.IntegrationTestLogger;
-import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.apache.activemq.artemis.core.config.Configuration;
 import org.apache.activemq.artemis.core.config.CoreQueueConfiguration;
 import org.apache.activemq.artemis.core.postoffice.Bindings;
 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.junit.Assert;
+import org.junit.Before;
 import org.junit.Test;
 
-public class PredefinedQueueTest extends ServiceTestBase
+import java.util.ArrayList;
+import java.util.List;
+
+public class PredefinedQueueTest extends ActiveMQTestBase
 {
    private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER;
 
+   private Configuration configuration = null;
+
+   @Override
+   @Before
+   public void setUp() throws Exception
+   {
+      super.setUp();
+      configuration = createDefaultInVMConfig();
+   }
+
    @Test
    public void testFailOnCreatePredefinedQueues() throws Exception
    {
-      Configuration conf = createDefaultConfig();
-
       final String testAddress = "testAddress";
 
       final String queueName1 = "queue1";
@@ -75,17 +82,17 @@ public class PredefinedQueueTest extends ServiceTestBase
       queueConfs.add(queue2);
       queueConfs.add(queue3);
 
-      conf.setQueueConfigurations(queueConfs);
+      configuration.setQueueConfigurations(queueConfs);
 
-      ActiveMQServer server = ActiveMQServers.newActiveMQServer(conf, false);
+      ActiveMQServer server = addServer(ActiveMQServers.newActiveMQServer(configuration, false));
 
       server.start();
 
-      ServerLocator locator = ActiveMQClient.createServerLocatorWithoutHA(new TransportConfiguration(ServiceTestBase.INVM_CONNECTOR_FACTORY));
+      ServerLocator locator = createInVMNonHALocator();
 
       ClientSessionFactory sf = createSessionFactory(locator);
 
-      ClientSession session = sf.createSession(false, true, true);
+      ClientSession session = addClientSession(sf.createSession(false, true, true));
 
       try
       {
@@ -129,21 +136,11 @@ public class PredefinedQueueTest extends ServiceTestBase
       {
          fail("Invalid Exception type:" + e.getType());
       }
-
-      session.close();
-
-      sf.close();
-
-      locator.close();
-
-      server.stop();
    }
 
    @Test
    public void testDeploySameNames() throws Exception
    {
-      Configuration conf = createDefaultConfig();
-
       final String testAddress = "testAddress";
 
       final String queueName1 = "queue1";
@@ -158,36 +155,31 @@ public class PredefinedQueueTest extends ServiceTestBase
          .setAddress(testAddress)
          .setName(queueName2);
 
-      List<CoreQueueConfiguration> queueConfs = new ArrayList<CoreQueueConfiguration>();
+      configuration
+              .addQueueConfiguration(queue1)
+              .addQueueConfiguration(queue2);
 
-      queueConfs.add(queue1);
-      queueConfs.add(queue2);
-
-      conf.setQueueConfigurations(queueConfs);
-
-      ActiveMQServer server = ActiveMQServers.newActiveMQServer(conf, false);
+      ActiveMQServer server = addServer(ActiveMQServers.newActiveMQServer(configuration, false));
 
       server.start();
 
-      Bindings bindings = server.getPostOffice()
-         .getBindingsForAddress(new SimpleString(testAddress));
+      Bindings bindings = server.getPostOffice().getBindingsForAddress(new SimpleString(testAddress));
 
-      Assert.assertEquals(2, bindings.getBindings()
-         .size());
+      Assert.assertEquals(2, bindings.getBindings().size());
 
-      ServerLocator locator = ActiveMQClient.createServerLocatorWithoutHA(new TransportConfiguration(ServiceTestBase.INVM_CONNECTOR_FACTORY));
+      ServerLocator locator = createInVMNonHALocator();
 
       ClientSessionFactory sf = createSessionFactory(locator);
 
-      ClientSession session = sf.createSession(false, true, true);
+      ClientSession session = addClientSession(sf.createSession(false, true, true));
 
       session.start();
 
-      ClientProducer producer = session.createProducer(new SimpleString(testAddress));
+      ClientProducer producer = addClientProducer(session.createProducer(new SimpleString(testAddress)));
 
-      ClientConsumer consumer1 = session.createConsumer(queueName1);
+      ClientConsumer consumer1 = addClientConsumer(session.createConsumer(queueName1));
 
-      ClientConsumer consumer2 = session.createConsumer(queueName2);
+      ClientConsumer consumer2 = addClientConsumer(session.createConsumer(queueName2));
 
       final int numMessages = 10;
 
@@ -217,21 +209,11 @@ public class PredefinedQueueTest extends ServiceTestBase
 
       Assert.assertNull(consumer1.receiveImmediate());
       Assert.assertNull(consumer2.receiveImmediate());
-
-      session.close();
-
-      sf.close();
-
-      locator.close();
-
-      server.stop();
    }
 
    @Test
    public void testDeployPreexistingQueues() throws Exception
    {
-      Configuration conf = createDefaultConfig();
-
       final String testAddress = "testAddress";
 
       final String queueName1 = "queue1";
@@ -240,15 +222,15 @@ public class PredefinedQueueTest extends ServiceTestBase
 
       final String queueName3 = "queue3";
 
-      ActiveMQServer server = addServer(ActiveMQServers.newActiveMQServer(conf));
+      ActiveMQServer server = addServer(ActiveMQServers.newActiveMQServer(configuration));
 
       server.start();
 
-      ServerLocator locator = ActiveMQClient.createServerLocatorWithoutHA(new TransportConfiguration(ServiceTestBase.INVM_CONNECTOR_FACTORY));
+      ServerLocator locator = createInVMNonHALocator();
 
       ClientSessionFactory sf = createSessionFactory(locator);
 
-      ClientSession session = sf.createSession(false, true, true);
+      ClientSession session = addClientSession(sf.createSession(false, true, true));
 
       session.createQueue(testAddress, queueName1, null, true);
 
@@ -274,19 +256,16 @@ public class PredefinedQueueTest extends ServiceTestBase
          .setAddress(testAddress)
          .setName(queueName3);
 
-      List<CoreQueueConfiguration> queueConfs = new ArrayList<CoreQueueConfiguration>();
-
-      queueConfs.add(queue1);
-      queueConfs.add(queue2);
-      queueConfs.add(queue3);
-
-      conf.setQueueConfigurations(queueConfs);
+      configuration
+              .addQueueConfiguration(queue1)
+              .addQueueConfiguration(queue2)
+              .addQueueConfiguration(queue3);
 
       server.start();
 
       sf = createSessionFactory(locator);
 
-      session = sf.createSession(false, true, true);
+      session = addClientSession(sf.createSession(false, true, true));
 
       session.start();
 
@@ -332,21 +311,11 @@ public class PredefinedQueueTest extends ServiceTestBase
       Assert.assertNull(consumer1.receiveImmediate());
       Assert.assertNull(consumer2.receiveImmediate());
       Assert.assertNull(consumer3.receiveImmediate());
-
-      session.close();
-
-      sf.close();
-
-      locator.close();
-
-      server.stop();
    }
 
    @Test
    public void testDurableNonDurable() throws Exception
    {
-      Configuration conf = createDefaultConfig();
-
       final String testAddress = "testAddress";
 
       final String queueName1 = "queue1";
@@ -367,9 +336,11 @@ public class PredefinedQueueTest extends ServiceTestBase
       queueConfs.add(queue1);
       queueConfs.add(queue2);
 
-      conf.setQueueConfigurations(queueConfs);
+      configuration
+              .addQueueConfiguration(queue1)
+              .addQueueConfiguration(queue2);
 
-      ActiveMQServer server = addServer(ActiveMQServers.newActiveMQServer(conf));
+      ActiveMQServer server = addServer(ActiveMQServers.newActiveMQServer(configuration));
 
       server.start();
 
@@ -377,7 +348,7 @@ public class PredefinedQueueTest extends ServiceTestBase
 
       ClientSessionFactory sf = createSessionFactory(locator);
 
-      ClientSession session = sf.createSession(false, true, true);
+      ClientSession session = addClientSession(sf.createSession(false, true, true));
 
       ClientProducer producer = session.createProducer(new SimpleString(testAddress));
 
@@ -408,7 +379,7 @@ public class PredefinedQueueTest extends ServiceTestBase
 
       sf = createSessionFactory(locator);
 
-      session = sf.createSession(false, true, true);
+      session = addClientSession(sf.createSession(false, true, true));
 
       session.start();
 
@@ -430,21 +401,11 @@ public class PredefinedQueueTest extends ServiceTestBase
 
       Assert.assertNull(consumer1.receiveImmediate());
       Assert.assertNull(consumer2.receiveImmediate());
-
-      session.close();
-
-      sf.close();
-
-      locator.close();
-
-      server.stop();
    }
 
    @Test
    public void testDeployWithFilter() throws Exception
    {
-      Configuration conf = createDefaultConfig();
-
       final String testAddress = "testAddress";
 
       final String queueName1 = "queue1";
@@ -457,21 +418,17 @@ public class PredefinedQueueTest extends ServiceTestBase
          .setFilterString(filter)
          .setDurable(false);
 
-      List<CoreQueueConfiguration> queueConfs = new ArrayList<CoreQueueConfiguration>();
-
-      queueConfs.add(queue1);
-
-      conf.setQueueConfigurations(queueConfs);
+      configuration.addQueueConfiguration(queue1);
 
-      ActiveMQServer server = ActiveMQServers.newActiveMQServer(conf, false);
+      ActiveMQServer server = addServer(ActiveMQServers.newActiveMQServer(configuration, false));
 
       server.start();
 
-      ServerLocator locator = ActiveMQClient.createServerLocatorWithoutHA(new TransportConfiguration(ServiceTestBase.INVM_CONNECTOR_FACTORY));
+      ServerLocator locator = createInVMNonHALocator();
 
       ClientSessionFactory sf = createSessionFactory(locator);
 
-      ClientSession session = sf.createSession(false, true, true);
+      ClientSession session = addClientSession(sf.createSession(false, true, true));
 
       ClientProducer producer = session.createProducer(new SimpleString(testAddress));
 
@@ -518,14 +475,6 @@ public class PredefinedQueueTest extends ServiceTestBase
       }
 
       Assert.assertNull(consumer1.receiveImmediate());
-
-      session.close();
-
-      sf.close();
-
-      locator.close();
-
-      server.stop();
    }
 
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/328611fd/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/ResourceLimitTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/ResourceLimitTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/ResourceLimitTest.java
index b96b9bc..e585d33 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/ResourceLimitTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/ResourceLimitTest.java
@@ -26,11 +26,11 @@ import org.apache.activemq.artemis.core.config.Configuration;
 import org.apache.activemq.artemis.core.server.ActiveMQServer;
 import org.apache.activemq.artemis.core.server.ActiveMQServers;
 import org.apache.activemq.artemis.core.settings.impl.ResourceLimitSettings;
-import org.apache.activemq.artemis.tests.util.ServiceTestBase;
+import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
 import org.junit.Before;
 import org.junit.Test;
 
-public class ResourceLimitTest extends ServiceTestBase
+public class ResourceLimitTest extends ActiveMQTestBase
 {
    private ActiveMQServer server;
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/328611fd/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/ScaleDown3NodeTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/ScaleDown3NodeTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/ScaleDown3NodeTest.java
index 0b76a60..17181a5 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/ScaleDown3NodeTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/ScaleDown3NodeTest.java
@@ -19,10 +19,10 @@ package org.apache.activemq.artemis.tests.integration.server;
 import org.apache.activemq.artemis.api.config.ActiveMQDefaultConfiguration;
 import org.apache.activemq.artemis.api.core.Message;
 import org.apache.activemq.artemis.api.core.SimpleString;
+import org.apache.activemq.artemis.api.core.client.ActiveMQClient;
 import org.apache.activemq.artemis.api.core.client.ClientMessage;
 import org.apache.activemq.artemis.api.core.client.ClientProducer;
 import org.apache.activemq.artemis.api.core.client.ClientSession;
-import org.apache.activemq.artemis.api.core.client.ActiveMQClient;
 import org.apache.activemq.artemis.core.config.ScaleDownConfiguration;
 import org.apache.activemq.artemis.core.config.ha.LiveOnlyPolicyConfiguration;
 import org.apache.activemq.artemis.core.persistence.impl.journal.JournalStorageManager;
@@ -33,8 +33,7 @@ import org.apache.activemq.artemis.core.server.Queue;
 import org.apache.activemq.artemis.core.settings.impl.AddressSettings;
 import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger;
 import org.apache.activemq.artemis.tests.integration.cluster.distribution.ClusterTestBase;
-import org.apache.activemq.artemis.tests.util.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;
@@ -81,17 +80,6 @@ public class ScaleDown3NodeTest extends ClusterTestBase
       return true;
    }
 
-   @Override
-   @After
-   public void tearDown() throws Exception
-   {
-      closeAllConsumers();
-      closeAllSessionFactories();
-      closeAllServerLocatorsFactories();
-      stopServers(0, 1, 2);
-      super.tearDown();
-   }
-
    @Test
    public void testBasicScaleDownWithDefaultReconnectAttempts() throws Exception
    {
@@ -112,8 +100,7 @@ public class ScaleDown3NodeTest extends ClusterTestBase
 
    private void testBasicScaleDownInternal(int reconnectAttempts, boolean large) throws Exception
    {
-      AddressSettings addressSettings = new AddressSettings();
-      addressSettings.setRedistributionDelay(0);
+      AddressSettings addressSettings = new AddressSettings().setRedistributionDelay(0);
       servers[0].getAddressSettingsRepository().addMatch("#", addressSettings);
       servers[1].getAddressSettingsRepository().addMatch("#", addressSettings);
       servers[2].getAddressSettingsRepository().addMatch("#", addressSettings);
@@ -149,7 +136,7 @@ public class ScaleDown3NodeTest extends ClusterTestBase
 
          for (int i = 0; i < 2 * ActiveMQClient.DEFAULT_MIN_LARGE_MESSAGE_SIZE; i++)
          {
-            fileMessage.addBytes(new byte[]{ServiceTestBase.getSamplebyte(i)});
+            fileMessage.addBytes(new byte[]{ActiveMQTestBase.getSamplebyte(i)});
          }
 
          fileMessage.putLongProperty(Message.HDR_LARGE_BODY_SIZE, 2 * ActiveMQClient.DEFAULT_MIN_LARGE_MESSAGE_SIZE);
@@ -254,7 +241,7 @@ public class ScaleDown3NodeTest extends ClusterTestBase
 
             for (int j = 0; j < 2 * ActiveMQClient.DEFAULT_MIN_LARGE_MESSAGE_SIZE; j++)
             {
-               Assert.assertEquals(ServiceTestBase.getSamplebyte(j), clientMessage.getBodyBuffer().readByte());
+               Assert.assertEquals(ActiveMQTestBase.getSamplebyte(j), clientMessage.getBodyBuffer().readByte());
             }
          }
          IntegrationTestLogger.LOGGER.info("Received: " + clientMessage);
@@ -270,8 +257,7 @@ public class ScaleDown3NodeTest extends ClusterTestBase
    @Test
    public void testScaleDownWithMultipleQueues() throws Exception
    {
-      AddressSettings addressSettings = new AddressSettings();
-      addressSettings.setRedistributionDelay(0);
+      AddressSettings addressSettings = new AddressSettings().setRedistributionDelay(0);
       servers[0].getAddressSettingsRepository().addMatch("#", addressSettings);
       servers[1].getAddressSettingsRepository().addMatch("#", addressSettings);
       servers[2].getAddressSettingsRepository().addMatch("#", addressSettings);

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/328611fd/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/ScaleDownDirectTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/ScaleDownDirectTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/ScaleDownDirectTest.java
index 1e4b957..573d86a 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/ScaleDownDirectTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/ScaleDownDirectTest.java
@@ -17,9 +17,6 @@
 
 package org.apache.activemq.artemis.tests.integration.server;
 
-import java.util.Arrays;
-import java.util.Collection;
-
 import org.apache.activemq.artemis.api.core.Message;
 import org.apache.activemq.artemis.api.core.SimpleString;
 import org.apache.activemq.artemis.api.core.client.ActiveMQClient;
@@ -32,13 +29,15 @@ import org.apache.activemq.artemis.core.postoffice.impl.LocalQueueBinding;
 import org.apache.activemq.artemis.core.server.impl.ScaleDownHandler;
 import org.apache.activemq.artemis.core.settings.impl.AddressSettings;
 import org.apache.activemq.artemis.tests.integration.cluster.distribution.ClusterTestBase;
-import org.junit.After;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.junit.runners.Parameterized;
 
+import java.util.Arrays;
+import java.util.Collection;
+
 /**
  * On this test we will run ScaleDown directly as an unit-test in several cases,
  * simulating what would happen during a real scale down.
@@ -46,8 +45,6 @@ import org.junit.runners.Parameterized;
 @RunWith(value = Parameterized.class)
 public class ScaleDownDirectTest extends ClusterTestBase
 {
-
-
    @Parameterized.Parameters(name = "isNetty={0}")
    public static Collection getParameters()
    {
@@ -77,13 +74,6 @@ public class ScaleDownDirectTest extends ClusterTestBase
 
    }
 
-   @Override
-   @After
-   public void tearDown() throws Exception
-   {
-      super.tearDown();
-   }
-
    @Test
    public void testSendMixedSmallMessages() throws Exception
    {
@@ -193,9 +183,9 @@ public class ScaleDownDirectTest extends ClusterTestBase
       ClientSession session = addClientSession(sf.createSession(false, false));
       ClientProducer producer = addClientProducer(session.createProducer(addressName));
 
-      AddressSettings defaultSetting = new AddressSettings();
-      defaultSetting.setPageSizeBytes(10 * 1024);
-      defaultSetting.setMaxSizeBytes(20 * 1024);
+      AddressSettings defaultSetting = new AddressSettings()
+              .setPageSizeBytes(10 * 1024)
+              .setMaxSizeBytes(20 * 1024);
       servers[0].getAddressSettingsRepository().addMatch("#", defaultSetting);
 
       while (!servers[0].getPagingManager().getPageStore(new SimpleString(addressName)).isPaging())

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/328611fd/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/ScaleDownTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/ScaleDownTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/ScaleDownTest.java
index 65a3af5..169eb81 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/ScaleDownTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/ScaleDownTest.java
@@ -16,32 +16,31 @@
  */
 package org.apache.activemq.artemis.tests.integration.server;
 
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Map;
-
 import org.apache.activemq.artemis.api.core.Message;
 import org.apache.activemq.artemis.api.core.SimpleString;
+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;
 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.core.config.ScaleDownConfiguration;
 import org.apache.activemq.artemis.core.config.ha.LiveOnlyPolicyConfiguration;
 import org.apache.activemq.artemis.core.postoffice.Binding;
 import org.apache.activemq.artemis.core.postoffice.impl.LocalQueueBinding;
 import org.apache.activemq.artemis.core.settings.impl.AddressSettings;
 import org.apache.activemq.artemis.tests.integration.cluster.distribution.ClusterTestBase;
-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;
 import org.junit.runner.RunWith;
 import org.junit.runners.Parameterized;
 
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Map;
+
 @RunWith(value = Parameterized.class)
 public class ScaleDownTest extends ClusterTestBase
 {
@@ -93,21 +92,6 @@ public class ScaleDownTest extends ClusterTestBase
       return true;
    }
 
-   @Override
-   @After
-   public void tearDown() throws Exception
-   {
-      closeAllConsumers();
-      closeAllSessionFactories();
-      closeAllServerLocatorsFactories();
-      LiveOnlyPolicyConfiguration haPolicyConfiguration0 = (LiveOnlyPolicyConfiguration) servers[0].getConfiguration().getHAPolicyConfiguration();
-      LiveOnlyPolicyConfiguration haPolicyConfiguration1 = (LiveOnlyPolicyConfiguration) servers[1].getConfiguration().getHAPolicyConfiguration();
-      haPolicyConfiguration0.setScaleDownConfiguration(null);
-      haPolicyConfiguration1.setScaleDownConfiguration(null);
-      stopServers(0, 1);
-      super.tearDown();
-   }
-
    @Test
    public void testBasicScaleDown() throws Exception
    {
@@ -414,7 +398,7 @@ public class ScaleDownTest extends ClusterTestBase
          for (int i = 0; i < 2 * ActiveMQClient.DEFAULT_MIN_LARGE_MESSAGE_SIZE; i++)
          {
             byte byteRead = msg.getBodyBuffer().readByte();
-            Assert.assertEquals(msg + " Is different", ServiceTestBase.getSamplebyte(i), byteRead);
+            Assert.assertEquals(msg + " Is different", ActiveMQTestBase.getSamplebyte(i), byteRead);
          }
 
          msg.acknowledge();
@@ -437,9 +421,9 @@ public class ScaleDownTest extends ClusterTestBase
       ClientSession session = addClientSession(sf.createSession(false, false));
       ClientProducer producer = addClientProducer(session.createProducer(addressName));
 
-      AddressSettings defaultSetting = new AddressSettings();
-      defaultSetting.setPageSizeBytes(10 * 1024);
-      defaultSetting.setMaxSizeBytes(20 * 1024);
+      AddressSettings defaultSetting = new AddressSettings()
+              .setPageSizeBytes(10 * 1024)
+              .setMaxSizeBytes(20 * 1024);
       servers[0].getAddressSettingsRepository().addMatch("#", defaultSetting);
 
       while (!servers[0].getPagingManager().getPageStore(new SimpleString(addressName)).isPaging())
@@ -481,9 +465,9 @@ public class ScaleDownTest extends ClusterTestBase
       ClientSession session = addClientSession(sf.createSession(false, false));
       ClientProducer producer = addClientProducer(session.createProducer(addressName));
 
-      AddressSettings defaultSetting = new AddressSettings();
-      defaultSetting.setPageSizeBytes(10 * 1024);
-      defaultSetting.setMaxSizeBytes(20 * 1024);
+      AddressSettings defaultSetting = new AddressSettings()
+              .setPageSizeBytes(10 * 1024)
+              .setMaxSizeBytes(20 * 1024);
       servers[0].getAddressSettingsRepository().addMatch("#", defaultSetting);
 
       while (!servers[0].getPagingManager().getPageStore(new SimpleString(addressName)).isPaging())

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/328611fd/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/SimpleStartStopTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/SimpleStartStopTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/SimpleStartStopTest.java
index 17fec0ae..7314aa1 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/SimpleStartStopTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/SimpleStartStopTest.java
@@ -23,11 +23,11 @@ import java.util.concurrent.atomic.AtomicInteger;
 import org.apache.activemq.artemis.core.persistence.impl.journal.JournalRecordIds;
 import org.apache.activemq.artemis.core.server.ActiveMQServer;
 import org.apache.activemq.artemis.logs.AssertionLoggerHandler;
-import org.apache.activemq.artemis.tests.util.ServiceTestBase;
+import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
 import org.jboss.logmanager.Level;
 import org.junit.Test;
 
-public class SimpleStartStopTest extends ServiceTestBase
+public class SimpleStartStopTest extends ActiveMQTestBase
 {
 
    /**

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/328611fd/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/SuppliedThreadPoolTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/SuppliedThreadPoolTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/SuppliedThreadPoolTest.java
index 64f4ef3..6cc21e6 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/SuppliedThreadPoolTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/SuppliedThreadPoolTest.java
@@ -24,7 +24,7 @@ import java.util.concurrent.ScheduledThreadPoolExecutor;
 import java.util.concurrent.ThreadPoolExecutor;
 import java.util.concurrent.TimeUnit;
 
-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.server.impl.ActiveMQServerImpl;
 import org.apache.activemq.artemis.core.server.impl.ServiceRegistry;
@@ -32,7 +32,7 @@ import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 
-public class SuppliedThreadPoolTest extends ServiceTestBase
+public class SuppliedThreadPoolTest extends ActiveMQTestBase
 {
    private ActiveMQServer server;
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/328611fd/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/spring/SpringIntegrationTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/spring/SpringIntegrationTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/spring/SpringIntegrationTest.java
index 1bd1e42..f46d49d 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/spring/SpringIntegrationTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/spring/SpringIntegrationTest.java
@@ -19,7 +19,7 @@ package org.apache.activemq.artemis.tests.integration.spring;
 import java.util.concurrent.TimeUnit;
 
 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.jms.client.ActiveMQConnectionFactory;
 import org.apache.activemq.artemis.jms.server.embedded.EmbeddedJMS;
 import org.junit.Assert;
@@ -29,7 +29,7 @@ import org.springframework.context.ApplicationContext;
 import org.springframework.context.support.ClassPathXmlApplicationContext;
 import org.springframework.jms.listener.DefaultMessageListenerContainer;
 
-public class SpringIntegrationTest extends ServiceTestBase
+public class SpringIntegrationTest extends ActiveMQTestBase
 {
    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/ssl/CoreClientOverOneWaySSLTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ssl/CoreClientOverOneWaySSLTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ssl/CoreClientOverOneWaySSLTest.java
index 1c3cd7b..3b7c362 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ssl/CoreClientOverOneWaySSLTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ssl/CoreClientOverOneWaySSLTest.java
@@ -37,7 +37,7 @@ 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.integration.IntegrationTestLogger;
-import org.apache.activemq.artemis.tests.util.ServiceTestBase;
+import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
 import org.apache.activemq.artemis.core.config.impl.ConfigurationImpl;
 import org.apache.activemq.artemis.core.remoting.impl.netty.TransportConstants;
 import org.apache.activemq.artemis.core.remoting.impl.ssl.SSLSupport;
@@ -50,7 +50,7 @@ import org.junit.runner.RunWith;
 import org.junit.runners.Parameterized;
 
 @RunWith(value = Parameterized.class)
-public class CoreClientOverOneWaySSLTest extends ServiceTestBase
+public class CoreClientOverOneWaySSLTest extends ActiveMQTestBase
 {
    @Parameterized.Parameters(name = "storeType={0}")
    public static Collection getParameters()
@@ -545,8 +545,8 @@ public class CoreClientOverOneWaySSLTest extends ServiceTestBase
       createCustomSslServer();
       tc.getParams().put(TransportConstants.SSL_ENABLED_PROP_NAME, false);
 
-      ServerLocator locator = addServerLocator(ActiveMQClient.createServerLocatorWithoutHA(tc));
-      locator.setCallTimeout(2000);
+      ServerLocator locator = addServerLocator(ActiveMQClient.createServerLocatorWithoutHA(tc))
+              .setCallTimeout(2000);
       try
       {
          createSessionFactory(locator);
@@ -602,7 +602,7 @@ public class CoreClientOverOneWaySSLTest extends ServiceTestBase
          .addAcceptorConfiguration(new TransportConfiguration(NETTY_ACCEPTOR_FACTORY, params));
       server = createServer(false, config);
       server.start();
-      waitForServer(server);
+      waitForServerToStart(server);
       tc = new TransportConfiguration(NETTY_CONNECTOR_FACTORY);
    }
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/328611fd/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ssl/CoreClientOverTwoWaySSLTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ssl/CoreClientOverTwoWaySSLTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ssl/CoreClientOverTwoWaySSLTest.java
index 2ffaabf..ef2a1ed 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ssl/CoreClientOverTwoWaySSLTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ssl/CoreClientOverTwoWaySSLTest.java
@@ -37,7 +37,7 @@ 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.RandomUtil;
-import org.apache.activemq.artemis.tests.util.ServiceTestBase;
+import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
 import org.apache.activemq.artemis.core.config.impl.ConfigurationImpl;
 import org.apache.activemq.artemis.core.protocol.core.Packet;
 import org.apache.activemq.artemis.core.protocol.core.impl.PacketImpl;
@@ -52,7 +52,7 @@ import org.junit.runner.RunWith;
 import org.junit.runners.Parameterized;
 
 @RunWith(value = Parameterized.class)
-public class CoreClientOverTwoWaySSLTest extends ServiceTestBase
+public class CoreClientOverTwoWaySSLTest extends ActiveMQTestBase
 {
    @Parameterized.Parameters(name = "storeType={0}")
    public static Collection getParameters()
@@ -201,7 +201,7 @@ public class CoreClientOverTwoWaySSLTest extends ServiceTestBase
          .addAcceptorConfiguration(new TransportConfiguration(NETTY_ACCEPTOR_FACTORY, params));
       server = createServer(false, config);
       server.start();
-      waitForServer(server);
+      waitForServerToStart(server);
       tc = new TransportConfiguration(NETTY_CONNECTOR_FACTORY);
    }
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/328611fd/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/ExtraStompTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/ExtraStompTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/ExtraStompTest.java
index 6c3eedf..e124707 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/ExtraStompTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/ExtraStompTest.java
@@ -16,21 +16,9 @@
  */
 package org.apache.activemq.artemis.tests.integration.stomp;
 
-import javax.jms.Message;
-import javax.jms.MessageConsumer;
-import javax.jms.QueueBrowser;
-import javax.jms.TextMessage;
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
 import org.apache.activemq.artemis.api.core.Interceptor;
 import org.apache.activemq.artemis.api.core.TransportConfiguration;
 import org.apache.activemq.artemis.api.core.client.ActiveMQClient;
-import org.apache.activemq.artemis.tests.integration.largemessage.LargeMessageTestBase;
-import org.apache.activemq.artemis.tests.unit.util.InVMNamingContext;
 import org.apache.activemq.artemis.core.config.Configuration;
 import org.apache.activemq.artemis.core.protocol.core.Packet;
 import org.apache.activemq.artemis.core.protocol.stomp.Stomp;
@@ -50,14 +38,25 @@ import org.apache.activemq.artemis.jms.server.config.impl.JMSQueueConfigurationI
 import org.apache.activemq.artemis.jms.server.config.impl.TopicConfigurationImpl;
 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.largemessage.LargeMessageTestBase;
 import org.apache.activemq.artemis.tests.integration.stomp.util.ClientStompFrame;
 import org.apache.activemq.artemis.tests.integration.stomp.util.StompClientConnection;
 import org.apache.activemq.artemis.tests.integration.stomp.util.StompClientConnectionFactory;
-import org.junit.After;
+import org.apache.activemq.artemis.tests.unit.util.InVMNamingContext;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
 
+import javax.jms.Message;
+import javax.jms.MessageConsumer;
+import javax.jms.QueueBrowser;
+import javax.jms.TextMessage;
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
 public class ExtraStompTest extends StompTestBase
 {
    @Override
@@ -68,14 +67,6 @@ public class ExtraStompTest extends StompTestBase
       super.setUp();
    }
 
-   @Override
-   @After
-   public void tearDown() throws Exception
-   {
-      super.tearDown();
-   }
-
-
    @Test
    public void testConnectionTTL() throws Exception
    {
@@ -700,7 +691,7 @@ public class ExtraStompTest extends StompTestBase
          .addAcceptorConfiguration(stompTransport)
          .addAcceptorConfiguration(new TransportConfiguration(InVMAcceptorFactory.class.getName()));
 
-      ActiveMQServer activeMQServer = ActiveMQServers.newActiveMQServer(config, defUser, defPass);
+      ActiveMQServer activeMQServer = addServer(ActiveMQServers.newActiveMQServer(config, defUser, defPass));
 
       JMSConfiguration jmsConfig = new JMSConfigurationImpl();
       jmsConfig.getQueueConfigurations().add(new JMSQueueConfigurationImpl()

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/328611fd/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/StompTestBase.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/StompTestBase.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/StompTestBase.java
index f40d4bb..6505119 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/StompTestBase.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/StompTestBase.java
@@ -51,7 +51,7 @@ import io.netty.handler.codec.string.StringDecoder;
 import io.netty.handler.codec.string.StringEncoder;
 import org.apache.activemq.artemis.api.core.TransportConfiguration;
 import org.apache.activemq.artemis.tests.unit.util.InVMNamingContext;
-import org.apache.activemq.artemis.tests.util.ServiceTestBase;
+import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
 import org.apache.activemq.artemis.core.config.Configuration;
 import org.apache.activemq.artemis.core.protocol.stomp.StompProtocolManagerFactory;
 import org.apache.activemq.artemis.core.registry.JndiBindingRegistry;
@@ -72,7 +72,7 @@ import org.apache.activemq.artemis.jms.server.impl.JMSServerManagerImpl;
 import org.junit.After;
 import org.junit.Before;
 
-public abstract class StompTestBase extends ServiceTestBase
+public abstract class StompTestBase extends ActiveMQTestBase
 {
    protected final int port = 61613;
 
@@ -206,7 +206,7 @@ public abstract class StompTestBase extends ServiceTestBase
          .addAcceptorConfiguration(stompTransport)
          .addAcceptorConfiguration(new TransportConfiguration(InVMAcceptorFactory.class.getName()));
 
-      ActiveMQServer activeMQServer = ActiveMQServers.newActiveMQServer(config, defUser, defPass);
+      ActiveMQServer activeMQServer = addServer(ActiveMQServers.newActiveMQServer(config, defUser, defPass));
 
       JMSConfiguration jmsConfig = new JMSConfigurationImpl();
       jmsConfig.getQueueConfigurations().add(new JMSQueueConfigurationImpl()


Mime
View raw message