activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clebertsuco...@apache.org
Subject [13/21] activemq-artemis git commit: More test-suite refactoring
Date Thu, 28 May 2015 15:19:04 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/NewDeadLetterAddressTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/NewDeadLetterAddressTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/NewDeadLetterAddressTest.java
index 9b9541d..02aa2b2 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/NewDeadLetterAddressTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/NewDeadLetterAddressTest.java
@@ -15,34 +15,27 @@
  * limitations under the License.
  */
 package org.apache.activemq.artemis.tests.integration.client;
-import org.apache.activemq.artemis.api.core.ActiveMQException;
-import org.apache.activemq.artemis.tests.util.ServiceTestBase;
-import org.junit.Before;
-import org.junit.After;
-
-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.core.settings.impl.AddressSettings;
+import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
 
 /**
  *
  * A NewDeadLetterAddressTest
  */
-public class NewDeadLetterAddressTest extends ServiceTestBase
+public class NewDeadLetterAddressTest extends ActiveMQTestBase
 {
    private ActiveMQServer server;
 
@@ -54,9 +47,9 @@ public class NewDeadLetterAddressTest extends ServiceTestBase
    {
       SimpleString dla = new SimpleString("DLA");
       SimpleString address = new SimpleString("empty_address");
-      AddressSettings addressSettings = new AddressSettings();
-      addressSettings.setDeadLetterAddress(dla);
-      addressSettings.setSendToDLAOnNoRoute(true);
+      AddressSettings addressSettings = new AddressSettings()
+              .setDeadLetterAddress(dla)
+              .setSendToDLAOnNoRoute(true);
       server.getAddressSettingsRepository().addMatch(address.toString(), addressSettings);
       SimpleString dlq = new SimpleString("DLQ1");
       clientSession.createQueue(dla, dlq, null, false);
@@ -75,39 +68,10 @@ public class NewDeadLetterAddressTest 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 = sessionFactory.createSession(false, true, false);
    }
-
-   @Override
-   @After
-   public void tearDown() throws Exception
-   {
-      if (clientSession != null)
-      {
-         try
-         {
-            clientSession.close();
-         }
-         catch (ActiveMQException e1)
-         {
-            //
-         }
-      }
-      clientSession = null;
-      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/OrderTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/OrderTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/OrderTest.java
index 8088189..bbe4987 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/OrderTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/OrderTest.java
@@ -25,7 +25,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.server.ActiveMQServer;
 import org.apache.activemq.artemis.core.settings.impl.AddressSettings;
 import org.junit.Assert;
@@ -35,7 +35,7 @@ import org.junit.runner.RunWith;
 import org.junit.runners.Parameterized;
 
 @RunWith(Parameterized.class)
-public class OrderTest extends ServiceTestBase
+public class OrderTest extends ActiveMQTestBase
 {
 
    private boolean persistent;
@@ -79,9 +79,9 @@ public class OrderTest extends ServiceTestBase
       server = createServer(persistent, true);
       server.start();
 
-      locator.setBlockOnNonDurableSend(false);
-      locator.setBlockOnDurableSend(false);
-      locator.setBlockOnAcknowledge(true);
+      locator.setBlockOnNonDurableSend(false)
+              .setBlockOnDurableSend(false)
+              .setBlockOnAcknowledge(true);
 
       ClientSessionFactory sf = createSessionFactory(locator);
 
@@ -154,9 +154,9 @@ public class OrderTest extends ServiceTestBase
 
       server.start();
 
-      locator.setBlockOnNonDurableSend(false);
-      locator.setBlockOnDurableSend(false);
-      locator.setBlockOnAcknowledge(false);
+      locator.setBlockOnNonDurableSend(false)
+              .setBlockOnDurableSend(false)
+              .setBlockOnAcknowledge(false);
 
       ClientSessionFactory sf = createSessionFactory(locator);
       ClientSession session = sf.createSession(true, true, 0);
@@ -214,15 +214,14 @@ public class OrderTest extends ServiceTestBase
       server = createServer(persistent, true);
 
       server.getAddressSettingsRepository().clear();
-      AddressSettings setting = new AddressSettings();
-      setting.setRedeliveryDelay(500);
+      AddressSettings setting = new AddressSettings().setRedeliveryDelay(500);
       server.getAddressSettingsRepository().addMatch("#", setting);
 
       server.start();
 
-      locator.setBlockOnNonDurableSend(false);
-      locator.setBlockOnDurableSend(false);
-      locator.setBlockOnAcknowledge(false);
+      locator.setBlockOnNonDurableSend(false)
+              .setBlockOnDurableSend(false)
+              .setBlockOnAcknowledge(false);
 
       ClientSessionFactory sf = createSessionFactory(locator);
       ClientSession session = sf.createSession(true, true, 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/PagingOrderTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/PagingOrderTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/PagingOrderTest.java
index b857030..cfeb714 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/PagingOrderTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/PagingOrderTest.java
@@ -16,17 +16,6 @@
  */
 package org.apache.activemq.artemis.tests.integration.client;
 
-import javax.jms.BytesMessage;
-import javax.jms.Connection;
-import javax.jms.DeliveryMode;
-import javax.jms.MessageProducer;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-import javax.jms.Topic;
-import java.nio.ByteBuffer;
-import java.util.HashMap;
-import java.util.concurrent.atomic.AtomicInteger;
-
 import org.apache.activemq.artemis.api.core.ActiveMQBuffer;
 import org.apache.activemq.artemis.api.core.SimpleString;
 import org.apache.activemq.artemis.api.core.TransportConfiguration;
@@ -38,7 +27,6 @@ import org.apache.activemq.artemis.api.core.client.ClientSessionFactory;
 import org.apache.activemq.artemis.api.core.client.ServerLocator;
 import org.apache.activemq.artemis.api.jms.ActiveMQJMSClient;
 import org.apache.activemq.artemis.api.jms.JMSFactoryType;
-import org.apache.activemq.artemis.tests.unit.util.InVMNamingContext;
 import org.apache.activemq.artemis.core.config.Configuration;
 import org.apache.activemq.artemis.core.paging.PagingStore;
 import org.apache.activemq.artemis.core.postoffice.Binding;
@@ -52,15 +40,26 @@ import org.apache.activemq.artemis.core.settings.impl.AddressFullMessagePolicy;
 import org.apache.activemq.artemis.core.settings.impl.AddressSettings;
 import org.apache.activemq.artemis.jms.client.ActiveMQJMSConnectionFactory;
 import org.apache.activemq.artemis.jms.server.impl.JMSServerManagerImpl;
-import org.apache.activemq.artemis.tests.util.ServiceTestBase;
-import org.junit.After;
+import org.apache.activemq.artemis.tests.unit.util.InVMNamingContext;
+import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
 import org.junit.Test;
 
+import javax.jms.BytesMessage;
+import javax.jms.Connection;
+import javax.jms.DeliveryMode;
+import javax.jms.MessageProducer;
+import javax.jms.Session;
+import javax.jms.TextMessage;
+import javax.jms.Topic;
+import java.nio.ByteBuffer;
+import java.util.HashMap;
+import java.util.concurrent.atomic.AtomicInteger;
+
 /**
  * A PagingOrderTest. PagingTest has a lot of tests already. I decided to create a newer one more
  * specialized on Ordering and counters
  */
-public class PagingOrderTest extends ServiceTestBase
+public class PagingOrderTest extends ActiveMQTestBase
 {
 
    private static final int PAGE_MAX = 100 * 1024;
@@ -75,27 +74,12 @@ public class PagingOrderTest extends ServiceTestBase
 
    private Connection conn;
 
-   @Override
-   @After
-   public void tearDown() throws Exception
-   {
-      try
-      {
-         if (conn != null)
-            conn.close();
-      }
-      finally
-      {
-         super.tearDown();
-      }
-   }
-
    @Test
    public void testOrder1() throws Throwable
    {
       boolean persistentMessages = true;
 
-      Configuration config = createDefaultConfig()
+      Configuration config = createDefaultInVMConfig()
          .setJournalSyncNonTransactional(false);
 
       ActiveMQServer server = createServer(true, config, PAGE_SIZE, PAGE_MAX, new HashMap<String, AddressSettings>());
@@ -105,16 +89,15 @@ public class PagingOrderTest extends ServiceTestBase
       final int messageSize = 1024;
 
       final int numberOfMessages = 500;
-      ServerLocator locator = createInVMNonHALocator();
 
-      locator.setClientFailureCheckPeriod(1000);
-      locator.setConnectionTTL(2000);
-      locator.setReconnectAttempts(0);
-
-      locator.setBlockOnNonDurableSend(true);
-      locator.setBlockOnDurableSend(true);
-      locator.setBlockOnAcknowledge(true);
-      locator.setConsumerWindowSize(1024 * 1024);
+      ServerLocator locator = createInVMNonHALocator()
+              .setClientFailureCheckPeriod(1000)
+              .setConnectionTTL(2000)
+              .setReconnectAttempts(0)
+              .setBlockOnNonDurableSend(true)
+              .setBlockOnDurableSend(true)
+              .setBlockOnAcknowledge(true)
+              .setConsumerWindowSize(1024 * 1024);
 
       ClientSessionFactory sf = createSessionFactory(locator);
 
@@ -175,13 +158,9 @@ public class PagingOrderTest extends ServiceTestBase
 
       session.close();
 
-      session = null;
-
       sf.close();
       sf = createSessionFactory(locator);
 
-      locator = createInVMNonHALocator();
-
       session = sf.createSession(true, true, 0);
 
       session.start();
@@ -204,7 +183,7 @@ public class PagingOrderTest extends ServiceTestBase
    {
       boolean persistentMessages = true;
 
-      Configuration config = createDefaultConfig()
+      Configuration config = createDefaultInVMConfig()
          .setJournalSyncNonTransactional(false);
 
       ActiveMQServer server = createServer(true, config, PAGE_SIZE, PAGE_MAX, new HashMap<String, AddressSettings>());
@@ -215,16 +194,14 @@ public class PagingOrderTest extends ServiceTestBase
 
       final int numberOfMessages = 500;
 
-      ServerLocator locator = createInVMNonHALocator();
-
-      locator.setClientFailureCheckPeriod(1000);
-      locator.setConnectionTTL(2000);
-      locator.setReconnectAttempts(0);
-
-      locator.setBlockOnNonDurableSend(true);
-      locator.setBlockOnDurableSend(true);
-      locator.setBlockOnAcknowledge(true);
-      locator.setConsumerWindowSize(1024 * 1024);
+      ServerLocator locator = createInVMNonHALocator()
+              .setClientFailureCheckPeriod(1000)
+              .setConnectionTTL(2000)
+              .setReconnectAttempts(0)
+              .setBlockOnNonDurableSend(true)
+              .setBlockOnDurableSend(true)
+              .setBlockOnAcknowledge(true)
+              .setConsumerWindowSize(1024 * 1024);
 
       ClientSessionFactory sf = createSessionFactory(locator);
 
@@ -357,7 +334,7 @@ public class PagingOrderTest extends ServiceTestBase
    {
       boolean persistentMessages = true;
 
-      Configuration config = createDefaultConfig()
+      Configuration config = createDefaultInVMConfig()
          .setJournalSyncNonTransactional(false);
 
       ActiveMQServer server = createServer(true, config, PAGE_SIZE, PAGE_MAX, new HashMap<String, AddressSettings>());
@@ -368,16 +345,14 @@ public class PagingOrderTest extends ServiceTestBase
 
       final int numberOfMessages = 500;
 
-      ServerLocator locator = createInVMNonHALocator();
-
-      locator.setClientFailureCheckPeriod(1000);
-      locator.setConnectionTTL(2000);
-      locator.setReconnectAttempts(0);
-
-      locator.setBlockOnNonDurableSend(true);
-      locator.setBlockOnDurableSend(true);
-      locator.setBlockOnAcknowledge(true);
-      locator.setConsumerWindowSize(1024 * 1024);
+      ServerLocator locator = createInVMNonHALocator()
+              .setClientFailureCheckPeriod(1000)
+              .setConnectionTTL(2000)
+              .setReconnectAttempts(0)
+              .setBlockOnNonDurableSend(true)
+              .setBlockOnDurableSend(true)
+              .setBlockOnAcknowledge(true)
+              .setConsumerWindowSize(1024 * 1024);
 
       ClientSessionFactory sf = createSessionFactory(locator);
 
@@ -471,7 +446,7 @@ public class PagingOrderTest extends ServiceTestBase
    {
       boolean persistentMessages = true;
 
-      Configuration config = createDefaultConfig()
+      Configuration config = createDefaultInVMConfig()
          .setJournalSyncNonTransactional(false);
 
       ActiveMQServer server = createServer(true, config, PAGE_SIZE, PAGE_MAX, new HashMap<String, AddressSettings>());
@@ -482,16 +457,14 @@ public class PagingOrderTest extends ServiceTestBase
 
       final int numberOfMessages = 3000;
 
-      ServerLocator locator = createInVMNonHALocator();
-
-      locator.setClientFailureCheckPeriod(1000);
-      locator.setConnectionTTL(2000);
-      locator.setReconnectAttempts(0);
-
-      locator.setBlockOnNonDurableSend(true);
-      locator.setBlockOnDurableSend(true);
-      locator.setBlockOnAcknowledge(true);
-      locator.setConsumerWindowSize(1024 * 1024);
+      ServerLocator locator = createInVMNonHALocator()
+              .setClientFailureCheckPeriod(1000)
+              .setConnectionTTL(2000)
+              .setReconnectAttempts(0)
+              .setBlockOnNonDurableSend(true)
+              .setBlockOnDurableSend(true)
+              .setBlockOnAcknowledge(true)
+              .setConsumerWindowSize(1024 * 1024);
 
       ClientSessionFactory sf = createSessionFactory(locator);
 
@@ -571,7 +544,7 @@ public class PagingOrderTest extends ServiceTestBase
    {
       boolean persistentMessages = true;
 
-      Configuration config = createDefaultConfig()
+      Configuration config = createDefaultInVMConfig()
          .setJournalSyncNonTransactional(false);
 
       ActiveMQServer server = createServer(true, config, PAGE_SIZE, PAGE_MAX, new HashMap<String, AddressSettings>());
@@ -582,16 +555,14 @@ public class PagingOrderTest extends ServiceTestBase
 
       final int numberOfMessages = 200;
 
-      ServerLocator locator = createInVMNonHALocator();
-
-      locator.setClientFailureCheckPeriod(1000);
-      locator.setConnectionTTL(2000);
-      locator.setReconnectAttempts(0);
-
-      locator.setBlockOnNonDurableSend(true);
-      locator.setBlockOnDurableSend(true);
-      locator.setBlockOnAcknowledge(true);
-      locator.setConsumerWindowSize(0);
+      ServerLocator locator = createInVMNonHALocator()
+              .setClientFailureCheckPeriod(1000)
+              .setConnectionTTL(2000)
+              .setReconnectAttempts(0)
+              .setBlockOnNonDurableSend(true)
+              .setBlockOnDurableSend(true)
+              .setBlockOnAcknowledge(true)
+              .setConsumerWindowSize(0);
 
       ClientSessionFactory sf = createSessionFactory(locator);
 
@@ -682,16 +653,14 @@ public class PagingOrderTest extends ServiceTestBase
 
       server.start();
 
-      locator = createInVMNonHALocator();
-
-      locator.setClientFailureCheckPeriod(1000);
-      locator.setConnectionTTL(2000);
-      locator.setReconnectAttempts(0);
-
-      locator.setBlockOnNonDurableSend(true);
-      locator.setBlockOnDurableSend(true);
-      locator.setBlockOnAcknowledge(true);
-      locator.setConsumerWindowSize(0);
+      locator = createInVMNonHALocator()
+              .setClientFailureCheckPeriod(1000)
+              .setConnectionTTL(2000)
+              .setReconnectAttempts(0)
+              .setBlockOnNonDurableSend(true)
+              .setBlockOnDurableSend(true)
+              .setBlockOnAcknowledge(true)
+              .setConsumerWindowSize(0);
 
       sf = createSessionFactory(locator);
 
@@ -718,7 +687,7 @@ public class PagingOrderTest extends ServiceTestBase
    public void testPagingOverCreatedDestinationTopics() throws Exception
    {
 
-      Configuration config = createDefaultConfig()
+      Configuration config = createDefaultInVMConfig()
          .setJournalSyncNonTransactional(false);
 
       ActiveMQServer server = createServer(true, config, PAGE_SIZE, -1, new HashMap<String, AddressSettings>());
@@ -797,7 +766,7 @@ public class PagingOrderTest extends ServiceTestBase
    public void testPagingOverCreatedDestinationQueues() throws Exception
    {
 
-      Configuration config = createDefaultConfig()
+      Configuration config = createDefaultInVMConfig()
          .setJournalSyncNonTransactional(false);
 
       ActiveMQServer server = createServer(true, config, -1, -1, new HashMap<String, 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/PagingSyncTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/PagingSyncTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/PagingSyncTest.java
index 500a084..e274d69 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/PagingSyncTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/PagingSyncTest.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.settings.impl.AddressSettings;
@@ -37,7 +37,7 @@ import org.junit.Test;
  * <p/>
  * PagingTest has a lot of tests already. I decided to create a newer one more specialized on Ordering and counters
  */
-public class PagingSyncTest extends ServiceTestBase
+public class PagingSyncTest extends ActiveMQTestBase
 {
 
    private static final int PAGE_MAX = 100 * 1024;
@@ -55,7 +55,7 @@ public class PagingSyncTest extends ServiceTestBase
    {
       boolean persistentMessages = true;
 
-      Configuration config = createDefaultConfig()
+      Configuration config = createDefaultInVMConfig()
          .setJournalSyncNonTransactional(false);
 
       ActiveMQServer server = createServer(true, config, PAGE_SIZE, PAGE_MAX, new HashMap<String, AddressSettings>());
@@ -66,16 +66,14 @@ public class PagingSyncTest extends ServiceTestBase
 
       final int numberOfMessages = 500;
 
-      ServerLocator locator = createInVMNonHALocator();
-
-      locator.setClientFailureCheckPeriod(1000);
-      locator.setConnectionTTL(2000);
-      locator.setReconnectAttempts(0);
-
-      locator.setBlockOnNonDurableSend(false);
-      locator.setBlockOnDurableSend(false);
-      locator.setBlockOnAcknowledge(false);
-      locator.setConsumerWindowSize(1024 * 1024);
+      ServerLocator locator = createInVMNonHALocator()
+              .setClientFailureCheckPeriod(1000)
+              .setConnectionTTL(2000)
+              .setReconnectAttempts(0)
+              .setBlockOnNonDurableSend(false)
+              .setBlockOnDurableSend(false)
+              .setBlockOnAcknowledge(false)
+              .setConsumerWindowSize(1024 * 1024);
 
       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/PagingTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/PagingTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/PagingTest.java
index 7abb2ac..e596323 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/PagingTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/PagingTest.java
@@ -57,7 +57,7 @@ import org.apache.activemq.artemis.core.settings.impl.AddressFullMessagePolicy;
 import org.apache.activemq.artemis.core.settings.impl.AddressSettings;
 import org.apache.activemq.artemis.logs.AssertionLoggerHandler;
 import org.apache.activemq.artemis.tests.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;
@@ -79,7 +79,7 @@ import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicBoolean;
 import java.util.concurrent.atomic.AtomicInteger;
 
-public class PagingTest extends ServiceTestBase
+public class PagingTest extends ActiveMQTestBase
 {
    private ServerLocator locator;
    private ActiveMQServer server;
@@ -107,7 +107,7 @@ public class PagingTest extends ServiceTestBase
    @Test
    public void testPageOnLargeMessageMultipleQueues() throws Exception
    {
-      Configuration config = createDefaultConfig();
+      Configuration config = createDefaultInVMConfig();
 
       final int PAGE_MAX = 20 * 1024;
 
@@ -122,9 +122,9 @@ public class PagingTest extends ServiceTestBase
 
       final int numberOfBytes = 1024;
 
-      locator.setBlockOnNonDurableSend(true);
-      locator.setBlockOnDurableSend(true);
-      locator.setBlockOnAcknowledge(true);
+      locator.setBlockOnNonDurableSend(true)
+              .setBlockOnDurableSend(true)
+              .setBlockOnAcknowledge(true);
 
       ClientSessionFactory sf = addSessionFactory(createSessionFactory(locator));
 
@@ -223,7 +223,7 @@ public class PagingTest extends ServiceTestBase
    {
       clearDataRecreateServerDirs();
 
-      Configuration config = createDefaultConfig()
+      Configuration config = createDefaultInVMConfig()
          .setJournalSyncNonTransactional(false);
 
       server =
@@ -236,11 +236,10 @@ public class PagingTest extends ServiceTestBase
 
       final int numberOfMessages = 5000;
 
-      locator = createInVMNonHALocator();
-
-      locator.setBlockOnNonDurableSend(true);
-      locator.setBlockOnDurableSend(true);
-      locator.setBlockOnAcknowledge(true);
+      locator = createInVMNonHALocator()
+              .setBlockOnNonDurableSend(true)
+              .setBlockOnDurableSend(true)
+              .setBlockOnAcknowledge(true);
 
       sf = createSessionFactory(locator);
 
@@ -362,7 +361,7 @@ public class PagingTest extends ServiceTestBase
    {
       clearDataRecreateServerDirs();
 
-      Configuration config = createDefaultConfig()
+      Configuration config = createDefaultInVMConfig()
          .setJournalSyncNonTransactional(false);
 
       server =
@@ -375,11 +374,10 @@ public class PagingTest extends ServiceTestBase
 
       final int numberOfMessages = 20;
 
-      locator = createInVMNonHALocator();
-
-      locator.setBlockOnNonDurableSend(true);
-      locator.setBlockOnDurableSend(true);
-      locator.setBlockOnAcknowledge(true);
+      locator = createInVMNonHALocator()
+              .setBlockOnNonDurableSend(true)
+              .setBlockOnDurableSend(true)
+              .setBlockOnAcknowledge(true);
 
       sf = createSessionFactory(locator);
 
@@ -482,7 +480,7 @@ public class PagingTest extends ServiceTestBase
    {
       clearDataRecreateServerDirs();
 
-      Configuration config = createDefaultConfig()
+      Configuration config = createDefaultInVMConfig()
          .setJournalSyncNonTransactional(false);
 
       server = createServer(true,
@@ -495,12 +493,11 @@ public class PagingTest extends ServiceTestBase
 
       final int numberOfMessages = 50;
 
-      locator = createInVMNonHALocator();
-
-      locator.setBlockOnNonDurableSend(true);
-      locator.setBlockOnDurableSend(true);
-      locator.setBlockOnAcknowledge(true);
-      locator.setAckBatchSize(0);
+      locator = createInVMNonHALocator()
+              .setBlockOnNonDurableSend(true)
+              .setBlockOnDurableSend(true)
+              .setBlockOnAcknowledge(true)
+              .setAckBatchSize(0);
 
       sf = createSessionFactory(locator);
 
@@ -699,7 +696,7 @@ public class PagingTest extends ServiceTestBase
    {
       clearDataRecreateServerDirs();
 
-      Configuration config = createDefaultConfig()
+      Configuration config = createDefaultInVMConfig()
          .setJournalDirectory(getJournalDir())
          .setJournalSyncNonTransactional(false)
          .setJournalCompactMinFiles(0) // disable compact
@@ -711,12 +708,11 @@ public class PagingTest extends ServiceTestBase
                             PagingTest.PAGE_MAX,
                             new HashMap<String, AddressSettings>());
 
-      AddressSettings defaultSetting = new AddressSettings();
-      defaultSetting.setPageSizeBytes(PAGE_SIZE);
-      defaultSetting.setMaxSizeBytes(PAGE_MAX);
-      // defaultSetting.setRedeliveryDelay(500);
-      defaultSetting.setExpiryAddress(new SimpleString("EXP"));
-      defaultSetting.setAddressFullMessagePolicy(AddressFullMessagePolicy.PAGE);
+      AddressSettings defaultSetting = new AddressSettings()
+              .setPageSizeBytes(PAGE_SIZE)
+              .setMaxSizeBytes(PAGE_MAX)
+              .setExpiryAddress(new SimpleString("EXP"))
+              .setAddressFullMessagePolicy(AddressFullMessagePolicy.PAGE);
 
       server.getAddressSettingsRepository().clear();
 
@@ -726,13 +722,11 @@ public class PagingTest extends ServiceTestBase
 
       final int numberOfMessages = 5000;
 
-      locator = createInVMNonHALocator();
-
-      locator.setConsumerWindowSize(10 * 1024 * 1024);
-
-      locator.setBlockOnNonDurableSend(true);
-      locator.setBlockOnDurableSend(true);
-      locator.setBlockOnAcknowledge(true);
+      locator = createInVMNonHALocator()
+              .setConsumerWindowSize(10 * 1024 * 1024)
+              .setBlockOnNonDurableSend(true)
+              .setBlockOnDurableSend(true)
+              .setBlockOnAcknowledge(true);
 
       ClientSessionFactory sf = locator.createSessionFactory();
 
@@ -841,7 +835,7 @@ public class PagingTest extends ServiceTestBase
    {
       clearDataRecreateServerDirs();
 
-      Configuration config = createDefaultConfig()
+      Configuration config = createDefaultInVMConfig()
          .setJournalDirectory(getJournalDir())
          .setJournalSyncNonTransactional(false)
          .setJournalCompactMinFiles(0); // disable compact
@@ -856,13 +850,11 @@ public class PagingTest extends ServiceTestBase
 
       final int numberOfMessages = 5000;
 
-      locator = createInVMNonHALocator();
-
-      locator.setConsumerWindowSize(10 * 1024 * 1024);
-
-      locator.setBlockOnNonDurableSend(true);
-      locator.setBlockOnDurableSend(true);
-      locator.setBlockOnAcknowledge(true);
+      locator = createInVMNonHALocator()
+              .setConsumerWindowSize(10 * 1024 * 1024)
+              .setBlockOnNonDurableSend(true)
+              .setBlockOnDurableSend(true)
+              .setBlockOnAcknowledge(true);
 
       SimpleString QUEUE2 = ADDRESS.concat("-2");
 
@@ -1025,7 +1017,7 @@ public class PagingTest extends ServiceTestBase
    {
       clearDataRecreateServerDirs();
 
-      Configuration config = createDefaultConfig()
+      Configuration config = createDefaultInVMConfig()
          .setJournalSyncNonTransactional(false);
 
       server = createServer(true,
@@ -1044,9 +1036,9 @@ public class PagingTest extends ServiceTestBase
 
       locator = createInVMNonHALocator();
 
-      locator.setBlockOnNonDurableSend(true);
-      locator.setBlockOnDurableSend(true);
-      locator.setBlockOnAcknowledge(true);
+      locator.setBlockOnNonDurableSend(true)
+              .setBlockOnDurableSend(true)
+              .setBlockOnAcknowledge(true);
 
       sf = createSessionFactory(locator);
 
@@ -1155,7 +1147,7 @@ public class PagingTest extends ServiceTestBase
                             new HashMap<String, AddressSettings>());
       server.start();
 
-      waitForServer(server);
+      waitForServerToStart(server);
 
       queue = server.locateQueue(ADDRESS);
 
@@ -1232,7 +1224,7 @@ public class PagingTest extends ServiceTestBase
    {
       clearDataRecreateServerDirs();
 
-      Configuration config = createDefaultConfig()
+      Configuration config = createDefaultInVMConfig()
          .setJournalSyncNonTransactional(false);
 
       server = createServer(true, config, PagingTest.PAGE_SIZE, PagingTest.PAGE_MAX, new HashMap<String, AddressSettings>());
@@ -1244,13 +1236,12 @@ public class PagingTest extends ServiceTestBase
 
       final int numberOfMessages = 500;
 
-      locator = createInVMNonHALocator();
-
-      locator.setBlockOnNonDurableSend(true);
-      locator.setBlockOnDurableSend(true);
-      locator.setBlockOnAcknowledge(true);
-      locator.setProducerWindowSize(-1);
-      locator.setMinLargeMessageSize(1024 * 1024);
+      locator = createInVMNonHALocator()
+              .setBlockOnNonDurableSend(true)
+              .setBlockOnDurableSend(true)
+              .setBlockOnAcknowledge(true)
+              .setProducerWindowSize(-1)
+              .setMinLargeMessageSize(1024 * 1024);
 
       sf = createSessionFactory(locator);
 
@@ -1315,7 +1306,7 @@ public class PagingTest extends ServiceTestBase
    {
       clearDataRecreateServerDirs();
 
-      Configuration config = createDefaultConfig()
+      Configuration config = createDefaultInVMConfig()
          .setJournalSyncNonTransactional(false);
 
       server = createServer(true,
@@ -1328,11 +1319,10 @@ public class PagingTest extends ServiceTestBase
 
       final int numberOfMessages = 1000;
 
-      locator = createInVMNonHALocator();
-
-      locator.setBlockOnNonDurableSend(true);
-      locator.setBlockOnDurableSend(true);
-      locator.setBlockOnAcknowledge(true);
+      locator = createInVMNonHALocator()
+              .setBlockOnNonDurableSend(true)
+              .setBlockOnDurableSend(true)
+              .setBlockOnAcknowledge(true);
 
       sf = createSessionFactory(locator);
 
@@ -1444,7 +1434,7 @@ public class PagingTest extends ServiceTestBase
    {
       clearDataRecreateServerDirs();
 
-      Configuration config = createDefaultConfig()
+      Configuration config = createDefaultInVMConfig()
          .setPersistDeliveryCountBeforeDelivery(true);
 
       config.setJournalSyncNonTransactional(false);
@@ -1459,11 +1449,10 @@ public class PagingTest extends ServiceTestBase
 
       final int numberOfMessages = 1000;
 
-      locator = createInVMNonHALocator();
-
-      locator.setBlockOnNonDurableSend(true);
-      locator.setBlockOnDurableSend(true);
-      locator.setBlockOnAcknowledge(true);
+      locator = createInVMNonHALocator()
+              .setBlockOnNonDurableSend(true)
+              .setBlockOnDurableSend(true)
+              .setBlockOnAcknowledge(true);
 
       sf = createSessionFactory(locator);
 
@@ -1578,10 +1567,10 @@ public class PagingTest extends ServiceTestBase
                             new HashMap<String, AddressSettings>());
       server.start();
 
-      locator = createInVMNonHALocator();
-      locator.setBlockOnNonDurableSend(true);
-      locator.setBlockOnDurableSend(true);
-      locator.setBlockOnAcknowledge(true);
+      locator = createInVMNonHALocator()
+              .setBlockOnNonDurableSend(true)
+              .setBlockOnDurableSend(true)
+              .setBlockOnAcknowledge(true);
 
       sf = createSessionFactory(locator);
 
@@ -1662,7 +1651,7 @@ public class PagingTest extends ServiceTestBase
    {
       clearDataRecreateServerDirs();
 
-      Configuration config = createDefaultConfig()
+      Configuration config = createDefaultInVMConfig()
          .setJournalSyncNonTransactional(false);
 
       server = createServer(true,
@@ -1681,11 +1670,10 @@ public class PagingTest extends ServiceTestBase
 
       try
       {
-         locator = createInVMNonHALocator();
-
-         locator.setBlockOnNonDurableSend(true);
-         locator.setBlockOnDurableSend(true);
-         locator.setBlockOnAcknowledge(true);
+         locator = createInVMNonHALocator()
+                 .setBlockOnNonDurableSend(true)
+                 .setBlockOnDurableSend(true)
+                 .setBlockOnAcknowledge(true);
 
          sf = createSessionFactory(locator);
 
@@ -1746,7 +1734,7 @@ public class PagingTest extends ServiceTestBase
                                         2,
                                         0,
                                         0,
-                                        new NIOSequentialFileFactory(getJournalDir()),
+                                        new NIOSequentialFileFactory(server.getConfiguration().getJournalDirectory()),
                                         "activemq-data",
                                         "amq",
                                         1);
@@ -1798,11 +1786,10 @@ public class PagingTest extends ServiceTestBase
 
       server.stop();
 
-      locator = createInVMNonHALocator();
-
-      locator.setBlockOnNonDurableSend(true);
-      locator.setBlockOnDurableSend(true);
-      locator.setBlockOnAcknowledge(true);
+      locator = createInVMNonHALocator()
+              .setBlockOnNonDurableSend(true)
+              .setBlockOnDurableSend(true)
+              .setBlockOnAcknowledge(true);
 
       server = createServer(true,
                             config,
@@ -1847,7 +1834,7 @@ public class PagingTest extends ServiceTestBase
    {
       clearDataRecreateServerDirs();
 
-      Configuration config = createDefaultConfig()
+      Configuration config = createDefaultInVMConfig()
          .setJournalSyncNonTransactional(false);
 
       server = createServer(true,
@@ -1866,11 +1853,10 @@ public class PagingTest extends ServiceTestBase
 
       try
       {
-         locator = createInVMNonHALocator();
-
-         locator.setBlockOnNonDurableSend(true);
-         locator.setBlockOnDurableSend(true);
-         locator.setBlockOnAcknowledge(true);
+         locator = createInVMNonHALocator()
+                 .setBlockOnNonDurableSend(true)
+                 .setBlockOnDurableSend(true)
+                 .setBlockOnAcknowledge(true);
 
          sf = createSessionFactory(locator);
 
@@ -1959,9 +1945,9 @@ public class PagingTest extends ServiceTestBase
 
       locator = createInVMNonHALocator();
 
-      locator.setBlockOnNonDurableSend(true);
-      locator.setBlockOnDurableSend(true);
-      locator.setBlockOnAcknowledge(true);
+      locator.setBlockOnNonDurableSend(true)
+              .setBlockOnDurableSend(true)
+              .setBlockOnAcknowledge(true);
 
       ClientSessionFactory csf = createSessionFactory(locator);
 
@@ -2006,7 +1992,7 @@ public class PagingTest extends ServiceTestBase
 
       clearDataRecreateServerDirs();
 
-      Configuration config = createDefaultConfig()
+      Configuration config = createDefaultInVMConfig()
          .setJournalSyncNonTransactional(false);
 
       server = createServer(true,
@@ -2019,11 +2005,10 @@ public class PagingTest extends ServiceTestBase
 
       final int numberOfMessages = 1000;
 
-      locator = createInVMNonHALocator();
-
-      locator.setBlockOnNonDurableSend(true);
-      locator.setBlockOnDurableSend(true);
-      locator.setBlockOnAcknowledge(true);
+      locator = createInVMNonHALocator()
+              .setBlockOnNonDurableSend(true)
+              .setBlockOnDurableSend(true)
+              .setBlockOnAcknowledge(true);
 
       sf = createSessionFactory(locator);
 
@@ -2124,7 +2109,7 @@ public class PagingTest extends ServiceTestBase
    {
       clearDataRecreateServerDirs();
 
-      Configuration config = createDefaultConfig()
+      Configuration config = createDefaultInVMConfig()
          .setJournalSyncNonTransactional(false);
 
       server = createServer(true,
@@ -2142,6 +2127,8 @@ public class PagingTest extends ServiceTestBase
             .setForwardingAddress(PagingTest.ADDRESS.toString() + "-1")
             .setExclusive(true);
 
+         config.addDivertConfiguration(divert1);
+
          DivertConfiguration divert2 = new DivertConfiguration()
             .setName("dv2")
             .setRoutingName("nm2")
@@ -2149,11 +2136,7 @@ public class PagingTest extends ServiceTestBase
             .setForwardingAddress(PagingTest.ADDRESS.toString() + "-2")
             .setExclusive(true);
 
-         ArrayList<DivertConfiguration> divertList = new ArrayList<DivertConfiguration>();
-         divertList.add(divert1);
-         divertList.add(divert2);
-
-         config.setDivertConfigurations(divertList);
+         config.addDivertConfiguration(divert2);
       }
 
       server.start();
@@ -2206,11 +2189,10 @@ public class PagingTest extends ServiceTestBase
       try
       {
          {
-            locator = createInVMNonHALocator();
-
-            locator.setBlockOnNonDurableSend(true);
-            locator.setBlockOnDurableSend(true);
-            locator.setBlockOnAcknowledge(true);
+            locator = createInVMNonHALocator()
+                    .setBlockOnNonDurableSend(true)
+                    .setBlockOnDurableSend(true)
+                    .setBlockOnAcknowledge(true);
 
             sf = createSessionFactory(locator);
 
@@ -2337,10 +2319,10 @@ public class PagingTest extends ServiceTestBase
                         }
                         catch (AssertionError e)
                         {
-                           PagingTest.log.info("Expected buffer:" + ServiceTestBase.dumbBytesHex(body, 40));
-                           PagingTest.log.info("Arriving buffer:" + ServiceTestBase.dumbBytesHex(message2.getBodyBuffer()
-                                                                                                 .toByteBuffer()
-                                                                                                 .array(), 40));
+                           PagingTest.log.info("Expected buffer:" + ActiveMQTestBase.dumpBytesHex(body, 40));
+                           PagingTest.log.info("Arriving buffer:" + ActiveMQTestBase.dumpBytesHex(message2.getBodyBuffer()
+                                                                                                          .toByteBuffer()
+                                                                                                          .array(), 40));
                            throw e;
                         }
                      }
@@ -2420,7 +2402,7 @@ public class PagingTest extends ServiceTestBase
    {
       clearDataRecreateServerDirs();
 
-      Configuration config = createDefaultConfig()
+      Configuration config = createDefaultInVMConfig()
          .setJournalSyncNonTransactional(false);
 
       server = createServer(true,
@@ -2445,9 +2427,9 @@ public class PagingTest extends ServiceTestBase
       {
          locator = createInVMNonHALocator();
 
-         locator.setBlockOnNonDurableSend(true);
-         locator.setBlockOnDurableSend(true);
-         locator.setBlockOnAcknowledge(true);
+         locator.setBlockOnNonDurableSend(true)
+                 .setBlockOnDurableSend(true)
+                 .setBlockOnAcknowledge(true);
 
          sf = createSessionFactory(locator);
 
@@ -2536,10 +2518,10 @@ public class PagingTest extends ServiceTestBase
                   }
                   catch (AssertionError e)
                   {
-                     PagingTest.log.info("Expected buffer:" + ServiceTestBase.dumbBytesHex(body, 40));
-                     PagingTest.log.info("Arriving buffer:" + ServiceTestBase.dumbBytesHex(message2.getBodyBuffer()
-                                                                                           .toByteBuffer()
-                                                                                           .array(), 40));
+                     PagingTest.log.info("Expected buffer:" + ActiveMQTestBase.dumpBytesHex(body, 40));
+                     PagingTest.log.info("Arriving buffer:" + ActiveMQTestBase.dumpBytesHex(message2.getBodyBuffer()
+                                                                                                    .toByteBuffer()
+                                                                                                    .array(), 40));
                      throw e;
                   }
                }
@@ -2587,7 +2569,7 @@ public class PagingTest extends ServiceTestBase
 
       clearDataRecreateServerDirs();
 
-      Configuration config = createDefaultConfig()
+      Configuration config = createDefaultInVMConfig()
          .setJournalSyncNonTransactional(false);
 
       server = createServer(true,
@@ -2601,11 +2583,10 @@ public class PagingTest extends ServiceTestBase
       final int numberOfIntegers = 256;
 
       final int numberOfMessages = 1000;
-      locator = createInVMNonHALocator();
-
-      locator.setBlockOnNonDurableSend(true);
-      locator.setBlockOnDurableSend(true);
-      locator.setBlockOnAcknowledge(true);
+      locator = createInVMNonHALocator()
+              .setBlockOnNonDurableSend(true)
+              .setBlockOnDurableSend(true)
+              .setBlockOnAcknowledge(true);
 
       sf = createSessionFactory(locator);
 
@@ -2689,10 +2670,10 @@ public class PagingTest extends ServiceTestBase
          }
          catch (AssertionError e)
          {
-            PagingTest.log.info("Expected buffer:" + ServiceTestBase.dumbBytesHex(body, 40));
-            PagingTest.log.info("Arriving buffer:" + ServiceTestBase.dumbBytesHex(message2.getBodyBuffer()
-                                                                                  .toByteBuffer()
-                                                                                  .array(), 40));
+            PagingTest.log.info("Expected buffer:" + ActiveMQTestBase.dumpBytesHex(body, 40));
+            PagingTest.log.info("Arriving buffer:" + ActiveMQTestBase.dumpBytesHex(message2.getBodyBuffer()
+                                                                                           .toByteBuffer()
+                                                                                           .array(), 40));
             throw e;
          }
       }
@@ -2708,7 +2689,7 @@ public class PagingTest extends ServiceTestBase
 
       buffer.readBytes(other);
 
-      ServiceTestBase.assertEqualsByteArrays(body, other);
+      ActiveMQTestBase.assertEqualsByteArrays(body, other);
    }
 
    /**
@@ -2723,7 +2704,7 @@ public class PagingTest extends ServiceTestBase
    {
       clearDataRecreateServerDirs();
 
-      Configuration config = createDefaultConfig();
+      Configuration config = createDefaultInVMConfig();
 
       server = createServer(true,
                             config,
@@ -2733,10 +2714,10 @@ public class PagingTest extends ServiceTestBase
 
       server.start();
 
-      locator = createInVMNonHALocator();
-      locator.setBlockOnNonDurableSend(true);
-      locator.setBlockOnDurableSend(true);
-      locator.setBlockOnAcknowledge(true);
+      locator = createInVMNonHALocator()
+              .setBlockOnNonDurableSend(true)
+              .setBlockOnDurableSend(true)
+              .setBlockOnAcknowledge(true);
 
       sf = createSessionFactory(locator);
 
@@ -2847,7 +2828,7 @@ public class PagingTest extends ServiceTestBase
       boolean IS_DURABLE_MESSAGE = true;
       clearDataRecreateServerDirs();
 
-      Configuration config = createDefaultConfig();
+      Configuration config = createDefaultInVMConfig();
 
       server = createServer(true,
                             config,
@@ -2857,10 +2838,10 @@ public class PagingTest extends ServiceTestBase
 
       server.start();
 
-      locator = createInVMNonHALocator();
-      locator.setBlockOnNonDurableSend(true);
-      locator.setBlockOnDurableSend(true);
-      locator.setBlockOnAcknowledge(true);
+      locator = createInVMNonHALocator()
+              .setBlockOnNonDurableSend(true)
+              .setBlockOnDurableSend(true)
+              .setBlockOnAcknowledge(true);
 
       sf = createSessionFactory(locator);
 
@@ -2972,7 +2953,7 @@ public class PagingTest extends ServiceTestBase
    {
       clearDataRecreateServerDirs();
 
-      Configuration config = createDefaultConfig();
+      Configuration config = createDefaultInVMConfig();
 
       server = createServer(true,
                             config,
@@ -2982,10 +2963,10 @@ public class PagingTest extends ServiceTestBase
 
       server.start();
 
-      locator = createInVMNonHALocator();
-      locator.setBlockOnNonDurableSend(true);
-      locator.setBlockOnDurableSend(true);
-      locator.setBlockOnAcknowledge(true);
+      locator = createInVMNonHALocator()
+              .setBlockOnNonDurableSend(true)
+              .setBlockOnDurableSend(true)
+              .setBlockOnAcknowledge(true);
 
       sf = createSessionFactory(locator);
 
@@ -3080,7 +3061,9 @@ public class PagingTest extends ServiceTestBase
    {
       clearDataRecreateServerDirs();
 
-      Configuration config = createDefaultConfig();
+      Configuration config = createDefaultInVMConfig()
+              .setJournalSyncNonTransactional(false)
+              .setJournalSyncTransactional(false);
 
       server = createServer(true,
                             config,
@@ -3088,20 +3071,17 @@ public class PagingTest extends ServiceTestBase
                             PagingTest.PAGE_MAX,
                             new HashMap<String, AddressSettings>());
 
-      server.getConfiguration().setJournalSyncNonTransactional(false);
-      server.getConfiguration().setJournalSyncTransactional(false);
-
       server.start();
 
       final AtomicInteger errors = new AtomicInteger(0);
 
       final int numberOfMessages = 10000;
 
-      locator = createInVMNonHALocator();
+      locator = createInVMNonHALocator()
+              .setBlockOnNonDurableSend(true)
+              .setBlockOnDurableSend(true)
+              .setBlockOnAcknowledge(false);
 
-      locator.setBlockOnNonDurableSend(true);
-      locator.setBlockOnDurableSend(true);
-      locator.setBlockOnAcknowledge(false);
       sf = createSessionFactory(locator);
 
       final byte[] body = new byte[MESSAGE_SIZE];
@@ -3194,7 +3174,9 @@ public class PagingTest extends ServiceTestBase
    {
       clearDataRecreateServerDirs();
 
-      Configuration config = createDefaultConfig();
+      Configuration config = createDefaultInVMConfig()
+              .setJournalSyncNonTransactional(false)
+              .setJournalSyncTransactional(false);
 
       server = createServer(true,
                             config,
@@ -3202,8 +3184,8 @@ public class PagingTest extends ServiceTestBase
                             PagingTest.PAGE_SIZE * 2,
                             new HashMap<String, AddressSettings>());
 
-      server.getConfiguration().setJournalSyncNonTransactional(false);
-      server.getConfiguration().setJournalSyncTransactional(false);
+      server.getConfiguration();
+      server.getConfiguration();
 
       server.start();
 
@@ -3211,9 +3193,10 @@ public class PagingTest extends ServiceTestBase
 
       final int numberOfMessages = 2000;
 
-      locator.setBlockOnNonDurableSend(true);
-      locator.setBlockOnDurableSend(true);
-      locator.setBlockOnAcknowledge(true);
+      locator.setBlockOnNonDurableSend(true)
+              .setBlockOnDurableSend(true)
+              .setBlockOnAcknowledge(true);
+
       sf = createSessionFactory(locator);
 
       final CountDownLatch ready = new CountDownLatch(1);
@@ -3323,7 +3306,7 @@ public class PagingTest extends ServiceTestBase
    {
       clearDataRecreateServerDirs();
 
-      Configuration config = createDefaultConfig()
+      Configuration config = createDefaultInVMConfig()
          .setJournalSyncNonTransactional(false);
 
       server = createServer(true,
@@ -3338,9 +3321,9 @@ public class PagingTest extends ServiceTestBase
 
       final int numberOfBytes = 1024;
 
-      locator.setBlockOnNonDurableSend(true);
-      locator.setBlockOnDurableSend(true);
-      locator.setBlockOnAcknowledge(true);
+      locator.setBlockOnNonDurableSend(true)
+              .setBlockOnDurableSend(true)
+              .setBlockOnAcknowledge(true);
 
       sf = createSessionFactory(locator);
       ClientSession session = sf.createSession(null, null, false, true, true, false, 0);
@@ -3355,7 +3338,7 @@ public class PagingTest extends ServiceTestBase
 
       for (int j = 0; j < numberOfBytes; j++)
       {
-         body[j] = ServiceTestBase.getSamplebyte(j);
+         body[j] = ActiveMQTestBase.getSamplebyte(j);
       }
 
       long scheduledTime = System.currentTimeMillis() + 5000;
@@ -3424,10 +3407,10 @@ public class PagingTest extends ServiceTestBase
          }
          catch (AssertionError e)
          {
-            PagingTest.log.info("Expected buffer:" + ServiceTestBase.dumbBytesHex(body, 40));
-            PagingTest.log.info("Arriving buffer:" + ServiceTestBase.dumbBytesHex(message2.getBodyBuffer()
-                                                                                  .toByteBuffer()
-                                                                                  .array(), 40));
+            PagingTest.log.info("Expected buffer:" + ActiveMQTestBase.dumpBytesHex(body, 40));
+            PagingTest.log.info("Arriving buffer:" + ActiveMQTestBase.dumpBytesHex(message2.getBodyBuffer()
+                                                                                           .toByteBuffer()
+                                                                                           .array(), 40));
             throw e;
          }
       }
@@ -3442,7 +3425,7 @@ public class PagingTest extends ServiceTestBase
    {
       clearDataRecreateServerDirs();
 
-      Configuration config = createDefaultConfig();
+      Configuration config = createDefaultInVMConfig();
 
       server = createServer(true,
                             config,
@@ -3456,9 +3439,9 @@ public class PagingTest extends ServiceTestBase
 
       final int numberOfMessages = 10;
 
-      locator.setBlockOnNonDurableSend(true);
-      locator.setBlockOnDurableSend(true);
-      locator.setBlockOnAcknowledge(true);
+      locator.setBlockOnNonDurableSend(true)
+              .setBlockOnDurableSend(true)
+              .setBlockOnAcknowledge(true);
 
       sf = createSessionFactory(locator);
       ClientSession session = sf.createSession(null, null, false, false, true, false, 0);
@@ -3501,7 +3484,7 @@ public class PagingTest extends ServiceTestBase
    {
       clearDataRecreateServerDirs();
 
-      Configuration config = createDefaultConfig();
+      Configuration config = createDefaultInVMConfig();
 
       server = createServer(true,
                             config,
@@ -3515,9 +3498,9 @@ public class PagingTest extends ServiceTestBase
 
       final int numberOfMessages = 500;
 
-      locator.setBlockOnNonDurableSend(true);
-      locator.setBlockOnDurableSend(true);
-      locator.setBlockOnAcknowledge(true);
+      locator.setBlockOnNonDurableSend(true)
+              .setBlockOnDurableSend(true)
+              .setBlockOnAcknowledge(true);
 
       sf = createSessionFactory(locator);
       ClientSession session = sf.createSession(null, null, false, false, false, false, 0);
@@ -3589,7 +3572,7 @@ public class PagingTest extends ServiceTestBase
    {
       clearDataRecreateServerDirs();
 
-      Configuration config = createDefaultConfig();
+      Configuration config = createDefaultInVMConfig();
 
       server = createServer(true,
                             config,
@@ -3601,9 +3584,9 @@ public class PagingTest extends ServiceTestBase
 
       final int numberOfMessages = 1000;
 
-      locator.setBlockOnNonDurableSend(true);
-      locator.setBlockOnDurableSend(true);
-      locator.setBlockOnAcknowledge(true);
+      locator.setBlockOnNonDurableSend(true)
+              .setBlockOnDurableSend(true)
+              .setBlockOnAcknowledge(true);
 
       sf = createSessionFactory(locator);
       ClientSession session = sf.createSession(null, null, false, false, false, false, 0);
@@ -3714,8 +3697,6 @@ public class PagingTest extends ServiceTestBase
    {
       clearDataRecreateServerDirs();
 
-      Configuration config = createDefaultConfig();
-
       HashMap<String, AddressSettings> settings = new HashMap<String, AddressSettings>();
 
       AddressSettings set = new AddressSettings();
@@ -3723,15 +3704,15 @@ public class PagingTest extends ServiceTestBase
 
       settings.put(PagingTest.ADDRESS.toString(), set);
 
-      server = createServer(true, config, 1024, 10 * 1024, settings);
+      server = createServer(true, createDefaultInVMConfig(), 1024, 10 * 1024, settings);
 
       server.start();
 
       final int numberOfMessages = 1000;
 
-      locator.setBlockOnNonDurableSend(true);
-      locator.setBlockOnDurableSend(true);
-      locator.setBlockOnAcknowledge(true);
+      locator.setBlockOnNonDurableSend(true)
+              .setBlockOnDurableSend(true)
+              .setBlockOnAcknowledge(true);
 
       sf = createSessionFactory(locator);
       ClientSession session = sf.createSession(null, null, false, true, true, false, 0);
@@ -3837,8 +3818,6 @@ public class PagingTest extends ServiceTestBase
    {
       clearDataRecreateServerDirs();
 
-      Configuration config = createDefaultConfig();
-
       HashMap<String, AddressSettings> settings = new HashMap<String, AddressSettings>();
 
       AddressSettings set = new AddressSettings();
@@ -3846,7 +3825,7 @@ public class PagingTest extends ServiceTestBase
 
       settings.put(PagingTest.ADDRESS.toString(), set);
 
-      server = createServer(true, config, 1024, 1024 * 1024, settings);
+      server = createServer(true, createDefaultInVMConfig(), 1024, 1024 * 1024, settings);
 
       server.start();
 
@@ -3922,7 +3901,7 @@ public class PagingTest extends ServiceTestBase
 
    private void internalTestPageMultipleDestinations(final boolean transacted) throws Exception
    {
-      Configuration config = createDefaultConfig();
+      Configuration config = createDefaultInVMConfig();
 
       final int NUMBER_OF_BINDINGS = 100;
 
@@ -3935,9 +3914,10 @@ public class PagingTest extends ServiceTestBase
                             new HashMap<String, AddressSettings>());
 
       server.start();
-      locator.setBlockOnNonDurableSend(true);
-      locator.setBlockOnDurableSend(true);
-      locator.setBlockOnAcknowledge(true);
+
+      locator.setBlockOnNonDurableSend(true)
+              .setBlockOnDurableSend(true)
+              .setBlockOnAcknowledge(true);
 
       ClientSessionFactory sf = createSessionFactory(locator);
       ClientSession session = sf.createSession(null, null, false, !transacted, true, false, 0);
@@ -4017,7 +3997,7 @@ public class PagingTest extends ServiceTestBase
    @Test
    public void testSyncPage() throws Exception
    {
-      Configuration config = createDefaultConfig();
+      Configuration config = createDefaultInVMConfig();
 
       server = createServer(true,
                             config,
@@ -4069,7 +4049,7 @@ public class PagingTest extends ServiceTestBase
    @Test
    public void testSyncPageTX() throws Exception
    {
-      Configuration config = createDefaultConfig();
+      Configuration config = createDefaultInVMConfig();
 
       server = createServer(true,
                             config,
@@ -4104,15 +4084,15 @@ public class PagingTest extends ServiceTestBase
       SimpleString PAGED_ADDRESS = new SimpleString("paged");
       SimpleString NON_PAGED_ADDRESS = new SimpleString("non-paged");
 
-      Configuration configuration = createDefaultConfig();
+      Configuration configuration = createDefaultInVMConfig();
 
       Map<String, AddressSettings> addresses = new HashMap<String, AddressSettings>();
 
       addresses.put("#", new AddressSettings());
 
-      AddressSettings pagedDestination = new AddressSettings();
-      pagedDestination.setPageSizeBytes(1024);
-      pagedDestination.setMaxSizeBytes(10 * 1024);
+      AddressSettings pagedDestination = new AddressSettings()
+              .setPageSizeBytes(1024)
+              .setMaxSizeBytes(10 * 1024);
 
       addresses.put(PAGED_ADDRESS.toString(), pagedDestination);
 
@@ -4195,23 +4175,23 @@ public class PagingTest extends ServiceTestBase
       SimpleString PAGED_ADDRESS_A = new SimpleString("paged-a");
       SimpleString PAGED_ADDRESS_B = new SimpleString("paged-b");
 
-      Configuration configuration = createDefaultConfig();
+      Configuration configuration = createDefaultInVMConfig();
 
       Map<String, AddressSettings> addresses = new HashMap<String, AddressSettings>();
 
       addresses.put("#", new AddressSettings());
 
-      AddressSettings pagedDestinationA = new AddressSettings();
-      pagedDestinationA.setPageSizeBytes(1024);
-      pagedDestinationA.setMaxSizeBytes(10 * 1024);
+      AddressSettings pagedDestinationA = new AddressSettings()
+              .setPageSizeBytes(1024)
+              .setMaxSizeBytes(10 * 1024);
 
       int NUMBER_MESSAGES_BEFORE_PAGING = 11;
 
       addresses.put(PAGED_ADDRESS_A.toString(), pagedDestinationA);
 
-      AddressSettings pagedDestinationB = new AddressSettings();
-      pagedDestinationB.setPageSizeBytes(2024);
-      pagedDestinationB.setMaxSizeBytes(25 * 1024);
+      AddressSettings pagedDestinationB = new AddressSettings()
+              .setPageSizeBytes(2024)
+              .setMaxSizeBytes(25 * 1024);
 
       addresses.put(PAGED_ADDRESS_B.toString(), pagedDestinationB);
 
@@ -4316,7 +4296,7 @@ public class PagingTest extends ServiceTestBase
 
       clearDataRecreateServerDirs();
 
-      Configuration config = createDefaultConfig()
+      Configuration config = createDefaultInVMConfig()
          .setJournalSyncNonTransactional(false)
          .setJournalFileSize(10 * 1024 * 1024);
 
@@ -4328,11 +4308,10 @@ public class PagingTest extends ServiceTestBase
 
       final int numberOfMessages = 200;
 
-      locator = createInVMNonHALocator();
-
-      locator.setBlockOnNonDurableSend(true);
-      locator.setBlockOnDurableSend(true);
-      locator.setBlockOnAcknowledge(true);
+      locator = createInVMNonHALocator()
+              .setBlockOnNonDurableSend(true)
+              .setBlockOnDurableSend(true)
+              .setBlockOnAcknowledge(true);
 
       sf = createSessionFactory(locator);
 
@@ -4438,7 +4417,7 @@ public class PagingTest extends ServiceTestBase
 
       clearDataRecreateServerDirs();
 
-      Configuration config = createDefaultConfig()
+      Configuration config = createDefaultInVMConfig()
          .setJournalSyncNonTransactional(false);
 
       server = createServer(true,
@@ -4450,15 +4429,13 @@ public class PagingTest extends ServiceTestBase
       server.start();
 
       final int numberOfMessages = 200;
-      locator = createInVMNonHALocator();
-
-      locator.setClientFailureCheckPeriod(120000);
-      locator.setConnectionTTL(5000000);
-      locator.setCallTimeout(120000);
-
-      locator.setBlockOnNonDurableSend(true);
-      locator.setBlockOnDurableSend(true);
-      locator.setBlockOnAcknowledge(true);
+      locator = createInVMNonHALocator()
+              .setClientFailureCheckPeriod(120000)
+              .setConnectionTTL(5000000)
+              .setCallTimeout(120000)
+              .setBlockOnNonDurableSend(true)
+              .setBlockOnDurableSend(true)
+              .setBlockOnAcknowledge(true);
 
       sf = createSessionFactory(locator);
 
@@ -4543,7 +4520,7 @@ public class PagingTest extends ServiceTestBase
 
       clearDataRecreateServerDirs();
 
-      Configuration config = createDefaultConfig()
+      Configuration config = createDefaultInVMConfig()
          .setJournalSyncNonTransactional(false);
 
       server = createServer(true,
@@ -4560,15 +4537,13 @@ public class PagingTest extends ServiceTestBase
 
       try
       {
-         ServerLocator locator = createInVMNonHALocator();
-
-         locator.setClientFailureCheckPeriod(120000);
-         locator.setConnectionTTL(5000000);
-         locator.setCallTimeout(120000);
-
-         locator.setBlockOnNonDurableSend(true);
-         locator.setBlockOnDurableSend(true);
-         locator.setBlockOnAcknowledge(true);
+         ServerLocator locator = createInVMNonHALocator()
+                 .setClientFailureCheckPeriod(120000)
+                 .setConnectionTTL(5000000)
+                 .setCallTimeout(120000)
+                 .setBlockOnNonDurableSend(true)
+                 .setBlockOnDurableSend(true)
+                 .setBlockOnAcknowledge(true);
 
          ClientSessionFactory sf = locator.createSessionFactory();
 
@@ -4662,7 +4637,7 @@ public class PagingTest extends ServiceTestBase
 
       clearDataRecreateServerDirs();
 
-      Configuration config = createDefaultConfig()
+      Configuration config = createDefaultInVMConfig()
          .setJournalSyncNonTransactional(false);
 
       server = createServer(true,
@@ -4675,15 +4650,13 @@ public class PagingTest extends ServiceTestBase
 
       try
       {
-         ServerLocator locator = createInVMNonHALocator();
-
-         locator.setClientFailureCheckPeriod(120000);
-         locator.setConnectionTTL(5000000);
-         locator.setCallTimeout(120000);
-
-         locator.setBlockOnNonDurableSend(true);
-         locator.setBlockOnDurableSend(true);
-         locator.setBlockOnAcknowledge(true);
+         ServerLocator locator = createInVMNonHALocator()
+                 .setClientFailureCheckPeriod(120000)
+                 .setConnectionTTL(5000000)
+                 .setCallTimeout(120000)
+                 .setBlockOnNonDurableSend(true)
+                 .setBlockOnDurableSend(true)
+                 .setBlockOnAcknowledge(true);
 
          ClientSessionFactory sf = locator.createSessionFactory();
 
@@ -4761,7 +4734,7 @@ public class PagingTest extends ServiceTestBase
 
       clearDataRecreateServerDirs();
 
-      Configuration config = createDefaultConfig()
+      Configuration config = createDefaultInVMConfig()
          .setJournalSyncNonTransactional(false);
 
       server = createServer(true,
@@ -4778,15 +4751,13 @@ public class PagingTest extends ServiceTestBase
 
       try
       {
-         ServerLocator locator = createInVMNonHALocator();
-
-         locator.setClientFailureCheckPeriod(120000);
-         locator.setConnectionTTL(5000000);
-         locator.setCallTimeout(120000);
-
-         locator.setBlockOnNonDurableSend(true);
-         locator.setBlockOnDurableSend(true);
-         locator.setBlockOnAcknowledge(true);
+         ServerLocator locator = createInVMNonHALocator()
+                 .setClientFailureCheckPeriod(120000)
+                 .setConnectionTTL(5000000)
+                 .setCallTimeout(120000)
+                 .setBlockOnNonDurableSend(true)
+                 .setBlockOnDurableSend(true)
+                 .setBlockOnAcknowledge(true);
 
          ClientSessionFactory sf = locator.createSessionFactory();
 
@@ -4885,14 +4856,14 @@ public class PagingTest extends ServiceTestBase
    {
       clearDataRecreateServerDirs();
 
-      Configuration config = createDefaultConfig()
+      Configuration config = createDefaultInVMConfig()
          .setThreadPoolMaxSize(5)
          .setJournalSyncNonTransactional(false);
 
       Map<String, AddressSettings> settings = new HashMap<String, AddressSettings>();
-      AddressSettings dla = new AddressSettings();
-      dla.setMaxDeliveryAttempts(5);
-      dla.setDeadLetterAddress(new SimpleString("DLA"));
+      AddressSettings dla = new AddressSettings()
+              .setMaxDeliveryAttempts(5)
+              .setDeadLetterAddress(new SimpleString("DLA"));
       settings.put(ADDRESS.toString(), dla);
 
       server = createServer(true, config, PagingTest.PAGE_SIZE, PagingTest.PAGE_MAX, settings);
@@ -5129,15 +5100,15 @@ public class PagingTest extends ServiceTestBase
    {
       clearDataRecreateServerDirs();
 
-      Configuration config = createDefaultConfig()
+      Configuration config = createDefaultInVMConfig()
          .setMessageExpiryScanPeriod(500)
          .setJournalSyncNonTransactional(false);
 
       Map<String, AddressSettings> settings = new HashMap<String, AddressSettings>();
-      AddressSettings dla = new AddressSettings();
-      dla.setMaxDeliveryAttempts(5);
-      dla.setDeadLetterAddress(new SimpleString("DLA"));
-      dla.setExpiryAddress(new SimpleString("DLA"));
+      AddressSettings dla = new AddressSettings()
+              .setMaxDeliveryAttempts(5)
+              .setDeadLetterAddress(new SimpleString("DLA"))
+              .setExpiryAddress(new SimpleString("DLA"));
       settings.put(ADDRESS.toString(), dla);
 
       server = createServer(true, config, PagingTest.PAGE_SIZE, PagingTest.PAGE_MAX, settings);
@@ -5148,11 +5119,10 @@ public class PagingTest extends ServiceTestBase
 
       try
       {
-         ServerLocator locator = createInVMNonHALocator();
-
-         locator.setBlockOnNonDurableSend(true);
-         locator.setBlockOnDurableSend(true);
-         locator.setBlockOnAcknowledge(true);
+         ServerLocator locator = createInVMNonHALocator()
+                 .setBlockOnNonDurableSend(true)
+                 .setBlockOnDurableSend(true)
+                 .setBlockOnAcknowledge(true);
 
          ClientSessionFactory sf = locator.createSessionFactory();
 
@@ -5297,7 +5267,7 @@ public class PagingTest extends ServiceTestBase
       {
          clearDataRecreateServerDirs();
 
-         Configuration config = createDefaultConfig();
+         Configuration config = createDefaultInVMConfig();
 
          HashMap<String, AddressSettings> settings = new HashMap<String, AddressSettings>();
 
@@ -5310,9 +5280,9 @@ public class PagingTest extends ServiceTestBase
 
          server.start();
 
-         locator.setBlockOnNonDurableSend(false);
-         locator.setBlockOnDurableSend(false);
-         locator.setBlockOnAcknowledge(true);
+         locator.setBlockOnNonDurableSend(false)
+                 .setBlockOnDurableSend(false)
+                 .setBlockOnAcknowledge(true);
 
          sf = createSessionFactory(locator);
          ClientSession session = sf.createSession(true, true, 0);
@@ -5389,7 +5359,7 @@ public class PagingTest extends ServiceTestBase
    {
       clearDataRecreateServerDirs();
 
-      Configuration config = createDefaultConfig();
+      Configuration config = createDefaultInVMConfig();
 
       HashMap<String, AddressSettings> settings = new HashMap<String, AddressSettings>();
 
@@ -5402,9 +5372,9 @@ public class PagingTest extends ServiceTestBase
 
       server.start();
 
-      locator.setBlockOnNonDurableSend(true);
-      locator.setBlockOnDurableSend(true);
-      locator.setBlockOnAcknowledge(true);
+      locator.setBlockOnNonDurableSend(true)
+              .setBlockOnDurableSend(true)
+              .setBlockOnAcknowledge(true);
 
       sf = createSessionFactory(locator);
       ClientSession session = sf.createSession(true, true, 0);
@@ -5473,7 +5443,7 @@ public class PagingTest extends ServiceTestBase
    {
       clearDataRecreateServerDirs();
 
-      Configuration config = createDefaultConfig();
+      Configuration config = createDefaultInVMConfig();
 
       HashMap<String, AddressSettings> settings = new HashMap<String, AddressSettings>();
 
@@ -5486,9 +5456,9 @@ public class PagingTest extends ServiceTestBase
 
       server.start();
 
-      locator.setBlockOnNonDurableSend(true);
-      locator.setBlockOnDurableSend(true);
-      locator.setBlockOnAcknowledge(true);
+      locator.setBlockOnNonDurableSend(true)
+              .setBlockOnDurableSend(true)
+              .setBlockOnAcknowledge(true);
 
       sf = createSessionFactory(locator);
       ClientSession session = addClientSession(sf.createSession(true, true, 0));
@@ -5592,7 +5562,7 @@ public class PagingTest extends ServiceTestBase
    public void testRouteOnTopWithMultipleQueues() throws Exception
    {
 
-      Configuration config = createDefaultConfig()
+      Configuration config = createDefaultInVMConfig()
          .setJournalSyncNonTransactional(false);
 
       server = createServer(true,
@@ -5603,12 +5573,11 @@ public class PagingTest extends ServiceTestBase
 
       server.start();
 
-      ServerLocator locator = createInVMNonHALocator();
-      locator.setBlockOnDurableSend(false);
+      ServerLocator locator = createInVMNonHALocator()
+              .setBlockOnDurableSend(false);
       ClientSessionFactory sf = createSessionFactory(locator);
       ClientSession session = sf.createSession(false, true, 0);
 
-
       session.createQueue("Q", "Q1", "dest=1", true);
       session.createQueue("Q", "Q2", "dest=2", true);
       session.createQueue("Q", "Q3", "dest=3", true);
@@ -5666,7 +5635,7 @@ public class PagingTest extends ServiceTestBase
 
       clearDataRecreateServerDirs();
 
-      Configuration config = createDefaultConfig()
+      Configuration config = createDefaultInVMConfig()
          .setJournalSyncNonTransactional(false);
 
       server = createServer(true,
@@ -5868,7 +5837,7 @@ public class PagingTest extends ServiceTestBase
    {
       clearDataRecreateServerDirs();
 
-      Configuration config = createDefaultConfig()
+      Configuration config = createDefaultInVMConfig()
          .setJournalSyncNonTransactional(false);
 
       server = createServer(true,
@@ -5881,8 +5850,8 @@ public class PagingTest extends ServiceTestBase
 
       try
       {
-         ServerLocator locator = createInVMNonHALocator();
-         locator.setBlockOnDurableSend(true);
+         ServerLocator locator = createInVMNonHALocator()
+                 .setBlockOnDurableSend(true);
          ClientSessionFactory sf = locator.createSessionFactory();
          ClientSession session = sf.createSession(true, true, 0);
 
@@ -5979,7 +5948,7 @@ public class PagingTest extends ServiceTestBase
    {
       clearDataRecreateServerDirs();
 
-      Configuration config = createDefaultConfig()
+      Configuration config = createDefaultInVMConfig()
          .setJournalSyncNonTransactional(false);
 
       server = createServer(true,
@@ -5992,8 +5961,8 @@ public class PagingTest extends ServiceTestBase
 
       try
       {
-         ServerLocator locator = createInVMNonHALocator();
-         locator.setBlockOnDurableSend(true);
+         ServerLocator locator = createInVMNonHALocator()
+                 .setBlockOnDurableSend(true);
          ClientSessionFactory sf = locator.createSessionFactory();
          ClientSession session = sf.createSession(true, true, 0);
 
@@ -6082,7 +6051,7 @@ public class PagingTest extends ServiceTestBase
    {
       clearDataRecreateServerDirs();
 
-      Configuration config = createDefaultConfig()
+      Configuration config = createDefaultInVMConfig()
          .setJournalSyncNonTransactional(false);
 
       server = createServer(true,
@@ -6183,7 +6152,7 @@ public class PagingTest extends ServiceTestBase
    {
       clearDataRecreateServerDirs();
 
-      Configuration config = createDefaultConfig()
+      Configuration config = createDefaultInVMConfig()
          .setJournalSyncNonTransactional(false);
 
       server = createServer(true,
@@ -6267,7 +6236,7 @@ public class PagingTest extends ServiceTestBase
    @Test
    public void testNoCursors() throws Exception
    {
-      Configuration config = createDefaultConfig()
+      Configuration config = createDefaultInVMConfig()
          .setJournalSyncNonTransactional(false);
 
       server = createServer(true,
@@ -6312,7 +6281,7 @@ public class PagingTest extends ServiceTestBase
    {
       clearDataRecreateServerDirs();
 
-      Configuration config = createDefaultConfig()
+      Configuration config = createDefaultInVMConfig()
          .setJournalSyncNonTransactional(false);
 
       server = createServer(true,
@@ -6426,9 +6395,9 @@ public class PagingTest extends ServiceTestBase
 
 
    @Override
-   protected Configuration createDefaultConfig() throws Exception
+   protected Configuration createDefaultInVMConfig() throws Exception
    {
-      return super.createDefaultConfig()
+      return super.createDefaultInVMConfig()
          .setJournalSyncNonTransactional(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/ProducerCloseTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ProducerCloseTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ProducerCloseTest.java
index fa4fb1c..c7a17c4 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ProducerCloseTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ProducerCloseTest.java
@@ -18,21 +18,19 @@ 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.TransportConfiguration;
 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.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 ProducerCloseTest extends ServiceTestBase
+public class ProducerCloseTest extends ActiveMQTestBase
 {
 
    private ActiveMQServer server;
@@ -51,7 +49,7 @@ public class ProducerCloseTest extends ServiceTestBase
 
       Assert.assertTrue(producer.isClosed());
 
-      ServiceTestBase.expectActiveMQException(ActiveMQExceptionType.OBJECT_CLOSED, new ActiveMQAction()
+      ActiveMQTestBase.expectActiveMQException(ActiveMQExceptionType.OBJECT_CLOSED, new ActiveMQAction()
       {
          public void run() throws ActiveMQException
          {
@@ -69,9 +67,7 @@ public class ProducerCloseTest extends ServiceTestBase
    public void setUp() throws Exception
    {
       super.setUp();
-      Configuration config = createDefaultConfig()
-         .addAcceptorConfiguration(new TransportConfiguration(InVMAcceptorFactory.class.getCanonicalName()))
-         .setSecurityEnabled(false);
+      Configuration config = createDefaultInVMConfig();
       server = createServer(false, config);
       server.start();
       locator = createInVMNonHALocator();

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/ProducerFlowControlTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ProducerFlowControlTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ProducerFlowControlTest.java
index 6707441..9ee92ee 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ProducerFlowControlTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ProducerFlowControlTest.java
@@ -35,7 +35,7 @@ import org.apache.activemq.artemis.core.settings.impl.AddressFullMessagePolicy;
 import org.apache.activemq.artemis.core.settings.impl.AddressSettings;
 import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger;
 import org.apache.activemq.artemis.tests.util.RandomUtil;
-import org.apache.activemq.artemis.tests.util.ServiceTestBase;
+import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
@@ -47,7 +47,7 @@ import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicBoolean;
 
-public class ProducerFlowControlTest extends ServiceTestBase
+public class ProducerFlowControlTest extends ActiveMQTestBase
 {
    private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER;
 
@@ -224,19 +224,19 @@ public class ProducerFlowControlTest extends ServiceTestBase
 
       server = createServer(realFiles, isNetty());
 
-      AddressSettings addressSettings = new AddressSettings();
-      addressSettings.setMaxSizeBytes(maxSize);
-      addressSettings.setAddressFullMessagePolicy(AddressFullMessagePolicy.BLOCK);
+      AddressSettings addressSettings = new AddressSettings()
+              .setMaxSizeBytes(maxSize)
+              .setAddressFullMessagePolicy(AddressFullMessagePolicy.BLOCK);
 
       HierarchicalRepository<AddressSettings> repos = server.getAddressSettingsRepository();
       repos.addMatch(address.toString(), addressSettings);
 
       server.start();
-      waitForServer(server);
+      waitForServerToStart(server);
 
-      locator.setProducerWindowSize(producerWindowSize);
-      locator.setConsumerWindowSize(consumerWindowSize);
-      locator.setAckBatchSize(ackBatchSize);
+      locator.setProducerWindowSize(producerWindowSize)
+              .setConsumerWindowSize(consumerWindowSize)
+              .setAckBatchSize(ackBatchSize);
 
       if (minLargeMessageSize != -1)
       {
@@ -273,7 +273,7 @@ public class ProducerFlowControlTest extends ServiceTestBase
 
                message.getBodyBuffer().readBytes(bytesRead);
 
-               ServiceTestBase.assertEqualsByteArrays(bytes, bytesRead);
+               ActiveMQTestBase.assertEqualsByteArrays(bytes, bytesRead);
 
                message.acknowledge();
 
@@ -367,19 +367,19 @@ public class ProducerFlowControlTest extends ServiceTestBase
 
       server = createServer(false, isNetty());
 
-      AddressSettings addressSettings = new AddressSettings();
-      addressSettings.setMaxSizeBytes(1024);
-      addressSettings.setAddressFullMessagePolicy(AddressFullMessagePolicy.BLOCK);
+      AddressSettings addressSettings = new AddressSettings()
+              .setMaxSizeBytes(1024)
+              .setAddressFullMessagePolicy(AddressFullMessagePolicy.BLOCK);
 
       HierarchicalRepository<AddressSettings> repos = server.getAddressSettingsRepository();
       repos.addMatch(address.toString(), addressSettings);
 
       server.start();
-      waitForServer(server);
+      waitForServerToStart(server);
 
-      locator.setProducerWindowSize(1024);
-      locator.setConsumerWindowSize(1024);
-      locator.setAckBatchSize(1024);
+      locator.setProducerWindowSize(1024)
+              .setConsumerWindowSize(1024)
+              .setAckBatchSize(1024);
 
       sf = createSessionFactory(locator);
       session = sf.createSession(false, true, true, true);
@@ -442,19 +442,19 @@ public class ProducerFlowControlTest extends ServiceTestBase
 
       server = createServer(false, isNetty());
 
-      AddressSettings addressSettings = new AddressSettings();
-      addressSettings.setMaxSizeBytes(1024);
-      addressSettings.setAddressFullMessagePolicy(AddressFullMessagePolicy.BLOCK);
+      AddressSettings addressSettings = new AddressSettings()
+              .setMaxSizeBytes(1024)
+              .setAddressFullMessagePolicy(AddressFullMessagePolicy.BLOCK);
 
       HierarchicalRepository<AddressSettings> repos = server.getAddressSettingsRepository();
       repos.addMatch(address.toString(), addressSettings);
 
       server.start();
-      waitForServer(server);
+      waitForServerToStart(server);
 
-      locator.setProducerWindowSize(1024);
-      locator.setConsumerWindowSize(1024);
-      locator.setAckBatchSize(1024);
+      locator.setProducerWindowSize(1024)
+              .setConsumerWindowSize(1024)
+              .setAckBatchSize(1024);
 
       sf = createSessionFactory(locator);
 
@@ -483,7 +483,7 @@ public class ProducerFlowControlTest extends ServiceTestBase
       server = createServer(false, isNetty());
 
       server.start();
-      waitForServer(server);
+      waitForServerToStart(server);
 
       sf = createSessionFactory(locator);
 
@@ -548,7 +548,7 @@ public class ProducerFlowControlTest extends ServiceTestBase
       server = createServer(false, isNetty());
 
       server.start();
-      waitForServer(server);
+      waitForServerToStart(server);
 
       sf = createSessionFactory(locator);
 
@@ -583,7 +583,7 @@ public class ProducerFlowControlTest extends ServiceTestBase
       server = createServer(false, isNetty());
 
       server.start();
-      waitForServer(server);
+      waitForServerToStart(server);
       sf = createSessionFactory(locator);
 
       session = sf.createSession(false, true, true, true);
@@ -619,7 +619,7 @@ public class ProducerFlowControlTest extends ServiceTestBase
       server = createServer(false, isNetty());
 
       server.start();
-      waitForServer(server);
+      waitForServerToStart(server);
 
       sf = createSessionFactory(locator);
 
@@ -654,7 +654,7 @@ public class ProducerFlowControlTest extends ServiceTestBase
       server = createServer(false, isNetty());
 
       server.start();
-      waitForServer(server);
+      waitForServerToStart(server);
       sf = createSessionFactory(locator);
 
       session = sf.createSession(false, true, true, true);
@@ -690,7 +690,7 @@ public class ProducerFlowControlTest extends ServiceTestBase
       server = createServer(false, isNetty());
 
       server.start();
-      waitForServer(server);
+      waitForServerToStart(server);
 
       sf = createSessionFactory(locator);
 
@@ -755,7 +755,7 @@ public class ProducerFlowControlTest extends ServiceTestBase
       server = createServer(false, isNetty());
 
       server.start();
-      waitForServer(server);
+      waitForServerToStart(server);
       sf = createSessionFactory(locator);
 
       session = sf.createSession(false, true, true, true);
@@ -780,7 +780,7 @@ public class ProducerFlowControlTest extends ServiceTestBase
       server = createServer(false, isNetty());
 
       server.start();
-      waitForServer(server);
+      waitForServerToStart(server);
 
       sf = createSessionFactory(locator);
 
@@ -830,7 +830,7 @@ public class ProducerFlowControlTest extends ServiceTestBase
       server = createServer(false, isNetty());
 
       server.start();
-      waitForServer(server);
+      waitForServerToStart(server);
 
       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/ProducerTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ProducerTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ProducerTest.java
index 039c961..6deae7b 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ProducerTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ProducerTest.java
@@ -34,12 +34,12 @@ 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.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 ProducerTest extends ServiceTestBase
+public class ProducerTest extends ActiveMQTestBase
 {
    private ActiveMQServer server;
 
@@ -71,8 +71,8 @@ public class ProducerTest extends ServiceTestBase
             return true;
          }
       });
-      ServerLocator locator = createInVMNonHALocator();
-      locator.setConfirmationWindowSize(100);
+      ServerLocator locator = createInVMNonHALocator()
+              .setConfirmationWindowSize(100);
       ClientSessionFactory cf = locator.createSessionFactory();
       ClientSession session = cf.createSession(false, true, true);
       ClientProducer producer = session.createProducer(QUEUE);
@@ -90,9 +90,9 @@ public class ProducerTest extends ServiceTestBase
    public void testProducerMultiThread() throws Exception
    {
       final ServerLocator locator = createInVMNonHALocator();
-      AddressSettings setting = new AddressSettings();
-      setting.setAddressFullMessagePolicy(AddressFullMessagePolicy.BLOCK);
-      setting.setMaxSizeBytes(10 * 1024);
+      AddressSettings setting = new AddressSettings()
+              .setAddressFullMessagePolicy(AddressFullMessagePolicy.BLOCK)
+              .setMaxSizeBytes(10 * 1024);
       server.stop();
       server.getConfiguration().getAddressesSettings().clear();
       server.getConfiguration().getAddressesSettings().put(QUEUE.toString(), setting);


Mime
View raw message