activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clebertsuco...@apache.org
Subject [12/21] activemq-artemis git commit: More test-suite refactoring
Date Thu, 28 May 2015 15:19:03 GMT
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/328611fd/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/QueueBrowserTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/QueueBrowserTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/QueueBrowserTest.java
index c8170a1..19624da 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/QueueBrowserTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/QueueBrowserTest.java
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 package org.apache.activemq.artemis.tests.integration.client;
-import org.apache.activemq.artemis.tests.util.ServiceTestBase;
+import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
 import org.junit.Before;
 
 import org.junit.Test;
@@ -32,7 +32,7 @@ import org.apache.activemq.artemis.api.core.client.ServerLocator;
 import org.apache.activemq.artemis.core.server.ActiveMQServer;
 import org.apache.activemq.artemis.core.server.Queue;
 
-public class QueueBrowserTest extends ServiceTestBase
+public class QueueBrowserTest 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/client/ReceiveImmediateTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ReceiveImmediateTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ReceiveImmediateTest.java
index 7bca4d2..1164976 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ReceiveImmediateTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ReceiveImmediateTest.java
@@ -34,9 +34,9 @@ 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.Queue;
-import org.apache.activemq.artemis.tests.util.ServiceTestBase;
+import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
 
-public class ReceiveImmediateTest extends ServiceTestBase
+public class ReceiveImmediateTest extends ActiveMQTestBase
 {
    private ActiveMQServer server;
 
@@ -51,8 +51,7 @@ public class ReceiveImmediateTest extends ServiceTestBase
    public void setUp() throws Exception
    {
       super.setUp();
-
-      Configuration config = createDefaultConfig();
+      Configuration config = createDefaultInVMConfig();
       server = createServer(false, config);
       server.start();
       locator = createInVMNonHALocator();
@@ -87,9 +86,10 @@ public class ReceiveImmediateTest extends ServiceTestBase
    @Test
    public void testConsumerReceiveImmediateWithSessionStop() throws Exception
    {
-      locator.setBlockOnNonDurableSend(true);
-      locator.setBlockOnAcknowledge(true);
-      locator.setAckBatchSize(0);
+      locator.setBlockOnNonDurableSend(true)
+              .setBlockOnAcknowledge(true)
+              .setAckBatchSize(0);
+
       sf = createSessionFactory(locator);
       ClientSession session = sf.createSession(false, true, true);
 
@@ -195,9 +195,10 @@ public class ReceiveImmediateTest extends ServiceTestBase
 
    private void doConsumerReceiveImmediateWithNoMessages(final boolean browser) throws Exception
    {
-      locator.setBlockOnNonDurableSend(true);
-      locator.setBlockOnAcknowledge(true);
-      locator.setAckBatchSize(0);
+      locator.setBlockOnNonDurableSend(true)
+              .setBlockOnAcknowledge(true)
+              .setAckBatchSize(0);
+
       sf = createSessionFactory(locator);
 
       ClientSession session = sf.createSession(false, true, false);
@@ -215,10 +216,10 @@ public class ReceiveImmediateTest extends ServiceTestBase
 
    private void doConsumerReceiveImmediate(final boolean browser) throws Exception
    {
+      locator.setBlockOnNonDurableSend(true)
+              .setBlockOnAcknowledge(true)
+              .setAckBatchSize(0);
 
-      locator.setBlockOnNonDurableSend(true);
-      locator.setBlockOnAcknowledge(true);
-      locator.setAckBatchSize(0);
       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/ReceiveTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ReceiveTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ReceiveTest.java
index 487fde1..ecaa481 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ReceiveTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ReceiveTest.java
@@ -27,13 +27,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 ReceiveTest extends ServiceTestBase
+public class ReceiveTest extends ActiveMQTestBase
 {
    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/RedeliveryConsumerTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/RedeliveryConsumerTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/RedeliveryConsumerTest.java
index 85031fb..91cd81e 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/RedeliveryConsumerTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/RedeliveryConsumerTest.java
@@ -36,11 +36,11 @@ import org.apache.activemq.artemis.core.journal.impl.NIOSequentialFileFactory;
 import org.apache.activemq.artemis.core.persistence.impl.journal.JournalRecordIds;
 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.Test;
 
-public class RedeliveryConsumerTest extends ServiceTestBase
+public class RedeliveryConsumerTest extends ActiveMQTestBase
 {
 
    // Constants -----------------------------------------------------
@@ -351,7 +351,7 @@ public class RedeliveryConsumerTest extends ServiceTestBase
     */
    private void setUp(final boolean persistDeliveryCountBeforeDelivery) throws Exception
    {
-      Configuration config = createDefaultConfig()
+      Configuration config = createDefaultInVMConfig()
          .setPersistDeliveryCountBeforeDelivery(persistDeliveryCountBeforeDelivery);
 
       server = createServer(true, config);
@@ -360,7 +360,7 @@ public class RedeliveryConsumerTest extends ServiceTestBase
       locator = createInVMNonHALocator();
       factory = createSessionFactory(locator);
 
-      ClientSession session = factory.createSession(false, false, false);
+      ClientSession session = addClientSession(factory.createSession(false, false, false));
       try
       {
          session.createQueue(ADDRESS, ADDRESS, 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/RequestorTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/RequestorTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/RequestorTest.java
index fea0f95..f74022a 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/RequestorTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/RequestorTest.java
@@ -28,22 +28,19 @@ 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.client.impl.ClientMessageImpl;
-import org.apache.activemq.artemis.core.config.Configuration;
 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.tests.util.ActiveMQTestBase;
 import org.apache.activemq.artemis.tests.util.RandomUtil;
-import org.apache.activemq.artemis.tests.util.ServiceTestBase;
-import org.apache.activemq.artemis.tests.util.TransportConfigurationUtils;
-import org.junit.After;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
 
-public class RequestorTest extends ServiceTestBase
+public class RequestorTest extends ActiveMQTestBase
 {
 
-   private ActiveMQServer service;
+   private ActiveMQServer server;
    private ClientSessionFactory sf;
    private ServerLocator locator;
 
@@ -82,10 +79,10 @@ public class RequestorTest extends ServiceTestBase
       final SimpleString key = RandomUtil.randomSimpleString();
       long value = RandomUtil.randomLong();
 
-      AddressSettings settings = new AddressSettings();
-      settings.setAddressFullMessagePolicy(AddressFullMessagePolicy.BLOCK);
-      settings.setMaxSizeBytes(1024);
-      service.getAddressSettingsRepository().addMatch("#", settings);
+      AddressSettings settings = new AddressSettings()
+              .setAddressFullMessagePolicy(AddressFullMessagePolicy.BLOCK)
+              .setMaxSizeBytes(1024);
+      server.getAddressSettingsRepository().addMatch("#", settings);
 
       SimpleString requestAddress = new SimpleString("RequestAddress");
 
@@ -213,9 +210,9 @@ public class RequestorTest extends ServiceTestBase
          }
       };
 
-      ServiceTestBase.expectActiveMQException("ClientRequestor's session must not be closed",
-              ActiveMQExceptionType.OBJECT_CLOSED,
-              activeMQAction);
+      ActiveMQTestBase.expectActiveMQException("ClientRequestor's session must not be closed",
+                                               ActiveMQExceptionType.OBJECT_CLOSED,
+                                               activeMQAction);
    }
 
    @Test
@@ -257,8 +254,8 @@ public class RequestorTest extends ServiceTestBase
          }
       };
 
-      ServiceTestBase.expectActiveMQException("can not send a request on a closed ClientRequestor",
-                                           ActiveMQExceptionType.OBJECT_CLOSED, activeMQAction);
+      ActiveMQTestBase.expectActiveMQException("can not send a request on a closed ClientRequestor",
+                                               ActiveMQExceptionType.OBJECT_CLOSED, activeMQAction);
    }
 
    @Override
@@ -266,30 +263,13 @@ public class RequestorTest extends ServiceTestBase
    public void setUp() throws Exception
    {
       super.setUp();
-
-      Configuration conf = createDefaultConfig()
-         .addAcceptorConfiguration(TransportConfigurationUtils.getInVMAcceptor(true));
-      service = createServer(false, conf);
-      service.start();
-
-      locator = createInVMNonHALocator();
-      locator.setAckBatchSize(0);
+      server = createServer(false, createDefaultInVMConfig());
+      server.start();
+      locator = createInVMNonHALocator()
+              .setAckBatchSize(0);
       sf = createSessionFactory(locator);
    }
 
-   @Override
-   @After
-   public void tearDown() throws Exception
-   {
-      locator = null;
-
-      sf = null;
-
-      service = null;
-
-      super.tearDown();
-   }
-
    private final class SimpleMessageHandler implements MessageHandler
    {
       private final SimpleString key;

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/RoutingTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/RoutingTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/RoutingTest.java
index f160d71..636ba3f 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/RoutingTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/RoutingTest.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.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
 
-public class RoutingTest extends ServiceTestBase
+public class RoutingTest extends ActiveMQTestBase
 {
    public final SimpleString addressA = new SimpleString("addressA");
    public final SimpleString queueA = new SimpleString("queueA");

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/SelfExpandingBufferTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SelfExpandingBufferTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SelfExpandingBufferTest.java
index 23814fa..90483db 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SelfExpandingBufferTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SelfExpandingBufferTest.java
@@ -27,11 +27,11 @@ 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.RandomUtil;
-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 SelfExpandingBufferTest extends ServiceTestBase
+public class SelfExpandingBufferTest extends ActiveMQTestBase
 {
 
    private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER;
@@ -117,7 +117,7 @@ public class SelfExpandingBufferTest extends ServiceTestBase
 
          msg2.getBodyBuffer().readBytes(receivedBytes);
 
-         ServiceTestBase.assertEqualsByteArrays(bytes, receivedBytes);
+         ActiveMQTestBase.assertEqualsByteArrays(bytes, receivedBytes);
 
          msg2 = cons.receive(3000);
 
@@ -125,7 +125,7 @@ public class SelfExpandingBufferTest extends ServiceTestBase
 
          msg2.getBodyBuffer().readBytes(receivedBytes);
 
-         ServiceTestBase.assertEqualsByteArrays(bytes, receivedBytes);
+         ActiveMQTestBase.assertEqualsByteArrays(bytes, receivedBytes);
       }
       finally
       {

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/ServerLocatorConnectTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ServerLocatorConnectTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ServerLocatorConnectTest.java
index 2fb373f..94c3619 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ServerLocatorConnectTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ServerLocatorConnectTest.java
@@ -28,11 +28,11 @@ import org.apache.activemq.artemis.core.client.impl.ClientSessionFactoryInternal
 import org.apache.activemq.artemis.core.client.impl.ServerLocatorInternal;
 import org.apache.activemq.artemis.core.config.Configuration;
 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 ServerLocatorConnectTest extends ServiceTestBase
+public class ServerLocatorConnectTest 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/client/SessionCloseOnGCTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SessionCloseOnGCTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SessionCloseOnGCTest.java
index debde03..e57bff8 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SessionCloseOnGCTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SessionCloseOnGCTest.java
@@ -21,14 +21,14 @@ import org.apache.activemq.artemis.api.core.client.ClientSessionFactory;
 import org.apache.activemq.artemis.api.core.client.ServerLocator;
 import org.apache.activemq.artemis.core.client.impl.ClientSessionFactoryImpl;
 import org.apache.activemq.artemis.core.server.ActiveMQServer;
-import org.apache.activemq.artemis.tests.util.ServiceTestBase;
+import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
 
 import java.lang.ref.WeakReference;
 
-public class SessionCloseOnGCTest extends ServiceTestBase
+public class SessionCloseOnGCTest extends ActiveMQTestBase
 {
    private ActiveMQServer server;
    private ServerLocator locator;
@@ -69,7 +69,7 @@ public class SessionCloseOnGCTest extends ServiceTestBase
       locator.close();
 
       locator = null;
-      ServiceTestBase.checkWeakReferences(wrs1, wrs2);
+      ActiveMQTestBase.checkWeakReferences(wrs1, wrs2);
 
       WeakReference<ClientSessionFactory> fref = new WeakReference<ClientSessionFactory>(factory);
 
@@ -77,7 +77,7 @@ public class SessionCloseOnGCTest extends ServiceTestBase
 
       factory = null;
 
-      ServiceTestBase.checkWeakReferences(fref, wrs1, wrs2);
+      ActiveMQTestBase.checkWeakReferences(fref, wrs1, wrs2);
    }
 
    @Test
@@ -102,7 +102,7 @@ public class SessionCloseOnGCTest extends ServiceTestBase
       locator.close();
 
       locator = null;
-      ServiceTestBase.checkWeakReferences(wrs1, wrs2);
+      ActiveMQTestBase.checkWeakReferences(wrs1, wrs2);
 
       WeakReference<ClientSessionFactory> fref = new WeakReference<ClientSessionFactory>(factory);
 
@@ -110,7 +110,7 @@ public class SessionCloseOnGCTest extends ServiceTestBase
 
       factory = null;
 
-      ServiceTestBase.checkWeakReferences(fref, wrs1, wrs2);
+      ActiveMQTestBase.checkWeakReferences(fref, wrs1, wrs2);
    }
 
    @Test
@@ -133,13 +133,13 @@ public class SessionCloseOnGCTest extends ServiceTestBase
       locator.close();
 
       locator = null;
-      ServiceTestBase.checkWeakReferences(wrs1, wrs2);
+      ActiveMQTestBase.checkWeakReferences(wrs1, wrs2);
 
       WeakReference<ClientSessionFactory> fref = new WeakReference<ClientSessionFactory>(factory);
 
       factory = null;
 
-      ServiceTestBase.checkWeakReferences(fref, wrs1, wrs2);
+      ActiveMQTestBase.checkWeakReferences(fref, wrs1, wrs2);
    }
 
    @Test
@@ -159,13 +159,13 @@ public class SessionCloseOnGCTest extends ServiceTestBase
       locator.close();
 
       locator = null;
-      ServiceTestBase.checkWeakReferences(wrs1, wrs2);
+      ActiveMQTestBase.checkWeakReferences(wrs1, wrs2);
 
       WeakReference<ClientSessionFactory> fref = new WeakReference<ClientSessionFactory>(factory);
 
       factory = null;
 
-      ServiceTestBase.checkWeakReferences(fref, wrs1, wrs2);
+      ActiveMQTestBase.checkWeakReferences(fref, wrs1, wrs2);
    }
 
    @Test
@@ -180,7 +180,7 @@ public class SessionCloseOnGCTest extends ServiceTestBase
       locator.close();
 
       locator = null;
-      ServiceTestBase.checkWeakReferences(fref);
+      ActiveMQTestBase.checkWeakReferences(fref);
    }
 
    @Test
@@ -196,7 +196,7 @@ public class SessionCloseOnGCTest extends ServiceTestBase
 
       session = null;
 
-      ServiceTestBase.checkWeakReferences(wses);
+      ActiveMQTestBase.checkWeakReferences(wses);
 
       Assert.assertEquals(0, sf.numSessions());
       Assert.assertEquals(1, sf.numConnections());
@@ -222,7 +222,7 @@ public class SessionCloseOnGCTest extends ServiceTestBase
       session2 = null;
       session3 = null;
 
-      ServiceTestBase.checkWeakReferences(ref1, ref2, ref3);
+      ActiveMQTestBase.checkWeakReferences(ref1, ref2, ref3);
 
       int count = 0;
       final int TOTAL_SLEEP_TIME = 400;

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/SessionCloseTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SessionCloseTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SessionCloseTest.java
index 060d38b..faea432 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SessionCloseTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SessionCloseTest.java
@@ -19,19 +19,15 @@ 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.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.remoting.impl.invm.InVMAcceptorFactory;
 import org.apache.activemq.artemis.core.server.ActiveMQServer;
 import org.apache.activemq.artemis.core.server.ActiveMQServers;
+import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
 import org.apache.activemq.artemis.tests.util.RandomUtil;
-import org.apache.activemq.artemis.tests.util.ServiceTestBase;
-import org.junit.After;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
@@ -39,7 +35,7 @@ import org.junit.Test;
 import javax.transaction.xa.XAException;
 import javax.transaction.xa.XAResource;
 
-public class SessionCloseTest extends ServiceTestBase
+public class SessionCloseTest extends ActiveMQTestBase
 {
 
    // Constants -----------------------------------------------------
@@ -66,7 +62,7 @@ public class SessionCloseTest extends ServiceTestBase
 
       Assert.assertTrue(session.isClosed());
 
-      ServiceTestBase.expectActiveMQException(ActiveMQExceptionType.OBJECT_CLOSED, new ActiveMQAction()
+      ActiveMQTestBase.expectActiveMQException(ActiveMQExceptionType.OBJECT_CLOSED, new ActiveMQAction()
       {
          public void run() throws ActiveMQException
          {
@@ -74,7 +70,7 @@ public class SessionCloseTest extends ServiceTestBase
          }
       });
 
-      ServiceTestBase.expectActiveMQException(ActiveMQExceptionType.OBJECT_CLOSED, new ActiveMQAction()
+      ActiveMQTestBase.expectActiveMQException(ActiveMQExceptionType.OBJECT_CLOSED, new ActiveMQAction()
       {
          public void run() throws ActiveMQException
          {
@@ -82,7 +78,7 @@ public class SessionCloseTest extends ServiceTestBase
          }
       });
 
-      ServiceTestBase.expectActiveMQException(ActiveMQExceptionType.OBJECT_CLOSED, new ActiveMQAction()
+      ActiveMQTestBase.expectActiveMQException(ActiveMQExceptionType.OBJECT_CLOSED, new ActiveMQAction()
       {
          public void run() throws ActiveMQException
          {
@@ -92,7 +88,7 @@ public class SessionCloseTest extends ServiceTestBase
          }
       });
 
-      ServiceTestBase.expectActiveMQException(ActiveMQExceptionType.OBJECT_CLOSED, new ActiveMQAction()
+      ActiveMQTestBase.expectActiveMQException(ActiveMQExceptionType.OBJECT_CLOSED, new ActiveMQAction()
       {
          public void run() throws ActiveMQException
          {
@@ -100,7 +96,7 @@ public class SessionCloseTest extends ServiceTestBase
          }
       });
 
-      ServiceTestBase.expectActiveMQException(ActiveMQExceptionType.OBJECT_CLOSED, new ActiveMQAction()
+      ActiveMQTestBase.expectActiveMQException(ActiveMQExceptionType.OBJECT_CLOSED, new ActiveMQAction()
       {
          public void run() throws ActiveMQException
          {
@@ -108,7 +104,7 @@ public class SessionCloseTest extends ServiceTestBase
          }
       });
 
-      ServiceTestBase.expectActiveMQException(ActiveMQExceptionType.OBJECT_CLOSED, new ActiveMQAction()
+      ActiveMQTestBase.expectActiveMQException(ActiveMQExceptionType.OBJECT_CLOSED, new ActiveMQAction()
       {
          public void run() throws ActiveMQException
          {
@@ -116,7 +112,7 @@ public class SessionCloseTest extends ServiceTestBase
          }
       });
 
-      ServiceTestBase.expectActiveMQException(ActiveMQExceptionType.OBJECT_CLOSED, new ActiveMQAction()
+      ActiveMQTestBase.expectActiveMQException(ActiveMQExceptionType.OBJECT_CLOSED, new ActiveMQAction()
       {
          public void run() throws ActiveMQException
          {
@@ -124,7 +120,7 @@ public class SessionCloseTest extends ServiceTestBase
          }
       });
 
-      ServiceTestBase.expectActiveMQException(ActiveMQExceptionType.OBJECT_CLOSED, new ActiveMQAction()
+      ActiveMQTestBase.expectActiveMQException(ActiveMQExceptionType.OBJECT_CLOSED, new ActiveMQAction()
       {
          public void run() throws ActiveMQException
          {
@@ -132,7 +128,7 @@ public class SessionCloseTest extends ServiceTestBase
          }
       });
 
-      ServiceTestBase.expectActiveMQException(ActiveMQExceptionType.OBJECT_CLOSED, new ActiveMQAction()
+      ActiveMQTestBase.expectActiveMQException(ActiveMQExceptionType.OBJECT_CLOSED, new ActiveMQAction()
       {
          public void run() throws ActiveMQException
          {
@@ -140,7 +136,7 @@ public class SessionCloseTest extends ServiceTestBase
          }
       });
 
-      ServiceTestBase.expectActiveMQException(ActiveMQExceptionType.OBJECT_CLOSED, new ActiveMQAction()
+      ActiveMQTestBase.expectActiveMQException(ActiveMQExceptionType.OBJECT_CLOSED, new ActiveMQAction()
       {
          public void run() throws ActiveMQException
          {
@@ -161,7 +157,7 @@ public class SessionCloseTest extends ServiceTestBase
       Assert.assertTrue(session.isXA());
       Assert.assertTrue(session.isClosed());
 
-      ServiceTestBase.expectXAException(XAException.XA_RETRY, new ActiveMQAction()
+      ActiveMQTestBase.expectXAException(XAException.XA_RETRY, new ActiveMQAction()
       {
          public void run() throws XAException
          {
@@ -169,7 +165,7 @@ public class SessionCloseTest extends ServiceTestBase
          }
       });
 
-      ServiceTestBase.expectXAException(XAException.XAER_RMERR, new ActiveMQAction()
+      ActiveMQTestBase.expectXAException(XAException.XAER_RMERR, new ActiveMQAction()
       {
          public void run() throws XAException
          {
@@ -177,7 +173,7 @@ public class SessionCloseTest extends ServiceTestBase
          }
       });
 
-      ServiceTestBase.expectXAException(XAException.XAER_RMERR, new ActiveMQAction()
+      ActiveMQTestBase.expectXAException(XAException.XAER_RMERR, new ActiveMQAction()
       {
          public void run() throws XAException
          {
@@ -185,7 +181,7 @@ public class SessionCloseTest extends ServiceTestBase
          }
       });
 
-      ServiceTestBase.expectXAException(XAException.XAER_RMERR, new ActiveMQAction()
+      ActiveMQTestBase.expectXAException(XAException.XAER_RMERR, new ActiveMQAction()
       {
          public void run() throws XAException
          {
@@ -193,7 +189,7 @@ public class SessionCloseTest extends ServiceTestBase
          }
       });
 
-      ServiceTestBase.expectXAException(XAException.XAER_RMERR, new ActiveMQAction()
+      ActiveMQTestBase.expectXAException(XAException.XAER_RMERR, new ActiveMQAction()
       {
          public void run() throws XAException
          {
@@ -201,7 +197,7 @@ public class SessionCloseTest extends ServiceTestBase
          }
       });
 
-      ServiceTestBase.expectXAException(XAException.XAER_RMERR, new ActiveMQAction()
+      ActiveMQTestBase.expectXAException(XAException.XAER_RMERR, new ActiveMQAction()
       {
          public void run() throws XAException
          {
@@ -209,7 +205,7 @@ public class SessionCloseTest extends ServiceTestBase
          }
       });
 
-      ServiceTestBase.expectXAException(XAException.XAER_RMERR, new ActiveMQAction()
+      ActiveMQTestBase.expectXAException(XAException.XAER_RMERR, new ActiveMQAction()
       {
          public void run() throws XAException
          {
@@ -249,38 +245,10 @@ public class SessionCloseTest extends ServiceTestBase
    public void setUp() throws Exception
    {
       super.setUp();
-
-      Configuration config = createDefaultConfig()
-         .addAcceptorConfiguration(new TransportConfiguration(InVMAcceptorFactory.class.getCanonicalName()))
-         .setSecurityEnabled(false);
-      server = ActiveMQServers.newActiveMQServer(config, false);
-
+      server = addServer(ActiveMQServers.newActiveMQServer(createDefaultInVMConfig(), false));
       server.start();
-
       ServerLocator locator = createInVMNonHALocator();
       sf = createSessionFactory(locator);
-
-   }
-
-   @Override
-   @After
-   public void tearDown() throws Exception
-   {
-      if (sf != null)
-      {
-         sf.close();
-      }
-
-      if (server != null)
-      {
-         server.stop();
-      }
-
-      sf = null;
-
-      server = null;
-
-      super.tearDown();
    }
 
    // Private -------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/328611fd/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SessionClosedOnRemotingConnectionFailureTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SessionClosedOnRemotingConnectionFailureTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SessionClosedOnRemotingConnectionFailureTest.java
index 3650e31..16ad8b8 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SessionClosedOnRemotingConnectionFailureTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SessionClosedOnRemotingConnectionFailureTest.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.ActiveMQNotConnectedException;
 import org.apache.activemq.artemis.api.core.ActiveMQObjectClosedException;
-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.ClientProducer;
 import org.apache.activemq.artemis.api.core.client.ClientSession;
@@ -29,12 +28,12 @@ import org.apache.activemq.artemis.core.client.impl.ClientSessionInternal;
 import org.apache.activemq.artemis.core.config.Configuration;
 import org.apache.activemq.artemis.core.server.ActiveMQServer;
 import org.apache.activemq.artemis.spi.core.protocol.RemotingConnection;
-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 SessionClosedOnRemotingConnectionFailureTest extends ServiceTestBase
+public class SessionClosedOnRemotingConnectionFailureTest extends ActiveMQTestBase
 {
    private ActiveMQServer server;
 
@@ -109,12 +108,8 @@ public class SessionClosedOnRemotingConnectionFailureTest extends ServiceTestBas
    public void setUp() throws Exception
    {
       super.setUp();
-
-      Configuration config = createDefaultConfig()
-         .addAcceptorConfiguration(new TransportConfiguration(INVM_ACCEPTOR_FACTORY))
-         .setSecurityEnabled(false);
+      Configuration config = createDefaultInVMConfig();
       server = createServer(false, config);
-
       server.start();
       ServerLocator locator = createInVMNonHALocator();
       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/SessionCreateAndDeleteQueueTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SessionCreateAndDeleteQueueTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SessionCreateAndDeleteQueueTest.java
index 19f4d80..87026c2 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SessionCreateAndDeleteQueueTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SessionCreateAndDeleteQueueTest.java
@@ -26,12 +26,12 @@ import org.apache.activemq.artemis.core.server.ActiveMQServer;
 import org.apache.activemq.artemis.core.server.Queue;
 import org.apache.activemq.artemis.core.server.impl.LastValueQueue;
 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.Before;
 import org.junit.Test;
 
-public class SessionCreateAndDeleteQueueTest extends ServiceTestBase
+public class SessionCreateAndDeleteQueueTest extends ActiveMQTestBase
 {
    private ActiveMQServer server;
 
@@ -106,9 +106,7 @@ public class SessionCreateAndDeleteQueueTest extends ServiceTestBase
    @Test
    public void testAddressSettingUSed() throws Exception
    {
-      AddressSettings addressSettings = new AddressSettings();
-      addressSettings.setLastValueQueue(true);
-      server.getAddressSettingsRepository().addMatch(address.toString(), addressSettings);
+      server.getAddressSettingsRepository().addMatch(address.toString(), new AddressSettings().setLastValueQueue(true));
       ClientSession session = createSessionFactory(locator).createSession(false, true, true);
       SimpleString filterString = new SimpleString("x=y");
       session.createQueue(address, queueName, filterString, 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/SessionCreateConsumerTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SessionCreateConsumerTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SessionCreateConsumerTest.java
index aa87a70..7af0ab0 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SessionCreateConsumerTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SessionCreateConsumerTest.java
@@ -24,12 +24,12 @@ import org.apache.activemq.artemis.api.core.client.ClientSessionFactory;
 import org.apache.activemq.artemis.api.core.client.ServerLocator;
 import org.apache.activemq.artemis.core.client.impl.ClientSessionInternal;
 import org.apache.activemq.artemis.core.server.ActiveMQServer;
-import org.apache.activemq.artemis.tests.util.ServiceTestBase;
+import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
 
-public class SessionCreateConsumerTest extends ServiceTestBase
+public class SessionCreateConsumerTest extends ActiveMQTestBase
 {
    private final String queueName = "ClientSessionCreateConsumerTestQ";
 
@@ -47,9 +47,9 @@ public class SessionCreateConsumerTest extends ServiceTestBase
 
       service = createServer(false);
       service.start();
-      locator.setProducerMaxRate(99);
-      locator.setBlockOnNonDurableSend(true);
-      locator.setBlockOnNonDurableSend(true);
+      locator.setProducerMaxRate(99)
+              .setBlockOnNonDurableSend(true)
+              .setBlockOnNonDurableSend(true);
       cf = createSessionFactory(locator);
       clientSession = (ClientSessionInternal) addClientSession(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/SessionCreateProducerTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SessionCreateProducerTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SessionCreateProducerTest.java
index 714bd24..41488ac 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SessionCreateProducerTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SessionCreateProducerTest.java
@@ -21,14 +21,14 @@ import org.apache.activemq.artemis.api.core.ActiveMQObjectClosedException;
 import org.apache.activemq.artemis.api.core.client.ClientProducer;
 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.client.impl.ClientSessionInternal;
 import org.apache.activemq.artemis.core.server.ActiveMQServer;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
 
-public class SessionCreateProducerTest extends ServiceTestBase
+public class SessionCreateProducerTest extends ActiveMQTestBase
 {
    private ServerLocator locator;
    private ClientSessionInternal clientSession;
@@ -42,9 +42,9 @@ public class SessionCreateProducerTest extends ServiceTestBase
       locator = createInVMNonHALocator();
       ActiveMQServer service = createServer(false);
       service.start();
-      locator.setProducerMaxRate(99);
-      locator.setBlockOnNonDurableSend(true);
-      locator.setBlockOnNonDurableSend(true);
+      locator.setProducerMaxRate(99)
+              .setBlockOnNonDurableSend(true)
+              .setBlockOnNonDurableSend(true);
       cf = createSessionFactory(locator);
       clientSession = (ClientSessionInternal) addClientSession(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/SessionFactoryTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SessionFactoryTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SessionFactoryTest.java
index b28a558..fceb975 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SessionFactoryTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SessionFactoryTest.java
@@ -16,30 +16,26 @@
  */
 package org.apache.activemq.artemis.tests.integration.client;
 
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
 import org.apache.activemq.artemis.api.core.BroadcastGroupConfiguration;
 import org.apache.activemq.artemis.api.core.DiscoveryGroupConfiguration;
 import org.apache.activemq.artemis.api.core.TransportConfiguration;
 import org.apache.activemq.artemis.api.core.UDPBroadcastEndpointFactory;
+import org.apache.activemq.artemis.api.core.client.ActiveMQClient;
 import org.apache.activemq.artemis.api.core.client.ClientSession;
 import org.apache.activemq.artemis.api.core.client.ClientSessionFactory;
-import org.apache.activemq.artemis.api.core.client.ActiveMQClient;
 import org.apache.activemq.artemis.api.core.client.ServerLocator;
-import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.apache.activemq.artemis.core.config.Configuration;
 import org.apache.activemq.artemis.core.config.ha.SharedStoreMasterPolicyConfiguration;
-import org.apache.activemq.artemis.core.remoting.impl.invm.InVMAcceptorFactory;
-import org.apache.activemq.artemis.core.remoting.impl.invm.InVMConnectorFactory;
 import org.apache.activemq.artemis.core.server.ActiveMQServer;
+import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
 import org.apache.activemq.artemis.tests.util.RandomUtil;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
 
-public class SessionFactoryTest extends ServiceTestBase
+import java.util.Arrays;
+
+public class SessionFactoryTest extends ActiveMQTestBase
 {
    private final DiscoveryGroupConfiguration groupConfiguration = new DiscoveryGroupConfiguration()
       .setBroadcastEndpointFactory(new UDPBroadcastEndpointFactory()
@@ -152,10 +148,6 @@ public class SessionFactoryTest extends ServiceTestBase
    @Test
    public void testGettersAndSetters() throws Exception
    {
-
-      TransportConfiguration[] tc = new TransportConfiguration[]{liveTC};
-      ServerLocator locator = ActiveMQClient.createServerLocatorWithoutHA(tc);
-
       long clientFailureCheckPeriod = RandomUtil.randomPositiveLong();
       long connectionTTL = RandomUtil.randomPositiveLong();
       long callTimeout = RandomUtil.randomPositiveLong();
@@ -177,28 +169,30 @@ public class SessionFactoryTest extends ServiceTestBase
       long retryInterval = RandomUtil.randomPositiveLong();
       double retryIntervalMultiplier = RandomUtil.randomDouble();
       int reconnectAttempts = RandomUtil.randomPositiveInt();
+      TransportConfiguration[] tc = new TransportConfiguration[]{liveTC};
 
-      locator.setClientFailureCheckPeriod(clientFailureCheckPeriod);
-      locator.setConnectionTTL(connectionTTL);
-      locator.setCallTimeout(callTimeout);
-      locator.setMinLargeMessageSize(minLargeMessageSize);
-      locator.setConsumerWindowSize(consumerWindowSize);
-      locator.setConsumerMaxRate(consumerMaxRate);
-      locator.setConfirmationWindowSize(confirmationWindowSize);
-      locator.setProducerMaxRate(producerMaxRate);
-      locator.setBlockOnAcknowledge(blockOnAcknowledge);
-      locator.setBlockOnDurableSend(blockOnDurableSend);
-      locator.setBlockOnNonDurableSend(blockOnNonDurableSend);
-      locator.setAutoGroup(autoGroup);
-      locator.setPreAcknowledge(preAcknowledge);
-      locator.setConnectionLoadBalancingPolicyClassName(loadBalancingPolicyClassName);
-      locator.setAckBatchSize(ackBatchSize);
-      locator.setUseGlobalPools(useGlobalPools);
-      locator.setScheduledThreadPoolMaxSize(scheduledThreadPoolMaxSize);
-      locator.setThreadPoolMaxSize(threadPoolMaxSize);
-      locator.setRetryInterval(retryInterval);
-      locator.setRetryIntervalMultiplier(retryIntervalMultiplier);
-      locator.setReconnectAttempts(reconnectAttempts);
+      ServerLocator locator = ActiveMQClient.createServerLocatorWithoutHA(tc)
+              .setClientFailureCheckPeriod(clientFailureCheckPeriod)
+              .setConnectionTTL(connectionTTL)
+              .setCallTimeout(callTimeout)
+              .setMinLargeMessageSize(minLargeMessageSize)
+              .setConsumerWindowSize(consumerWindowSize)
+              .setConsumerMaxRate(consumerMaxRate)
+              .setConfirmationWindowSize(confirmationWindowSize)
+              .setProducerMaxRate(producerMaxRate)
+              .setBlockOnAcknowledge(blockOnAcknowledge)
+              .setBlockOnDurableSend(blockOnDurableSend)
+              .setBlockOnNonDurableSend(blockOnNonDurableSend)
+              .setAutoGroup(autoGroup)
+              .setPreAcknowledge(preAcknowledge)
+              .setConnectionLoadBalancingPolicyClassName(loadBalancingPolicyClassName)
+              .setAckBatchSize(ackBatchSize)
+              .setUseGlobalPools(useGlobalPools)
+              .setScheduledThreadPoolMaxSize(scheduledThreadPoolMaxSize)
+              .setThreadPoolMaxSize(threadPoolMaxSize)
+              .setRetryInterval(retryInterval)
+              .setRetryIntervalMultiplier(retryIntervalMultiplier)
+              .setReconnectAttempts(reconnectAttempts);
 
       assertEqualsTransportConfigurations(tc, locator.getStaticTransportConfigurations());
       Assert.assertEquals(clientFailureCheckPeriod, locator.getClientFailureCheckPeriod());
@@ -214,8 +208,7 @@ public class SessionFactoryTest extends ServiceTestBase
       Assert.assertEquals(blockOnNonDurableSend, locator.isBlockOnNonDurableSend());
       Assert.assertEquals(autoGroup, locator.isAutoGroup());
       Assert.assertEquals(preAcknowledge, locator.isPreAcknowledge());
-      Assert.assertEquals(loadBalancingPolicyClassName, locator
-         .getConnectionLoadBalancingPolicyClassName());
+      Assert.assertEquals(loadBalancingPolicyClassName, locator.getConnectionLoadBalancingPolicyClassName());
       Assert.assertEquals(ackBatchSize, locator.getAckBatchSize());
       Assert.assertEquals(useGlobalPools, locator.isUseGlobalPools());
       Assert.assertEquals(scheduledThreadPoolMaxSize, locator.getScheduledThreadPoolMaxSize());
@@ -223,7 +216,6 @@ public class SessionFactoryTest extends ServiceTestBase
       Assert.assertEquals(retryInterval, locator.getRetryInterval());
       Assert.assertEquals(retryIntervalMultiplier, locator.getRetryIntervalMultiplier(), 0.000001);
       Assert.assertEquals(reconnectAttempts, locator.getReconnectAttempts());
-
    }
 
    private void testSettersThrowException(final ClientSessionFactory cf)
@@ -526,7 +518,7 @@ public class SessionFactoryTest extends ServiceTestBase
 
    private void startServer() throws Exception
    {
-      liveTC = new TransportConfiguration(InVMConnectorFactory.class.getName());
+      liveTC = new TransportConfiguration(INVM_CONNECTOR_FACTORY);
 
       final long broadcastPeriod = 250;
 
@@ -534,7 +526,7 @@ public class SessionFactoryTest extends ServiceTestBase
 
       final int localBindPort = 5432;
 
-      BroadcastGroupConfiguration bcConfig1 = new BroadcastGroupConfiguration()
+      BroadcastGroupConfiguration broadcastGroupConfiguration = new BroadcastGroupConfiguration()
          .setName(bcGroupName)
          .setBroadcastPeriod(broadcastPeriod)
          .setConnectorInfos(Arrays.asList(liveTC.getName()))
@@ -543,15 +535,10 @@ public class SessionFactoryTest extends ServiceTestBase
                                    .setGroupPort(getUDPDiscoveryPort())
                                    .setLocalBindPort(localBindPort));
 
-      List<BroadcastGroupConfiguration> bcConfigs1 = new ArrayList<BroadcastGroupConfiguration>();
-      bcConfigs1.add(bcConfig1);
-
-      Configuration liveConf = createDefaultConfig()
-         .setSecurityEnabled(false)
-         .addAcceptorConfiguration(new TransportConfiguration(InVMAcceptorFactory.class.getName()))
+      Configuration liveConf = createDefaultInVMConfig()
          .addConnectorConfiguration(liveTC.getName(), liveTC)
          .setHAPolicyConfiguration(new SharedStoreMasterPolicyConfiguration())
-         .setBroadcastGroupConfigurations(bcConfigs1);
+         .addBroadcastGroupConfiguration(broadcastGroupConfiguration);
 
       liveService = createServer(false, liveConf);
       liveService.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/SessionSendAcknowledgementHandlerTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SessionSendAcknowledgementHandlerTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SessionSendAcknowledgementHandlerTest.java
index 690c51c..1226f03 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SessionSendAcknowledgementHandlerTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SessionSendAcknowledgementHandlerTest.java
@@ -28,12 +28,12 @@ import org.apache.activemq.artemis.api.core.client.ClientSessionFactory;
 import org.apache.activemq.artemis.api.core.client.SendAcknowledgementHandler;
 import org.apache.activemq.artemis.api.core.client.ServerLocator;
 import org.apache.activemq.artemis.core.server.ActiveMQServer;
-import org.apache.activemq.artemis.tests.util.ServiceTestBase;
+import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
 
-public class SessionSendAcknowledgementHandlerTest extends ServiceTestBase
+public class SessionSendAcknowledgementHandlerTest 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/client/SessionStopStartTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SessionStopStartTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SessionStopStartTest.java
index b68d0db..517be41 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SessionStopStartTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SessionStopStartTest.java
@@ -34,9 +34,9 @@ import org.apache.activemq.artemis.api.core.client.MessageHandler;
 import org.apache.activemq.artemis.api.core.client.ServerLocator;
 import org.apache.activemq.artemis.core.server.ActiveMQServer;
 import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger;
-import org.apache.activemq.artemis.tests.util.ServiceTestBase;
+import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
 
-public class SessionStopStartTest extends ServiceTestBase
+public class SessionStopStartTest 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/SessionTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SessionTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SessionTest.java
index 46fa21b..ca02bb3 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SessionTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SessionTest.java
@@ -31,7 +31,7 @@ import org.apache.activemq.artemis.api.core.client.ClientSessionFactory;
 import org.apache.activemq.artemis.api.core.client.ServerLocator;
 import org.apache.activemq.artemis.api.core.client.SessionFailureListener;
 import org.apache.activemq.artemis.tests.util.CountDownSessionFailureListener;
-import org.apache.activemq.artemis.tests.util.ServiceTestBase;
+import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
 import org.apache.activemq.artemis.core.client.impl.ClientSessionFactoryInternal;
 import org.apache.activemq.artemis.core.client.impl.ClientSessionInternal;
 import org.apache.activemq.artemis.core.server.ActiveMQServer;
@@ -44,7 +44,7 @@ import org.junit.Test;
 /**
  * This test covers the API for ClientSession although XA tests are tested separately.
  */
-public class SessionTest extends ServiceTestBase
+public class SessionTest extends ActiveMQTestBase
 {
    private final String queueName = "ClientSessionTestQ";
 
@@ -61,7 +61,7 @@ public class SessionTest extends ServiceTestBase
       locator = createInVMNonHALocator();
       server = createServer(false);
       server.start();
-      waitForServer(server);
+      waitForServerToStart(server);
    }
 
    @Test
@@ -398,8 +398,8 @@ public class SessionTest extends ServiceTestBase
    @Test
    public void testCommitWithReceive() throws Exception
    {
-      locator.setBlockOnNonDurableSend(true);
-      locator.setBlockOnDurableSend(true);
+      locator.setBlockOnNonDurableSend(true)
+              .setBlockOnDurableSend(true);
       cf = createSessionFactory(locator);
       ClientSession sendSession = cf.createSession(false, true, true);
       ClientProducer cp = sendSession.createProducer(queueName);
@@ -458,8 +458,8 @@ public class SessionTest extends ServiceTestBase
    @Test
    public void testRollbackWithReceive() throws Exception
    {
-      locator.setBlockOnNonDurableSend(true);
-      locator.setBlockOnDurableSend(true);
+      locator.setBlockOnNonDurableSend(true)
+              .setBlockOnDurableSend(true);
       cf = createSessionFactory(locator);
       ClientSession sendSession = cf.createSession(false, true, true);
       ClientProducer cp = sendSession.createProducer(queueName);

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/SimpleSendMultipleQueuesTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SimpleSendMultipleQueuesTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SimpleSendMultipleQueuesTest.java
index 1ac46ec..ac130db 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SimpleSendMultipleQueuesTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SimpleSendMultipleQueuesTest.java
@@ -15,12 +15,6 @@
  * limitations under the License.
  */
 package org.apache.activemq.artemis.tests.integration.client;
-import org.junit.Before;
-import org.junit.After;
-
-import org.junit.Test;
-
-import org.junit.Assert;
 
 import org.apache.activemq.artemis.api.core.client.ClientConsumer;
 import org.apache.activemq.artemis.api.core.client.ClientMessage;
@@ -29,10 +23,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.ServerLocator;
 import org.apache.activemq.artemis.core.server.ActiveMQServer;
+import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
 import org.apache.activemq.artemis.tests.util.RandomUtil;
-import org.apache.activemq.artemis.tests.util.ServiceTestBase;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
 
-public class SimpleSendMultipleQueuesTest extends ServiceTestBase
+public class SimpleSendMultipleQueuesTest extends ActiveMQTestBase
 {
    public static final String address = "testaddress";
 
@@ -111,27 +108,4 @@ public class SimpleSendMultipleQueuesTest extends ServiceTestBase
 
       session.start();
    }
-
-   @Override
-   @After
-   public void tearDown() throws Exception
-   {
-      if (session != null)
-      {
-         consumer1.close();
-
-         consumer2.close();
-
-         consumer3.close();
-
-         session.deleteQueue("queue1");
-         session.deleteQueue("queue2");
-         session.deleteQueue("queue3");
-
-         session.close();
-      }
-
-      super.tearDown();
-   }
-
 }

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/SlowConsumerTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SlowConsumerTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SlowConsumerTest.java
index 249c269..e3df2d7 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SlowConsumerTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SlowConsumerTest.java
@@ -40,14 +40,14 @@ import org.apache.activemq.artemis.core.server.ActiveMQServer;
 import org.apache.activemq.artemis.core.settings.impl.AddressSettings;
 import org.apache.activemq.artemis.core.settings.impl.SlowConsumerPolicy;
 import org.apache.activemq.artemis.tests.util.RandomUtil;
-import org.apache.activemq.artemis.tests.util.ServiceTestBase;
+import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.junit.runners.Parameterized;
 
 @RunWith(value = Parameterized.class)
-public class SlowConsumerTest extends ServiceTestBase
+public class SlowConsumerTest extends ActiveMQTestBase
 {
    private boolean isNetty = false;
 
@@ -81,10 +81,10 @@ public class SlowConsumerTest extends ServiceTestBase
 
       server = createServer(false, isNetty);
 
-      AddressSettings addressSettings = new AddressSettings();
-      addressSettings.setSlowConsumerCheckPeriod(2);
-      addressSettings.setSlowConsumerThreshold(10);
-      addressSettings.setSlowConsumerPolicy(SlowConsumerPolicy.KILL);
+      AddressSettings addressSettings = new AddressSettings()
+              .setSlowConsumerCheckPeriod(2)
+              .setSlowConsumerThreshold(10)
+              .setSlowConsumerPolicy(SlowConsumerPolicy.KILL);
 
       server.start();
 
@@ -137,10 +137,10 @@ public class SlowConsumerTest extends ServiceTestBase
 
       session.createQueue(QUEUE, QUEUE, null, false);
 
-      AddressSettings addressSettings = new AddressSettings();
-      addressSettings.setSlowConsumerCheckPeriod(2);
-      addressSettings.setSlowConsumerThreshold(10);
-      addressSettings.setSlowConsumerPolicy(SlowConsumerPolicy.NOTIFY);
+      AddressSettings addressSettings = new AddressSettings()
+              .setSlowConsumerCheckPeriod(2)
+              .setSlowConsumerThreshold(10)
+              .setSlowConsumerPolicy(SlowConsumerPolicy.NOTIFY);
 
       server.getAddressSettingsRepository().removeMatch(QUEUE.toString());
       server.getAddressSettingsRepository().addMatch(QUEUE.toString(), addressSettings);
@@ -320,10 +320,10 @@ public class SlowConsumerTest extends ServiceTestBase
       SimpleString queueName2 = new SimpleString("Q2");
       SimpleString queueName = new SimpleString("Q");
 
-      AddressSettings addressSettings = new AddressSettings();
-      addressSettings.setSlowConsumerCheckPeriod(2);
-      addressSettings.setSlowConsumerThreshold(10);
-      addressSettings.setSlowConsumerPolicy(SlowConsumerPolicy.KILL);
+      AddressSettings addressSettings = new AddressSettings()
+              .setSlowConsumerCheckPeriod(2)
+              .setSlowConsumerThreshold(10)
+              .setSlowConsumerPolicy(SlowConsumerPolicy.KILL);
 
       server.getAddressSettingsRepository().addMatch(address.toString(), 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/client/TemporaryQueueTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/TemporaryQueueTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/TemporaryQueueTest.java
index add2724..5a434ad 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/TemporaryQueueTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/TemporaryQueueTest.java
@@ -16,11 +16,6 @@
  */
 package org.apache.activemq.artemis.tests.integration.client;
 
-import java.util.Arrays;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.atomic.AtomicInteger;
-
 import org.apache.activemq.artemis.api.core.ActiveMQDisconnectedException;
 import org.apache.activemq.artemis.api.core.ActiveMQException;
 import org.apache.activemq.artemis.api.core.ActiveMQExceptionType;
@@ -36,8 +31,6 @@ 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.SingleServerTestBase;
-import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.apache.activemq.artemis.core.client.impl.ClientProducerImpl;
 import org.apache.activemq.artemis.core.client.impl.ClientSessionInternal;
 import org.apache.activemq.artemis.core.protocol.core.Packet;
@@ -51,10 +44,16 @@ import org.apache.activemq.artemis.core.settings.impl.AddressFullMessagePolicy;
 import org.apache.activemq.artemis.core.settings.impl.AddressSettings;
 import org.apache.activemq.artemis.spi.core.protocol.RemotingConnection;
 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.junit.After;
+import org.apache.activemq.artemis.tests.util.SingleServerTestBase;
 import org.junit.Test;
 
+import java.util.Arrays;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicInteger;
+
 public class TemporaryQueueTest extends SingleServerTestBase
 {
    // Constants -----------------------------------------------------
@@ -173,14 +172,6 @@ public class TemporaryQueueTest extends SingleServerTestBase
       session.close();
    }
 
-   @Override
-   @After
-   public void tearDown() throws Exception
-   {
-
-      super.tearDown();
-   }
-
    @Test
    public void testDeleteTemporaryQueueAfterConnectionIsClosed() throws Exception
    {
@@ -348,10 +339,12 @@ public class TemporaryQueueTest extends SingleServerTestBase
    @Test
    public void testRecreateConsumerOverServerFailure() throws Exception
    {
-      ServerLocator serverWithReattach = createLocator();
-      serverWithReattach.setReconnectAttempts(-1);
-      serverWithReattach.setRetryInterval(1000);
-      serverWithReattach.setConfirmationWindowSize(-1);
+      ServerLocator serverWithReattach = createInVMNonHALocator()
+              .setReconnectAttempts(-1)
+              .setRetryInterval(1000)
+              .setConfirmationWindowSize(-1)
+              .setConnectionTTL(TemporaryQueueTest.CONNECTION_TTL)
+              .setClientFailureCheckPeriod(TemporaryQueueTest.CONNECTION_TTL / 3);
       ClientSessionFactory reattachSF = createSessionFactory(serverWithReattach);
 
       ClientSession session = reattachSF.createSession(false, false);
@@ -574,8 +567,8 @@ public class TemporaryQueueTest extends SingleServerTestBase
          }
       };
 
-      ServiceTestBase.expectActiveMQException("temp queue must not exist after the server detected the client crash",
-              ActiveMQExceptionType.QUEUE_DOES_NOT_EXIST, activeMQAction);
+      ActiveMQTestBase.expectActiveMQException("temp queue must not exist after the server detected the client crash",
+                                               ActiveMQExceptionType.QUEUE_DOES_NOT_EXIST, activeMQAction);
 
       session.close();
 
@@ -586,9 +579,9 @@ public class TemporaryQueueTest extends SingleServerTestBase
    public void testBlockingWithTemporaryQueue() throws Exception
    {
 
-      AddressSettings setting = new AddressSettings();
-      setting.setAddressFullMessagePolicy(AddressFullMessagePolicy.BLOCK);
-      setting.setMaxSizeBytes(1024 * 1024);
+      AddressSettings setting = new AddressSettings()
+              .setAddressFullMessagePolicy(AddressFullMessagePolicy.BLOCK)
+              .setMaxSizeBytes(1024 * 1024);
 
       server.getAddressSettingsRepository().addMatch("TestAD", setting);
 
@@ -685,14 +678,4 @@ public class TemporaryQueueTest extends SingleServerTestBase
    // Package protected ---------------------------------------------
 
    // Protected -----------------------------------------------------
-
-   @Override
-   protected ServerLocator createLocator()
-   {
-      ServerLocator retlocator = super.createLocator();
-      retlocator.setConnectionTTL(TemporaryQueueTest.CONNECTION_TTL);
-      retlocator.setClientFailureCheckPeriod(TemporaryQueueTest.CONNECTION_TTL / 3);
-      return retlocator;
-   }
-
 }

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/TransactionDurabilityTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/TransactionDurabilityTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/TransactionDurabilityTest.java
index 459152e..18ad8ee 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/TransactionDurabilityTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/TransactionDurabilityTest.java
@@ -16,24 +16,19 @@
  */
 package org.apache.activemq.artemis.tests.integration.client;
 
-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.tests.util.ServiceTestBase;
+import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
+import org.junit.Assert;
+import org.junit.Test;
 
-public class TransactionDurabilityTest extends ServiceTestBase
+public class TransactionDurabilityTest extends ActiveMQTestBase
 {
 
    /*
@@ -54,27 +49,23 @@ public class TransactionDurabilityTest extends ServiceTestBase
    @Test
    public void testRolledBackAcknowledgeWithSameMessageAckedByOtherSession() throws Exception
    {
-      Configuration conf = createDefaultConfig();
-
       final SimpleString testAddress = new SimpleString("testAddress");
 
       final SimpleString queue1 = new SimpleString("queue1");
 
       final SimpleString queue2 = new SimpleString("queue2");
 
-      ActiveMQServer server = createServer(true, conf);
+      ActiveMQServer server = createServer(true, createDefaultInVMConfig());
 
       server.start();
 
-      ServerLocator locator =
-               addServerLocator(ActiveMQClient.createServerLocatorWithoutHA(new TransportConfiguration(
-                  ServiceTestBase.INVM_CONNECTOR_FACTORY)));
+      ServerLocator locator = createInVMNonHALocator();
 
       ClientSessionFactory sf = createSessionFactory(locator);
 
-      ClientSession session1 = sf.createSession(false, true, true);
+      ClientSession session1 = addClientSession(sf.createSession(false, true, true));
 
-      ClientSession session2 = sf.createSession(false, false, false);
+      ClientSession session2 = addClientSession(sf.createSession(false, false, false));
 
       session1.createQueue(testAddress, queue1, null, true);
 
@@ -120,9 +111,9 @@ public class TransactionDurabilityTest extends ServiceTestBase
 
       sf = createSessionFactory(locator);
 
-      session1 = sf.createSession(false, true, true);
+      session1 = addClientSession(sf.createSession(false, true, true));
 
-      session2 = sf.createSession(false, true, true);
+      session2 = addClientSession(sf.createSession(false, true, true));
 
       session1.start();
 
@@ -152,9 +143,9 @@ public class TransactionDurabilityTest extends ServiceTestBase
 
       sf = createSessionFactory(locator);
 
-      session1 = sf.createSession(false, true, true);
+      session1 = addClientSession(sf.createSession(false, true, true));
 
-      session2 = sf.createSession(false, true, true);
+      session2 = addClientSession(sf.createSession(false, true, true));
 
       session1.start();
 
@@ -179,7 +170,5 @@ public class TransactionDurabilityTest extends ServiceTestBase
       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/client/TransactionalSendTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/TransactionalSendTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/TransactionalSendTest.java
index d5cc953..7d322b3 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/TransactionalSendTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/TransactionalSendTest.java
@@ -23,12 +23,12 @@ import org.apache.activemq.artemis.api.core.client.ClientSessionFactory;
 import org.apache.activemq.artemis.api.core.client.ServerLocator;
 import org.apache.activemq.artemis.core.server.ActiveMQServer;
 import org.apache.activemq.artemis.core.server.Queue;
-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 TransactionalSendTest extends ServiceTestBase
+public class TransactionalSendTest 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/TransientQueueTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/TransientQueueTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/TransientQueueTest.java
index 342b5e7..b0de200 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/TransientQueueTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/TransientQueueTest.java
@@ -140,7 +140,6 @@ public class TransientQueueTest extends SingleServerTestBase
 
    }
 
-
    @Test
    public void testQueueDifferentConfigs() throws Exception
    {
@@ -225,19 +224,14 @@ public class TransientQueueTest extends SingleServerTestBase
       }
 
       assertTrue(exHappened);
-
-
    }
 
-
    protected ServerLocator createLocator()
    {
-      ServerLocator retlocator = super.createLocator();
-      retlocator.setConsumerWindowSize(0);
-      retlocator.setBlockOnAcknowledge(true);
-      retlocator.setBlockOnDurableSend(false);
-      retlocator.setBlockOnNonDurableSend(false);
-      return retlocator;
+      return super.createLocator()
+              .setConsumerWindowSize(0)
+              .setBlockOnAcknowledge(true)
+              .setBlockOnDurableSend(false)
+              .setBlockOnNonDurableSend(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/WildCardRoutingTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/WildCardRoutingTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/WildCardRoutingTest.java
index 3ada09d..f228169 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/WildCardRoutingTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/WildCardRoutingTest.java
@@ -16,9 +16,7 @@
  */
 package org.apache.activemq.artemis.tests.integration.client;
 
-import org.apache.activemq.artemis.api.core.ActiveMQException;
 import org.apache.activemq.artemis.api.core.SimpleString;
-import org.apache.activemq.artemis.api.core.TransportConfiguration;
 import org.apache.activemq.artemis.api.core.client.ClientConsumer;
 import org.apache.activemq.artemis.api.core.client.ClientMessage;
 import org.apache.activemq.artemis.api.core.client.ClientProducer;
@@ -28,18 +26,17 @@ 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.junit.After;
+import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
 
-public class WildCardRoutingTest extends ServiceTestBase
+public class WildCardRoutingTest extends ActiveMQTestBase
 {
    private ActiveMQServer server;
    private ServerLocator locator;
    private ClientSession clientSession;
-   private ClientSessionFactory sessionFactory;
+   private ClientSessionFactory sf;
 
    @Test
    public void testBasicWildcardRouting() throws Exception
@@ -781,45 +778,14 @@ public class WildCardRoutingTest extends ServiceTestBase
    public void setUp() throws Exception
    {
       super.setUp();
-      TransportConfiguration transportConfig = new TransportConfiguration(ServiceTestBase.INVM_ACCEPTOR_FACTORY);
-
-      Configuration configuration = createDefaultConfig()
+      Configuration configuration = createDefaultInVMConfig()
          .setWildcardRoutingEnabled(true)
-         .setSecurityEnabled(false)
-         .setTransactionTimeoutScanPeriod(500)
-         .addAcceptorConfiguration(transportConfig);
-
-      server = ActiveMQServers.newActiveMQServer(configuration, false);
-      // start the server
+         .setTransactionTimeoutScanPeriod(500);
+      server = addServer(ActiveMQServers.newActiveMQServer(configuration, false));
       server.start();
       server.getManagementService().enableNotifications(false);
-      // then we create a client as normal
       locator = createInVMNonHALocator();
-      sessionFactory = createSessionFactory(locator);
-      clientSession = sessionFactory.createSession(false, true, true);
-   }
-
-   @Override
-   @After
-   public void tearDown() throws Exception
-   {
-      if (clientSession != null)
-      {
-         try
-         {
-            clientSession.close();
-         }
-         catch (ActiveMQException e1)
-         {
-            //
-         }
-      }
-      closeSessionFactory(sessionFactory);
-      stopComponent(server);
-      closeServerLocator(locator);
-      locator = null;
-      server = null;
-      clientSession = null;
-      super.tearDown();
+      sf = createSessionFactory(locator);
+      clientSession = addClientSession(sf.createSession(false, true, true));
    }
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/328611fd/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/clientcrash/ClientCrashTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/clientcrash/ClientCrashTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/clientcrash/ClientCrashTest.java
index 399ec6d..ae8ded3 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/clientcrash/ClientCrashTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/clientcrash/ClientCrashTest.java
@@ -125,8 +125,7 @@ public class ClientCrashTest extends ClientTestBase
    public void testCrashClient2() throws Exception
    {
       // set the redelivery delay to avoid an attempt to redeliver the message to the dead client
-      AddressSettings addressSettings = new AddressSettings();
-      addressSettings.setRedeliveryDelay(ClientCrashTest.CONNECTION_TTL + ClientCrashTest.PING_PERIOD);
+      AddressSettings addressSettings = new AddressSettings().setRedeliveryDelay(ClientCrashTest.CONNECTION_TTL + ClientCrashTest.PING_PERIOD);
       server.getAddressSettingsRepository().addMatch(ClientCrashTest.QUEUE2.toString(), addressSettings);
 
       assertActiveConnections(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/clientcrash/ClientExitTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/clientcrash/ClientExitTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/clientcrash/ClientExitTest.java
index 9b8c90a..afa835a 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/clientcrash/ClientExitTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/clientcrash/ClientExitTest.java
@@ -15,22 +15,18 @@
  * limitations under the License.
  */
 package org.apache.activemq.artemis.tests.integration.clientcrash;
-import org.junit.Before;
-
-import org.junit.Test;
 
 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.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.remoting.impl.netty.NettyConnectorFactory;
 import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger;
 import org.apache.activemq.artemis.tests.util.RandomUtil;
 import org.apache.activemq.artemis.tests.util.SpawnedVMSupport;
+import org.junit.Before;
+import org.junit.Test;
 
 /**
  * A test that makes sure that a ActiveMQ Artemis client gracefully exists after the last session is
@@ -106,7 +102,7 @@ public class ClientExitTest extends ClientTestBase
    {
       super.setUp();
 
-      ServerLocator locator = ActiveMQClient.createServerLocatorWithoutHA(new TransportConfiguration(NettyConnectorFactory.class.getName()));
+      ServerLocator locator = createNettyNonHALocator();
       addServerLocator(locator);
       ClientSessionFactory sf = createSessionFactory(locator);
       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/clientcrash/ClientTestBase.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/clientcrash/ClientTestBase.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/clientcrash/ClientTestBase.java
index 4baae7c..7872dc1 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/clientcrash/ClientTestBase.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/clientcrash/ClientTestBase.java
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 package org.apache.activemq.artemis.tests.integration.clientcrash;
-import org.apache.activemq.artemis.tests.util.ServiceTestBase;
+import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
 import org.junit.Before;
 
 import org.junit.Assert;
@@ -23,7 +23,7 @@ import org.junit.Assert;
 import org.apache.activemq.artemis.core.config.Configuration;
 import org.apache.activemq.artemis.core.server.ActiveMQServer;
 
-public abstract class ClientTestBase extends ServiceTestBase
+public abstract class ClientTestBase extends ActiveMQTestBase
 {
 
    protected ActiveMQServer server;
@@ -34,8 +34,7 @@ public abstract class ClientTestBase extends ServiceTestBase
    {
       super.setUp();
 
-      Configuration config = createDefaultConfig(true)
-         .setSecurityEnabled(false);
+      Configuration config = createDefaultNettyConfig();
       server = createServer(false, config);
       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/cluster/ClusterControllerTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/ClusterControllerTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/ClusterControllerTest.java
index 23b73f4..a083eda 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/ClusterControllerTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/ClusterControllerTest.java
@@ -23,7 +23,6 @@ import org.apache.activemq.artemis.core.server.cluster.ActiveMQServerSideProtoco
 import org.apache.activemq.artemis.core.server.cluster.ClusterControl;
 import org.apache.activemq.artemis.core.server.cluster.ClusterController;
 import org.apache.activemq.artemis.tests.integration.cluster.distribution.ClusterTestBase;
-import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 
@@ -56,15 +55,6 @@ public class ClusterControllerTest extends ClusterTestBase
       startServers(1);
    }
 
-   @Override
-   @After
-   public void tearDown() throws Exception
-   {
-      stopServers();
-
-      super.tearDown();
-   }
-
    @Test
    public void controlWithDifferentConnector() 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/cluster/NodeManagerTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/NodeManagerTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/NodeManagerTest.java
index 4ef0de9..ab6a434 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/NodeManagerTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/NodeManagerTest.java
@@ -21,7 +21,7 @@ import java.util.List;
 
 import org.apache.activemq.artemis.core.server.NodeManager;
 import org.apache.activemq.artemis.core.server.impl.InVMNodeManager;
-import org.apache.activemq.artemis.tests.util.ServiceTestBase;
+import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
 import org.junit.Test;
 
 import static org.apache.activemq.artemis.tests.integration.cluster.NodeManagerAction.AWAIT_LIVE;
@@ -36,7 +36,7 @@ import static org.apache.activemq.artemis.tests.integration.cluster.NodeManagerA
 import static org.apache.activemq.artemis.tests.integration.cluster.NodeManagerAction.START_LIVE;
 import static org.apache.activemq.artemis.tests.integration.cluster.NodeManagerAction.STOP_BACKUP;
 
-public class NodeManagerTest extends ServiceTestBase
+public class NodeManagerTest extends ActiveMQTestBase
 {
    @Test
    public void testLive() throws Exception


Mime
View raw message