activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clebertsuco...@apache.org
Subject [15/21] activemq-artemis git commit: More test-suite refactoring
Date Thu, 28 May 2015 15:19:06 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/aerogear/AeroGearBasicServerTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/aerogear/AeroGearBasicServerTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/aerogear/AeroGearBasicServerTest.java
index a755a6c..d2fb5fa 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/aerogear/AeroGearBasicServerTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/aerogear/AeroGearBasicServerTest.java
@@ -18,8 +18,6 @@ package org.apache.activemq.artemis.tests.integration.aerogear;
 
 
 import org.apache.activemq.artemis.api.core.Message;
-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.config.CoreQueueConfiguration;
 import org.apache.activemq.artemis.core.server.ActiveMQServer;
 import org.apache.activemq.artemis.integration.aerogear.AeroGearConnectorServiceFactory;
 import org.apache.activemq.artemis.integration.aerogear.AeroGearConstants;
-import org.apache.activemq.artemis.tests.util.ServiceTestBase;
+import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
 import org.apache.activemq.artemis.utils.json.JSONArray;
 import org.apache.activemq.artemis.utils.json.JSONException;
 import org.apache.activemq.artemis.utils.json.JSONObject;
@@ -53,7 +51,7 @@ import java.util.HashMap;
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.TimeUnit;
 
-public class AeroGearBasicServerTest extends ServiceTestBase
+public class AeroGearBasicServerTest extends ActiveMQTestBase
 {
 
    private ActiveMQServer server;
@@ -88,7 +86,8 @@ public class AeroGearBasicServerTest extends ServiceTestBase
       params.put(AeroGearConstants.DEVICE_TYPE_NAME, "android,ipad");
       params.put(AeroGearConstants.SOUND_NAME, "sound1");
       params.put(AeroGearConstants.VARIANTS_NAME, "variant1,variant2");
-      Configuration configuration = createDefaultConfig()
+
+      Configuration configuration = createDefaultInVMConfig()
          .addConnectorServiceConfiguration(
             new ConnectorServiceConfiguration()
                .setFactoryClassName(AeroGearConnectorServiceFactory.class.getName())
@@ -97,7 +96,8 @@ public class AeroGearBasicServerTest extends ServiceTestBase
          .addQueueConfiguration(new CoreQueueConfiguration()
                                    .setAddress("testQueue")
                                    .setName("testQueue"));
-      server = createServer(configuration);
+
+      server = addServer(createServer(configuration));
       server.start();
 
    }
@@ -110,14 +110,6 @@ public class AeroGearBasicServerTest extends ServiceTestBase
       {
          jetty.stop();
       }
-      if (locator != null)
-      {
-         locator.close();
-      }
-      if (server != null)
-      {
-         server.stop();
-      }
       super.tearDown();
    }
 
@@ -127,8 +119,7 @@ public class AeroGearBasicServerTest extends ServiceTestBase
       CountDownLatch latch = new CountDownLatch(1);
       AeroGearHandler aeroGearHandler = new AeroGearHandler(latch);
       jetty.addHandler(aeroGearHandler);
-      TransportConfiguration tpconf = new TransportConfiguration(INVM_CONNECTOR_FACTORY);
-      locator = ActiveMQClient.createServerLocatorWithoutHA(tpconf);
+      locator = createInVMNonHALocator();
       ClientSessionFactory sf = createSessionFactory(locator);
       ClientSession session = sf.createSession(false, true, true);
       ClientProducer producer = session.createProducer("testQueue");
@@ -276,8 +267,7 @@ public class AeroGearBasicServerTest extends ServiceTestBase
          }
 
       });
-      TransportConfiguration tpconf = new TransportConfiguration(INVM_CONNECTOR_FACTORY);
-      locator = ActiveMQClient.createServerLocatorWithoutHA(tpconf);
+      locator = createInVMNonHALocator();
       ClientSessionFactory sf = createSessionFactory(locator);
       ClientSession session = sf.createSession(false, true, true);
       ClientProducer producer = session.createProducer("testQueue");
@@ -330,8 +320,7 @@ public class AeroGearBasicServerTest extends ServiceTestBase
          }
 
       });
-      TransportConfiguration tpconf = new TransportConfiguration(INVM_CONNECTOR_FACTORY);
-      locator = ActiveMQClient.createServerLocatorWithoutHA(tpconf);
+      locator = createInVMNonHALocator();
       ClientSessionFactory sf = createSessionFactory(locator);
       ClientSession session = sf.createSession(false, true, true);
       ClientProducer producer = session.createProducer("testQueue");
@@ -368,8 +357,7 @@ public class AeroGearBasicServerTest extends ServiceTestBase
          }
 
       });
-      TransportConfiguration tpconf = new TransportConfiguration(INVM_CONNECTOR_FACTORY);
-      locator = ActiveMQClient.createServerLocatorWithoutHA(tpconf);
+      locator = createInVMNonHALocator();
       ClientSessionFactory sf = createSessionFactory(locator);
       ClientSession session = sf.createSession(false, true, true);
       ClientProducer producer = session.createProducer("testQueue");

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/AckBatchSizeTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/AckBatchSizeTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/AckBatchSizeTest.java
index 3eac8ed..7949f6e 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/AckBatchSizeTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/AckBatchSizeTest.java
@@ -23,13 +23,13 @@ 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.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.Queue;
 import org.junit.Assert;
 import org.junit.Test;
 
-public class AckBatchSizeTest extends ServiceTestBase
+public class AckBatchSizeTest extends ActiveMQTestBase
 {
    public final SimpleString addressA = new SimpleString("addressA");
 
@@ -64,10 +64,10 @@ public class AckBatchSizeTest extends ServiceTestBase
    {
       ActiveMQServer server = createServer(false);
       server.start();
-      ServerLocator locator = createInVMNonHALocator();
       int numMessages = 100;
-      locator.setAckBatchSize(numMessages * getMessageEncodeSize(addressA));
-      locator.setBlockOnAcknowledge(true);
+      ServerLocator locator = createInVMNonHALocator()
+              .setAckBatchSize(numMessages * getMessageEncodeSize(addressA))
+              .setBlockOnAcknowledge(true);
       ClientSessionFactory cf = createSessionFactory(locator);
       ClientSession sendSession = cf.createSession(false, true, true);
 
@@ -106,9 +106,9 @@ public class AckBatchSizeTest extends ServiceTestBase
       ActiveMQServer server = createServer(false);
 
       server.start();
-      ServerLocator locator = createInVMNonHALocator();
-      locator.setAckBatchSize(0);
-      locator.setBlockOnAcknowledge(true);
+      ServerLocator locator = createInVMNonHALocator()
+              .setAckBatchSize(0)
+              .setBlockOnAcknowledge(true);
       ClientSessionFactory cf = createSessionFactory(locator);
       ClientSession sendSession = cf.createSession(false, true, true);
       int numMessages = 100;

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/328611fd/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/AcknowledgeTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/AcknowledgeTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/AcknowledgeTest.java
index ef3621f..ea11db4 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/AcknowledgeTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/AcknowledgeTest.java
@@ -34,7 +34,7 @@ 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.tests.util.ServiceTestBase;
+import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
 import org.apache.activemq.artemis.core.client.impl.ClientSessionInternal;
 import org.apache.activemq.artemis.core.protocol.core.impl.ActiveMQConsumerContext;
 import org.apache.activemq.artemis.core.server.ActiveMQServer;
@@ -44,7 +44,7 @@ import org.apache.activemq.artemis.utils.UUID;
 import org.junit.Assert;
 import org.junit.Test;
 
-public class AcknowledgeTest extends ServiceTestBase
+public class AcknowledgeTest extends ActiveMQTestBase
 {
    private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER;
 
@@ -61,9 +61,9 @@ public class AcknowledgeTest extends ServiceTestBase
    {
       ActiveMQServer server = createServer(false);
       server.start();
-      ServerLocator locator = createInVMNonHALocator();
-      locator.setAckBatchSize(0);
-      locator.setBlockOnAcknowledge(true);
+      ServerLocator locator = createInVMNonHALocator()
+              .setAckBatchSize(0)
+              .setBlockOnAcknowledge(true);
       ClientSessionFactory cf = createSessionFactory(locator);
       ClientSession sendSession = cf.createSession(false, true, true);
       ClientSession session = cf.createSession(false, true, true);
@@ -136,9 +136,9 @@ public class AcknowledgeTest extends ServiceTestBase
    {
       ActiveMQServer server = createServer(false);
       server.start();
-      ServerLocator locator = createInVMNonHALocator();
-      locator.setBlockOnAcknowledge(true);
-      locator.setAckBatchSize(0);
+      ServerLocator locator = createInVMNonHALocator()
+              .setBlockOnAcknowledge(true)
+              .setAckBatchSize(0);
       ClientSessionFactory cf = createSessionFactory(locator);
       ClientSession sendSession = cf.createSession(false, true, true);
       final ClientSession session = cf.createSession(false, true, true);
@@ -193,11 +193,9 @@ public class AcknowledgeTest extends ServiceTestBase
       ActiveMQServer server = createServer(false);
       server.start();
 
-      ServerLocator locator = createInVMNonHALocator();
-
-      locator.setAckBatchSize(0);
-
-      locator.setBlockOnAcknowledge(true);
+      ServerLocator locator = createInVMNonHALocator()
+              .setAckBatchSize(0)
+              .setBlockOnAcknowledge(true);
 
       ClientSessionFactory cf = createSessionFactory(locator);
 
@@ -277,9 +275,9 @@ public class AcknowledgeTest extends ServiceTestBase
    {
       ActiveMQServer server = createServer(false);
       server.start();
-      ServerLocator locator = createInVMNonHALocator();
-      locator.setBlockOnAcknowledge(true);
-      locator.setAckBatchSize(0);
+      ServerLocator locator = createInVMNonHALocator()
+              .setBlockOnAcknowledge(true)
+              .setAckBatchSize(0);
       ClientSessionFactory cf = createSessionFactory(locator);
       ClientSession sendSession = cf.createSession(false, true, true);
       final ClientSession session = cf.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/ActiveMQCrashTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ActiveMQCrashTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ActiveMQCrashTest.java
index 018d694..32389c2 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ActiveMQCrashTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ActiveMQCrashTest.java
@@ -19,7 +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.Interceptor;
 import org.apache.activemq.artemis.api.core.Message;
-import org.apache.activemq.artemis.api.core.TransportConfiguration;
 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;
@@ -29,12 +28,11 @@ import org.apache.activemq.artemis.api.core.client.ServerLocator;
 import org.apache.activemq.artemis.core.config.Configuration;
 import org.apache.activemq.artemis.core.protocol.core.Packet;
 import org.apache.activemq.artemis.core.protocol.core.impl.PacketImpl;
-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.spi.core.protocol.RemotingConnection;
 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;
@@ -44,7 +42,7 @@ import org.junit.Test;
  * From https://jira.jboss.org/jira/browse/HORNETQ-144
  *
  */
-public class ActiveMQCrashTest extends ServiceTestBase
+public class ActiveMQCrashTest extends ActiveMQTestBase
 {
    private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER;
 
@@ -56,10 +54,8 @@ public class ActiveMQCrashTest extends ServiceTestBase
    @Test
    public void testHang() throws Exception
    {
-      Configuration configuration = createDefaultConfig()
-         .setPersistenceEnabled(false)
-         .setSecurityEnabled(false)
-         .addAcceptorConfiguration(new TransportConfiguration(InVMAcceptorFactory.class.getName()));
+      Configuration configuration = createDefaultInVMConfig()
+         .setPersistenceEnabled(false);
 
       server = addServer(ActiveMQServers.newActiveMQServer(configuration));
 
@@ -67,9 +63,6 @@ public class ActiveMQCrashTest extends ServiceTestBase
 
       server.getRemotingService().addIncomingInterceptor(new AckInterceptor(server));
 
-
-
-
       // Force an ack at once - this means the send call will block
       locator.setConfirmationWindowSize(1);
 

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/AddressSettingsTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/AddressSettingsTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/AddressSettingsTest.java
index d85d73c..a1b0ad7 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/AddressSettingsTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/AddressSettingsTest.java
@@ -26,11 +26,11 @@ import org.apache.activemq.artemis.api.core.client.ServerLocator;
 import org.apache.activemq.artemis.core.server.ActiveMQServer;
 import org.apache.activemq.artemis.core.settings.HierarchicalRepository;
 import org.apache.activemq.artemis.core.settings.impl.AddressSettings;
-import org.apache.activemq.artemis.tests.util.ServiceTestBase;
+import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
 import org.junit.Assert;
 import org.junit.Test;
 
-public class AddressSettingsTest extends ServiceTestBase
+public class AddressSettingsTest extends ActiveMQTestBase
 {
    private final SimpleString addressA = new SimpleString("addressA");
 
@@ -66,12 +66,12 @@ public class AddressSettingsTest extends ServiceTestBase
       ActiveMQServer server = createServer(false);
 
       server.start();
-      AddressSettings addressSettings = new AddressSettings();
-      addressSettings.setDeadLetterAddress(dlaA);
-      addressSettings.setMaxDeliveryAttempts(1);
-      AddressSettings addressSettings2 = new AddressSettings();
-      addressSettings2.setDeadLetterAddress(dlaB);
-      addressSettings2.setMaxDeliveryAttempts(1);
+      AddressSettings addressSettings = new AddressSettings()
+              .setDeadLetterAddress(dlaA)
+              .setMaxDeliveryAttempts(1);
+      AddressSettings addressSettings2 = new AddressSettings()
+              .setDeadLetterAddress(dlaB)
+              .setMaxDeliveryAttempts(1);
       HierarchicalRepository<AddressSettings> repos = server.getAddressSettingsRepository();
       repos.addMatch(addressA.toString(), addressSettings);
       repos.addMatch(addressB.toString(), addressSettings2);
@@ -123,12 +123,12 @@ public class AddressSettingsTest extends ServiceTestBase
       ActiveMQServer server = createServer(false);
 
       server.start();
-      AddressSettings addressSettings = new AddressSettings();
-      addressSettings.setDeadLetterAddress(dlaA);
-      addressSettings.setMaxDeliveryAttempts(1);
-      AddressSettings addressSettings2 = new AddressSettings();
-      addressSettings2.setDeadLetterAddress(dlaB);
-      addressSettings2.setMaxDeliveryAttempts(1);
+      AddressSettings addressSettings = new AddressSettings()
+              .setDeadLetterAddress(dlaA)
+              .setMaxDeliveryAttempts(1);
+      AddressSettings addressSettings2 = new AddressSettings()
+              .setDeadLetterAddress(dlaB)
+              .setMaxDeliveryAttempts(1);
       HierarchicalRepository<AddressSettings> repos = server.getAddressSettingsRepository();
       repos.addMatch(addressA.toString(), addressSettings);
       repos.addMatch("#", addressSettings2);
@@ -179,12 +179,12 @@ public class AddressSettingsTest extends ServiceTestBase
    {
       ActiveMQServer server = createServer(false);
       server.start();
-      AddressSettings addressSettings = new AddressSettings();
-      addressSettings.setDeadLetterAddress(dlaA);
-      addressSettings.setMaxDeliveryAttempts(1);
-      AddressSettings addressSettings2 = new AddressSettings();
-      addressSettings2.setDeadLetterAddress(dlaB);
-      addressSettings2.setMaxDeliveryAttempts(1);
+      AddressSettings addressSettings = new AddressSettings()
+              .setDeadLetterAddress(dlaA)
+              .setMaxDeliveryAttempts(1);
+      AddressSettings addressSettings2 = new AddressSettings()
+              .setDeadLetterAddress(dlaB)
+              .setMaxDeliveryAttempts(1);
       HierarchicalRepository<AddressSettings> repos = server.getAddressSettingsRepository();
       repos.addMatch(addressA.toString(), addressSettings);
       repos.addMatch("*", addressSettings2);
@@ -235,15 +235,15 @@ public class AddressSettingsTest extends ServiceTestBase
       ActiveMQServer server = createServer(false);
 
       server.start();
-      AddressSettings addressSettings = new AddressSettings();
-      addressSettings.setDeadLetterAddress(dlaA);
-      addressSettings.setMaxDeliveryAttempts(1);
-      AddressSettings addressSettings2 = new AddressSettings();
-      addressSettings2.setDeadLetterAddress(dlaB);
-      addressSettings2.setMaxDeliveryAttempts(1);
-      AddressSettings addressSettings3 = new AddressSettings();
-      addressSettings3.setDeadLetterAddress(dlaC);
-      addressSettings3.setMaxDeliveryAttempts(1);
+      AddressSettings addressSettings = new AddressSettings()
+              .setDeadLetterAddress(dlaA)
+              .setMaxDeliveryAttempts(1);
+      AddressSettings addressSettings2 = new AddressSettings()
+              .setDeadLetterAddress(dlaB)
+              .setMaxDeliveryAttempts(1);
+      AddressSettings addressSettings3 = new AddressSettings()
+              .setDeadLetterAddress(dlaC)
+              .setMaxDeliveryAttempts(1);
       HierarchicalRepository<AddressSettings> repos = server.getAddressSettingsRepository();
       repos.addMatch(addressA2.toString(), addressSettings);
       repos.addMatch("add.*", addressSettings2);
@@ -311,13 +311,13 @@ public class AddressSettingsTest extends ServiceTestBase
       ActiveMQServer server = createServer(false);
 
       server.start();
-      AddressSettings addressSettings = new AddressSettings();
-      addressSettings.setMaxDeliveryAttempts(1);
-      AddressSettings addressSettings2 = new AddressSettings();
-      addressSettings2.setMaxDeliveryAttempts(1);
-      AddressSettings addressSettings3 = new AddressSettings();
-      addressSettings3.setDeadLetterAddress(dlaC);
-      addressSettings3.setMaxDeliveryAttempts(1);
+      AddressSettings addressSettings = new AddressSettings()
+              .setMaxDeliveryAttempts(1);
+      AddressSettings addressSettings2 = new AddressSettings()
+              .setMaxDeliveryAttempts(1);
+      AddressSettings addressSettings3 = new AddressSettings()
+              .setDeadLetterAddress(dlaC)
+              .setMaxDeliveryAttempts(1);
       HierarchicalRepository<AddressSettings> repos = server.getAddressSettingsRepository();
       repos.addMatch(addressA2.toString(), addressSettings);
       repos.addMatch("add.*", addressSettings2);

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/AutoCloseCoreTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/AutoCloseCoreTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/AutoCloseCoreTest.java
index 4e63021..cb69657 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/AutoCloseCoreTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/AutoCloseCoreTest.java
@@ -31,7 +31,7 @@ public class AutoCloseCoreTest extends SingleServerTestBase
       ServerLocator locatorx;
       ClientSession sessionx;
       ClientSessionFactory factoryx;
-      try (ServerLocator locator = createLocator();
+      try (ServerLocator locator = createInVMNonHALocator();
            ClientSessionFactory factory = locator.createSessionFactory();
            ClientSession session = factory.createSession(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/client/AutogroupIdTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/AutogroupIdTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/AutogroupIdTest.java
index f683a0b..8e0b508 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/AutogroupIdTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/AutogroupIdTest.java
@@ -29,11 +29,12 @@ 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;
 import org.junit.Assert;
+import org.junit.Before;
 import org.junit.Test;
 
-public class AutogroupIdTest extends ServiceTestBase
+public class AutogroupIdTest extends ActiveMQTestBase
 {
    private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER;
 
@@ -47,8 +48,27 @@ public class AutogroupIdTest extends ServiceTestBase
 
    private final SimpleString groupTestQ = new SimpleString("testGroupQueue");
 
+   private ActiveMQServer server;
+
+   private ServerLocator locator;
+
    /* auto group id tests*/
 
+   @Override
+   @Before
+   public void setUp() throws Exception
+   {
+      super.setUp();
+
+      server = createServer(false);
+
+      server.start();
+
+      waitForServerToStart(server);
+
+      locator = createInVMNonHALocator();
+   }
+
    /*
    * tests when the autogroupid is set only 1 consumer (out of 2) gets all the messages from a single producer
    * */
@@ -56,11 +76,6 @@ public class AutogroupIdTest extends ServiceTestBase
    @Test
    public void testGroupIdAutomaticallySet() throws Exception
    {
-      ActiveMQServer server = createServer(false);
-
-      server.start();
-
-      ServerLocator locator = createInVMNonHALocator();
       locator.setAutoGroup(true);
       ClientSessionFactory sf = createSessionFactory(locator);
       ClientSession session = sf.createSession(false, true, true);
@@ -106,12 +121,6 @@ public class AutogroupIdTest extends ServiceTestBase
    @Test
    public void testGroupIdAutomaticallySetMultipleProducers() throws Exception
    {
-      ActiveMQServer server = createServer(false);
-
-      server.start();
-
-
-      ServerLocator locator = createInVMNonHALocator();
       locator.setAutoGroup(true);
       ClientSessionFactory sf = createSessionFactory(locator);
       ClientSession session = sf.createSession(false, true, true);
@@ -161,12 +170,6 @@ public class AutogroupIdTest extends ServiceTestBase
    @Test
    public void testGroupIdAutomaticallyNotSet() throws Exception
    {
-      ActiveMQServer server = createServer(false);
-
-      server.start();
-
-
-      ServerLocator locator = createInVMNonHALocator();
       ClientSessionFactory sf = createSessionFactory(locator);
 
       ClientSession session = 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/BlockingSendTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/BlockingSendTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/BlockingSendTest.java
index 0b624bc..e9045ba 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/BlockingSendTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/BlockingSendTest.java
@@ -23,11 +23,11 @@ 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;
 import org.junit.Assert;
 import org.junit.Test;
 
-public class BlockingSendTest extends ServiceTestBase
+public class BlockingSendTest extends ActiveMQTestBase
 {
 
    // Constants -----------------------------------------------------
@@ -55,8 +55,8 @@ public class BlockingSendTest extends ServiceTestBase
       server.start();
 
       System.out.println("sync = " + server.getConfiguration().isJournalSyncNonTransactional());
-      locator = createFactory(false);
-      locator.setBlockOnDurableSend(true);
+      locator = createInVMNonHALocator()
+              .setBlockOnDurableSend(true);
       factory = createSessionFactory(locator);
 
       session = factory.createSession();

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/CommitRollbackTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/CommitRollbackTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/CommitRollbackTest.java
index 6c0210f..f17f611 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/CommitRollbackTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/CommitRollbackTest.java
@@ -28,13 +28,13 @@ 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.server.Queue;
 import org.junit.Assert;
 import org.junit.Test;
 
-public class CommitRollbackTest extends ServiceTestBase
+public class CommitRollbackTest extends ActiveMQTestBase
 {
    public final SimpleString addressA = new SimpleString("addressA");
 
@@ -169,9 +169,9 @@ public class CommitRollbackTest extends ServiceTestBase
    {
       ActiveMQServer server = createServer(false);
       server.start();
-      ServerLocator locator = createInVMNonHALocator();
-      locator.setBlockOnAcknowledge(true);
-      locator.setAckBatchSize(0);
+      ServerLocator locator = createInVMNonHALocator()
+              .setBlockOnAcknowledge(true)
+              .setAckBatchSize(0);
       ClientSessionFactory cf = createSessionFactory(locator);
       ClientSession sendSession = cf.createSession(false, true, true);
       final ClientSession session = cf.createSession(false, true, false);
@@ -224,9 +224,9 @@ public class CommitRollbackTest extends ServiceTestBase
    {
       ActiveMQServer server = createServer(false);
       server.start();
-      ServerLocator locator = createInVMNonHALocator();
-      locator.setBlockOnAcknowledge(true);
-      locator.setAckBatchSize(0);
+      ServerLocator locator = createInVMNonHALocator()
+              .setBlockOnAcknowledge(true)
+              .setAckBatchSize(0);
       ClientSessionFactory cf = createSessionFactory(locator);
       ClientSession sendSession = cf.createSession(false, true, true);
       final ClientSession session = cf.createSession(false, true, 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/ConcurrentCreateDeleteProduceTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ConcurrentCreateDeleteProduceTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ConcurrentCreateDeleteProduceTest.java
index 59ea460..59b0602 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ConcurrentCreateDeleteProduceTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ConcurrentCreateDeleteProduceTest.java
@@ -26,7 +26,7 @@ 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.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.server.ActiveMQServer;
 import org.apache.activemq.artemis.core.server.Queue;
@@ -40,7 +40,7 @@ import org.junit.Test;
  * the NPE happened during depaging what let the server to recover itself on the next depage.
  * To verify a fix on this test against the previous version of QueueImpl look for NPEs on System.err
  */
-public class ConcurrentCreateDeleteProduceTest extends ServiceTestBase
+public class ConcurrentCreateDeleteProduceTest extends ActiveMQTestBase
 {
 
    volatile boolean running = true;
@@ -62,19 +62,18 @@ public class ConcurrentCreateDeleteProduceTest extends ServiceTestBase
    {
       super.setUp();
 
-      Configuration config = createDefaultConfig()
+      Configuration config = createDefaultInVMConfig()
          .setJournalSyncNonTransactional(false)
          .setJournalSyncTransactional(false);
 
-      server =
-         createServer(true, config,
-                      PAGE_SIZE,
-                      PAGE_MAX,
-                      new HashMap<String, AddressSettings>());
+      server = createServer(true, config,
+                            PAGE_SIZE,
+                            PAGE_MAX,
+                            new HashMap<String, AddressSettings>());
       server.start();
-      locator = createNonHALocator(false);
-      locator.setBlockOnDurableSend(false);
-      locator.setBlockOnAcknowledge(true);
+      locator = createNonHALocator(false)
+              .setBlockOnDurableSend(false)
+              .setBlockOnAcknowledge(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/ConsumerCloseTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ConsumerCloseTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ConsumerCloseTest.java
index cba7278..88e1df0 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ConsumerCloseTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ConsumerCloseTest.java
@@ -19,7 +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.ActiveMQExceptionType;
 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;
@@ -29,12 +28,11 @@ import org.apache.activemq.artemis.api.core.client.MessageHandler;
 import org.apache.activemq.artemis.api.core.client.ServerLocator;
 import org.apache.activemq.artemis.core.client.impl.ClientConsumerImpl;
 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.core.settings.impl.AddressSettings;
+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;
@@ -42,7 +40,7 @@ import org.junit.Test;
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.TimeUnit;
 
-public class ConsumerCloseTest extends ServiceTestBase
+public class ConsumerCloseTest extends ActiveMQTestBase
 {
 
    private ClientSessionFactory sf;
@@ -165,8 +163,7 @@ public class ConsumerCloseTest extends ServiceTestBase
    {
 
 
-      AddressSettings settings = new AddressSettings();
-      settings.setRedeliveryDelay(50000);
+      AddressSettings settings = new AddressSettings().setRedeliveryDelay(50000);
       server.getAddressSettingsRepository().addMatch("#", settings);
 
       ClientConsumer consumer = session.createConsumer(queue);
@@ -223,8 +220,7 @@ public class ConsumerCloseTest extends ServiceTestBase
    {
 
 
-      AddressSettings settings = new AddressSettings();
-      settings.setRedeliveryDelay(1000);
+      AddressSettings settings = new AddressSettings().setRedeliveryDelay(1000);
       server.getAddressSettingsRepository().addMatch("#", settings);
 
       ClientProducer producer = session.createProducer(address);
@@ -302,9 +298,7 @@ public class ConsumerCloseTest extends ServiceTestBase
    {
       super.setUp();
 
-      Configuration config = createDefaultConfig()
-         .addAcceptorConfiguration(new TransportConfiguration(InVMAcceptorFactory.class.getCanonicalName()))
-         .setSecurityEnabled(false);
+      Configuration config = createDefaultInVMConfig();
 
       server = addServer(ActiveMQServers.newActiveMQServer(config, false));
       server.start();

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/ConsumerFilterTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ConsumerFilterTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ConsumerFilterTest.java
index 22fc1b2..30527e8 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ConsumerFilterTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ConsumerFilterTest.java
@@ -25,11 +25,11 @@ import org.apache.activemq.artemis.api.core.client.ServerLocator;
 import org.apache.activemq.artemis.core.server.ActiveMQServer;
 import org.apache.activemq.artemis.core.server.impl.QueueImpl;
 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.Before;
 import org.junit.Test;
 
-public class ConsumerFilterTest extends ServiceTestBase
+public class ConsumerFilterTest 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/ConsumerRoundRobinTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ConsumerRoundRobinTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ConsumerRoundRobinTest.java
index 62ad8e6..f63705c 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ConsumerRoundRobinTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ConsumerRoundRobinTest.java
@@ -29,9 +29,9 @@ 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.integration.IntegrationTestLogger;
-import org.apache.activemq.artemis.tests.util.ServiceTestBase;
+import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
 
-public class ConsumerRoundRobinTest extends ServiceTestBase
+public class ConsumerRoundRobinTest 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/ConsumerStuckTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ConsumerStuckTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ConsumerStuckTest.java
index 0246b6b..f485e88 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ConsumerStuckTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ConsumerStuckTest.java
@@ -27,11 +27,11 @@ import org.apache.activemq.artemis.core.client.impl.ClientSessionFactoryImpl;
 import org.apache.activemq.artemis.core.protocol.core.impl.RemotingConnectionImpl;
 import org.apache.activemq.artemis.core.remoting.impl.netty.NettyConnection;
 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.Before;
 import org.junit.Test;
 
-public class ConsumerStuckTest extends ServiceTestBase
+public class ConsumerStuckTest extends ActiveMQTestBase
 {
    private ActiveMQServer server;
 
@@ -57,10 +57,10 @@ public class ConsumerStuckTest extends ServiceTestBase
    public void testClientStuckTest() throws Exception
    {
 
-      ServerLocator locator = createNettyNonHALocator();
-      locator.setConnectionTTL(1000);
-      locator.setClientFailureCheckPeriod(100);
-      locator.setConsumerWindowSize(10 * 1024 * 1024);
+      ServerLocator locator = createNettyNonHALocator()
+              .setConnectionTTL(1000)
+              .setClientFailureCheckPeriod(100)
+              .setConsumerWindowSize(10 * 1024 * 1024);
       ClientSessionFactory sf = locator.createSessionFactory();
       ((ClientSessionFactoryImpl) sf).stopPingingAfterOne();
 
@@ -168,10 +168,10 @@ public class ConsumerStuckTest extends ServiceTestBase
    public void testClientStuckTestWithDirectDelivery() throws Exception
    {
 
-      ServerLocator locator = createNettyNonHALocator();
-      locator.setConnectionTTL(1000);
-      locator.setClientFailureCheckPeriod(100);
-      locator.setConsumerWindowSize(10 * 1024 * 1024);
+      ServerLocator locator = createNettyNonHALocator()
+              .setConnectionTTL(1000)
+              .setClientFailureCheckPeriod(100)
+              .setConsumerWindowSize(10 * 1024 * 1024);
       ClientSessionFactory sf = locator.createSessionFactory();
       ((ClientSessionFactoryImpl) sf).stopPingingAfterOne();
 

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/ConsumerTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ConsumerTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ConsumerTest.java
index 40fa4dc..ada81d4 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ConsumerTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ConsumerTest.java
@@ -39,7 +39,7 @@ import org.apache.activemq.artemis.core.protocol.core.impl.PacketImpl;
 import org.apache.activemq.artemis.core.server.ActiveMQServer;
 import org.apache.activemq.artemis.core.server.Queue;
 import org.apache.activemq.artemis.spi.core.protocol.RemotingConnection;
-import org.apache.activemq.artemis.tests.util.ServiceTestBase;
+import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
 import org.apache.activemq.artemis.utils.ConcurrentHashSet;
 import org.junit.Assert;
 import org.junit.Before;
@@ -48,7 +48,7 @@ import org.junit.runner.RunWith;
 import org.junit.runners.Parameterized;
 
 @RunWith(value = Parameterized.class)
-public class ConsumerTest extends ServiceTestBase
+public class ConsumerTest extends ActiveMQTestBase
 {
    @Parameterized.Parameters(name = "isNetty={0}")
    public static Collection getParameters()
@@ -95,8 +95,8 @@ public class ConsumerTest extends ServiceTestBase
 
       for (int i = 0; i < 10; i++)
       {
-         ServerLocator locatorSendx = createFactory(isNetty());
-         locatorSendx.setReconnectAttempts(-1);
+         ServerLocator locatorSendx = createFactory(isNetty())
+                 .setReconnectAttempts(-1);
          ClientSessionFactory factoryx = locatorSendx.createSessionFactory();
          factoryx.close();
          locatorSendx.close();
@@ -287,9 +287,9 @@ public class ConsumerTest extends ServiceTestBase
             return true;
          }
       });
-      ServerLocator locator = createInVMNonHALocator();
-      locator.setConfirmationWindowSize(100);
-      locator.setAckBatchSize(-1);
+      ServerLocator locator = createInVMNonHALocator()
+              .setConfirmationWindowSize(100)
+              .setAckBatchSize(-1);
       ClientSessionFactory sfReceive = createSessionFactory(locator);
       ClientSession sessionRec = sfReceive.createSession(false, true, true);
       ClientConsumer consumer = sessionRec.createConsumer(QUEUE);
@@ -456,8 +456,8 @@ public class ConsumerTest extends ServiceTestBase
                {
                   try
                   {
-                     ServerLocator locatorSendx = createFactory(isNetty());
-                     locatorSendx.setReconnectAttempts(-1);
+                     ServerLocator locatorSendx = createFactory(isNetty())
+                             .setReconnectAttempts(-1);
                      ClientSessionFactory factoryx = locatorSendx.createSessionFactory();
                      ClientSession sessionSend = factoryx.createSession(true, true);
 
@@ -624,9 +624,8 @@ public class ConsumerTest extends ServiceTestBase
    @Test
    public void testConsumerCreditsOnRollbackLargeMessages() throws Exception
    {
-
-      locator.setConsumerWindowSize(10000);
-      locator.setMinLargeMessageSize(1000);
+      locator.setConsumerWindowSize(10000)
+              .setMinLargeMessageSize(1000);
 
       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/ConsumerWindowSizeTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ConsumerWindowSizeTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ConsumerWindowSizeTest.java
index 0c3a240..aa8b99e 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ConsumerWindowSizeTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ConsumerWindowSizeTest.java
@@ -33,7 +33,7 @@ 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.tests.util.ServiceTestBase;
+import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
 import org.apache.activemq.artemis.core.client.impl.ClientConsumerInternal;
 import org.apache.activemq.artemis.core.postoffice.Binding;
 import org.apache.activemq.artemis.core.postoffice.Bindings;
@@ -46,7 +46,7 @@ import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
 
-public class ConsumerWindowSizeTest extends ServiceTestBase
+public class ConsumerWindowSizeTest extends ActiveMQTestBase
 {
    private final SimpleString addressA = new SimpleString("addressA");
 
@@ -923,9 +923,8 @@ public class ConsumerWindowSizeTest extends ServiceTestBase
 
          server.start();
 
-         locator.setConsumerWindowSize(0);
-
-         locator.setMinLargeMessageSize(100);
+         locator.setConsumerWindowSize(0)
+                 .setMinLargeMessageSize(100);
 
          ClientSessionFactory sf = createSessionFactory(locator);
 
@@ -1027,8 +1026,7 @@ public class ConsumerWindowSizeTest extends ServiceTestBase
 
       ActiveMQServer server = createServer(false, isNetty());
 
-      AddressSettings settings = new AddressSettings();
-      settings.setMaxDeliveryAttempts(-1);
+      AddressSettings settings = new AddressSettings().setMaxDeliveryAttempts(-1);
       server.getAddressSettingsRepository().addMatch("#", settings);
 
       ClientSession session = 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/client/CoreClientTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/CoreClientTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/CoreClientTest.java
index 7002e8a..d375ed5 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/CoreClientTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/CoreClientTest.java
@@ -17,27 +17,22 @@
 package org.apache.activemq.artemis.tests.integration.client;
 
 import org.apache.activemq.artemis.api.core.ActiveMQBuffer;
-import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger;
-import org.apache.activemq.artemis.tests.util.ServiceTestBase;
-import org.junit.Test;
-
-import org.junit.Assert;
-
 import org.apache.activemq.artemis.api.core.SimpleString;
-import org.apache.activemq.artemis.api.core.TransportConfiguration;
 import org.apache.activemq.artemis.api.core.client.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.core.config.Configuration;
 import org.apache.activemq.artemis.core.server.ActiveMQServer;
 import org.apache.activemq.artemis.core.server.ActiveMQServers;
 import org.apache.activemq.artemis.jms.client.ActiveMQTextMessage;
+import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger;
+import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
+import org.junit.Assert;
+import org.junit.Test;
 
-public class CoreClientTest extends ServiceTestBase
+public class CoreClientTest extends ActiveMQTestBase
 {
    private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER;
 
@@ -54,29 +49,23 @@ public class CoreClientTest extends ServiceTestBase
    @Test
    public void testCoreClientNetty() throws Exception
    {
-      testCoreClient(NETTY_ACCEPTOR_FACTORY, NETTY_CONNECTOR_FACTORY);
+      testCoreClient(true);
    }
 
    @Test
    public void testCoreClientInVM() throws Exception
    {
-      testCoreClient(INVM_ACCEPTOR_FACTORY, INVM_CONNECTOR_FACTORY);
+      testCoreClient(false);
    }
 
-   private void testCoreClient(final String acceptorFactoryClassName, final String connectorFactoryClassName) throws Exception
+   private void testCoreClient(final boolean netty) throws Exception
    {
       final SimpleString QUEUE = new SimpleString("CoreClientTestQueue");
 
-      Configuration conf = createDefaultConfig()
-         .setSecurityEnabled(false)
-         .addAcceptorConfiguration(new TransportConfiguration(acceptorFactoryClassName));
-
-      ActiveMQServer server = addServer(ActiveMQServers.newActiveMQServer(conf, false));
+      ActiveMQServer server = addServer(ActiveMQServers.newActiveMQServer(createDefaultConfig(netty), false));
 
       server.start();
-      ServerLocator locator =
-               addServerLocator(ActiveMQClient.createServerLocatorWithoutHA(new TransportConfiguration(
-                  connectorFactoryClassName)));
+      ServerLocator locator = createNonHALocator(netty);
 
       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/CreateQueueIdempotentTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/CreateQueueIdempotentTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/CreateQueueIdempotentTest.java
index 0e189d6..ca9d0a1 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/CreateQueueIdempotentTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/CreateQueueIdempotentTest.java
@@ -16,24 +16,22 @@
  */
 package org.apache.activemq.artemis.tests.integration.client;
 
-import java.util.concurrent.atomic.AtomicInteger;
-
 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.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.ServiceTestBase;
-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.ActiveMQTestBase;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
 
-public class CreateQueueIdempotentTest extends ServiceTestBase
+import java.util.concurrent.atomic.AtomicInteger;
+
+public class CreateQueueIdempotentTest extends ActiveMQTestBase
 {
 
    private ActiveMQServer server;
@@ -43,12 +41,7 @@ public class CreateQueueIdempotentTest extends ServiceTestBase
    public void setUp() throws Exception
    {
       super.setUp();
-
-      Configuration conf = createDefaultConfig()
-         .setSecurityEnabled(false)
-         .addAcceptorConfiguration(new TransportConfiguration(INVM_ACCEPTOR_FACTORY));
-
-      server = addServer(ActiveMQServers.newActiveMQServer(conf, true));
+      server = addServer(ActiveMQServers.newActiveMQServer(createDefaultInVMConfig(), true));
       server.start();
    }
 

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/DeadLetterAddressTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/DeadLetterAddressTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/DeadLetterAddressTest.java
index 0a253e3..252c82b 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/DeadLetterAddressTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/DeadLetterAddressTest.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;
@@ -28,14 +26,13 @@ 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.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.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;
@@ -45,7 +42,7 @@ import java.util.Map;
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.TimeUnit;
 
-public class DeadLetterAddressTest extends ServiceTestBase
+public class DeadLetterAddressTest extends ActiveMQTestBase
 {
    private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER;
 
@@ -60,9 +57,9 @@ public class DeadLetterAddressTest extends ServiceTestBase
       SimpleString dla = new SimpleString("DLA");
       SimpleString qName = new SimpleString("q1");
       SimpleString adName = new SimpleString("ad1");
-      AddressSettings addressSettings = new AddressSettings();
-      addressSettings.setMaxDeliveryAttempts(1);
-      addressSettings.setDeadLetterAddress(dla);
+      AddressSettings addressSettings = new AddressSettings()
+              .setMaxDeliveryAttempts(1)
+              .setDeadLetterAddress(dla);
       server.getAddressSettingsRepository().addMatch(adName.toString(), addressSettings);
       SimpleString dlq = new SimpleString("DLQ1");
       clientSession.createQueue(dla, dlq, null, false);
@@ -94,9 +91,9 @@ public class DeadLetterAddressTest extends ServiceTestBase
    {
       SimpleString dla = new SimpleString("DLA");
       SimpleString qName = new SimpleString("q1");
-      AddressSettings addressSettings = new AddressSettings();
-      addressSettings.setMaxDeliveryAttempts(1);
-      addressSettings.setDeadLetterAddress(dla);
+      AddressSettings addressSettings = new AddressSettings()
+              .setMaxDeliveryAttempts(1)
+              .setDeadLetterAddress(dla);
       server.getAddressSettingsRepository().addMatch(qName.toString(), addressSettings);
       //SimpleString dlq = new SimpleString("DLQ1");
       //clientSession.createQueue(dla, dlq, null, false);
@@ -123,9 +120,9 @@ public class DeadLetterAddressTest extends ServiceTestBase
    {
       SimpleString dla = new SimpleString("DLA");
       SimpleString qName = new SimpleString("q1");
-      AddressSettings addressSettings = new AddressSettings();
-      addressSettings.setMaxDeliveryAttempts(2);
-      addressSettings.setDeadLetterAddress(dla);
+      AddressSettings addressSettings = new AddressSettings()
+              .setMaxDeliveryAttempts(2)
+              .setDeadLetterAddress(dla);
       server.getAddressSettingsRepository().addMatch(qName.toString(), addressSettings);
       SimpleString dlq = new SimpleString("DLQ1");
       clientSession.createQueue(dla, dlq, null, false);
@@ -161,9 +158,9 @@ public class DeadLetterAddressTest extends ServiceTestBase
    {
       SimpleString dla = new SimpleString("DLA");
       SimpleString qName = new SimpleString("q1");
-      AddressSettings addressSettings = new AddressSettings();
-      addressSettings.setMaxDeliveryAttempts(2);
-      addressSettings.setDeadLetterAddress(dla);
+      AddressSettings addressSettings = new AddressSettings()
+              .setMaxDeliveryAttempts(2)
+              .setDeadLetterAddress(dla);
       server.getAddressSettingsRepository().addMatch(qName.toString(), addressSettings);
       SimpleString dlq = new SimpleString("DLQ1");
       clientSession.createQueue(dla, dlq, null, false);
@@ -217,9 +214,9 @@ public class DeadLetterAddressTest extends ServiceTestBase
    {
       SimpleString dla = new SimpleString("DLA");
       SimpleString qName = new SimpleString("q1");
-      AddressSettings addressSettings = new AddressSettings();
-      addressSettings.setMaxDeliveryAttempts(1);
-      addressSettings.setDeadLetterAddress(dla);
+      AddressSettings addressSettings = new AddressSettings()
+              .setMaxDeliveryAttempts(1)
+              .setDeadLetterAddress(dla);
       server.getAddressSettingsRepository().addMatch(qName.toString(), addressSettings);
       SimpleString dlq = new SimpleString("DLQ1");
       SimpleString dlq2 = new SimpleString("DLQ2");
@@ -257,8 +254,7 @@ public class DeadLetterAddressTest extends ServiceTestBase
    public void testBasicSendToNoQueue() throws Exception
    {
       SimpleString qName = new SimpleString("q1");
-      AddressSettings addressSettings = new AddressSettings();
-      addressSettings.setMaxDeliveryAttempts(1);
+      AddressSettings addressSettings = new AddressSettings().setMaxDeliveryAttempts(1);
       server.getAddressSettingsRepository().addMatch(qName.toString(), addressSettings);
       clientSession.createQueue(qName, qName, null, false);
       ClientProducer producer = clientSession.createProducer(qName);
@@ -283,9 +279,9 @@ public class DeadLetterAddressTest extends ServiceTestBase
       final int NUM_MESSAGES = 5;
       SimpleString dla = new SimpleString("DLA");
       SimpleString qName = new SimpleString("q1");
-      AddressSettings addressSettings = new AddressSettings();
-      addressSettings.setMaxDeliveryAttempts(MAX_DELIVERIES);
-      addressSettings.setDeadLetterAddress(dla);
+      AddressSettings addressSettings = new AddressSettings()
+              .setMaxDeliveryAttempts(MAX_DELIVERIES)
+              .setDeadLetterAddress(dla);
       server.getAddressSettingsRepository().addMatch(qName.toString(), addressSettings);
       SimpleString dlq = new SimpleString("DLQ1");
       clientSession.createQueue(dla, dlq, null, false);
@@ -371,9 +367,9 @@ public class DeadLetterAddressTest extends ServiceTestBase
       SimpleString queue = RandomUtil.randomSimpleString();
       SimpleString deadLetterAddress = RandomUtil.randomSimpleString();
       SimpleString deadLetterQueue = RandomUtil.randomSimpleString();
-      AddressSettings addressSettings = new AddressSettings();
-      addressSettings.setMaxDeliveryAttempts(deliveryAttempt);
-      addressSettings.setDeadLetterAddress(deadLetterAddress);
+      AddressSettings addressSettings = new AddressSettings()
+              .setMaxDeliveryAttempts(deliveryAttempt)
+              .setDeadLetterAddress(deadLetterAddress);
       server.getAddressSettingsRepository().setDefault(addressSettings);
 
       clientSession.createQueue(address, queue, false);
@@ -414,9 +410,9 @@ public class DeadLetterAddressTest extends ServiceTestBase
       SimpleString queue = RandomUtil.randomSimpleString();
       SimpleString deadLetterAddress = RandomUtil.randomSimpleString();
       SimpleString deadLetterQueue = RandomUtil.randomSimpleString();
-      AddressSettings addressSettings = new AddressSettings();
-      addressSettings.setMaxDeliveryAttempts(deliveryAttempt);
-      addressSettings.setDeadLetterAddress(deadLetterAddress);
+      AddressSettings addressSettings = new AddressSettings()
+              .setMaxDeliveryAttempts(deliveryAttempt)
+              .setDeadLetterAddress(deadLetterAddress);
       server.getAddressSettingsRepository().addMatch("*", addressSettings);
 
       clientSession.createQueue(address, queue, false);
@@ -459,13 +455,13 @@ public class DeadLetterAddressTest extends ServiceTestBase
       SimpleString specificDeadLetterAddress = RandomUtil.randomSimpleString();
       SimpleString specificDeadLetterQueue = RandomUtil.randomSimpleString();
 
-      AddressSettings defaultAddressSettings = new AddressSettings();
-      defaultAddressSettings.setMaxDeliveryAttempts(defaultDeliveryAttempt);
-      defaultAddressSettings.setDeadLetterAddress(defaultDeadLetterAddress);
+      AddressSettings defaultAddressSettings = new AddressSettings()
+              .setMaxDeliveryAttempts(defaultDeliveryAttempt)
+              .setDeadLetterAddress(defaultDeadLetterAddress);
       server.getAddressSettingsRepository().addMatch("*", defaultAddressSettings);
-      AddressSettings specificAddressSettings = new AddressSettings();
-      specificAddressSettings.setMaxDeliveryAttempts(specificeDeliveryAttempt);
-      specificAddressSettings.setDeadLetterAddress(specificDeadLetterAddress);
+      AddressSettings specificAddressSettings = new AddressSettings()
+              .setMaxDeliveryAttempts(specificeDeliveryAttempt)
+              .setDeadLetterAddress(specificDeadLetterAddress);
       server.getAddressSettingsRepository().addMatch(address.toString(), specificAddressSettings);
 
       clientSession.createQueue(address, queue, false);
@@ -509,18 +505,10 @@ public class DeadLetterAddressTest 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
-      locator =
-               addServerLocator(ActiveMQClient.createServerLocatorWithoutHA(new TransportConfiguration(
-                  INVM_CONNECTOR_FACTORY)));
+      locator = createInVMNonHALocator();
       ClientSessionFactory sessionFactory = createSessionFactory(locator);
       clientSession = addClientSession(sessionFactory.createSession(false, true, 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/DeliveryOrderTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/DeliveryOrderTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/DeliveryOrderTest.java
index a06c046..0054132 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/DeliveryOrderTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/DeliveryOrderTest.java
@@ -29,13 +29,13 @@ 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.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
 
-public class DeliveryOrderTest extends ServiceTestBase
+public class DeliveryOrderTest extends ActiveMQTestBase
 {
    public final SimpleString addressA = new SimpleString("addressA");
 

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/DurableQueueTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/DurableQueueTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/DurableQueueTest.java
index 4d571fc..d46d4b8 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/DurableQueueTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/DurableQueueTest.java
@@ -31,9 +31,9 @@ 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;
 
-public class DurableQueueTest extends ServiceTestBase
+public class DurableQueueTest 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/ExpireTestOnRestartTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ExpireTestOnRestartTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ExpireTestOnRestartTest.java
index 1d8e7ee..e8b0442 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ExpireTestOnRestartTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ExpireTestOnRestartTest.java
@@ -27,11 +27,11 @@ import org.apache.activemq.artemis.core.server.ActiveMQServer;
 import org.apache.activemq.artemis.core.server.Queue;
 import org.apache.activemq.artemis.core.settings.impl.AddressFullMessagePolicy;
 import org.apache.activemq.artemis.core.settings.impl.AddressSettings;
-import org.apache.activemq.artemis.tests.util.ServiceTestBase;
+import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
 import org.junit.Before;
 import org.junit.Test;
 
-public class ExpireTestOnRestartTest extends ServiceTestBase
+public class ExpireTestOnRestartTest extends ActiveMQTestBase
 {
 
    ActiveMQServer server;
@@ -43,11 +43,11 @@ public class ExpireTestOnRestartTest extends ServiceTestBase
    {
       super.setUp();
       server = createServer(true);
-      AddressSettings setting = new AddressSettings();
-      setting.setExpiryAddress(SimpleString.toSimpleString("exp"));
-      setting.setAddressFullMessagePolicy(AddressFullMessagePolicy.PAGE);
-      setting.setPageSizeBytes(100 * 1024);
-      setting.setMaxSizeBytes(200 * 1024);
+      AddressSettings setting = new AddressSettings()
+              .setExpiryAddress(SimpleString.toSimpleString("exp"))
+              .setAddressFullMessagePolicy(AddressFullMessagePolicy.PAGE)
+              .setPageSizeBytes(100 * 1024)
+              .setMaxSizeBytes(200 * 1024);
       server.getConfiguration().setJournalSyncNonTransactional(false);
       server.getConfiguration().setMessageExpiryScanPeriod(-1);
       server.getConfiguration().setJournalSyncTransactional(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/ExpiryAddressTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ExpiryAddressTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ExpiryAddressTest.java
index 409a6da..729d443 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ExpiryAddressTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ExpiryAddressTest.java
@@ -18,27 +18,24 @@ package org.apache.activemq.artemis.tests.integration.client;
 
 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;
 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.message.impl.MessageImpl;
 import org.apache.activemq.artemis.core.server.ActiveMQServer;
 import org.apache.activemq.artemis.core.server.ActiveMQServers;
 import org.apache.activemq.artemis.core.settings.impl.AddressSettings;
 import org.apache.activemq.artemis.tests.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 ExpiryAddressTest extends ServiceTestBase
+public class ExpiryAddressTest extends ActiveMQTestBase
 {
    private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER;
 
@@ -54,8 +51,7 @@ public class ExpiryAddressTest extends ServiceTestBase
       SimpleString adSend = new SimpleString("a1");
       SimpleString qName = new SimpleString("q1");
       SimpleString eq = new SimpleString("EA1");
-      AddressSettings addressSettings = new AddressSettings();
-      addressSettings.setExpiryAddress(ea);
+      AddressSettings addressSettings = new AddressSettings().setExpiryAddress(ea);
       server.getAddressSettingsRepository().addMatch("#", addressSettings);
       clientSession.createQueue(ea, eq, null, false);
       clientSession.createQueue(adSend, qName, null, false);
@@ -89,8 +85,7 @@ public class ExpiryAddressTest extends ServiceTestBase
       SimpleString expiryAddress1 = new SimpleString("expiryAddress1");
       SimpleString qName = new SimpleString("q1");
       SimpleString expiryQueue1 = new SimpleString("expiryQueue1");
-      AddressSettings addressSettings = new AddressSettings();
-      addressSettings.setExpiryAddress(expiryAddress1);
+      AddressSettings addressSettings = new AddressSettings().setExpiryAddress(expiryAddress1);
       server.getAddressSettingsRepository().addMatch(qName.toString(), addressSettings);
       clientSession.createQueue(expiryAddress1, expiryQueue1, null, false);
       clientSession.createQueue(qName, qName, null, false);
@@ -98,8 +93,7 @@ public class ExpiryAddressTest extends ServiceTestBase
       // override "original" address settings
       SimpleString expiryAddress2 = new SimpleString("expiryAddress2");
       SimpleString expiryQueue2 = new SimpleString("expiryQueue2");
-      addressSettings = new AddressSettings();
-      addressSettings.setExpiryAddress(expiryAddress2);
+      addressSettings = new AddressSettings().setExpiryAddress(expiryAddress2);
       server.getAddressSettingsRepository().addMatch(qName.toString(), addressSettings);
       clientSession.createQueue(expiryAddress2, expiryQueue2, null, false);
 
@@ -142,8 +136,7 @@ public class ExpiryAddressTest extends ServiceTestBase
       SimpleString qName = new SimpleString("q1");
       SimpleString eq = new SimpleString("EQ1");
       SimpleString eq2 = new SimpleString("EQ2");
-      AddressSettings addressSettings = new AddressSettings();
-      addressSettings.setExpiryAddress(ea);
+      AddressSettings addressSettings = new AddressSettings().setExpiryAddress(ea);
       server.getAddressSettingsRepository().addMatch(qName.toString(), addressSettings);
       clientSession.createQueue(ea, eq, null, false);
       clientSession.createQueue(ea, eq2, null, false);
@@ -225,15 +218,12 @@ public class ExpiryAddressTest extends ServiceTestBase
       final int NUM_MESSAGES = 5;
       SimpleString ea = new SimpleString("DLA");
       SimpleString qName = new SimpleString("q1");
-      AddressSettings addressSettings = new AddressSettings();
-      addressSettings.setExpiryAddress(ea);
+      AddressSettings addressSettings = new AddressSettings().setExpiryAddress(ea);
       server.getAddressSettingsRepository().addMatch(qName.toString(), addressSettings);
       SimpleString eq = new SimpleString("EA1");
       clientSession.createQueue(ea, eq, null, false);
       clientSession.createQueue(qName, qName, null, false);
-      ServerLocator locator1 =
-               addServerLocator(ActiveMQClient.createServerLocatorWithoutHA(new TransportConfiguration(
-                  INVM_CONNECTOR_FACTORY)));
+      ServerLocator locator1 = createInVMNonHALocator();
 
       ClientSessionFactory sessionFactory = createSessionFactory(locator1);
 
@@ -282,8 +272,7 @@ public class ExpiryAddressTest extends ServiceTestBase
       SimpleString ea = new SimpleString("EA");
       SimpleString qName = new SimpleString("q1");
       SimpleString eq = new SimpleString("EA1");
-      AddressSettings addressSettings = new AddressSettings();
-      addressSettings.setExpiryAddress(ea);
+      AddressSettings addressSettings = new AddressSettings().setExpiryAddress(ea);
       server.getAddressSettingsRepository().setDefault(addressSettings);
       clientSession.createQueue(ea, eq, null, false);
       clientSession.createQueue(qName, qName, null, false);
@@ -312,8 +301,7 @@ public class ExpiryAddressTest extends ServiceTestBase
       SimpleString ea = new SimpleString("EA");
       SimpleString qName = new SimpleString("q1");
       SimpleString eq = new SimpleString("EA1");
-      AddressSettings addressSettings = new AddressSettings();
-      addressSettings.setExpiryAddress(ea);
+      AddressSettings addressSettings = new AddressSettings().setExpiryAddress(ea);
       server.getAddressSettingsRepository().addMatch("*", addressSettings);
       clientSession.createQueue(ea, eq, null, false);
       clientSession.createQueue(qName, qName, null, false);
@@ -346,11 +334,9 @@ public class ExpiryAddressTest extends ServiceTestBase
       SimpleString specificExpiryAddress = RandomUtil.randomSimpleString();
       SimpleString specificExpiryQueue = RandomUtil.randomSimpleString();
 
-      AddressSettings defaultAddressSettings = new AddressSettings();
-      defaultAddressSettings.setExpiryAddress(defaultExpiryAddress);
+      AddressSettings defaultAddressSettings = new AddressSettings().setExpiryAddress(defaultExpiryAddress);
       server.getAddressSettingsRepository().addMatch("prefix.*", defaultAddressSettings);
-      AddressSettings specificAddressSettings = new AddressSettings();
-      specificAddressSettings.setExpiryAddress(specificExpiryAddress);
+      AddressSettings specificAddressSettings = new AddressSettings().setExpiryAddress(specificExpiryAddress);
       server.getAddressSettingsRepository().addMatch("prefix.address", specificAddressSettings);
 
       clientSession.createQueue(address, queue, false);
@@ -385,21 +371,14 @@ public class ExpiryAddressTest 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
-      locator = createInVMNonHALocator();
-      locator.setBlockOnAcknowledge(true);
+      locator = createInVMNonHALocator()
+              .setBlockOnAcknowledge(true);
       ClientSessionFactory sessionFactory = createSessionFactory(locator);
       // There are assertions over sizes that needs to be done after the ACK
       // was received on server
       clientSession = addClientSession(sessionFactory.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/ExpiryLargeMessageTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ExpiryLargeMessageTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ExpiryLargeMessageTest.java
index 2c065dd..6e18d70 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ExpiryLargeMessageTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ExpiryLargeMessageTest.java
@@ -27,7 +27,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.integration.IntegrationTestLogger;
-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.Queue;
 import org.apache.activemq.artemis.core.settings.impl.AddressFullMessagePolicy;
@@ -37,7 +37,7 @@ import org.junit.Test;
 /**
  * This test will send large messages in page-mode, DLQ then, expiry then, and they should be received fine
  */
-public class ExpiryLargeMessageTest extends ServiceTestBase
+public class ExpiryLargeMessageTest extends ActiveMQTestBase
 {
 
    private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER;
@@ -69,20 +69,14 @@ public class ExpiryLargeMessageTest extends ServiceTestBase
 
       server.getConfiguration().setMessageExpiryScanPeriod(600000);
 
-      AddressSettings setting = new AddressSettings();
-      setting.setAddressFullMessagePolicy(AddressFullMessagePolicy.PAGE);
-      setting.setMaxDeliveryAttempts(5);
-      setting.setMaxSizeBytes(50 * 1024);
-      setting.setPageSizeBytes(10 * 1024);
-      setting.setExpiryAddress(EXPIRY);
-      setting.setDeadLetterAddress(DLQ);
+      AddressSettings setting = new AddressSettings()
+              .setAddressFullMessagePolicy(AddressFullMessagePolicy.PAGE)
+              .setMaxDeliveryAttempts(5)
+              .setMaxSizeBytes(50 * 1024)
+              .setPageSizeBytes(10 * 1024)
+              .setExpiryAddress(EXPIRY)
+              .setDeadLetterAddress(DLQ);
       server.getAddressSettingsRepository().addMatch(MY_QUEUE.toString(), setting);
-
-      setting.setAddressFullMessagePolicy(AddressFullMessagePolicy.PAGE);
-      setting.setMaxDeliveryAttempts(5);
-      setting.setMaxSizeBytes(50 * 1024);
-      setting.setPageSizeBytes(10 * 1024);
-      setting.setDeadLetterAddress(DLQ);
       server.getAddressSettingsRepository().addMatch(EXPIRY.toString(), setting);
 
       server.start();
@@ -281,20 +275,14 @@ public class ExpiryLargeMessageTest extends ServiceTestBase
 
       server.getConfiguration().setMessageExpiryScanPeriod(600000);
 
-      AddressSettings setting = new AddressSettings();
-      setting.setAddressFullMessagePolicy(AddressFullMessagePolicy.PAGE);
-      setting.setMaxDeliveryAttempts(5);
-      setting.setMaxSizeBytes(-1);
-      setting.setPageSizeBytes(10 * 1024);
-      setting.setExpiryAddress(EXPIRY);
-      setting.setDeadLetterAddress(DLQ);
+      AddressSettings setting = new AddressSettings()
+              .setAddressFullMessagePolicy(AddressFullMessagePolicy.PAGE)
+              .setMaxDeliveryAttempts(5)
+              .setMaxSizeBytes(-1)
+              .setPageSizeBytes(10 * 1024)
+              .setExpiryAddress(EXPIRY)
+              .setDeadLetterAddress(DLQ);
       server.getAddressSettingsRepository().addMatch(MY_QUEUE.toString(), setting);
-
-      setting.setAddressFullMessagePolicy(AddressFullMessagePolicy.PAGE);
-      setting.setMaxDeliveryAttempts(5);
-      setting.setMaxSizeBytes(-1);
-      setting.setPageSizeBytes(10 * 1024);
-      setting.setDeadLetterAddress(DLQ);
       server.getAddressSettingsRepository().addMatch(EXPIRY.toString(), setting);
 
       server.start();


Mime
View raw message