You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by an...@apache.org on 2015/05/20 11:47:06 UTC

[01/13] activemq-artemis git commit: Initial commit of the hacking guide

Repository: activemq-artemis
Updated Branches:
  refs/heads/master 042a8f556 -> 13cc616b2


Initial commit of the hacking guide


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/70258865
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/70258865
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/70258865

Branch: refs/heads/master
Commit: 70258865a5e595c194dee178d23759133b9aae7b
Parents: 042a8f5
Author: jbertram <jb...@apache.org>
Authored: Wed May 13 12:49:42 2015 -0500
Committer: jbertram <jb...@apache.org>
Committed: Tue May 19 15:24:51 2015 -0500

----------------------------------------------------------------------
 README.md                                       | 332 +------------------
 artemis-website/pom.xml                         | 128 +++----
 .../src/main/resources/hacking-guide/index.html |  24 ++
 artemis-website/src/main/resources/index.html   |   1 +
 .../src/main/resources/user-manual/index.html   |   4 +-
 docs/hacking-guide/en/README.md                 |   7 +
 docs/hacking-guide/en/SUMMARY.md                |  10 +
 docs/hacking-guide/en/book.json                 |  11 +
 docs/hacking-guide/en/building.md               |  48 +++
 docs/hacking-guide/en/code.md                   | 164 +++++++++
 docs/hacking-guide/en/formatting.md             |  11 +
 docs/hacking-guide/en/ide.md                    |  79 +++++
 docs/hacking-guide/en/images/artemis-logo.jpg   | Bin 0 -> 18517 bytes
 docs/hacking-guide/en/maintainers.md            |  90 +++++
 docs/hacking-guide/en/notice.md                 |  17 +
 docs/hacking-guide/en/tests.md                  |  15 +
 pom.xml                                         |   4 +-
 17 files changed, 556 insertions(+), 389 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/70258865/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
index 3c7ec50..e42b119 100644
--- a/README.md
+++ b/README.md
@@ -1,107 +1,27 @@
 # ActiveMQ Artemis
 
-This file describes some minimum 'stuff one needs to know' to get
-started coding in this project.
+This file describes some minimum 'stuff one needs to know' to get started coding in this project.
 
 ## Source
 
-The project's source code is hosted at:
-
-https://git-wip-us.apache.org/repos/asf/activemq-artemis.git
-
-### Git usage:
-
-Pull requests should be merged without fast forwards '--no-ff'. An easy way to achieve that is to use
-
-```% git config branch.master.mergeoptions --no-ff```
-
-## Maven
-
-The minimum required Maven version is 3.0.0.
-
-Do note that there are some compatibility issues with Maven 3.X still
-unsolved [1]. This is specially true for the 'site' plugin [2].
-
-[1]: <https://cwiki.apache.org/MAVEN/maven-3x-compatibility-notes.html>
-[2]: <https://cwiki.apache.org/MAVEN/maven-3x-and-site-plugin.html>
-
-
-## building the distribution
-
-If you want to build the full release with documentation, Javadocs and the full web site then run the following:
-
-```% mvn -Prelease package```
-
-If you want to install it to your local maven repo then run
-
-```% mvn -Prelease install```
-
-The full release uses gitbook to build a static website from the documentation, if you don't have gitbook installed then
- install gitbook using npm
-
-```npm install -g gitbook gitbook-cli```
-
-### Installing NPM
-
-If you don't have npm installed then you would need to install  it first.
-
-#### On Fedora
-
-```yum install npm```
-
-#### On Mac-OS
-
-The easiest way would be through brew [brew]
-
-You first install brew using the instructions on the [brew] website.
-
-After you installed brew you can install npm by:
-
-```brew install npm```
-
-[brew]: <http://brew.sh>
-
-#### Build without docs
-
-
-It is possible to build a distribution with out the manuals and javadocs if you dont have or want gitbook installed, 
-simply run
-
-```% mvn package```
-
-## Tests
-
-To run the unit tests:
-
-```% mvn -Ptests test```
-
-Generating reports from unit tests:
-
-```% mvn install site```
-
-
-Running tests individually
-
-```% mvn -Ptests -DfailIfNoTests=false -Dtest=<test-name> test ```
-
-where &lt;test-name> is the name of the Test class without its package name
-
+For details about the modifying the code, building the project, running tests, IDE integration, etc. see 
+our [Hacking Guide](./docs/hacking-guide/en/README.md).
 
 ## Examples
 
 To run an example firstly make sure you have run
 
-```% mvn -Prelease install```
+    $ mvn -Prelease install
 
 If the project version has already been released then this is unnecessary.
 
 then you will need to set the following maven options, on Linux by
 
-```export MAVEN_OPTS="-Xmx1024m -XX:MaxPermSize=512m"```
+    $ export MAVEN_OPTS="-Xmx1024m -XX:MaxPermSize=512m"
 
 and the finally run the examples by
 
-```% mvn verify```
+    $ mvn verify
 
 You can also run individual examples by running the same command from the directory of which ever example you want to run.
 NB for this make sure you have installed examples/common.
@@ -110,241 +30,5 @@ NB for this make sure you have installed examples/common.
 
 If you are trying to copy the examples somewhere else and modifying them. Consider asking Maven to explicitly list all the dependencies:
 
-```
-# if trying to modify the 'topic' example:
-cd examples/jms/topic && mvn dependency:list
-```
-
-## Eclipse
-
-We recommend using Eclipse Kepler (4.3), due to the built-in support
-for Maven and Git. Note that there are still some Maven plugins used
-by sub-projects (e.g. documentation) which are not supported even in
-Eclipse Kepler (4.3).
-
-Eclipse [m2e] is already included in "Eclipse IDE for Java Developers", or it
-can be installed from [Eclipse Kepler release repository].
-
-[m2e]: http://eclipse.org/m2e/
-[Eclipse Kepler release repository]: http://download.eclipse.org/releases/kepler
-
-## IntelliJ IDEA
-
-### Importing the Project
-
-The following steps show how to import ActiveMQ Artemis source into IntelliJ IDEA and setup the correct maven profile to allow
-running of JUnit tests from within the IDE.  (Steps are based on version: 13.1.4)
-
-* File --> Import Project --> Select the root directory of the ActiveMQ Artemis source folder. --> Click OK
-
-This should open the import project wizard.  From here:
-
-* Select "Import from existing model" toggle box, then select Maven from the list box below.  Click Next.
-* Leave the defaults set on this page and click next.
-* On the "Select profiles page", select the checkbox next to "tests" and click next.
-* From here the default settings should suffice.  Continue through the wizard, clicking next until the wizard is complete.
-
-Once the project has been imported and IDEA has caught up importing all the relevant dependencies, you should be able to
-run JUnit tests from with the IDE.  Select any test class in the tests -> integration tests folder.  Right click on the
-class in the project tab and click "Run <classname>".  If the "Run <classname>" option is present then you're all set to go.
-
-
-### Style Templates for Idea
-
-We have shared the style templates that are good for this project. If you want to apply them use these steps:
-
-* File->Import Settings
-* Select the file under ./artemis-cloned-folder/etc/IDEA-style.jar
-* Select both Code Style Templates and File templates (it's the default option)
-* Select OK and restart Idea
-
-### Issue: My JUnit tests are not runnable with in the IDE.
-
-If the "Run <classname>" or "Run all tests" option is not present.  It is likely that the default profile has not been
-imported properly.  To (re)import the "tests" Maven profile in an existing project.
-
-* Open the Maven Projects Tool Window: View -> Tool Windows -> Maven Projects
-* Select the "profiles" drop down
-* Unselect then reselect the checkbox next to "tests".
-* Click on the "Reimport all maven projects" button in the top left hand corner of the window. (It looks like a ciruclar
-blue arrow.
-* Wait for IDEA to reload and try running a JUnit test again.  The option to run should now be present.
-
-### Annotation Pre-Processing
-
-ActiveMQ Artemis uses [JBoss Logging] and that requires source code generation from Java
-annotations. In order for it to 'just work' in Eclipse you need to install the
-_Maven Integration for Eclipse JDT Annotation Processor Toolkit_ [m2e-apt]. See
-this [JBoss blog post] for details.
-
-[JBoss Logging]: <https://community.jboss.org/wiki/JBossLoggingTooling>
-[m2e-apt]: https://github.com/jbosstools/m2e-apt
-[JBoss blog post]: https://community.jboss.org/en/tools/blog/2012/05/20/annotation-processing-support-in-m2e-or-m2e-apt-100-is-out
-
-### M2E Connector for Javacc-Maven-Plugin
-
-Eclipse Indigo (3.7) has out-of-the-box support for it.
-
-As of this writing, Eclipse Kepler (4.3) still lacks support for
-Maven's javacc plugin. The available [m2e connector for
-javacc-maven-plugin] requires a downgrade of Maven components to be
-installed. manual installation instructions (as of this writing you
-need to use the development update site). See [this post] for how to
-do this with Eclipse Juno (4.2).
-
-The current recommended solution for Eclipse Kepler is to mark
-`javacc-maven-plugin` as ignored by Eclipse, run Maven from the
-command line and then modify the project `activemq-core-client` adding
-the folder `target/generated-sources/javacc` to its build path.
-
-[m2e connector for javacc-maven-plugin]: https://github.com/objectledge/maven-extensions
-[this post]:
-http://dev.eclipse.org/mhonarc/lists/m2e-users/msg02725.html
-
-### Use _Project Working Sets_
-
-Importing all ActiveMQ Artemis subprojects will create _too many_ projects in Eclipse,
-cluttering your _Package Explorer_ and _Project Explorer_ views. One way to address
-that is to use [Eclipse's Working Sets] feature. A good introduction to it can be
-found at a [Dzone article on Eclipse Working Sets].
-
-[Eclipse's Working Sets]: http://help.eclipse.org/juno/index.jsp?topic=%2Forg.eclipse.platform.doc.user%2Fconcepts%2Fcworkset.htm
-[Dzone article on Eclipse Working Sets]: http://eclipse.dzone.com/articles/categorise-projects-package
-
-### Code Formatting
-
-Eclipse code formatting and (basic) project configuration files can be found at
-the ```etc/``` folder. You should manually copy them _after importing all your
-projects_:
-
-```
-for settings_dir in `find . -type d -name .settings`; do
-   \cp -v etc/org.eclipse.jdt.* $settings_dir
-done
-```
-
-Do not use the [maven-eclipse-plugin] to copy the files as it conflicts with [m2e].
-
-[maven-eclipse-plugin]: https://maven.apache.org/plugins/maven-eclipse-plugin/
-[m2e]: http://eclipse.org/m2e/
-
-## Committing Changes
-
-### Repositories
-
-The code repository for ActiveMQ Artemis is hosted by Apache org and lives here: https://git-wip-us.apache.org/repos/asf/activemq-artemis.git.
-
-We also host a mirror of the ActiveMQ Artemis repository on GitHub: https://github.com/apache/activemq-artemis.  We use this mirror for all code submissions and reviews.  To submit code to ActiveMQ Artemis please open a Pull Request as outlined as part of the GitHub workflow described here: https://guides.github.com/introduction/flow/index.html.  Once a pull request is opened it will be reviewed and commented on.  Any further changes as a result of comments / review process should be addressed and reflected in the original pull request as outlined in the GitHub workflow.  When the pull request has went through the review process and ready to merge, the reviewer should comment with "Ack, Ready to Push".  Once an Ack message is received one of the ActiveMQ Artemis core team members will push the changes to upstream Apache ActiveMQ Artemis repository and close the pull request.
-
-### Commit Messages
-
-We follow the 50/72 git commit message format.  An ActiveMQ Artemis commit message should be formatted in the following manner:
-
-* Add the ACTIVEMQ6 JIRA or Bugzilla reference (if one exists) followed by a brief description of the change in the first line.
-* Insert a single blank line after the first line.
-* Provide a detailed description of the change in the following lines, breaking paragraphs where needed.
-* The first line should be limited to 50 characters
-* Subsequent lines should be wrapped at 72 characters.
-
-An example correctly formatted commit message:
-
-```
-ACTIVEMQ6-123 Add new commit msg format to README
-
-Adds a description of the new commit message format as well as examples
-of well formatted commit messages to the README.md.  This is required 
-to enable developers to quickly identify what the commit is intended to 
-do and why the commit was added.
-```
-### Adding New Dependencies
-
-Due to incompatibilities between some open source licenses and the Apache v2.0 license (that this project is licensed under)
-care must be taken when adding new dependencies to the project.  The Apache Software Foundation 3rd party
- licensing policy has more information here: http://www.apache.org/legal/3party.html
-
-To keep track of all licenses in ActiveMQ Artemis, new dependencies must be added in either the top level pom.xml or in test/pom.xml
-(depending on whether this is a test only dependency or if it is used in the main code base).  The dependency should be
-added under the dependency management section with version and labelled with a comment highlighting the license for the
-dependency version.  See existing dependencies in the main pom.xml for examples.  The dependency can then be added to
-individual ActiveMQ Artemis modules *without* the version specified (the version is implied from the dependency management
-section of the top level pom).  This allows ActiveMQ Artemis developers to keep track of all dependencies and licenses.
-
-### Core Contributers
-
-Core ActiveMQ Artemis members have write access to the Apache ActiveMQ Artemis repositories and will be responsible for Ack'ing and pushing commits contributed via pull requests on GitHub.  The follow steps can be used as an example for how to set up relevant ActiveMQ Artemis repositories for reviewing and pushing changes.
-
-To setup repositories for reviewing and pushing:
-
-```bash
-  # Clone the GitHub Mirror of ActiveMQ Artemis Repo:
-  git clone git@github.com:apache/activemq-artemis.git
-
-  # Add the following section to your <artemis-repo>/.git/config statement to fetch all pull requests sent to the GitHub mirror.  Note that the remote name for git@github.com:apache/activemq-artemis.git may be different.  Be sure to edit all references to the remote name.  In this case "activemq".
-
-  [remote "origin"]
-        url = git@github.com:apache/activemq-artemis.git
-        fetch = +refs/heads/*:refs/remotes/origin/*
-        fetch = +refs/pull/*/head:refs/remotes/origin/pr/*
-
-
-  # Add the Apache repository as a remote
-  git remote add upstream https://git-wip-us.apache.org/repos/asf/activemq-artemis.git
-
-  # Fetch
-  git fetch --all
-```
-
-To push commits from a pull request to the apache repository:
-
-```bash
-  cd <artemis-repo>
-
-  # Download all the remote branches etc... including all the pull requests.
-  git fetch --all
-  
-  # Checkout the pull request you wish to review
-  git checkout pr/2
-
-  # Review is done...  READY TO MERGE.
-
-  # Check out the master branch.
-  git checkout master
-
-  # Ensure you are up to date
-  git pull
-
-  # Create a new merge commit from the 
-  git merge --no-ff pr/2
-
-  #  IMPORTANT: In this commit message be sure to write something along the lines of: "Merge Pull Request #2" Where 2 is the Pull Request ID.  "#2" shows up as a link in the GitHub UI for navigating to the PR from the commit message.
-
-  # Pushes to the upstream repo.
-  git push upstream master
-```
-
-#### Notes:
-
-The GitHub mirror repository is cloning the Apache ActiveMQ Artemis repository (The root repository).  There maybe a slight delay between when a commit is pushed to the Apache repo and when that commit is reflected in the GitHub mirror.  This may cause some difficulty when trying to push a PR to upstream (Apache) that has been merged on an out of date GitHub (mirror) master.  You can wait for the mirror to update before performing the steps above.  A solution to this is to change local master branch to track the upstream (Apache) master, rather than GitHub (mirror) master by editing your config to look like this:
-
-```bash
-  [branch "master"]
-        remote = upstream
-        merge = refs/heads/master
-```
-
-Where upstream points to the Apache Repo.
-
-If you'd like master to always track GitHub master, then another way to acheive this is to add another branch that tracks upstream master and push from that branch to upstream master e.g.
-
-```bash
-  # .git/config entry
-  [branch "umaster"]
-        remote = upstream
-        merge = refs/heads/master
-
-  git checkout umaster
-  git pull
-  git merge --no-ff pr/2
-  git push upstream umaster:master # Push local branch umaster to upstream branch master.
-```
-
+    # if trying to modify the 'topic' example:
+    cd examples/jms/topic && mvn dependency:list

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/70258865/artemis-website/pom.xml
----------------------------------------------------------------------
diff --git a/artemis-website/pom.xml b/artemis-website/pom.xml
index 1db47fd..db3fbd8 100644
--- a/artemis-website/pom.xml
+++ b/artemis-website/pom.xml
@@ -27,43 +27,44 @@
    <packaging>jar</packaging>
    <name>ActiveMQ Artemis Web</name>
 
-    <dependencies>
-        <dependency>
-            <groupId>org.apache.activemq</groupId>
-            <artifactId>artemis-core-client</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.activemq</groupId>
-            <artifactId>artemis-jms-client</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.activemq</groupId>
-            <artifactId>artemis-server</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.activemq</groupId>
-            <artifactId>artemis-jms-server</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.activemq</groupId>
-            <artifactId>artemis-journal</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.activemq</groupId>
-            <artifactId>artemis-selector</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-    </dependencies>
+   <dependencies>
+      <dependency>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-core-client</artifactId>
+         <version>${project.version}</version>
+      </dependency>
+      <dependency>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-jms-client</artifactId>
+         <version>${project.version}</version>
+      </dependency>
+      <dependency>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-server</artifactId>
+         <version>${project.version}</version>
+      </dependency>
+      <dependency>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-jms-server</artifactId>
+         <version>${project.version}</version>
+      </dependency>
+      <dependency>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-journal</artifactId>
+         <version>${project.version}</version>
+      </dependency>
+      <dependency>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-selector</artifactId>
+         <version>${project.version}</version>
+      </dependency>
+   </dependencies>
 
    <properties>
-     <activemq.basedir>${project.basedir}/..</activemq.basedir>
-     <webapp-dir>${project.artifactId}-${project.version}</webapp-dir>
-     <webapp-outdir>${basedir}/target/classes/user-manual</webapp-outdir>
+      <activemq.basedir>${project.basedir}/..</activemq.basedir>
+      <webapp-dir>${project.artifactId}-${project.version}</webapp-dir>
+      <webapp-outdir-user-manual>${basedir}/target/classes/user-manual</webapp-outdir-user-manual>
+      <webapp-outdir-hacking-guide>${basedir}/target/classes/hacking-guide</webapp-outdir-hacking-guide>
    </properties>
 
    <build>
@@ -109,35 +110,42 @@
       <profile>
          <id>release</id>
          <build>
-             <plugins>
-                <plugin>
+            <plugins>
+               <plugin>
                   <artifactId>maven-antrun-plugin</artifactId>
                   <version>1.6</version>
                   <executions>
-                    <execution>
-                      <phase>generate-sources</phase>
-                      <configuration>
-                        <target>
-                          <condition property="gitbook.cmd" value="gitbook.cmd" else="gitbook">
-                             <os family="windows" />
-                          </condition>
-                          <!-- lets generate the gitbook -->
-                          <mkdir dir="${webapp-outdir}/gitbook" />
-                          <echo>executing ${gitbook.cmd}</echo>
-                          <exec executable="${gitbook.cmd}">
-                            <arg value="build" />
-                            <arg value="${basedir}/../docs/user-manual/en" />
-                            <arg value="--output=${webapp-outdir}" />
-                          </exec>
-                        </target>
-                      </configuration>
-                      <goals>
-                        <goal>run</goal>
-                      </goals>
-                    </execution>
+                     <execution>
+                        <phase>generate-sources</phase>
+                        <configuration>
+                           <target>
+                              <condition property="gitbook.cmd" value="gitbook.cmd" else="gitbook">
+                                 <os family="windows"/>
+                              </condition>
+                              <!-- lets generate the gitbook -->
+                              <mkdir dir="${webapp-outdir-user-manual}/gitbook"/>
+                              <echo>executing ${gitbook.cmd}</echo>
+                              <exec executable="${gitbook.cmd}">
+                                 <arg value="build"/>
+                                 <arg value="${basedir}/../docs/user-manual/en"/>
+                                 <arg value="--output=${webapp-outdir-user-manual}"/>
+                              </exec>
+                              <mkdir dir="${webapp-outdir-hacking-guide}/gitbook"/>
+                              <echo>executing ${gitbook.cmd}</echo>
+                              <exec executable="${gitbook.cmd}">
+                                 <arg value="build"/>
+                                 <arg value="${basedir}/../docs/hacking-guide/en"/>
+                                 <arg value="--output=${webapp-outdir-hacking-guide}"/>
+                              </exec>
+                           </target>
+                        </configuration>
+                        <goals>
+                           <goal>run</goal>
+                        </goals>
+                     </execution>
                   </executions>
-                </plugin>
-             </plugins>
+               </plugin>
+            </plugins>
          </build>
       </profile>
    </profiles>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/70258865/artemis-website/src/main/resources/hacking-guide/index.html
----------------------------------------------------------------------
diff --git a/artemis-website/src/main/resources/hacking-guide/index.html b/artemis-website/src/main/resources/hacking-guide/index.html
new file mode 100644
index 0000000..ef75a15
--- /dev/null
+++ b/artemis-website/src/main/resources/hacking-guide/index.html
@@ -0,0 +1,24 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<h1>User Manual</h1>
+
+<p>If you are seeing this message, it is because the Hacking Guide was not built during the Apache ActiveMQ Artemis build.  To
+build Apache ActiveMQ Artemis with the Hacking Guide you must use the maven release profile:
+<code>mvn clean install -Prelease</code>.</p>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/70258865/artemis-website/src/main/resources/index.html
----------------------------------------------------------------------
diff --git a/artemis-website/src/main/resources/index.html b/artemis-website/src/main/resources/index.html
index a805c32..dceecd3 100644
--- a/artemis-website/src/main/resources/index.html
+++ b/artemis-website/src/main/resources/index.html
@@ -52,6 +52,7 @@
         <ul>
             <li><a target="_blank" href="api/index.html">API</a></li>
             <li><a target="_blank" href="user-manual/index.html">User Manual</a></li>
+            <li><a target="_blank" href="hacking-guide/index.html">Hacking Guide</a></li>
             <li><a href="examples/index.html">Examples</a></li>
             <li><a href="http://activemq.apache.org/artemis">Apache ActiveMQ Artemis Website</a></li>
         </ul>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/70258865/artemis-website/src/main/resources/user-manual/index.html
----------------------------------------------------------------------
diff --git a/artemis-website/src/main/resources/user-manual/index.html b/artemis-website/src/main/resources/user-manual/index.html
index 6490318..a36e404 100644
--- a/artemis-website/src/main/resources/user-manual/index.html
+++ b/artemis-website/src/main/resources/user-manual/index.html
@@ -21,6 +21,4 @@ under the License.
 
 <p>If you are seeing this message, it is because the User Manual was not built during the Apache ActiveMQ Artemis build.  To
 build Apache ActiveMQ Artemis with the User Manual you must use the maven release profile:
-<code>mvn clean install -Prelease</code>.</p>
-
-<p>Please see the README in the source distribution for more information.</p>
+<code>mvn clean install -Prelease</code>.</p>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/70258865/docs/hacking-guide/en/README.md
----------------------------------------------------------------------
diff --git a/docs/hacking-guide/en/README.md b/docs/hacking-guide/en/README.md
new file mode 100644
index 0000000..43de4db
--- /dev/null
+++ b/docs/hacking-guide/en/README.md
@@ -0,0 +1,7 @@
+![ActiveMQ Artemis logo](images/artemis-logo.jpg)
+
+Apache ActiveMQ Artemis Hacking Guide
+=====================================
+
+This hacking guide outlines how developers can get involved in contributing to the Apache ActiveMQ Artemis project.
+

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/70258865/docs/hacking-guide/en/SUMMARY.md
----------------------------------------------------------------------
diff --git a/docs/hacking-guide/en/SUMMARY.md b/docs/hacking-guide/en/SUMMARY.md
new file mode 100644
index 0000000..d9c7a05
--- /dev/null
+++ b/docs/hacking-guide/en/SUMMARY.md
@@ -0,0 +1,10 @@
+# Summary
+
+* [Legal Notice](notice.md)
+* [Working with the Code](code.md)
+* [IDE Integration](ide.md)
+* [Building](building.md)
+* [Tests](tests.md)
+* [Code Formatting](formatting.md)
+* [Notes for Maintainers](maintainers.md)
+

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/70258865/docs/hacking-guide/en/book.json
----------------------------------------------------------------------
diff --git a/docs/hacking-guide/en/book.json b/docs/hacking-guide/en/book.json
new file mode 100644
index 0000000..0d6ce8b
--- /dev/null
+++ b/docs/hacking-guide/en/book.json
@@ -0,0 +1,11 @@
+{
+    "title": "ActiveMQ Artemis Documentation",
+    "description": "ActiveMQ Artemis Hacking Guide",
+    "github": "apache/activemq-artemis",
+    "githubHost": "https://github.com/",
+    "links": {
+        "home": "http://activemq.apache.org/",
+        "issues": "http://activemq.apache.org/",
+        "contribute": "http://activemq.apache.org/contributing.html"
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/70258865/docs/hacking-guide/en/building.md
----------------------------------------------------------------------
diff --git a/docs/hacking-guide/en/building.md b/docs/hacking-guide/en/building.md
new file mode 100644
index 0000000..2651745
--- /dev/null
+++ b/docs/hacking-guide/en/building.md
@@ -0,0 +1,48 @@
+# Building
+
+We use Apache Maven to build the code, docs, distribution, etc. and to manage dependencies.
+
+The minimum required Maven version is 3.0.0.
+
+Note that there are some [compatibility issues with Maven 3.X](https://cwiki.apache.org/confluence/display/MAVEN/Maven+3.x+Compatibility+Notes)
+still unsolved. This is specially true for the ['site' plugin](https://maven.apache.org/plugins-archives/maven-site-plugin-3.3/maven-3.html).
+
+## Full Release
+
+The full release uses `gitbook` to build a static website from the documentation, if you don't have `gitbook` installed 
+then you can build the distribution without docs (see below) or install `gitbook` using `npm`:
+
+    $ npm install -g gitbook gitbook-cli
+
+If you don't have `npm` installed then you would need to install it first.
+
+#### Install npm On Fedora
+
+    $ yum install npm
+
+#### Install npm On Mac-OS
+
+The easiest way would be through brew [brew]
+
+You first install brew using the instructions on the [brew] website.
+
+After you installed brew you can install npm by:
+
+    brew install npm
+
+[brew]: <http://brew.sh>
+
+To build the full release with documentation, Javadocs, and the full web site:
+
+    $ mvn -Prelease package
+
+To install it to your local maven repo:
+
+    $ mvn -Prelease install
+
+## Build the distribution without docs
+
+It is possible to build a distribution with out the manuals and Javadocs if you don't have or want `gitbook` installed, 
+simply run
+
+    $ mvn package
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/70258865/docs/hacking-guide/en/code.md
----------------------------------------------------------------------
diff --git a/docs/hacking-guide/en/code.md b/docs/hacking-guide/en/code.md
new file mode 100644
index 0000000..c25fe4c
--- /dev/null
+++ b/docs/hacking-guide/en/code.md
@@ -0,0 +1,164 @@
+# Working with the Code
+
+While the canonical Apache ActiveMQ Artemis git repository is hosted on Apache hardware at https://git-wip-us.apache.org/repos/asf?p=activemq-artemis.git
+the developers use a mirror on GitHub for collaboration and pull-request review functionality.
+
+## Initial Steps
+
+1. Create a github account if you don't have one already
+
+   http://github.com
+   
+1. Fork the apache-artemis repository into your account
+
+   https://github.com/apache/activemq-artemis
+   
+1. Clone your newly forked copy onto your local workspace:
+
+        $ git clone git@github.com:<your-user-name>/activemq-artemis.git
+        Cloning into 'activemq-artemis'...
+        remote: Counting objects: 63800, done.
+        remote: Compressing objects: 100% (722/722), done.
+        remote: Total 63800 (delta 149), reused 0 (delta 0), pack-reused 62748
+        Receiving objects: 100% (63800/63800), 18.28 MiB | 3.16 MiB/s, done.
+        Resolving deltas: 100% (28800/28800), done.
+        Checking connectivity... done.
+     
+        $ cd activemq-artemis
+   
+1. Add a remote reference to `upstream` for pulling future updates
+
+        $ git remote add upstream https://github.com/apache/activemq-artemis
+
+1. Build with Maven
+
+   Typically developers will want to build using the `dev` profile which disables license and code style checks. For
+   example:
+   
+        $ mvn -Pdev install
+        ...
+        [INFO] ------------------------------------------------------------------------
+        [INFO] Reactor Summary:
+        [INFO] 
+        [INFO] ActiveMQ Artemis Parent ........................... SUCCESS [2.298s]
+        [INFO] ActiveMQ Artemis Commons .......................... SUCCESS [1.821s]
+        [INFO] ActiveMQ Artemis Selector Implementation .......... SUCCESS [0.767s]
+        [INFO] ActiveMQ Artemis Native POM ....................... SUCCESS [0.189s]
+        [INFO] ActiveMQ Artemis Journal .......................... SUCCESS [0.646s]
+        [INFO] ActiveMQ Artemis Core Client ...................... SUCCESS [5.969s]
+        [INFO] ActiveMQ Artemis JMS Client ....................... SUCCESS [2.110s]
+        [INFO] ActiveMQ Artemis Server ........................... SUCCESS [11.540s]
+        ...
+        [INFO] ActiveMQ Artemis stress Tests ..................... SUCCESS [0.332s]
+        [INFO] ActiveMQ Artemis performance Tests ................ SUCCESS [0.174s]
+        [INFO] ------------------------------------------------------------------------
+        [INFO] BUILD SUCCESS
+        [INFO] ------------------------------------------------------------------------
+
+## Typical development cycle
+
+1. Identify a task (e.g. a bug to fix or feature to implement)
+
+   https://issues.apache.org/jira/browse/ACTIVEMQ6
+
+1. Create a topic branch in your local git repo to do your work
+
+         $ git checkout -b my_cool_feature
+
+1. Make the changes and commit one or more times
+
+         $ git commit
+
+   <a name="commitMessageDetails"></a> When you commit your changes you will need to supply a commit message. We follow the
+    50/72 git commit message format. An ActiveMQ Artemis commit message should be formatted in the following manner:
+                                                                        
+   1. Add the ACTIVEMQ6 JIRA (if one exists) followed by a brief description of the change in the first line. This line
+      should be limited to 50 characters.
+   1. Insert a single blank line after the first line.
+   1. Provide a detailed description of the change in the following lines, breaking paragraphs where needed. These lines
+      should be wrapped at 72 characters.
+                                                                        
+   An example correctly formatted commit message:
+                                                                        
+         ACTIVEMQ6-123 Add new commit msg format to README
+        
+         Adds a description of the new commit message format as well as examples
+         of well formatted commit messages to the README.md.  This is required 
+         to enable developers to quickly identify what the commit is intended to 
+         do and why the commit was added.
+
+1. Occasionally you'll want to push your commit(s) to GitHub for safe-keeping and/or sharing with others.
+
+         git push origin my_cool_feature  
+    
+   Note that git push references the branch you are pushing and defaults to `master`, not your working branch.
+   
+1. Discuss your planned changes (if you want feedback)
+
+   On mailing list - http://activemq.apache.org/mailing-lists.html
+   On IRC - irc://irc.freenode.org/apache-activemq or https://webchat.freenode.net/?channels=apache-activemq
+
+1. Once you're finished coding your feature/fix then rebase your branch against the latest master (applies your patches 
+   on top of master)
+   
+         git fetch upstream  
+         git rebase -i upstream/master  
+         # if you have conflicts fix them and rerun rebase  
+         # The -f, forces the push, alters history, see note below  
+         git push -f origin my_cool_feature
+    
+   The `rebase -i` triggers an interactive update which also allows you to combine commits, alter commit messages etc. 
+   It's a good idea to make the commit log very nice for external consumption (e.g. by squashing all related commits 
+   into a single commit. Note that rebasing and/or using `push -f` can alter history. While this is great for making a 
+   clean patch, it is unfriendly to anyone who has forked your branch. Therefore you'll want to make sure that you 
+   either work in a branch that you don't share, or if you do share it, tell them you are about to revise the branch 
+   history (and thus, they will then need to rebase on top of your branch once you push it out).
+
+1. Get your changes merged into upstream
+
+    1. Send a github pull request, by clicking the pull request link while in your repo's fork.
+    1. An email will automatically be sent to the ActiveMQ developer list.
+    1. As part of the review you may see an automated test run comment on your request.
+    1. After review a maintainer will merge your PR into the canonical git repository at which point those changes will 
+       be synced with the GitHub mirror repository (i.e. your `master`) and your PR will be closed by the `asfgit` bot.
+
+## Other common tasks       
+    
+1. Pulling updates from upstream
+
+        $ git pull --rebase upstream master
+        
+   (`--rebase` will automatically move your local commits, if any, on top of the latest branch you pull from; you can leave
+   it off if you do not have any local commits).
+   
+   One last option, which some prefer, is to avoid using pull altogether, and just use fetch + rebase (this is of course
+   more typing). For example:
+   
+        $ git fetch upstream
+        $ git pull
+
+1. Pushing pulled updates (or local commits if you aren't using topic branches) to your private github repo (origin)
+    
+        $ git push  
+        Counting objects: 192, done.  
+        Delta compression using up to 4 threads.  
+        Compressing objects: 100% (44/44), done.  
+        Writing objects: 100% (100/100), 10.67 KiB, done.  
+        Total 100 (delta 47), reused 100 (delta 47)  
+        To git@github.com:<your-user-name>/apache-artemis.git  
+           3382570..1fa25df  master -> master
+
+   You might need to say -f to force the changes.
+
+## Adding New Dependencies
+
+Due to incompatibilities between some open source licenses and the Apache v2.0 license (that this project is licensed under)
+care must be taken when adding new dependencies to the project.  The Apache Software Foundation 3rd party licensing 
+policy has more information here: http://www.apache.org/legal/3party.html
+
+To keep track of all licenses in ActiveMQ Artemis, new dependencies must be added in either the top level pom.xml or in test/pom.xml
+(depending on whether this is a test only dependency or if it is used in the main code base).  The dependency should be
+added under the dependency management section with version and labelled with a comment highlighting the license for the
+dependency version.  See existing dependencies in the main pom.xml for examples.  The dependency can then be added to
+individual ActiveMQ Artemis modules *without* the version specified (the version is implied from the dependency management
+section of the top level pom).  This allows ActiveMQ Artemis developers to keep track of all dependencies and licenses.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/70258865/docs/hacking-guide/en/formatting.md
----------------------------------------------------------------------
diff --git a/docs/hacking-guide/en/formatting.md b/docs/hacking-guide/en/formatting.md
new file mode 100644
index 0000000..40ee585
--- /dev/null
+++ b/docs/hacking-guide/en/formatting.md
@@ -0,0 +1,11 @@
+# Code Formatting
+
+Eclipse code formatting and (basic) project configuration files can be found at the `etc/` folder. You should manually 
+copy them _after importing all your projects_:
+
+    for settings_dir in `find . -type d -name .settings`; do
+       \cp -v etc/org.eclipse.jdt.* $settings_dir
+    done
+
+Do not use the [maven-eclipse-plugin](https://maven.apache.org/plugins/maven-eclipse-plugin/) to copy the files as it 
+conflicts with [m2e](http://eclipse.org/m2e/).
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/70258865/docs/hacking-guide/en/ide.md
----------------------------------------------------------------------
diff --git a/docs/hacking-guide/en/ide.md b/docs/hacking-guide/en/ide.md
new file mode 100644
index 0000000..a782872
--- /dev/null
+++ b/docs/hacking-guide/en/ide.md
@@ -0,0 +1,79 @@
+# IDE Integration
+
+## IntelliJ IDEA
+
+### Importing the Project
+
+The following steps show how to import ActiveMQ Artemis source into IntelliJ IDEA and setup the correct maven profile to allow
+running of JUnit tests from within the IDE.  (Steps are based on version: 13.1.4)
+
+* File --> Import Project --> Select the root directory of the ActiveMQ Artemis source folder. --> Click OK
+
+This should open the import project wizard.  From here:
+
+* Select "Import from existing model" toggle box, then select Maven from the list box below.  Click Next.
+* Leave the defaults set on this page and click next.
+* On the "Select profiles page", select the checkbox next to "dev" and click next.
+* From here the default settings should suffice.  Continue through the wizard, clicking next until the wizard is complete.
+
+Once the project has been imported and IDEA has caught up importing all the relevant dependencies, you should be able to
+run JUnit tests from with the IDE.  Select any test class in the tests -> integration tests folder.  Right click on the
+class in the project tab and click "Run <classname>".  If the "Run <classname>" option is present then you're all set to go.
+
+### Style Templates for Idea
+
+We have shared the style templates that are good for this project. If you want to apply them use these steps:
+
+* File->Import Settings
+* Select the file under ./artemis-cloned-folder/etc/IDEA-style.jar
+* Select both Code Style Templates and File templates (it's the default option)
+* Select OK and restart Idea
+
+### Issue: My JUnit tests are not runnable with in the IDE.
+
+If the "Run <classname>" or "Run all tests" option is not present.  It is likely that the default profile has not been
+imported properly.  To (re)import the "tests" Maven profile in an existing project.
+
+* Open the Maven Projects Tool Window: View -> Tool Windows -> Maven Projects
+* Select the "profiles" drop down
+* Unselect then reselect the checkbox next to "tests".
+* Click on the "Reimport all maven projects" button in the top left hand corner of the window. (It looks like a ciruclar
+blue arrow.
+* Wait for IDEA to reload and try running a JUnit test again.  The option to run should now be present.
+
+## Eclipse
+
+We recommend using Eclipse Kepler (4.3), due to the built-in support for Maven and Git. Note that there are still some 
+Maven plugins used by sub-projects (e.g. documentation) which are not supported even in Eclipse Kepler (4.3).
+
+Eclipse [m2e](http://eclipse.org/m2e/) is already included in "Eclipse IDE for Java Developers", or it can be installed 
+from [Eclipse Kepler release repository](http://download.eclipse.org/releases/kepler).
+
+### Annotation Pre-Processing
+
+ActiveMQ Artemis uses [JBoss Logging](https://community.jboss.org/wiki/JBossLoggingTooling) and that requires source 
+code generation from Java annotations. In order for it to 'just work' in Eclipse you need to install the
+_Maven Integration for Eclipse JDT Annotation Processor Toolkit_ [m2e-apt](https://github.com/jbosstools/m2e-apt). See
+this [JBoss blog post](https://community.jboss.org/en/tools/blog/2012/05/20/annotation-processing-support-in-m2e-or-m2e-apt-100-is-out)
+ for details.
+
+### M2E Connector for Javacc-Maven-Plugin
+
+Eclipse Indigo (3.7) has out-of-the-box support for it.
+
+As of this writing, Eclipse Kepler (4.3) still lacks support for Maven's javacc plugin. The available [m2e connector for
+javacc-maven-plugin](https://github.com/objectledge/maven-extensions) requires a downgrade of Maven components to be
+installed. manual installation instructions (as of this writing you need to use the development update site). See 
+[this post](http://dev.eclipse.org/mhonarc/lists/m2e-users/msg02725.html) for how to do this with Eclipse Juno (4.2).
+
+The current recommended solution for Eclipse Kepler is to mark `javacc-maven-plugin` as ignored by Eclipse, run Maven 
+from the command line and then modify the project `activemq-core-client` adding the folder 
+`target/generated-sources/javacc` to its build path.
+
+### Use _Project Working Sets_
+
+Importing all ActiveMQ Artemis subprojects will create _too many_ projects in Eclipse, cluttering your _Package Explorer_ 
+and _Project Explorer_ views. One way to address that is to use 
+[Eclipse's Working Sets](http://help.eclipse.org/juno/index.jsp?topic=%2Forg.eclipse.platform.doc.user%2Fconcepts%2Fcworkset.htm) 
+feature. A good introduction to it can be found at a 
+[Dzone article on Eclipse Working Sets](http://eclipse.dzone.com/articles/categorise-projects-package).
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/70258865/docs/hacking-guide/en/images/artemis-logo.jpg
----------------------------------------------------------------------
diff --git a/docs/hacking-guide/en/images/artemis-logo.jpg b/docs/hacking-guide/en/images/artemis-logo.jpg
new file mode 100644
index 0000000..d2c2c6b
Binary files /dev/null and b/docs/hacking-guide/en/images/artemis-logo.jpg differ

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/70258865/docs/hacking-guide/en/maintainers.md
----------------------------------------------------------------------
diff --git a/docs/hacking-guide/en/maintainers.md b/docs/hacking-guide/en/maintainers.md
new file mode 100644
index 0000000..5d77af9
--- /dev/null
+++ b/docs/hacking-guide/en/maintainers.md
@@ -0,0 +1,90 @@
+# Notes for Maintainers
+
+Core ActiveMQ Artemis members have write access to the Apache ActiveMQ Artemis repositories and will be responsible for 
+acknowledging and pushing commits contributed via pull requests on GitHub.  
+
+## Commit Messages
+
+Please ensure the commit messages follow the 50/72 format as described [here](code.md#commitMessageDetails).
+
+## Configuring git repositories
+
+Aside from the traditional `origin` and `upstream` repositories committers will need an additional reference for the 
+canonical Apache git repository where they will be merging and pushing pull-requests. For the purposes of this document,
+let's assume these ref/repo associations already exist as described in the [Working with the Code](code.md) section:
+
+- `origin` : https://github.com/(your-user-name)/activemq-artemis.git
+- `upstream` : https://github.com/apache/activemq-artemis
+
+1. Add the canonical Apache repository as a remote. Here we call it `apache`.
+
+        $ git remote add apache https://git-wip-us.apache.org/repos/asf/activemq-artemis.git
+
+1. Add the following section to your <artemis-repo>/.git/config statement to fetch all pull requests sent to the GitHub 
+   mirror.  We are using `upstream` as the remote repo name (as noted above), but the remote repo name may be different 
+   if you choose. Just be sure to edit all references to the remote repo name so it's consistent.
+
+        [remote "upstream"]
+            url = git@github.com:apache/activemq-artemis.git
+            fetch = +refs/heads/*:refs/remotes/upstream/*
+            fetch = +refs/pull/*/head:refs/remotes/upstream/pr/*
+
+## Merging and pushing pull requests
+
+Here are the basic commands to retrieve pull requests, merge, and push them to the canonical Apache repository:
+
+1. Download all the remote branches etc... including all the pull requests.
+    
+        $ git fetch --all
+        Fetching origin
+        Fetching upstream
+        remote: Counting objects: 566, done.
+        remote: Compressing objects: 100% (188/188), done.
+        remote: Total 566 (delta 64), reused 17 (delta 17), pack-reused 351
+        Receiving objects: 100% (566/566), 300.67 KiB | 0 bytes/s, done.
+        Resolving deltas: 100% (78/78), done.
+        From github.com:apache/activemq-artemis
+         * [new ref]         refs/pull/105/head -> upstream/pr/105
+  
+1. Checkout the pull request you wish to review
+
+        $ git checkout pr/105
+
+1. Once you've reviewed the change and are ready to merge checkout `master`.
+
+        $ git checkout master
+
+1. Ensure you are up to date
+
+        $ git pull
+
+1. Create a new merge commit from the pull-request. IMPORTANT: The commit message here should be something like: "This 
+   closes #105" where "105" is the pull request ID.  The "#105" shows up as a link in the GitHub UI for navigating to 
+   the PR from the commit message. 
+ 
+        $ git merge --no-ff pr/105
+
+1. Push to the canonical Apache repo.
+
+        $ git push apache master
+
+#### Notes:
+
+The GitHub mirror repository (i.e. `upstream`) is cloning the canonical Apache repository.  Because of this there may be
+a slight delay between when a commit is pushed to the Apache repo and when that commit is reflected in the GitHub mirror.  
+This may cause some difficulty when trying to push a PR to `apache` that has been merged on the out-of-date GitHub mirror.  
+You can wait for the mirror to update before performing the steps above or you can change your local master branch to 
+track the master branch on the canonical Apache repository rather than the master branch on the GitHub mirror:
+
+    $ git branch master -u apache/master
+
+Where `apache` points to the canonical Apache repository.
+
+If you'd like your local master branch to always track `upstream/master` (i.e. the GitHub mirror) then another way to 
+achieve this is to add another branch that tracks `apache/master` and push from that branch e.g.
+
+    $ git checkout master
+    $ git branch apache_master --track apache/master
+    $ git pull
+    $ git merge --no-ff pr/105
+    $ git push

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/70258865/docs/hacking-guide/en/notice.md
----------------------------------------------------------------------
diff --git a/docs/hacking-guide/en/notice.md b/docs/hacking-guide/en/notice.md
new file mode 100644
index 0000000..2b2cdc2
--- /dev/null
+++ b/docs/hacking-guide/en/notice.md
@@ -0,0 +1,17 @@
+Legal Notice
+============
+
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements. See the NOTICE file distributed with
+this work for additional information regarding copyright ownership. The
+ASF licenses this file to You under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance with the
+License. You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/70258865/docs/hacking-guide/en/tests.md
----------------------------------------------------------------------
diff --git a/docs/hacking-guide/en/tests.md b/docs/hacking-guide/en/tests.md
new file mode 100644
index 0000000..8cc09d9
--- /dev/null
+++ b/docs/hacking-guide/en/tests.md
@@ -0,0 +1,15 @@
+# Tests
+
+To run the unit tests:
+
+    $ mvn -Ptests test
+
+Generating reports from unit tests:
+
+    $ mvn install site
+
+Running tests individually
+
+    $ mvn -Ptests -DfailIfNoTests=false -Dtest=<test-name> test
+
+where &lt;test-name> is the name of the Test class without its package name
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/70258865/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 8674572..61824fd 100644
--- a/pom.xml
+++ b/pom.xml
@@ -949,8 +949,8 @@
                   <exclude>**/*.txt</exclude>
                   <exclude>**/*.md</exclude>
                   <exclude>etc/org.eclipse.*</exclude>
-                  <exclude>docs/user-manual/en/*.json</exclude>
-                  <exclude>docs/user-manual/en/_book/</exclude>
+                  <exclude>docs/**/*.json</exclude>
+                  <exclude>docs/**/_book/</exclude>
                   <exclude>**/target/</exclude>
                   <exclude>**/META-INF/services/*</exclude>
                   <exclude>**/*.iml</exclude>


[04/13] activemq-artemis git commit: Refactor base test classes

Posted by an...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlTest.java
index 75fe771..7df47ea 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlTest.java
@@ -16,24 +16,19 @@
  */
 package org.apache.activemq.artemis.tests.integration.management;
 
-import javax.transaction.xa.XAResource;
-import javax.transaction.xa.Xid;
-import java.util.HashMap;
-import java.util.Map;
-
 import org.apache.activemq.artemis.api.core.SimpleString;
 import org.apache.activemq.artemis.api.core.TransportConfiguration;
+import org.apache.activemq.artemis.api.core.client.ActiveMQClient;
 import org.apache.activemq.artemis.api.core.client.ClientConsumer;
 import org.apache.activemq.artemis.api.core.client.ClientMessage;
 import org.apache.activemq.artemis.api.core.client.ClientProducer;
 import org.apache.activemq.artemis.api.core.client.ClientSession;
 import org.apache.activemq.artemis.api.core.client.ClientSessionFactory;
-import org.apache.activemq.artemis.api.core.client.ActiveMQClient;
 import org.apache.activemq.artemis.api.core.client.ServerLocator;
+import org.apache.activemq.artemis.api.core.management.ActiveMQServerControl;
 import org.apache.activemq.artemis.api.core.management.AddressSettingsInfo;
 import org.apache.activemq.artemis.api.core.management.BridgeControl;
 import org.apache.activemq.artemis.api.core.management.DivertControl;
-import org.apache.activemq.artemis.api.core.management.ActiveMQServerControl;
 import org.apache.activemq.artemis.api.core.management.ObjectNameBuilder;
 import org.apache.activemq.artemis.api.core.management.QueueControl;
 import org.apache.activemq.artemis.api.core.management.RoleInfo;
@@ -48,7 +43,6 @@ import org.apache.activemq.artemis.core.server.ActiveMQServers;
 import org.apache.activemq.artemis.core.settings.impl.SlowConsumerPolicy;
 import org.apache.activemq.artemis.core.transaction.impl.XidImpl;
 import org.apache.activemq.artemis.tests.util.RandomUtil;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
 import org.apache.activemq.artemis.utils.UUIDGenerator;
 import org.apache.activemq.artemis.utils.json.JSONArray;
 import org.apache.activemq.artemis.utils.json.JSONObject;
@@ -57,6 +51,11 @@ import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
 
+import javax.transaction.xa.XAResource;
+import javax.transaction.xa.Xid;
+import java.util.HashMap;
+import java.util.Map;
+
 public class ActiveMQServerControlTest extends ManagementTestBase
 {
 
@@ -690,7 +689,7 @@ public class ActiveMQServerControlTest extends ManagementTestBase
       assertEquals(name, divertNames[0]);
 
       // check that a message sent to the address is diverted exclusively
-      ServerLocator locator = ActiveMQClient.createServerLocatorWithoutHA(new TransportConfiguration(UnitTestCase.INVM_CONNECTOR_FACTORY));
+      ServerLocator locator = createInVMNonHALocator();
 
       ClientSessionFactory csf = createSessionFactory(locator);
       ClientSession session = csf.createSession();
@@ -756,7 +755,7 @@ public class ActiveMQServerControlTest extends ManagementTestBase
       checkNoResource(ObjectNameBuilder.DEFAULT.getBridgeObjectName(name));
       assertEquals(0, serverControl.getBridgeNames().length);
 
-      ServerLocator locator = ActiveMQClient.createServerLocatorWithoutHA(new TransportConfiguration(UnitTestCase.INVM_CONNECTOR_FACTORY));
+      ServerLocator locator = createInVMNonHALocator();
       ClientSessionFactory csf = createSessionFactory(locator);
       ClientSession session = csf.createSession();
 
@@ -840,7 +839,7 @@ public class ActiveMQServerControlTest extends ManagementTestBase
       SimpleString atestq = new SimpleString("BasicXaTestq");
       Xid xid = newXID();
 
-      ServerLocator locator = ActiveMQClient.createServerLocatorWithoutHA(new TransportConfiguration(UnitTestCase.INVM_CONNECTOR_FACTORY));
+      ServerLocator locator = createInVMNonHALocator();
       ClientSessionFactory csf = createSessionFactory(locator);
       ClientSession clientSession = csf.createSession(true, false, false);
       clientSession.createQueue(atestq, atestq, null, true);
@@ -886,7 +885,7 @@ public class ActiveMQServerControlTest extends ManagementTestBase
       SimpleString atestq = new SimpleString("BasicXaTestq");
       Xid xid = newXID();
 
-      ServerLocator locator = ActiveMQClient.createServerLocatorWithoutHA(new TransportConfiguration(UnitTestCase.INVM_CONNECTOR_FACTORY));
+      ServerLocator locator = createInVMNonHALocator();
       ClientSessionFactory csf = createSessionFactory(locator);
       ClientSession clientSession = csf.createSession(true, false, false);
       clientSession.createQueue(atestq, atestq, null, true);
@@ -929,7 +928,7 @@ public class ActiveMQServerControlTest extends ManagementTestBase
       byte[] globalTransactionId = UUIDGenerator.getInstance().generateStringUUID().getBytes();
       Xid xid = new XidImpl("xa1".getBytes(), 1, globalTransactionId);
       Xid xid2 = new XidImpl("xa2".getBytes(), 1, globalTransactionId);
-      ServerLocator locator = ActiveMQClient.createServerLocatorWithoutHA(new TransportConfiguration(UnitTestCase.INVM_CONNECTOR_FACTORY));
+      ServerLocator locator = createInVMNonHALocator();
       ClientSessionFactory csf = createSessionFactory(locator);
       ClientSession clientSession = csf.createSession(true, false, false);
       clientSession.createQueue(recQueue, recQueue, null, true);
@@ -941,13 +940,13 @@ public class ActiveMQServerControlTest extends ManagementTestBase
       locator.close();
 
 
-      ServerLocator receiveLocator = ActiveMQClient.createServerLocatorWithoutHA(new TransportConfiguration(UnitTestCase.INVM_CONNECTOR_FACTORY));
+      ServerLocator receiveLocator = createInVMNonHALocator();
       ClientSessionFactory receiveCsf = createSessionFactory(receiveLocator);
       ClientSession receiveClientSession = receiveCsf.createSession(true, false, false);
       ClientConsumer consumer = receiveClientSession.createConsumer(recQueue);
 
 
-      ServerLocator sendLocator = ActiveMQClient.createServerLocatorWithoutHA(new TransportConfiguration(UnitTestCase.INVM_CONNECTOR_FACTORY));
+      ServerLocator sendLocator = createInVMNonHALocator();
       ClientSessionFactory sendCsf = createSessionFactory(sendLocator);
       ClientSession sendClientSession = sendCsf.createSession(true, false, false);
       ClientProducer producer = sendClientSession.createProducer(sendQueue);
@@ -1009,7 +1008,7 @@ public class ActiveMQServerControlTest extends ManagementTestBase
    protected void scaleDown(ScaleDownHandler handler) throws Exception
    {
       SimpleString address = new SimpleString("testQueue");
-      Configuration conf = createDefaultConfig(false, 2);
+      Configuration conf = createDefaultConfig(2, new HashMap<String, Object>(), INVM_ACCEPTOR_FACTORY);
       conf.setSecurityEnabled(false);
       conf.getAcceptorConfigurations().clear();
       HashMap<String, Object> params = new HashMap<String, Object>();
@@ -1017,13 +1016,13 @@ public class ActiveMQServerControlTest extends ManagementTestBase
       conf.getAcceptorConfigurations().add(new TransportConfiguration(InVMAcceptorFactory.class.getName(), params));
       ActiveMQServer server2 = ActiveMQServers.newActiveMQServer(conf, null, true);
       this.conf.getConnectorConfigurations().clear();
-      this.conf.getConnectorConfigurations().put("server2-connector", new TransportConfiguration(UnitTestCase.INVM_CONNECTOR_FACTORY, params));
+      this.conf.getConnectorConfigurations().put("server2-connector", new TransportConfiguration(INVM_CONNECTOR_FACTORY, params));
       try
       {
          server2.start();
          server.createQueue(address, address, null, true, false);
          server2.createQueue(address, address, null, true, false);
-         ServerLocator locator = ActiveMQClient.createServerLocatorWithoutHA(new TransportConfiguration(UnitTestCase.INVM_CONNECTOR_FACTORY));
+         ServerLocator locator = createInVMNonHALocator();
          ClientSessionFactory csf = createSessionFactory(locator);
          ClientSession session = csf.createSession();
          ClientProducer producer = session.createProducer(address);
@@ -1037,7 +1036,7 @@ public class ActiveMQServerControlTest extends ManagementTestBase
          ActiveMQServerControl managementControl = createManagementControl();
          handler.scaleDown(managementControl);
          locator.close();
-         locator = ActiveMQClient.createServerLocatorWithoutHA(new TransportConfiguration(UnitTestCase.INVM_CONNECTOR_FACTORY, params));
+         locator = ActiveMQClient.createServerLocatorWithoutHA(new TransportConfiguration(INVM_CONNECTOR_FACTORY, params));
          csf = createSessionFactory(locator);
          session = csf.createSession();
          session.start();
@@ -1072,7 +1071,7 @@ public class ActiveMQServerControlTest extends ManagementTestBase
                                                    params,
                                                    RandomUtil.randomString());
 
-      conf = createDefaultConfig(false)
+      conf = createDefaultConfig()
          .setSecurityEnabled(false)
          .setJMXManagementEnabled(true)
          .clearAcceptorConfigurations()

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlUsingCoreTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlUsingCoreTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlUsingCoreTest.java
index 7c664d4..451c16d 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlUsingCoreTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlUsingCoreTest.java
@@ -16,15 +16,12 @@
  */
 package org.apache.activemq.artemis.tests.integration.management;
 
-import org.apache.activemq.artemis.api.core.TransportConfiguration;
 import org.apache.activemq.artemis.api.core.client.ClientSession;
 import org.apache.activemq.artemis.api.core.client.ClientSessionFactory;
-import org.apache.activemq.artemis.api.core.client.ActiveMQClient;
 import org.apache.activemq.artemis.api.core.client.ServerLocator;
 import org.apache.activemq.artemis.api.core.management.ActiveMQServerControl;
 import org.apache.activemq.artemis.api.core.management.Parameter;
 import org.apache.activemq.artemis.api.core.management.ResourceNames;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
 import org.junit.After;
 import org.junit.Before;
 
@@ -62,7 +59,7 @@ public class ActiveMQServerControlUsingCoreTest extends ActiveMQServerControlTes
    {
       super.setUp();
 
-      locator = ActiveMQClient.createServerLocatorWithoutHA(new TransportConfiguration(UnitTestCase.INVM_CONNECTOR_FACTORY));
+      locator = createInVMNonHALocator();
       ClientSessionFactory sf = createSessionFactory(locator);
       session = sf.createSession(false, true, true);
       session.start();
@@ -88,7 +85,7 @@ public class ActiveMQServerControlUsingCoreTest extends ActiveMQServerControlTes
 
       super.restartServer();
 
-      ServerLocator locator = ActiveMQClient.createServerLocatorWithoutHA(new TransportConfiguration(UnitTestCase.INVM_CONNECTOR_FACTORY));
+      ServerLocator locator = createInVMNonHALocator();
       ClientSessionFactory sf = createSessionFactory(locator);
       session = sf.createSession(false, true, true);
       session.start();

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/AddressControlTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/AddressControlTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/AddressControlTest.java
index 8622f67..93bff07 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/AddressControlTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/AddressControlTest.java
@@ -16,21 +16,17 @@
  */
 package org.apache.activemq.artemis.tests.integration.management;
 
-import java.util.HashSet;
-import java.util.Set;
-
 import org.apache.activemq.artemis.api.config.ActiveMQDefaultConfiguration;
 import org.apache.activemq.artemis.api.core.SimpleString;
 import org.apache.activemq.artemis.api.core.TransportConfiguration;
+import org.apache.activemq.artemis.api.core.client.ActiveMQClient;
 import org.apache.activemq.artemis.api.core.client.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.api.core.management.AddressControl;
 import org.apache.activemq.artemis.api.core.management.RoleInfo;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
 import org.apache.activemq.artemis.core.config.Configuration;
 import org.apache.activemq.artemis.core.remoting.impl.invm.InVMAcceptorFactory;
 import org.apache.activemq.artemis.core.security.CheckType;
@@ -43,6 +39,9 @@ import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
 
+import java.util.HashSet;
+import java.util.Set;
+
 import static org.apache.activemq.artemis.tests.util.RandomUtil.randomString;
 
 public class AddressControlTest extends ManagementTestBase
@@ -221,7 +220,7 @@ public class AddressControlTest extends ManagementTestBase
       server.start();
       ServerLocator locator2 =
          ActiveMQClient.createServerLocatorWithoutHA(new TransportConfiguration(
-            UnitTestCase.INVM_CONNECTOR_FACTORY));
+            INVM_CONNECTOR_FACTORY));
       addServerLocator(locator2);
       ClientSessionFactory sf2 = createSessionFactory(locator2);
 
@@ -289,7 +288,7 @@ public class AddressControlTest extends ManagementTestBase
       server.getAddressSettingsRepository().addMatch(address.toString(), addressSettings);
       server.start();
       ServerLocator locator2 = ActiveMQClient.createServerLocatorWithoutHA(new TransportConfiguration(
-         UnitTestCase.INVM_CONNECTOR_FACTORY));
+         INVM_CONNECTOR_FACTORY));
       addServerLocator(locator2);
       ClientSessionFactory sf2 = createSessionFactory(locator2);
 
@@ -310,7 +309,8 @@ public class AddressControlTest extends ManagementTestBase
 
       Configuration conf = createBasicConfig()
          .addAcceptorConfiguration(new TransportConfiguration(InVMAcceptorFactory.class.getName()));
-      server = createServer(false, conf, mbeanServer);
+      server = createServer(false, conf);
+      server.setMBeanServer(mbeanServer);
       server.start();
 
       locator = createInVMNonHALocator();

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/AddressControlUsingCoreTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/AddressControlUsingCoreTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/AddressControlUsingCoreTest.java
index f1853f8..cf1fdb6 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/AddressControlUsingCoreTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/AddressControlUsingCoreTest.java
@@ -181,7 +181,8 @@ public class AddressControlUsingCoreTest extends ManagementTestBase
 
       Configuration conf = createBasicConfig()
          .addAcceptorConfiguration(new TransportConfiguration(InVMAcceptorFactory.class.getName()));
-      server = createServer(false, conf, mbeanServer);
+      server = createServer(false, conf);
+      server.setMBeanServer(mbeanServer);
       server.start();
 
       ServerLocator locator = createInVMNonHALocator();

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/BroadcastGroupControlTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/BroadcastGroupControlTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/BroadcastGroupControlTest.java
index bd0c0cb..ed5db0b 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/BroadcastGroupControlTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/BroadcastGroupControlTest.java
@@ -16,7 +16,7 @@
  */
 package org.apache.activemq.artemis.tests.integration.management;
 
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.junit.Test;
 
 import java.util.ArrayList;
@@ -66,7 +66,7 @@ public class BroadcastGroupControlTest extends ManagementTestBase
    @Test
    public void testAttributes() throws Exception
    {
-      TransportConfiguration connectorConfiguration = new TransportConfiguration(UnitTestCase.NETTY_CONNECTOR_FACTORY);
+      TransportConfiguration connectorConfiguration = new TransportConfiguration(ServiceTestBase.NETTY_CONNECTOR_FACTORY);
       List<String> connectorInfos = new ArrayList<String>();
       connectorInfos.add(connectorConfiguration.getName());
       BroadcastGroupConfiguration broadcastGroupConfig = BroadcastGroupControlTest.randomBroadcastGroupConfiguration(connectorInfos);
@@ -74,7 +74,7 @@ public class BroadcastGroupControlTest extends ManagementTestBase
       Configuration conf = createBasicConfig()
          .addConnectorConfiguration(connectorConfiguration.getName(), connectorConfiguration)
          .addBroadcastGroupConfiguration(broadcastGroupConfig)
-         .addAcceptorConfiguration(new TransportConfiguration(UnitTestCase.INVM_ACCEPTOR_FACTORY));
+         .addAcceptorConfiguration(new TransportConfiguration(ServiceTestBase.INVM_ACCEPTOR_FACTORY));
       service = addServer(ActiveMQServers.newActiveMQServer(conf, mbeanServer, false));
       service.start();
 
@@ -104,7 +104,7 @@ public class BroadcastGroupControlTest extends ManagementTestBase
    @Test
    public void testStartStop() throws Exception
    {
-      TransportConfiguration connectorConfiguration = new TransportConfiguration(UnitTestCase.NETTY_CONNECTOR_FACTORY);
+      TransportConfiguration connectorConfiguration = new TransportConfiguration(ServiceTestBase.NETTY_CONNECTOR_FACTORY);
       List<String> connectorInfos = new ArrayList<String>();
       connectorInfos.add(connectorConfiguration.getName());
       BroadcastGroupConfiguration broadcastGroupConfig = BroadcastGroupControlTest.randomBroadcastGroupConfiguration(connectorInfos);
@@ -112,7 +112,7 @@ public class BroadcastGroupControlTest extends ManagementTestBase
       Configuration conf = createBasicConfig()
          .addConnectorConfiguration(connectorConfiguration.getName(), connectorConfiguration)
          .addBroadcastGroupConfiguration(broadcastGroupConfig)
-         .addAcceptorConfiguration(new TransportConfiguration(UnitTestCase.INVM_ACCEPTOR_FACTORY));
+         .addAcceptorConfiguration(new TransportConfiguration(ServiceTestBase.INVM_ACCEPTOR_FACTORY));
       service = addServer(ActiveMQServers.newActiveMQServer(conf, mbeanServer, false));
       service.start();
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ClusterConnectionControl2Test.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ClusterConnectionControl2Test.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ClusterConnectionControl2Test.java
index 03cd26a..34f046f 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ClusterConnectionControl2Test.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ClusterConnectionControl2Test.java
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 package org.apache.activemq.artemis.tests.integration.management;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.junit.Before;
 import org.junit.After;
 
@@ -108,12 +108,12 @@ public class ClusterConnectionControl2Test extends ManagementTestBase
 
       Map<String, Object> acceptorParams_1 = new HashMap<String, Object>();
       acceptorParams_1.put(TransportConstants.PORT_PROP_NAME, port_1);
-      TransportConfiguration acceptorConfig_0 = new TransportConfiguration(UnitTestCase.NETTY_ACCEPTOR_FACTORY);
+      TransportConfiguration acceptorConfig_0 = new TransportConfiguration(ServiceTestBase.NETTY_ACCEPTOR_FACTORY);
 
-      TransportConfiguration acceptorConfig_1 = new TransportConfiguration(UnitTestCase.NETTY_ACCEPTOR_FACTORY, acceptorParams_1);
+      TransportConfiguration acceptorConfig_1 = new TransportConfiguration(ServiceTestBase.NETTY_ACCEPTOR_FACTORY, acceptorParams_1);
 
-      TransportConfiguration connectorConfig_1 = new TransportConfiguration(UnitTestCase.NETTY_CONNECTOR_FACTORY, acceptorParams_1);
-      TransportConfiguration connectorConfig_0 = new TransportConfiguration(UnitTestCase.NETTY_CONNECTOR_FACTORY);
+      TransportConfiguration connectorConfig_1 = new TransportConfiguration(ServiceTestBase.NETTY_CONNECTOR_FACTORY, acceptorParams_1);
+      TransportConfiguration connectorConfig_0 = new TransportConfiguration(ServiceTestBase.NETTY_CONNECTOR_FACTORY);
 
       CoreQueueConfiguration queueConfig = new CoreQueueConfiguration()
          .setAddress(RandomUtil.randomString())

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ClusterConnectionControlUsingCoreTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ClusterConnectionControlUsingCoreTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ClusterConnectionControlUsingCoreTest.java
index 45a1793..874184d 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ClusterConnectionControlUsingCoreTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ClusterConnectionControlUsingCoreTest.java
@@ -16,19 +16,16 @@
  */
 package org.apache.activemq.artemis.tests.integration.management;
 
-import java.util.Map;
-
-import org.apache.activemq.artemis.api.core.TransportConfiguration;
 import org.apache.activemq.artemis.api.core.client.ClientSession;
 import org.apache.activemq.artemis.api.core.client.ClientSessionFactory;
-import org.apache.activemq.artemis.api.core.client.ActiveMQClient;
 import org.apache.activemq.artemis.api.core.client.ServerLocator;
 import org.apache.activemq.artemis.api.core.management.ClusterConnectionControl;
 import org.apache.activemq.artemis.api.core.management.ResourceNames;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
 import org.junit.After;
 import org.junit.Before;
 
+import java.util.Map;
+
 public class ClusterConnectionControlUsingCoreTest extends ClusterConnectionControlTest
 {
 
@@ -148,7 +145,7 @@ public class ClusterConnectionControlUsingCoreTest extends ClusterConnectionCont
    {
       super.setUp();
 
-      locator = ActiveMQClient.createServerLocatorWithoutHA(new TransportConfiguration(UnitTestCase.INVM_CONNECTOR_FACTORY));
+      locator = createInVMNonHALocator();
    }
 
    @Override

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/DivertControlUsingCoreTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/DivertControlUsingCoreTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/DivertControlUsingCoreTest.java
index 98b77e5..402a0df 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/DivertControlUsingCoreTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/DivertControlUsingCoreTest.java
@@ -16,14 +16,11 @@
  */
 package org.apache.activemq.artemis.tests.integration.management;
 
-import org.apache.activemq.artemis.api.core.TransportConfiguration;
 import org.apache.activemq.artemis.api.core.client.ClientSession;
 import org.apache.activemq.artemis.api.core.client.ClientSessionFactory;
-import org.apache.activemq.artemis.api.core.client.ActiveMQClient;
 import org.apache.activemq.artemis.api.core.client.ServerLocator;
 import org.apache.activemq.artemis.api.core.management.DivertControl;
 import org.apache.activemq.artemis.api.core.management.ResourceNames;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
 import org.junit.After;
 import org.junit.Before;
 
@@ -105,7 +102,7 @@ public class DivertControlUsingCoreTest extends DivertControlTest
    {
       super.setUp();
 
-      locator = ActiveMQClient.createServerLocatorWithoutHA(new TransportConfiguration(UnitTestCase.INVM_CONNECTOR_FACTORY));
+      locator = createInVMNonHALocator();
    }
 
    @Override

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ManagementServiceImplTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ManagementServiceImplTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ManagementServiceImplTest.java
index 9db746f..0cf3b95 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ManagementServiceImplTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ManagementServiceImplTest.java
@@ -17,7 +17,7 @@
 package org.apache.activemq.artemis.tests.integration.management;
 
 import org.apache.activemq.artemis.tests.unit.core.postoffice.impl.FakeQueue;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.junit.Test;
 
 import org.junit.Assert;
@@ -38,7 +38,7 @@ import org.apache.activemq.artemis.core.server.management.impl.ManagementService
 import org.apache.activemq.artemis.tests.integration.server.FakeStorageManager;
 import org.apache.activemq.artemis.tests.util.RandomUtil;
 
-public class ManagementServiceImplTest extends UnitTestCase
+public class ManagementServiceImplTest extends ServiceTestBase
 {
    @Test
    public void testHandleManagementMessageWithOperation() throws Exception

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/NotificationTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/NotificationTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/NotificationTest.java
index aec091c..8f69140 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/NotificationTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/NotificationTest.java
@@ -27,7 +27,7 @@ import org.apache.activemq.artemis.api.core.client.ClientSessionFactory;
 import org.apache.activemq.artemis.api.core.client.ActiveMQClient;
 import org.apache.activemq.artemis.api.core.client.ServerLocator;
 import org.apache.activemq.artemis.api.core.management.ManagementHelper;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.apache.activemq.artemis.core.client.impl.ClientSessionInternal;
 import org.apache.activemq.artemis.core.config.Configuration;
 import org.apache.activemq.artemis.core.remoting.impl.invm.InVMAcceptorFactory;
@@ -45,7 +45,7 @@ import static org.apache.activemq.artemis.api.core.management.CoreNotificationTy
 import static org.apache.activemq.artemis.api.core.management.CoreNotificationType.CONSUMER_CLOSED;
 import static org.apache.activemq.artemis.api.core.management.CoreNotificationType.CONSUMER_CREATED;
 
-public class NotificationTest extends UnitTestCase
+public class NotificationTest extends ServiceTestBase
 {
 
    // Constants -----------------------------------------------------

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/QueueControlTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/QueueControlTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/QueueControlTest.java
index e3e00c7..b96d802 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/QueueControlTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/QueueControlTest.java
@@ -16,13 +16,6 @@
  */
 package org.apache.activemq.artemis.tests.integration.management;
 
-import java.util.LinkedList;
-import java.util.Map;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.TimeUnit;
-
-import javax.management.Notification;
-
 import org.apache.activemq.artemis.api.core.ActiveMQException;
 import org.apache.activemq.artemis.api.core.Message;
 import org.apache.activemq.artemis.api.core.SimpleString;
@@ -32,12 +25,11 @@ 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.MessageHandler;
 import org.apache.activemq.artemis.api.core.client.ServerLocator;
+import org.apache.activemq.artemis.api.core.management.ActiveMQServerControl;
 import org.apache.activemq.artemis.api.core.management.CoreNotificationType;
 import org.apache.activemq.artemis.api.core.management.DayCounterInfo;
-import org.apache.activemq.artemis.api.core.management.ActiveMQServerControl;
 import org.apache.activemq.artemis.api.core.management.MessageCounterInfo;
 import org.apache.activemq.artemis.api.core.management.ObjectNameBuilder;
 import org.apache.activemq.artemis.api.core.management.QueueControl;
@@ -56,6 +48,12 @@ import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
 
+import javax.management.Notification;
+import java.util.LinkedList;
+import java.util.Map;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
+
 public class QueueControlTest extends ManagementTestBase
 {
 
@@ -391,7 +389,7 @@ public class QueueControlTest extends ManagementTestBase
    @Test
    public void testListDeliveringMessagesWithRASession() throws Exception
    {
-      ServerLocator locator1 = ActiveMQClient.createServerLocatorWithoutHA(new TransportConfiguration(INVM_CONNECTOR_FACTORY));
+      ServerLocator locator1 = createInVMNonHALocator();
       locator1.setBlockOnNonDurableSend(true);
       locator1.setConsumerWindowSize(10240);
       locator1.setAckBatchSize(0);

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/SecurityManagementTestBase.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/SecurityManagementTestBase.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/SecurityManagementTestBase.java
index c3770c1..e3d3035 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/SecurityManagementTestBase.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/SecurityManagementTestBase.java
@@ -16,7 +16,7 @@
  */
 package org.apache.activemq.artemis.tests.integration.management;
 import org.apache.activemq.artemis.api.config.ActiveMQDefaultConfiguration;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.junit.Before;
 import org.junit.After;
 
@@ -33,7 +33,7 @@ import org.apache.activemq.artemis.api.core.management.ManagementHelper;
 import org.apache.activemq.artemis.api.core.management.ResourceNames;
 import org.apache.activemq.artemis.core.server.ActiveMQServer;
 
-public abstract class SecurityManagementTestBase extends UnitTestCase
+public abstract class SecurityManagementTestBase extends ServiceTestBase
 {
 
    // Constants -----------------------------------------------------
@@ -78,7 +78,7 @@ public abstract class SecurityManagementTestBase extends UnitTestCase
    {
       ServerLocator locator =
                addServerLocator(ActiveMQClient.createServerLocatorWithoutHA(new TransportConfiguration(
-                  UnitTestCase.INVM_CONNECTOR_FACTORY)));
+                  INVM_CONNECTOR_FACTORY)));
       ClientSessionFactory sf = locator.createSessionFactory();
       try
       {

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/SecurityNotificationTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/SecurityNotificationTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/SecurityNotificationTest.java
index 90ac2bb..ec8fc6f 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/SecurityNotificationTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/SecurityNotificationTest.java
@@ -15,30 +15,15 @@
  * limitations under the License.
  */
 package org.apache.activemq.artemis.tests.integration.management;
-import org.apache.activemq.artemis.api.core.ActiveMQException;
-import org.apache.activemq.artemis.spi.core.security.ActiveMQSecurityManagerImpl;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
-import org.junit.Before;
-import org.junit.After;
-
-import org.junit.Test;
-
-import static org.apache.activemq.artemis.api.core.management.CoreNotificationType.SECURITY_AUTHENTICATION_VIOLATION;
-import static org.apache.activemq.artemis.api.core.management.CoreNotificationType.SECURITY_PERMISSION_VIOLATION;
-
-import java.util.HashSet;
-import java.util.Set;
-
-import org.junit.Assert;
 
 import org.apache.activemq.artemis.api.config.ActiveMQDefaultConfiguration;
+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.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.api.core.management.ManagementHelper;
 import org.apache.activemq.artemis.core.config.Configuration;
@@ -47,9 +32,21 @@ import org.apache.activemq.artemis.core.security.CheckType;
 import org.apache.activemq.artemis.core.security.Role;
 import org.apache.activemq.artemis.core.server.ActiveMQServer;
 import org.apache.activemq.artemis.core.server.ActiveMQServers;
+import org.apache.activemq.artemis.spi.core.security.ActiveMQSecurityManagerImpl;
 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;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import static org.apache.activemq.artemis.api.core.management.CoreNotificationType.SECURITY_AUTHENTICATION_VIOLATION;
+import static org.apache.activemq.artemis.api.core.management.CoreNotificationType.SECURITY_PERMISSION_VIOLATION;
 
-public class SecurityNotificationTest extends UnitTestCase
+public class SecurityNotificationTest extends ServiceTestBase
 {
 
    // Constants -----------------------------------------------------
@@ -77,7 +74,7 @@ public class SecurityNotificationTest extends UnitTestCase
 
       SecurityNotificationTest.flush(notifConsumer);
 
-      ServerLocator locator = ActiveMQClient.createServerLocatorWithoutHA(new TransportConfiguration(UnitTestCase.INVM_CONNECTOR_FACTORY));
+      ServerLocator locator = createInVMNonHALocator();
       ClientSessionFactory sf = createSessionFactory(locator);
 
       try
@@ -111,7 +108,7 @@ public class SecurityNotificationTest extends UnitTestCase
 
       SecurityNotificationTest.flush(notifConsumer);
 
-      ServerLocator locator = ActiveMQClient.createServerLocatorWithoutHA(new TransportConfiguration(UnitTestCase.INVM_CONNECTOR_FACTORY));
+      ServerLocator locator = createInVMNonHALocator();
       ClientSessionFactory sf = createSessionFactory(locator);
       ClientSession guestSession = sf.createSession("guest", "guest", false, true, true, false, 1);
 
@@ -169,7 +166,7 @@ public class SecurityNotificationTest extends UnitTestCase
 
       securityManager.getConfiguration().addRole("admin", "notif");
 
-      ServerLocator locator = ActiveMQClient.createServerLocatorWithoutHA(new TransportConfiguration(UnitTestCase.INVM_CONNECTOR_FACTORY));
+      ServerLocator locator = createInVMNonHALocator();
       ClientSessionFactory sf = createSessionFactory(locator);
       adminSession = sf.createSession("admin", "admin", false, true, true, false, 1);
       adminSession.start();

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/MultipleProducersPagingTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/MultipleProducersPagingTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/MultipleProducersPagingTest.java
index 878f551..6b2f15d 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/MultipleProducersPagingTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/MultipleProducersPagingTest.java
@@ -36,7 +36,7 @@ import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicLong;
 
 import org.apache.activemq.artemis.api.core.TransportConfiguration;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.apache.activemq.artemis.core.config.Configuration;
 import org.apache.activemq.artemis.core.remoting.impl.netty.NettyAcceptorFactory;
 import org.apache.activemq.artemis.core.remoting.impl.netty.NettyConnectorFactory;
@@ -52,7 +52,7 @@ import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
 
-public class MultipleProducersPagingTest extends UnitTestCase
+public class MultipleProducersPagingTest extends ServiceTestBase
 {
    private static final int CONSUMER_WAIT_TIME_MS = 250;
    private static final int PRODUCERS = 5;

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/SpawnedServerSupport.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/SpawnedServerSupport.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/SpawnedServerSupport.java
index eb9b6ca..7dce83f 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/SpawnedServerSupport.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/SpawnedServerSupport.java
@@ -29,6 +29,7 @@ import org.apache.activemq.artemis.core.config.Configuration;
 import org.apache.activemq.artemis.core.config.HAPolicyConfiguration;
 import org.apache.activemq.artemis.core.config.ha.SharedStoreMasterPolicyConfiguration;
 import org.apache.activemq.artemis.core.config.ha.SharedStoreSlavePolicyConfiguration;
+import org.apache.activemq.artemis.core.config.impl.ConfigurationImpl;
 import org.apache.activemq.artemis.core.remoting.impl.netty.NettyAcceptorFactory;
 import org.apache.activemq.artemis.core.remoting.impl.netty.NettyConnectorFactory;
 import org.apache.activemq.artemis.core.server.ActiveMQServer;
@@ -57,10 +58,21 @@ public class SpawnedServerSupport
       settings.setPageSizeBytes(10 * 1024);
       settings.setMaxSizeBytes(100 * 1024);
 
-      Configuration conf = ServiceTestBase.createBasicConfig(folder, 0)
-         .setPersistenceEnabled(true)
-         .addAddressesSetting("#", settings)
-         .addAcceptorConfiguration(new TransportConfiguration("org.apache.activemq.artemis.core.remoting.impl.netty.NettyAcceptorFactory"));
+      Configuration conf = new ConfigurationImpl()
+              .setSecurityEnabled(false)
+              .setJournalMinFiles(2)
+              .setJournalFileSize(100 * 1024)
+              .setJournalType(ServiceTestBase.getDefaultJournalType())
+              .setJournalCompactMinFiles(0)
+              .setJournalCompactPercentage(0)
+              .setClusterPassword(ServiceTestBase.CLUSTER_PASSWORD)
+              .setJournalDirectory(ServiceTestBase.getJournalDir(folder, 0, false))
+              .setBindingsDirectory(ServiceTestBase.getBindingsDir(folder, 0, false))
+              .setPagingDirectory(ServiceTestBase.getPageDir(folder, 0, false))
+              .setLargeMessagesDirectory(ServiceTestBase.getLargeMessagesDir(folder, 0, false))
+              .setPersistenceEnabled(true)
+              .addAddressesSetting("#", settings)
+              .addAcceptorConfiguration(new TransportConfiguration("org.apache.activemq.artemis.core.remoting.impl.netty.NettyAcceptorFactory"));
 
       return conf;
    }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ra/ActiveMQMessageHandlerTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ra/ActiveMQMessageHandlerTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ra/ActiveMQMessageHandlerTest.java
index 0c0a7a7..3564e23 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ra/ActiveMQMessageHandlerTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ra/ActiveMQMessageHandlerTest.java
@@ -16,14 +16,6 @@
  */
 package org.apache.activemq.artemis.tests.integration.ra;
 
-import javax.jms.Message;
-import javax.resource.ResourceException;
-import javax.resource.spi.InvalidPropertyException;
-import java.lang.reflect.Method;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.atomic.AtomicInteger;
-
 import org.apache.activemq.artemis.api.core.ActiveMQException;
 import org.apache.activemq.artemis.api.core.SimpleString;
 import org.apache.activemq.artemis.api.core.client.ClientMessage;
@@ -38,9 +30,16 @@ import org.apache.activemq.artemis.ra.ActiveMQResourceAdapter;
 import org.apache.activemq.artemis.ra.inflow.ActiveMQActivation;
 import org.apache.activemq.artemis.ra.inflow.ActiveMQActivationSpec;
 import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
 import org.junit.Test;
 
+import javax.jms.Message;
+import javax.resource.ResourceException;
+import javax.resource.spi.InvalidPropertyException;
+import java.lang.reflect.Method;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicInteger;
+
 public class ActiveMQMessageHandlerTest extends ActiveMQRATestBase
 {
 
@@ -199,7 +198,7 @@ public class ActiveMQMessageHandlerTest extends ActiveMQRATestBase
    protected ActiveMQResourceAdapter newResourceAdapter()
    {
       ActiveMQResourceAdapter qResourceAdapter = new ActiveMQResourceAdapter();
-      qResourceAdapter.setConnectorClassName(UnitTestCase.INVM_CONNECTOR_FACTORY);
+      qResourceAdapter.setConnectorClassName(INVM_CONNECTOR_FACTORY);
       return qResourceAdapter;
    }
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ra/ActiveMQMessageHandlerXATest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ra/ActiveMQMessageHandlerXATest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ra/ActiveMQMessageHandlerXATest.java
index 03231e7..d49a186 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ra/ActiveMQMessageHandlerXATest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ra/ActiveMQMessageHandlerXATest.java
@@ -16,18 +16,16 @@
  */
 package org.apache.activemq.artemis.tests.integration.ra;
 
-import org.apache.activemq.artemis.core.postoffice.Binding;
-import org.apache.activemq.artemis.core.server.Queue;
-import org.apache.activemq.artemis.ra.inflow.ActiveMQActivationSpec;
-import org.junit.Test;
-
 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.core.postoffice.Binding;
+import org.apache.activemq.artemis.core.server.Queue;
 import org.apache.activemq.artemis.core.transaction.impl.XidImpl;
 import org.apache.activemq.artemis.ra.ActiveMQResourceAdapter;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.ra.inflow.ActiveMQActivationSpec;
 import org.apache.activemq.artemis.utils.UUIDGenerator;
+import org.junit.Test;
 
 import javax.jms.Message;
 import javax.resource.ResourceException;
@@ -163,7 +161,7 @@ public class ActiveMQMessageHandlerXATest extends ActiveMQRATestBase
    {
       setupDLQ(10);
       ActiveMQResourceAdapter qResourceAdapter = newResourceAdapter();
-      qResourceAdapter.setConnectorClassName(UnitTestCase.INVM_CONNECTOR_FACTORY);
+      qResourceAdapter.setConnectorClassName(INVM_CONNECTOR_FACTORY);
       MyBootstrapContext ctx = new MyBootstrapContext();
       qResourceAdapter.start(ctx);
       ActiveMQActivationSpec spec = new ActiveMQActivationSpec();

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ra/ActiveMQRAClusteredTestBase.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ra/ActiveMQRAClusteredTestBase.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ra/ActiveMQRAClusteredTestBase.java
index 55fadcf..45fc6cb 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ra/ActiveMQRAClusteredTestBase.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ra/ActiveMQRAClusteredTestBase.java
@@ -25,7 +25,7 @@ import org.apache.activemq.artemis.core.remoting.impl.invm.TransportConstants;
 import org.apache.activemq.artemis.core.server.ActiveMQServer;
 import org.apache.activemq.artemis.core.server.ActiveMQServers;
 import org.apache.activemq.artemis.jms.server.impl.JMSServerManagerImpl;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.junit.Before;
 
 public class ActiveMQRAClusteredTestBase extends ActiveMQRATestBase
@@ -96,7 +96,7 @@ public class ActiveMQRAClusteredTestBase extends ActiveMQRATestBase
          .setPagingDirectory(getTestDir() + "/" + directoryPrefix + "Page / ")
          .addConnectorConfiguration(secondaryConnectorName, secondaryConnector)
          .addConnectorConfiguration(primaryConnectorName, primaryConnector)
-         .addClusterConfiguration(UnitTestCase.basicClusterConnectionConfig(secondaryConnectorName, primaryConnectorName));
+         .addClusterConfiguration(ServiceTestBase.basicClusterConnectionConfig(secondaryConnectorName, primaryConnectorName));
 
       return configuration;
    }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ra/ActiveMQRATestBase.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ra/ActiveMQRATestBase.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ra/ActiveMQRATestBase.java
index eccdb96..fde184e 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ra/ActiveMQRATestBase.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ra/ActiveMQRATestBase.java
@@ -16,6 +16,16 @@
  */
 package org.apache.activemq.artemis.tests.integration.ra;
 
+import org.apache.activemq.artemis.api.core.SimpleString;
+import org.apache.activemq.artemis.api.core.client.ServerLocator;
+import org.apache.activemq.artemis.core.settings.impl.AddressSettings;
+import org.apache.activemq.artemis.jms.client.ActiveMQMessage;
+import org.apache.activemq.artemis.ra.ActiveMQResourceAdapter;
+import org.apache.activemq.artemis.ra.inflow.ActiveMQActivation;
+import org.apache.activemq.artemis.tests.util.JMSTestBase;
+import org.junit.After;
+import org.junit.Before;
+
 import javax.jms.Message;
 import javax.jms.MessageListener;
 import javax.resource.ResourceException;
@@ -36,17 +46,6 @@ import java.util.Map;
 import java.util.Timer;
 import java.util.concurrent.CountDownLatch;
 
-import org.apache.activemq.artemis.api.core.SimpleString;
-import org.apache.activemq.artemis.api.core.client.ServerLocator;
-import org.apache.activemq.artemis.tests.util.JMSTestBase;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
-import org.apache.activemq.artemis.core.settings.impl.AddressSettings;
-import org.apache.activemq.artemis.jms.client.ActiveMQMessage;
-import org.apache.activemq.artemis.ra.ActiveMQResourceAdapter;
-import org.apache.activemq.artemis.ra.inflow.ActiveMQActivation;
-import org.junit.After;
-import org.junit.Before;
-
 public abstract class ActiveMQRATestBase extends JMSTestBase
 {
    protected ServerLocator locator;
@@ -95,7 +94,7 @@ public abstract class ActiveMQRATestBase extends JMSTestBase
    protected ActiveMQResourceAdapter newResourceAdapter()
    {
       ActiveMQResourceAdapter qResourceAdapter = new ActiveMQResourceAdapter();
-      qResourceAdapter.setConnectorClassName(UnitTestCase.INVM_CONNECTOR_FACTORY);
+      qResourceAdapter.setConnectorClassName(INVM_CONNECTOR_FACTORY);
       return qResourceAdapter;
    }
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ra/ResourceAdapterTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ra/ResourceAdapterTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ra/ResourceAdapterTest.java
index 4ea46c8..246e50c 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ra/ResourceAdapterTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ra/ResourceAdapterTest.java
@@ -16,25 +16,12 @@
  */
 package org.apache.activemq.artemis.tests.integration.ra;
 
-import javax.jms.Connection;
-import javax.resource.ResourceException;
-import javax.resource.spi.endpoint.MessageEndpoint;
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Set;
-import java.util.concurrent.CountDownLatch;
-
 import org.apache.activemq.artemis.api.core.DiscoveryGroupConfiguration;
 import org.apache.activemq.artemis.api.core.UDPBroadcastEndpointFactory;
 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.api.jms.ActiveMQJMSClient;
-import org.apache.activemq.artemis.tests.unit.ra.BootstrapContext;
-import org.apache.activemq.artemis.tests.unit.ra.MessageEndpointFactory;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
 import org.apache.activemq.artemis.core.client.impl.ClientSessionFactoryInternal;
 import org.apache.activemq.artemis.core.client.impl.ServerLocatorImpl;
 import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
@@ -43,9 +30,21 @@ import org.apache.activemq.artemis.ra.ActiveMQResourceAdapter;
 import org.apache.activemq.artemis.ra.inflow.ActiveMQActivation;
 import org.apache.activemq.artemis.ra.inflow.ActiveMQActivationSpec;
 import org.apache.activemq.artemis.service.extensions.xa.recovery.XARecoveryConfig;
+import org.apache.activemq.artemis.tests.unit.ra.BootstrapContext;
+import org.apache.activemq.artemis.tests.unit.ra.MessageEndpointFactory;
 import org.apache.activemq.artemis.utils.DefaultSensitiveStringCodec;
 import org.junit.Test;
 
+import javax.jms.Connection;
+import javax.resource.ResourceException;
+import javax.resource.spi.endpoint.MessageEndpoint;
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.CountDownLatch;
+
 public class ResourceAdapterTest extends ActiveMQRATestBase
 {
    @Test
@@ -120,7 +119,7 @@ public class ResourceAdapterTest extends ActiveMQRATestBase
    public void testStartStop() throws Exception
    {
       ActiveMQResourceAdapter qResourceAdapter = new ActiveMQResourceAdapter();
-      qResourceAdapter.setConnectorClassName(UnitTestCase.INVM_CONNECTOR_FACTORY);
+      qResourceAdapter.setConnectorClassName(INVM_CONNECTOR_FACTORY);
       ActiveMQRATestBase.MyBootstrapContext ctx = new ActiveMQRATestBase.MyBootstrapContext();
 
       qResourceAdapter.start(ctx);

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/scheduling/DelayedMessageTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/scheduling/DelayedMessageTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/scheduling/DelayedMessageTest.java
index 0e287b6..cff46fd 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/scheduling/DelayedMessageTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/scheduling/DelayedMessageTest.java
@@ -15,11 +15,6 @@
  * limitations under the License.
  */
 package org.apache.activemq.artemis.tests.integration.scheduling;
-import org.junit.Before;
-
-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;
@@ -33,7 +28,9 @@ import org.apache.activemq.artemis.core.settings.impl.AddressSettings;
 import org.apache.activemq.artemis.jms.client.ActiveMQTextMessage;
 import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger;
 import org.apache.activemq.artemis.tests.util.ServiceTestBase;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
 
 public class DelayedMessageTest extends ServiceTestBase
 {
@@ -90,7 +87,7 @@ public class DelayedMessageTest extends ServiceTestBase
 
       final int NUM_MESSAGES = 5;
 
-      UnitTestCase.forceGC();
+      ServiceTestBase.forceGC();
 
       for (int i = 0; i < NUM_MESSAGES; i++)
       {

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/scheduling/MultipliedDelayedMessageTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/scheduling/MultipliedDelayedMessageTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/scheduling/MultipliedDelayedMessageTest.java
index 33d32bb..7ffef99 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/scheduling/MultipliedDelayedMessageTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/scheduling/MultipliedDelayedMessageTest.java
@@ -22,13 +22,12 @@ 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.integration.IntegrationTestLogger;
-import org.apache.activemq.artemis.tests.util.ServiceTestBase;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
 import org.apache.activemq.artemis.core.config.Configuration;
 import org.apache.activemq.artemis.core.server.ActiveMQServer;
 import org.apache.activemq.artemis.core.settings.impl.AddressSettings;
 import org.apache.activemq.artemis.jms.client.ActiveMQTextMessage;
+import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
@@ -94,7 +93,7 @@ public class MultipliedDelayedMessageTest extends ServiceTestBase
       // Session for sending the message
       session = sessionFactory.createSession(false, true, true);
       ClientProducer producer = session.createProducer(queueName);
-      UnitTestCase.forceGC();
+      ServiceTestBase.forceGC();
       ClientMessage tm = createDurableMessage(session, "message");
       producer.send(tm);
       session.close();

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/scheduling/ScheduledMessageTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/scheduling/ScheduledMessageTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/scheduling/ScheduledMessageTest.java
index b9528c4..377166b 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/scheduling/ScheduledMessageTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/scheduling/ScheduledMessageTest.java
@@ -16,11 +16,6 @@
  */
 package org.apache.activemq.artemis.tests.integration.scheduling;
 
-import javax.transaction.xa.XAResource;
-import javax.transaction.xa.Xid;
-import java.util.ArrayList;
-import java.util.concurrent.atomic.AtomicInteger;
-
 import org.apache.activemq.artemis.api.core.Message;
 import org.apache.activemq.artemis.api.core.SimpleString;
 import org.apache.activemq.artemis.api.core.client.ClientConsumer;
@@ -29,19 +24,23 @@ 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.integration.IntegrationTestLogger;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
 import org.apache.activemq.artemis.core.config.Configuration;
 import org.apache.activemq.artemis.core.server.ActiveMQServer;
 import org.apache.activemq.artemis.core.settings.impl.AddressSettings;
 import org.apache.activemq.artemis.core.transaction.impl.XidImpl;
 import org.apache.activemq.artemis.jms.client.ActiveMQTextMessage;
+import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger;
 import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.apache.activemq.artemis.utils.UUIDGenerator;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
 
+import javax.transaction.xa.XAResource;
+import javax.transaction.xa.Xid;
+import java.util.ArrayList;
+import java.util.concurrent.atomic.AtomicInteger;
+
 public class ScheduledMessageTest extends ServiceTestBase
 {
    private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER;
@@ -864,7 +863,7 @@ public class ScheduledMessageTest extends ServiceTestBase
 
    private void scheduledDelivery(final boolean tx) throws Exception
    {
-      UnitTestCase.forceGC();
+      ServiceTestBase.forceGC();
 
       Xid xid = new XidImpl("xa1".getBytes(), 1, UUIDGenerator.getInstance().generateStringUUID().getBytes());
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/security/SecurityTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/security/SecurityTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/security/SecurityTest.java
index 5f9c50b..0ad440e 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/security/SecurityTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/security/SecurityTest.java
@@ -92,7 +92,7 @@ public class SecurityTest extends ServiceTestBase
     */
    private ActiveMQServer createServer() throws Exception
    {
-      configuration = createDefaultConfig(false)
+      configuration = createDefaultConfig()
          .setSecurityEnabled(true);
       ActiveMQServer server = createServer(false, configuration);
       return server;
@@ -569,7 +569,7 @@ public class SecurityTest extends ServiceTestBase
    @Test
    public void testSendMessageUpdateRoleCached() throws Exception
    {
-      Configuration configuration = createDefaultConfig(false)
+      Configuration configuration = createDefaultConfig()
          .setSecurityEnabled(true)
          .setSecurityInvalidationInterval(10000);
       ActiveMQServer server = createServer(false, configuration);
@@ -625,7 +625,7 @@ public class SecurityTest extends ServiceTestBase
    @Test
    public void testSendMessageUpdateRoleCached2() throws Exception
    {
-      Configuration configuration = createDefaultConfig(false)
+      Configuration configuration = createDefaultConfig()
          .setSecurityEnabled(true)
          .setSecurityInvalidationInterval(0);
       ActiveMQServer server = createServer(false, configuration);
@@ -695,7 +695,7 @@ public class SecurityTest extends ServiceTestBase
    @Test
    public void testSendMessageUpdateSender() throws Exception
    {
-      Configuration configuration = createDefaultConfig(false)
+      Configuration configuration = createDefaultConfig()
          .setSecurityEnabled(true)
          .setSecurityInvalidationInterval(-1);
       ActiveMQServer server = createServer(false, configuration);

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/ConnectionLimitTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/ConnectionLimitTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/ConnectionLimitTest.java
index 0832f24..fc9f5f1 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/ConnectionLimitTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/ConnectionLimitTest.java
@@ -26,14 +26,14 @@ import org.apache.activemq.artemis.core.config.Configuration;
 import org.apache.activemq.artemis.core.remoting.impl.netty.TransportConstants;
 import org.apache.activemq.artemis.core.server.ActiveMQServer;
 import org.apache.activemq.artemis.core.server.ActiveMQServers;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.junit.Before;
 import org.junit.Test;
 
 import java.util.HashMap;
 import java.util.Map;
 
-public class ConnectionLimitTest extends UnitTestCase
+public class ConnectionLimitTest extends ServiceTestBase
 {
    private ActiveMQServer server;
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/ExpiryRunnerTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/ExpiryRunnerTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/ExpiryRunnerTest.java
index d4038cc..cbeb225 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/ExpiryRunnerTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/ExpiryRunnerTest.java
@@ -15,20 +15,8 @@
  * limitations under the License.
  */
 package org.apache.activemq.artemis.tests.integration.server;
-import org.apache.activemq.artemis.api.core.ActiveMQException;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
-import org.junit.Before;
-import org.junit.After;
-
-import org.junit.Test;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.TimeUnit;
-
-import org.junit.Assert;
 
+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;
@@ -36,15 +24,24 @@ 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.impl.ConfigurationImpl;
 import org.apache.activemq.artemis.core.server.ActiveMQServer;
 import org.apache.activemq.artemis.core.server.ActiveMQServers;
 import org.apache.activemq.artemis.core.server.Queue;
 import org.apache.activemq.artemis.core.settings.impl.AddressSettings;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
+import org.junit.After;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
 
-public class ExpiryRunnerTest extends UnitTestCase
+public class ExpiryRunnerTest extends ServiceTestBase
 {
    private ActiveMQServer server;
 
@@ -265,12 +262,12 @@ public class ExpiryRunnerTest extends UnitTestCase
 
       ConfigurationImpl configuration = createBasicConfig()
          .setMessageExpiryScanPeriod(1000)
-         .addAcceptorConfiguration(new TransportConfiguration(UnitTestCase.INVM_ACCEPTOR_FACTORY));
+         .addAcceptorConfiguration(new TransportConfiguration(ServiceTestBase.INVM_ACCEPTOR_FACTORY));
       server = ActiveMQServers.newActiveMQServer(configuration, false);
       // start the server
       server.start();
       // then we create a client as normal
-      locator = ActiveMQClient.createServerLocatorWithoutHA(new TransportConfiguration(UnitTestCase.INVM_CONNECTOR_FACTORY));
+      locator = createInVMNonHALocator();
       locator.setBlockOnAcknowledge(true);
       ClientSessionFactory sessionFactory = createSessionFactory(locator);
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/LVQRecoveryTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/LVQRecoveryTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/LVQRecoveryTest.java
index 2a1236e..de24818 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/LVQRecoveryTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/LVQRecoveryTest.java
@@ -16,21 +16,15 @@
  */
 package org.apache.activemq.artemis.tests.integration.server;
 
-import javax.transaction.xa.XAResource;
-import javax.transaction.xa.Xid;
-
 import org.apache.activemq.artemis.api.core.ActiveMQException;
 import org.apache.activemq.artemis.api.core.Message;
 import org.apache.activemq.artemis.api.core.SimpleString;
-import org.apache.activemq.artemis.api.core.TransportConfiguration;
 import org.apache.activemq.artemis.api.core.client.ClientConsumer;
 import org.apache.activemq.artemis.api.core.client.ClientMessage;
 import org.apache.activemq.artemis.api.core.client.ClientProducer;
 import org.apache.activemq.artemis.api.core.client.ClientSession;
 import org.apache.activemq.artemis.api.core.client.ClientSessionFactory;
-import org.apache.activemq.artemis.api.core.client.ActiveMQClient;
 import org.apache.activemq.artemis.api.core.client.ServerLocator;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
 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;
@@ -41,6 +35,9 @@ import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
 
+import javax.transaction.xa.XAResource;
+import javax.transaction.xa.Xid;
+
 public class LVQRecoveryTest extends ServiceTestBase
 {
    private ActiveMQServer server;
@@ -231,7 +228,7 @@ public class LVQRecoveryTest extends ServiceTestBase
       qs.setLastValueQueue(true);
       server.getAddressSettingsRepository().addMatch(address.toString(), qs);
       // then we create a client as normal
-      locator = ActiveMQClient.createServerLocatorWithoutHA(new TransportConfiguration(UnitTestCase.INVM_CONNECTOR_FACTORY));
+      locator = createInVMNonHALocator();
 
       locator.setBlockOnAcknowledge(true);
       locator.setAckBatchSize(0);
@@ -255,7 +252,7 @@ public class LVQRecoveryTest extends ServiceTestBase
       server.getAddressSettingsRepository().addMatch(address.toString(), qs1);
       // then we create a client as normal
       locator.close();
-      locator = ActiveMQClient.createServerLocatorWithoutHA(new TransportConfiguration(UnitTestCase.INVM_CONNECTOR_FACTORY));
+      locator = createInVMNonHALocator();
 
       locator.setBlockOnAcknowledge(true);
       locator.setAckBatchSize(0);

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/LVQTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/LVQTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/LVQTest.java
index 663e073..83a432e 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/LVQTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/LVQTest.java
@@ -15,16 +15,8 @@
  * limitations under the License.
  */
 package org.apache.activemq.artemis.tests.integration.server;
-import org.apache.activemq.artemis.api.core.ActiveMQException;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
-import org.apache.activemq.artemis.core.server.Queue;
-import org.junit.Before;
-import org.junit.After;
-
-import org.junit.Test;
-
-import org.junit.Assert;
 
+import org.apache.activemq.artemis.api.core.ActiveMQException;
 import org.apache.activemq.artemis.api.core.Message;
 import org.apache.activemq.artemis.api.core.SimpleString;
 import org.apache.activemq.artemis.api.core.TransportConfiguration;
@@ -33,14 +25,19 @@ 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.impl.ConfigurationImpl;
 import org.apache.activemq.artemis.core.server.ActiveMQServer;
 import org.apache.activemq.artemis.core.server.ActiveMQServers;
+import org.apache.activemq.artemis.core.server.Queue;
 import org.apache.activemq.artemis.core.settings.impl.AddressSettings;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
+import org.junit.After;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
 
-public class LVQTest extends UnitTestCase
+public class LVQTest extends ServiceTestBase
 {
    private ActiveMQServer server;
 
@@ -675,7 +672,7 @@ public class LVQTest extends UnitTestCase
       super.setUp();
 
       ConfigurationImpl configuration = createBasicConfig()
-         .addAcceptorConfiguration(new TransportConfiguration(UnitTestCase.INVM_ACCEPTOR_FACTORY));
+         .addAcceptorConfiguration(new TransportConfiguration(ServiceTestBase.INVM_ACCEPTOR_FACTORY));
       server = ActiveMQServers.newActiveMQServer(configuration, false);
       // start the server
       server.start();
@@ -684,7 +681,7 @@ public class LVQTest extends UnitTestCase
       qs.setLastValueQueue(true);
       server.getAddressSettingsRepository().addMatch(address.toString(), qs);
       // then we create a client as normalServer
-      ServerLocator locator = ActiveMQClient.createServerLocatorWithoutHA(new TransportConfiguration(UnitTestCase.INVM_CONNECTOR_FACTORY));
+      ServerLocator locator = createInVMNonHALocator();
       locator.setBlockOnAcknowledge(true);
       locator.setAckBatchSize(0);
       ClientSessionFactory sessionFactory = createSessionFactory(locator);

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

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/ScaleDown3NodeTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/ScaleDown3NodeTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/ScaleDown3NodeTest.java
index 29e6d0e..0b76a60 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/ScaleDown3NodeTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/ScaleDown3NodeTest.java
@@ -33,7 +33,7 @@ import org.apache.activemq.artemis.core.server.Queue;
 import org.apache.activemq.artemis.core.settings.impl.AddressSettings;
 import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger;
 import org.apache.activemq.artemis.tests.integration.cluster.distribution.ClusterTestBase;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.junit.After;
 import org.junit.Assert;
 import org.junit.Before;
@@ -149,7 +149,7 @@ public class ScaleDown3NodeTest extends ClusterTestBase
 
          for (int i = 0; i < 2 * ActiveMQClient.DEFAULT_MIN_LARGE_MESSAGE_SIZE; i++)
          {
-            fileMessage.addBytes(new byte[]{UnitTestCase.getSamplebyte(i)});
+            fileMessage.addBytes(new byte[]{ServiceTestBase.getSamplebyte(i)});
          }
 
          fileMessage.putLongProperty(Message.HDR_LARGE_BODY_SIZE, 2 * ActiveMQClient.DEFAULT_MIN_LARGE_MESSAGE_SIZE);
@@ -254,7 +254,7 @@ public class ScaleDown3NodeTest extends ClusterTestBase
 
             for (int j = 0; j < 2 * ActiveMQClient.DEFAULT_MIN_LARGE_MESSAGE_SIZE; j++)
             {
-               Assert.assertEquals(UnitTestCase.getSamplebyte(j), clientMessage.getBodyBuffer().readByte());
+               Assert.assertEquals(ServiceTestBase.getSamplebyte(j), clientMessage.getBodyBuffer().readByte());
             }
          }
          IntegrationTestLogger.LOGGER.info("Received: " + clientMessage);

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/ScaleDownTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/ScaleDownTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/ScaleDownTest.java
index ac77bf9..65a3af5 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/ScaleDownTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/ScaleDownTest.java
@@ -34,7 +34,7 @@ import org.apache.activemq.artemis.core.postoffice.Binding;
 import org.apache.activemq.artemis.core.postoffice.impl.LocalQueueBinding;
 import org.apache.activemq.artemis.core.settings.impl.AddressSettings;
 import org.apache.activemq.artemis.tests.integration.cluster.distribution.ClusterTestBase;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.junit.After;
 import org.junit.Assert;
 import org.junit.Before;
@@ -414,7 +414,7 @@ public class ScaleDownTest extends ClusterTestBase
          for (int i = 0; i < 2 * ActiveMQClient.DEFAULT_MIN_LARGE_MESSAGE_SIZE; i++)
          {
             byte byteRead = msg.getBodyBuffer().readByte();
-            Assert.assertEquals(msg + " Is different", UnitTestCase.getSamplebyte(i), byteRead);
+            Assert.assertEquals(msg + " Is different", ServiceTestBase.getSamplebyte(i), byteRead);
          }
 
          msg.acknowledge();

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/SuppliedThreadPoolTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/SuppliedThreadPoolTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/SuppliedThreadPoolTest.java
index d574d5b..64f4ef3 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/SuppliedThreadPoolTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/SuppliedThreadPoolTest.java
@@ -24,7 +24,7 @@ import java.util.concurrent.ScheduledThreadPoolExecutor;
 import java.util.concurrent.ThreadPoolExecutor;
 import java.util.concurrent.TimeUnit;
 
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.apache.activemq.artemis.core.server.ActiveMQServer;
 import org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl;
 import org.apache.activemq.artemis.core.server.impl.ServiceRegistry;
@@ -32,7 +32,7 @@ import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 
-public class SuppliedThreadPoolTest extends UnitTestCase
+public class SuppliedThreadPoolTest extends ServiceTestBase
 {
    private ActiveMQServer server;
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/spring/SpringIntegrationTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/spring/SpringIntegrationTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/spring/SpringIntegrationTest.java
index 3bac31d..1bd1e42 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/spring/SpringIntegrationTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/spring/SpringIntegrationTest.java
@@ -19,7 +19,7 @@ package org.apache.activemq.artemis.tests.integration.spring;
 import java.util.concurrent.TimeUnit;
 
 import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
 import org.apache.activemq.artemis.jms.server.embedded.EmbeddedJMS;
 import org.junit.Assert;
@@ -29,7 +29,7 @@ import org.springframework.context.ApplicationContext;
 import org.springframework.context.support.ClassPathXmlApplicationContext;
 import org.springframework.jms.listener.DefaultMessageListenerContainer;
 
-public class SpringIntegrationTest extends UnitTestCase
+public class SpringIntegrationTest extends ServiceTestBase
 {
    IntegrationTestLogger log = IntegrationTestLogger.LOGGER;
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/StompTestBase.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/StompTestBase.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/StompTestBase.java
index 1ea8764..f40d4bb 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/StompTestBase.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/StompTestBase.java
@@ -51,7 +51,7 @@ import io.netty.handler.codec.string.StringDecoder;
 import io.netty.handler.codec.string.StringEncoder;
 import org.apache.activemq.artemis.api.core.TransportConfiguration;
 import org.apache.activemq.artemis.tests.unit.util.InVMNamingContext;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.apache.activemq.artemis.core.config.Configuration;
 import org.apache.activemq.artemis.core.protocol.stomp.StompProtocolManagerFactory;
 import org.apache.activemq.artemis.core.registry.JndiBindingRegistry;
@@ -72,7 +72,7 @@ import org.apache.activemq.artemis.jms.server.impl.JMSServerManagerImpl;
 import org.junit.After;
 import org.junit.Before;
 
-public abstract class StompTestBase extends UnitTestCase
+public abstract class StompTestBase extends ServiceTestBase
 {
    protected final int port = 61613;
 


[12/13] activemq-artemis git commit: Fix test config

Posted by an...@apache.org.
Fix test config

This configuration should not have a "data" folder hence should not
have persistence enabled.


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/a9f475ee
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/a9f475ee
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/a9f475ee

Branch: refs/heads/master
Commit: a9f475ee47b3611fc466c2a80ae9323b22540750
Parents: 4b833cf
Author: jbertram <jb...@apache.org>
Authored: Tue May 19 16:19:03 2015 -0500
Committer: jbertram <jb...@apache.org>
Committed: Tue May 19 16:19:03 2015 -0500

----------------------------------------------------------------------
 .../org/apache/activemq/artemis/tests/util/ServiceTestBase.java     | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/a9f475ee/artemis-server/src/test/java/org/apache/activemq/artemis/tests/util/ServiceTestBase.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/test/java/org/apache/activemq/artemis/tests/util/ServiceTestBase.java b/artemis-server/src/test/java/org/apache/activemq/artemis/tests/util/ServiceTestBase.java
index a77298b..baeae3c 100644
--- a/artemis-server/src/test/java/org/apache/activemq/artemis/tests/util/ServiceTestBase.java
+++ b/artemis-server/src/test/java/org/apache/activemq/artemis/tests/util/ServiceTestBase.java
@@ -516,6 +516,7 @@ public abstract class ServiceTestBase extends Assert
       ConfigurationImpl configuration = new ConfigurationImpl()
               .setSecurityEnabled(false)
               .setJournalType(getDefaultJournalType())
+              .setPersistenceEnabled(false)
               .setJournalCompactMinFiles(0)
               .setJournalCompactPercentage(0)
               .setClusterPassword(CLUSTER_PASSWORD);


[13/13] activemq-artemis git commit: merge PR #271 - Hacking guide + test-suite refactor + couple more fixes

Posted by an...@apache.org.
merge PR #271 - Hacking guide + test-suite refactor + couple more fixes


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/13cc616b
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/13cc616b
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/13cc616b

Branch: refs/heads/master
Commit: 13cc616b2f5c375bc98cb0b6f8aa8774cc8282c6
Parents: 042a8f5 a9f475e
Author: Andy Taylor <an...@gmail.com>
Authored: Wed May 20 10:45:55 2015 +0100
Committer: Andy Taylor <an...@gmail.com>
Committed: Wed May 20 10:45:55 2015 +0100

----------------------------------------------------------------------
 README.md                                       |  332 +-
 .../artemis/tests/CoreUnitTestCase.java         |   89 -
 .../util/TimeAndCounterIDGeneratorTest.java     |   15 +-
 .../core/server/ActiveMQMessageBundle.java      |    3 +
 .../artemis/core/server/ActiveMQServer.java     |    4 +
 .../core/server/impl/ActiveMQServerImpl.java    |   14 +-
 .../core/config/impl/ConfigurationImplTest.java |   20 +-
 .../impl/FileConfigurationParserTest.java       |   14 +-
 .../config/impl/HAPolicyConfigurationTest.java  |   10 +-
 .../WrongRoleFileConfigurationParserTest.java   |   10 +-
 .../group/impl/ClusteredResetMockTest.java      |   18 +-
 .../core/settings/AddressSettingsTest.java      |    4 +-
 .../artemis/core/settings/RepositoryTest.java   |   12 +-
 .../artemis/tests/util/RemoveFolder.java        |    2 +-
 .../artemis/tests/util/ServiceTestBase.java     | 3327 +++++++++++++-----
 .../artemis/tests/util/SimpleStringTest.java    |    2 +-
 .../tests/util/SingleServerTestBase.java        |    2 +-
 .../artemis/tests/util/UnitTestCase.java        | 2137 -----------
 artemis-website/pom.xml                         |  128 +-
 .../src/main/resources/hacking-guide/index.html |   24 +
 artemis-website/src/main/resources/index.html   |    1 +
 .../src/main/resources/user-manual/index.html   |    4 +-
 docs/hacking-guide/en/README.md                 |    7 +
 docs/hacking-guide/en/SUMMARY.md                |   10 +
 docs/hacking-guide/en/book.json                 |   11 +
 docs/hacking-guide/en/building.md               |   48 +
 docs/hacking-guide/en/code.md                   |  164 +
 docs/hacking-guide/en/formatting.md             |   11 +
 docs/hacking-guide/en/ide.md                    |   79 +
 docs/hacking-guide/en/images/artemis-logo.jpg   |  Bin 0 -> 18517 bytes
 docs/hacking-guide/en/maintainers.md            |   90 +
 docs/hacking-guide/en/notice.md                 |   17 +
 docs/hacking-guide/en/tests.md                  |   27 +
 pom.xml                                         |    4 +-
 .../extras/byteman/ClosingConnectionTest.java   |    3 +-
 .../tests/extras/jms/bridge/BridgeTestBase.java |    6 +-
 .../integration/DuplicateDetectionTest.java     |   63 +-
 .../tests/integration/String64KLimitTest.java   |    4 +-
 .../aerogear/AeroGearBasicServerTest.java       |   29 +-
 .../integration/client/ActiveMQCrashTest.java   |   17 +-
 .../ConcurrentCreateDeleteProduceTest.java      |    2 +-
 .../integration/client/ConsumerCloseTest.java   |   18 +-
 .../integration/client/ConsumerStuckTest.java   |   10 +-
 .../client/DeadLetterAddressTest.java           |   27 +-
 .../integration/client/ExpiryAddressTest.java   |   21 +-
 .../integration/client/HangConsumerTest.java    |    2 +-
 .../integration/client/HeuristicXATest.java     |   42 +-
 .../client/IncompatibleVersionTest.java         |   10 +-
 .../client/InterruptedLargeMessageTest.java     |    8 +-
 .../client/JmsNettyNioStressTest.java           |   28 +-
 .../LargeMessageAvoidLargeMessagesTest.java     |    8 +-
 .../integration/client/LargeMessageTest.java    |   46 +-
 .../client/LibaioDependencyCheckTest.java       |    4 +-
 .../client/MessageDurabilityTest.java           |    5 +-
 .../MessageGroupingConnectionFactoryTest.java   |   25 +-
 .../integration/client/MessageGroupingTest.java |   45 +-
 .../integration/client/MessagePriorityTest.java |    5 +-
 .../client/MultipleThreadFilterOneTest.java     |    2 +-
 .../tests/integration/client/NIOvsOIOTest.java  |   24 +-
 .../client/NewDeadLetterAddressTest.java        |    8 +-
 .../integration/client/PagingOrderTest.java     |    6 +-
 .../tests/integration/client/PagingTest.java    |   67 +-
 .../integration/client/ProducerCloseTest.java   |   15 +-
 .../client/ProducerFlowControlTest.java         |   17 +-
 .../client/ReceiveImmediateTest.java            |    2 +-
 .../tests/integration/client/RequestorTest.java |    5 +-
 .../client/SelfExpandingBufferTest.java         |    9 +-
 .../client/SessionCloseOnGCTest.java            |   29 +-
 .../integration/client/SessionCloseTest.java    |   59 +-
 .../integration/client/TemporaryQueueTest.java  |    4 +-
 .../integration/client/WildCardRoutingTest.java |   21 +-
 .../cluster/ClusterControllerTest.java          |    8 +-
 .../cluster/RealNodeManagerTest.java            |    4 +-
 .../integration/cluster/bridge/BridgeTest.java  |   98 +-
 .../cluster/bridge/BridgeTestBase.java          |    4 +-
 .../cluster/distribution/ClusterTestBase.java   |   49 +-
 .../MessageRedistributionWithDiscoveryTest.java |    6 +-
 .../distribution/SymmetricClusterTest.java      |    4 +-
 .../SymmetricClusterWithBackupTest.java         |    4 +-
 .../SymmetricClusterWithDiscoveryTest.java      |    6 +-
 .../AutomaticColocatedQuorumVoteTest.java       |    6 +-
 .../failover/BackupSyncLargeMessageTest.java    |    8 +-
 .../cluster/failover/FailoverTestBase.java      |   27 +-
 .../failover/LiveToLiveFailoverTest.java        |    5 +-
 ...ultipleLivesMultipleBackupsFailoverTest.java |   18 +-
 .../MultipleServerFailoverTestBase.java         |    8 +-
 .../failover/QuorumVoteServerConnectTest.java   |    4 +-
 .../SingleLiveMultipleBackupsFailoverTest.java  |   11 +-
 .../MultiThreadRandomReattachTestBase.java      |    6 +-
 .../MultiThreadReattachSupportTestBase.java     |   22 +-
 .../cluster/reattach/RandomReattachTest.java    |   25 +-
 .../cluster/topology/IsolatedTopologyTest.java  |   21 +-
 .../topology/TopologyClusterTestBase.java       |   21 +-
 .../discovery/DiscoveryBaseTest.java            |    4 +-
 .../divert/PersistentDivertTest.java            |   23 +-
 .../integration/embedded/ValidateAIOTest.java   |    2 +-
 .../http/CoreClientOverHttpTest.java            |    4 +-
 .../jms/ActiveMQConnectionFactoryTest.java      |    4 +-
 .../tests/integration/jms/FloodServerTest.java  |    4 +-
 .../integration/jms/SimpleJNDIClientTest.java   |    4 +-
 .../jms/client/ReSendMessageTest.java           |    6 +-
 .../jms/cluster/JMSReconnectTest.java           |    4 +-
 .../jms/connection/CloseConnectionOnGCTest.java |    8 +-
 .../jms/connection/ExceptionListenerTest.java   |    4 +-
 .../jms/largemessage/JMSLargeMessageTest.java   |   18 +-
 .../jms/server/JMSServerStartStopTest.java      |    4 +-
 .../jms/server/config/JMSConfigurationTest.java |    2 +-
 .../ConnectionFactoryControlTest.java           |    8 +-
 .../server/management/JMSQueueControlTest.java  |    3 +-
 .../management/JMSServerControlRestartTest.java |   18 +-
 .../server/management/JMSServerControlTest.java |  114 +-
 .../journal/AIOImportExportTest.java            |    4 +-
 .../journal/AIOJournalCompactTest.java          |    4 +-
 .../journal/JournalPerfTuneTest.java            |    4 +-
 .../journal/NIOBufferedJournalCompactTest.java  |    4 +-
 .../journal/NIOImportExportTest.java            |    4 +-
 .../journal/NIOJournalCompactTest.java          |    6 +-
 .../integration/journal/NIOJournalImplTest.java |    4 +-
 .../journal/ValidateTransactionHealthTest.java  |    4 +-
 .../largemessage/LargeMessageTestBase.java      |   39 +-
 .../largemessage/ServerLargeMessageTest.java    |    7 +-
 .../management/AcceptorControlTest.java         |    9 +-
 .../AcceptorControlUsingCoreTest.java           |   12 +-
 .../management/ActiveMQServerControlTest.java   |   39 +-
 .../ActiveMQServerControlUsingCoreTest.java     |    7 +-
 .../management/AddressControlTest.java          |   16 +-
 .../management/AddressControlUsingCoreTest.java |    3 +-
 .../management/BroadcastGroupControlTest.java   |   10 +-
 .../ClusterConnectionControl2Test.java          |   10 +-
 .../ClusterConnectionControlUsingCoreTest.java  |    9 +-
 .../management/DivertControlUsingCoreTest.java  |    5 +-
 .../management/ManagementServiceImplTest.java   |    4 +-
 .../management/NotificationTest.java            |    4 +-
 .../management/QueueControlTest.java            |   18 +-
 .../management/SecurityManagementTestBase.java  |    6 +-
 .../management/SecurityNotificationTest.java    |   37 +-
 .../paging/MultipleProducersPagingTest.java     |    4 +-
 .../paging/SpawnedServerSupport.java            |   20 +-
 .../ra/ActiveMQMessageHandlerTest.java          |   19 +-
 .../ra/ActiveMQMessageHandlerXATest.java        |   12 +-
 .../ra/ActiveMQRAClusteredTestBase.java         |    4 +-
 .../integration/ra/ActiveMQRATestBase.java      |   23 +-
 .../integration/ra/ResourceAdapterTest.java     |   27 +-
 .../scheduling/DelayedMessageTest.java          |   11 +-
 .../MultipliedDelayedMessageTest.java           |    7 +-
 .../scheduling/ScheduledMessageTest.java        |   15 +-
 .../integration/security/SecurityTest.java      |    8 +-
 .../integration/server/ConnectionLimitTest.java |    4 +-
 .../integration/server/ExpiryRunnerTest.java    |   31 +-
 .../integration/server/LVQRecoveryTest.java     |   13 +-
 .../tests/integration/server/LVQTest.java       |   23 +-
 .../integration/server/ResourceLimitTest.java   |    4 +-
 .../integration/server/ScaleDown3NodeTest.java  |    6 +-
 .../tests/integration/server/ScaleDownTest.java |    4 +-
 .../server/SuppliedThreadPoolTest.java          |    4 +-
 .../spring/SpringIntegrationTest.java           |    4 +-
 .../tests/integration/stomp/StompTestBase.java  |    4 +-
 .../integration/stomp/StompWebSocketTest.java   |    4 +-
 .../integration/stomp/v11/StompV11TestBase.java |    4 +-
 .../netty/ActiveMQFrameDecoder2Test.java        |    4 +-
 .../NettyConnectorWithHTTPUpgradeTest.java      |    4 +-
 .../vertx/ActiveMQVertxUnitTest.java            |   11 +-
 .../integration/xa/BasicXaRecoveryTest.java     |   63 +-
 .../tests/integration/xa/XaTimeoutTest.java     |    6 +-
 .../tests/util/ReplicatedBackupUtils.java       |    4 +-
 .../tests/util/TransportConfigurationUtils.java |   20 +-
 .../artemis/jms/tests/MessageConsumerTest.java  |    8 +-
 .../tests/message/JMSExpirationHeaderTest.java  |   10 +-
 .../jms/tests/selector/SelectorTest.java        |    6 +-
 .../paging/MeasurePagingMultiThreadTest.java    |   10 +-
 .../stress/journal/AddAndRemoveStressTest.java  |    4 +-
 .../stress/journal/CompactingStressTest.java    |   21 +-
 .../JournalCleanupCompactStressTest.java        |   37 +-
 .../stress/journal/LargeJournalStressTest.java  |   15 +-
 .../journal/MultiThreadConsumerStressTest.java  |   13 +-
 .../NIOMultiThreadCompactorStressTest.java      |   19 +-
 .../tests/stress/stomp/StompStressTest.java     |    4 +-
 .../core/journal/impl/AIOJournalImplTest.java   |    4 +-
 .../core/journal/impl/NIOJournalImplTest.java   |    4 +-
 .../core/server/impl/QueueConcurrentTest.java   |    4 +-
 .../timing/core/server/impl/QueueImplTest.java  |    4 +-
 .../jms/bridge/impl/JMSBridgeImplTest.java      |    4 +-
 .../tests/timing/util/ReusableLatchTest.java    |    4 +-
 .../timing/util/TokenBucketLimiterImplTest.java |    4 +-
 .../artemis/tests/timing/util/UTF8Test.java     |    4 +-
 .../tests/unit/core/asyncio/AIOTestBase.java    |    4 +-
 .../unit/core/asyncio/AsynchronousFileTest.java |   22 +-
 .../MultiThreadAsynchronousFileTest.java        |    4 +-
 .../client/impl/LargeMessageBufferTest.java     |    8 +-
 .../impl/ConfigurationValidationTest.java       |    4 +-
 .../core/config/impl/ConnectorsServiceTest.java |    4 +-
 .../config/impl/TransportConfigurationTest.java |    4 +-
 .../journal/impl/AlignedJournalImplTest.java    |   10 +-
 .../unit/core/journal/impl/CleanBufferTest.java |    4 +-
 .../core/journal/impl/FileFactoryTestBase.java  |    4 +-
 .../core/journal/impl/JournalAsyncTest.java     |    4 +-
 .../core/journal/impl/JournalImplTestBase.java  |    8 +-
 .../unit/core/journal/impl/ReclaimerTest.java   |    4 +-
 .../impl/SequentialFileFactoryTestBase.java     |   12 +-
 .../unit/core/journal/impl/TimedBufferTest.java |   18 +-
 .../unit/core/message/impl/MessageImplTest.java |    4 +-
 .../unit/core/paging/impl/PagePositionTest.java |    4 +-
 .../tests/unit/core/paging/impl/PageTest.java   |    8 +-
 .../core/paging/impl/PagingManagerImplTest.java |    6 +-
 .../core/paging/impl/PagingStoreImplTest.java   |   16 +-
 .../impl/BatchIDGeneratorUnitTest.java          |    4 +-
 .../impl/OperationContextUnitTest.java          |    4 +-
 .../core/postoffice/impl/AddressImplTest.java   |    4 +-
 .../core/postoffice/impl/BindingsImplTest.java  |    4 +-
 .../impl/WildcardAddressManagerUnitTest.java    |    4 +-
 .../core/remoting/ActiveMQBufferTestBase.java   |   14 +-
 .../impl/netty/NettyAcceptorFactoryTest.java    |    4 +-
 .../remoting/impl/netty/NettyAcceptorTest.java  |   12 +-
 .../impl/netty/NettyConnectionTest.java         |    4 +-
 .../remoting/impl/netty/NettyConnectorTest.java |    4 +-
 .../core/remoting/impl/ssl/SSLSupportTest.java  |    4 +-
 .../impl/ActiveMQSecurityManagerImplTest.java   |    4 +-
 .../impl/ClusterConnectionBridgeTest.java       |    4 +-
 .../cluster/impl/RemoteQueueBindImplTest.java   |    4 +-
 .../group/impl/SystemPropertyOverrideTest.java  |    4 +-
 .../unit/core/server/impl/FileLockTest.java     |    4 +-
 .../unit/core/server/impl/QueueImplTest.java    |    6 +-
 .../tests/unit/jms/ActiveMQDestinationTest.java |    4 +-
 .../unit/jms/client/ActiveMQMapMessageTest.java |    6 +-
 .../jms/client/ActiveMQStreamMessageTest.java   |   12 +-
 .../unit/jms/client/JMSExceptionHelperTest.java |    4 +-
 .../unit/jms/client/SelectorTranslatorTest.java |    4 +-
 .../tests/unit/jms/misc/ManifestTest.java       |    4 +-
 .../ConnectionFactoryObjectFactoryTest.java     |    4 +-
 .../DestinationObjectFactoryTest.java           |    4 +-
 .../ra/ActiveMQResourceAdapterConfigTest.java   |    4 +-
 .../ra/ConnectionFactoryPropertiesTest.java     |    4 +-
 .../util/ActiveMQBufferInputStreamTest.java     |    4 +-
 .../artemis/tests/unit/util/LinkedListTest.java |    4 +-
 .../ObjectInputStreamWithClassLoaderTest.java   |    4 +-
 .../tests/unit/util/ReusableLatchTest.java      |    4 +-
 .../tests/unit/util/SoftValueMapTest.java       |    4 +-
 .../artemis/tests/unit/util/UTF8Test.java       |    4 +-
 .../tests/unit/util/UUIDGeneratorTest.java      |   10 +-
 .../artemis/tests/unit/util/UUIDTest.java       |    4 +-
 .../tests/unit/util/VersionLoaderTest.java      |    4 +-
 241 files changed, 4386 insertions(+), 4696 deletions(-)
----------------------------------------------------------------------



[11/13] activemq-artemis git commit: ACTIVEMQ6-111 journal dir created even if persistence disabled

Posted by an...@apache.org.
ACTIVEMQ6-111 journal dir created even if persistence disabled


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/4b833cf5
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/4b833cf5
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/4b833cf5

Branch: refs/heads/master
Commit: 4b833cf5e79324453b7fa51a4158e890b23048b5
Parents: 99147d0
Author: jbertram <jb...@apache.org>
Authored: Tue May 19 16:16:51 2015 -0500
Committer: jbertram <jb...@apache.org>
Committed: Tue May 19 16:16:51 2015 -0500

----------------------------------------------------------------------
 .../activemq/artemis/core/server/impl/ActiveMQServerImpl.java      | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/4b833cf5/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
index 1f55131..6d17703 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
@@ -2236,7 +2236,7 @@ public class ActiveMQServerImpl implements ActiveMQServer
    {
       File journalDir = new File(configuration.getJournalDirectory());
 
-      if (!journalDir.exists())
+      if (!journalDir.exists() && configuration.isPersistenceEnabled())
       {
          if (configuration.isCreateJournalDir())
          {


[09/13] activemq-artemis git commit: Refactor base test classes

Posted by an...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/artemis-server/src/test/java/org/apache/activemq/artemis/tests/util/ServiceTestBase.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/test/java/org/apache/activemq/artemis/tests/util/ServiceTestBase.java b/artemis-server/src/test/java/org/apache/activemq/artemis/tests/util/ServiceTestBase.java
index 3299edb..a77298b 100644
--- a/artemis-server/src/test/java/org/apache/activemq/artemis/tests/util/ServiceTestBase.java
+++ b/artemis-server/src/test/java/org/apache/activemq/artemis/tests/util/ServiceTestBase.java
@@ -16,32 +16,29 @@
  */
 package org.apache.activemq.artemis.tests.util;
 
-import javax.management.MBeanServer;
-import java.io.File;
-import java.lang.management.ManagementFactory;
-import java.util.HashMap;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.atomic.AtomicInteger;
-
+import org.apache.activemq.artemis.api.core.ActiveMQBuffer;
 import org.apache.activemq.artemis.api.core.ActiveMQException;
+import org.apache.activemq.artemis.api.core.ActiveMQExceptionType;
+import org.apache.activemq.artemis.api.core.Message;
 import org.apache.activemq.artemis.api.core.Pair;
 import org.apache.activemq.artemis.api.core.SimpleString;
 import org.apache.activemq.artemis.api.core.TransportConfiguration;
+import org.apache.activemq.artemis.api.core.client.ActiveMQClient;
 import org.apache.activemq.artemis.api.core.client.ClientConsumer;
 import org.apache.activemq.artemis.api.core.client.ClientMessage;
 import org.apache.activemq.artemis.api.core.client.ClientProducer;
 import org.apache.activemq.artemis.api.core.client.ClientSession;
 import org.apache.activemq.artemis.api.core.client.ClientSessionFactory;
-import org.apache.activemq.artemis.api.core.client.ActiveMQClient;
 import org.apache.activemq.artemis.api.core.client.ServerLocator;
+import org.apache.activemq.artemis.core.asyncio.impl.AsynchronousFileImpl;
+import org.apache.activemq.artemis.core.client.impl.ClientSessionFactoryImpl;
 import org.apache.activemq.artemis.core.client.impl.ClientSessionFactoryInternal;
+import org.apache.activemq.artemis.core.client.impl.ServerLocatorImpl;
 import org.apache.activemq.artemis.core.client.impl.Topology;
 import org.apache.activemq.artemis.core.client.impl.TopologyMemberImpl;
+import org.apache.activemq.artemis.core.config.ClusterConnectionConfiguration;
 import org.apache.activemq.artemis.core.config.Configuration;
+import org.apache.activemq.artemis.core.config.impl.ConfigurationImpl;
 import org.apache.activemq.artemis.core.journal.PreparedTransactionInfo;
 import org.apache.activemq.artemis.core.journal.RecordInfo;
 import org.apache.activemq.artemis.core.journal.SequentialFileFactory;
@@ -50,563 +47,1549 @@ import org.apache.activemq.artemis.core.journal.impl.JournalImpl;
 import org.apache.activemq.artemis.core.journal.impl.JournalReaderCallback;
 import org.apache.activemq.artemis.core.journal.impl.NIOSequentialFileFactory;
 import org.apache.activemq.artemis.core.paging.PagingStore;
+import org.apache.activemq.artemis.core.persistence.impl.journal.OperationContextImpl;
 import org.apache.activemq.artemis.core.postoffice.Binding;
 import org.apache.activemq.artemis.core.postoffice.Bindings;
 import org.apache.activemq.artemis.core.postoffice.PostOffice;
 import org.apache.activemq.artemis.core.postoffice.QueueBinding;
 import org.apache.activemq.artemis.core.postoffice.impl.LocalQueueBinding;
+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.remoting.impl.invm.InVMRegistry;
 import org.apache.activemq.artemis.core.remoting.impl.invm.TransportConstants;
+import org.apache.activemq.artemis.core.remoting.impl.netty.NettyAcceptorFactory;
+import org.apache.activemq.artemis.core.remoting.impl.netty.NettyConnector;
+import org.apache.activemq.artemis.core.remoting.impl.netty.NettyConnectorFactory;
 import org.apache.activemq.artemis.core.server.ActiveMQComponent;
 import org.apache.activemq.artemis.core.server.ActiveMQServer;
 import org.apache.activemq.artemis.core.server.ActiveMQServerLogger;
 import org.apache.activemq.artemis.core.server.ActiveMQServers;
+import org.apache.activemq.artemis.core.server.JournalType;
+import org.apache.activemq.artemis.core.server.MessageReference;
 import org.apache.activemq.artemis.core.server.NodeManager;
 import org.apache.activemq.artemis.core.server.Queue;
+import org.apache.activemq.artemis.core.server.ServerMessage;
 import org.apache.activemq.artemis.core.server.cluster.ClusterConnection;
+import org.apache.activemq.artemis.core.server.cluster.ClusterManager;
 import org.apache.activemq.artemis.core.server.cluster.RemoteQueueBinding;
 import org.apache.activemq.artemis.core.server.impl.Activation;
 import org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl;
+import org.apache.activemq.artemis.core.server.impl.ServerMessageImpl;
 import org.apache.activemq.artemis.core.server.impl.SharedNothingBackupActivation;
 import org.apache.activemq.artemis.core.settings.impl.AddressFullMessagePolicy;
 import org.apache.activemq.artemis.core.settings.impl.AddressSettings;
+import org.apache.activemq.artemis.core.transaction.impl.XidImpl;
 import org.apache.activemq.artemis.spi.core.security.ActiveMQSecurityManager;
 import org.apache.activemq.artemis.spi.core.security.ActiveMQSecurityManagerImpl;
+import org.apache.activemq.artemis.utils.OrderedExecutorFactory;
 import org.apache.activemq.artemis.utils.UUIDGenerator;
 import org.junit.After;
 import org.junit.Assert;
 import org.junit.Before;
+import org.junit.Rule;
+import org.junit.rules.TemporaryFolder;
+import org.junit.rules.TestName;
+import org.junit.rules.TestRule;
+import org.junit.rules.TestWatcher;
+import org.junit.runner.Description;
+
+import javax.naming.Context;
+import javax.transaction.xa.XAException;
+import javax.transaction.xa.Xid;
+import java.beans.BeanInfo;
+import java.beans.Introspector;
+import java.beans.PropertyDescriptor;
+import java.io.BufferedInputStream;
+import java.io.BufferedOutputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.lang.management.ManagementFactory;
+import java.lang.ref.Reference;
+import java.lang.ref.WeakReference;
+import java.net.ServerSocket;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.Random;
+import java.util.Set;
+import java.util.UUID;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicInteger;
 
 /**
  * Base class with basic utilities on starting up a basic server
  */
-public abstract class ServiceTestBase extends UnitTestCase
+public abstract class ServiceTestBase extends Assert
 {
+   public static final String TARGET_TMP = "./target/tmp";
+   public static final String INVM_ACCEPTOR_FACTORY = InVMAcceptorFactory.class.getCanonicalName();
+   public static final String INVM_CONNECTOR_FACTORY = InVMConnectorFactory.class.getCanonicalName();
+   public static final String NETTY_ACCEPTOR_FACTORY = NettyAcceptorFactory.class.getCanonicalName();
+   public static final String NETTY_CONNECTOR_FACTORY = NettyConnectorFactory.class.getCanonicalName();
+   public static final String CLUSTER_PASSWORD = "UnitTestsClusterPassword";
 
    /**
     * Add a "sendCallNumber" property to messages sent using helper classes. Meant to help in
     * debugging.
     */
    private static final String SEND_CALL_NUMBER = "sendCallNumber";
+   private static final String OS_TYPE = System.getProperty("os.name").toLowerCase();
+   private static final int DEFAULT_UDP_PORT;
+   private static final ActiveMQServerLogger log = ActiveMQServerLogger.LOGGER;
+
    protected static final long WAIT_TIMEOUT = 20000;
+
+   // There is a verification about thread leakages. We only fail a single thread when this happens
+   private static Set<Thread> alreadyFailedThread = new HashSet<Thread>();
+
+   private final Collection<ActiveMQServer> servers = new ArrayList<ActiveMQServer>();
+   private final Collection<ServerLocator> locators = new ArrayList<ServerLocator>();
+   private final Collection<ClientSessionFactory> sessionFactories = new ArrayList<ClientSessionFactory>();
+   private final Collection<ClientSession> clientSessions = new HashSet<ClientSession>();
+   private final Collection<ClientConsumer> clientConsumers = new HashSet<ClientConsumer>();
+   private final Collection<ClientProducer> clientProducers = new HashSet<ClientProducer>();
+   private final Collection<ActiveMQComponent> otherComponents = new HashSet<ActiveMQComponent>();
+   private final Set<ExecutorService> executorSet = new HashSet<ExecutorService>();
+
+   private boolean checkThread = true;
+   private String testDir;
    private int sendMsgCount = 0;
+   private Map<Thread, StackTraceElement[]> previousThreads;
 
-   @Override
-   @After
-   public void tearDown() throws Exception
-   {
-      super.tearDown();
-      if (InVMRegistry.instance.size() > 0)
-      {
-         fail("InVMREgistry size > 0");
-      }
-   }
+   @Rule
+   public TestName name = new TestName();
 
-   @Override
-   @Before
-   public void setUp() throws Exception
-   {
-      sendMsgCount = 0;
-      super.setUp();
-   }
+   @Rule
+   public TemporaryFolder temporaryFolder;
 
-   /**
-    * @param queue
-    * @throws InterruptedException
-    */
-   protected void waitForNotPaging(Queue queue) throws InterruptedException
-   {
-      waitForNotPaging(queue.getPageSubscription().getPagingStore());
-   }
+   @Rule
+   // This Custom rule will remove any files under ./target/tmp
+   // including anything created previously by TemporaryFolder
+   public RemoveFolder folder = new RemoveFolder(TARGET_TMP);
 
-   protected void waitForNotPaging(PagingStore store) throws InterruptedException
+   @Rule
+   public TestRule watcher = new TestWatcher()
    {
-      long timeout = System.currentTimeMillis() + 10000;
-      while (timeout > System.currentTimeMillis() && store.isPaging())
+      @Override
+      protected void starting(Description description)
       {
-         Thread.sleep(100);
+         log.info(String.format("#*#*# Starting test: %s()...", description.getMethodName()));
       }
-      assertFalse(store.isPaging());
-   }
 
-   protected Topology waitForTopology(final ActiveMQServer server, final int nodes) throws Exception
+      @Override
+      protected void finished(Description description)
+      {
+         log.info(String.format("#*#*# Finished test: %s()...", description.getMethodName()));
+      }
+   };
+
+   static
    {
-      return waitForTopology(server, nodes, -1, WAIT_TIMEOUT);
+      Random random = new Random();
+      DEFAULT_UDP_PORT = 6000 + random.nextInt(1000);
    }
 
-   protected Topology waitForTopology(final ActiveMQServer server, final int nodes, final int backups) throws Exception
+   public ServiceTestBase()
    {
-      return waitForTopology(server, nodes, backups, WAIT_TIMEOUT);
+      File parent = new File(TARGET_TMP);
+      parent.mkdirs();
+      temporaryFolder = new TemporaryFolder(parent);
    }
 
-   protected Topology waitForTopology(final ActiveMQServer server, final int liveNodes, final int backupNodes, final long timeout) throws Exception
+   @After
+   public void tearDown() throws Exception
    {
-      ActiveMQServerLogger.LOGGER.debug("waiting for " + liveNodes + " on the topology for server = " + server);
-
-      long start = System.currentTimeMillis();
-
-      Set<ClusterConnection> ccs = server.getClusterManager().getClusterConnections();
+      for (ExecutorService s : executorSet)
+      {
+         s.shutdown();
+      }
+      closeAllSessionFactories();
+      closeAllServerLocatorsFactories();
 
-      if (ccs.size() != 1)
+      try
       {
-         throw new IllegalStateException("You need a single cluster connection on this version of waitForTopology on ServiceTestBase");
+         assertAllExecutorsFinished();
+         assertAllClientConsumersAreClosed();
+         assertAllClientProducersAreClosed();
+         assertAllClientSessionsAreClosed();
       }
+      finally
+      {
+         synchronized (servers)
+         {
+            for (ActiveMQServer server : servers)
+            {
+               if (server == null)
+               {
+                  continue;
+               }
+               try
+               {
+                  final ClusterManager clusterManager = server.getClusterManager();
+                  if (clusterManager != null)
+                  {
+                     for (ClusterConnection cc : clusterManager.getClusterConnections())
+                     {
+                        stopComponent(cc);
+                     }
+                  }
+               }
+               catch (Exception e)
+               {
+                  // no-op
+               }
+               stopComponentOutputExceptions(server);
+            }
+            servers.clear();
+         }
 
-      Topology topology = server.getClusterManager().getDefaultConnection(null).getTopology();
+         closeAllOtherComponents();
 
-      int liveNodesCount = 0;
+         ArrayList<Exception> exceptions;
+         try
+         {
+            exceptions = checkCsfStopped();
+         }
+         finally
+         {
+            cleanupPools();
+         }
+         //clean up pools before failing
+         if (!exceptions.isEmpty())
+         {
+            for (Exception exception : exceptions)
+            {
+               exception.printStackTrace();
+            }
+            fail("Client Session Factories still trying to reconnect, see above to see where created");
+         }
+         Map<Thread, StackTraceElement[]> threadMap = Thread.getAllStackTraces();
+         for (Thread thread : threadMap.keySet())
+         {
+            StackTraceElement[] stack = threadMap.get(thread);
+            for (StackTraceElement stackTraceElement : stack)
+            {
+               if (stackTraceElement.getMethodName().contains("getConnectionWithRetry") && !alreadyFailedThread.contains(thread))
+               {
+                  alreadyFailedThread.add(thread);
+                  System.out.println(threadDump(this.getName() + " has left threads running. Look at thread " +
+                                                        thread.getName() +
+                                                        " id = " +
+                                                        thread.getId() +
+                                                        " has running locators on test " +
+                                                        this.getName() +
+                                                        " on this following dump"));
+                  fail("test '" + getName() + "' left serverlocator running, this could effect other tests");
+               }
+               else if (stackTraceElement.getMethodName().contains("BroadcastGroupImpl.run") && !alreadyFailedThread.contains(thread))
+               {
+                  alreadyFailedThread.add(thread);
+                  System.out.println(threadDump(this.getName() + " has left threads running. Look at thread " +
+                                                        thread.getName() +
+                                                        " id = " +
+                                                        thread.getId() +
+                                                        " is still broadcasting " +
+                                                        this.getName() +
+                                                        " on this following dump"));
+                  fail("test left broadcastgroupimpl running, this could effect other tests");
+               }
+            }
+         }
 
-      int backupNodesCount = 0;
+         if (checkThread)
+         {
+            StringBuffer buffer = null;
 
+            boolean failed = true;
 
-      do
-      {
-         liveNodesCount = 0;
-         backupNodesCount = 0;
 
-         for (TopologyMemberImpl member : topology.getMembers())
-         {
-            if (member.getLive() != null)
+            long timeout = System.currentTimeMillis() + 60000;
+            while (failed && timeout > System.currentTimeMillis())
             {
-               liveNodesCount++;
+               buffer = new StringBuffer();
+
+               failed = checkThread(buffer);
+
+               if (failed)
+               {
+                  forceGC();
+                  Thread.sleep(500);
+                  log.info("There are still threads running, trying again");
+                  System.out.println(buffer);
+               }
             }
-            if (member.getBackup() != null)
+
+            if (failed)
             {
-               backupNodesCount++;
+               logAndSystemOut("Thread leaked on test " + this.getClass().getName() + "::" + this.getName() + "\n" +
+                                       buffer);
+               logAndSystemOut("Thread leakage");
+
+               fail("Thread leaked");
             }
+
+         }
+         else
+         {
+            checkThread = true;
          }
 
-         if ((liveNodes == -1 || liveNodes == liveNodesCount) && (backupNodes == -1 || backupNodes == backupNodesCount))
+         if (Thread.currentThread().getContextClassLoader() == null)
          {
-            return topology;
+            Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader());
+            fail("Thread Context ClassLoader was set to null at some point before this test. We will set to this.getClass().getClassLoader(), but you are supposed to fix your tests");
          }
 
-         Thread.sleep(10);
+         checkFilesUsage();
       }
-      while (System.currentTimeMillis() - start < timeout);
-
-      String msg = "Timed out waiting for cluster topology of live=" + liveNodes + ",backup=" + backupNodes +
-         " (received live=" + liveNodesCount + ", backup=" + backupNodesCount +
-         ") topology = " +
-         topology.describe() +
-         ")";
-
-      ActiveMQServerLogger.LOGGER.error(msg);
 
-      throw new Exception(msg);
+      if (InVMRegistry.instance.size() > 0)
+      {
+         fail("InVMREgistry size > 0");
+      }
    }
 
-
-   protected void waitForTopology(final ActiveMQServer server, String clusterConnectionName, final int nodes, final long timeout) throws Exception
+   @Before
+   public void setUp() throws Exception
    {
-      ActiveMQServerLogger.LOGGER.debug("waiting for " + nodes + " on the topology for server = " + server);
+      sendMsgCount = 0;
+      testDir = temporaryFolder.getRoot().getAbsolutePath();
+      clearDataRecreateServerDirs();
+      OperationContextImpl.clearContext();
 
-      long start = System.currentTimeMillis();
+      InVMRegistry.instance.clear();
 
-      ClusterConnection clusterConnection = server.getClusterManager().getClusterConnection(clusterConnectionName);
+      // checkFreePort(TransportConstants.DEFAULT_PORT);
 
+      previousThreads = Thread.getAllStackTraces();
 
-      Topology topology = clusterConnection.getTopology();
+      logAndSystemOut("#test " + getName());
+   }
 
-      do
+   public static void assertEqualsByteArrays(final byte[] expected, final byte[] actual)
+   {
+      for (int i = 0; i < expected.length; i++)
       {
-         if (nodes == topology.getMembers().size())
-         {
-            return;
-         }
+         Assert.assertEquals("byte at index " + i, expected[i], actual[i]);
+      }
+   }
 
-         Thread.sleep(10);
+   public static int countOccurrencesOf(String str, String sub)
+   {
+      if (str == null || sub == null || str.length() == 0 || sub.length() == 0)
+      {
+         return 0;
       }
-      while (System.currentTimeMillis() - start < timeout);
+      int count = 0;
+      int pos = 0;
+      int idx;
+      while ((idx = str.indexOf(sub, pos)) != -1)
+      {
+         ++count;
+         pos = idx + sub.length();
+      }
+      return count;
+   }
 
-      String msg = "Timed out waiting for cluster topology of " + nodes +
-         " (received " +
-         topology.getMembers().size() +
-         ") topology = " +
-         topology +
-         ")";
+   protected void disableCheckThread()
+   {
+      checkThread = false;
+   }
 
-      ActiveMQServerLogger.LOGGER.error(msg);
+   protected String getName()
+   {
+      return name.getMethodName();
+   }
 
-      throw new Exception(msg);
+   protected boolean isWindows()
+   {
+      return (OS_TYPE.indexOf("win") >= 0);
    }
 
-   protected static final void waitForComponent(final ActiveMQComponent component, final long seconds) throws InterruptedException
+   protected Configuration createDefaultConfig() throws Exception
    {
-      long time = System.currentTimeMillis();
-      long toWait = seconds * 1000;
-      while (!component.isStarted())
-      {
-         Thread.sleep(50);
-         if (System.currentTimeMillis() > (time + toWait))
-         {
-            fail("component did not start within timeout of " + seconds);
-         }
-      }
+      return createDefaultConfig(false);
    }
 
-   protected static final Map<String, Object> generateParams(final int node, final boolean netty)
+   protected Configuration createDefaultConfig(final boolean netty) throws Exception
    {
-      Map<String, Object> params = new HashMap<String, Object>();
+      ConfigurationImpl configuration = createBasicConfig(-1)
+              .setJMXManagementEnabled(false)
+              .clearAcceptorConfigurations()
+              .addAcceptorConfiguration(new TransportConfiguration(INVM_ACCEPTOR_FACTORY));
 
       if (netty)
       {
-         params.put(org.apache.activemq.artemis.core.remoting.impl.netty.TransportConstants.PORT_PROP_NAME,
-                    org.apache.activemq.artemis.core.remoting.impl.netty.TransportConstants.DEFAULT_PORT + node);
-      }
-      else
-      {
-         params.put(org.apache.activemq.artemis.core.remoting.impl.invm.TransportConstants.SERVER_ID_PROP_NAME, node);
+         configuration.addAcceptorConfiguration(new TransportConfiguration(NETTY_ACCEPTOR_FACTORY));
       }
 
-      return params;
+      return configuration;
    }
 
-   protected static final TransportConfiguration getNettyAcceptorTransportConfiguration(final boolean live)
+   protected Configuration createDefaultConfig(final int index,
+                                               final Map<String, Object> params,
+                                               final String... acceptors)
    {
-      if (live)
+      Configuration configuration = createBasicConfig(index).clearAcceptorConfigurations();
+
+      for (String acceptor : acceptors)
       {
-         return new TransportConfiguration(NETTY_ACCEPTOR_FACTORY);
+         TransportConfiguration transportConfig = new TransportConfiguration(acceptor, params);
+         configuration.getAcceptorConfigurations().add(transportConfig);
       }
 
-      Map<String, Object> server1Params = new HashMap<String, Object>();
+      return configuration;
+   }
 
-      server1Params.put(org.apache.activemq.artemis.core.remoting.impl.netty.TransportConstants.PORT_PROP_NAME,
-                        org.apache.activemq.artemis.core.remoting.impl.netty.TransportConstants.DEFAULT_PORT + 1);
+   protected static final ClusterConnectionConfiguration basicClusterConnectionConfig(String connectorName, String... connectors)
+   {
+      ArrayList<String> connectors0 = new ArrayList<>();
+      for (String c : connectors)
+      {
+         connectors0.add(c);
+      }
+      ClusterConnectionConfiguration clusterConnectionConfiguration = new ClusterConnectionConfiguration()
+              .setName("cluster1")
+              .setAddress("jms")
+              .setConnectorName(connectorName)
+              .setRetryInterval(1000)
+              .setDuplicateDetection(false)
+              .setForwardWhenNoConsumers(true)
+              .setMaxHops(1)
+              .setConfirmationWindowSize(1)
+              .setStaticConnectors(connectors0);
+
+      return clusterConnectionConfiguration;
+   }
 
-      return new TransportConfiguration(NETTY_ACCEPTOR_FACTORY, server1Params);
+   protected final OrderedExecutorFactory getOrderedExecutor()
+   {
+      final ExecutorService executor = Executors.newCachedThreadPool();
+      executorSet.add(executor);
+      return new OrderedExecutorFactory(executor);
    }
 
-   protected static final TransportConfiguration getNettyConnectorTransportConfiguration(final boolean live)
+   protected ConfigurationImpl createBasicConfig() throws Exception
    {
-      if (live)
+      return createBasicConfig(0);
+   }
+
+   /**
+    * @param serverID
+    * @return
+    * @throws Exception
+    */
+   protected ConfigurationImpl createBasicConfig(final int serverID)
+   {
+      ConfigurationImpl configuration = new ConfigurationImpl()
+              .setSecurityEnabled(false)
+              .setJournalMinFiles(2)
+              .setJournalFileSize(100 * 1024)
+              .setJournalType(getDefaultJournalType())
+              .setJournalDirectory(getJournalDir(serverID, false))
+              .setBindingsDirectory(getBindingsDir(serverID, false))
+              .setPagingDirectory(getPageDir(serverID, false))
+              .setLargeMessagesDirectory(getLargeMessagesDir(serverID, false))
+              .setJournalCompactMinFiles(0)
+              .setJournalCompactPercentage(0)
+              .setClusterPassword(CLUSTER_PASSWORD);
+
+      return configuration;
+   }
+
+   public static final ConfigurationImpl createBasicConfigNoDataFolder()
+   {
+      ConfigurationImpl configuration = new ConfigurationImpl()
+              .setSecurityEnabled(false)
+              .setJournalType(getDefaultJournalType())
+              .setJournalCompactMinFiles(0)
+              .setJournalCompactPercentage(0)
+              .setClusterPassword(CLUSTER_PASSWORD);
+
+      return configuration;
+   }
+
+   protected static String getUDPDiscoveryAddress()
+   {
+      return System.getProperty("TEST-UDP-ADDRESS", "230.1.2.3");
+   }
+
+   protected static String getUDPDiscoveryAddress(final int variant)
+   {
+      String value = getUDPDiscoveryAddress();
+
+      int posPoint = value.lastIndexOf('.');
+
+      int last = Integer.valueOf(value.substring(posPoint + 1));
+
+      return value.substring(0, posPoint + 1) + (last + variant);
+   }
+
+   public static int getUDPDiscoveryPort()
+   {
+      String port = System.getProperty("TEST-UDP-PORT");
+      if (port != null)
       {
-         return new TransportConfiguration(NETTY_CONNECTOR_FACTORY);
+         return Integer.parseInt(port);
       }
+      return DEFAULT_UDP_PORT;
+   }
 
-      Map<String, Object> server1Params = new HashMap<String, Object>();
+   public static int getUDPDiscoveryPort(final int variant)
+   {
+      return getUDPDiscoveryPort() + variant;
+   }
 
-      server1Params.put(org.apache.activemq.artemis.core.remoting.impl.netty.TransportConstants.PORT_PROP_NAME,
-                        org.apache.activemq.artemis.core.remoting.impl.netty.TransportConstants.DEFAULT_PORT + 1);
-      return new TransportConfiguration(NETTY_CONNECTOR_FACTORY, server1Params);
+   public static JournalType getDefaultJournalType()
+   {
+      if (AsynchronousFileImpl.isLoaded())
+      {
+         return JournalType.ASYNCIO;
+      }
+      else
+      {
+         return JournalType.NIO;
+      }
    }
 
-   protected static final TransportConfiguration createTransportConfiguration(boolean netty, boolean acceptor,
-                                                                              Map<String, Object> params)
+   public static void forceGC()
    {
-      String className;
-      if (netty)
+      log.info("#test forceGC");
+      WeakReference<Object> dumbReference = new WeakReference<Object>(new Object());
+      // A loop that will wait GC, using the minimal time as possible
+      while (dumbReference.get() != null)
       {
-         if (acceptor)
+         System.gc();
+         try
          {
-            className = NETTY_ACCEPTOR_FACTORY;
+            Thread.sleep(100);
          }
-         else
+         catch (InterruptedException e)
          {
-            className = NETTY_CONNECTOR_FACTORY;
          }
       }
-      else
+      log.info("#test forceGC Done");
+   }
+
+   public static void forceGC(final Reference<?> ref, final long timeout)
+   {
+      long waitUntil = System.currentTimeMillis() + timeout;
+      // A loop that will wait GC, using the minimal time as possible
+      while (ref.get() != null && System.currentTimeMillis() < waitUntil)
       {
-         if (acceptor)
+         ArrayList<String> list = new ArrayList<String>();
+         for (int i = 0; i < 1000; i++)
          {
-            className = INVM_ACCEPTOR_FACTORY;
+            list.add("Some string with garbage with concatenation " + i);
          }
-         else
+         list.clear();
+         list = null;
+         System.gc();
+         try
+         {
+            Thread.sleep(500);
+         }
+         catch (InterruptedException e)
          {
-            className = INVM_CONNECTOR_FACTORY;
          }
       }
-      if (params == null)
-         params = new HashMap<String, Object>();
-      return new TransportConfiguration(className, params);
    }
 
-   private final ActiveMQServerLogger log = ActiveMQServerLogger.LOGGER;
-
-   protected void waitForServer(ActiveMQServer server) throws InterruptedException
+   /**
+    * Verifies whether weak references are released after a few GCs.
+    *
+    * @param references
+    * @throws InterruptedException
+    */
+   public static void checkWeakReferences(final WeakReference<?>... references)
    {
-      if (server == null)
-         return;
-      final long wait = 5000;
-      long timetowait = System.currentTimeMillis() + wait;
-      while (!server.isStarted() && System.currentTimeMillis() < timetowait)
-      {
-         Thread.sleep(50);
-      }
+      int i = 0;
+      boolean hasValue = false;
 
-      if (!server.isStarted())
+      do
       {
-         log.info(threadDump("Server didn't start"));
-         fail("server didn't start: " + server);
+         hasValue = false;
+
+         if (i > 0)
+         {
+            forceGC();
+         }
+
+         for (WeakReference<?> ref : references)
+         {
+            if (ref.get() != null)
+            {
+               hasValue = true;
+               break;
+            }
+         }
       }
+      while (i++ <= 30 && hasValue);
 
-      if (!server.getHAPolicy().isBackup())
+      for (WeakReference<?> ref : references)
       {
-         if (!server.waitForActivation(wait, TimeUnit.MILLISECONDS))
-            fail("Server didn't initialize: " + server);
+         Assert.assertNull(ref.get());
       }
    }
 
-   protected void waitForServerToStop(ActiveMQServer server) throws InterruptedException
+   public static String threadDump(final String msg)
    {
-      if (server == null)
-         return;
-      final long wait = 5000;
-      long timetowait = System.currentTimeMillis() + wait;
-      while (server.isStarted() && System.currentTimeMillis() < timetowait)
-      {
-         Thread.sleep(50);
+      StringWriter str = new StringWriter();
+      PrintWriter out = new PrintWriter(str);
+
+      Map<Thread, StackTraceElement[]> stackTrace = Thread.getAllStackTraces();
+
+      out.println("*******************************************************************************");
+      out.println("Complete Thread dump " + msg);
+
+      for (Map.Entry<Thread, StackTraceElement[]> el : stackTrace.entrySet())
+      {
+         out.println("===============================================================================");
+         out.println("Thread " + el.getKey() +
+                             " name = " +
+                             el.getKey().getName() +
+                             " id = " +
+                             el.getKey().getId() +
+                             " group = " +
+                             el.getKey().getThreadGroup());
+         out.println();
+         for (StackTraceElement traceEl : el.getValue())
+         {
+            out.println(traceEl);
+         }
       }
 
-      if (server.isStarted())
-      {
-         log.info(threadDump("Server didn't start"));
-         fail("server didnt start: " + server);
-      }
+      out.println("===============================================================================");
+      out.println("End Thread dump " + msg);
+      out.println("*******************************************************************************");
+
+      return str.toString();
    }
 
    /**
-    * @param backup
+    * Sends the message to both logger and System.out (for unit report)
     */
-   public static final void waitForRemoteBackupSynchronization(final ActiveMQServer backup)
+   public void logAndSystemOut(String message, Exception e)
    {
-      waitForRemoteBackup(null, 10, true, backup);
+      ActiveMQServerLogger log0 = ActiveMQServerLogger.LOGGER;
+      log0.info(message, e);
+      System.out.println(message);
+      e.printStackTrace(System.out);
    }
 
    /**
-    * @param sessionFactoryP
-    * @param seconds
-    * @param waitForSync
-    * @param backup
+    * Sends the message to both logger and System.out (for unit report)
     */
-   public static final void waitForRemoteBackup(ClientSessionFactory sessionFactoryP, int seconds,
-                                                boolean waitForSync, final ActiveMQServer backup)
+   public void logAndSystemOut(String message)
    {
-      ClientSessionFactoryInternal sessionFactory = (ClientSessionFactoryInternal)sessionFactoryP;
-      final ActiveMQServerImpl actualServer = (ActiveMQServerImpl) backup;
-      final long toWait = seconds * 1000;
-      final long time = System.currentTimeMillis();
-      int loop = 0;
-      while (true)
+      ActiveMQServerLogger log0 = ActiveMQServerLogger.LOGGER;
+      log0.info(message);
+      System.out.println(this.getClass().getName() + "::" + message);
+   }
+
+   public static String dumpBytes(final byte[] bytes)
+   {
+      StringBuffer buff = new StringBuffer();
+
+      buff.append(System.identityHashCode(bytes) + ", size: " + bytes.length + " [");
+
+      for (int i = 0; i < bytes.length; i++)
       {
-         Activation activation = actualServer.getActivation();
-         boolean isReplicated = !backup.getHAPolicy().isSharedStore();
-         boolean isRemoteUpToDate = true;
-         if (isReplicated)
-         {
-            if (activation instanceof SharedNothingBackupActivation)
-            {
-               isRemoteUpToDate = ((SharedNothingBackupActivation) activation).isRemoteBackupUpToDate();
-            }
-            else
-            {
-               //we may have already failed over and changed the Activation
-               if (actualServer.isStarted())
-               {
-                  //let it fail a few time to have time to start stopping in the case of waiting to failback
-                  isRemoteUpToDate = loop++ > 10;
-               }
-               //we could be waiting to failback or restart if the server is stopping
-               else
-               {
-                  isRemoteUpToDate = false;
-               }
-            }
-         }
-         if ((sessionFactory == null || sessionFactory.getBackupConnector() != null) &&
-               (isRemoteUpToDate || !waitForSync) &&
-            (!waitForSync || actualServer.getBackupManager() != null && actualServer.getBackupManager().isBackupAnnounced()))
-         {
-            break;
-         }
-         if (System.currentTimeMillis() > (time + toWait))
-         {
-            fail("backup started? (" + actualServer.isStarted() + "). Finished synchronizing (" +
-                  (activation) + "). SessionFactory!=null ? " + (sessionFactory != null) +
-                    " || sessionFactory.getBackupConnector()==" +
-                    (sessionFactory != null ? sessionFactory.getBackupConnector() : "not-applicable"));
-         }
-         try
-         {
-            Thread.sleep(100);
-         }
-         catch (InterruptedException e)
+         buff.append(bytes[i]);
+
+         if (i != bytes.length - 1)
          {
-            fail(e.getMessage());
+            buff.append(", ");
          }
       }
+
+      buff.append("]");
+
+      return buff.toString();
    }
 
-   public static final void waitForRemoteBackup(ClientSessionFactory sessionFactory, int seconds)
+   public static String dumbBytesHex(final byte[] buffer, final int bytesPerLine)
    {
-      ClientSessionFactoryInternal factoryInternal = (ClientSessionFactoryInternal) sessionFactory;
-      final long toWait = seconds * 1000;
-      final long time = System.currentTimeMillis();
-      while (true)
+
+      StringBuffer buff = new StringBuffer();
+
+      buff.append("[");
+
+      for (int i = 0; i < buffer.length; i++)
       {
-         if (factoryInternal.getBackupConnector() != null)
-         {
-            break;
-         }
-         if (System.currentTimeMillis() > (time + toWait))
-         {
-            fail("Backup wasn't located");
-         }
-         try
+         buff.append(String.format("%1$2X", buffer[i]));
+         if (i + 1 < buffer.length)
          {
-            Thread.sleep(100);
+            buff.append(", ");
          }
-         catch (InterruptedException e)
+         if ((i + 1) % bytesPerLine == 0)
          {
-            fail(e.getMessage());
+            buff.append("\n ");
          }
       }
+      buff.append("]");
+
+      return buff.toString();
    }
 
-   protected final ActiveMQServer
-   createServer(final boolean realFiles,
-                final Configuration configuration,
-                final int pageSize,
-                final int maxAddressSize,
-                final Map<String, AddressSettings> settings,
-                final MBeanServer mbeanServer)
+   public static void assertEqualsTransportConfigurations(final TransportConfiguration[] expected,
+                                                          final TransportConfiguration[] actual)
    {
-      ActiveMQServer server;
-
-      if (realFiles)
-      {
-         server = ActiveMQServers.newActiveMQServer(configuration, mbeanServer, true);
-      }
-      else
+      assertEquals(expected.length, actual.length);
+      for (int i = 0; i < expected.length; i++)
       {
-         server = ActiveMQServers.newActiveMQServer(configuration, mbeanServer, false);
+         Assert.assertEquals("TransportConfiguration at index " + i, expected[i], actual[i]);
       }
-      try
-      {
-         for (Map.Entry<String, AddressSettings> setting : settings.entrySet())
-         {
-            server.getAddressSettingsRepository().addMatch(setting.getKey(), setting.getValue());
-         }
-
-         AddressSettings defaultSetting = new AddressSettings();
-         defaultSetting.setPageSizeBytes(pageSize);
-         defaultSetting.setMaxSizeBytes(maxAddressSize);
+   }
 
-         server.getAddressSettingsRepository().addMatch("#", defaultSetting);
+   public static void assertEqualsBuffers(final int size, final ActiveMQBuffer expected, final ActiveMQBuffer actual)
+   {
+      // assertEquals(expected.length, actual.length);
+      expected.readerIndex(0);
+      actual.readerIndex(0);
 
-         return server;
-      }
-      finally
+      for (int i = 0; i < size; i++)
       {
-         addServer(server);
+         byte b1 = expected.readByte();
+         byte b2 = actual.readByte();
+         Assert.assertEquals("byte at index " + i, b1, b2);
       }
+      expected.resetReaderIndex();
+      actual.resetReaderIndex();
    }
 
-   protected final ActiveMQServer createServer(final boolean realFiles,
-                                              final Configuration configuration,
-                                              final int pageSize,
-                                              final int maxAddressSize,
-                                              final Map<String, AddressSettings> settings)
-   {
-      return createServer(realFiles, configuration, pageSize, maxAddressSize, AddressFullMessagePolicy.PAGE, settings);
-   }
-
-   protected final ActiveMQServer createServer(final boolean realFiles,
-                                              final Configuration configuration,
-                                              final int pageSize,
-                                              final int maxAddressSize,
-                                              final AddressFullMessagePolicy fullPolicy,
-                                              final Map<String, AddressSettings> settings)
+   public static void assertEqualsByteArrays(final int length, final byte[] expected, final byte[] actual)
    {
-      ActiveMQServer server = addServer(ActiveMQServers.newActiveMQServer(configuration, realFiles));
-      if (settings != null)
+      // we check only for the given length (the arrays might be
+      // larger)
+      Assert.assertTrue(expected.length >= length);
+      Assert.assertTrue(actual.length >= length);
+      for (int i = 0; i < length; i++)
       {
-         for (Map.Entry<String, AddressSettings> setting : settings.entrySet())
-         {
-            server.getAddressSettingsRepository().addMatch(setting.getKey(), setting.getValue());
-         }
+         Assert.assertEquals("byte at index " + i, expected[i], actual[i]);
       }
-
-      AddressSettings defaultSetting = new AddressSettings();
-      defaultSetting.setPageSizeBytes(pageSize);
-      defaultSetting.setMaxSizeBytes(maxAddressSize);
-      defaultSetting.setAddressFullMessagePolicy(fullPolicy);
-
-      server.getAddressSettingsRepository().addMatch("#", defaultSetting);
-
-      return server;
    }
 
-
-   protected final ActiveMQServer createServer(final boolean realFiles,
-                                              Configuration conf,
-                                              MBeanServer mbeanServer)
+   public static void assertSameXids(final List<Xid> expected, final List<Xid> actual)
    {
-      return createServer(realFiles, conf, mbeanServer, new HashMap<String, AddressSettings>());
+      Assert.assertNotNull(expected);
+      Assert.assertNotNull(actual);
+      Assert.assertEquals(expected.size(), actual.size());
+
+      for (int i = 0; i < expected.size(); i++)
+      {
+         Xid expectedXid = expected.get(i);
+         Xid actualXid = actual.get(i);
+         assertEqualsByteArrays(expectedXid.getBranchQualifier(), actualXid.getBranchQualifier());
+         Assert.assertEquals(expectedXid.getFormatId(), actualXid.getFormatId());
+         assertEqualsByteArrays(expectedXid.getGlobalTransactionId(), actualXid.getGlobalTransactionId());
+      }
    }
 
-   protected final ActiveMQServer
-   createServer(final boolean realFiles,
-                final Configuration configuration,
-                final MBeanServer mbeanServer,
-                final Map<String, AddressSettings> settings)
+   protected static void checkNoBinding(final Context context, final String binding)
    {
-      ActiveMQServer server;
-
-      if (realFiles)
+      try
       {
-         server = ActiveMQServers.newActiveMQServer(configuration, mbeanServer);
+         context.lookup(binding);
+         Assert.fail("there must be no resource to look up for " + binding);
       }
-      else
+      catch (Exception e)
       {
-         server = ActiveMQServers.newActiveMQServer(configuration, mbeanServer, false);
       }
-      try
-      {
-         for (Map.Entry<String, AddressSettings> setting : settings.entrySet())
-         {
-            server.getAddressSettingsRepository().addMatch(setting.getKey(), setting.getValue());
-         }
+   }
 
-         AddressSettings defaultSetting = new AddressSettings();
-         server.getAddressSettingsRepository().addMatch("#", defaultSetting);
+   protected static Object checkBinding(final Context context, final String binding) throws Exception
+   {
+      Object o = context.lookup(binding);
+      Assert.assertNotNull(o);
+      return o;
+   }
 
+   /**
+    * @param connectorConfigs
+    * @return
+    */
+   protected ArrayList<String> registerConnectors(final ActiveMQServer server,
+                                                  final List<TransportConfiguration> connectorConfigs)
+   {
+      // The connectors need to be pre-configured at main config object but this method is taking
+      // TransportConfigurations directly
+      // So this will first register them at the config and then generate a list of objects
+      ArrayList<String> connectors = new ArrayList<String>();
+      for (TransportConfiguration tnsp : connectorConfigs)
+      {
+         String name1 = RandomUtil.randomString();
 
-         return server;
+         server.getConfiguration().getConnectorConfigurations().put(name1, tnsp);
+
+         connectors.add(name1);
       }
-      finally
+      return connectors;
+   }
+
+   protected static final void checkFreePort(final int... ports)
+   {
+      for (int port : ports)
       {
-         addServer(server);
+         ServerSocket ssocket = null;
+         try
+         {
+            ssocket = new ServerSocket(port);
+         }
+         catch (Exception e)
+         {
+            throw new IllegalStateException("port " + port + " is bound", e);
+         }
+         finally
+         {
+            if (ssocket != null)
+            {
+               try
+               {
+                  ssocket.close();
+               }
+               catch (IOException e)
+               {
+               }
+            }
+         }
       }
    }
 
-   protected final ActiveMQServer createServer(final boolean realFiles) throws Exception
+   /**
+    * @return the testDir
+    */
+   protected final String getTestDir()
    {
-      return createServer(realFiles, false);
+      return testDir;
    }
 
-   protected final ActiveMQServer createServer(final boolean realFiles, final boolean netty) throws Exception
+   protected final void setTestDir(String testDir)
    {
-      return createServer(realFiles, createDefaultConfig(netty), -1, -1, new HashMap<String, AddressSettings>());
+      this.testDir = testDir;
    }
 
-   protected ActiveMQServer createServer(final boolean realFiles, final Configuration configuration)
+   protected final void clearDataRecreateServerDirs()
    {
-      return createServer(realFiles, configuration, -1, -1, new HashMap<String, AddressSettings>());
+      clearDataRecreateServerDirs(getTestDir());
    }
 
-   protected final ActiveMQServer createServer(final Configuration configuration)
+   protected void clearDataRecreateServerDirs(final String testDir1)
    {
-      return createServer(configuration.isPersistenceEnabled(), configuration, -1, -1,
-                          new HashMap<String, AddressSettings>());
+      // Need to delete the root
+
+      File file = new File(testDir1);
+      deleteDirectory(file);
+      file.mkdirs();
+
+      recreateDirectory(getJournalDir(testDir1));
+      recreateDirectory(getBindingsDir(testDir1));
+      recreateDirectory(getPageDir(testDir1));
+      recreateDirectory(getLargeMessagesDir(testDir1));
+      recreateDirectory(getClientLargeMessagesDir(testDir1));
+      recreateDirectory(getTemporaryDir(testDir1));
    }
 
-   protected ActiveMQServer createInVMFailoverServer(final boolean realFiles,
-                                                    final Configuration configuration,
-                                                    final NodeManager nodeManager,
-                                                    final int id)
-   {
+   /**
+    * @return the journalDir
+    */
+   public String getJournalDir()
+   {
+      return getJournalDir(getTestDir());
+   }
+
+   protected static String getJournalDir(final String testDir1)
+   {
+      return testDir1 + "/journal";
+   }
+
+   protected String getJournalDir(final int index, final boolean backup)
+   {
+      return getJournalDir(getTestDir(), index, backup);
+   }
+
+   public static String getJournalDir(final String testDir, final int index, final boolean backup)
+   {
+      return getJournalDir(testDir) + directoryNameSuffix(index, backup);
+   }
+
+   /**
+    * @return the bindingsDir
+    */
+   protected String getBindingsDir()
+   {
+      return getBindingsDir(getTestDir());
+   }
+
+   /**
+    * @return the bindingsDir
+    */
+   protected static String getBindingsDir(final String testDir1)
+   {
+      return testDir1 + "/bindings";
+   }
+
+   /**
+    * @return the bindingsDir
+    */
+   protected String getBindingsDir(final int index, final boolean backup)
+   {
+      return getBindingsDir(getTestDir(), index, backup);
+   }
+
+   public static String getBindingsDir(final String testDir, final int index, final boolean backup)
+   {
+      return getBindingsDir(testDir) + directoryNameSuffix(index, backup);
+   }
+
+   /**
+    * @return the pageDir
+    */
+   protected String getPageDir()
+   {
+      return getPageDir(getTestDir());
+   }
+
+   /**
+    * @return the pageDir
+    */
+   protected static String getPageDir(final String testDir1)
+   {
+      return testDir1 + "/page";
+   }
+
+   protected String getPageDir(final int index, final boolean backup)
+   {
+      return getPageDir(getTestDir(), index, backup);
+   }
+
+   public static String getPageDir(final String testDir, final int index, final boolean backup)
+   {
+      return getPageDir(testDir) + directoryNameSuffix(index, backup);
+   }
+
+   /**
+    * @return the largeMessagesDir
+    */
+   protected String getLargeMessagesDir()
+   {
+      return getLargeMessagesDir(getTestDir());
+   }
+
+   /**
+    * @return the largeMessagesDir
+    */
+   protected static String getLargeMessagesDir(final String testDir1)
+   {
+      return testDir1 + "/large-msg";
+   }
+
+   protected String getLargeMessagesDir(final int index, final boolean backup)
+   {
+      return getLargeMessagesDir(getTestDir(), index, backup);
+   }
+
+   public static String getLargeMessagesDir(final String testDir, final int index, final boolean backup)
+   {
+      return getLargeMessagesDir(testDir) + directoryNameSuffix(index, backup);
+   }
+
+   private static String directoryNameSuffix(int index, boolean backup)
+   {
+      if (index == -1)
+         return "";
+      return index + "-" + (backup ? "B" : "L");
+   }
+
+   /**
+    * @return the clientLargeMessagesDir
+    */
+   protected String getClientLargeMessagesDir()
+   {
+      return getClientLargeMessagesDir(getTestDir());
+   }
+
+   /**
+    * @return the clientLargeMessagesDir
+    */
+   protected String getClientLargeMessagesDir(final String testDir1)
+   {
+      return testDir1 + "/client-large-msg";
+   }
+
+   /**
+    * @return the temporaryDir
+    */
+   protected final String getTemporaryDir()
+   {
+      return getTemporaryDir(getTestDir());
+   }
+
+   /**
+    * @return the temporaryDir
+    */
+   protected String getTemporaryDir(final String testDir1)
+   {
+      return testDir1 + "/temp";
+   }
+
+   protected static void expectActiveMQException(final String message, final ActiveMQExceptionType errorCode, final ActiveMQAction action)
+   {
+      try
+      {
+         action.run();
+         Assert.fail(message);
+      }
+      catch (Exception e)
+      {
+         Assert.assertTrue(e instanceof ActiveMQException);
+         Assert.assertEquals(errorCode, ((ActiveMQException) e).getType());
+      }
+   }
+
+   protected static void expectActiveMQException(final ActiveMQExceptionType errorCode, final ActiveMQAction action)
+   {
+      expectActiveMQException("must throw a ActiveMQException with the expected errorCode: " + errorCode,
+                              errorCode,
+                              action);
+   }
+
+   protected static void expectXAException(final int errorCode, final ActiveMQAction action)
+   {
+      try
+      {
+         action.run();
+         Assert.fail("must throw a XAException with the expected errorCode: " + errorCode);
+      }
+      catch (Exception e)
+      {
+         Assert.assertTrue(e instanceof XAException);
+         Assert.assertEquals(errorCode, ((XAException) e).errorCode);
+      }
+   }
+
+   public static byte getSamplebyte(final long position)
+   {
+      return (byte) ('a' + position % ('z' - 'a' + 1));
+   }
+
+   // Creates a Fake LargeStream without using a real file
+   public static InputStream createFakeLargeStream(final long size) throws Exception
+   {
+      return new InputStream()
+      {
+         private long count;
+
+         private boolean closed = false;
+
+         @Override
+         public void close() throws IOException
+         {
+            super.close();
+            closed = true;
+         }
+
+         @Override
+         public int read() throws IOException
+         {
+            if (closed)
+            {
+               throw new IOException("Stream was closed");
+            }
+            if (count++ < size)
+            {
+               return getSamplebyte(count - 1);
+            }
+            else
+            {
+               return -1;
+            }
+         }
+      };
+
+   }
+
+   /**
+    * It validates a Bean (POJO) using simple setters and getters with random values.
+    * You can pass a list of properties to be ignored, as some properties will have a pre-defined domain (not being possible to use random-values on them)
+    */
+   protected void validateGettersAndSetters(final Object pojo, final String... ignoredProperties) throws Exception
+   {
+      HashSet<String> ignoreSet = new HashSet<String>();
+
+      for (String ignore : ignoredProperties)
+      {
+         ignoreSet.add(ignore);
+      }
+
+      BeanInfo info = Introspector.getBeanInfo(pojo.getClass());
+
+      PropertyDescriptor[] properties = info.getPropertyDescriptors();
+
+      for (PropertyDescriptor prop : properties)
+      {
+         Object value;
+
+         if (prop.getPropertyType() == String.class)
+         {
+            value = RandomUtil.randomString();
+         }
+         else if (prop.getPropertyType() == Integer.class || prop.getPropertyType() == Integer.TYPE)
+         {
+            value = RandomUtil.randomInt();
+         }
+         else if (prop.getPropertyType() == Long.class || prop.getPropertyType() == Long.TYPE)
+         {
+            value = RandomUtil.randomLong();
+         }
+         else if (prop.getPropertyType() == Boolean.class || prop.getPropertyType() == Boolean.TYPE)
+         {
+            value = RandomUtil.randomBoolean();
+         }
+         else if (prop.getPropertyType() == Double.class || prop.getPropertyType() == Double.TYPE)
+         {
+            value = RandomUtil.randomDouble();
+         }
+         else
+         {
+            System.out.println("Can't validate property of type " + prop.getPropertyType() + " on " + prop.getName());
+            value = null;
+         }
+
+         if (value != null && prop.getWriteMethod() != null && prop.getReadMethod() == null)
+         {
+            System.out.println("WriteOnly property " + prop.getName() + " on " + pojo.getClass());
+         }
+         else if (value != null & prop.getWriteMethod() != null &&
+                 prop.getReadMethod() != null &&
+                 !ignoreSet.contains(prop.getName()))
+         {
+            System.out.println("Validating " + prop.getName() + " type = " + prop.getPropertyType());
+            prop.getWriteMethod().invoke(pojo, value);
+
+            Assert.assertEquals("Property " + prop.getName(), value, prop.getReadMethod().invoke(pojo));
+         }
+      }
+   }
+
+   /**
+    * @param queue
+    * @throws InterruptedException
+    */
+   protected void waitForNotPaging(Queue queue) throws InterruptedException
+   {
+      waitForNotPaging(queue.getPageSubscription().getPagingStore());
+   }
+
+   protected void waitForNotPaging(PagingStore store) throws InterruptedException
+   {
+      long timeout = System.currentTimeMillis() + 10000;
+      while (timeout > System.currentTimeMillis() && store.isPaging())
+      {
+         Thread.sleep(100);
+      }
+      assertFalse(store.isPaging());
+   }
+
+   protected Topology waitForTopology(final ActiveMQServer server, final int nodes) throws Exception
+   {
+      return waitForTopology(server, nodes, -1, WAIT_TIMEOUT);
+   }
+
+   protected Topology waitForTopology(final ActiveMQServer server, final int nodes, final int backups) throws Exception
+   {
+      return waitForTopology(server, nodes, backups, WAIT_TIMEOUT);
+   }
+
+   protected Topology waitForTopology(final ActiveMQServer server, final int liveNodes, final int backupNodes, final long timeout) throws Exception
+   {
+      ActiveMQServerLogger.LOGGER.debug("waiting for " + liveNodes + " on the topology for server = " + server);
+
+      long start = System.currentTimeMillis();
+
+      Set<ClusterConnection> ccs = server.getClusterManager().getClusterConnections();
+
+      if (ccs.size() != 1)
+      {
+         throw new IllegalStateException("You need a single cluster connection on this version of waitForTopology on ServiceTestBase");
+      }
+
+      Topology topology = server.getClusterManager().getDefaultConnection(null).getTopology();
+
+      int liveNodesCount = 0;
+
+      int backupNodesCount = 0;
+
+
+      do
+      {
+         liveNodesCount = 0;
+         backupNodesCount = 0;
+
+         for (TopologyMemberImpl member : topology.getMembers())
+         {
+            if (member.getLive() != null)
+            {
+               liveNodesCount++;
+            }
+            if (member.getBackup() != null)
+            {
+               backupNodesCount++;
+            }
+         }
+
+         if ((liveNodes == -1 || liveNodes == liveNodesCount) && (backupNodes == -1 || backupNodes == backupNodesCount))
+         {
+            return topology;
+         }
+
+         Thread.sleep(10);
+      }
+      while (System.currentTimeMillis() - start < timeout);
+
+      String msg = "Timed out waiting for cluster topology of live=" + liveNodes + ",backup=" + backupNodes +
+         " (received live=" + liveNodesCount + ", backup=" + backupNodesCount +
+         ") topology = " +
+         topology.describe() +
+         ")";
+
+      ActiveMQServerLogger.LOGGER.error(msg);
+
+      throw new Exception(msg);
+   }
+
+
+   protected void waitForTopology(final ActiveMQServer server, String clusterConnectionName, final int nodes, final long timeout) throws Exception
+   {
+      ActiveMQServerLogger.LOGGER.debug("waiting for " + nodes + " on the topology for server = " + server);
+
+      long start = System.currentTimeMillis();
+
+      ClusterConnection clusterConnection = server.getClusterManager().getClusterConnection(clusterConnectionName);
+
+
+      Topology topology = clusterConnection.getTopology();
+
+      do
+      {
+         if (nodes == topology.getMembers().size())
+         {
+            return;
+         }
+
+         Thread.sleep(10);
+      }
+      while (System.currentTimeMillis() - start < timeout);
+
+      String msg = "Timed out waiting for cluster topology of " + nodes +
+         " (received " +
+         topology.getMembers().size() +
+         ") topology = " +
+         topology +
+         ")";
+
+      ActiveMQServerLogger.LOGGER.error(msg);
+
+      throw new Exception(msg);
+   }
+
+   protected static final void waitForComponent(final ActiveMQComponent component, final long seconds) throws InterruptedException
+   {
+      long time = System.currentTimeMillis();
+      long toWait = seconds * 1000;
+      while (!component.isStarted())
+      {
+         Thread.sleep(50);
+         if (System.currentTimeMillis() > (time + toWait))
+         {
+            fail("component did not start within timeout of " + seconds);
+         }
+      }
+   }
+
+   protected static final Map<String, Object> generateParams(final int node, final boolean netty)
+   {
+      Map<String, Object> params = new HashMap<String, Object>();
+
+      if (netty)
+      {
+         params.put(org.apache.activemq.artemis.core.remoting.impl.netty.TransportConstants.PORT_PROP_NAME,
+                    org.apache.activemq.artemis.core.remoting.impl.netty.TransportConstants.DEFAULT_PORT + node);
+      }
+      else
+      {
+         params.put(org.apache.activemq.artemis.core.remoting.impl.invm.TransportConstants.SERVER_ID_PROP_NAME, node);
+      }
+
+      return params;
+   }
+
+   protected static final TransportConfiguration getNettyAcceptorTransportConfiguration(final boolean live)
+   {
+      if (live)
+      {
+         return new TransportConfiguration(NETTY_ACCEPTOR_FACTORY);
+      }
+
+      Map<String, Object> server1Params = new HashMap<String, Object>();
+
+      server1Params.put(org.apache.activemq.artemis.core.remoting.impl.netty.TransportConstants.PORT_PROP_NAME,
+                        org.apache.activemq.artemis.core.remoting.impl.netty.TransportConstants.DEFAULT_PORT + 1);
+
+      return new TransportConfiguration(NETTY_ACCEPTOR_FACTORY, server1Params);
+   }
+
+   protected static final TransportConfiguration getNettyConnectorTransportConfiguration(final boolean live)
+   {
+      if (live)
+      {
+         return new TransportConfiguration(NETTY_CONNECTOR_FACTORY);
+      }
+
+      Map<String, Object> server1Params = new HashMap<String, Object>();
+
+      server1Params.put(org.apache.activemq.artemis.core.remoting.impl.netty.TransportConstants.PORT_PROP_NAME,
+                        org.apache.activemq.artemis.core.remoting.impl.netty.TransportConstants.DEFAULT_PORT + 1);
+      return new TransportConfiguration(NETTY_CONNECTOR_FACTORY, server1Params);
+   }
+
+   protected static final TransportConfiguration createTransportConfiguration(boolean netty, boolean acceptor,
+                                                                              Map<String, Object> params)
+   {
+      String className;
+      if (netty)
+      {
+         if (acceptor)
+         {
+            className = NETTY_ACCEPTOR_FACTORY;
+         }
+         else
+         {
+            className = NETTY_CONNECTOR_FACTORY;
+         }
+      }
+      else
+      {
+         if (acceptor)
+         {
+            className = INVM_ACCEPTOR_FACTORY;
+         }
+         else
+         {
+            className = INVM_CONNECTOR_FACTORY;
+         }
+      }
+      if (params == null)
+         params = new HashMap<String, Object>();
+      return new TransportConfiguration(className, params);
+   }
+
+
+   protected void waitForServer(ActiveMQServer server) throws InterruptedException
+   {
+      if (server == null)
+         return;
+      final long wait = 5000;
+      long timetowait = System.currentTimeMillis() + wait;
+      while (!server.isStarted() && System.currentTimeMillis() < timetowait)
+      {
+         Thread.sleep(50);
+      }
+
+      if (!server.isStarted())
+      {
+         log.info(threadDump("Server didn't start"));
+         fail("server didn't start: " + server);
+      }
+
+      if (!server.getHAPolicy().isBackup())
+      {
+         if (!server.waitForActivation(wait, TimeUnit.MILLISECONDS))
+            fail("Server didn't initialize: " + server);
+      }
+   }
+
+   protected void waitForServerToStop(ActiveMQServer server) throws InterruptedException
+   {
+      if (server == null)
+         return;
+      final long wait = 5000;
+      long timetowait = System.currentTimeMillis() + wait;
+      while (server.isStarted() && System.currentTimeMillis() < timetowait)
+      {
+         Thread.sleep(50);
+      }
+
+      if (server.isStarted())
+      {
+         log.info(threadDump("Server didn't start"));
+         fail("server didnt start: " + server);
+      }
+   }
+
+   /**
+    * @param backup
+    */
+   public static final void waitForRemoteBackupSynchronization(final ActiveMQServer backup)
+   {
+      waitForRemoteBackup(null, 10, true, backup);
+   }
+
+   /**
+    * @param sessionFactoryP
+    * @param seconds
+    * @param waitForSync
+    * @param backup
+    */
+   public static final void waitForRemoteBackup(ClientSessionFactory sessionFactoryP, int seconds,
+                                                boolean waitForSync, final ActiveMQServer backup)
+   {
+      ClientSessionFactoryInternal sessionFactory = (ClientSessionFactoryInternal)sessionFactoryP;
+      final ActiveMQServerImpl actualServer = (ActiveMQServerImpl) backup;
+      final long toWait = seconds * 1000;
+      final long time = System.currentTimeMillis();
+      int loop = 0;
+      while (true)
+      {
+         Activation activation = actualServer.getActivation();
+         boolean isReplicated = !backup.getHAPolicy().isSharedStore();
+         boolean isRemoteUpToDate = true;
+         if (isReplicated)
+         {
+            if (activation instanceof SharedNothingBackupActivation)
+            {
+               isRemoteUpToDate = ((SharedNothingBackupActivation) activation).isRemoteBackupUpToDate();
+            }
+            else
+            {
+               //we may have already failed over and changed the Activation
+               if (actualServer.isStarted())
+               {
+                  //let it fail a few time to have time to start stopping in the case of waiting to failback
+                  isRemoteUpToDate = loop++ > 10;
+               }
+               //we could be waiting to failback or restart if the server is stopping
+               else
+               {
+                  isRemoteUpToDate = false;
+               }
+            }
+         }
+         if ((sessionFactory == null || sessionFactory.getBackupConnector() != null) &&
+               (isRemoteUpToDate || !waitForSync) &&
+            (!waitForSync || actualServer.getBackupManager() != null && actualServer.getBackupManager().isBackupAnnounced()))
+         {
+            break;
+         }
+         if (System.currentTimeMillis() > (time + toWait))
+         {
+            fail("backup started? (" + actualServer.isStarted() + "). Finished synchronizing (" +
+                  (activation) + "). SessionFactory!=null ? " + (sessionFactory != null) +
+                    " || sessionFactory.getBackupConnector()==" +
+                    (sessionFactory != null ? sessionFactory.getBackupConnector() : "not-applicable"));
+         }
+         try
+         {
+            Thread.sleep(100);
+         }
+         catch (InterruptedException e)
+         {
+            fail(e.getMessage());
+         }
+      }
+   }
+
+   public static final void waitForRemoteBackup(ClientSessionFactory sessionFactory, int seconds)
+   {
+      ClientSessionFactoryInternal factoryInternal = (ClientSessionFactoryInternal) sessionFactory;
+      final long toWait = seconds * 1000;
+      final long time = System.currentTimeMillis();
+      while (true)
+      {
+         if (factoryInternal.getBackupConnector() != null)
+         {
+            break;
+         }
+         if (System.currentTimeMillis() > (time + toWait))
+         {
+            fail("Backup wasn't located");
+         }
+         try
+         {
+            Thread.sleep(100);
+         }
+         catch (InterruptedException e)
+         {
+            fail(e.getMessage());
+         }
+      }
+   }
+
+   protected final ActiveMQServer createServer(final boolean realFiles,
+                                              final Configuration configuration,
+                                              final long pageSize,
+                                              final long maxAddressSize,
+                                              final Map<String, AddressSettings> settings)
+   {
+
+      ActiveMQServer server = addServer(ActiveMQServers.newActiveMQServer(configuration, realFiles));
+      if (settings != null)
+      {
+         for (Map.Entry<String, AddressSettings> setting : settings.entrySet())
+         {
+            server.getAddressSettingsRepository().addMatch(setting.getKey(), setting.getValue());
+         }
+      }
+
+      AddressSettings defaultSetting = new AddressSettings();
+      defaultSetting.setPageSizeBytes(pageSize);
+      defaultSetting.setMaxSizeBytes(maxAddressSize);
+      defaultSetting.setAddressFullMessagePolicy(AddressFullMessagePolicy.PAGE);
+
+      server.getAddressSettingsRepository().addMatch("#", defaultSetting);
+
+      return server;
+   }
+
+   protected final ActiveMQServer createServer(final boolean realFiles) throws Exception
+   {
+      return createServer(realFiles, false);
+   }
+
+   protected final ActiveMQServer createServer(final boolean realFiles, final boolean netty) throws Exception
+   {
+      return createServer(realFiles, createDefaultConfig(netty), AddressSettings.DEFAULT_PAGE_SIZE, AddressSettings.DEFAULT_MAX_SIZE_BYTES, new HashMap<String, AddressSettings>());
+   }
+
+   protected ActiveMQServer createServer(final boolean realFiles, final Configuration configuration)
+   {
+      return createServer(realFiles, configuration, AddressSettings.DEFAULT_PAGE_SIZE, AddressSettings.DEFAULT_MAX_SIZE_BYTES, new HashMap<String, AddressSettings>());
+   }
+
+   protected final ActiveMQServer createServer(final Configuration configuration)
+   {
+      return createServer(configuration.isPersistenceEnabled(), configuration, AddressSettings.DEFAULT_PAGE_SIZE, AddressSettings.DEFAULT_MAX_SIZE_BYTES, new HashMap<String, AddressSettings>());
+   }
+
+   protected ActiveMQServer createInVMFailoverServer(final boolean realFiles,
+                                                    final Configuration configuration,
+                                                    final NodeManager nodeManager,
+                                                    final int id)
+   {
       return createInVMFailoverServer(realFiles,
                                       configuration,
                                       -1,
@@ -616,648 +1599,1401 @@ public abstract class ServiceTestBase extends UnitTestCase
                                       id);
    }
 
-   protected ActiveMQServer createInVMFailoverServer(final boolean realFiles,
-                                                    final Configuration configuration,
-                                                    final int pageSize,
-                                                    final int maxAddressSize,
-                                                    final Map<String, AddressSettings> settings,
-                                                    NodeManager nodeManager,
-                                                    final int id)
+   protected ActiveMQServer createInVMFailoverServer(final boolean realFiles,
+                                                    final Configuration configuration,
+                                                    final int pageSize,
+                                                    final int maxAddressSize,
+                                                    final Map<String, AddressSettings> settings,
+                                                    NodeManager nodeManager,
+                                                    final int id)
+   {
+      ActiveMQServer server;
+      ActiveMQSecurityManager securityManager = new ActiveMQSecurityManagerImpl();
+      configuration.setPersistenceEnabled(realFiles);
+      server = new InVMNodeManagerServer(configuration,
+                                         ManagementFactory.getPlatformMBeanServer(),
+                                         securityManager,
+                                         nodeManager);
+
+      try
+      {
+         server.setIdentity("Server " + id);
+
+         for (Map.Entry<String, AddressSettings> setting : settings.entrySet())
+         {
+            server.getAddressSettingsRepository().addMatch(setting.getKey(), setting.getValue());
+         }
+
+         AddressSettings defaultSetting = new AddressSettings();
+         defaultSetting.setPageSizeBytes(pageSize);
+         defaultSetting.setMaxSizeBytes(maxAddressSize);
+
+         server.getAddressSettingsRepository().addMatch("#", defaultSetting);
+
+         return server;
+      }
+      finally
+      {
+         addServer(server);
+      }
+   }
+
+   protected ActiveMQServer createColocatedInVMFailoverServer(final boolean realFiles,
+                                                    final Configuration configuration,
+                                                    NodeManager liveNodeManager,
+                                                    NodeManager backupNodeManager,
+                                                    final int id)
+   {
+      return createColocatedInVMFailoverServer(realFiles,
+            configuration,
+            -1,
+            -1,
+            new HashMap<String, AddressSettings>(),
+            liveNodeManager,
+            backupNodeManager,
+            id);
+   }
+
+   protected ActiveMQServer createColocatedInVMFailoverServer(final boolean realFiles,
+                                                    final Configuration configuration,
+                                                    final int pageSize,
+                                                    final int maxAddressSize,
+                                                    final Map<String, AddressSettings> settings,
+                                                    NodeManager liveNodeManager,
+                                                    NodeManager backupNodeManager,
+                                                    final int id)
+   {
+      ActiveMQServer server;
+      ActiveMQSecurityManager securityManager = new ActiveMQSecurityManagerImpl();
+      configuration.setPersistenceEnabled(realFiles);
+      server = new ColocatedActiveMQServer(configuration,
+            ManagementFactory.getPlatformMBeanServer(),
+            securityManager,
+            liveNodeManager,
+            backupNodeManager);
+
+      try
+      {
+         server.setIdentity("Server " + id);
+
+         for (Map.Entry<String, AddressSettings> setting : settings.entrySet())
+         {
+            server.getAddressSettingsRepository().addMatch(setting.getKey(), setting.getValue());
+         }
+
+         AddressSettings defaultSetting = new AddressSettings();
+         defaultSetting.setPageSizeBytes(pageSize);
+         defaultSetting.setMaxSizeBytes(maxAddressSize);
+
+         server.getAddressSettingsRepository().addMatch("#", defaultSetting);
+
+         return server;
+      }
+      finally
+      {
+         addServer(server);
+      }
+   }
+
+   protected ActiveMQServer createClusteredServerWithParams(final boolean isNetty,
+                                                           final int index,
+                                                           final boolean realFiles,
+                                                           final Map<String, Object> params) throws Exception
+   {
+      String acceptor = isNetty ? NETTY_ACCEPTOR_FACTORY : INVM_ACCEPTOR_FACTORY;
+      return createServer(realFiles, createDefaultConfig(index, params, acceptor), -1, -1,
+                          new HashMap<String, AddressSettings>());
+   }
+
+   protected ActiveMQServer createClusteredServerWithParams(final boolean isNetty,
+                                                           final int index,
+                                                           final boolean realFiles,
+                                                           final int pageSize,
+                                                           final int maxAddressSize,
+                                                           final Map<String, Object> params) throws Exception
+   {
+      return createServer(realFiles, createDefaultConfig(index, params, (isNetty ? NETTY_ACCEPTOR_FACTORY : INVM_ACCEPTOR_FACTORY)),
+                          pageSize,
+                          maxAddressSize,
+                          new HashMap<String, AddressSettings>());
+   }
+
+   protected ServerLocator createFactory(final boolean isNetty) throws Exception
+   {
+      if (isNetty)
+      {
+         return createNettyNonHALocator();
+      }
+      else
+      {
+         return createInVMNonHALocator();
+      }
+   }
+
+   protected void createQueue(final String address, final String queue) throws Exception
+   {
+      ServerLocator locator = createInVMNonHALocator();
+      ClientSessionFactory sf = locator.createSessionFactory();
+      ClientSession session = sf.createSession();
+      try
+      {
+         session.createQueue(address, queue);
+      }
+      finally
+      {
+         session.close();
+         closeSessionFactory(sf);
+         closeServerLocator(locator);
+      }
+   }
+
+   protected final ServerLocator createInVMLocator(final int serverID)
+   {
+      TransportConfiguration tnspConfig = createInVMTransportConnectorConfig(serverID, UUIDGenerator.getInstance().generateStringUUID());
+
+      ServerLocator locator = ActiveMQClient.createServerLocatorWithHA(tnspConfig);
+      return addServerLocator(locator);
+   }
+
+   /**
+    * @param serverID
+    * @return
+    */
+   protected final TransportConfiguration createInVMTransportConnectorConfig(final int serverID, String name1)
+   {
+      Map<String, Object> server1Params = new HashMap<String, Object>();
+
+      if (serverID != 0)
+      {
+         server1Params.put(TransportConstants.SERVER_ID_PROP_NAME, serverID);
+      }
+
+      TransportConfiguration tnspConfig = new TransportConfiguration(INVM_CONNECTOR_FACTORY, server1Params, name1);
+      return tnspConfig;
+   }
+
+   public String getTextMessage(final ClientMessage m)
+   {
+      m.getBodyBuffer().resetReaderIndex();
+      return m.getBodyBuffer().readString();
+   }
+
+   protected ClientMessage createBytesMessage(final ClientSession session,
+                                              final byte type,
+                                              final byte[] b,
+                                              final boolean durable)
+   {
+      ClientMessage message = session.createMessage(type, durable, 0, System.currentTimeMillis(), (byte) 1);
+      message.getBodyBuffer().writeBytes(b);
+      return message;
+   }
+
+   /**
+    * @param i
+    * @param message
+    * @throws Exception
+    */
+   protected void setBody(final int i, final ClientMessage message)
+   {
+      message.getBodyBuffer().writeString("message" + i);
+   }
+
+   /**
+    * @param i
+    * @param message
+    */
+   protected void assertMessageBody(final int i, final ClientMessage message)
+   {
+      Assert.assertEquals(message.toString(), "message" + i, message.getBodyBuffer().readString());
+   }
+
+   /**
+    * Send durable messages with pre-specified body.
+    *
+    * @param session
+    * @param producer
+    * @param numMessages
+    * @throws Exception
+    */
+   public final void sendMessages(ClientSession session, ClientProducer producer, int numMessages) throws ActiveMQException
+   {
+      for (int i = 0; i < numMessages; i++)
+      {
+         producer.send(createMessage(session, i, true));
+      }
+   }
+
+   protected final ClientMessage createMessage(ClientSession session, int counter, boolean durable) throws ActiveMQException
+   {
+      ClientMessage message = session.createMessage(durable);
+      setBody(counter, message);
+      message.putIntProperty("counter", counter);
+      message.putIntProperty(SEND_CALL_NUMBER, sendMsgCount++);
+      return message;
+   }
+
+   protected final void receiveMessages(ClientConsumer consumer, final int start, final int msgCount, final boolean ack) throws ActiveMQException
+   {
+      for (int i = start; i < msgCount; i++)
+      {
+         ClientMessage message = consumer.receive(1000);
+         Assert.assertNotNull("Expecting a message " + i, message);
+         // sendCallNumber is just a debugging measure.
+         Object prop = message.getObjectProperty(SEND_CALL_NUMBER);
+         if (prop == null)
+            prop = Integer.valueOf(-1);
+         final int actual = message.getIntProperty("counter").intValue();
+         Assert.assertEquals("expected=" + i + ". Got: property['counter']=" + actual + " sendNumber=" + prop, i,
+                             actual);
+         assertMessageBody(i, message);
+         if (ack)
+            message.acknowledge();
+      }
+   }
+
+   /**
+    * Reads a journal system and returns a Map<Integer,AtomicInteger> of recordTypes and the number of records per type,
+    * independent of being deleted or not
+    *
+    * @param config
+    * @return
+    * @throws Exception
+    */
+   protected Pair<List<RecordInfo>, List<PreparedTransactionInfo>> loadMessageJournal(Configuration config) throws Exception
+   {
+      JournalImpl messagesJournal = null;
+      try
+      {
+         SequentialFileFactory messagesFF = new NIOSequentialFileFactory(getJournalDir(), null);
+
+         messagesJournal = new JournalImpl(config.getJournalFileSize(),
+                                           config.getJournalMinFiles(),
+                                           0,
+                                           0,
+                                           messagesFF,
+                                           "activemq-data",
+                                           "amq",
+                                           1);
+         final List<RecordInfo> committedRecords = new LinkedList<RecordInfo>();
+         final List<PreparedTransactionInfo> preparedTransactions = new LinkedList<PreparedTransactionInfo>();
+
+         messagesJournal.start();
+
+         messagesJournal.load(committedRecords, preparedTransactions, null, false);
+
+         return new Pair<List<RecordInfo>, List<PreparedTransactionInfo>>(committedRecords, preparedTransactions);
+      }
+      finally
+      {
+         try
+         {
+            if (messagesJournal != null)
+            {
+               messagesJournal.stop();
+            }
+         }
+         catch (Throwable ignored)
+         {
+         }
+      }
+
+   }
+
+   /**
+    * Reads a journal system and returns a Map<Integer,AtomicInteger> of recordTypes and the number of records per type,
+    * independent of being deleted or not
+    *
+    * @param config
+    * @return
+    * @throws Exception
+    */
+   protected HashMap<Integer, AtomicInteger> countJournal(Configuration config) throws Exception
+   {
+      final HashMap<Integer, AtomicInteger> recordsType = new HashMap<Integer, AtomicInteger>();
+      SequentialFileFactory messagesFF = new NIOSequentialFileFactory(config.getJournalDirectory(), null);
+
+      JournalImpl messagesJournal = new JournalImpl(config.getJournalFileSize(),
+                                                    config.getJournalMinFiles(),
+                                                    0,
+                                                    0,
+                                                    messagesFF,
+                                                    "activemq-data",
+                                                    "amq",
+                                                    1);
+      List<JournalFile> filesToRead = messagesJournal.orderFiles();
+
+      for (JournalFile file : filesToRead)
+      {
+         JournalImpl.readJournalFile(messagesFF, file, new RecordTypeCounter(recordsType));
+      }
+      return recordsType;
+   }
+
+   /**
+    * This method will load a journal and count the living records
+    *
+    * @param config
+    * @return
+    * @throws Exception
+    */
+   protected HashMap<Integer, AtomicInteger> countJournalLivingRecords(Configuration config) throws Exception
+   {
+      return internalCountJournalLivingRecords(config, true);
+   }
+
+   /**
+    * This method will load a journal and count the living records
+    *
+    * @param config
+    * @param messageJournal if true -> MessageJournal, false -> BindingsJournal
+    * @return
+    * @throws Exception
+    */
+   protected HashMap<Integer, AtomicInteger> internalCountJournalLivingRecords(Configuration config, boolean messageJournal) throws Exception
+   {
+      final HashMap<Integer, AtomicInteger> recordsType = new HashMap<Integer, AtomicInteger>();
+      SequentialFileFactory ff;
+
+      JournalImpl journal;
+
+      if (messageJournal)
+      {
+         ff = new NIOSequentialFileFactory(getJournalDir(), null);
+         journal = new JournalImpl(config.getJournalFileSize(),
+                                   config.getJournalMinFiles(),
+                                   0,
+                                   0,
+                                   ff,
+                                   "activemq-data",
+                                   "amq",
+                                   1);
+      }
+      else
+      {
+         ff = new NIOSequentialFileFactory(getBindingsDir(), null);
+         journal = new JournalImpl(1024 * 1024,
+                                   2,
+                                   config.getJournalCompactMinFiles(),
+                                   config.getJournalCompactPercentage(),
+                                   ff,
+                                   "activemq-bindings",
+                                   "bindings",
+                                   1);
+      }
+      journal.start();
+
+
+      final List<RecordInfo> committedRecords = new LinkedList<RecordInfo>();
+      final List<PreparedTransactionInfo> preparedTransactions = new LinkedList<PreparedTransactionInfo>();
+
+
+      journal.load(committedRecords, preparedTransactions, null, false);
+
+      for (RecordInfo info : committedRecords)
+      {
+         Integer ikey = new Integer(info.getUserRecordType());
+         AtomicInteger value = recordsType.get(ikey);
+         if (value == null)
+         {
+            value = new AtomicInteger();
+            recordsType.put(ikey, value);
+         }
+         value.incrementAndGet();
+
+      }
+
+      journal.stop();
+      return recordsType;
+   }
+
+   private static final class RecordTypeCounter implements JournalReaderCallback
+   {
+      private final HashMap<Integer, AtomicInteger> recordsType;
+
+      /**
+       * @param recordsType
+       */
+      public RecordTypeCounter(HashMap<Integer, AtomicInteger> recordsType)
+      {
+         this.recordsType = recordsType;
+      }
+
+      AtomicInteger getType(byte key)
+      {
+         if (key == 0)
+         {
+            System.out.println("huh?");
+         }
+         Integer ikey = new Integer(key);
+         AtomicInteger value = recordsType.get(ikey);
+         if (value == null)
+         {
+            value = new AtomicInteger();
+            recordsType.put(ikey, value);
+         }
+         return value;
+      }
+
+      public void onReadUpdateRecordTX(long transactionID, RecordInfo recordInfo) throws Exception
+      {
+         getType(recordInfo.getUserRecordType()).incrementAndGet();
+      }
+
+      public void onReadUpdateRecord(RecordInfo recordInfo) throws Exception
+      {
+         getType(recordInfo.getUserRecordType()).incrementAndGet();
+      }
+
+      public void onReadAddRecordTX(long transactionID, RecordInfo recordInfo) throws Exception
+      {
+         getType(recordInfo.getUserRecordType()).incrementAndGet();
+      }
+
+      public void onReadAddRecord(RecordInfo recordInfo) throws Exception
+      {
+         getType(recordInfo.getUserRecordType()).incrementAndGet();
+      }
+
+      public void onReadRollbackRecord(long transactionID) throws Exception
+      {
+      }
+
+      public void onReadPrepareRecord(long transactionID, byte[] extraData, int numberOfRecords) throws Exception
+      {
+      }
+
+      public void onReadDeleteRecordTX(long transactionID, RecordInfo recordInfo) throws Exception
+      {
+      }
+
+      public void onReadDeleteRecord(long recordID) throws Exception
+      {
+      }
+
+      public void onReadCommitRecord(long transactionID, int numberOfRecords) throws Exception
+      {
+      }
+
+      public void markAsDataFile(JournalFile file0)
+      {
+      }
+   }
+
+   /**
+    * @param server                the server where's being checked
+    * @param address               the name of the address being checked
+    * @param local                 if true we are looking for local bindings, false we are looking for remoting servers
+    * @param expect

<TRUNCATED>

[07/13] activemq-artemis git commit: Refactor base test classes

Posted by an...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/aerogear/AeroGearBasicServerTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/aerogear/AeroGearBasicServerTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/aerogear/AeroGearBasicServerTest.java
index ab37bb8..a755a6c 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/aerogear/AeroGearBasicServerTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/aerogear/AeroGearBasicServerTest.java
@@ -17,32 +17,23 @@
 package org.apache.activemq.artemis.tests.integration.aerogear;
 
 
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.TimeUnit;
-
 import org.apache.activemq.artemis.api.core.Message;
 import org.apache.activemq.artemis.api.core.TransportConfiguration;
+import org.apache.activemq.artemis.api.core.client.ActiveMQClient;
 import org.apache.activemq.artemis.api.core.client.ClientConsumer;
 import org.apache.activemq.artemis.api.core.client.ClientMessage;
 import org.apache.activemq.artemis.api.core.client.ClientProducer;
 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.SendAcknowledgementHandler;
 import org.apache.activemq.artemis.api.core.client.ServerLocator;
-import org.apache.activemq.artemis.tests.util.ServiceTestBase;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
 import org.apache.activemq.artemis.core.config.Configuration;
 import org.apache.activemq.artemis.core.config.ConnectorServiceConfiguration;
 import org.apache.activemq.artemis.core.config.CoreQueueConfiguration;
 import org.apache.activemq.artemis.core.server.ActiveMQServer;
 import org.apache.activemq.artemis.integration.aerogear.AeroGearConnectorServiceFactory;
 import org.apache.activemq.artemis.integration.aerogear.AeroGearConstants;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.apache.activemq.artemis.utils.json.JSONArray;
 import org.apache.activemq.artemis.utils.json.JSONException;
 import org.apache.activemq.artemis.utils.json.JSONObject;
@@ -54,6 +45,14 @@ import org.mortbay.jetty.Server;
 import org.mortbay.jetty.handler.AbstractHandler;
 import org.mortbay.jetty.nio.SelectChannelConnector;
 
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
+
 public class AeroGearBasicServerTest extends ServiceTestBase
 {
 
@@ -128,7 +127,7 @@ public class AeroGearBasicServerTest extends ServiceTestBase
       CountDownLatch latch = new CountDownLatch(1);
       AeroGearHandler aeroGearHandler = new AeroGearHandler(latch);
       jetty.addHandler(aeroGearHandler);
-      TransportConfiguration tpconf = new TransportConfiguration(UnitTestCase.INVM_CONNECTOR_FACTORY);
+      TransportConfiguration tpconf = new TransportConfiguration(INVM_CONNECTOR_FACTORY);
       locator = ActiveMQClient.createServerLocatorWithoutHA(tpconf);
       ClientSessionFactory sf = createSessionFactory(locator);
       ClientSession session = sf.createSession(false, true, true);
@@ -277,7 +276,7 @@ public class AeroGearBasicServerTest extends ServiceTestBase
          }
 
       });
-      TransportConfiguration tpconf = new TransportConfiguration(UnitTestCase.INVM_CONNECTOR_FACTORY);
+      TransportConfiguration tpconf = new TransportConfiguration(INVM_CONNECTOR_FACTORY);
       locator = ActiveMQClient.createServerLocatorWithoutHA(tpconf);
       ClientSessionFactory sf = createSessionFactory(locator);
       ClientSession session = sf.createSession(false, true, true);
@@ -331,7 +330,7 @@ public class AeroGearBasicServerTest extends ServiceTestBase
          }
 
       });
-      TransportConfiguration tpconf = new TransportConfiguration(UnitTestCase.INVM_CONNECTOR_FACTORY);
+      TransportConfiguration tpconf = new TransportConfiguration(INVM_CONNECTOR_FACTORY);
       locator = ActiveMQClient.createServerLocatorWithoutHA(tpconf);
       ClientSessionFactory sf = createSessionFactory(locator);
       ClientSession session = sf.createSession(false, true, true);
@@ -369,7 +368,7 @@ public class AeroGearBasicServerTest extends ServiceTestBase
          }
 
       });
-      TransportConfiguration tpconf = new TransportConfiguration(UnitTestCase.INVM_CONNECTOR_FACTORY);
+      TransportConfiguration tpconf = new TransportConfiguration(INVM_CONNECTOR_FACTORY);
       locator = ActiveMQClient.createServerLocatorWithoutHA(tpconf);
       ClientSessionFactory sf = createSessionFactory(locator);
       ClientSession session = sf.createSession(false, true, true);

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ActiveMQCrashTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ActiveMQCrashTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ActiveMQCrashTest.java
index e95b5e5..018d694 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ActiveMQCrashTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ActiveMQCrashTest.java
@@ -15,13 +15,8 @@
  * limitations under the License.
  */
 package org.apache.activemq.artemis.tests.integration.client;
-import org.apache.activemq.artemis.api.core.ActiveMQException;
-import org.junit.Before;
-
-import org.junit.Test;
-
-import org.junit.Assert;
 
+import org.apache.activemq.artemis.api.core.ActiveMQException;
 import org.apache.activemq.artemis.api.core.Interceptor;
 import org.apache.activemq.artemis.api.core.Message;
 import org.apache.activemq.artemis.api.core.TransportConfiguration;
@@ -29,7 +24,6 @@ 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.SendAcknowledgementHandler;
 import org.apache.activemq.artemis.api.core.client.ServerLocator;
 import org.apache.activemq.artemis.core.config.Configuration;
@@ -41,14 +35,16 @@ import org.apache.activemq.artemis.core.server.ActiveMQServers;
 import org.apache.activemq.artemis.spi.core.protocol.RemotingConnection;
 import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger;
 import org.apache.activemq.artemis.tests.util.ServiceTestBase;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
 
 /**
  *
  * From https://jira.jboss.org/jira/browse/HORNETQ-144
  *
  */
-public class ActiveMQCrashTest extends UnitTestCase
+public class ActiveMQCrashTest extends ServiceTestBase
 {
    private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER;
 
@@ -156,7 +152,6 @@ public class ActiveMQCrashTest extends UnitTestCase
    public void setUp() throws Exception
    {
       super.setUp();
-      locator = ActiveMQClient.createServerLocatorWithoutHA(new TransportConfiguration(ServiceTestBase.INVM_CONNECTOR_FACTORY));
-      addServerLocator(locator);
+      locator = createInVMNonHALocator();
    }
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ConcurrentCreateDeleteProduceTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ConcurrentCreateDeleteProduceTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ConcurrentCreateDeleteProduceTest.java
index 3f2d947..59ea460 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ConcurrentCreateDeleteProduceTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ConcurrentCreateDeleteProduceTest.java
@@ -62,7 +62,7 @@ public class ConcurrentCreateDeleteProduceTest extends ServiceTestBase
    {
       super.setUp();
 
-      Configuration config = createDefaultConfig(false)
+      Configuration config = createDefaultConfig()
          .setJournalSyncNonTransactional(false)
          .setJournalSyncTransactional(false);
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ConsumerCloseTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ConsumerCloseTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ConsumerCloseTest.java
index 3fa49e7..cba7278 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ConsumerCloseTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ConsumerCloseTest.java
@@ -16,9 +16,6 @@
  */
 package org.apache.activemq.artemis.tests.integration.client;
 
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.TimeUnit;
-
 import org.apache.activemq.artemis.api.core.ActiveMQException;
 import org.apache.activemq.artemis.api.core.ActiveMQExceptionType;
 import org.apache.activemq.artemis.api.core.SimpleString;
@@ -28,10 +25,8 @@ 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.MessageHandler;
 import org.apache.activemq.artemis.api.core.client.ServerLocator;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
 import org.apache.activemq.artemis.core.client.impl.ClientConsumerImpl;
 import org.apache.activemq.artemis.core.config.Configuration;
 import org.apache.activemq.artemis.core.remoting.impl.invm.InVMAcceptorFactory;
@@ -44,6 +39,9 @@ import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
 
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
+
 public class ConsumerCloseTest extends ServiceTestBase
 {
 
@@ -72,7 +70,7 @@ public class ConsumerCloseTest extends ServiceTestBase
 
       Assert.assertTrue(consumer.isClosed());
 
-      UnitTestCase.expectActiveMQException(ActiveMQExceptionType.OBJECT_CLOSED, new ActiveMQAction()
+      expectActiveMQException(ActiveMQExceptionType.OBJECT_CLOSED, new ActiveMQAction()
       {
          public void run() throws ActiveMQException
          {
@@ -80,7 +78,7 @@ public class ConsumerCloseTest extends ServiceTestBase
          }
       });
 
-      UnitTestCase.expectActiveMQException(ActiveMQExceptionType.OBJECT_CLOSED, new ActiveMQAction()
+      expectActiveMQException(ActiveMQExceptionType.OBJECT_CLOSED, new ActiveMQAction()
       {
          public void run() throws ActiveMQException
          {
@@ -88,7 +86,7 @@ public class ConsumerCloseTest extends ServiceTestBase
          }
       });
 
-      UnitTestCase.expectActiveMQException(ActiveMQExceptionType.OBJECT_CLOSED, new ActiveMQAction()
+      expectActiveMQException(ActiveMQExceptionType.OBJECT_CLOSED, new ActiveMQAction()
       {
          public void run() throws ActiveMQException
          {
@@ -314,9 +312,7 @@ public class ConsumerCloseTest extends ServiceTestBase
       address = RandomUtil.randomSimpleString();
       queue = RandomUtil.randomSimpleString();
 
-      locator =
-         addServerLocator(ActiveMQClient.createServerLocatorWithoutHA(new TransportConfiguration(
-            ServiceTestBase.INVM_CONNECTOR_FACTORY)));
+      locator = createInVMNonHALocator();
 
       sf = createSessionFactory(locator);
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ConsumerStuckTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ConsumerStuckTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ConsumerStuckTest.java
index 62be9c0..0246b6b 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ConsumerStuckTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ConsumerStuckTest.java
@@ -17,19 +17,17 @@
 package org.apache.activemq.artemis.tests.integration.client;
 
 import org.apache.activemq.artemis.api.core.SimpleString;
-import org.apache.activemq.artemis.api.core.TransportConfiguration;
 import org.apache.activemq.artemis.api.core.client.ClientConsumer;
 import org.apache.activemq.artemis.api.core.client.ClientMessage;
 import org.apache.activemq.artemis.api.core.client.ClientProducer;
 import org.apache.activemq.artemis.api.core.client.ClientSession;
 import org.apache.activemq.artemis.api.core.client.ClientSessionFactory;
-import org.apache.activemq.artemis.api.core.client.ActiveMQClient;
 import org.apache.activemq.artemis.api.core.client.ServerLocator;
-import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.apache.activemq.artemis.core.client.impl.ClientSessionFactoryImpl;
 import org.apache.activemq.artemis.core.protocol.core.impl.RemotingConnectionImpl;
 import org.apache.activemq.artemis.core.remoting.impl.netty.NettyConnection;
 import org.apache.activemq.artemis.core.server.ActiveMQServer;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.junit.Before;
 import org.junit.Test;
 
@@ -59,7 +57,7 @@ public class ConsumerStuckTest extends ServiceTestBase
    public void testClientStuckTest() throws Exception
    {
 
-      ServerLocator locator = ActiveMQClient.createServerLocatorWithoutHA(new TransportConfiguration(NETTY_CONNECTOR_FACTORY));
+      ServerLocator locator = createNettyNonHALocator();
       locator.setConnectionTTL(1000);
       locator.setClientFailureCheckPeriod(100);
       locator.setConsumerWindowSize(10 * 1024 * 1024);
@@ -170,7 +168,7 @@ public class ConsumerStuckTest extends ServiceTestBase
    public void testClientStuckTestWithDirectDelivery() throws Exception
    {
 
-      ServerLocator locator = ActiveMQClient.createServerLocatorWithoutHA(new TransportConfiguration(NETTY_CONNECTOR_FACTORY));
+      ServerLocator locator = createNettyNonHALocator();
       locator.setConnectionTTL(1000);
       locator.setClientFailureCheckPeriod(100);
       locator.setConsumerWindowSize(10 * 1024 * 1024);
@@ -228,7 +226,7 @@ public class ConsumerStuckTest extends ServiceTestBase
          public void run()
          {
             try (
-               ServerLocator locator = ActiveMQClient.createServerLocatorWithoutHA(new TransportConfiguration(NETTY_CONNECTOR_FACTORY));
+               ServerLocator locator = createNettyNonHALocator();
                ClientSessionFactory factory = locator.createSessionFactory();
                ClientSession session = factory.createSession(false, true, true, true);
                ClientProducer producer = session.createProducer(QUEUE);

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/DeadLetterAddressTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/DeadLetterAddressTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/DeadLetterAddressTest.java
index 2098148..0a253e3 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/DeadLetterAddressTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/DeadLetterAddressTest.java
@@ -15,27 +15,17 @@
  * limitations under the License.
  */
 package org.apache.activemq.artemis.tests.integration.client;
-import org.apache.activemq.artemis.api.core.ActiveMQException;
-import org.junit.Before;
-
-import org.junit.Test;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.TimeUnit;
-
-import org.junit.Assert;
 
+import org.apache.activemq.artemis.api.core.ActiveMQException;
 import org.apache.activemq.artemis.api.core.Message;
 import org.apache.activemq.artemis.api.core.SimpleString;
 import org.apache.activemq.artemis.api.core.TransportConfiguration;
+import org.apache.activemq.artemis.api.core.client.ActiveMQClient;
 import org.apache.activemq.artemis.api.core.client.ClientConsumer;
 import org.apache.activemq.artemis.api.core.client.ClientMessage;
 import org.apache.activemq.artemis.api.core.client.ClientProducer;
 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.MessageHandler;
 import org.apache.activemq.artemis.api.core.client.ServerLocator;
 import org.apache.activemq.artemis.core.config.Configuration;
@@ -46,7 +36,14 @@ 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.UnitTestCase;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
 
 public class DeadLetterAddressTest extends ServiceTestBase
 {
@@ -512,7 +509,7 @@ public class DeadLetterAddressTest extends ServiceTestBase
    public void setUp() throws Exception
    {
       super.setUp();
-      TransportConfiguration transportConfig = new TransportConfiguration(UnitTestCase.INVM_ACCEPTOR_FACTORY);
+      TransportConfiguration transportConfig = new TransportConfiguration(ServiceTestBase.INVM_ACCEPTOR_FACTORY);
 
       Configuration configuration = createDefaultConfig()
          .setSecurityEnabled(false)
@@ -523,7 +520,7 @@ public class DeadLetterAddressTest extends ServiceTestBase
       // then we create a client as normal
       locator =
                addServerLocator(ActiveMQClient.createServerLocatorWithoutHA(new TransportConfiguration(
-                  UnitTestCase.INVM_CONNECTOR_FACTORY)));
+                  INVM_CONNECTOR_FACTORY)));
       ClientSessionFactory sessionFactory = createSessionFactory(locator);
       clientSession = addClientSession(sessionFactory.createSession(false, true, false));
    }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ExpiryAddressTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ExpiryAddressTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ExpiryAddressTest.java
index 62b5383..409a6da 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ExpiryAddressTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ExpiryAddressTest.java
@@ -15,31 +15,28 @@
  * limitations under the License.
  */
 package org.apache.activemq.artemis.tests.integration.client;
-import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger;
-import org.apache.activemq.artemis.tests.util.ServiceTestBase;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
-import org.apache.activemq.artemis.core.message.impl.MessageImpl;
-import org.junit.Before;
-
-import org.junit.Test;
-
-import org.junit.Assert;
 
 import org.apache.activemq.artemis.api.core.Message;
 import org.apache.activemq.artemis.api.core.SimpleString;
 import org.apache.activemq.artemis.api.core.TransportConfiguration;
+import org.apache.activemq.artemis.api.core.client.ActiveMQClient;
 import org.apache.activemq.artemis.api.core.client.ClientConsumer;
 import org.apache.activemq.artemis.api.core.client.ClientMessage;
 import org.apache.activemq.artemis.api.core.client.ClientProducer;
 import org.apache.activemq.artemis.api.core.client.ClientSession;
 import org.apache.activemq.artemis.api.core.client.ClientSessionFactory;
-import org.apache.activemq.artemis.api.core.client.ActiveMQClient;
 import org.apache.activemq.artemis.api.core.client.ServerLocator;
 import org.apache.activemq.artemis.core.config.Configuration;
+import org.apache.activemq.artemis.core.message.impl.MessageImpl;
 import org.apache.activemq.artemis.core.server.ActiveMQServer;
 import org.apache.activemq.artemis.core.server.ActiveMQServers;
 import org.apache.activemq.artemis.core.settings.impl.AddressSettings;
+import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger;
 import org.apache.activemq.artemis.tests.util.RandomUtil;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
 
 public class ExpiryAddressTest extends ServiceTestBase
 {
@@ -236,7 +233,7 @@ public class ExpiryAddressTest extends ServiceTestBase
       clientSession.createQueue(qName, qName, null, false);
       ServerLocator locator1 =
                addServerLocator(ActiveMQClient.createServerLocatorWithoutHA(new TransportConfiguration(
-                  UnitTestCase.INVM_CONNECTOR_FACTORY)));
+                  INVM_CONNECTOR_FACTORY)));
 
       ClientSessionFactory sessionFactory = createSessionFactory(locator1);
 
@@ -388,7 +385,7 @@ public class ExpiryAddressTest extends ServiceTestBase
    public void setUp() throws Exception
    {
       super.setUp();
-      TransportConfiguration transportConfig = new TransportConfiguration(UnitTestCase.INVM_ACCEPTOR_FACTORY);
+      TransportConfiguration transportConfig = new TransportConfiguration(ServiceTestBase.INVM_ACCEPTOR_FACTORY);
 
       Configuration configuration = createDefaultConfig()
          .setSecurityEnabled(false)

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/HangConsumerTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/HangConsumerTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/HangConsumerTest.java
index 0a47c3a..dbac194 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/HangConsumerTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/HangConsumerTest.java
@@ -93,7 +93,7 @@ public class HangConsumerTest extends ServiceTestBase
    {
       super.setUp();
 
-      Configuration config = createDefaultConfig(false)
+      Configuration config = createDefaultConfig()
          .setMessageExpiryScanPeriod(10);
 
       ActiveMQSecurityManager securityManager = new ActiveMQSecurityManagerImpl();

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/HeuristicXATest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/HeuristicXATest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/HeuristicXATest.java
index 30095d3..389bf8d 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/HeuristicXATest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/HeuristicXATest.java
@@ -15,21 +15,6 @@
  * limitations under the License.
  */
 package org.apache.activemq.artemis.tests.integration.client;
-import org.apache.activemq.artemis.tests.integration.management.ManagementControlHelper;
-import org.apache.activemq.artemis.tests.util.ServiceTestBase;
-import org.junit.Before;
-import org.junit.After;
-
-import org.junit.Test;
-
-import java.util.HashMap;
-
-import javax.management.MBeanServer;
-import javax.management.MBeanServerFactory;
-import javax.transaction.xa.XAResource;
-import javax.transaction.xa.Xid;
-
-import org.junit.Assert;
 
 import org.apache.activemq.artemis.api.core.SimpleString;
 import org.apache.activemq.artemis.api.core.client.ClientConsumer;
@@ -42,8 +27,18 @@ import org.apache.activemq.artemis.api.core.management.ActiveMQServerControl;
 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.core.settings.impl.AddressSettings;
 import org.apache.activemq.artemis.core.transaction.impl.XidImpl;
+import org.apache.activemq.artemis.tests.integration.management.ManagementControlHelper;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
+import org.junit.After;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+import javax.management.MBeanServer;
+import javax.management.MBeanServerFactory;
+import javax.transaction.xa.XAResource;
+import javax.transaction.xa.Xid;
 
 public class HeuristicXATest extends ServiceTestBase
 {
@@ -70,7 +65,8 @@ public class HeuristicXATest extends ServiceTestBase
       Configuration configuration = createDefaultConfig()
          .setJMXManagementEnabled(true);
 
-      ActiveMQServer server = createServer(false, configuration, mbeanServer, new HashMap<String, AddressSettings>());
+      ActiveMQServer server = createServer(false, configuration);
+      server.setMBeanServer(mbeanServer);
       server.start();
 
       ActiveMQServerControl jmxServer = ManagementControlHelper.createActiveMQServerControl(mbeanServer);
@@ -95,7 +91,8 @@ public class HeuristicXATest extends ServiceTestBase
       Configuration configuration = createDefaultConfig()
          .setJMXManagementEnabled(true);
 
-      ActiveMQServer server = createServer(false, configuration, mbeanServer, new HashMap<String, AddressSettings>());
+      ActiveMQServer server = createServer(false, configuration);
+      server.setMBeanServer(mbeanServer);
       server.start();
       Xid xid = newXID();
 
@@ -190,7 +187,8 @@ public class HeuristicXATest extends ServiceTestBase
       Configuration configuration = createDefaultConfig()
          .setJMXManagementEnabled(true);
 
-      ActiveMQServer server = createServer(true, configuration, mbeanServer, new HashMap<String, AddressSettings>());
+      ActiveMQServer server = createServer(true, configuration);
+      server.setMBeanServer(mbeanServer);
       server.start();
       Xid xid = newXID();
 
@@ -290,7 +288,8 @@ public class HeuristicXATest extends ServiceTestBase
       Configuration configuration = createDefaultConfig()
          .setJMXManagementEnabled(true);
 
-      ActiveMQServer server = createServer(true, configuration, mbeanServer, new HashMap<String, AddressSettings>());
+      ActiveMQServer server = createServer(true, configuration);
+      server.setMBeanServer(mbeanServer);
       server.start();
       Xid xid = newXID();
 
@@ -399,7 +398,8 @@ public class HeuristicXATest extends ServiceTestBase
       Configuration configuration = createDefaultConfig()
          .setJMXManagementEnabled(true);
 
-      ActiveMQServer server = createServer(true, configuration, mbeanServer, new HashMap<String, AddressSettings>());
+      ActiveMQServer server = createServer(true, configuration);
+      server.setMBeanServer(mbeanServer);
       server.start();
       Xid xid = newXID();
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/IncompatibleVersionTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/IncompatibleVersionTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/IncompatibleVersionTest.java
index a955ae7..3be1789 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/IncompatibleVersionTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/IncompatibleVersionTest.java
@@ -261,7 +261,7 @@ public class IncompatibleVersionTest extends ServiceTestBase
       }
    }
 
-   private static class ClientStarter
+   private class ClientStarter
    {
       public void perform() throws Exception
       {
@@ -269,7 +269,7 @@ public class IncompatibleVersionTest extends ServiceTestBase
          ClientSessionFactory sf = null;
          try
          {
-            locator = ActiveMQClient.createServerLocatorWithoutHA(new TransportConfiguration(NETTY_CONNECTOR_FACTORY));
+            locator = createNettyNonHALocator();
             sf = locator.createSessionFactory();
             ClientSession session = sf.createSession(false, true, true);
             log.info("### client: connected. server incrementingVersion = " + session.getVersion());
@@ -285,6 +285,12 @@ public class IncompatibleVersionTest extends ServiceTestBase
 
    public static void main(String[] args) throws Exception
    {
+      IncompatibleVersionTest incompatibleVersionTest = new IncompatibleVersionTest();
+      incompatibleVersionTest.execute(args);
+   }
+
+   private void execute(String[] args) throws Exception
+   {
       if (args[0].equals("server"))
       {
          ServerStarter ss = new ServerStarter();

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/InterruptedLargeMessageTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/InterruptedLargeMessageTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/InterruptedLargeMessageTest.java
index 22b30a4..60592f9 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/InterruptedLargeMessageTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/InterruptedLargeMessageTest.java
@@ -38,7 +38,7 @@ import org.apache.activemq.artemis.api.core.client.ActiveMQClient;
 import org.apache.activemq.artemis.api.core.client.ServerLocator;
 import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger;
 import org.apache.activemq.artemis.tests.integration.largemessage.LargeMessageTestBase;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.apache.activemq.artemis.core.filter.Filter;
 import org.apache.activemq.artemis.core.paging.cursor.PageSubscription;
 import org.apache.activemq.artemis.core.persistence.StorageManager;
@@ -128,7 +128,7 @@ public class InterruptedLargeMessageTest extends LargeMessageTestBase
 
       server.stop(false);
 
-      UnitTestCase.forceGC();
+      ServiceTestBase.forceGC();
 
       server.start();
 
@@ -261,7 +261,7 @@ public class InterruptedLargeMessageTest extends LargeMessageTestBase
             Assert.assertNotNull(clientMessage);
             for (int countByte = 0; countByte < LARGE_MESSAGE_SIZE; countByte++)
             {
-               Assert.assertEquals(UnitTestCase.getSamplebyte(countByte), clientMessage.getBodyBuffer().readByte());
+               Assert.assertEquals(ServiceTestBase.getSamplebyte(countByte), clientMessage.getBodyBuffer().readByte());
             }
             clientMessage.acknowledge();
          }
@@ -340,7 +340,7 @@ public class InterruptedLargeMessageTest extends LargeMessageTestBase
             Assert.assertNotNull(clientMessage);
             for (int countByte = 0; countByte < LARGE_MESSAGE_SIZE; countByte++)
             {
-               Assert.assertEquals(UnitTestCase.getSamplebyte(countByte), clientMessage.getBodyBuffer().readByte());
+               Assert.assertEquals(ServiceTestBase.getSamplebyte(countByte), clientMessage.getBodyBuffer().readByte());
             }
             clientMessage.acknowledge();
          }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/JmsNettyNioStressTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/JmsNettyNioStressTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/JmsNettyNioStressTest.java
index ac20c5b..484f654 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/JmsNettyNioStressTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/JmsNettyNioStressTest.java
@@ -16,32 +16,32 @@
  */
 package org.apache.activemq.artemis.tests.integration.client;
 
-import javax.jms.BytesMessage;
-import javax.jms.Connection;
-import javax.jms.DeliveryMode;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageProducer;
-import javax.jms.Session;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.concurrent.atomic.AtomicInteger;
-
 import org.apache.activemq.artemis.api.core.TransportConfiguration;
 import org.apache.activemq.artemis.api.core.client.ClientSession;
 import org.apache.activemq.artemis.api.core.client.ClientSessionFactory;
 import org.apache.activemq.artemis.api.core.client.ServerLocator;
 import org.apache.activemq.artemis.api.jms.ActiveMQJMSClient;
 import org.apache.activemq.artemis.api.jms.JMSFactoryType;
-import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.apache.activemq.artemis.core.config.Configuration;
 import org.apache.activemq.artemis.core.remoting.impl.netty.NettyConnectorFactory;
 import org.apache.activemq.artemis.core.remoting.impl.netty.TransportConstants;
 import org.apache.activemq.artemis.core.server.ActiveMQServer;
 import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
 import org.apache.activemq.artemis.jms.client.ActiveMQDestination;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.junit.Assert;
 import org.junit.Test;
 
+import javax.jms.BytesMessage;
+import javax.jms.Connection;
+import javax.jms.DeliveryMode;
+import javax.jms.MessageConsumer;
+import javax.jms.MessageProducer;
+import javax.jms.Session;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.concurrent.atomic.AtomicInteger;
+
 /**
  * -- https://issues.jboss.org/browse/HORNETQ-746
  * Stress test using netty with NIO and many JMS clients concurrently, to try
@@ -92,7 +92,11 @@ public class JmsNettyNioStressTest extends ServiceTestBase
       // minimize threads to maximize possibility for deadlock
       params.put(TransportConstants.NIO_REMOTING_THREADS_PROPNAME, 1);
       params.put(TransportConstants.BATCH_DELAY, 50);
-      Configuration config = createDefaultConfig(params, ServiceTestBase.NETTY_ACCEPTOR_FACTORY);
+      TransportConfiguration transportConfig = new TransportConfiguration(ServiceTestBase.NETTY_ACCEPTOR_FACTORY, params);
+      Configuration config = createBasicConfig(-1)
+              .setJMXManagementEnabled(false)
+              .clearAcceptorConfigurations()
+              .addAcceptorConfiguration(transportConfig);
       ActiveMQServer server = createServer(true, config);
       server.getConfiguration().setThreadPoolMaxSize(2);
       server.start();

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/LargeMessageAvoidLargeMessagesTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/LargeMessageAvoidLargeMessagesTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/LargeMessageAvoidLargeMessagesTest.java
index bed8582..e43ba04 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/LargeMessageAvoidLargeMessagesTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/LargeMessageAvoidLargeMessagesTest.java
@@ -25,7 +25,7 @@ import org.apache.activemq.artemis.api.core.client.ClientSession;
 import org.apache.activemq.artemis.api.core.client.ClientSessionFactory;
 import org.apache.activemq.artemis.api.core.client.ActiveMQClient;
 import org.apache.activemq.artemis.api.core.client.ServerLocator;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.apache.activemq.artemis.core.server.ActiveMQServer;
 import org.apache.activemq.artemis.core.settings.impl.AddressSettings;
 import org.junit.Assert;
@@ -350,7 +350,7 @@ public class LargeMessageAvoidLargeMessagesTest extends LargeMessageTest
 
       for (int i = 0; i < messageSize; i++)
       {
-         Assert.assertEquals(UnitTestCase.getSamplebyte(i), msg1
+         Assert.assertEquals(ServiceTestBase.getSamplebyte(i), msg1
             .getBodyBuffer().readByte());
       }
 
@@ -375,7 +375,7 @@ public class LargeMessageAvoidLargeMessagesTest extends LargeMessageTest
 
       for (int i = 0; i < messageSize; i++)
       {
-         Assert.assertEquals(UnitTestCase.getSamplebyte(i), msg1
+         Assert.assertEquals(ServiceTestBase.getSamplebyte(i), msg1
             .getBodyBuffer().readByte());
       }
 
@@ -394,7 +394,7 @@ public class LargeMessageAvoidLargeMessagesTest extends LargeMessageTest
 
       for (int i = 0; i < messageSize; i++)
       {
-         Assert.assertEquals(UnitTestCase.getSamplebyte(i), msg1
+         Assert.assertEquals(ServiceTestBase.getSamplebyte(i), msg1
             .getBodyBuffer().readByte());
       }
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/LargeMessageTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/LargeMessageTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/LargeMessageTest.java
index 657de07..02fd208 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/LargeMessageTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/LargeMessageTest.java
@@ -49,7 +49,7 @@ import org.apache.activemq.artemis.core.settings.impl.AddressFullMessagePolicy;
 import org.apache.activemq.artemis.core.settings.impl.AddressSettings;
 import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger;
 import org.apache.activemq.artemis.tests.util.RandomUtil;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
@@ -489,7 +489,7 @@ public class LargeMessageTest extends LargeMessageTestBase
 
       for (int i = 0; i < messageSize; i++)
       {
-         Assert.assertEquals(UnitTestCase.getSamplebyte(i), msg1.getBodyBuffer().readByte());
+         Assert.assertEquals(ServiceTestBase.getSamplebyte(i), msg1.getBodyBuffer().readByte());
       }
 
       session.close();
@@ -513,7 +513,7 @@ public class LargeMessageTest extends LargeMessageTestBase
 
       for (int i = 0; i < messageSize; i++)
       {
-         Assert.assertEquals(UnitTestCase.getSamplebyte(i), msg1.getBodyBuffer().readByte());
+         Assert.assertEquals(ServiceTestBase.getSamplebyte(i), msg1.getBodyBuffer().readByte());
       }
 
       msg1.acknowledge();
@@ -530,7 +530,7 @@ public class LargeMessageTest extends LargeMessageTestBase
 
       for (int i = 0; i < messageSize; i++)
       {
-         Assert.assertEquals(UnitTestCase.getSamplebyte(i), msg1.getBodyBuffer().readByte());
+         Assert.assertEquals(ServiceTestBase.getSamplebyte(i), msg1.getBodyBuffer().readByte());
       }
 
       msg1.acknowledge();
@@ -579,7 +579,7 @@ public class LargeMessageTest extends LargeMessageTestBase
 
       for (int i = 0; i < messageSize; i++)
       {
-         Assert.assertEquals(UnitTestCase.getSamplebyte(i), msg.getBodyBuffer().readByte());
+         Assert.assertEquals(ServiceTestBase.getSamplebyte(i), msg.getBodyBuffer().readByte());
       }
       session.rollback();
 
@@ -594,7 +594,7 @@ public class LargeMessageTest extends LargeMessageTestBase
       msg.acknowledge();
       for (int i = 0; i < messageSize; i++)
       {
-         Assert.assertEquals(UnitTestCase.getSamplebyte(i), msg.getBodyBuffer().readByte());
+         Assert.assertEquals(ServiceTestBase.getSamplebyte(i), msg.getBodyBuffer().readByte());
       }
       Assert.assertEquals(2, msg.getDeliveryCount());
       msg.acknowledge();
@@ -662,7 +662,7 @@ public class LargeMessageTest extends LargeMessageTestBase
 
       for (int j = 0; j < messageSize; j++)
       {
-         Assert.assertEquals(UnitTestCase.getSamplebyte(j), msg1.getBodyBuffer().readByte());
+         Assert.assertEquals(ServiceTestBase.getSamplebyte(j), msg1.getBodyBuffer().readByte());
       }
 
       session.rollback();
@@ -680,7 +680,7 @@ public class LargeMessageTest extends LargeMessageTestBase
 
          for (int j = 0; j < messageSize; j++)
          {
-            Assert.assertEquals(UnitTestCase.getSamplebyte(j), msg1.getBodyBuffer().readByte());
+            Assert.assertEquals(ServiceTestBase.getSamplebyte(j), msg1.getBodyBuffer().readByte());
          }
 
          session.rollback();
@@ -704,7 +704,7 @@ public class LargeMessageTest extends LargeMessageTestBase
 
       for (int i = 0; i < messageSize; i++)
       {
-         Assert.assertEquals(UnitTestCase.getSamplebyte(i), msg1.getBodyBuffer().readByte());
+         Assert.assertEquals(ServiceTestBase.getSamplebyte(i), msg1.getBodyBuffer().readByte());
       }
 
       session.commit();
@@ -778,7 +778,7 @@ public class LargeMessageTest extends LargeMessageTestBase
 
       for (int j = 0; j < messageSize; j++)
       {
-         Assert.assertEquals(UnitTestCase.getSamplebyte(j), msg1.getBodyBuffer().readByte());
+         Assert.assertEquals(ServiceTestBase.getSamplebyte(j), msg1.getBodyBuffer().readByte());
       }
 
       session.rollback();
@@ -795,7 +795,7 @@ public class LargeMessageTest extends LargeMessageTestBase
 
          for (int j = 0; j < messageSize; j++)
          {
-            Assert.assertEquals(UnitTestCase.getSamplebyte(j), msg1.getBodyBuffer().readByte());
+            Assert.assertEquals(ServiceTestBase.getSamplebyte(j), msg1.getBodyBuffer().readByte());
          }
 
          session.rollback();
@@ -824,7 +824,7 @@ public class LargeMessageTest extends LargeMessageTestBase
 
       for (int i = 0; i < messageSize; i++)
       {
-         Assert.assertEquals(UnitTestCase.getSamplebyte(i), msg1.getBodyBuffer().readByte());
+         Assert.assertEquals(ServiceTestBase.getSamplebyte(i), msg1.getBodyBuffer().readByte());
       }
 
       session.commit();
@@ -891,7 +891,7 @@ public class LargeMessageTest extends LargeMessageTestBase
 
          for (int i = 0; i < messageSize; i++)
          {
-            Assert.assertEquals(UnitTestCase.getSamplebyte(i), msg1.getBodyBuffer().readByte());
+            Assert.assertEquals(ServiceTestBase.getSamplebyte(i), msg1.getBodyBuffer().readByte());
          }
 
          session.close();
@@ -915,7 +915,7 @@ public class LargeMessageTest extends LargeMessageTestBase
 
          for (int i = 0; i < messageSize; i++)
          {
-            Assert.assertEquals(UnitTestCase.getSamplebyte(i), msg1.getBodyBuffer().readByte());
+            Assert.assertEquals(ServiceTestBase.getSamplebyte(i), msg1.getBodyBuffer().readByte());
          }
 
          msg1.acknowledge();
@@ -1195,7 +1195,7 @@ public class LargeMessageTest extends LargeMessageTestBase
       assertNotNull(msg);
       for (long i = 0; i < messageSize; i++)
       {
-         Assert.assertEquals("position " + i, UnitTestCase.getSamplebyte(i), msg.getBodyBuffer().readByte());
+         Assert.assertEquals("position " + i, ServiceTestBase.getSamplebyte(i), msg.getBodyBuffer().readByte());
       }
    }
 
@@ -2447,7 +2447,7 @@ public class LargeMessageTest extends LargeMessageTestBase
          for (int i = 0; i < NUMBER_OF_MESSAGES; i++)
          {
             ClientMessage clientFile = session.createMessage(true);
-            clientFile.setBodyInputStream(UnitTestCase.createFakeLargeStream(SIZE));
+            clientFile.setBodyInputStream(ServiceTestBase.createFakeLargeStream(SIZE));
             producer.send(clientFile);
 
          }
@@ -2480,7 +2480,7 @@ public class LargeMessageTest extends LargeMessageTestBase
                {
                   for (int byteRead = 0; byteRead < SIZE; byteRead++)
                   {
-                     Assert.assertEquals(UnitTestCase.getSamplebyte(byteRead), msg.getBodyBuffer().readByte());
+                     Assert.assertEquals(ServiceTestBase.getSamplebyte(byteRead), msg.getBodyBuffer().readByte());
                   }
                }
 
@@ -2551,7 +2551,7 @@ public class LargeMessageTest extends LargeMessageTestBase
          for (int i = 0; i < NUMBER_OF_MESSAGES; i++)
          {
             ClientMessage clientFile = session.createMessage(true);
-            clientFile.setBodyInputStream(UnitTestCase.createFakeLargeStream(SIZE));
+            clientFile.setBodyInputStream(ServiceTestBase.createFakeLargeStream(SIZE));
             producer.send(clientFile);
 
          }
@@ -2583,7 +2583,7 @@ public class LargeMessageTest extends LargeMessageTestBase
                {
                   for (int byteRead = 0; byteRead < SIZE; byteRead++)
                   {
-                     Assert.assertEquals(UnitTestCase.getSamplebyte(byteRead), msg.getBodyBuffer().readByte());
+                     Assert.assertEquals(ServiceTestBase.getSamplebyte(byteRead), msg.getBodyBuffer().readByte());
                   }
                }
 
@@ -2910,7 +2910,7 @@ public class LargeMessageTest extends LargeMessageTestBase
          session.createQueue(ADDRESS, ADDRESS, null, true);
 
          ClientMessage clientFile = session.createMessage(true);
-         clientFile.setBodyInputStream(UnitTestCase.createFakeLargeStream(SIZE));
+         clientFile.setBodyInputStream(ServiceTestBase.createFakeLargeStream(SIZE));
 
          ClientProducer producer = session.createProducer(ADDRESS);
 
@@ -2989,7 +2989,7 @@ public class LargeMessageTest extends LargeMessageTestBase
       for (int i = 0; i < NUMBER_OF_MESSAGES; i++)
       {
          ClientMessage msg = session.createMessage(true);
-         msg.setBodyInputStream(UnitTestCase.createFakeLargeStream(SIZE));
+         msg.setBodyInputStream(ServiceTestBase.createFakeLargeStream(SIZE));
          msg.putIntProperty(new SimpleString("key"), i);
          producer.send(msg);
 
@@ -3047,7 +3047,7 @@ public class LargeMessageTest extends LargeMessageTestBase
 
       for (int i = 0; i < LARGE_MESSAGE_SIZE; i++)
       {
-         fileMessage.addBytes(new byte[]{UnitTestCase.getSamplebyte(i)});
+         fileMessage.addBytes(new byte[]{ServiceTestBase.getSamplebyte(i)});
       }
 
       // The server would be doing this
@@ -3077,7 +3077,7 @@ public class LargeMessageTest extends LargeMessageTestBase
 
       for (int i = 0; i < LARGE_MESSAGE_SIZE; i++)
       {
-         Assert.assertEquals(UnitTestCase.getSamplebyte(i), msg.getBodyBuffer().readByte());
+         Assert.assertEquals(ServiceTestBase.getSamplebyte(i), msg.getBodyBuffer().readByte());
       }
 
       msg.acknowledge();

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/LibaioDependencyCheckTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/LibaioDependencyCheckTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/LibaioDependencyCheckTest.java
index f5dcd1b..8a11973 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/LibaioDependencyCheckTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/LibaioDependencyCheckTest.java
@@ -19,7 +19,7 @@ package org.apache.activemq.artemis.tests.integration.client;
 import org.junit.Test;
 
 import org.apache.activemq.artemis.core.asyncio.impl.AsynchronousFileImpl;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 
 /**
  * This tests is placed in duplication here to validate that the libaio module is properly loaded on this
@@ -27,7 +27,7 @@ import org.apache.activemq.artemis.tests.util.UnitTestCase;
  *
  * This test should be placed on each one of the tests modules to make sure the library is loaded correctly.
  */
-public class LibaioDependencyCheckTest extends UnitTestCase
+public class LibaioDependencyCheckTest extends ServiceTestBase
 {
 
    // Constants -----------------------------------------------------

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MessageDurabilityTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MessageDurabilityTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MessageDurabilityTest.java
index 42bc4b8..5992390 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MessageDurabilityTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MessageDurabilityTest.java
@@ -25,7 +25,6 @@ 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.UnitTestCase;
 import org.apache.activemq.artemis.core.server.ActiveMQServer;
 import org.apache.activemq.artemis.tests.util.RandomUtil;
 import org.apache.activemq.artemis.tests.util.ServiceTestBase;
@@ -150,7 +149,7 @@ public class MessageDurabilityTest extends ServiceTestBase
 
       session.start();
 
-      UnitTestCase.expectActiveMQException(ActiveMQExceptionType.QUEUE_DOES_NOT_EXIST, new ActiveMQAction()
+      ServiceTestBase.expectActiveMQException(ActiveMQExceptionType.QUEUE_DOES_NOT_EXIST, new ActiveMQAction()
       {
          public void run() throws ActiveMQException
          {
@@ -178,7 +177,7 @@ public class MessageDurabilityTest extends ServiceTestBase
       restart();
 
       session.start();
-      UnitTestCase.expectActiveMQException(ActiveMQExceptionType.QUEUE_DOES_NOT_EXIST, new ActiveMQAction()
+      ServiceTestBase.expectActiveMQException(ActiveMQExceptionType.QUEUE_DOES_NOT_EXIST, new ActiveMQAction()
       {
          public void run() throws ActiveMQException
          {

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MessageGroupingConnectionFactoryTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MessageGroupingConnectionFactoryTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MessageGroupingConnectionFactoryTest.java
index 23a28f8..dc96d10 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MessageGroupingConnectionFactoryTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MessageGroupingConnectionFactoryTest.java
@@ -15,34 +15,31 @@
  * 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.UnitTestCase;
-import org.junit.Before;
-
-import org.junit.Test;
-
-import java.util.ArrayList;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.TimeUnit;
-
-import org.junit.Assert;
 
+import org.apache.activemq.artemis.api.core.ActiveMQException;
 import org.apache.activemq.artemis.api.core.SimpleString;
 import org.apache.activemq.artemis.api.core.TransportConfiguration;
+import org.apache.activemq.artemis.api.core.client.ActiveMQClient;
 import org.apache.activemq.artemis.api.core.client.ClientConsumer;
 import org.apache.activemq.artemis.api.core.client.ClientMessage;
 import org.apache.activemq.artemis.api.core.client.ClientProducer;
 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.MessageHandler;
 import org.apache.activemq.artemis.api.core.client.ServerLocator;
 import org.apache.activemq.artemis.core.config.Configuration;
 import org.apache.activemq.artemis.core.server.ActiveMQServer;
 import org.apache.activemq.artemis.core.server.ActiveMQServers;
 import org.apache.activemq.artemis.tests.util.ServiceTestBase;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+import java.util.ArrayList;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
 
-public class MessageGroupingConnectionFactoryTest extends UnitTestCase
+public class MessageGroupingConnectionFactoryTest extends ServiceTestBase
 {
    private ActiveMQServer server;
 
@@ -121,7 +118,7 @@ public class MessageGroupingConnectionFactoryTest extends UnitTestCase
    public void setUp() throws Exception
    {
       super.setUp();
-      TransportConfiguration transportConfig = new TransportConfiguration(UnitTestCase.INVM_ACCEPTOR_FACTORY);
+      TransportConfiguration transportConfig = new TransportConfiguration(ServiceTestBase.INVM_ACCEPTOR_FACTORY);
 
       Configuration configuration = createDefaultConfig()
          .setSecurityEnabled(false)

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MessageGroupingTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MessageGroupingTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MessageGroupingTest.java
index 2097ba8..48c4590 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MessageGroupingTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MessageGroupingTest.java
@@ -15,40 +15,37 @@
  * 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.integration.IntegrationTestLogger;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
-import org.junit.Assume;
-import org.junit.Before;
-
-import org.junit.Test;
-
-import java.util.ArrayList;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.TimeUnit;
-
-import javax.transaction.xa.XAResource;
-import javax.transaction.xa.Xid;
-
-import org.junit.Assert;
 
+import org.apache.activemq.artemis.api.core.ActiveMQException;
 import org.apache.activemq.artemis.api.core.Message;
 import org.apache.activemq.artemis.api.core.SimpleString;
 import org.apache.activemq.artemis.api.core.TransportConfiguration;
+import org.apache.activemq.artemis.api.core.client.ActiveMQClient;
 import org.apache.activemq.artemis.api.core.client.ClientConsumer;
 import org.apache.activemq.artemis.api.core.client.ClientMessage;
 import org.apache.activemq.artemis.api.core.client.ClientProducer;
 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.MessageHandler;
 import org.apache.activemq.artemis.api.core.client.ServerLocator;
 import org.apache.activemq.artemis.core.config.Configuration;
 import org.apache.activemq.artemis.core.server.ActiveMQServer;
 import org.apache.activemq.artemis.core.server.ActiveMQServers;
 import org.apache.activemq.artemis.core.transaction.impl.XidImpl;
+import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
+import org.junit.Assert;
+import org.junit.Assume;
+import org.junit.Before;
+import org.junit.Test;
+
+import javax.transaction.xa.XAResource;
+import javax.transaction.xa.Xid;
+import java.util.ArrayList;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
 
-public class MessageGroupingTest extends UnitTestCase
+public class MessageGroupingTest extends ServiceTestBase
 {
    private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER;
 
@@ -282,7 +279,7 @@ public class MessageGroupingTest extends UnitTestCase
 
    private void doTestMultipleGroupingTXCommit() throws Exception
    {
-      ServerLocator locator = ActiveMQClient.createServerLocatorWithoutHA(new TransportConfiguration(UnitTestCase.INVM_CONNECTOR_FACTORY));
+      ServerLocator locator = createInVMNonHALocator();
       ClientSessionFactory sessionFactory = createSessionFactory(locator);
       ClientSession clientSession = sessionFactory.createSession(false, false, false);
       ClientProducer clientProducer = this.clientSession.createProducer(qName);
@@ -343,7 +340,7 @@ public class MessageGroupingTest extends UnitTestCase
    private void doTestMultipleGroupingTXRollback() throws Exception
    {
       log.info("*** starting test");
-      ServerLocator locator = ActiveMQClient.createServerLocatorWithoutHA(new TransportConfiguration(UnitTestCase.INVM_CONNECTOR_FACTORY));
+      ServerLocator locator = createInVMNonHALocator();
       locator.setBlockOnAcknowledge(true);
       ClientSessionFactory sessionFactory = createSessionFactory(locator);
       ClientSession clientSession = sessionFactory.createSession(false, false, false);
@@ -419,7 +416,7 @@ public class MessageGroupingTest extends UnitTestCase
 
    private void dotestMultipleGroupingXACommit() throws Exception
    {
-      ServerLocator locator = ActiveMQClient.createServerLocatorWithoutHA(new TransportConfiguration(UnitTestCase.INVM_CONNECTOR_FACTORY));
+      ServerLocator locator = createInVMNonHALocator();
       ClientSessionFactory sessionFactory = createSessionFactory(locator);
       ClientSession clientSession = sessionFactory.createSession(true, false, false);
       ClientProducer clientProducer = this.clientSession.createProducer(qName);
@@ -479,7 +476,7 @@ public class MessageGroupingTest extends UnitTestCase
 
    private void doTestMultipleGroupingXARollback() throws Exception
    {
-      ServerLocator locator = ActiveMQClient.createServerLocatorWithoutHA(new TransportConfiguration(UnitTestCase.INVM_CONNECTOR_FACTORY));
+      ServerLocator locator = createInVMNonHALocator();
       locator.setBlockOnAcknowledge(true);
       ClientSessionFactory sessionFactory = createSessionFactory(locator);
       ClientSession clientSession = sessionFactory.createSession(true, false, false);
@@ -611,7 +608,7 @@ public class MessageGroupingTest extends UnitTestCase
    public void setUp() throws Exception
    {
       super.setUp();
-      TransportConfiguration transportConfig = new TransportConfiguration(UnitTestCase.INVM_ACCEPTOR_FACTORY);
+      TransportConfiguration transportConfig = new TransportConfiguration(ServiceTestBase.INVM_ACCEPTOR_FACTORY);
 
       Configuration configuration = createDefaultConfig()
          .setSecurityEnabled(false)
@@ -623,7 +620,7 @@ public class MessageGroupingTest extends UnitTestCase
       // then we create a client as normal
       locator =
                addServerLocator(ActiveMQClient.createServerLocatorWithoutHA(new TransportConfiguration(
-                  UnitTestCase.INVM_CONNECTOR_FACTORY)));
+                  INVM_CONNECTOR_FACTORY)));
       clientSessionFactory = createSessionFactory(locator);
       clientSession = addClientSession(clientSessionFactory.createSession(false, true, true));
       clientSession.createQueue(qName, qName, null, false);

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MessagePriorityTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MessagePriorityTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MessagePriorityTest.java
index e0f7d8c..e9b9da0 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MessagePriorityTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MessagePriorityTest.java
@@ -18,12 +18,12 @@ package org.apache.activemq.artemis.tests.integration.client;
 
 import org.apache.activemq.artemis.api.core.SimpleString;
 import org.apache.activemq.artemis.api.core.TransportConfiguration;
+import org.apache.activemq.artemis.api.core.client.ActiveMQClient;
 import org.apache.activemq.artemis.api.core.client.ClientConsumer;
 import org.apache.activemq.artemis.api.core.client.ClientMessage;
 import org.apache.activemq.artemis.api.core.client.ClientProducer;
 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.remoting.impl.invm.InVMAcceptorFactory;
@@ -32,12 +32,11 @@ import org.apache.activemq.artemis.core.server.ActiveMQServers;
 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.UnitTestCase;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
 
-public class MessagePriorityTest extends UnitTestCase
+public class MessagePriorityTest extends ServiceTestBase
 {
 
    // Constants -----------------------------------------------------

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MultipleThreadFilterOneTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MultipleThreadFilterOneTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MultipleThreadFilterOneTest.java
index 7a261a1..e6f854b 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MultipleThreadFilterOneTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MultipleThreadFilterOneTest.java
@@ -164,7 +164,7 @@ public class MultipleThreadFilterOneTest extends ServiceTestBase
 
             for (int i = 0; i < numberOfMessages; i++)
             {
-               ClientMessage msg = consumer.receive(5000);
+               ClientMessage msg = consumer.receive(15000);
                Assert.assertNotNull(msg);
                Assert.assertEquals(nr, msg.getIntProperty("prodNR").intValue());
                msg.acknowledge();

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/NIOvsOIOTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/NIOvsOIOTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/NIOvsOIOTest.java
index 7f9d9c1..ede5299 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/NIOvsOIOTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/NIOvsOIOTest.java
@@ -16,23 +16,12 @@
  */
 package org.apache.activemq.artemis.tests.integration.client;
 
-import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
-import org.junit.Test;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.CountDownLatch;
-
 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.MessageHandler;
 import org.apache.activemq.artemis.api.core.client.ServerLocator;
 import org.apache.activemq.artemis.core.config.Configuration;
@@ -42,9 +31,18 @@ import org.apache.activemq.artemis.core.server.ActiveMQServers;
 import org.apache.activemq.artemis.core.settings.HierarchicalRepository;
 import org.apache.activemq.artemis.core.settings.impl.AddressFullMessagePolicy;
 import org.apache.activemq.artemis.core.settings.impl.AddressSettings;
+import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.apache.activemq.artemis.utils.UUIDGenerator;
+import org.junit.Test;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.CountDownLatch;
 
-public class NIOvsOIOTest extends UnitTestCase
+public class NIOvsOIOTest extends ServiceTestBase
 {
    private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER;
 
@@ -85,7 +83,7 @@ public class NIOvsOIOTest extends UnitTestCase
 
       List<ClientSessionFactory> factories = new ArrayList<ClientSessionFactory>();
 
-      ServerLocator locator = ActiveMQClient.createServerLocatorWithoutHA(new TransportConfiguration(UnitTestCase.INVM_CONNECTOR_FACTORY));
+      ServerLocator locator = createInVMNonHALocator();
 
       for (int i = 0; i < numReceivers; i++)
       {

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/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 adfd621..9b9541d 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
@@ -16,7 +16,7 @@
  */
 package org.apache.activemq.artemis.tests.integration.client;
 import org.apache.activemq.artemis.api.core.ActiveMQException;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.junit.Before;
 import org.junit.After;
 
@@ -42,7 +42,7 @@ import org.apache.activemq.artemis.core.settings.impl.AddressSettings;
  *
  * A NewDeadLetterAddressTest
  */
-public class NewDeadLetterAddressTest extends UnitTestCase
+public class NewDeadLetterAddressTest extends ServiceTestBase
 {
    private ActiveMQServer server;
 
@@ -75,7 +75,7 @@ public class NewDeadLetterAddressTest extends UnitTestCase
    public void setUp() throws Exception
    {
       super.setUp();
-      TransportConfiguration transportConfig = new TransportConfiguration(UnitTestCase.INVM_ACCEPTOR_FACTORY);
+      TransportConfiguration transportConfig = new TransportConfiguration(ServiceTestBase.INVM_ACCEPTOR_FACTORY);
 
       Configuration configuration = createDefaultConfig()
          .setSecurityEnabled(false)
@@ -86,7 +86,7 @@ public class NewDeadLetterAddressTest extends UnitTestCase
       // then we create a client as normal
       locator =
                addServerLocator(ActiveMQClient.createServerLocatorWithoutHA(new TransportConfiguration(
-                  UnitTestCase.INVM_CONNECTOR_FACTORY)));
+                  INVM_CONNECTOR_FACTORY)));
       ClientSessionFactory sessionFactory = createSessionFactory(locator);
       clientSession = sessionFactory.createSession(false, true, false);
    }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/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 94a860b..b857030 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
@@ -800,7 +800,8 @@ public class PagingOrderTest extends ServiceTestBase
       Configuration config = createDefaultConfig()
          .setJournalSyncNonTransactional(false);
 
-      ActiveMQServer server = createServer(true, config, -1, -1, AddressFullMessagePolicy.BLOCK, new HashMap<String, AddressSettings>());
+      ActiveMQServer server = createServer(true, config, -1, -1, new HashMap<String, AddressSettings>());
+      server.getAddressSettingsRepository().getMatch("#").setAddressFullMessagePolicy(AddressFullMessagePolicy.BLOCK);
 
       JMSServerManagerImpl jmsServer = new JMSServerManagerImpl(server);
       InVMNamingContext context = new InVMNamingContext();
@@ -857,7 +858,8 @@ public class PagingOrderTest extends ServiceTestBase
 
       jmsServer.stop();
 
-      server = createServer(true, config, -1, -1, AddressFullMessagePolicy.BLOCK, new HashMap<String, AddressSettings>());
+      server = createServer(true, config, -1, -1, new HashMap<String, AddressSettings>());
+      server.getAddressSettingsRepository().getMatch("#").setAddressFullMessagePolicy(AddressFullMessagePolicy.BLOCK);
 
       jmsServer = new JMSServerManagerImpl(server);
       context = new InVMNamingContext();

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/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 d74a94f..7abb2ac 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
@@ -16,23 +16,6 @@
  */
 package org.apache.activemq.artemis.tests.integration.client;
 
-import javax.transaction.xa.XAResource;
-import javax.transaction.xa.Xid;
-import java.io.File;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.nio.ByteBuffer;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.atomic.AtomicBoolean;
-import java.util.concurrent.atomic.AtomicInteger;
-
 import org.apache.activemq.artemis.api.core.ActiveMQBuffer;
 import org.apache.activemq.artemis.api.core.ActiveMQException;
 import org.apache.activemq.artemis.api.core.ActiveMQExceptionType;
@@ -46,9 +29,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.integration.IntegrationTestLogger;
-import org.apache.activemq.artemis.tests.util.ServiceTestBase;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
 import org.apache.activemq.artemis.core.client.impl.ClientConsumerInternal;
 import org.apache.activemq.artemis.core.config.Configuration;
 import org.apache.activemq.artemis.core.config.DivertConfiguration;
@@ -76,10 +56,29 @@ import org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl;
 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.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
 
+import javax.transaction.xa.XAResource;
+import javax.transaction.xa.Xid;
+import java.io.File;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.nio.ByteBuffer;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.concurrent.atomic.AtomicInteger;
+
 public class PagingTest extends ServiceTestBase
 {
    private ServerLocator locator;
@@ -1236,12 +1235,8 @@ public class PagingTest extends ServiceTestBase
       Configuration config = createDefaultConfig()
          .setJournalSyncNonTransactional(false);
 
-      server = createServer(true,
-                            config,
-                            PagingTest.PAGE_SIZE,
-                            PagingTest.PAGE_MAX,
-                            AddressFullMessagePolicy.BLOCK,
-                            new HashMap<String, AddressSettings>());
+      server = createServer(true, config, PagingTest.PAGE_SIZE, PagingTest.PAGE_MAX, new HashMap<String, AddressSettings>());
+      server.getAddressSettingsRepository().getMatch("#").setAddressFullMessagePolicy(AddressFullMessagePolicy.BLOCK);
 
       server.start();
 
@@ -2342,8 +2337,8 @@ public class PagingTest extends ServiceTestBase
                         }
                         catch (AssertionError e)
                         {
-                           PagingTest.log.info("Expected buffer:" + UnitTestCase.dumbBytesHex(body, 40));
-                           PagingTest.log.info("Arriving buffer:" + UnitTestCase.dumbBytesHex(message2.getBodyBuffer()
+                           PagingTest.log.info("Expected buffer:" + ServiceTestBase.dumbBytesHex(body, 40));
+                           PagingTest.log.info("Arriving buffer:" + ServiceTestBase.dumbBytesHex(message2.getBodyBuffer()
                                                                                                  .toByteBuffer()
                                                                                                  .array(), 40));
                            throw e;
@@ -2541,8 +2536,8 @@ public class PagingTest extends ServiceTestBase
                   }
                   catch (AssertionError e)
                   {
-                     PagingTest.log.info("Expected buffer:" + UnitTestCase.dumbBytesHex(body, 40));
-                     PagingTest.log.info("Arriving buffer:" + UnitTestCase.dumbBytesHex(message2.getBodyBuffer()
+                     PagingTest.log.info("Expected buffer:" + ServiceTestBase.dumbBytesHex(body, 40));
+                     PagingTest.log.info("Arriving buffer:" + ServiceTestBase.dumbBytesHex(message2.getBodyBuffer()
                                                                                            .toByteBuffer()
                                                                                            .array(), 40));
                      throw e;
@@ -2694,8 +2689,8 @@ public class PagingTest extends ServiceTestBase
          }
          catch (AssertionError e)
          {
-            PagingTest.log.info("Expected buffer:" + UnitTestCase.dumbBytesHex(body, 40));
-            PagingTest.log.info("Arriving buffer:" + UnitTestCase.dumbBytesHex(message2.getBodyBuffer()
+            PagingTest.log.info("Expected buffer:" + ServiceTestBase.dumbBytesHex(body, 40));
+            PagingTest.log.info("Arriving buffer:" + ServiceTestBase.dumbBytesHex(message2.getBodyBuffer()
                                                                                   .toByteBuffer()
                                                                                   .array(), 40));
             throw e;
@@ -2713,7 +2708,7 @@ public class PagingTest extends ServiceTestBase
 
       buffer.readBytes(other);
 
-      UnitTestCase.assertEqualsByteArrays(body, other);
+      ServiceTestBase.assertEqualsByteArrays(body, other);
    }
 
    /**
@@ -3360,7 +3355,7 @@ public class PagingTest extends ServiceTestBase
 
       for (int j = 0; j < numberOfBytes; j++)
       {
-         body[j] = UnitTestCase.getSamplebyte(j);
+         body[j] = ServiceTestBase.getSamplebyte(j);
       }
 
       long scheduledTime = System.currentTimeMillis() + 5000;
@@ -3429,8 +3424,8 @@ public class PagingTest extends ServiceTestBase
          }
          catch (AssertionError e)
          {
-            PagingTest.log.info("Expected buffer:" + UnitTestCase.dumbBytesHex(body, 40));
-            PagingTest.log.info("Arriving buffer:" + UnitTestCase.dumbBytesHex(message2.getBodyBuffer()
+            PagingTest.log.info("Expected buffer:" + ServiceTestBase.dumbBytesHex(body, 40));
+            PagingTest.log.info("Arriving buffer:" + ServiceTestBase.dumbBytesHex(message2.getBodyBuffer()
                                                                                   .toByteBuffer()
                                                                                   .array(), 40));
             throw e;

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/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 5a9f5f5..fa4fb1c 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
@@ -15,16 +15,9 @@
  * 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.api.core.ActiveMQExceptionType;
-import org.apache.activemq.artemis.tests.util.ServiceTestBase;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
-import org.junit.Before;
-
-import org.junit.Test;
-
-import org.junit.Assert;
-
 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;
@@ -34,6 +27,10 @@ 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.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
 {
@@ -54,7 +51,7 @@ public class ProducerCloseTest extends ServiceTestBase
 
       Assert.assertTrue(producer.isClosed());
 
-      UnitTestCase.expectActiveMQException(ActiveMQExceptionType.OBJECT_CLOSED, new ActiveMQAction()
+      ServiceTestBase.expectActiveMQException(ActiveMQExceptionType.OBJECT_CLOSED, new ActiveMQAction()
       {
          public void run() throws ActiveMQException
          {

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/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 1f053c9..6707441 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
@@ -16,13 +16,6 @@
  */
 package org.apache.activemq.artemis.tests.integration.client;
 
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.atomic.AtomicBoolean;
-
 import org.apache.activemq.artemis.api.core.ActiveMQObjectClosedException;
 import org.apache.activemq.artemis.api.core.SimpleString;
 import org.apache.activemq.artemis.api.core.client.ClientConsumer;
@@ -32,7 +25,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.UnitTestCase;
 import org.apache.activemq.artemis.core.client.impl.ClientProducerCreditManagerImpl;
 import org.apache.activemq.artemis.core.client.impl.ClientProducerCredits;
 import org.apache.activemq.artemis.core.client.impl.ClientProducerInternal;
@@ -48,6 +40,13 @@ import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
 
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicBoolean;
+
 public class ProducerFlowControlTest extends ServiceTestBase
 {
    private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER;
@@ -274,7 +273,7 @@ public class ProducerFlowControlTest extends ServiceTestBase
 
                message.getBodyBuffer().readBytes(bytesRead);
 
-               UnitTestCase.assertEqualsByteArrays(bytes, bytesRead);
+               ServiceTestBase.assertEqualsByteArrays(bytes, bytesRead);
 
                message.acknowledge();
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/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 145f6bf..7bca4d2 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
@@ -52,7 +52,7 @@ public class ReceiveImmediateTest extends ServiceTestBase
    {
       super.setUp();
 
-      Configuration config = createDefaultConfig(false);
+      Configuration config = createDefaultConfig();
       server = createServer(false, config);
       server.start();
       locator = createInVMNonHALocator();


[03/13] activemq-artemis git commit: Refactor base test classes

Posted by an...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/StompWebSocketTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/StompWebSocketTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/StompWebSocketTest.java
index 547386c..4db0465 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/StompWebSocketTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/StompWebSocketTest.java
@@ -20,7 +20,7 @@ import java.util.HashMap;
 import java.util.Map;
 
 import org.apache.activemq.artemis.api.core.TransportConfiguration;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.apache.activemq.artemis.core.config.Configuration;
 import org.apache.activemq.artemis.core.config.CoreQueueConfiguration;
 import org.apache.activemq.artemis.core.protocol.stomp.StompProtocolManagerFactory;
@@ -37,7 +37,7 @@ import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 
-public class StompWebSocketTest extends UnitTestCase
+public class StompWebSocketTest extends ServiceTestBase
 {
    private JMSServerManager server;
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/v11/StompV11TestBase.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/v11/StompV11TestBase.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/v11/StompV11TestBase.java
index abeaa89..4e884c8 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/v11/StompV11TestBase.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/v11/StompV11TestBase.java
@@ -16,7 +16,7 @@
  */
 package org.apache.activemq.artemis.tests.integration.stomp.v11;
 import org.apache.activemq.artemis.tests.unit.util.InVMNamingContext;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.apache.activemq.artemis.core.registry.JndiBindingRegistry;
 import org.junit.Before;
 import org.junit.After;
@@ -52,7 +52,7 @@ import org.apache.activemq.artemis.jms.server.config.impl.JMSQueueConfigurationI
 import org.apache.activemq.artemis.jms.server.config.impl.TopicConfigurationImpl;
 import org.apache.activemq.artemis.jms.server.impl.JMSServerManagerImpl;
 
-public abstract class StompV11TestBase extends UnitTestCase
+public abstract class StompV11TestBase extends ServiceTestBase
 {
    protected String hostname = "127.0.0.1";
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/transports/netty/ActiveMQFrameDecoder2Test.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/transports/netty/ActiveMQFrameDecoder2Test.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/transports/netty/ActiveMQFrameDecoder2Test.java
index ee63884..defb673 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/transports/netty/ActiveMQFrameDecoder2Test.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/transports/netty/ActiveMQFrameDecoder2Test.java
@@ -23,14 +23,14 @@ import java.util.Random;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
 import io.netty.channel.embedded.EmbeddedChannel;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.apache.activemq.artemis.core.remoting.impl.netty.ActiveMQFrameDecoder2;
 import org.junit.After;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
 
-public class ActiveMQFrameDecoder2Test extends UnitTestCase
+public class ActiveMQFrameDecoder2Test extends ServiceTestBase
 {
    private static final int MSG_CNT = 10000;
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/transports/netty/NettyConnectorWithHTTPUpgradeTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/transports/netty/NettyConnectorWithHTTPUpgradeTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/transports/netty/NettyConnectorWithHTTPUpgradeTest.java
index a086de6..e3ccde3 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/transports/netty/NettyConnectorWithHTTPUpgradeTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/transports/netty/NettyConnectorWithHTTPUpgradeTest.java
@@ -45,7 +45,7 @@ import org.apache.activemq.artemis.api.core.client.ClientSession;
 import org.apache.activemq.artemis.api.core.client.ClientSessionFactory;
 import org.apache.activemq.artemis.api.core.client.ActiveMQClient;
 import org.apache.activemq.artemis.api.core.client.ServerLocator;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.apache.activemq.artemis.core.config.Configuration;
 import org.apache.activemq.artemis.core.remoting.impl.netty.NettyAcceptor;
 import org.apache.activemq.artemis.core.remoting.impl.netty.PartialPooledByteBufAllocator;
@@ -69,7 +69,7 @@ import static org.apache.activemq.artemis.tests.util.RandomUtil.randomString;
 /**
  * Test that Netty Connector can connect to a Web Server and upgrade from a HTTP request to its remoting protocol.
  */
-public class NettyConnectorWithHTTPUpgradeTest extends UnitTestCase
+public class NettyConnectorWithHTTPUpgradeTest extends ServiceTestBase
 {
 
    private static final SimpleString QUEUE = new SimpleString("NettyConnectorWithHTTPUpgradeTest");

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/vertx/ActiveMQVertxUnitTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/vertx/ActiveMQVertxUnitTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/vertx/ActiveMQVertxUnitTest.java
index f0ef01b..f480655 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/vertx/ActiveMQVertxUnitTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/vertx/ActiveMQVertxUnitTest.java
@@ -16,17 +16,14 @@
  */
 package org.apache.activemq.artemis.tests.integration.vertx;
 
-import java.util.HashMap;
-
 import org.apache.activemq.artemis.api.core.ActiveMQBuffer;
 import org.apache.activemq.artemis.api.core.TransportConfiguration;
+import org.apache.activemq.artemis.api.core.client.ActiveMQClient;
 import org.apache.activemq.artemis.api.core.client.ClientConsumer;
 import org.apache.activemq.artemis.api.core.client.ClientMessage;
 import org.apache.activemq.artemis.api.core.client.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.UnitTestCase;
 import org.apache.activemq.artemis.core.config.Configuration;
 import org.apache.activemq.artemis.core.config.ConnectorServiceConfiguration;
 import org.apache.activemq.artemis.core.config.CoreQueueConfiguration;
@@ -48,6 +45,8 @@ import org.vertx.java.platform.PlatformLocator;
 import org.vertx.java.platform.PlatformManager;
 import org.vertx.java.spi.cluster.impl.hazelcast.HazelcastClusterManagerFactory;
 
+import java.util.HashMap;
+
 /**
  * This class tests the basics of ActiveMQ
  * vertx integration
@@ -156,7 +155,7 @@ public class ActiveMQVertxUnitTest extends ServiceTestBase
          .setParams(config5)
          .setName("test-vertx-outgoing-connector2");
 
-      Configuration configuration = createDefaultConfig(false)
+      Configuration configuration = createDefaultConfig()
          .addQueueConfiguration(qc1)
          .addQueueConfiguration(qc2)
          .addQueueConfiguration(qc3)
@@ -682,7 +681,7 @@ public class ActiveMQVertxUnitTest extends ServiceTestBase
 
       try
       {
-         TransportConfiguration tpconf = new TransportConfiguration(UnitTestCase.INVM_CONNECTOR_FACTORY);
+         TransportConfiguration tpconf = new TransportConfiguration(INVM_CONNECTOR_FACTORY);
          locator = ActiveMQClient.createServerLocatorWithoutHA(tpconf);
 
          sf = createSessionFactory(locator);

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/xa/BasicXaRecoveryTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/xa/BasicXaRecoveryTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/xa/BasicXaRecoveryTest.java
index 2141bfa..7ee1a39 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/xa/BasicXaRecoveryTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/xa/BasicXaRecoveryTest.java
@@ -15,14 +15,6 @@
  * limitations under the License.
  */
 package org.apache.activemq.artemis.tests.integration.xa;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.management.MBeanServer;
-import javax.management.MBeanServerFactory;
-import javax.transaction.xa.XAResource;
-import javax.transaction.xa.Xid;
 
 import org.apache.activemq.artemis.api.core.ActiveMQException;
 import org.apache.activemq.artemis.api.core.SimpleString;
@@ -42,13 +34,20 @@ import org.apache.activemq.artemis.jms.client.ActiveMQTextMessage;
 import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger;
 import org.apache.activemq.artemis.tests.integration.management.ManagementControlHelper;
 import org.apache.activemq.artemis.tests.util.ServiceTestBase;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
 import org.apache.activemq.artemis.utils.UUIDGenerator;
 import org.junit.After;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
 
+import javax.management.MBeanServer;
+import javax.management.MBeanServerFactory;
+import javax.transaction.xa.XAResource;
+import javax.transaction.xa.Xid;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Map;
+
 public class BasicXaRecoveryTest extends ServiceTestBase
 {
    private static IntegrationTestLogger log = IntegrationTestLogger.LOGGER;
@@ -88,7 +87,8 @@ public class BasicXaRecoveryTest extends ServiceTestBase
 
       mbeanServer = MBeanServerFactory.createMBeanServer();
 
-      server = createServer(true, configuration, -1, -1, addressSettings, mbeanServer);
+      server = createServer(true, configuration, -1, -1, addressSettings);
+      server.setMBeanServer(mbeanServer);
 
       // start the server
       server.start();
@@ -334,8 +334,8 @@ public class BasicXaRecoveryTest extends ServiceTestBase
       Xid[] xids = clientSession.recover(XAResource.TMSTARTRSCAN);
       Assert.assertEquals(xids.length, 1);
       Assert.assertEquals(xids[0].getFormatId(), xid.getFormatId());
-      UnitTestCase.assertEqualsByteArrays(xids[0].getBranchQualifier(), xid.getBranchQualifier());
-      UnitTestCase.assertEqualsByteArrays(xids[0].getGlobalTransactionId(), xid.getGlobalTransactionId());
+      ServiceTestBase.assertEqualsByteArrays(xids[0].getBranchQualifier(), xid.getBranchQualifier());
+      ServiceTestBase.assertEqualsByteArrays(xids[0].getGlobalTransactionId(), xid.getGlobalTransactionId());
 
       clientSession.commit(xid, false);
 
@@ -413,8 +413,8 @@ public class BasicXaRecoveryTest extends ServiceTestBase
       Xid[] xids = clientSession.recover(XAResource.TMSTARTRSCAN);
       Assert.assertEquals(1, xids.length);
       Assert.assertEquals(xids[0].getFormatId(), xid.getFormatId());
-      UnitTestCase.assertEqualsByteArrays(xids[0].getBranchQualifier(), xid.getBranchQualifier());
-      UnitTestCase.assertEqualsByteArrays(xids[0].getGlobalTransactionId(), xid.getGlobalTransactionId());
+      ServiceTestBase.assertEqualsByteArrays(xids[0].getBranchQualifier(), xid.getBranchQualifier());
+      ServiceTestBase.assertEqualsByteArrays(xids[0].getGlobalTransactionId(), xid.getGlobalTransactionId());
 
       clientSession.rollback(xid);
 
@@ -458,8 +458,8 @@ public class BasicXaRecoveryTest extends ServiceTestBase
 
       Assert.assertEquals(xids.length, 1);
       Assert.assertEquals(xids[0].getFormatId(), xid.getFormatId());
-      UnitTestCase.assertEqualsByteArrays(xids[0].getBranchQualifier(), xid.getBranchQualifier());
-      UnitTestCase.assertEqualsByteArrays(xids[0].getGlobalTransactionId(), xid.getGlobalTransactionId());
+      ServiceTestBase.assertEqualsByteArrays(xids[0].getBranchQualifier(), xid.getBranchQualifier());
+      ServiceTestBase.assertEqualsByteArrays(xids[0].getGlobalTransactionId(), xid.getGlobalTransactionId());
       xids = clientSession.recover(XAResource.TMENDRSCAN);
       Assert.assertEquals(xids.length, 0);
       if (commit)
@@ -537,8 +537,8 @@ public class BasicXaRecoveryTest extends ServiceTestBase
       Xid[] xids = clientSession.recover(XAResource.TMSTARTRSCAN);
       Assert.assertEquals(xids.length, 1);
       Assert.assertEquals(xids[0].getFormatId(), xid.getFormatId());
-      UnitTestCase.assertEqualsByteArrays(xids[0].getBranchQualifier(), xid.getBranchQualifier());
-      UnitTestCase.assertEqualsByteArrays(xids[0].getGlobalTransactionId(), xid.getGlobalTransactionId());
+      ServiceTestBase.assertEqualsByteArrays(xids[0].getBranchQualifier(), xid.getBranchQualifier());
+      ServiceTestBase.assertEqualsByteArrays(xids[0].getGlobalTransactionId(), xid.getGlobalTransactionId());
 
       xids = clientSession.recover(XAResource.TMENDRSCAN);
       Assert.assertEquals(xids.length, 0);
@@ -593,8 +593,8 @@ public class BasicXaRecoveryTest extends ServiceTestBase
 
       Assert.assertEquals(xids.length, 1);
       Assert.assertEquals(xids[0].getFormatId(), xid.getFormatId());
-      UnitTestCase.assertEqualsByteArrays(xids[0].getBranchQualifier(), xid.getBranchQualifier());
-      UnitTestCase.assertEqualsByteArrays(xids[0].getGlobalTransactionId(), xid.getGlobalTransactionId());
+      ServiceTestBase.assertEqualsByteArrays(xids[0].getBranchQualifier(), xid.getBranchQualifier());
+      ServiceTestBase.assertEqualsByteArrays(xids[0].getGlobalTransactionId(), xid.getGlobalTransactionId());
       xids = clientSession.recover(XAResource.TMENDRSCAN);
       Assert.assertEquals(xids.length, 0);
       clientSession.rollback(xid);
@@ -642,8 +642,8 @@ public class BasicXaRecoveryTest extends ServiceTestBase
 
       Assert.assertEquals(xids.length, 1);
       Assert.assertEquals(xids[0].getFormatId(), xid.getFormatId());
-      UnitTestCase.assertEqualsByteArrays(xids[0].getBranchQualifier(), xid.getBranchQualifier());
-      UnitTestCase.assertEqualsByteArrays(xids[0].getGlobalTransactionId(), xid.getGlobalTransactionId());
+      ServiceTestBase.assertEqualsByteArrays(xids[0].getBranchQualifier(), xid.getBranchQualifier());
+      ServiceTestBase.assertEqualsByteArrays(xids[0].getGlobalTransactionId(), xid.getGlobalTransactionId());
       xids = clientSession.recover(XAResource.TMENDRSCAN);
       Assert.assertEquals(xids.length, 0);
       clientSession.commit(xid, false);
@@ -893,8 +893,8 @@ public class BasicXaRecoveryTest extends ServiceTestBase
 
       Assert.assertEquals(xids.length, 1);
       Assert.assertEquals(xids[0].getFormatId(), xid.getFormatId());
-      UnitTestCase.assertEqualsByteArrays(xids[0].getBranchQualifier(), xid.getBranchQualifier());
-      UnitTestCase.assertEqualsByteArrays(xids[0].getGlobalTransactionId(), xid.getGlobalTransactionId());
+      ServiceTestBase.assertEqualsByteArrays(xids[0].getBranchQualifier(), xid.getBranchQualifier());
+      ServiceTestBase.assertEqualsByteArrays(xids[0].getGlobalTransactionId(), xid.getGlobalTransactionId());
       xids = clientSession.recover(XAResource.TMENDRSCAN);
       Assert.assertEquals(xids.length, 0);
       clientSession.commit(xid, false);
@@ -973,8 +973,8 @@ public class BasicXaRecoveryTest extends ServiceTestBase
 
       Assert.assertEquals(xids.length, 1);
       Assert.assertEquals(xids[0].getFormatId(), xid.getFormatId());
-      UnitTestCase.assertEqualsByteArrays(xids[0].getBranchQualifier(), xid.getBranchQualifier());
-      UnitTestCase.assertEqualsByteArrays(xids[0].getGlobalTransactionId(), xid.getGlobalTransactionId());
+      ServiceTestBase.assertEqualsByteArrays(xids[0].getBranchQualifier(), xid.getBranchQualifier());
+      ServiceTestBase.assertEqualsByteArrays(xids[0].getGlobalTransactionId(), xid.getGlobalTransactionId());
       xids = clientSession.recover(XAResource.TMENDRSCAN);
       Assert.assertEquals(xids.length, 0);
       clientSession.commit(xid, false);
@@ -1047,8 +1047,8 @@ public class BasicXaRecoveryTest extends ServiceTestBase
 
       Assert.assertEquals(1, xids.length);
       Assert.assertEquals(xids[0].getFormatId(), xid.getFormatId());
-      UnitTestCase.assertEqualsByteArrays(xids[0].getBranchQualifier(), xid.getBranchQualifier());
-      UnitTestCase.assertEqualsByteArrays(xids[0].getGlobalTransactionId(), xid.getGlobalTransactionId());
+      ServiceTestBase.assertEqualsByteArrays(xids[0].getBranchQualifier(), xid.getBranchQualifier());
+      ServiceTestBase.assertEqualsByteArrays(xids[0].getGlobalTransactionId(), xid.getGlobalTransactionId());
       xids = clientSession.recover(XAResource.TMENDRSCAN);
       Assert.assertEquals(xids.length, 0);
       clientSession.rollback(xid);
@@ -1268,7 +1268,8 @@ public class BasicXaRecoveryTest extends ServiceTestBase
       clientSession = null;
       server.stop();
       server = null;
-      server = createServer(true, configuration, -1, -1, addressSettings, mbeanServer);
+      server = createServer(true, configuration, -1, -1, addressSettings);
+      server.setMBeanServer(mbeanServer);
 
       server.start();
       createClients();
@@ -1346,8 +1347,8 @@ public class BasicXaRecoveryTest extends ServiceTestBase
             if (found)
             {
                Assert.assertEquals(xid.getFormatId(), origXid.getFormatId());
-               UnitTestCase.assertEqualsByteArrays(xid.getBranchQualifier(), origXid.getBranchQualifier());
-               UnitTestCase.assertEqualsByteArrays(xid.getGlobalTransactionId(), origXid.getGlobalTransactionId());
+               ServiceTestBase.assertEqualsByteArrays(xid.getBranchQualifier(), origXid.getBranchQualifier());
+               ServiceTestBase.assertEqualsByteArrays(xid.getGlobalTransactionId(), origXid.getGlobalTransactionId());
                break;
             }
          }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/xa/XaTimeoutTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/xa/XaTimeoutTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/xa/XaTimeoutTest.java
index 3bcdbb3..09cd7a2 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/xa/XaTimeoutTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/xa/XaTimeoutTest.java
@@ -38,7 +38,7 @@ import org.apache.activemq.artemis.api.core.client.ClientSessionFactory;
 import org.apache.activemq.artemis.api.core.client.ActiveMQClient;
 import org.apache.activemq.artemis.api.core.client.MessageHandler;
 import org.apache.activemq.artemis.api.core.client.ServerLocator;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.apache.activemq.artemis.core.config.impl.ConfigurationImpl;
 import org.apache.activemq.artemis.core.protocol.core.Packet;
 import org.apache.activemq.artemis.core.protocol.core.impl.wireformat.SessionXAStartMessage;
@@ -56,7 +56,7 @@ import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
 
-public class XaTimeoutTest extends UnitTestCase
+public class XaTimeoutTest extends ServiceTestBase
 {
 
    private final Map<String, AddressSettings> addressSettings = new HashMap<String, AddressSettings>();
@@ -86,7 +86,7 @@ public class XaTimeoutTest extends UnitTestCase
       addressSettings.clear();
       configuration = createBasicConfig()
          .setTransactionTimeoutScanPeriod(500)
-         .addAcceptorConfiguration(new TransportConfiguration(UnitTestCase.INVM_ACCEPTOR_FACTORY));
+         .addAcceptorConfiguration(new TransportConfiguration(ServiceTestBase.INVM_ACCEPTOR_FACTORY));
       messagingService = addServer(ActiveMQServers.newActiveMQServer(configuration, false));
       // start the server
       messagingService.start();

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/util/ReplicatedBackupUtils.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/util/ReplicatedBackupUtils.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/util/ReplicatedBackupUtils.java
index ba20df8..379d761 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/util/ReplicatedBackupUtils.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/util/ReplicatedBackupUtils.java
@@ -49,14 +49,14 @@ public final class ReplicatedBackupUtils
 
       backupConfig.addConnectorConfiguration(BACKUP_NODE_NAME, backupConnector)
          .addConnectorConfiguration(LIVE_NODE_NAME, liveConnector)
-         .addClusterConfiguration(UnitTestCase.basicClusterConnectionConfig(BACKUP_NODE_NAME, LIVE_NODE_NAME))
+         .addClusterConfiguration(ServiceTestBase.basicClusterConnectionConfig(BACKUP_NODE_NAME, LIVE_NODE_NAME))
          .setHAPolicyConfiguration(new ReplicaPolicyConfiguration());
 
       liveConfig.setName(LIVE_NODE_NAME)
          .addConnectorConfiguration(LIVE_NODE_NAME, liveConnector)
          .addConnectorConfiguration(BACKUP_NODE_NAME, backupConnector)
          .setSecurityEnabled(false)
-         .addClusterConfiguration(UnitTestCase.basicClusterConnectionConfig(LIVE_NODE_NAME, BACKUP_NODE_NAME))
+         .addClusterConfiguration(ServiceTestBase.basicClusterConnectionConfig(LIVE_NODE_NAME, BACKUP_NODE_NAME))
          .setHAPolicyConfiguration(new ReplicatedPolicyConfiguration());
    }
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/util/TransportConfigurationUtils.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/util/TransportConfigurationUtils.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/util/TransportConfigurationUtils.java
index c7e8060..d373b7e 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/util/TransportConfigurationUtils.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/util/TransportConfigurationUtils.java
@@ -32,52 +32,52 @@ public final class TransportConfigurationUtils
 
    public static TransportConfiguration getInVMAcceptor(final boolean live)
    {
-      return transportConfiguration(UnitTestCase.INVM_ACCEPTOR_FACTORY, live);
+      return transportConfiguration(ServiceTestBase.INVM_ACCEPTOR_FACTORY, live);
    }
 
    public static TransportConfiguration getInVMConnector(final boolean live)
    {
-      return transportConfiguration(UnitTestCase.INVM_CONNECTOR_FACTORY, live);
+      return transportConfiguration(ServiceTestBase.INVM_CONNECTOR_FACTORY, live);
    }
 
    public static TransportConfiguration getInVMAcceptor(final boolean live, int server)
    {
-      return transportConfiguration(UnitTestCase.INVM_ACCEPTOR_FACTORY, live, server);
+      return transportConfiguration(ServiceTestBase.INVM_ACCEPTOR_FACTORY, live, server);
    }
 
    public static TransportConfiguration getInVMConnector(final boolean live, int server)
    {
-      return transportConfiguration(UnitTestCase.INVM_CONNECTOR_FACTORY, live, server);
+      return transportConfiguration(ServiceTestBase.INVM_CONNECTOR_FACTORY, live, server);
    }
 
    public static TransportConfiguration getNettyAcceptor(final boolean live, int server)
    {
-      return transportConfiguration(UnitTestCase.NETTY_ACCEPTOR_FACTORY, live, server);
+      return transportConfiguration(ServiceTestBase.NETTY_ACCEPTOR_FACTORY, live, server);
    }
 
    public static TransportConfiguration getNettyConnector(final boolean live, int server)
    {
-      return transportConfiguration(UnitTestCase.NETTY_CONNECTOR_FACTORY, live, server);
+      return transportConfiguration(ServiceTestBase.NETTY_CONNECTOR_FACTORY, live, server);
    }
 
    public static TransportConfiguration getInVMAcceptor(final boolean live, int server, String name)
    {
-      return transportConfiguration(UnitTestCase.INVM_ACCEPTOR_FACTORY, live, server, name);
+      return transportConfiguration(ServiceTestBase.INVM_ACCEPTOR_FACTORY, live, server, name);
    }
 
    public static TransportConfiguration getInVMConnector(final boolean live, int server, String name)
    {
-      return transportConfiguration(UnitTestCase.INVM_CONNECTOR_FACTORY, live, server, name);
+      return transportConfiguration(ServiceTestBase.INVM_CONNECTOR_FACTORY, live, server, name);
    }
 
    public static TransportConfiguration getNettyAcceptor(final boolean live, int server, String name)
    {
-      return transportConfiguration(UnitTestCase.NETTY_ACCEPTOR_FACTORY, live, server, name);
+      return transportConfiguration(ServiceTestBase.NETTY_ACCEPTOR_FACTORY, live, server, name);
    }
 
    public static TransportConfiguration getNettyConnector(final boolean live, int server, String name)
    {
-      return transportConfiguration(UnitTestCase.NETTY_CONNECTOR_FACTORY, live, server, name);
+      return transportConfiguration(ServiceTestBase.NETTY_CONNECTOR_FACTORY, live, server, name);
    }
 
    /**

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/MessageConsumerTest.java
----------------------------------------------------------------------
diff --git a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/MessageConsumerTest.java b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/MessageConsumerTest.java
index 9133ce8..c88b139 100644
--- a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/MessageConsumerTest.java
+++ b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/MessageConsumerTest.java
@@ -45,7 +45,7 @@ import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicInteger;
 
 import org.apache.activemq.artemis.jms.tests.util.ProxyAssertSupport;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.junit.Assert;
 import org.junit.Test;
 
@@ -4336,7 +4336,7 @@ public class MessageConsumerTest extends JMSTestCase
 
       public void waitForMessages() throws InterruptedException
       {
-         UnitTestCase.waitForLatch(latch);
+         ServiceTestBase.waitForLatch(latch);
       }
 
       public ExceptionRedelMessageListenerImpl(final Session sess)
@@ -4459,7 +4459,7 @@ public class MessageConsumerTest extends JMSTestCase
        */
       public void waitForMessages() throws InterruptedException
       {
-         UnitTestCase.waitForLatch(latch);
+         ServiceTestBase.waitForLatch(latch);
       }
 
       public void onMessage(final Message m)
@@ -4557,7 +4557,7 @@ public class MessageConsumerTest extends JMSTestCase
        */
       public void waitForMessages() throws InterruptedException
       {
-         UnitTestCase.waitForLatch(latch);
+         ServiceTestBase.waitForLatch(latch);
       }
 
       public void onMessage(final Message m)

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/message/JMSExpirationHeaderTest.java
----------------------------------------------------------------------
diff --git a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/message/JMSExpirationHeaderTest.java b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/message/JMSExpirationHeaderTest.java
index e37e5ae..8aa175e 100644
--- a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/message/JMSExpirationHeaderTest.java
+++ b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/message/JMSExpirationHeaderTest.java
@@ -23,7 +23,7 @@ import javax.jms.Message;
 
 import org.apache.activemq.artemis.jms.client.ActiveMQMessage;
 import org.apache.activemq.artemis.jms.tests.util.ProxyAssertSupport;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
@@ -141,7 +141,7 @@ public class JMSExpirationHeaderTest extends MessageHeaderTestBase
       }, "receiver thread");
       receiverThread.start();
 
-      UnitTestCase.waitForLatch(latch);
+      ServiceTestBase.waitForLatch(latch);
       ProxyAssertSupport.assertNull(expectedMessage);
    }
 
@@ -213,8 +213,8 @@ public class JMSExpirationHeaderTest extends MessageHeaderTestBase
       }, "sender thread");
       senderThread.start();
 
-      UnitTestCase.waitForLatch(senderLatch);
-      UnitTestCase.waitForLatch(receiverLatch);
+      ServiceTestBase.waitForLatch(senderLatch);
+      ServiceTestBase.waitForLatch(receiverLatch);
 
       if (testFailed)
       {
@@ -298,7 +298,7 @@ public class JMSExpirationHeaderTest extends MessageHeaderTestBase
       queueConsumer.close();
 
       // wait for the reading thread to conclude
-      UnitTestCase.waitForLatch(latch);
+      ServiceTestBase.waitForLatch(latch);
 
       log.trace("Expected message:" + expectedMessage);
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/selector/SelectorTest.java
----------------------------------------------------------------------
diff --git a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/selector/SelectorTest.java b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/selector/SelectorTest.java
index 43804f9..93e741f 100644
--- a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/selector/SelectorTest.java
+++ b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/selector/SelectorTest.java
@@ -31,7 +31,7 @@ import java.util.concurrent.CountDownLatch;
 import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
 import org.apache.activemq.artemis.jms.tests.ActiveMQServerTestCase;
 import org.apache.activemq.artemis.jms.tests.util.ProxyAssertSupport;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.junit.Assert;
 import org.junit.Test;
 
@@ -635,8 +635,8 @@ public class SelectorTest extends ActiveMQServerTestCase
             }
          }, "consumer thread 2").start();
 
-         UnitTestCase.waitForLatch(latch);
-         UnitTestCase.waitForLatch(latch2);
+         ServiceTestBase.waitForLatch(latch);
+         ServiceTestBase.waitForLatch(latch2);
 
          ProxyAssertSupport.assertEquals(5, received.size());
          for (Message m : received)

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/performance-tests/src/test/java/org/apache/activemq/artemis/tests/performance/paging/MeasurePagingMultiThreadTest.java
----------------------------------------------------------------------
diff --git a/tests/performance-tests/src/test/java/org/apache/activemq/artemis/tests/performance/paging/MeasurePagingMultiThreadTest.java b/tests/performance-tests/src/test/java/org/apache/activemq/artemis/tests/performance/paging/MeasurePagingMultiThreadTest.java
index c5b847b..6d70818 100644
--- a/tests/performance-tests/src/test/java/org/apache/activemq/artemis/tests/performance/paging/MeasurePagingMultiThreadTest.java
+++ b/tests/performance-tests/src/test/java/org/apache/activemq/artemis/tests/performance/paging/MeasurePagingMultiThreadTest.java
@@ -15,8 +15,6 @@
  * limitations under the License.
  */
 package org.apache.activemq.artemis.tests.performance.paging;
-import java.util.HashMap;
-import java.util.concurrent.CountDownLatch;
 
 import org.apache.activemq.artemis.api.core.ActiveMQException;
 import org.apache.activemq.artemis.api.core.SimpleString;
@@ -29,9 +27,11 @@ import org.apache.activemq.artemis.core.config.Configuration;
 import org.apache.activemq.artemis.core.server.ActiveMQServer;
 import org.apache.activemq.artemis.core.settings.impl.AddressSettings;
 import org.apache.activemq.artemis.tests.util.ServiceTestBase;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
 import org.junit.Test;
 
+import java.util.HashMap;
+import java.util.concurrent.CountDownLatch;
+
 public class MeasurePagingMultiThreadTest extends ServiceTestBase
 {
 
@@ -98,7 +98,7 @@ public class MeasurePagingMultiThreadTest extends ServiceTestBase
                try
                {
                   latchAlign.countDown();
-                  UnitTestCase.waitForLatch(latchStart);
+                  ServiceTestBase.waitForLatch(latchStart);
 
                   long start = System.currentTimeMillis();
                   sendMessages(NUMBER_OF_MESSAGES, producer, msg);
@@ -125,7 +125,7 @@ public class MeasurePagingMultiThreadTest extends ServiceTestBase
             senders[i].start();
          }
 
-         UnitTestCase.waitForLatch(latchAlign);
+         ServiceTestBase.waitForLatch(latchAlign);
 
          long timeStart = System.currentTimeMillis();
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/stress-tests/src/test/java/org/apache/activemq/artemis/tests/stress/journal/AddAndRemoveStressTest.java
----------------------------------------------------------------------
diff --git a/tests/stress-tests/src/test/java/org/apache/activemq/artemis/tests/stress/journal/AddAndRemoveStressTest.java b/tests/stress-tests/src/test/java/org/apache/activemq/artemis/tests/stress/journal/AddAndRemoveStressTest.java
index 4c96ad6..3cbe91f 100644
--- a/tests/stress-tests/src/test/java/org/apache/activemq/artemis/tests/stress/journal/AddAndRemoveStressTest.java
+++ b/tests/stress-tests/src/test/java/org/apache/activemq/artemis/tests/stress/journal/AddAndRemoveStressTest.java
@@ -19,7 +19,7 @@ import java.util.ArrayList;
 import java.util.List;
 
 import org.apache.activemq.artemis.tests.unit.core.journal.impl.fakes.SimpleEncoding;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.apache.activemq.artemis.core.journal.LoaderCallback;
 import org.apache.activemq.artemis.core.journal.PreparedTransactionInfo;
 import org.apache.activemq.artemis.core.journal.RecordInfo;
@@ -29,7 +29,7 @@ import org.apache.activemq.artemis.core.journal.impl.JournalImpl;
 import org.junit.Assert;
 import org.junit.Test;
 
-public class AddAndRemoveStressTest extends UnitTestCase
+public class AddAndRemoveStressTest extends ServiceTestBase
 {
 
    // Constants -----------------------------------------------------

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/stress-tests/src/test/java/org/apache/activemq/artemis/tests/stress/journal/CompactingStressTest.java
----------------------------------------------------------------------
diff --git a/tests/stress-tests/src/test/java/org/apache/activemq/artemis/tests/stress/journal/CompactingStressTest.java b/tests/stress-tests/src/test/java/org/apache/activemq/artemis/tests/stress/journal/CompactingStressTest.java
index c72e8ec..5b5b009 100644
--- a/tests/stress-tests/src/test/java/org/apache/activemq/artemis/tests/stress/journal/CompactingStressTest.java
+++ b/tests/stress-tests/src/test/java/org/apache/activemq/artemis/tests/stress/journal/CompactingStressTest.java
@@ -17,15 +17,6 @@
 package org.apache.activemq.artemis.tests.stress.journal;
 
 import org.apache.activemq.artemis.api.config.ActiveMQDefaultConfiguration;
-import org.apache.activemq.artemis.tests.util.ServiceTestBase;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
-import org.junit.Test;
-
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.atomic.AtomicInteger;
-
-import org.junit.Assert;
-
 import org.apache.activemq.artemis.api.core.Message;
 import org.apache.activemq.artemis.api.core.client.ClientConsumer;
 import org.apache.activemq.artemis.api.core.client.ClientMessage;
@@ -37,6 +28,12 @@ import org.apache.activemq.artemis.core.asyncio.impl.AsynchronousFileImpl;
 import org.apache.activemq.artemis.core.config.Configuration;
 import org.apache.activemq.artemis.core.server.ActiveMQServer;
 import org.apache.activemq.artemis.core.server.JournalType;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
+import org.junit.Assert;
+import org.junit.Test;
+
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.atomic.AtomicInteger;
 
 public class CompactingStressTest extends ServiceTestBase
 {
@@ -236,7 +233,7 @@ public class CompactingStressTest extends ServiceTestBase
             latchReady.countDown();
             try
             {
-               UnitTestCase.waitForLatch(latchStart);
+               ServiceTestBase.waitForLatch(latchStart);
                session = sf.createSession(true, true);
                sessionSlow = sf.createSession(false, false);
                ClientProducer prod = session.createProducer(CompactingStressTest.AD2);
@@ -299,7 +296,7 @@ public class CompactingStressTest extends ServiceTestBase
             latchReady.countDown();
             try
             {
-               UnitTestCase.waitForLatch(latchStart);
+               ServiceTestBase.waitForLatch(latchStart);
                session = sf.createSession(true, true);
                session.start();
                ClientConsumer cons = session.createConsumer(CompactingStressTest.Q2);
@@ -335,7 +332,7 @@ public class CompactingStressTest extends ServiceTestBase
       FastProducer p1 = new FastProducer();
       p1.start();
 
-      UnitTestCase.waitForLatch(latchReady);
+      ServiceTestBase.waitForLatch(latchReady);
       latchStart.countDown();
 
       p1.join();

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/stress-tests/src/test/java/org/apache/activemq/artemis/tests/stress/journal/JournalCleanupCompactStressTest.java
----------------------------------------------------------------------
diff --git a/tests/stress-tests/src/test/java/org/apache/activemq/artemis/tests/stress/journal/JournalCleanupCompactStressTest.java b/tests/stress-tests/src/test/java/org/apache/activemq/artemis/tests/stress/journal/JournalCleanupCompactStressTest.java
index 54bfc73..36fcaed 100644
--- a/tests/stress-tests/src/test/java/org/apache/activemq/artemis/tests/stress/journal/JournalCleanupCompactStressTest.java
+++ b/tests/stress-tests/src/test/java/org/apache/activemq/artemis/tests/stress/journal/JournalCleanupCompactStressTest.java
@@ -16,25 +16,7 @@
  */
 package org.apache.activemq.artemis.tests.stress.journal;
 
-import java.io.File;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.Executor;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-import java.util.concurrent.LinkedBlockingDeque;
-import java.util.concurrent.Semaphore;
-import java.util.concurrent.ThreadFactory;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.atomic.AtomicInteger;
-import java.util.concurrent.locks.ReadWriteLock;
-import java.util.concurrent.locks.ReentrantReadWriteLock;
-
 import org.apache.activemq.artemis.api.config.ActiveMQDefaultConfiguration;
-import org.apache.activemq.artemis.tests.util.ServiceTestBase;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
 import org.apache.activemq.artemis.core.asyncio.impl.AsynchronousFileImpl;
 import org.apache.activemq.artemis.core.journal.IOAsyncTask;
 import org.apache.activemq.artemis.core.journal.PreparedTransactionInfo;
@@ -46,6 +28,7 @@ import org.apache.activemq.artemis.core.journal.impl.JournalImpl;
 import org.apache.activemq.artemis.core.journal.impl.NIOSequentialFileFactory;
 import org.apache.activemq.artemis.core.persistence.impl.journal.OperationContextImpl;
 import org.apache.activemq.artemis.tests.util.RandomUtil;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.apache.activemq.artemis.utils.ActiveMQThreadFactory;
 import org.apache.activemq.artemis.utils.OrderedExecutorFactory;
 import org.apache.activemq.artemis.utils.SimpleIDGenerator;
@@ -53,6 +36,22 @@ import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.Executor;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.LinkedBlockingDeque;
+import java.util.concurrent.Semaphore;
+import java.util.concurrent.ThreadFactory;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicInteger;
+import java.util.concurrent.locks.ReadWriteLock;
+import java.util.concurrent.locks.ReentrantReadWriteLock;
+
 public class JournalCleanupCompactStressTest extends ServiceTestBase
 {
 
@@ -267,7 +266,7 @@ public class JournalCleanupCompactStressTest extends ServiceTestBase
          }
       });
 
-      UnitTestCase.waitForLatch(latchExecutorDone);
+      ServiceTestBase.waitForLatch(latchExecutorDone);
 
       journal.stop();
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/stress-tests/src/test/java/org/apache/activemq/artemis/tests/stress/journal/LargeJournalStressTest.java
----------------------------------------------------------------------
diff --git a/tests/stress-tests/src/test/java/org/apache/activemq/artemis/tests/stress/journal/LargeJournalStressTest.java b/tests/stress-tests/src/test/java/org/apache/activemq/artemis/tests/stress/journal/LargeJournalStressTest.java
index 9431f0b..aef8924 100644
--- a/tests/stress-tests/src/test/java/org/apache/activemq/artemis/tests/stress/journal/LargeJournalStressTest.java
+++ b/tests/stress-tests/src/test/java/org/apache/activemq/artemis/tests/stress/journal/LargeJournalStressTest.java
@@ -16,9 +16,6 @@
  */
 package org.apache.activemq.artemis.tests.stress.journal;
 
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.atomic.AtomicInteger;
-
 import org.apache.activemq.artemis.api.config.ActiveMQDefaultConfiguration;
 import org.apache.activemq.artemis.api.core.client.ClientConsumer;
 import org.apache.activemq.artemis.api.core.client.ClientMessage;
@@ -26,16 +23,18 @@ 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.UnitTestCase;
 import org.apache.activemq.artemis.core.config.Configuration;
 import org.apache.activemq.artemis.core.server.ActiveMQServer;
 import org.apache.activemq.artemis.core.server.JournalType;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.junit.After;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
 
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.atomic.AtomicInteger;
+
 public class LargeJournalStressTest extends ServiceTestBase
 {
 
@@ -104,7 +103,7 @@ public class LargeJournalStressTest extends ServiceTestBase
             latchReady.countDown();
             try
             {
-               UnitTestCase.waitForLatch(latchStart);
+               ServiceTestBase.waitForLatch(latchStart);
                session = sf.createSession(true, true);
                sessionSlow = sf.createSession(false, false);
                ClientProducer prod = session.createProducer(LargeJournalStressTest.AD2);
@@ -170,7 +169,7 @@ public class LargeJournalStressTest extends ServiceTestBase
             latchReady.countDown();
             try
             {
-               UnitTestCase.waitForLatch(latchStart);
+               ServiceTestBase.waitForLatch(latchStart);
                session = sf.createSession(true, true);
                session.start();
                ClientConsumer cons = session.createConsumer(LargeJournalStressTest.Q2);
@@ -206,7 +205,7 @@ public class LargeJournalStressTest extends ServiceTestBase
       FastProducer p1 = new FastProducer();
       p1.start();
 
-      UnitTestCase.waitForLatch(latchReady);
+      ServiceTestBase.waitForLatch(latchReady);
       latchStart.countDown();
 
       p1.join();

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/stress-tests/src/test/java/org/apache/activemq/artemis/tests/stress/journal/MultiThreadConsumerStressTest.java
----------------------------------------------------------------------
diff --git a/tests/stress-tests/src/test/java/org/apache/activemq/artemis/tests/stress/journal/MultiThreadConsumerStressTest.java b/tests/stress-tests/src/test/java/org/apache/activemq/artemis/tests/stress/journal/MultiThreadConsumerStressTest.java
index 97a6a0e..3f13c3e 100644
--- a/tests/stress-tests/src/test/java/org/apache/activemq/artemis/tests/stress/journal/MultiThreadConsumerStressTest.java
+++ b/tests/stress-tests/src/test/java/org/apache/activemq/artemis/tests/stress/journal/MultiThreadConsumerStressTest.java
@@ -16,9 +16,6 @@
  */
 package org.apache.activemq.artemis.tests.stress.journal;
 
-import java.util.ArrayList;
-import java.util.concurrent.CountDownLatch;
-
 import org.apache.activemq.artemis.api.config.ActiveMQDefaultConfiguration;
 import org.apache.activemq.artemis.api.core.SimpleString;
 import org.apache.activemq.artemis.api.core.client.ClientConsumer;
@@ -27,7 +24,6 @@ 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.UnitTestCase;
 import org.apache.activemq.artemis.core.config.Configuration;
 import org.apache.activemq.artemis.core.server.ActiveMQServer;
 import org.apache.activemq.artemis.core.server.JournalType;
@@ -36,6 +32,9 @@ import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
 
+import java.util.ArrayList;
+import java.util.concurrent.CountDownLatch;
+
 /**
  * A MultiThreadConsumerStressTest
  * <p/>
@@ -113,7 +112,7 @@ public class MultiThreadConsumerStressTest extends ServiceTestBase
          threads.add(cons[i]);
       }
 
-      UnitTestCase.waitForLatch(latchReady);
+      ServiceTestBase.waitForLatch(latchReady);
       latchStart.countDown();
 
       for (BaseThread t : threads)
@@ -243,7 +242,7 @@ public class MultiThreadConsumerStressTest extends ServiceTestBase
          latchReady.countDown();
          try
          {
-            UnitTestCase.waitForLatch(latchStart);
+            ServiceTestBase.waitForLatch(latchStart);
             session = sf.createSession(false, false);
             ClientProducer prod = session.createProducer(ADDRESS);
             for (int i = 0; i < numberOfMessages; i++)
@@ -304,7 +303,7 @@ public class MultiThreadConsumerStressTest extends ServiceTestBase
          latchReady.countDown();
          try
          {
-            UnitTestCase.waitForLatch(latchStart);
+            ServiceTestBase.waitForLatch(latchStart);
             session = sf.createSession(false, false);
             session.start();
             ClientConsumer cons = session.createConsumer(QUEUE);

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/stress-tests/src/test/java/org/apache/activemq/artemis/tests/stress/journal/NIOMultiThreadCompactorStressTest.java
----------------------------------------------------------------------
diff --git a/tests/stress-tests/src/test/java/org/apache/activemq/artemis/tests/stress/journal/NIOMultiThreadCompactorStressTest.java b/tests/stress-tests/src/test/java/org/apache/activemq/artemis/tests/stress/journal/NIOMultiThreadCompactorStressTest.java
index c5913d2..0a85c53 100644
--- a/tests/stress-tests/src/test/java/org/apache/activemq/artemis/tests/stress/journal/NIOMultiThreadCompactorStressTest.java
+++ b/tests/stress-tests/src/test/java/org/apache/activemq/artemis/tests/stress/journal/NIOMultiThreadCompactorStressTest.java
@@ -16,12 +16,6 @@
  */
 package org.apache.activemq.artemis.tests.stress.journal;
 
-import javax.transaction.xa.XAResource;
-import javax.transaction.xa.Xid;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.concurrent.CountDownLatch;
-
 import org.apache.activemq.artemis.api.config.ActiveMQDefaultConfiguration;
 import org.apache.activemq.artemis.api.core.ActiveMQException;
 import org.apache.activemq.artemis.api.core.SimpleString;
@@ -40,11 +34,16 @@ import org.apache.activemq.artemis.core.journal.impl.NIOSequentialFileFactory;
 import org.apache.activemq.artemis.core.server.ActiveMQServer;
 import org.apache.activemq.artemis.core.server.JournalType;
 import org.apache.activemq.artemis.tests.util.ServiceTestBase;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
 
+import javax.transaction.xa.XAResource;
+import javax.transaction.xa.Xid;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.CountDownLatch;
+
 public class NIOMultiThreadCompactorStressTest extends ServiceTestBase
 {
 
@@ -231,7 +230,7 @@ public class NIOMultiThreadCompactorStressTest extends ServiceTestBase
          threads.add(cons[i]);
       }
 
-      UnitTestCase.waitForLatch(latchReady);
+      ServiceTestBase.waitForLatch(latchReady);
       latchStart.countDown();
 
       for (BaseThread t : threads)
@@ -440,7 +439,7 @@ public class NIOMultiThreadCompactorStressTest extends ServiceTestBase
          latchReady.countDown();
          try
          {
-            UnitTestCase.waitForLatch(latchStart);
+            ServiceTestBase.waitForLatch(latchStart);
             session = sf.createSession(!transactional, !transactional);
             ClientProducer prod = session.createProducer(ADDRESS);
             for (int i = 0; i < numberOfMessages; i++)
@@ -509,7 +508,7 @@ public class NIOMultiThreadCompactorStressTest extends ServiceTestBase
          latchReady.countDown();
          try
          {
-            UnitTestCase.waitForLatch(latchStart);
+            ServiceTestBase.waitForLatch(latchStart);
             session = sf.createSession(!transactional, !transactional);
             session.start();
             ClientConsumer cons = session.createConsumer(QUEUE);

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/stress-tests/src/test/java/org/apache/activemq/artemis/tests/stress/stomp/StompStressTest.java
----------------------------------------------------------------------
diff --git a/tests/stress-tests/src/test/java/org/apache/activemq/artemis/tests/stress/stomp/StompStressTest.java b/tests/stress-tests/src/test/java/org/apache/activemq/artemis/tests/stress/stomp/StompStressTest.java
index e06dcce..e9d4404 100644
--- a/tests/stress-tests/src/test/java/org/apache/activemq/artemis/tests/stress/stomp/StompStressTest.java
+++ b/tests/stress-tests/src/test/java/org/apache/activemq/artemis/tests/stress/stomp/StompStressTest.java
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 package org.apache.activemq.artemis.tests.stress.stomp;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.junit.Before;
 import org.junit.After;
 
@@ -43,7 +43,7 @@ import org.apache.activemq.artemis.core.remoting.impl.netty.TransportConstants;
 import org.apache.activemq.artemis.core.server.ActiveMQServer;
 import org.apache.activemq.artemis.core.server.ActiveMQServers;
 
-public class StompStressTest extends UnitTestCase
+public class StompStressTest extends ServiceTestBase
 {
    private static final int COUNT = 1000;
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/timing-tests/src/test/java/org/apache/activemq/artemis/tests/timing/core/journal/impl/AIOJournalImplTest.java
----------------------------------------------------------------------
diff --git a/tests/timing-tests/src/test/java/org/apache/activemq/artemis/tests/timing/core/journal/impl/AIOJournalImplTest.java b/tests/timing-tests/src/test/java/org/apache/activemq/artemis/tests/timing/core/journal/impl/AIOJournalImplTest.java
index 7182ebc..972828d 100644
--- a/tests/timing-tests/src/test/java/org/apache/activemq/artemis/tests/timing/core/journal/impl/AIOJournalImplTest.java
+++ b/tests/timing-tests/src/test/java/org/apache/activemq/artemis/tests/timing/core/journal/impl/AIOJournalImplTest.java
@@ -17,7 +17,7 @@
 package org.apache.activemq.artemis.tests.timing.core.journal.impl;
 import java.io.File;
 
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.apache.activemq.artemis.core.journal.SequentialFileFactory;
 import org.apache.activemq.artemis.core.journal.impl.AIOSequentialFileFactory;
 import org.junit.BeforeClass;
@@ -35,7 +35,7 @@ public class AIOJournalImplTest extends JournalImplTestUnit
    {
       File file = new File(getTestDir());
 
-      UnitTestCase.deleteDirectory(file);
+      ServiceTestBase.deleteDirectory(file);
 
       file.mkdir();
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/timing-tests/src/test/java/org/apache/activemq/artemis/tests/timing/core/journal/impl/NIOJournalImplTest.java
----------------------------------------------------------------------
diff --git a/tests/timing-tests/src/test/java/org/apache/activemq/artemis/tests/timing/core/journal/impl/NIOJournalImplTest.java b/tests/timing-tests/src/test/java/org/apache/activemq/artemis/tests/timing/core/journal/impl/NIOJournalImplTest.java
index 71477d1..c4654df 100644
--- a/tests/timing-tests/src/test/java/org/apache/activemq/artemis/tests/timing/core/journal/impl/NIOJournalImplTest.java
+++ b/tests/timing-tests/src/test/java/org/apache/activemq/artemis/tests/timing/core/journal/impl/NIOJournalImplTest.java
@@ -18,7 +18,7 @@ package org.apache.activemq.artemis.tests.timing.core.journal.impl;
 
 import java.io.File;
 
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.apache.activemq.artemis.core.journal.SequentialFileFactory;
 import org.apache.activemq.artemis.core.journal.impl.NIOSequentialFileFactory;
 import org.apache.activemq.artemis.tests.unit.UnitTestLogger;
@@ -36,7 +36,7 @@ public class NIOJournalImplTest extends JournalImplTestUnit
 
       NIOJournalImplTest.log.debug("deleting directory " + journalDir);
 
-      UnitTestCase.deleteDirectory(file);
+      ServiceTestBase.deleteDirectory(file);
 
       file.mkdir();
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/timing-tests/src/test/java/org/apache/activemq/artemis/tests/timing/core/server/impl/QueueConcurrentTest.java
----------------------------------------------------------------------
diff --git a/tests/timing-tests/src/test/java/org/apache/activemq/artemis/tests/timing/core/server/impl/QueueConcurrentTest.java b/tests/timing-tests/src/test/java/org/apache/activemq/artemis/tests/timing/core/server/impl/QueueConcurrentTest.java
index b57903c..1bdbb33 100644
--- a/tests/timing-tests/src/test/java/org/apache/activemq/artemis/tests/timing/core/server/impl/QueueConcurrentTest.java
+++ b/tests/timing-tests/src/test/java/org/apache/activemq/artemis/tests/timing/core/server/impl/QueueConcurrentTest.java
@@ -16,7 +16,7 @@
  */
 package org.apache.activemq.artemis.tests.timing.core.server.impl;
 import org.apache.activemq.artemis.tests.unit.core.server.impl.fakes.FakeQueueFactory;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.junit.Before;
 import org.junit.After;
 
@@ -40,7 +40,7 @@ import org.apache.activemq.artemis.tests.unit.core.server.impl.fakes.FakeConsume
  *
  * All the concurrent queue tests go in here
  */
-public class QueueConcurrentTest extends UnitTestCase
+public class QueueConcurrentTest extends ServiceTestBase
 {
    private static final UnitTestLogger log = UnitTestLogger.LOGGER;
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/timing-tests/src/test/java/org/apache/activemq/artemis/tests/timing/core/server/impl/QueueImplTest.java
----------------------------------------------------------------------
diff --git a/tests/timing-tests/src/test/java/org/apache/activemq/artemis/tests/timing/core/server/impl/QueueImplTest.java b/tests/timing-tests/src/test/java/org/apache/activemq/artemis/tests/timing/core/server/impl/QueueImplTest.java
index 30fb6c4..96d1f62 100644
--- a/tests/timing-tests/src/test/java/org/apache/activemq/artemis/tests/timing/core/server/impl/QueueImplTest.java
+++ b/tests/timing-tests/src/test/java/org/apache/activemq/artemis/tests/timing/core/server/impl/QueueImplTest.java
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 package org.apache.activemq.artemis.tests.timing.core.server.impl;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.junit.Before;
 import org.junit.After;
 
@@ -38,7 +38,7 @@ import org.apache.activemq.artemis.core.server.MessageReference;
 import org.apache.activemq.artemis.core.server.impl.QueueImpl;
 import org.apache.activemq.artemis.tests.unit.core.server.impl.fakes.FakeConsumer;
 
-public class QueueImplTest extends UnitTestCase
+public class QueueImplTest extends ServiceTestBase
 {
    private static final SimpleString queue1 = new SimpleString("queue1");
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/timing-tests/src/test/java/org/apache/activemq/artemis/tests/timing/jms/bridge/impl/JMSBridgeImplTest.java
----------------------------------------------------------------------
diff --git a/tests/timing-tests/src/test/java/org/apache/activemq/artemis/tests/timing/jms/bridge/impl/JMSBridgeImplTest.java b/tests/timing-tests/src/test/java/org/apache/activemq/artemis/tests/timing/jms/bridge/impl/JMSBridgeImplTest.java
index b4905a5..a7c7440 100644
--- a/tests/timing-tests/src/test/java/org/apache/activemq/artemis/tests/timing/jms/bridge/impl/JMSBridgeImplTest.java
+++ b/tests/timing-tests/src/test/java/org/apache/activemq/artemis/tests/timing/jms/bridge/impl/JMSBridgeImplTest.java
@@ -50,7 +50,7 @@ import org.apache.activemq.artemis.api.jms.JMSFactoryType;
 import org.apache.activemq.artemis.api.jms.management.JMSQueueControl;
 import org.apache.activemq.artemis.tests.unit.UnitTestLogger;
 import org.apache.activemq.artemis.tests.unit.util.InVMNamingContext;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.apache.activemq.artemis.core.config.Configuration;
 import org.apache.activemq.artemis.core.registry.JndiBindingRegistry;
 import org.apache.activemq.artemis.core.remoting.impl.invm.InVMAcceptorFactory;
@@ -71,7 +71,7 @@ import org.junit.Rule;
 import org.junit.Test;
 import org.junit.rules.ExpectedException;
 
-public class JMSBridgeImplTest extends UnitTestCase
+public class JMSBridgeImplTest extends ServiceTestBase
 {
    // Constants -----------------------------------------------------
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/timing-tests/src/test/java/org/apache/activemq/artemis/tests/timing/util/ReusableLatchTest.java
----------------------------------------------------------------------
diff --git a/tests/timing-tests/src/test/java/org/apache/activemq/artemis/tests/timing/util/ReusableLatchTest.java b/tests/timing-tests/src/test/java/org/apache/activemq/artemis/tests/timing/util/ReusableLatchTest.java
index 2189b4e..47ea01f 100644
--- a/tests/timing-tests/src/test/java/org/apache/activemq/artemis/tests/timing/util/ReusableLatchTest.java
+++ b/tests/timing-tests/src/test/java/org/apache/activemq/artemis/tests/timing/util/ReusableLatchTest.java
@@ -16,14 +16,14 @@
  */
 package org.apache.activemq.artemis.tests.timing.util;
 
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.junit.Test;
 
 import org.junit.Assert;
 
 import org.apache.activemq.artemis.utils.ReusableLatch;
 
-public class ReusableLatchTest extends UnitTestCase
+public class ReusableLatchTest extends ServiceTestBase
 {
    @Test
    public void testTimeout() throws Exception

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/timing-tests/src/test/java/org/apache/activemq/artemis/tests/timing/util/TokenBucketLimiterImplTest.java
----------------------------------------------------------------------
diff --git a/tests/timing-tests/src/test/java/org/apache/activemq/artemis/tests/timing/util/TokenBucketLimiterImplTest.java b/tests/timing-tests/src/test/java/org/apache/activemq/artemis/tests/timing/util/TokenBucketLimiterImplTest.java
index 6e0af14..eabc9fb 100644
--- a/tests/timing-tests/src/test/java/org/apache/activemq/artemis/tests/timing/util/TokenBucketLimiterImplTest.java
+++ b/tests/timing-tests/src/test/java/org/apache/activemq/artemis/tests/timing/util/TokenBucketLimiterImplTest.java
@@ -21,12 +21,12 @@ import java.util.concurrent.atomic.AtomicBoolean;
 import java.util.concurrent.atomic.AtomicInteger;
 
 import org.apache.activemq.artemis.tests.unit.UnitTestLogger;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.apache.activemq.artemis.utils.TokenBucketLimiterImpl;
 import org.junit.Assert;
 import org.junit.Test;
 
-public class TokenBucketLimiterImplTest extends UnitTestCase
+public class TokenBucketLimiterImplTest extends ServiceTestBase
 {
    private static final UnitTestLogger log = UnitTestLogger.LOGGER;
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/timing-tests/src/test/java/org/apache/activemq/artemis/tests/timing/util/UTF8Test.java
----------------------------------------------------------------------
diff --git a/tests/timing-tests/src/test/java/org/apache/activemq/artemis/tests/timing/util/UTF8Test.java b/tests/timing-tests/src/test/java/org/apache/activemq/artemis/tests/timing/util/UTF8Test.java
index ab37d4a..a864a2e 100644
--- a/tests/timing-tests/src/test/java/org/apache/activemq/artemis/tests/timing/util/UTF8Test.java
+++ b/tests/timing-tests/src/test/java/org/apache/activemq/artemis/tests/timing/util/UTF8Test.java
@@ -23,10 +23,10 @@ import org.junit.Test;
 
 import org.junit.Assert;
 
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.apache.activemq.artemis.utils.UTF8Util;
 
-public class UTF8Test extends UnitTestCase
+public class UTF8Test extends ServiceTestBase
 {
 
    private final String str = "abcdef&^*&!^ghijkl\uB5E2\uCAC7\uB2BB\uB7DD\uB7C7\uB3A3\uBCE4\uB5A5" + "abcdef&^*&!^ghijkl\uB5E2\uCAC7\uB2BB\uB7DD\uB7C7\uB3A3\uBCE4\uB5A5"

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/asyncio/AIOTestBase.java
----------------------------------------------------------------------
diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/asyncio/AIOTestBase.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/asyncio/AIOTestBase.java
index d0d5db4..ae88e0f 100644
--- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/asyncio/AIOTestBase.java
+++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/asyncio/AIOTestBase.java
@@ -22,7 +22,7 @@ import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.atomic.AtomicInteger;
 
 import org.apache.activemq.artemis.api.core.ActiveMQException;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.apache.activemq.artemis.core.asyncio.AIOCallback;
 import org.apache.activemq.artemis.core.asyncio.impl.AsynchronousFileImpl;
 import org.junit.After;
@@ -32,7 +32,7 @@ import org.junit.Before;
 /**
  * The base class for AIO Tests
  */
-public abstract class AIOTestBase extends UnitTestCase
+public abstract class AIOTestBase extends ServiceTestBase
 {
    // The AIO Test must use a local filesystem. Sometimes $HOME is on a NFS on
    // most enterprise systems

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/asyncio/AsynchronousFileTest.java
----------------------------------------------------------------------
diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/asyncio/AsynchronousFileTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/asyncio/AsynchronousFileTest.java
index 4e09983..55471a9 100644
--- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/asyncio/AsynchronousFileTest.java
+++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/asyncio/AsynchronousFileTest.java
@@ -39,7 +39,7 @@ import org.apache.activemq.artemis.core.asyncio.BufferCallback;
 import org.apache.activemq.artemis.core.asyncio.impl.AsynchronousFileImpl;
 import org.apache.activemq.artemis.core.journal.impl.AIOSequentialFileFactory;
 import org.apache.activemq.artemis.tests.unit.UnitTestLogger;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.apache.activemq.artemis.utils.ActiveMQThreadFactory;
 import org.junit.After;
 import org.junit.Assert;
@@ -151,7 +151,7 @@ public class AsynchronousFileTest extends AIOTestBase
 
       for (int i = 0; i < 1024; i++)
       {
-         write.put(UnitTestCase.getSamplebyte(i));
+         write.put(ServiceTestBase.getSamplebyte(i));
       }
 
       final CountDownLatch latch = new CountDownLatch(1);
@@ -177,7 +177,7 @@ public class AsynchronousFileTest extends AIOTestBase
 
       write = null;
 
-      UnitTestCase.forceGC(bufferCheck2, 5000);
+      ServiceTestBase.forceGC(bufferCheck2, 5000);
 
       assertNull(bufferCheck2.get());
 
@@ -185,7 +185,7 @@ public class AsynchronousFileTest extends AIOTestBase
 
       controller = null;
 
-      UnitTestCase.forceGC(bufferCheck, 5000);
+      ServiceTestBase.forceGC(bufferCheck, 5000);
 
       assertNull(bufferCheck.get());
    }
@@ -272,8 +272,8 @@ public class AsynchronousFileTest extends AIOTestBase
 
          }
 
-         UnitTestCase.waitForLatch(latchDone);
-         UnitTestCase.waitForLatch(latchDone2);
+         ServiceTestBase.waitForLatch(latchDone);
+         ServiceTestBase.waitForLatch(latchDone2);
 
          CountDownCallback.checkResults(numberOfLines, listResult1);
          CountDownCallback.checkResults(numberOfLines, listResult2);
@@ -626,7 +626,7 @@ public class AsynchronousFileTest extends AIOTestBase
             final ByteBuffer buffer0 = AsynchronousFileImpl.newBuffer(SIZE);
             for (int j = 0; j < SIZE; j++)
             {
-               buffer0.put(UnitTestCase.getSamplebyte(j));
+               buffer0.put(ServiceTestBase.getSamplebyte(j));
             }
 
             CountDownCallback aio = new CountDownCallback(latch, errors, result, i);
@@ -673,7 +673,7 @@ public class AsynchronousFileTest extends AIOTestBase
          for (int count = 0; count < SIZE; count++)
          {
             Assert.assertEquals("byte position " + count + " differs on line " + i + " position = " + count,
-                                UnitTestCase.getSamplebyte(count),
+                                ServiceTestBase.getSamplebyte(count),
                                 bytesRead[count]);
          }
       }
@@ -803,7 +803,7 @@ public class AsynchronousFileTest extends AIOTestBase
 
       }
 
-      UnitTestCase.waitForLatch(latchDone);
+      ServiceTestBase.waitForLatch(latchDone);
 
       long timeTotal = System.currentTimeMillis() - valueInitial;
 
@@ -853,7 +853,7 @@ public class AsynchronousFileTest extends AIOTestBase
          CountDownLatch latchDone = new CountDownLatch(1);
          CountDownCallback aioBlock = new CountDownCallback(latchDone, null, null, 0);
          controller.write(i * 512, 512, buffer, aioBlock);
-         UnitTestCase.waitForLatch(latchDone);
+         ServiceTestBase.waitForLatch(latchDone);
          assertTrue(aioBlock.doneCalled);
          assertEquals(0, aioBlock.errorCalled);
       }
@@ -922,7 +922,7 @@ public class AsynchronousFileTest extends AIOTestBase
       CountDownCallback aioBlock = new CountDownCallback(latchDone, null, null, 0);
       controller.write(11, 512, buffer, aioBlock);
 
-      UnitTestCase.waitForLatch(latchDone);
+      ServiceTestBase.waitForLatch(latchDone);
 
       assertTrue(aioBlock.errorCalled != 0);
       assertFalse(aioBlock.doneCalled);

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/asyncio/MultiThreadAsynchronousFileTest.java
----------------------------------------------------------------------
diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/asyncio/MultiThreadAsynchronousFileTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/asyncio/MultiThreadAsynchronousFileTest.java
index 560735f..be37b83 100644
--- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/asyncio/MultiThreadAsynchronousFileTest.java
+++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/asyncio/MultiThreadAsynchronousFileTest.java
@@ -25,7 +25,7 @@ import java.util.concurrent.Executors;
 import java.util.concurrent.atomic.AtomicInteger;
 
 import org.apache.activemq.artemis.api.core.ActiveMQExceptionType;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.apache.activemq.artemis.core.asyncio.AIOCallback;
 import org.apache.activemq.artemis.core.asyncio.impl.AsynchronousFileImpl;
 import org.apache.activemq.artemis.core.journal.impl.AIOSequentialFileFactory;
@@ -125,7 +125,7 @@ public class MultiThreadAsynchronousFileTest extends AIOTestBase
          }
 
          latchStart.countDown();
-         UnitTestCase.waitForLatch(latchStart);
+         ServiceTestBase.waitForLatch(latchStart);
 
          long startTime = System.currentTimeMillis();
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/client/impl/LargeMessageBufferTest.java
----------------------------------------------------------------------
diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/client/impl/LargeMessageBufferTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/client/impl/LargeMessageBufferTest.java
index 71b78b0..4aa7391 100644
--- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/client/impl/LargeMessageBufferTest.java
+++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/client/impl/LargeMessageBufferTest.java
@@ -36,7 +36,7 @@ import org.apache.activemq.artemis.api.core.SimpleString;
 import org.apache.activemq.artemis.api.core.client.ClientMessage;
 import org.apache.activemq.artemis.api.core.client.ClientSession;
 import org.apache.activemq.artemis.api.core.client.MessageHandler;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.apache.activemq.artemis.core.client.impl.ClientConsumerInternal;
 import org.apache.activemq.artemis.core.client.impl.ClientLargeMessageInternal;
 import org.apache.activemq.artemis.core.client.impl.ClientMessageInternal;
@@ -52,7 +52,7 @@ import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
 
-public class LargeMessageBufferTest extends UnitTestCase
+public class LargeMessageBufferTest extends ServiceTestBase
 {
 
    // Constants -----------------------------------------------------
@@ -340,7 +340,7 @@ public class LargeMessageBufferTest extends UnitTestCase
 
       t.start();
 
-      UnitTestCase.waitForLatch(latchGo);
+      ServiceTestBase.waitForLatch(latchGo);
 
       buffer.cancel();
 
@@ -632,7 +632,7 @@ public class LargeMessageBufferTest extends UnitTestCase
          }
       });
 
-      UnitTestCase.waitForLatch(latchBytesWritten1);
+      ServiceTestBase.waitForLatch(latchBytesWritten1);
 
       try
       {

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/config/impl/ConfigurationValidationTest.java
----------------------------------------------------------------------
diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/config/impl/ConfigurationValidationTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/config/impl/ConfigurationValidationTest.java
index 5972d3d..a2f5d33 100644
--- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/config/impl/ConfigurationValidationTest.java
+++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/config/impl/ConfigurationValidationTest.java
@@ -22,11 +22,11 @@ import org.junit.Test;
 import org.junit.Assert;
 
 import org.apache.activemq.artemis.core.config.impl.FileConfiguration;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.apache.activemq.artemis.utils.XMLUtil;
 import org.w3c.dom.Element;
 
-public class ConfigurationValidationTest extends UnitTestCase
+public class ConfigurationValidationTest extends ServiceTestBase
 {
 
    // Constants -----------------------------------------------------

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/config/impl/ConnectorsServiceTest.java
----------------------------------------------------------------------
diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/config/impl/ConnectorsServiceTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/config/impl/ConnectorsServiceTest.java
index b508feb..a1557be 100644
--- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/config/impl/ConnectorsServiceTest.java
+++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/config/impl/ConnectorsServiceTest.java
@@ -21,7 +21,7 @@ import java.util.HashMap;
 import java.util.List;
 
 import org.apache.activemq.artemis.tests.unit.core.config.impl.fakes.FakeConnectorServiceFactory;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.apache.activemq.artemis.core.config.Configuration;
 import org.apache.activemq.artemis.core.config.ConnectorServiceConfiguration;
 import org.apache.activemq.artemis.core.config.impl.ConfigurationImpl;
@@ -32,7 +32,7 @@ import org.apache.activemq.artemis.tests.unit.core.config.impl.fakes.FakeConnect
 import org.junit.Before;
 import org.junit.Test;
 
-public class ConnectorsServiceTest extends UnitTestCase
+public class ConnectorsServiceTest extends ServiceTestBase
 {
    private Configuration configuration;
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/config/impl/TransportConfigurationTest.java
----------------------------------------------------------------------
diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/config/impl/TransportConfigurationTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/config/impl/TransportConfigurationTest.java
index 41058d9..cd3b0e2 100644
--- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/config/impl/TransportConfigurationTest.java
+++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/config/impl/TransportConfigurationTest.java
@@ -16,14 +16,14 @@
  */
 package org.apache.activemq.artemis.tests.unit.core.config.impl;
 
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.junit.Test;
 
 import org.junit.Assert;
 
 import org.apache.activemq.artemis.api.core.TransportConfiguration;
 
-public class TransportConfigurationTest extends UnitTestCase
+public class TransportConfigurationTest extends ServiceTestBase
 {
 
    // Constants -----------------------------------------------------

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/AlignedJournalImplTest.java
----------------------------------------------------------------------
diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/AlignedJournalImplTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/AlignedJournalImplTest.java
index 9a99707..ebf8f6c 100644
--- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/AlignedJournalImplTest.java
+++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/AlignedJournalImplTest.java
@@ -16,7 +16,7 @@
  */
 package org.apache.activemq.artemis.tests.unit.core.journal.impl;
 import org.apache.activemq.artemis.tests.unit.core.journal.impl.fakes.FakeSequentialFileFactory;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.junit.Before;
 import org.junit.After;
 
@@ -44,7 +44,7 @@ import org.apache.activemq.artemis.core.journal.impl.JournalImpl;
 import org.apache.activemq.artemis.tests.unit.UnitTestLogger;
 import org.apache.activemq.artemis.tests.unit.core.journal.impl.fakes.SimpleEncoding;
 
-public class AlignedJournalImplTest extends UnitTestCase
+public class AlignedJournalImplTest extends ServiceTestBase
 {
 
    // Constants -----------------------------------------------------
@@ -1223,7 +1223,7 @@ public class AlignedJournalImplTest extends UnitTestCase
             try
             {
                latchReady.countDown();
-               UnitTestCase.waitForLatch(latchStart);
+               ServiceTestBase.waitForLatch(latchStart);
                for (int i = 0; i < NUMBER_OF_ELEMENTS; i++)
                {
                   journalImpl.appendAddRecordTransactional(i, i, (byte)1, new SimpleEncoding(50, (byte)1));
@@ -1247,7 +1247,7 @@ public class AlignedJournalImplTest extends UnitTestCase
             try
             {
                latchReady.countDown();
-               UnitTestCase.waitForLatch(latchStart);
+               ServiceTestBase.waitForLatch(latchStart);
                for (int i = 0; i < NUMBER_OF_ELEMENTS; i++)
                {
                   Integer toDelete = queueDelete.poll(10, TimeUnit.SECONDS);
@@ -1269,7 +1269,7 @@ public class AlignedJournalImplTest extends UnitTestCase
       t1.start();
       t2.start();
 
-      UnitTestCase.waitForLatch(latchReady);
+      ServiceTestBase.waitForLatch(latchReady);
       latchStart.countDown();
 
       t1.join();

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/CleanBufferTest.java
----------------------------------------------------------------------
diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/CleanBufferTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/CleanBufferTest.java
index 980a4a6..498d22c 100644
--- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/CleanBufferTest.java
+++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/CleanBufferTest.java
@@ -17,7 +17,7 @@
 package org.apache.activemq.artemis.tests.unit.core.journal.impl;
 
 import org.apache.activemq.artemis.tests.unit.core.journal.impl.fakes.FakeSequentialFileFactory;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.junit.Test;
 
 import java.nio.ByteBuffer;
@@ -29,7 +29,7 @@ import org.apache.activemq.artemis.core.journal.SequentialFileFactory;
 import org.apache.activemq.artemis.core.journal.impl.AIOSequentialFileFactory;
 import org.apache.activemq.artemis.core.journal.impl.NIOSequentialFileFactory;
 
-public class CleanBufferTest extends UnitTestCase
+public class CleanBufferTest extends ServiceTestBase
 {
 
    // Constants -----------------------------------------------------

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/FileFactoryTestBase.java
----------------------------------------------------------------------
diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/FileFactoryTestBase.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/FileFactoryTestBase.java
index c1a6e5f..7063f15 100644
--- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/FileFactoryTestBase.java
+++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/FileFactoryTestBase.java
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 package org.apache.activemq.artemis.tests.unit.core.journal.impl;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.junit.Before;
 
 import java.nio.ByteBuffer;
@@ -25,7 +25,7 @@ import org.junit.Assert;
 import org.apache.activemq.artemis.core.journal.SequentialFile;
 import org.apache.activemq.artemis.core.journal.SequentialFileFactory;
 
-public abstract class FileFactoryTestBase extends UnitTestCase
+public abstract class FileFactoryTestBase extends ServiceTestBase
 {
    protected abstract SequentialFileFactory createFactory();
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/JournalAsyncTest.java
----------------------------------------------------------------------
diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/JournalAsyncTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/JournalAsyncTest.java
index b6b1cce..758f9d7 100644
--- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/JournalAsyncTest.java
+++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/JournalAsyncTest.java
@@ -22,7 +22,7 @@ import java.util.concurrent.TimeUnit;
 
 import org.apache.activemq.artemis.tests.unit.core.journal.impl.fakes.FakeSequentialFileFactory;
 import org.apache.activemq.artemis.tests.unit.core.journal.impl.fakes.SimpleEncoding;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.apache.activemq.artemis.core.journal.PreparedTransactionInfo;
 import org.apache.activemq.artemis.core.journal.RecordInfo;
 import org.apache.activemq.artemis.core.journal.impl.JournalImpl;
@@ -31,7 +31,7 @@ import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
 
-public class JournalAsyncTest extends UnitTestCase
+public class JournalAsyncTest extends ServiceTestBase
 {
 
    // Constants -----------------------------------------------------

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/JournalImplTestBase.java
----------------------------------------------------------------------
diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/JournalImplTestBase.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/JournalImplTestBase.java
index 9648ed6..edec8d1 100644
--- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/JournalImplTestBase.java
+++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/JournalImplTestBase.java
@@ -33,13 +33,13 @@ import org.apache.activemq.artemis.core.journal.RecordInfo;
 import org.apache.activemq.artemis.core.journal.SequentialFileFactory;
 import org.apache.activemq.artemis.core.journal.TestableJournal;
 import org.apache.activemq.artemis.core.journal.impl.JournalImpl;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.apache.activemq.artemis.utils.ReusableLatch;
 import org.junit.After;
 import org.junit.Assert;
 import org.junit.Before;
 
-public abstract class JournalImplTestBase extends UnitTestCase
+public abstract class JournalImplTestBase extends ServiceTestBase
 {
    protected List<RecordInfo> records = new LinkedList<RecordInfo>();
 
@@ -568,7 +568,7 @@ public abstract class JournalImplTestBase extends UnitTestCase
 
          Assert.assertEquals("type not same", rexpected.isUpdate, ractual.isUpdate);
 
-         UnitTestCase.assertEqualsByteArrays(rexpected.data, ractual.data);
+         ServiceTestBase.assertEqualsByteArrays(rexpected.data, ractual.data);
       }
    }
 
@@ -602,7 +602,7 @@ public abstract class JournalImplTestBase extends UnitTestCase
       for (int i = 0; i < length; i++)
       {
          // record[i] = RandomUtil.randomByte();
-         record[i] = UnitTestCase.getSamplebyte(i);
+         record[i] = ServiceTestBase.getSamplebyte(i);
       }
       return record;
    }


[08/13] activemq-artemis git commit: Refactor base test classes

Posted by an...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/artemis-server/src/test/java/org/apache/activemq/artemis/tests/util/SimpleStringTest.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/test/java/org/apache/activemq/artemis/tests/util/SimpleStringTest.java b/artemis-server/src/test/java/org/apache/activemq/artemis/tests/util/SimpleStringTest.java
index 2f92aa8..cc45e64 100644
--- a/artemis-server/src/test/java/org/apache/activemq/artemis/tests/util/SimpleStringTest.java
+++ b/artemis-server/src/test/java/org/apache/activemq/artemis/tests/util/SimpleStringTest.java
@@ -437,7 +437,7 @@ public class SimpleStringTest extends Assert
             x[i].start();
          }
 
-         UnitTestCase.waitForLatch(latch);
+         ServiceTestBase.waitForLatch(latch);
          start.countDown();
 
          for (T t : x)

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/artemis-server/src/test/java/org/apache/activemq/artemis/tests/util/SingleServerTestBase.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/test/java/org/apache/activemq/artemis/tests/util/SingleServerTestBase.java b/artemis-server/src/test/java/org/apache/activemq/artemis/tests/util/SingleServerTestBase.java
index 8751f2b..017c5aa 100644
--- a/artemis-server/src/test/java/org/apache/activemq/artemis/tests/util/SingleServerTestBase.java
+++ b/artemis-server/src/test/java/org/apache/activemq/artemis/tests/util/SingleServerTestBase.java
@@ -59,7 +59,7 @@ public abstract class SingleServerTestBase extends ServiceTestBase
 
    protected ServerLocator createLocator()
    {
-      ServerLocator retlocator = ActiveMQClient.createServerLocatorWithoutHA(new TransportConfiguration(UnitTestCase.INVM_CONNECTOR_FACTORY));
+      ServerLocator retlocator = ActiveMQClient.createServerLocatorWithoutHA(new TransportConfiguration(INVM_CONNECTOR_FACTORY));
       addServerLocator(retlocator);
       return retlocator;
    }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/artemis-server/src/test/java/org/apache/activemq/artemis/tests/util/UnitTestCase.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/test/java/org/apache/activemq/artemis/tests/util/UnitTestCase.java b/artemis-server/src/test/java/org/apache/activemq/artemis/tests/util/UnitTestCase.java
deleted file mode 100644
index 0134d8e..0000000
--- a/artemis-server/src/test/java/org/apache/activemq/artemis/tests/util/UnitTestCase.java
+++ /dev/null
@@ -1,2137 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.activemq.artemis.tests.util;
-
-import javax.naming.Context;
-import javax.transaction.xa.XAException;
-import javax.transaction.xa.Xid;
-import java.beans.BeanInfo;
-import java.beans.Introspector;
-import java.beans.PropertyDescriptor;
-import java.io.BufferedInputStream;
-import java.io.BufferedOutputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.io.PrintWriter;
-import java.io.StringWriter;
-import java.lang.ref.Reference;
-import java.lang.ref.WeakReference;
-import java.net.ServerSocket;
-import java.nio.ByteBuffer;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Random;
-import java.util.Set;
-import java.util.UUID;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.atomic.AtomicInteger;
-
-import org.apache.activemq.artemis.api.core.ActiveMQBuffer;
-import org.apache.activemq.artemis.api.core.ActiveMQException;
-import org.apache.activemq.artemis.api.core.ActiveMQExceptionType;
-import org.apache.activemq.artemis.api.core.Message;
-import org.apache.activemq.artemis.api.core.SimpleString;
-import org.apache.activemq.artemis.api.core.TransportConfiguration;
-import org.apache.activemq.artemis.api.core.client.ClientConsumer;
-import org.apache.activemq.artemis.api.core.client.ClientMessage;
-import org.apache.activemq.artemis.api.core.client.ClientProducer;
-import org.apache.activemq.artemis.api.core.client.ClientSession;
-import org.apache.activemq.artemis.api.core.client.ClientSessionFactory;
-import org.apache.activemq.artemis.api.core.client.ActiveMQClient;
-import org.apache.activemq.artemis.api.core.client.ServerLocator;
-import org.apache.activemq.artemis.core.asyncio.impl.AsynchronousFileImpl;
-import org.apache.activemq.artemis.core.client.impl.ClientSessionFactoryImpl;
-import org.apache.activemq.artemis.core.client.impl.ServerLocatorImpl;
-import org.apache.activemq.artemis.core.config.ClusterConnectionConfiguration;
-import org.apache.activemq.artemis.core.config.Configuration;
-import org.apache.activemq.artemis.core.config.impl.ConfigurationImpl;
-import org.apache.activemq.artemis.core.journal.PreparedTransactionInfo;
-import org.apache.activemq.artemis.core.journal.RecordInfo;
-import org.apache.activemq.artemis.core.journal.SequentialFileFactory;
-import org.apache.activemq.artemis.core.journal.impl.JournalImpl;
-import org.apache.activemq.artemis.core.journal.impl.NIOSequentialFileFactory;
-import org.apache.activemq.artemis.core.persistence.impl.journal.DescribeJournal;
-import org.apache.activemq.artemis.core.persistence.impl.journal.DescribeJournal.ReferenceDescribe;
-import org.apache.activemq.artemis.core.persistence.impl.journal.JournalRecordIds;
-import org.apache.activemq.artemis.core.persistence.impl.journal.OperationContextImpl;
-import org.apache.activemq.artemis.core.postoffice.Binding;
-import org.apache.activemq.artemis.core.postoffice.Bindings;
-import org.apache.activemq.artemis.core.postoffice.PostOffice;
-import org.apache.activemq.artemis.core.postoffice.QueueBinding;
-import org.apache.activemq.artemis.core.postoffice.impl.LocalQueueBinding;
-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.remoting.impl.invm.InVMRegistry;
-import org.apache.activemq.artemis.core.remoting.impl.netty.NettyAcceptorFactory;
-import org.apache.activemq.artemis.core.remoting.impl.netty.NettyConnector;
-import org.apache.activemq.artemis.core.remoting.impl.netty.NettyConnectorFactory;
-import org.apache.activemq.artemis.core.server.ActiveMQComponent;
-import org.apache.activemq.artemis.core.server.ActiveMQMessageBundle;
-import org.apache.activemq.artemis.core.server.ActiveMQServer;
-import org.apache.activemq.artemis.core.server.ActiveMQServerLogger;
-import org.apache.activemq.artemis.core.server.JournalType;
-import org.apache.activemq.artemis.core.server.MessageReference;
-import org.apache.activemq.artemis.core.server.Queue;
-import org.apache.activemq.artemis.core.server.ServerMessage;
-import org.apache.activemq.artemis.core.server.cluster.ClusterConnection;
-import org.apache.activemq.artemis.core.server.cluster.ClusterManager;
-import org.apache.activemq.artemis.core.server.impl.ServerMessageImpl;
-import org.apache.activemq.artemis.core.transaction.impl.XidImpl;
-import org.apache.activemq.artemis.tests.CoreUnitTestCase;
-import org.apache.activemq.artemis.utils.OrderedExecutorFactory;
-import org.apache.activemq.artemis.utils.UUIDGenerator;
-import org.junit.After;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.rules.TemporaryFolder;
-import org.junit.rules.TestName;
-
-/**
- * Helper base class for our unit tests.
- * <p/>
- * See {@code org.apache.activemq.tests.util.ServiceTestBase} for a test case with server set-up.
- *
- * @see ServiceTestBase
- */
-public abstract class UnitTestCase extends CoreUnitTestCase
-{
-   public static final String TARGET_TMP = "./target/tmp";
-   // Constants -----------------------------------------------------
-
-   @Rule
-   public TestName name = new TestName();
-
-   @Rule
-   public TemporaryFolder temporaryFolder;
-
-   @Rule
-   // This Custom rule will remove any files under ./target/tmp
-   // including anything created previously by TemporaryFolder
-   public RemoveFolder folder = new RemoveFolder(TARGET_TMP);
-
-
-   private String testDir;
-
-   private static final ActiveMQServerLogger log = ActiveMQServerLogger.LOGGER;
-
-   public static final String INVM_ACCEPTOR_FACTORY = InVMAcceptorFactory.class.getCanonicalName();
-
-   public static final String INVM_CONNECTOR_FACTORY = InVMConnectorFactory.class.getCanonicalName();
-
-   public static final String NETTY_ACCEPTOR_FACTORY = NettyAcceptorFactory.class.getCanonicalName();
-
-   public static final String NETTY_CONNECTOR_FACTORY = NettyConnectorFactory.class.getCanonicalName();
-
-   protected static final String CLUSTER_PASSWORD = "UnitTestsClusterPassword";
-
-   private static final String OS_TYPE = System.getProperty("os.name").toLowerCase();
-   private static final int DEFAULT_UDP_PORT;
-
-
-   public UnitTestCase()
-   {
-      File parent = new File(TARGET_TMP);
-      parent.mkdirs();
-      temporaryFolder = new TemporaryFolder(parent);
-   }
-
-   static
-   {
-      Random random = new Random();
-      DEFAULT_UDP_PORT = 6000 + random.nextInt(1000);
-   }
-
-   // Attributes ----------------------------------------------------
-
-   // There is a verification about thread leakages. We only fail a single thread when this happens
-   private static Set<Thread> alreadyFailedThread = new HashSet<Thread>();
-
-   private final Collection<ActiveMQServer> servers = new ArrayList<ActiveMQServer>();
-   private final Collection<ServerLocator> locators = new ArrayList<ServerLocator>();
-   private final Collection<ClientSessionFactory> sessionFactories = new ArrayList<ClientSessionFactory>();
-   private final Collection<ClientSession> clientSessions = new HashSet<ClientSession>();
-   private final Collection<ClientConsumer> clientConsumers = new HashSet<ClientConsumer>();
-   private final Collection<ClientProducer> clientProducers = new HashSet<ClientProducer>();
-   private final Collection<ActiveMQComponent> otherComponents = new HashSet<ActiveMQComponent>();
-   private final Set<ExecutorService> executorSet = new HashSet<ExecutorService>();
-
-   private boolean checkThread = true;
-
-   protected void disableCheckThread()
-   {
-      checkThread = false;
-   }
-
-   protected String getName()
-   {
-      return name.getMethodName();
-   }
-
-   protected boolean isWindows()
-   {
-      return (OS_TYPE.indexOf("win") >= 0);
-   }
-
-   // Static --------------------------------------------------------
-
-   protected Configuration createDefaultConfig() throws Exception
-   {
-      return createDefaultConfig(false);
-   }
-
-   protected Configuration createDefaultConfig(int serverId) throws Exception
-   {
-      return createDefaultConfig(false, serverId);
-   }
-
-   protected Configuration createDefaultConfig(final boolean netty) throws Exception
-   {
-      if (netty)
-      {
-         return createDefaultConfig(new HashMap<String, Object>(), INVM_ACCEPTOR_FACTORY, NETTY_ACCEPTOR_FACTORY);
-      }
-      else
-      {
-         return createDefaultConfig(new HashMap<String, Object>(), INVM_ACCEPTOR_FACTORY);
-      }
-   }
-
-   protected Configuration createDefaultConfig(final boolean netty, int serverId) throws Exception
-   {
-      if (netty)
-      {
-         return createDefaultConfig(serverId, new HashMap<String, Object>(), INVM_ACCEPTOR_FACTORY, NETTY_ACCEPTOR_FACTORY);
-      }
-      else
-      {
-         return createDefaultConfig(serverId, new HashMap<String, Object>(), INVM_ACCEPTOR_FACTORY);
-      }
-   }
-
-   protected static final ClusterConnectionConfiguration basicClusterConnectionConfig(String connectorName,
-                                                                                      String... connectors)
-   {
-      ArrayList<String> connectors0 = new ArrayList<String>();
-      for (String c : connectors)
-      {
-         connectors0.add(c);
-      }
-      return basicClusterConnectionConfig(connectorName, connectors0);
-   }
-
-   protected static final ClusterConnectionConfiguration basicClusterConnectionConfig(String connectorName,
-                                                                                      List<String> connectors)
-   {
-      ClusterConnectionConfiguration ccc = new ClusterConnectionConfiguration()
-         .setName("cluster1")
-         .setAddress("jms")
-         .setConnectorName(connectorName)
-         .setRetryInterval(1000)
-         .setDuplicateDetection(false)
-         .setForwardWhenNoConsumers(true)
-         .setMaxHops(1)
-         .setConfirmationWindowSize(1)
-         .setStaticConnectors(connectors);
-
-      return ccc;
-   }
-
-   protected Configuration createDefaultConfig(final int index,
-                                               final Map<String, Object> params,
-                                               final String... acceptors)
-   {
-      Configuration configuration = createBasicConfig(index);
-
-      configuration.getAcceptorConfigurations().clear();
-
-      for (String acceptor : acceptors)
-      {
-         TransportConfiguration transportConfig = new TransportConfiguration(acceptor, params);
-         configuration.getAcceptorConfigurations().add(transportConfig);
-      }
-
-      return configuration;
-   }
-
-   protected final OrderedExecutorFactory getOrderedExecutor()
-   {
-      final ExecutorService executor = Executors.newCachedThreadPool();
-      executorSet.add(executor);
-      return new OrderedExecutorFactory(executor);
-   }
-
-   protected ConfigurationImpl createBasicConfig() throws Exception
-   {
-      return createBasicConfig(0);
-   }
-
-   /**
-    * @param serverID
-    * @return
-    * @throws Exception
-    */
-   protected ConfigurationImpl createBasicConfig(final int serverID)
-   {
-      ConfigurationImpl configuration = new ConfigurationImpl()
-         .setSecurityEnabled(false)
-         .setJournalMinFiles(2)
-         .setJournalFileSize(100 * 1024)
-         .setJournalType(getDefaultJournalType())
-         .setJournalDirectory(getJournalDir(serverID, false))
-         .setBindingsDirectory(getBindingsDir(serverID, false))
-         .setPagingDirectory(getPageDir(serverID, false))
-         .setLargeMessagesDirectory(getLargeMessagesDir(serverID, false))
-         .setJournalCompactMinFiles(0)
-         .setJournalCompactPercentage(0)
-         .setClusterPassword(CLUSTER_PASSWORD);
-
-      return configuration;
-   }
-
-   public static final ConfigurationImpl createBasicConfig(final String testDir, final int serverID)
-   {
-      ConfigurationImpl configuration = new ConfigurationImpl()
-         .setSecurityEnabled(false)
-         .setJournalMinFiles(2)
-         .setJournalFileSize(100 * 1024)
-         .setJournalType(getDefaultJournalType())
-         .setJournalDirectory(getJournalDir(testDir, serverID, false))
-         .setBindingsDirectory(getBindingsDir(testDir, serverID, false))
-         .setPagingDirectory(getPageDir(testDir, serverID, false))
-         .setLargeMessagesDirectory(getLargeMessagesDir(testDir, serverID, false))
-         .setJournalCompactMinFiles(0)
-         .setJournalCompactPercentage(0)
-         .setClusterPassword(CLUSTER_PASSWORD);
-
-      return configuration;
-   }
-
-   public static final ConfigurationImpl createBasicConfigNoDataFolder()
-   {
-      ConfigurationImpl configuration = new ConfigurationImpl()
-         .setSecurityEnabled(false)
-         .setJournalType(getDefaultJournalType())
-         .setJournalCompactMinFiles(0)
-         .setJournalCompactPercentage(0)
-         .setClusterPassword(CLUSTER_PASSWORD);
-
-      return configuration;
-   }
-
-   protected Configuration createDefaultConfig(final Map<String, Object> params, final String... acceptors) throws Exception
-   {
-      ConfigurationImpl configuration = createBasicConfig(-1)
-         .setJMXManagementEnabled(false)
-         .clearAcceptorConfigurations();
-
-      for (String acceptor : acceptors)
-      {
-         TransportConfiguration transportConfig = new TransportConfiguration(acceptor, params);
-         configuration.addAcceptorConfiguration(transportConfig);
-      }
-
-      return configuration;
-   }
-
-   protected static String getUDPDiscoveryAddress()
-   {
-      return System.getProperty("TEST-UDP-ADDRESS", "230.1.2.3");
-   }
-
-   protected static String getUDPDiscoveryAddress(final int variant)
-   {
-      String value = getUDPDiscoveryAddress();
-
-      int posPoint = value.lastIndexOf('.');
-
-      int last = Integer.valueOf(value.substring(posPoint + 1));
-
-      return value.substring(0, posPoint + 1) + (last + variant);
-   }
-
-   public static int getUDPDiscoveryPort()
-   {
-      String port = System.getProperty("TEST-UDP-PORT");
-      if (port != null)
-      {
-         return Integer.parseInt(port);
-      }
-      return DEFAULT_UDP_PORT;
-   }
-
-   public static int getUDPDiscoveryPort(final int variant)
-   {
-      return getUDPDiscoveryPort() + variant;
-   }
-
-   protected static JournalType getDefaultJournalType()
-   {
-      if (AsynchronousFileImpl.isLoaded())
-      {
-         return JournalType.ASYNCIO;
-      }
-      else
-      {
-         return JournalType.NIO;
-      }
-   }
-
-   public static void forceGC()
-   {
-      log.info("#test forceGC");
-      WeakReference<Object> dumbReference = new WeakReference<Object>(new Object());
-      // A loop that will wait GC, using the minimal time as possible
-      while (dumbReference.get() != null)
-      {
-         System.gc();
-         try
-         {
-            Thread.sleep(100);
-         }
-         catch (InterruptedException e)
-         {
-         }
-      }
-      log.info("#test forceGC Done");
-   }
-
-   public static void forceGC(final Reference<?> ref, final long timeout)
-   {
-      long waitUntil = System.currentTimeMillis() + timeout;
-      // A loop that will wait GC, using the minimal time as possible
-      while (ref.get() != null && System.currentTimeMillis() < waitUntil)
-      {
-         ArrayList<String> list = new ArrayList<String>();
-         for (int i = 0; i < 1000; i++)
-         {
-            list.add("Some string with garbage with concatenation " + i);
-         }
-         list.clear();
-         list = null;
-         System.gc();
-         try
-         {
-            Thread.sleep(500);
-         }
-         catch (InterruptedException e)
-         {
-         }
-      }
-   }
-
-   /**
-    * Verifies whether weak references are released after a few GCs.
-    *
-    * @param references
-    * @throws InterruptedException
-    */
-   public static void checkWeakReferences(final WeakReference<?>... references)
-   {
-      int i = 0;
-      boolean hasValue = false;
-
-      do
-      {
-         hasValue = false;
-
-         if (i > 0)
-         {
-            UnitTestCase.forceGC();
-         }
-
-         for (WeakReference<?> ref : references)
-         {
-            if (ref.get() != null)
-            {
-               hasValue = true;
-               break;
-            }
-         }
-      }
-      while (i++ <= 30 && hasValue);
-
-      for (WeakReference<?> ref : references)
-      {
-         Assert.assertNull(ref.get());
-      }
-   }
-
-   public static String threadDump(final String msg)
-   {
-      StringWriter str = new StringWriter();
-      PrintWriter out = new PrintWriter(str);
-
-      Map<Thread, StackTraceElement[]> stackTrace = Thread.getAllStackTraces();
-
-      out.println("*******************************************************************************");
-      out.println("Complete Thread dump " + msg);
-
-      for (Map.Entry<Thread, StackTraceElement[]> el : stackTrace.entrySet())
-      {
-         out.println("===============================================================================");
-         out.println("Thread " + el.getKey() +
-                        " name = " +
-                        el.getKey().getName() +
-                        " id = " +
-                        el.getKey().getId() +
-                        " group = " +
-                        el.getKey().getThreadGroup());
-         out.println();
-         for (StackTraceElement traceEl : el.getValue())
-         {
-            out.println(traceEl);
-         }
-      }
-
-      out.println("===============================================================================");
-      out.println("End Thread dump " + msg);
-      out.println("*******************************************************************************");
-
-      return str.toString();
-   }
-
-   /**
-    * Sends the message to both logger and System.out (for unit report)
-    */
-   public void logAndSystemOut(String message, Exception e)
-   {
-      ActiveMQServerLogger log0 = ActiveMQServerLogger.LOGGER;
-      log0.info(message, e);
-      System.out.println(message);
-      e.printStackTrace(System.out);
-   }
-
-   /**
-    * Sends the message to both logger and System.out (for unit report)
-    */
-   public void logAndSystemOut(String message)
-   {
-      ActiveMQServerLogger log0 = ActiveMQServerLogger.LOGGER;
-      log0.info(message);
-      System.out.println(this.getClass().getName() + "::" + message);
-   }
-
-   public static String dumpBytes(final byte[] bytes)
-   {
-      StringBuffer buff = new StringBuffer();
-
-      buff.append(System.identityHashCode(bytes) + ", size: " + bytes.length + " [");
-
-      for (int i = 0; i < bytes.length; i++)
-      {
-         buff.append(bytes[i]);
-
-         if (i != bytes.length - 1)
-         {
-            buff.append(", ");
-         }
-      }
-
-      buff.append("]");
-
-      return buff.toString();
-   }
-
-   public static String dumbBytesHex(final byte[] buffer, final int bytesPerLine)
-   {
-
-      StringBuffer buff = new StringBuffer();
-
-      buff.append("[");
-
-      for (int i = 0; i < buffer.length; i++)
-      {
-         buff.append(String.format("%1$2X", buffer[i]));
-         if (i + 1 < buffer.length)
-         {
-            buff.append(", ");
-         }
-         if ((i + 1) % bytesPerLine == 0)
-         {
-            buff.append("\n ");
-         }
-      }
-      buff.append("]");
-
-      return buff.toString();
-   }
-
-   public static void assertEqualsByteArrays(final byte[] expected, final byte[] actual)
-   {
-      // assertEquals(expected.length, actual.length);
-      for (int i = 0; i < expected.length; i++)
-      {
-         Assert.assertEquals("byte at index " + i, expected[i], actual[i]);
-      }
-   }
-
-   public static void assertEqualsTransportConfigurations(final TransportConfiguration[] expected,
-                                                          final TransportConfiguration[] actual)
-   {
-      assertEquals(expected.length, actual.length);
-      for (int i = 0; i < expected.length; i++)
-      {
-         Assert.assertEquals("TransportConfiguration at index " + i, expected[i], actual[i]);
-      }
-   }
-
-   public static void assertEqualsBuffers(final int size, final ActiveMQBuffer expected, final ActiveMQBuffer actual)
-   {
-      // assertEquals(expected.length, actual.length);
-      expected.readerIndex(0);
-      actual.readerIndex(0);
-
-      for (int i = 0; i < size; i++)
-      {
-         byte b1 = expected.readByte();
-         byte b2 = actual.readByte();
-         Assert.assertEquals("byte at index " + i, b1, b2);
-      }
-      expected.resetReaderIndex();
-      actual.resetReaderIndex();
-   }
-
-   public static void assertEqualsByteArrays(final int length, final byte[] expected, final byte[] actual)
-   {
-      // we check only for the given length (the arrays might be
-      // larger)
-      Assert.assertTrue(expected.length >= length);
-      Assert.assertTrue(actual.length >= length);
-      for (int i = 0; i < length; i++)
-      {
-         Assert.assertEquals("byte at index " + i, expected[i], actual[i]);
-      }
-   }
-
-   public static void assertSameXids(final List<Xid> expected, final List<Xid> actual)
-   {
-      Assert.assertNotNull(expected);
-      Assert.assertNotNull(actual);
-      Assert.assertEquals(expected.size(), actual.size());
-
-      for (int i = 0; i < expected.size(); i++)
-      {
-         Xid expectedXid = expected.get(i);
-         Xid actualXid = actual.get(i);
-         UnitTestCase.assertEqualsByteArrays(expectedXid.getBranchQualifier(), actualXid.getBranchQualifier());
-         Assert.assertEquals(expectedXid.getFormatId(), actualXid.getFormatId());
-         UnitTestCase.assertEqualsByteArrays(expectedXid.getGlobalTransactionId(), actualXid.getGlobalTransactionId());
-      }
-   }
-
-   protected static void checkNoBinding(final Context context, final String binding)
-   {
-      try
-      {
-         context.lookup(binding);
-         Assert.fail("there must be no resource to look up for " + binding);
-      }
-      catch (Exception e)
-      {
-      }
-   }
-
-   protected static Object checkBinding(final Context context, final String binding) throws Exception
-   {
-      Object o = context.lookup(binding);
-      Assert.assertNotNull(o);
-      return o;
-   }
-
-   /**
-    * @param connectorConfigs
-    * @return
-    */
-   protected ArrayList<String> registerConnectors(final ActiveMQServer server,
-                                                  final List<TransportConfiguration> connectorConfigs)
-   {
-      // The connectors need to be pre-configured at main config object but this method is taking
-      // TransportConfigurations directly
-      // So this will first register them at the config and then generate a list of objects
-      ArrayList<String> connectors = new ArrayList<String>();
-      for (TransportConfiguration tnsp : connectorConfigs)
-      {
-         String name1 = RandomUtil.randomString();
-
-         server.getConfiguration().getConnectorConfigurations().put(name1, tnsp);
-
-         connectors.add(name1);
-      }
-      return connectors;
-   }
-
-   protected static final void checkFreePort(final int... ports)
-   {
-      for (int port : ports)
-      {
-         ServerSocket ssocket = null;
-         try
-         {
-            ssocket = new ServerSocket(port);
-         }
-         catch (Exception e)
-         {
-            throw new IllegalStateException("port " + port + " is bound", e);
-         }
-         finally
-         {
-            if (ssocket != null)
-            {
-               try
-               {
-                  ssocket.close();
-               }
-               catch (IOException e)
-               {
-               }
-            }
-         }
-      }
-   }
-
-   /**
-    * @return the testDir
-    */
-   protected final String getTestDir()
-   {
-      return testDir;
-   }
-
-   protected final void setTestDir(String testDir)
-   {
-      this.testDir = testDir;
-   }
-
-   protected final void clearDataRecreateServerDirs()
-   {
-      clearDataRecreateServerDirs(getTestDir());
-   }
-
-   protected final void deleteTmpDir()
-   {
-      File file = new File(getTestDir());
-      deleteDirectory(file);
-   }
-
-   protected void clearDataRecreateServerDirs(final String testDir1)
-   {
-      // Need to delete the root
-
-      File file = new File(testDir1);
-      deleteDirectory(file);
-      file.mkdirs();
-
-      recreateDirectory(getJournalDir(testDir1));
-      recreateDirectory(getBindingsDir(testDir1));
-      recreateDirectory(getPageDir(testDir1));
-      recreateDirectory(getLargeMessagesDir(testDir1));
-      recreateDirectory(getClientLargeMessagesDir(testDir1));
-      recreateDirectory(getTemporaryDir(testDir1));
-   }
-
-   /**
-    * @return the journalDir
-    */
-   public String getJournalDir()
-   {
-      return getJournalDir(getTestDir());
-   }
-
-   protected static String getJournalDir(final String testDir1)
-   {
-      return testDir1 + "/journal";
-   }
-
-   protected String getJournalDir(final int index, final boolean backup)
-   {
-      return getJournalDir(getTestDir(), index, backup);
-   }
-
-   protected static String getJournalDir(final String testDir, final int index, final boolean backup)
-   {
-      return getJournalDir(testDir) + directoryNameSuffix(index, backup);
-   }
-
-   /**
-    * @return the bindingsDir
-    */
-   protected String getBindingsDir()
-   {
-      return getBindingsDir(getTestDir());
-   }
-
-   /**
-    * @return the bindingsDir
-    */
-   protected static String getBindingsDir(final String testDir1)
-   {
-      return testDir1 + "/bindings";
-   }
-
-   /**
-    * @return the bindingsDir
-    */
-   protected String getBindingsDir(final int index, final boolean backup)
-   {
-      return getBindingsDir(getTestDir(), index, backup);
-   }
-
-   protected static String getBindingsDir(final String testDir, final int index, final boolean backup)
-   {
-      return getBindingsDir(testDir) + directoryNameSuffix(index, backup);
-   }
-
-   /**
-    * @return the pageDir
-    */
-   protected String getPageDir()
-   {
-      return getPageDir(getTestDir());
-   }
-
-   /**
-    * @return the pageDir
-    */
-   protected static String getPageDir(final String testDir1)
-   {
-      return testDir1 + "/page";
-   }
-
-   protected String getPageDir(final int index, final boolean backup)
-   {
-      return getPageDir(getTestDir(), index, backup);
-   }
-
-   protected static String getPageDir(final String testDir, final int index, final boolean backup)
-   {
-      return getPageDir(testDir) + directoryNameSuffix(index, backup);
-   }
-
-   /**
-    * @return the largeMessagesDir
-    */
-   protected String getLargeMessagesDir()
-   {
-      return getLargeMessagesDir(getTestDir());
-   }
-
-   /**
-    * @return the largeMessagesDir
-    */
-   protected static String getLargeMessagesDir(final String testDir1)
-   {
-      return testDir1 + "/large-msg";
-   }
-
-   protected String getLargeMessagesDir(final int index, final boolean backup)
-   {
-      return getLargeMessagesDir(getTestDir(), index, backup);
-   }
-
-   protected static String getLargeMessagesDir(final String testDir, final int index, final boolean backup)
-   {
-      return getLargeMessagesDir(testDir) + directoryNameSuffix(index, backup);
-   }
-
-   private static String directoryNameSuffix(int index, boolean backup)
-   {
-      if (index == -1)
-         return "";
-      return index + "-" + (backup ? "B" : "L");
-   }
-
-   /**
-    * @return the clientLargeMessagesDir
-    */
-   protected String getClientLargeMessagesDir()
-   {
-      return getClientLargeMessagesDir(getTestDir());
-   }
-
-   /**
-    * @return the clientLargeMessagesDir
-    */
-   protected String getClientLargeMessagesDir(final String testDir1)
-   {
-      return testDir1 + "/client-large-msg";
-   }
-
-   /**
-    * @return the temporaryDir
-    */
-   protected final String getTemporaryDir()
-   {
-      return getTemporaryDir(getTestDir());
-   }
-
-   /**
-    * @return the temporaryDir
-    */
-   protected String getTemporaryDir(final String testDir1)
-   {
-      return testDir1 + "/temp";
-   }
-
-   protected static void expectActiveMQException(final String message, final ActiveMQExceptionType errorCode, final ActiveMQAction action)
-   {
-      try
-      {
-         action.run();
-         Assert.fail(message);
-      }
-      catch (Exception e)
-      {
-         Assert.assertTrue(e instanceof ActiveMQException);
-         Assert.assertEquals(errorCode, ((ActiveMQException) e).getType());
-      }
-   }
-
-   protected static void expectActiveMQException(final ActiveMQExceptionType errorCode, final ActiveMQAction action)
-   {
-      UnitTestCase.expectActiveMQException("must throw a ActiveMQException with the expected errorCode: " + errorCode,
-                                           errorCode,
-                                           action);
-   }
-
-   protected static void expectXAException(final int errorCode, final ActiveMQAction action)
-   {
-      try
-      {
-         action.run();
-         Assert.fail("must throw a XAException with the expected errorCode: " + errorCode);
-      }
-      catch (Exception e)
-      {
-         Assert.assertTrue(e instanceof XAException);
-         Assert.assertEquals(errorCode, ((XAException) e).errorCode);
-      }
-   }
-
-   public static byte getSamplebyte(final long position)
-   {
-      return (byte) ('a' + position % ('z' - 'a' + 1));
-   }
-
-   // Creates a Fake LargeStream without using a real file
-   public static InputStream createFakeLargeStream(final long size) throws Exception
-   {
-      return new InputStream()
-      {
-         private long count;
-
-         private boolean closed = false;
-
-         @Override
-         public void close() throws IOException
-         {
-            super.close();
-            closed = true;
-         }
-
-         @Override
-         public int read() throws IOException
-         {
-            if (closed)
-            {
-               throw new IOException("Stream was closed");
-            }
-            if (count++ < size)
-            {
-               return UnitTestCase.getSamplebyte(count - 1);
-            }
-            else
-            {
-               return -1;
-            }
-         }
-      };
-
-   }
-
-   /**
-    * It validates a Bean (POJO) using simple setters and getters with random values.
-    * You can pass a list of properties to be ignored, as some properties will have a pre-defined domain (not being possible to use random-values on them)
-    */
-   protected void validateGettersAndSetters(final Object pojo, final String... ignoredProperties) throws Exception
-   {
-      HashSet<String> ignoreSet = new HashSet<String>();
-
-      for (String ignore : ignoredProperties)
-      {
-         ignoreSet.add(ignore);
-      }
-
-      BeanInfo info = Introspector.getBeanInfo(pojo.getClass());
-
-      PropertyDescriptor[] properties = info.getPropertyDescriptors();
-
-      for (PropertyDescriptor prop : properties)
-      {
-         Object value;
-
-         if (prop.getPropertyType() == String.class)
-         {
-            value = RandomUtil.randomString();
-         }
-         else if (prop.getPropertyType() == Integer.class || prop.getPropertyType() == Integer.TYPE)
-         {
-            value = RandomUtil.randomInt();
-         }
-         else if (prop.getPropertyType() == Long.class || prop.getPropertyType() == Long.TYPE)
-         {
-            value = RandomUtil.randomLong();
-         }
-         else if (prop.getPropertyType() == Boolean.class || prop.getPropertyType() == Boolean.TYPE)
-         {
-            value = RandomUtil.randomBoolean();
-         }
-         else if (prop.getPropertyType() == Double.class || prop.getPropertyType() == Double.TYPE)
-         {
-            value = RandomUtil.randomDouble();
-         }
-         else
-         {
-            System.out.println("Can't validate property of type " + prop.getPropertyType() + " on " + prop.getName());
-            value = null;
-         }
-
-         if (value != null && prop.getWriteMethod() != null && prop.getReadMethod() == null)
-         {
-            System.out.println("WriteOnly property " + prop.getName() + " on " + pojo.getClass());
-         }
-         else if (value != null & prop.getWriteMethod() != null &&
-            prop.getReadMethod() != null &&
-            !ignoreSet.contains(prop.getName()))
-         {
-            System.out.println("Validating " + prop.getName() + " type = " + prop.getPropertyType());
-            prop.getWriteMethod().invoke(pojo, value);
-
-            Assert.assertEquals("Property " + prop.getName(), value, prop.getReadMethod().invoke(pojo));
-         }
-      }
-   }
-
-   // Package protected ---------------------------------------------
-
-   // Protected -----------------------------------------------------
-
-   Map<Thread, StackTraceElement[]> previousThreads;
-
-   @Before
-   public void setUp() throws Exception
-   {
-      testDir = temporaryFolder.getRoot().getAbsolutePath();
-      clearDataRecreateServerDirs();
-      OperationContextImpl.clearContext();
-
-      InVMRegistry.instance.clear();
-
-      // checkFreePort(TransportConstants.DEFAULT_PORT);
-
-      previousThreads = Thread.getAllStackTraces();
-
-      logAndSystemOut("#test " + getName());
-   }
-
-   @After
-   public void tearDown() throws Exception
-   {
-      for (ExecutorService s : executorSet)
-      {
-         s.shutdown();
-      }
-      closeAllSessionFactories();
-      closeAllServerLocatorsFactories();
-
-      try
-      {
-         assertAllExecutorsFinished();
-         assertAllClientConsumersAreClosed();
-         assertAllClientProducersAreClosed();
-         assertAllClientSessionsAreClosed();
-      }
-      finally
-      {
-         synchronized (servers)
-         {
-            for (ActiveMQServer server : servers)
-            {
-               if (server == null)
-                  continue;
-               try
-               {
-                  final ClusterManager clusterManager = server.getClusterManager();
-                  if (clusterManager != null)
-                  {
-                     for (ClusterConnection cc : clusterManager.getClusterConnections())
-                     {
-                        stopComponent(cc);
-                     }
-                  }
-               }
-               catch (Exception e)
-               {
-                  // no-op
-               }
-               stopComponentOutputExceptions(server);
-            }
-            servers.clear();
-         }
-
-         closeAllOtherComponents();
-
-         ArrayList<Exception> exceptions;
-         try
-         {
-            exceptions = checkCsfStopped();
-         }
-         finally
-         {
-            cleanupPools();
-         }
-         //clean up pools before failing
-         if (!exceptions.isEmpty())
-         {
-            for (Exception exception : exceptions)
-            {
-               exception.printStackTrace();
-            }
-            fail("Client Session Factories still trying to reconnect, see above to see where created");
-         }
-         Map<Thread, StackTraceElement[]> threadMap = Thread.getAllStackTraces();
-         for (Thread thread : threadMap.keySet())
-         {
-            StackTraceElement[] stack = threadMap.get(thread);
-            for (StackTraceElement stackTraceElement : stack)
-            {
-               if (stackTraceElement.getMethodName().contains("getConnectionWithRetry") && !alreadyFailedThread.contains(thread))
-               {
-                  alreadyFailedThread.add(thread);
-                  System.out.println(threadDump(this.getName() + " has left threads running. Look at thread " +
-                                                   thread.getName() +
-                                                   " id = " +
-                                                   thread.getId() +
-                                                   " has running locators on test " +
-                                                   this.getName() +
-                                                   " on this following dump"));
-                  fail("test '" + getName() + "' left serverlocator running, this could effect other tests");
-               }
-               else if (stackTraceElement.getMethodName().contains("BroadcastGroupImpl.run") && !alreadyFailedThread.contains(thread))
-               {
-                  alreadyFailedThread.add(thread);
-                  System.out.println(threadDump(this.getName() + " has left threads running. Look at thread " +
-                                                   thread.getName() +
-                                                   " id = " +
-                                                   thread.getId() +
-                                                   " is still broadcasting " +
-                                                   this.getName() +
-                                                   " on this following dump"));
-                  fail("test left broadcastgroupimpl running, this could effect other tests");
-               }
-            }
-         }
-
-         if (checkThread)
-         {
-            StringBuffer buffer = null;
-
-            boolean failed = true;
-
-
-            long timeout = System.currentTimeMillis() + 60000;
-            while (failed && timeout > System.currentTimeMillis())
-            {
-               buffer = new StringBuffer();
-
-               failed = checkThread(buffer);
-
-               if (failed)
-               {
-                  forceGC();
-                  Thread.sleep(500);
-                  log.info("There are still threads running, trying again");
-                  System.out.println(buffer);
-               }
-            }
-
-            if (failed)
-            {
-               logAndSystemOut("Thread leaked on test " + this.getClass().getName() + "::" + this.getName() + "\n" +
-                                  buffer);
-               logAndSystemOut("Thread leakage");
-
-               fail("Thread leaked");
-            }
-
-         }
-         else
-         {
-            checkThread = true;
-         }
-
-         if (Thread.currentThread().getContextClassLoader() == null)
-         {
-            Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader());
-            fail("Thread Context ClassLoader was set to null at some point before this test. We will set to this.getClass().getClassLoader(), but you are supposed to fix your tests");
-         }
-
-         checkFilesUsage();
-      }
-   }
-
-   private void assertAllExecutorsFinished() throws InterruptedException
-   {
-      for (ExecutorService s : executorSet)
-      {
-         Assert.assertTrue(s.awaitTermination(5, TimeUnit.SECONDS));
-      }
-   }
-
-   private ArrayList<Exception> checkCsfStopped()
-   {
-      long time = System.currentTimeMillis();
-      long waitUntil = time + 5000;
-      while (!ClientSessionFactoryImpl.CLOSE_RUNNABLES.isEmpty() && time < waitUntil)
-      {
-         try
-         {
-            Thread.sleep(50);
-         }
-         catch (InterruptedException e)
-         {
-            //ignore
-         }
-         time = System.currentTimeMillis();
-      }
-      List<ClientSessionFactoryImpl.CloseRunnable> closeRunnables =
-         new ArrayList<ClientSessionFactoryImpl.CloseRunnable>(ClientSessionFactoryImpl.CLOSE_RUNNABLES);
-      ArrayList<Exception> exceptions = new ArrayList<Exception>();
-
-      if (!closeRunnables.isEmpty())
-      {
-         for (ClientSessionFactoryImpl.CloseRunnable closeRunnable : closeRunnables)
-         {
-            if (closeRunnable != null)
-            {
-               exceptions.add(closeRunnable.stop().createTrace);
-            }
-         }
-      }
-
-      return exceptions;
-   }
-
-   private void assertAllClientProducersAreClosed()
-   {
-      synchronized (clientProducers)
-      {
-         for (ClientProducer p : clientProducers)
-         {
-            assertTrue(p + " should be closed", p.isClosed());
-         }
-         clientProducers.clear();
-      }
-   }
-
-   /**
-    *
-    */
-   private void closeAllOtherComponents()
-   {
-      synchronized (otherComponents)
-      {
-         for (ActiveMQComponent c : otherComponents)
-         {
-            stopComponent(c);
-         }
-         otherComponents.clear();
-      }
-   }
-
-   /**
-    * @param buffer
-    * @return
-    */
-   private boolean checkThread(StringBuffer buffer)
-   {
-      boolean failedThread = false;
-
-      Map<Thread, StackTraceElement[]> postThreads = Thread.getAllStackTraces();
-
-      if (postThreads != null && previousThreads != null && postThreads.size() > previousThreads.size())
-      {
-
-         buffer.append("*********************************************************************************\n");
-         buffer.append("LEAKING THREADS\n");
-
-         for (Thread aliveThread : postThreads.keySet())
-         {
-            if (!isExpectedThread(aliveThread) && !previousThreads.containsKey(aliveThread))
-            {
-               failedThread = true;
-               buffer.append("=============================================================================\n");
-               buffer.append("Thread " + aliveThread + " is still alive with the following stackTrace:\n");
-               StackTraceElement[] elements = postThreads.get(aliveThread);
-               for (StackTraceElement el : elements)
-               {
-                  buffer.append(el + "\n");
-               }
-            }
-
-         }
-         buffer.append("*********************************************************************************\n");
-
-      }
-      return failedThread;
-   }
-
-   /**
-    * if it's an expected thread... we will just move along ignoring it
-    *
-    * @param thread
-    * @return
-    */
-   private boolean isExpectedThread(Thread thread)
-   {
-      final String threadName = thread.getName();
-      final ThreadGroup group = thread.getThreadGroup();
-      final boolean isSystemThread = group != null && "system".equals(group.getName());
-      final String javaVendor = System.getProperty("java.vendor");
-
-      if (threadName.contains("SunPKCS11"))
-      {
-         return true;
-      }
-      else if (threadName.contains("Attach Listener"))
-      {
-         return true;
-      }
-      else if ((javaVendor.contains("IBM") || isSystemThread) && threadName.equals("process reaper"))
-      {
-         return true;
-      }
-      else if (javaVendor.contains("IBM") && threadName.equals("MemoryPoolMXBean notification dispatcher"))
-      {
-         return true;
-      }
-      else if (threadName.contains("globalEventExecutor"))
-      {
-         return true;
-      }
-      else if (threadName.contains("threadDeathWatcher"))
-      {
-         return true;
-      }
-      else if (threadName.contains("netty-threads"))
-      {
-         // This is ok as we use EventLoopGroup.shutdownGracefully() which will shutdown things with a bit of delay
-         // if the EventLoop's are still busy.
-         return true;
-      }
-      else if (threadName.contains("threadDeathWatcher"))
-      {
-         //another netty thread
-         return true;
-      }
-      else
-      {
-         for (StackTraceElement element : thread.getStackTrace())
-         {
-            if (element.getClassName().contains("org.jboss.byteman.agent.TransformListener"))
-            {
-               return true;
-            }
-         }
-         return false;
-      }
-   }
-
-
-   private void checkFilesUsage()
-   {
-      long timeout = System.currentTimeMillis() + 15000;
-
-      while (AsynchronousFileImpl.getTotalMaxIO() != 0 && System.currentTimeMillis() > timeout)
-      {
-         try
-         {
-            Thread.sleep(100);
-         }
-         catch (Exception ignored)
-         {
-         }
-      }
-
-      int invmSize = InVMRegistry.instance.size();
-      if (invmSize > 0)
-      {
-         InVMRegistry.instance.clear();
-         log.info(threadDump("Thread dump"));
-         fail("invm registry still had acceptors registered");
-      }
-
-      final int totalMaxIO = AsynchronousFileImpl.getTotalMaxIO();
-      if (totalMaxIO != 0)
-      {
-         AsynchronousFileImpl.resetMaxAIO();
-         Assert.fail("test did not close all its files " + totalMaxIO);
-      }
-   }
-
-   private void cleanupPools()
-   {
-      OperationContextImpl.clearContext();
-
-      // We shutdown the global pools to give a better isolation between tests
-      try
-      {
-         ServerLocatorImpl.clearThreadPools();
-      }
-      catch (Throwable e)
-      {
-         log.info(threadDump(e.getMessage()));
-         System.err.println(threadDump(e.getMessage()));
-      }
-
-      try
-      {
-         NettyConnector.clearThreadPools();
-      }
-      catch (Exception e)
-      {
-         log.info(threadDump(e.getMessage()));
-         System.err.println(threadDump(e.getMessage()));
-      }
-   }
-
-   protected static final byte[] autoEncode(final Object... args)
-   {
-
-      int size = 0;
-
-      for (Object arg : args)
-      {
-         if (arg instanceof Byte)
-         {
-            size++;
-         }
-         else if (arg instanceof Boolean)
-         {
-            size++;
-         }
-         else if (arg instanceof Integer)
-         {
-            size += 4;
-         }
-         else if (arg instanceof Long)
-         {
-            size += 8;
-         }
-         else if (arg instanceof Float)
-         {
-            size += 4;
-         }
-         else if (arg instanceof Double)
-         {
-            size += 8;
-         }
-         else
-         {
-            throw ActiveMQMessageBundle.BUNDLE.autoConvertError(arg.getClass());
-         }
-      }
-
-      ByteBuffer buffer = ByteBuffer.allocate(size);
-
-      for (Object arg : args)
-      {
-         if (arg instanceof Byte)
-         {
-            buffer.put(((Byte) arg).byteValue());
-         }
-         else if (arg instanceof Boolean)
-         {
-            Boolean b = (Boolean) arg;
-            buffer.put((byte) (b.booleanValue() ? 1 : 0));
-         }
-         else if (arg instanceof Integer)
-         {
-            buffer.putInt(((Integer) arg).intValue());
-         }
-         else if (arg instanceof Long)
-         {
-            buffer.putLong(((Long) arg).longValue());
-         }
-         else if (arg instanceof Float)
-         {
-            buffer.putFloat(((Float) arg).floatValue());
-         }
-         else if (arg instanceof Double)
-         {
-            buffer.putDouble(((Double) arg).doubleValue());
-         }
-         else
-         {
-            throw ActiveMQMessageBundle.BUNDLE.autoConvertError(arg.getClass());
-         }
-      }
-
-      return buffer.array();
-   }
-
-   protected static final void recreateDirectory(final String directory)
-   {
-      File file = new File(directory);
-      deleteDirectory(file);
-      file.mkdirs();
-   }
-
-   protected static final boolean deleteDirectory(final File directory)
-   {
-      if (directory.isDirectory())
-      {
-         String[] files = directory.list();
-         int num = 5;
-         int attempts = 0;
-         while (files == null && (attempts < num))
-         {
-            try
-            {
-               Thread.sleep(100);
-            }
-            catch (InterruptedException e)
-            {
-            }
-            files = directory.list();
-            attempts++;
-         }
-
-         for (String file : files)
-         {
-            File f = new File(directory, file);
-            if (!deleteDirectory(f))
-            {
-               log.warn("Failed to clean up file: " + f.getAbsolutePath());
-            }
-         }
-      }
-
-      return directory.delete();
-   }
-
-   protected static final void copyRecursive(final File from, final File to) throws Exception
-   {
-      if (from.isDirectory())
-      {
-         if (!to.exists())
-         {
-            to.mkdir();
-         }
-
-         String[] subs = from.list();
-
-         for (String sub : subs)
-         {
-            copyRecursive(new File(from, sub), new File(to, sub));
-         }
-      }
-      else
-      {
-         InputStream in = null;
-
-         OutputStream out = null;
-
-         try
-         {
-            in = new BufferedInputStream(new FileInputStream(from));
-
-            out = new BufferedOutputStream(new FileOutputStream(to));
-
-            int b;
-
-            while ((b = in.read()) != -1)
-            {
-               out.write(b);
-            }
-         }
-         finally
-         {
-            if (in != null)
-            {
-               in.close();
-            }
-
-            if (out != null)
-            {
-               out.close();
-            }
-         }
-      }
-   }
-
-   protected void assertRefListsIdenticalRefs(final List<MessageReference> l1, final List<MessageReference> l2)
-   {
-      if (l1.size() != l2.size())
-      {
-         Assert.fail("Lists different sizes: " + l1.size() + ", " + l2.size());
-      }
-
-      Iterator<MessageReference> iter1 = l1.iterator();
-      Iterator<MessageReference> iter2 = l2.iterator();
-
-      while (iter1.hasNext())
-      {
-         MessageReference o1 = iter1.next();
-         MessageReference o2 = iter2.next();
-
-         Assert.assertTrue("expected " + o1 + " but was " + o2, o1 == o2);
-      }
-   }
-
-   protected ServerMessage generateMessage(final long id)
-   {
-      ServerMessage message = new ServerMessageImpl(id, 1000);
-
-      message.setMessageID(id);
-
-      message.getBodyBuffer().writeString(UUID.randomUUID().toString());
-
-      message.setAddress(new SimpleString("foo"));
-
-      return message;
-   }
-
-   protected MessageReference generateReference(final Queue queue, final long id)
-   {
-      ServerMessage message = generateMessage(id);
-
-      return message.createReference(queue);
-   }
-
-   protected int calculateRecordSize(final int size, final int alignment)
-   {
-      return (size / alignment + (size % alignment != 0 ? 1 : 0)) * alignment;
-   }
-
-   protected ClientMessage createTextMessage(final ClientSession session, final String s)
-   {
-      return createTextMessage(session, s, true);
-   }
-
-
-   protected ClientMessage createTextMessage(final ClientSession session, final String s, final boolean durable)
-   {
-      ClientMessage message = session.createMessage(Message.TEXT_TYPE,
-                                                    durable,
-                                                    0,
-                                                    System.currentTimeMillis(),
-                                                    (byte) 4);
-      message.getBodyBuffer().writeString(s);
-      return message;
-   }
-
-   protected XidImpl newXID()
-   {
-      return new XidImpl("xa1".getBytes(), 1, UUIDGenerator.getInstance().generateStringUUID().getBytes());
-   }
-
-   protected int getMessageCount(final ActiveMQServer service, final String address) throws Exception
-   {
-      return getMessageCount(service.getPostOffice(), address);
-   }
-
-   /**
-    * @param address
-    * @param postOffice
-    * @return
-    * @throws Exception
-    */
-   protected int getMessageCount(final PostOffice postOffice, final String address) throws Exception
-   {
-      int messageCount = 0;
-
-      List<QueueBinding> bindings = getLocalQueueBindings(postOffice, address);
-
-      for (QueueBinding qBinding : bindings)
-      {
-         qBinding.getQueue().flushExecutor();
-         messageCount += getMessageCount(qBinding.getQueue());
-      }
-
-      return messageCount;
-   }
-
-   protected int getMessageCount(final Queue queue)
-   {
-      queue.flushExecutor();
-      return (int)queue.getMessageCount();
-   }
-
-   protected int getMessagesAdded(final Queue queue)
-   {
-      queue.flushExecutor();
-      return (int)queue.getMessagesAdded();
-   }
-
-   protected List<QueueBinding> getLocalQueueBindings(final PostOffice postOffice, final String address) throws Exception
-   {
-      ArrayList<QueueBinding> bindingsFound = new ArrayList<QueueBinding>();
-
-      Bindings bindings = postOffice.getBindingsForAddress(new SimpleString(address));
-
-      for (Binding binding : bindings.getBindings())
-      {
-         if (binding instanceof LocalQueueBinding)
-         {
-            bindingsFound.add((QueueBinding) binding);
-         }
-      }
-      return bindingsFound;
-   }
-
-   /**
-    * It will inspect the journal directly and determine if there are queues on this journal,
-    *
-    * @param serverToInvestigate
-    * @return a Map containing the reference counts per queue
-    * @throws Exception
-    */
-   protected Map<Long, AtomicInteger> loadQueues(ActiveMQServer serverToInvestigate) throws Exception
-   {
-      SequentialFileFactory messagesFF = new NIOSequentialFileFactory(serverToInvestigate.getConfiguration()
-                                                                         .getJournalDirectory());
-
-      JournalImpl messagesJournal = new JournalImpl(serverToInvestigate.getConfiguration().getJournalFileSize(),
-                                                    serverToInvestigate.getConfiguration().getJournalMinFiles(),
-                                                    0,
-                                                    0,
-                                                    messagesFF,
-                                                    "activemq-data",
-                                                    "amq",
-                                                    1);
-      List<RecordInfo> records = new LinkedList<RecordInfo>();
-
-      List<PreparedTransactionInfo> preparedTransactions = new LinkedList<PreparedTransactionInfo>();
-
-      messagesJournal.start();
-      messagesJournal.load(records, preparedTransactions, null);
-
-      // These are more immutable integers
-      Map<Long, AtomicInteger> messageRefCounts = new HashMap<Long, AtomicInteger>();
-
-      for (RecordInfo info : records)
-      {
-         Object o = DescribeJournal.newObjectEncoding(info);
-         if (info.getUserRecordType() == JournalRecordIds.ADD_REF)
-         {
-            ReferenceDescribe ref = (ReferenceDescribe) o;
-            AtomicInteger count = messageRefCounts.get(ref.refEncoding.queueID);
-            if (count == null)
-            {
-               count = new AtomicInteger(1);
-               messageRefCounts.put(ref.refEncoding.queueID, count);
-            }
-            else
-            {
-               count.incrementAndGet();
-            }
-         }
-      }
-
-      messagesJournal.stop();
-
-      return messageRefCounts;
-
-   }
-
-   protected final ServerLocator createInVMNonHALocator()
-   {
-      return createNonHALocator(false);
-   }
-
-   protected final ServerLocator createNettyNonHALocator()
-   {
-      return createNonHALocator(true);
-   }
-
-   protected final ServerLocator createNonHALocator(final boolean isNetty)
-   {
-      ServerLocator locatorWithoutHA = internalCreateNonHALocator(isNetty);
-      return addServerLocator(locatorWithoutHA);
-   }
-
-   /**
-    * Creates the Locator without adding it to the list where the tearDown will take place
-    * This is because we don't want it closed in certain tests where we are issuing failures
-    * @param isNetty
-    * @return
-    */
-   protected ServerLocator internalCreateNonHALocator(boolean isNetty)
-   {
-      return isNetty
-         ? ActiveMQClient.createServerLocatorWithoutHA(new TransportConfiguration(NETTY_CONNECTOR_FACTORY))
-         : ActiveMQClient.createServerLocatorWithoutHA(new TransportConfiguration(INVM_CONNECTOR_FACTORY));
-   }
-
-   protected static final void stopComponent(ActiveMQComponent component)
-   {
-      if (component == null)
-         return;
-      try
-      {
-         component.stop();
-      }
-      catch (Exception e)
-      {
-         // no-op
-      }
-   }
-
-   protected static final void stopComponentOutputExceptions(ActiveMQComponent component)
-   {
-      if (component == null)
-         return;
-      try
-      {
-         component.stop();
-      }
-      catch (Exception e)
-      {
-         System.err.println("Exception closing " + component);
-         e.printStackTrace();
-      }
-   }
-
-   protected final ClientSessionFactory createSessionFactory(ServerLocator locator) throws Exception
-   {
-      ClientSessionFactory sf = locator.createSessionFactory();
-      addSessionFactory(sf);
-      return sf;
-   }
-
-   protected final ActiveMQServer addServer(final ActiveMQServer server)
-   {
-      if (server != null)
-      {
-         synchronized (servers)
-         {
-            servers.add(server);
-         }
-      }
-      return server;
-   }
-
-   protected final ServerLocator addServerLocator(final ServerLocator locator)
-   {
-      if (locator != null)
-      {
-         synchronized (locators)
-         {
-            locators.add(locator);
-         }
-      }
-      return locator;
-   }
-
-   protected final ClientSession addClientSession(final ClientSession session)
-   {
-      if (session != null)
-      {
-         synchronized (clientSessions)
-         {
-            clientSessions.add(session);
-         }
-      }
-      return session;
-   }
-
-   protected final ClientConsumer addClientConsumer(final ClientConsumer consumer)
-   {
-      if (consumer != null)
-      {
-         synchronized (clientConsumers)
-         {
-            clientConsumers.add(consumer);
-         }
-      }
-      return consumer;
-   }
-
-   protected final ClientProducer addClientProducer(final ClientProducer producer)
-   {
-      if (producer != null)
-      {
-         synchronized (clientProducers)
-         {
-            clientProducers.add(producer);
-         }
-      }
-      return producer;
-   }
-
-   protected final void addActiveMQComponent(final ActiveMQComponent component)
-   {
-      if (component != null)
-      {
-         synchronized (otherComponents)
-         {
-            otherComponents.add(component);
-         }
-      }
-   }
-
-   protected final ClientSessionFactory addSessionFactory(final ClientSessionFactory sf)
-   {
-      if (sf != null)
-      {
-         synchronized (sessionFactories)
-         {
-            sessionFactories.add(sf);
-         }
-      }
-      return sf;
-   }
-
-   private void assertAllClientConsumersAreClosed()
-   {
-      synchronized (clientConsumers)
-      {
-         for (ClientConsumer cc : clientConsumers)
-         {
-            if (cc == null)
-               continue;
-            assertTrue(cc.isClosed());
-         }
-         clientConsumers.clear();
-      }
-   }
-
-   private void assertAllClientSessionsAreClosed()
-   {
-      synchronized (clientSessions)
-      {
-         for (final ClientSession cs : clientSessions)
-         {
-            if (cs == null)
-               continue;
-            assertTrue(cs.isClosed());
-         }
-         clientSessions.clear();
-      }
-   }
-
-   protected void closeAllSessionFactories()
-   {
-      synchronized (sessionFactories)
-      {
-         for (ClientSessionFactory sf : sessionFactories)
-         {
-            closeSessionFactory(sf);
-            assert sf.isClosed();
-         }
-         sessionFactories.clear();
-      }
-   }
-
-   protected void closeAllServerLocatorsFactories()
-   {
-      synchronized (locators)
-      {
-         for (ServerLocator locator : locators)
-         {
-            closeServerLocator(locator);
-         }
-         locators.clear();
-      }
-   }
-
-   public static final void closeServerLocator(ServerLocator locator)
-   {
-      if (locator == null)
-         return;
-      try
-      {
-         locator.close();
-      }
-      catch (Exception e)
-      {
-         e.printStackTrace();
-      }
-   }
-
-   public static final void closeSessionFactory(final ClientSessionFactory sf)
-   {
-      if (sf == null)
-         return;
-      try
-      {
-         sf.close();
-      }
-      catch (Exception e)
-      {
-         e.printStackTrace();
-      }
-   }
-
-   public static void crashAndWaitForFailure(ActiveMQServer server, ClientSession... sessions) throws Exception
-   {
-      CountDownLatch latch = new CountDownLatch(sessions.length);
-      for (ClientSession session : sessions)
-      {
-         CountDownSessionFailureListener listener = new CountDownSessionFailureListener(latch, session);
-         session.addFailureListener(listener);
-      }
-
-      ClusterManager clusterManager = server.getClusterManager();
-      clusterManager.flushExecutor();
-      clusterManager.clear();
-      Assert.assertTrue("server should be running!", server.isStarted());
-      server.stop(true);
-
-      if (sessions.length > 0)
-      {
-         // Wait to be informed of failure
-         boolean ok = latch.await(10000, TimeUnit.MILLISECONDS);
-         Assert.assertTrue("Failed to stop the server! Latch count is " + latch.getCount() + " out of " +
-                              sessions.length, ok);
-      }
-   }
-
-   public static void crashAndWaitForFailure(ActiveMQServer server, ServerLocator locator) throws Exception
-   {
-      ClientSessionFactory sf = locator.createSessionFactory();
-      ClientSession session = sf.createSession();
-      try
-      {
-         crashAndWaitForFailure(server, session);
-      }
-      finally
-      {
-         try
-         {
-            session.close();
-            sf.close();
-         }
-         catch (Exception ignored)
-         {
-         }
-      }
-   }
-
-   public interface RunnerWithEX
-   {
-      void run() throws Throwable;
-   }
-
-   // This can be used to interrupt a thread if it takes more than timeoutMilliseconds
-   public boolean runWithTimeout(final RunnerWithEX runner, final long timeoutMilliseconds) throws Throwable
-   {
-
-      class ThreadRunner extends Thread
-      {
-
-         Throwable t;
-
-         final RunnerWithEX run;
-
-         ThreadRunner(RunnerWithEX run)
-         {
-            this.run = run;
-         }
-
-         public void run()
-         {
-            try
-            {
-               runner.run();
-            }
-            catch (Throwable t)
-            {
-               this.t = t;
-            }
-         }
-      }
-
-      ThreadRunner runnerThread = new ThreadRunner(runner);
-
-      runnerThread.start();
-
-      boolean hadToInterrupt = false;
-      while (runnerThread.isAlive())
-      {
-         runnerThread.join(timeoutMilliseconds);
-         if (runnerThread.isAlive())
-         {
-            System.err.println("Thread still running, interrupting it now:");
-            for (Object t : runnerThread.getStackTrace())
-            {
-               System.err.println(t);
-            }
-            hadToInterrupt = true;
-            runnerThread.interrupt();
-         }
-      }
-
-      if (runnerThread.t != null)
-      {
-         runnerThread.t.printStackTrace();
-         throw runnerThread.t;
-      }
-
-      // we are returning true if it ran ok.
-      // had to Interrupt is exactly the opposite of what we are returning
-      return !hadToInterrupt;
-   }
-
-
-   // Private -------------------------------------------------------
-
-   // Inner classes -------------------------------------------------
-
-   protected interface ActiveMQAction
-   {
-      void run() throws Exception;
-   }
-
-   /**
-    * Asserts that latch completes within a (rather large interval).
-    * <p/>
-    * Use this instead of just calling {@code latch.await()}. Otherwise your test may hang the whole
-    * test run if it fails to count-down the latch.
-    *
-    * @param latch
-    * @throws InterruptedException
-    */
-   public static void waitForLatch(CountDownLatch latch) throws InterruptedException
-   {
-      assertTrue("Latch has got to return within a minute", latch.await(1, TimeUnit.MINUTES));
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/docs/hacking-guide/en/tests.md
----------------------------------------------------------------------
diff --git a/docs/hacking-guide/en/tests.md b/docs/hacking-guide/en/tests.md
index 8cc09d9..24bb520 100644
--- a/docs/hacking-guide/en/tests.md
+++ b/docs/hacking-guide/en/tests.md
@@ -1,5 +1,7 @@
 # Tests
 
+## Running Tests
+
 To run the unit tests:
 
     $ mvn -Ptests test
@@ -12,4 +14,14 @@ Running tests individually
 
     $ mvn -Ptests -DfailIfNoTests=false -Dtest=<test-name> test
 
-where &lt;test-name> is the name of the Test class without its package name
\ No newline at end of file
+where &lt;test-name> is the name of the Test class without its package name
+
+## Writing Tests
+
+The broker is comprised of POJOs so it's simple to configure and run a broker instance and test particular functionality.
+Even complex test-cases involving multiple clustered brokers are relatively easy to write. Almost every test in the 
+test-suite follows this pattern - configure broker, start broker, test functionality, stop broker.
+
+The test-suite uses JUnit to manage test execution and life-cycle.  Most tests extend [org.apache.activemq.artemis.tests.util.ServiceTestBase](../../../artemis-server/src/test/java/org/apache/activemq/artemis/tests/util/ServiceTestBase.java)
+which contains JUnit setup and tear-down methods as well as a wealth of utility functions to configure, start, manage,
+and stop brokers as well as perform other common tasks.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/ClosingConnectionTest.java
----------------------------------------------------------------------
diff --git a/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/ClosingConnectionTest.java b/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/ClosingConnectionTest.java
index 4007b5b..24f5af3 100644
--- a/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/ClosingConnectionTest.java
+++ b/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/ClosingConnectionTest.java
@@ -179,7 +179,8 @@ public class ClosingConnectionTest extends ServiceTestBase
 
    private ActiveMQServer newActiveMQServer() throws Exception
    {
-      ActiveMQServer server = createServer(true, createDefaultConfig(isNetty()), mBeanServer);
+      ActiveMQServer server = createServer(true, createDefaultConfig(isNetty()));
+      server.setMBeanServer(mBeanServer);
 
       AddressSettings defaultSetting = new AddressSettings();
       defaultSetting.setPageSizeBytes(10 * 1024);

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/jms/bridge/BridgeTestBase.java
----------------------------------------------------------------------
diff --git a/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/jms/bridge/BridgeTestBase.java b/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/jms/bridge/BridgeTestBase.java
index 668db2d..1dc7d9e 100644
--- a/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/jms/bridge/BridgeTestBase.java
+++ b/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/jms/bridge/BridgeTestBase.java
@@ -60,12 +60,12 @@ import org.apache.activemq.artemis.jms.server.JMSServerManager;
 import org.apache.activemq.artemis.jms.server.impl.JMSServerManagerImpl;
 import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger;
 import org.apache.activemq.artemis.tests.unit.util.InVMNamingContext;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.junit.After;
 import org.junit.Assert;
 import org.junit.Before;
 
-public abstract class BridgeTestBase extends UnitTestCase
+public abstract class BridgeTestBase extends ServiceTestBase
 {
    private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER;
 
@@ -392,7 +392,7 @@ public abstract class BridgeTestBase extends UnitTestCase
             if (largeMessage)
             {
                BytesMessage msg = sess.createBytesMessage();
-               ((ActiveMQMessage) msg).setInputStream(UnitTestCase.createFakeLargeStream(1024L * 1024L));
+               ((ActiveMQMessage) msg).setInputStream(ServiceTestBase.createFakeLargeStream(1024L * 1024L));
                msg.setStringProperty("msg", "message" + i);
                prod.send(msg);
             }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/DuplicateDetectionTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/DuplicateDetectionTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/DuplicateDetectionTest.java
index 1d7530f..264e597 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/DuplicateDetectionTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/DuplicateDetectionTest.java
@@ -16,34 +16,31 @@
  */
 package org.apache.activemq.artemis.tests.integration;
 
-import javax.transaction.xa.XAException;
-import javax.transaction.xa.XAResource;
-import javax.transaction.xa.Xid;
-
 import org.apache.activemq.artemis.api.core.ActiveMQDuplicateIdException;
 import org.apache.activemq.artemis.api.core.ActiveMQException;
 import org.apache.activemq.artemis.api.core.Message;
 import org.apache.activemq.artemis.api.core.SimpleString;
-import org.apache.activemq.artemis.api.core.TransportConfiguration;
 import org.apache.activemq.artemis.api.core.client.ClientConsumer;
 import org.apache.activemq.artemis.api.core.client.ClientMessage;
 import org.apache.activemq.artemis.api.core.client.ClientProducer;
 import org.apache.activemq.artemis.api.core.client.ClientSession;
 import org.apache.activemq.artemis.api.core.client.ClientSessionFactory;
-import org.apache.activemq.artemis.api.core.client.ActiveMQClient;
 import org.apache.activemq.artemis.api.core.client.ServerLocator;
-import org.apache.activemq.artemis.tests.util.ServiceTestBase;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
 import org.apache.activemq.artemis.core.config.Configuration;
 import org.apache.activemq.artemis.core.message.impl.MessageImpl;
 import org.apache.activemq.artemis.core.postoffice.impl.PostOfficeImpl;
 import org.apache.activemq.artemis.core.server.ActiveMQServer;
 import org.apache.activemq.artemis.core.transaction.impl.XidImpl;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.apache.activemq.artemis.utils.UUIDGenerator;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
 
+import javax.transaction.xa.XAException;
+import javax.transaction.xa.XAResource;
+import javax.transaction.xa.Xid;
+
 public class DuplicateDetectionTest extends ServiceTestBase
 {
    private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER;
@@ -57,7 +54,7 @@ public class DuplicateDetectionTest extends ServiceTestBase
    @Test
    public void testSimpleDuplicateDetecion() throws Exception
    {
-      ServerLocator locator = ActiveMQClient.createServerLocatorWithoutHA(new TransportConfiguration(UnitTestCase.INVM_CONNECTOR_FACTORY));
+      ServerLocator locator = createInVMNonHALocator();
 
       ClientSessionFactory sf = createSessionFactory(locator);
 
@@ -165,7 +162,7 @@ public class DuplicateDetectionTest extends ServiceTestBase
    {
       final int TEST_SIZE = 100;
 
-      ServerLocator locator = ActiveMQClient.createServerLocatorWithoutHA(new TransportConfiguration(UnitTestCase.INVM_CONNECTOR_FACTORY));
+      ServerLocator locator = createInVMNonHALocator();
 
       locator.setBlockOnNonDurableSend(true);
 
@@ -242,7 +239,7 @@ public class DuplicateDetectionTest extends ServiceTestBase
    @Test
    public void testSimpleDuplicateDetectionWithString() throws Exception
    {
-      ServerLocator locator = ActiveMQClient.createServerLocatorWithoutHA(new TransportConfiguration(UnitTestCase.INVM_CONNECTOR_FACTORY));
+      ServerLocator locator = createInVMNonHALocator();
 
       ClientSessionFactory sf = createSessionFactory(locator);
 
@@ -313,7 +310,7 @@ public class DuplicateDetectionTest extends ServiceTestBase
    @Test
    public void testCacheSize() throws Exception
    {
-      ServerLocator locator = ActiveMQClient.createServerLocatorWithoutHA(new TransportConfiguration(UnitTestCase.INVM_CONNECTOR_FACTORY));
+      ServerLocator locator = createInVMNonHALocator();
 
       ClientSessionFactory sf = createSessionFactory(locator);
 
@@ -473,7 +470,7 @@ public class DuplicateDetectionTest extends ServiceTestBase
    @Test
    public void testTransactedDuplicateDetection1() throws Exception
    {
-      ServerLocator locator = ActiveMQClient.createServerLocatorWithoutHA(new TransportConfiguration(UnitTestCase.INVM_CONNECTOR_FACTORY));
+      ServerLocator locator = createInVMNonHALocator();
 
       ClientSessionFactory sf = createSessionFactory(locator);
 
@@ -526,7 +523,7 @@ public class DuplicateDetectionTest extends ServiceTestBase
    @Test
    public void testTransactedDuplicateDetection2() throws Exception
    {
-      ServerLocator locator = ActiveMQClient.createServerLocatorWithoutHA(new TransportConfiguration(UnitTestCase.INVM_CONNECTOR_FACTORY));
+      ServerLocator locator = createInVMNonHALocator();
 
       ClientSessionFactory sf = createSessionFactory(locator);
 
@@ -573,7 +570,7 @@ public class DuplicateDetectionTest extends ServiceTestBase
    @Test
    public void testTransactedDuplicateDetection3() throws Exception
    {
-      ServerLocator locator = ActiveMQClient.createServerLocatorWithoutHA(new TransportConfiguration(UnitTestCase.INVM_CONNECTOR_FACTORY));
+      ServerLocator locator = createInVMNonHALocator();
 
       ClientSessionFactory sf = createSessionFactory(locator);
 
@@ -639,7 +636,7 @@ public class DuplicateDetectionTest extends ServiceTestBase
    @Test
    public void testRollbackThenSend() throws Exception
    {
-      ServerLocator locator = ActiveMQClient.createServerLocatorWithoutHA(new TransportConfiguration(UnitTestCase.INVM_CONNECTOR_FACTORY));
+      ServerLocator locator = createInVMNonHALocator();
 
       ClientSessionFactory sf = createSessionFactory(locator);
 
@@ -688,7 +685,7 @@ public class DuplicateDetectionTest extends ServiceTestBase
    @Test
    public void testEntireTransactionRejected() throws Exception
    {
-      ServerLocator locator = ActiveMQClient.createServerLocatorWithoutHA(new TransportConfiguration(UnitTestCase.INVM_CONNECTOR_FACTORY));
+      ServerLocator locator = createInVMNonHALocator();
 
       ClientSessionFactory sf = createSessionFactory(locator);
 
@@ -784,7 +781,7 @@ public class DuplicateDetectionTest extends ServiceTestBase
    @Test
    public void testXADuplicateDetection1() throws Exception
    {
-      ServerLocator locator = ActiveMQClient.createServerLocatorWithoutHA(new TransportConfiguration(UnitTestCase.INVM_CONNECTOR_FACTORY));
+      ServerLocator locator = createInVMNonHALocator();
 
       ClientSessionFactory sf = createSessionFactory(locator);
 
@@ -864,7 +861,7 @@ public class DuplicateDetectionTest extends ServiceTestBase
    @Test
    public void testXADuplicateDetection2() throws Exception
    {
-      ServerLocator locator = ActiveMQClient.createServerLocatorWithoutHA(new TransportConfiguration(UnitTestCase.INVM_CONNECTOR_FACTORY));
+      ServerLocator locator = createInVMNonHALocator();
 
       ClientSessionFactory sf = createSessionFactory(locator);
 
@@ -946,7 +943,7 @@ public class DuplicateDetectionTest extends ServiceTestBase
    @Test
    public void testXADuplicateDetection3() throws Exception
    {
-      ServerLocator locator = ActiveMQClient.createServerLocatorWithoutHA(new TransportConfiguration(UnitTestCase.INVM_CONNECTOR_FACTORY));
+      ServerLocator locator = createInVMNonHALocator();
 
       ClientSessionFactory sf = createSessionFactory(locator);
 
@@ -1027,7 +1024,7 @@ public class DuplicateDetectionTest extends ServiceTestBase
    @Test
    public void testXADuplicateDetectionPrepareAndRollback() throws Exception
    {
-      ServerLocator locator = ActiveMQClient.createServerLocatorWithoutHA(new TransportConfiguration(UnitTestCase.INVM_CONNECTOR_FACTORY));
+      ServerLocator locator = createInVMNonHALocator();
 
       ClientSessionFactory sf = createSessionFactory(locator);
 
@@ -1100,7 +1097,7 @@ public class DuplicateDetectionTest extends ServiceTestBase
    @Test
    public void testXADuplicateDetectionPrepareAndRollbackStopServer() throws Exception
    {
-      ServerLocator locator = ActiveMQClient.createServerLocatorWithoutHA(new TransportConfiguration(UnitTestCase.INVM_CONNECTOR_FACTORY));
+      ServerLocator locator = createInVMNonHALocator();
 
       ClientSessionFactory sf = createSessionFactory(locator);
 
@@ -1187,7 +1184,7 @@ public class DuplicateDetectionTest extends ServiceTestBase
    @Test
    public void testXADuplicateDetection4() throws Exception
    {
-      ServerLocator locator = ActiveMQClient.createServerLocatorWithoutHA(new TransportConfiguration(UnitTestCase.INVM_CONNECTOR_FACTORY));
+      ServerLocator locator = createInVMNonHALocator();
 
       ClientSessionFactory sf = createSessionFactory(locator);
 
@@ -1296,7 +1293,7 @@ public class DuplicateDetectionTest extends ServiceTestBase
 
       messagingService2.start();
 
-      ServerLocator locator = ActiveMQClient.createServerLocatorWithoutHA(new TransportConfiguration(UnitTestCase.INVM_CONNECTOR_FACTORY));
+      ServerLocator locator = createInVMNonHALocator();
 
       ClientSessionFactory sf = createSessionFactory(locator);
 
@@ -1383,7 +1380,7 @@ public class DuplicateDetectionTest extends ServiceTestBase
 
       messagingService2.start();
 
-      ServerLocator locator = ActiveMQClient.createServerLocatorWithoutHA(new TransportConfiguration(UnitTestCase.INVM_CONNECTOR_FACTORY));
+      ServerLocator locator = createInVMNonHALocator();
 
       ClientSessionFactory sf = createSessionFactory(locator);
 
@@ -1465,7 +1462,7 @@ public class DuplicateDetectionTest extends ServiceTestBase
 
       messagingService2.start();
 
-      ServerLocator locator = ActiveMQClient.createServerLocatorWithoutHA(new TransportConfiguration(UnitTestCase.INVM_CONNECTOR_FACTORY));
+      ServerLocator locator = createInVMNonHALocator();
 
       ClientSessionFactory sf = createSessionFactory(locator);
 
@@ -1558,7 +1555,7 @@ public class DuplicateDetectionTest extends ServiceTestBase
 
       messagingService2.start();
 
-      ServerLocator locator = ActiveMQClient.createServerLocatorWithoutHA(new TransportConfiguration(UnitTestCase.INVM_CONNECTOR_FACTORY));
+      ServerLocator locator = createInVMNonHALocator();
 
       ClientSessionFactory sf = createSessionFactory(locator);
 
@@ -1659,7 +1656,7 @@ public class DuplicateDetectionTest extends ServiceTestBase
 
       messagingService2.start();
 
-      ServerLocator locator = ActiveMQClient.createServerLocatorWithoutHA(new TransportConfiguration(UnitTestCase.INVM_CONNECTOR_FACTORY));
+      ServerLocator locator = createInVMNonHALocator();
 
       ClientSessionFactory sf = createSessionFactory(locator);
 
@@ -1745,7 +1742,7 @@ public class DuplicateDetectionTest extends ServiceTestBase
 
       messagingService2.start();
 
-      ServerLocator locator = ActiveMQClient.createServerLocatorWithoutHA(new TransportConfiguration(UnitTestCase.INVM_CONNECTOR_FACTORY));
+      ServerLocator locator = createInVMNonHALocator();
 
       ClientSessionFactory sf = createSessionFactory(locator);
 
@@ -1834,7 +1831,7 @@ public class DuplicateDetectionTest extends ServiceTestBase
 
       messagingService2.start();
 
-      ServerLocator locator = ActiveMQClient.createServerLocatorWithoutHA(new TransportConfiguration(UnitTestCase.INVM_CONNECTOR_FACTORY));
+      ServerLocator locator = createInVMNonHALocator();
 
       ClientSessionFactory sf = createSessionFactory(locator);
 
@@ -1954,7 +1951,7 @@ public class DuplicateDetectionTest extends ServiceTestBase
 
       messagingService2.start();
 
-      ServerLocator locator = ActiveMQClient.createServerLocatorWithoutHA(new TransportConfiguration(UnitTestCase.INVM_CONNECTOR_FACTORY));
+      ServerLocator locator = createInVMNonHALocator();
 
       ClientSessionFactory sf = createSessionFactory(locator);
 
@@ -2057,7 +2054,7 @@ public class DuplicateDetectionTest extends ServiceTestBase
 
       messagingService2.start();
 
-      ServerLocator locator = ActiveMQClient.createServerLocatorWithoutHA(new TransportConfiguration(UnitTestCase.INVM_CONNECTOR_FACTORY));
+      ServerLocator locator = createInVMNonHALocator();
 
       ClientSessionFactory sf = createSessionFactory(locator);
 
@@ -2158,7 +2155,7 @@ public class DuplicateDetectionTest extends ServiceTestBase
 
       messagingService2.start();
 
-      ServerLocator locator = ActiveMQClient.createServerLocatorWithoutHA(new TransportConfiguration(UnitTestCase.INVM_CONNECTOR_FACTORY));
+      ServerLocator locator = createInVMNonHALocator();
 
       ClientSessionFactory sf = createSessionFactory(locator);
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/String64KLimitTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/String64KLimitTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/String64KLimitTest.java
index 45847e7..bffdc97 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/String64KLimitTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/String64KLimitTest.java
@@ -33,7 +33,7 @@ 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.RandomUtil;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 
 /**
  *
@@ -43,7 +43,7 @@ import org.apache.activemq.artemis.tests.util.UnitTestCase;
  * http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4806007
  * http://jira.jboss.com/jira/browse/JBAS-2641
  */
-public class String64KLimitTest extends UnitTestCase
+public class String64KLimitTest extends ServiceTestBase
 {
    // Constants -----------------------------------------------------
 


[10/13] activemq-artemis git commit: Refactor base test classes

Posted by an...@apache.org.
Refactor base test classes

This has bothered me for awhile, but writing the hacking guide has
given me an opportunity to refactor some of our test-suite to be
simpler, more consistent, and easier to understand. This is
important if we want users to provide well-written tests. Our
test-suite is an important part of the code-base and it should be
easy to write good tests.

Basically I just consolidated CoreUnitTestCase, UnitTestCase, and
ServiceTestBase into a single class named ServiceTestBase. I also
simplified some of the configuration creation methods to reduce
duplicated code.


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/99147d07
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/99147d07
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/99147d07

Branch: refs/heads/master
Commit: 99147d0713bd1688e4c79b6d2e551bff9203ea4a
Parents: 7025886
Author: jbertram <jb...@apache.org>
Authored: Mon May 18 11:07:28 2015 -0500
Committer: jbertram <jb...@apache.org>
Committed: Tue May 19 15:27:13 2015 -0500

----------------------------------------------------------------------
 .../artemis/tests/CoreUnitTestCase.java         |   89 -
 .../util/TimeAndCounterIDGeneratorTest.java     |   15 +-
 .../core/server/ActiveMQMessageBundle.java      |    3 +
 .../artemis/core/server/ActiveMQServer.java     |    4 +
 .../core/server/impl/ActiveMQServerImpl.java    |   12 +-
 .../core/config/impl/ConfigurationImplTest.java |   20 +-
 .../impl/FileConfigurationParserTest.java       |   14 +-
 .../config/impl/HAPolicyConfigurationTest.java  |   10 +-
 .../WrongRoleFileConfigurationParserTest.java   |   10 +-
 .../group/impl/ClusteredResetMockTest.java      |   18 +-
 .../core/settings/AddressSettingsTest.java      |    4 +-
 .../artemis/core/settings/RepositoryTest.java   |   12 +-
 .../artemis/tests/util/RemoveFolder.java        |    2 +-
 .../artemis/tests/util/ServiceTestBase.java     | 3326 +++++++++++++-----
 .../artemis/tests/util/SimpleStringTest.java    |    2 +-
 .../tests/util/SingleServerTestBase.java        |    2 +-
 .../artemis/tests/util/UnitTestCase.java        | 2137 -----------
 docs/hacking-guide/en/tests.md                  |   14 +-
 .../extras/byteman/ClosingConnectionTest.java   |    3 +-
 .../tests/extras/jms/bridge/BridgeTestBase.java |    6 +-
 .../integration/DuplicateDetectionTest.java     |   63 +-
 .../tests/integration/String64KLimitTest.java   |    4 +-
 .../aerogear/AeroGearBasicServerTest.java       |   29 +-
 .../integration/client/ActiveMQCrashTest.java   |   17 +-
 .../ConcurrentCreateDeleteProduceTest.java      |    2 +-
 .../integration/client/ConsumerCloseTest.java   |   18 +-
 .../integration/client/ConsumerStuckTest.java   |   10 +-
 .../client/DeadLetterAddressTest.java           |   27 +-
 .../integration/client/ExpiryAddressTest.java   |   21 +-
 .../integration/client/HangConsumerTest.java    |    2 +-
 .../integration/client/HeuristicXATest.java     |   42 +-
 .../client/IncompatibleVersionTest.java         |   10 +-
 .../client/InterruptedLargeMessageTest.java     |    8 +-
 .../client/JmsNettyNioStressTest.java           |   28 +-
 .../LargeMessageAvoidLargeMessagesTest.java     |    8 +-
 .../integration/client/LargeMessageTest.java    |   46 +-
 .../client/LibaioDependencyCheckTest.java       |    4 +-
 .../client/MessageDurabilityTest.java           |    5 +-
 .../MessageGroupingConnectionFactoryTest.java   |   25 +-
 .../integration/client/MessageGroupingTest.java |   45 +-
 .../integration/client/MessagePriorityTest.java |    5 +-
 .../client/MultipleThreadFilterOneTest.java     |    2 +-
 .../tests/integration/client/NIOvsOIOTest.java  |   24 +-
 .../client/NewDeadLetterAddressTest.java        |    8 +-
 .../integration/client/PagingOrderTest.java     |    6 +-
 .../tests/integration/client/PagingTest.java    |   67 +-
 .../integration/client/ProducerCloseTest.java   |   15 +-
 .../client/ProducerFlowControlTest.java         |   17 +-
 .../client/ReceiveImmediateTest.java            |    2 +-
 .../tests/integration/client/RequestorTest.java |    5 +-
 .../client/SelfExpandingBufferTest.java         |    9 +-
 .../client/SessionCloseOnGCTest.java            |   29 +-
 .../integration/client/SessionCloseTest.java    |   59 +-
 .../integration/client/TemporaryQueueTest.java  |    4 +-
 .../integration/client/WildCardRoutingTest.java |   21 +-
 .../cluster/ClusterControllerTest.java          |    8 +-
 .../cluster/RealNodeManagerTest.java            |    4 +-
 .../integration/cluster/bridge/BridgeTest.java  |   98 +-
 .../cluster/bridge/BridgeTestBase.java          |    4 +-
 .../cluster/distribution/ClusterTestBase.java   |   49 +-
 .../MessageRedistributionWithDiscoveryTest.java |    6 +-
 .../distribution/SymmetricClusterTest.java      |    4 +-
 .../SymmetricClusterWithBackupTest.java         |    4 +-
 .../SymmetricClusterWithDiscoveryTest.java      |    6 +-
 .../AutomaticColocatedQuorumVoteTest.java       |    6 +-
 .../failover/BackupSyncLargeMessageTest.java    |    8 +-
 .../cluster/failover/FailoverTestBase.java      |   27 +-
 .../failover/LiveToLiveFailoverTest.java        |    5 +-
 ...ultipleLivesMultipleBackupsFailoverTest.java |   18 +-
 .../MultipleServerFailoverTestBase.java         |    8 +-
 .../failover/QuorumVoteServerConnectTest.java   |    4 +-
 .../SingleLiveMultipleBackupsFailoverTest.java  |   11 +-
 .../MultiThreadRandomReattachTestBase.java      |    6 +-
 .../MultiThreadReattachSupportTestBase.java     |   22 +-
 .../cluster/reattach/RandomReattachTest.java    |   25 +-
 .../cluster/topology/IsolatedTopologyTest.java  |   21 +-
 .../topology/TopologyClusterTestBase.java       |   21 +-
 .../discovery/DiscoveryBaseTest.java            |    4 +-
 .../divert/PersistentDivertTest.java            |   23 +-
 .../integration/embedded/ValidateAIOTest.java   |    2 +-
 .../http/CoreClientOverHttpTest.java            |    4 +-
 .../jms/ActiveMQConnectionFactoryTest.java      |    4 +-
 .../tests/integration/jms/FloodServerTest.java  |    4 +-
 .../integration/jms/SimpleJNDIClientTest.java   |    4 +-
 .../jms/client/ReSendMessageTest.java           |    6 +-
 .../jms/cluster/JMSReconnectTest.java           |    4 +-
 .../jms/connection/CloseConnectionOnGCTest.java |    8 +-
 .../jms/connection/ExceptionListenerTest.java   |    4 +-
 .../jms/largemessage/JMSLargeMessageTest.java   |   18 +-
 .../jms/server/JMSServerStartStopTest.java      |    4 +-
 .../jms/server/config/JMSConfigurationTest.java |    2 +-
 .../ConnectionFactoryControlTest.java           |    8 +-
 .../server/management/JMSQueueControlTest.java  |    3 +-
 .../management/JMSServerControlRestartTest.java |   18 +-
 .../server/management/JMSServerControlTest.java |  114 +-
 .../journal/AIOImportExportTest.java            |    4 +-
 .../journal/AIOJournalCompactTest.java          |    4 +-
 .../journal/JournalPerfTuneTest.java            |    4 +-
 .../journal/NIOBufferedJournalCompactTest.java  |    4 +-
 .../journal/NIOImportExportTest.java            |    4 +-
 .../journal/NIOJournalCompactTest.java          |    6 +-
 .../integration/journal/NIOJournalImplTest.java |    4 +-
 .../journal/ValidateTransactionHealthTest.java  |    4 +-
 .../largemessage/LargeMessageTestBase.java      |   39 +-
 .../largemessage/ServerLargeMessageTest.java    |    7 +-
 .../management/AcceptorControlTest.java         |    9 +-
 .../AcceptorControlUsingCoreTest.java           |   12 +-
 .../management/ActiveMQServerControlTest.java   |   39 +-
 .../ActiveMQServerControlUsingCoreTest.java     |    7 +-
 .../management/AddressControlTest.java          |   16 +-
 .../management/AddressControlUsingCoreTest.java |    3 +-
 .../management/BroadcastGroupControlTest.java   |   10 +-
 .../ClusterConnectionControl2Test.java          |   10 +-
 .../ClusterConnectionControlUsingCoreTest.java  |    9 +-
 .../management/DivertControlUsingCoreTest.java  |    5 +-
 .../management/ManagementServiceImplTest.java   |    4 +-
 .../management/NotificationTest.java            |    4 +-
 .../management/QueueControlTest.java            |   18 +-
 .../management/SecurityManagementTestBase.java  |    6 +-
 .../management/SecurityNotificationTest.java    |   37 +-
 .../paging/MultipleProducersPagingTest.java     |    4 +-
 .../paging/SpawnedServerSupport.java            |   20 +-
 .../ra/ActiveMQMessageHandlerTest.java          |   19 +-
 .../ra/ActiveMQMessageHandlerXATest.java        |   12 +-
 .../ra/ActiveMQRAClusteredTestBase.java         |    4 +-
 .../integration/ra/ActiveMQRATestBase.java      |   23 +-
 .../integration/ra/ResourceAdapterTest.java     |   27 +-
 .../scheduling/DelayedMessageTest.java          |   11 +-
 .../MultipliedDelayedMessageTest.java           |    7 +-
 .../scheduling/ScheduledMessageTest.java        |   15 +-
 .../integration/security/SecurityTest.java      |    8 +-
 .../integration/server/ConnectionLimitTest.java |    4 +-
 .../integration/server/ExpiryRunnerTest.java    |   31 +-
 .../integration/server/LVQRecoveryTest.java     |   13 +-
 .../tests/integration/server/LVQTest.java       |   23 +-
 .../integration/server/ResourceLimitTest.java   |    4 +-
 .../integration/server/ScaleDown3NodeTest.java  |    6 +-
 .../tests/integration/server/ScaleDownTest.java |    4 +-
 .../server/SuppliedThreadPoolTest.java          |    4 +-
 .../spring/SpringIntegrationTest.java           |    4 +-
 .../tests/integration/stomp/StompTestBase.java  |    4 +-
 .../integration/stomp/StompWebSocketTest.java   |    4 +-
 .../integration/stomp/v11/StompV11TestBase.java |    4 +-
 .../netty/ActiveMQFrameDecoder2Test.java        |    4 +-
 .../NettyConnectorWithHTTPUpgradeTest.java      |    4 +-
 .../vertx/ActiveMQVertxUnitTest.java            |   11 +-
 .../integration/xa/BasicXaRecoveryTest.java     |   63 +-
 .../tests/integration/xa/XaTimeoutTest.java     |    6 +-
 .../tests/util/ReplicatedBackupUtils.java       |    4 +-
 .../tests/util/TransportConfigurationUtils.java |   20 +-
 .../artemis/jms/tests/MessageConsumerTest.java  |    8 +-
 .../tests/message/JMSExpirationHeaderTest.java  |   10 +-
 .../jms/tests/selector/SelectorTest.java        |    6 +-
 .../paging/MeasurePagingMultiThreadTest.java    |   10 +-
 .../stress/journal/AddAndRemoveStressTest.java  |    4 +-
 .../stress/journal/CompactingStressTest.java    |   21 +-
 .../JournalCleanupCompactStressTest.java        |   37 +-
 .../stress/journal/LargeJournalStressTest.java  |   15 +-
 .../journal/MultiThreadConsumerStressTest.java  |   13 +-
 .../NIOMultiThreadCompactorStressTest.java      |   19 +-
 .../tests/stress/stomp/StompStressTest.java     |    4 +-
 .../core/journal/impl/AIOJournalImplTest.java   |    4 +-
 .../core/journal/impl/NIOJournalImplTest.java   |    4 +-
 .../core/server/impl/QueueConcurrentTest.java   |    4 +-
 .../timing/core/server/impl/QueueImplTest.java  |    4 +-
 .../jms/bridge/impl/JMSBridgeImplTest.java      |    4 +-
 .../tests/timing/util/ReusableLatchTest.java    |    4 +-
 .../timing/util/TokenBucketLimiterImplTest.java |    4 +-
 .../artemis/tests/timing/util/UTF8Test.java     |    4 +-
 .../tests/unit/core/asyncio/AIOTestBase.java    |    4 +-
 .../unit/core/asyncio/AsynchronousFileTest.java |   22 +-
 .../MultiThreadAsynchronousFileTest.java        |    4 +-
 .../client/impl/LargeMessageBufferTest.java     |    8 +-
 .../impl/ConfigurationValidationTest.java       |    4 +-
 .../core/config/impl/ConnectorsServiceTest.java |    4 +-
 .../config/impl/TransportConfigurationTest.java |    4 +-
 .../journal/impl/AlignedJournalImplTest.java    |   10 +-
 .../unit/core/journal/impl/CleanBufferTest.java |    4 +-
 .../core/journal/impl/FileFactoryTestBase.java  |    4 +-
 .../core/journal/impl/JournalAsyncTest.java     |    4 +-
 .../core/journal/impl/JournalImplTestBase.java  |    8 +-
 .../unit/core/journal/impl/ReclaimerTest.java   |    4 +-
 .../impl/SequentialFileFactoryTestBase.java     |   12 +-
 .../unit/core/journal/impl/TimedBufferTest.java |   18 +-
 .../unit/core/message/impl/MessageImplTest.java |    4 +-
 .../unit/core/paging/impl/PagePositionTest.java |    4 +-
 .../tests/unit/core/paging/impl/PageTest.java   |    8 +-
 .../core/paging/impl/PagingManagerImplTest.java |    6 +-
 .../core/paging/impl/PagingStoreImplTest.java   |   16 +-
 .../impl/BatchIDGeneratorUnitTest.java          |    4 +-
 .../impl/OperationContextUnitTest.java          |    4 +-
 .../core/postoffice/impl/AddressImplTest.java   |    4 +-
 .../core/postoffice/impl/BindingsImplTest.java  |    4 +-
 .../impl/WildcardAddressManagerUnitTest.java    |    4 +-
 .../core/remoting/ActiveMQBufferTestBase.java   |   14 +-
 .../impl/netty/NettyAcceptorFactoryTest.java    |    4 +-
 .../remoting/impl/netty/NettyAcceptorTest.java  |   12 +-
 .../impl/netty/NettyConnectionTest.java         |    4 +-
 .../remoting/impl/netty/NettyConnectorTest.java |    4 +-
 .../core/remoting/impl/ssl/SSLSupportTest.java  |    4 +-
 .../impl/ActiveMQSecurityManagerImplTest.java   |    4 +-
 .../impl/ClusterConnectionBridgeTest.java       |    4 +-
 .../cluster/impl/RemoteQueueBindImplTest.java   |    4 +-
 .../group/impl/SystemPropertyOverrideTest.java  |    4 +-
 .../unit/core/server/impl/FileLockTest.java     |    4 +-
 .../unit/core/server/impl/QueueImplTest.java    |    6 +-
 .../tests/unit/jms/ActiveMQDestinationTest.java |    4 +-
 .../unit/jms/client/ActiveMQMapMessageTest.java |    6 +-
 .../jms/client/ActiveMQStreamMessageTest.java   |   12 +-
 .../unit/jms/client/JMSExceptionHelperTest.java |    4 +-
 .../unit/jms/client/SelectorTranslatorTest.java |    4 +-
 .../tests/unit/jms/misc/ManifestTest.java       |    4 +-
 .../ConnectionFactoryObjectFactoryTest.java     |    4 +-
 .../DestinationObjectFactoryTest.java           |    4 +-
 .../ra/ActiveMQResourceAdapterConfigTest.java   |    4 +-
 .../ra/ConnectionFactoryPropertiesTest.java     |    4 +-
 .../util/ActiveMQBufferInputStreamTest.java     |    4 +-
 .../artemis/tests/unit/util/LinkedListTest.java |    4 +-
 .../ObjectInputStreamWithClassLoaderTest.java   |    4 +-
 .../tests/unit/util/ReusableLatchTest.java      |    4 +-
 .../tests/unit/util/SoftValueMapTest.java       |    4 +-
 .../artemis/tests/unit/util/UTF8Test.java       |    4 +-
 .../tests/unit/util/UUIDGeneratorTest.java      |   10 +-
 .../artemis/tests/unit/util/UUIDTest.java       |    4 +-
 .../tests/unit/util/VersionLoaderTest.java      |    4 +-
 225 files changed, 3829 insertions(+), 4307 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/artemis-core-client/src/test/java/org/apache/activemq/artemis/tests/CoreUnitTestCase.java
----------------------------------------------------------------------
diff --git a/artemis-core-client/src/test/java/org/apache/activemq/artemis/tests/CoreUnitTestCase.java b/artemis-core-client/src/test/java/org/apache/activemq/artemis/tests/CoreUnitTestCase.java
deleted file mode 100644
index 3bdc561..0000000
--- a/artemis-core-client/src/test/java/org/apache/activemq/artemis/tests/CoreUnitTestCase.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.activemq.artemis.tests;
-
-
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.TimeUnit;
-
-import org.apache.activemq.artemis.core.client.ActiveMQClientLogger;
-import org.junit.Assert;
-import org.junit.Rule;
-import org.junit.rules.TestRule;
-import org.junit.rules.TestWatcher;
-import org.junit.runner.Description;
-
-public abstract class CoreUnitTestCase extends Assert
-{
-   public static void assertEqualsByteArrays(final byte[] expected, final byte[] actual)
-   {
-      for (int i = 0; i < expected.length; i++)
-      {
-         Assert.assertEquals("byte at index " + i, expected[i], actual[i]);
-      }
-   }
-
-   private static final ActiveMQClientLogger log = ActiveMQClientLogger.LOGGER;
-
-   @Rule
-   public TestRule watcher = new TestWatcher()
-   {
-      @Override
-      protected void starting(Description description)
-      {
-         log.info(String.format("#*#*# Starting test: %s()...", description.getMethodName()));
-      }
-
-      @Override
-      protected void finished(Description description)
-      {
-         log.info(String.format("#*#*# Finished test: %s()...", description.getMethodName()));
-      }
-   };
-
-   /**
-    * Asserts that latch completes within a (rather large interval).
-    * <p/>
-    * Use this instead of just calling {@code latch.await()}. Otherwise your test may hang the whole
-    * test run if it fails to count-down the latch.
-    *
-    * @param latch
-    * @throws InterruptedException
-    */
-   public static void waitForLatch(CountDownLatch latch) throws InterruptedException
-   {
-      assertTrue("Latch has got to return within a minute", latch.await(1, TimeUnit.MINUTES));
-   }
-
-   public static int countOccurrencesOf(String str, String sub)
-   {
-      if (str == null || sub == null || str.length() == 0 || sub.length() == 0)
-      {
-         return 0;
-      }
-      int count = 0;
-      int pos = 0;
-      int idx;
-      while ((idx = str.indexOf(sub, pos)) != -1)
-      {
-         ++count;
-         pos = idx + sub.length();
-      }
-      return count;
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/artemis-core-client/src/test/java/org/apache/activemq/artemis/util/TimeAndCounterIDGeneratorTest.java
----------------------------------------------------------------------
diff --git a/artemis-core-client/src/test/java/org/apache/activemq/artemis/util/TimeAndCounterIDGeneratorTest.java b/artemis-core-client/src/test/java/org/apache/activemq/artemis/util/TimeAndCounterIDGeneratorTest.java
index d97fafc..995b65b 100644
--- a/artemis-core-client/src/test/java/org/apache/activemq/artemis/util/TimeAndCounterIDGeneratorTest.java
+++ b/artemis-core-client/src/test/java/org/apache/activemq/artemis/util/TimeAndCounterIDGeneratorTest.java
@@ -16,16 +16,13 @@
  */
 package org.apache.activemq.artemis.util;
 
+import org.apache.activemq.artemis.utils.ConcurrentHashSet;
+import org.apache.activemq.artemis.utils.TimeAndCounterIDGenerator;
+import org.junit.Assert;
 import org.junit.Test;
 
 import java.util.concurrent.CountDownLatch;
-
-import org.junit.Assert;
-
-
-import org.apache.activemq.artemis.tests.CoreUnitTestCase;
-import org.apache.activemq.artemis.utils.ConcurrentHashSet;
-import org.apache.activemq.artemis.utils.TimeAndCounterIDGenerator;
+import java.util.concurrent.TimeUnit;
 
 public class TimeAndCounterIDGeneratorTest extends Assert
 {
@@ -105,7 +102,7 @@ public class TimeAndCounterIDGeneratorTest extends Assert
             try
             {
                latchAlign.countDown();
-               CoreUnitTestCase.waitForLatch(latchStart);
+               assertTrue("Latch has got to return within a minute", latchStart.await(1, TimeUnit.MINUTES));
 
                long lastValue = 0L;
                for (int i = 0; i < NUMBER_OF_IDS; i++)
@@ -136,7 +133,7 @@ public class TimeAndCounterIDGeneratorTest extends Assert
          arrays[i].start();
       }
 
-      CoreUnitTestCase.waitForLatch(latchAlign);
+      assertTrue("Latch has got to return within a minute", latchAlign.await(1, TimeUnit.MINUTES));
 
       latchStart.countDown();
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQMessageBundle.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQMessageBundle.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQMessageBundle.java
index e4396c2..51fcb01 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQMessageBundle.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQMessageBundle.java
@@ -359,4 +359,7 @@ public interface ActiveMQMessageBundle
 
    @Message(id = 119111, value = "Too many queues created by user ''{0}''. Queues allowed: {1}.", format = Message.Format.MESSAGE_FORMAT)
    ActiveMQSessionCreationException queueLimitReached(String username, int limit);
+
+   @Message(id = 119112, value = "Cannot set MBeanServer during startup or while started")
+   IllegalStateException cannotSetMBeanserver();
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQServer.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQServer.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQServer.java
index 18a3ce1..7790812 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQServer.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQServer.java
@@ -48,6 +48,8 @@ import org.apache.activemq.artemis.spi.core.protocol.SessionCallback;
 import org.apache.activemq.artemis.spi.core.security.ActiveMQSecurityManager;
 import org.apache.activemq.artemis.utils.ExecutorFactory;
 
+import javax.management.MBeanServer;
+
 /**
  * This interface defines the internal interface of the ActiveMQ Artemis Server exposed to other components
  * of the server.
@@ -278,4 +280,6 @@ public interface ActiveMQServer extends ActiveMQComponent
    HAPolicy getHAPolicy();
 
    void setHAPolicy(HAPolicy haPolicy);
+
+   void setMBeanServer(MBeanServer mBeanServer);
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
index adfa348..1f55131 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
@@ -183,7 +183,7 @@ public class ActiveMQServerImpl implements ActiveMQServer
 
    private final Configuration configuration;
 
-   private final MBeanServer mbeanServer;
+   private MBeanServer mbeanServer;
 
    private volatile SecurityStore securityStore;
 
@@ -519,6 +519,16 @@ public class ActiveMQServerImpl implements ActiveMQServer
       this.haPolicy = haPolicy;
    }
 
+   @Override
+   public void setMBeanServer(MBeanServer mbeanServer)
+   {
+      if (state == SERVER_STATE.STARTING || state == SERVER_STATE.STARTED)
+      {
+         throw ActiveMQMessageBundle.BUNDLE.cannotSetMBeanserver();
+      }
+      this.mbeanServer = mbeanServer;
+   }
+
    public ExecutorService getThreadPool()
    {
       return threadPool;

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/artemis-server/src/test/java/org/apache/activemq/artemis/core/config/impl/ConfigurationImplTest.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/test/java/org/apache/activemq/artemis/core/config/impl/ConfigurationImplTest.java b/artemis-server/src/test/java/org/apache/activemq/artemis/core/config/impl/ConfigurationImplTest.java
index de50915..9bfc3a3 100644
--- a/artemis-server/src/test/java/org/apache/activemq/artemis/core/config/impl/ConfigurationImplTest.java
+++ b/artemis-server/src/test/java/org/apache/activemq/artemis/core/config/impl/ConfigurationImplTest.java
@@ -15,10 +15,17 @@
  * limitations under the License.
  */
 package org.apache.activemq.artemis.core.config.impl;
+
 import org.apache.activemq.artemis.api.config.ActiveMQDefaultConfiguration;
+import org.apache.activemq.artemis.api.core.SimpleString;
+import org.apache.activemq.artemis.core.config.Configuration;
 import org.apache.activemq.artemis.core.config.ha.LiveOnlyPolicyConfiguration;
+import org.apache.activemq.artemis.core.journal.impl.JournalConstants;
+import org.apache.activemq.artemis.core.server.JournalType;
+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;
 
 import java.io.ByteArrayInputStream;
@@ -26,16 +33,7 @@ import java.io.ByteArrayOutputStream;
 import java.io.ObjectInputStream;
 import java.io.ObjectOutputStream;
 
-import org.junit.Assert;
-
-import org.apache.activemq.artemis.api.core.SimpleString;
-import org.apache.activemq.artemis.core.config.Configuration;
-import org.apache.activemq.artemis.core.journal.impl.JournalConstants;
-import org.apache.activemq.artemis.core.server.JournalType;
-import org.apache.activemq.artemis.tests.util.RandomUtil;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
-
-public class ConfigurationImplTest extends UnitTestCase
+public class ConfigurationImplTest extends ServiceTestBase
 {
    protected Configuration conf;
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/artemis-server/src/test/java/org/apache/activemq/artemis/core/config/impl/FileConfigurationParserTest.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/test/java/org/apache/activemq/artemis/core/config/impl/FileConfigurationParserTest.java b/artemis-server/src/test/java/org/apache/activemq/artemis/core/config/impl/FileConfigurationParserTest.java
index 1c94a45..6ee3fa4 100644
--- a/artemis-server/src/test/java/org/apache/activemq/artemis/core/config/impl/FileConfigurationParserTest.java
+++ b/artemis-server/src/test/java/org/apache/activemq/artemis/core/config/impl/FileConfigurationParserTest.java
@@ -16,20 +16,20 @@
  */
 package org.apache.activemq.artemis.core.config.impl;
 
-import java.io.ByteArrayInputStream;
-import java.nio.charset.StandardCharsets;
-import java.util.HashMap;
-import java.util.Map;
-
 import org.apache.activemq.artemis.api.config.ActiveMQDefaultConfiguration;
 import org.apache.activemq.artemis.core.config.Configuration;
 import org.apache.activemq.artemis.core.config.FileDeploymentManager;
 import org.apache.activemq.artemis.core.deployers.impl.FileConfigurationParser;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.apache.activemq.artemis.utils.DefaultSensitiveStringCodec;
 import org.junit.Test;
 
-public class FileConfigurationParserTest extends UnitTestCase
+import java.io.ByteArrayInputStream;
+import java.nio.charset.StandardCharsets;
+import java.util.HashMap;
+import java.util.Map;
+
+public class FileConfigurationParserTest extends ServiceTestBase
 {
    /**
     * These "InvalidConfigurationTest*.xml" files are modified copies of {@value

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/artemis-server/src/test/java/org/apache/activemq/artemis/core/config/impl/HAPolicyConfigurationTest.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/test/java/org/apache/activemq/artemis/core/config/impl/HAPolicyConfigurationTest.java b/artemis-server/src/test/java/org/apache/activemq/artemis/core/config/impl/HAPolicyConfigurationTest.java
index 57a7b28..8da767c 100644
--- a/artemis-server/src/test/java/org/apache/activemq/artemis/core/config/impl/HAPolicyConfigurationTest.java
+++ b/artemis-server/src/test/java/org/apache/activemq/artemis/core/config/impl/HAPolicyConfigurationTest.java
@@ -16,6 +16,7 @@
  */
 package org.apache.activemq.artemis.core.config.impl;
 
+import org.apache.activemq.artemis.core.config.Configuration;
 import org.apache.activemq.artemis.core.config.FileDeploymentManager;
 import org.apache.activemq.artemis.core.server.cluster.ha.ColocatedPolicy;
 import org.apache.activemq.artemis.core.server.cluster.ha.HAPolicy;
@@ -25,21 +26,20 @@ import org.apache.activemq.artemis.core.server.cluster.ha.ReplicatedPolicy;
 import org.apache.activemq.artemis.core.server.cluster.ha.ScaleDownPolicy;
 import org.apache.activemq.artemis.core.server.cluster.ha.SharedStoreMasterPolicy;
 import org.apache.activemq.artemis.core.server.cluster.ha.SharedStoreSlavePolicy;
+import org.apache.activemq.artemis.core.server.impl.Activation;
+import org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl;
 import org.apache.activemq.artemis.core.server.impl.ColocatedActivation;
 import org.apache.activemq.artemis.core.server.impl.LiveOnlyActivation;
 import org.apache.activemq.artemis.core.server.impl.SharedNothingBackupActivation;
 import org.apache.activemq.artemis.core.server.impl.SharedNothingLiveActivation;
-import org.apache.activemq.artemis.core.config.Configuration;
-import org.apache.activemq.artemis.core.server.impl.Activation;
-import org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl;
 import org.apache.activemq.artemis.core.server.impl.SharedStoreBackupActivation;
 import org.apache.activemq.artemis.core.server.impl.SharedStoreLiveActivation;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.junit.Test;
 
 import java.util.List;
 
-public class HAPolicyConfigurationTest extends UnitTestCase
+public class HAPolicyConfigurationTest extends ServiceTestBase
 {
    @Test
    public void liveOnlyTest() throws Exception

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/artemis-server/src/test/java/org/apache/activemq/artemis/core/config/impl/WrongRoleFileConfigurationParserTest.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/test/java/org/apache/activemq/artemis/core/config/impl/WrongRoleFileConfigurationParserTest.java b/artemis-server/src/test/java/org/apache/activemq/artemis/core/config/impl/WrongRoleFileConfigurationParserTest.java
index 9ec1bc3..d24b5e6 100644
--- a/artemis-server/src/test/java/org/apache/activemq/artemis/core/config/impl/WrongRoleFileConfigurationParserTest.java
+++ b/artemis-server/src/test/java/org/apache/activemq/artemis/core/config/impl/WrongRoleFileConfigurationParserTest.java
@@ -16,21 +16,21 @@
  */
 package org.apache.activemq.artemis.core.config.impl;
 
-import java.io.ByteArrayInputStream;
-import java.nio.charset.StandardCharsets;
-
 import org.apache.activemq.artemis.core.deployers.impl.FileConfigurationParser;
 import org.apache.activemq.artemis.logs.AssertionLoggerHandler;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
 import org.junit.Test;
 
+import java.io.ByteArrayInputStream;
+import java.nio.charset.StandardCharsets;
+
 /**
  * When running this test from an IDE add this to the test command line so that the AssertionLoggerHandler works properly:
  * -Djava.util.logging.manager=org.jboss.logmanager.LogManager  -Dlogging.configuration=file:<path_to_source>/tests/config/logging.properties
  */
-public class WrongRoleFileConfigurationParserTest extends UnitTestCase
+public class WrongRoleFileConfigurationParserTest extends ServiceTestBase
 {
    @BeforeClass
    public static void prepareLogger()

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/artemis-server/src/test/java/org/apache/activemq/artemis/core/server/group/impl/ClusteredResetMockTest.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/test/java/org/apache/activemq/artemis/core/server/group/impl/ClusteredResetMockTest.java b/artemis-server/src/test/java/org/apache/activemq/artemis/core/server/group/impl/ClusteredResetMockTest.java
index 7453064..2959eb8 100644
--- a/artemis-server/src/test/java/org/apache/activemq/artemis/core/server/group/impl/ClusteredResetMockTest.java
+++ b/artemis-server/src/test/java/org/apache/activemq/artemis/core/server/group/impl/ClusteredResetMockTest.java
@@ -17,12 +17,6 @@
 package org.apache.activemq.artemis.core.server.group.impl;
 
 
-import javax.management.ObjectName;
-import java.util.HashSet;
-import java.util.Set;
-import java.util.concurrent.ScheduledExecutorService;
-import java.util.concurrent.TimeUnit;
-
 import org.apache.activemq.artemis.api.core.BroadcastGroupConfiguration;
 import org.apache.activemq.artemis.api.core.SimpleString;
 import org.apache.activemq.artemis.api.core.TransportConfiguration;
@@ -39,8 +33,8 @@ import org.apache.activemq.artemis.core.persistence.StorageManager;
 import org.apache.activemq.artemis.core.postoffice.PostOffice;
 import org.apache.activemq.artemis.core.remoting.server.RemotingService;
 import org.apache.activemq.artemis.core.security.Role;
-import org.apache.activemq.artemis.core.server.Divert;
 import org.apache.activemq.artemis.core.server.ActiveMQServer;
+import org.apache.activemq.artemis.core.server.Divert;
 import org.apache.activemq.artemis.core.server.Queue;
 import org.apache.activemq.artemis.core.server.QueueFactory;
 import org.apache.activemq.artemis.core.server.ServerMessage;
@@ -54,18 +48,24 @@ import org.apache.activemq.artemis.core.settings.HierarchicalRepository;
 import org.apache.activemq.artemis.core.settings.impl.AddressSettings;
 import org.apache.activemq.artemis.core.transaction.ResourceManager;
 import org.apache.activemq.artemis.spi.core.remoting.Acceptor;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.apache.activemq.artemis.utils.ConcurrentHashSet;
 import org.apache.activemq.artemis.utils.ReusableLatch;
 import org.junit.Assert;
 import org.junit.Test;
 
+import javax.management.ObjectName;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.TimeUnit;
+
 /**
  * this is testing the case for resending notifications from RemotingGroupHandler
  * There is a small window where you could receive notifications wrongly
  * this test will make sure the component would play well with that notification
  */
-public class ClusteredResetMockTest extends UnitTestCase
+public class ClusteredResetMockTest extends ServiceTestBase
 {
 
    public static final SimpleString ANYCLUSTER = SimpleString.toSimpleString("anycluster");

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/artemis-server/src/test/java/org/apache/activemq/artemis/core/settings/AddressSettingsTest.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/test/java/org/apache/activemq/artemis/core/settings/AddressSettingsTest.java b/artemis-server/src/test/java/org/apache/activemq/artemis/core/settings/AddressSettingsTest.java
index 676aa20..563022c 100644
--- a/artemis-server/src/test/java/org/apache/activemq/artemis/core/settings/AddressSettingsTest.java
+++ b/artemis-server/src/test/java/org/apache/activemq/artemis/core/settings/AddressSettingsTest.java
@@ -19,11 +19,11 @@ package org.apache.activemq.artemis.core.settings;
 import org.apache.activemq.artemis.api.core.SimpleString;
 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.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.junit.Assert;
 import org.junit.Test;
 
-public class AddressSettingsTest extends UnitTestCase
+public class AddressSettingsTest extends ServiceTestBase
 {
    @Test
    public void testDefaults()

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/artemis-server/src/test/java/org/apache/activemq/artemis/core/settings/RepositoryTest.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/test/java/org/apache/activemq/artemis/core/settings/RepositoryTest.java b/artemis-server/src/test/java/org/apache/activemq/artemis/core/settings/RepositoryTest.java
index 277b26e..97c6544 100644
--- a/artemis-server/src/test/java/org/apache/activemq/artemis/core/settings/RepositoryTest.java
+++ b/artemis-server/src/test/java/org/apache/activemq/artemis/core/settings/RepositoryTest.java
@@ -16,18 +16,18 @@
  */
 package org.apache.activemq.artemis.core.settings;
 
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.concurrent.atomic.AtomicInteger;
-
 import org.apache.activemq.artemis.core.security.Role;
 import org.apache.activemq.artemis.core.settings.impl.HierarchicalObjectRepository;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
 
-public class RepositoryTest extends UnitTestCase
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.concurrent.atomic.AtomicInteger;
+
+public class RepositoryTest extends ServiceTestBase
 {
    HierarchicalRepository<HashSet<Role>> securityRepository;
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/artemis-server/src/test/java/org/apache/activemq/artemis/tests/util/RemoveFolder.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/test/java/org/apache/activemq/artemis/tests/util/RemoveFolder.java b/artemis-server/src/test/java/org/apache/activemq/artemis/tests/util/RemoveFolder.java
index e068467..66a41c6 100644
--- a/artemis-server/src/test/java/org/apache/activemq/artemis/tests/util/RemoveFolder.java
+++ b/artemis-server/src/test/java/org/apache/activemq/artemis/tests/util/RemoveFolder.java
@@ -38,6 +38,6 @@ public class RemoveFolder extends ExternalResource
     */
    protected void after()
    {
-      UnitTestCase.deleteDirectory(new File(folderName));
+      ServiceTestBase.deleteDirectory(new File(folderName));
    }
 }


[02/13] activemq-artemis git commit: Refactor base test classes

Posted by an...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/ReclaimerTest.java
----------------------------------------------------------------------
diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/ReclaimerTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/ReclaimerTest.java
index bcdd00c..01e1886 100644
--- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/ReclaimerTest.java
+++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/ReclaimerTest.java
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 package org.apache.activemq.artemis.tests.unit.core.journal.impl;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.junit.Before;
 
 import org.junit.Test;
@@ -32,7 +32,7 @@ import org.apache.activemq.artemis.core.journal.impl.JournalFile;
 import org.apache.activemq.artemis.core.journal.impl.JournalImpl;
 import org.apache.activemq.artemis.core.journal.impl.Reclaimer;
 
-public class ReclaimerTest extends UnitTestCase
+public class ReclaimerTest extends ServiceTestBase
 {
    private JournalFile[] files;
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/SequentialFileFactoryTestBase.java
----------------------------------------------------------------------
diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/SequentialFileFactoryTestBase.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/SequentialFileFactoryTestBase.java
index 5c5914b..146a8f9 100644
--- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/SequentialFileFactoryTestBase.java
+++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/SequentialFileFactoryTestBase.java
@@ -17,7 +17,7 @@
 package org.apache.activemq.artemis.tests.unit.core.journal.impl;
 import org.apache.activemq.artemis.api.core.ActiveMQBuffer;
 import org.apache.activemq.artemis.api.core.ActiveMQBuffers;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.junit.Before;
 import org.junit.After;
 
@@ -35,7 +35,7 @@ import org.apache.activemq.artemis.core.asyncio.impl.AsynchronousFileImpl;
 import org.apache.activemq.artemis.core.journal.SequentialFile;
 import org.apache.activemq.artemis.core.journal.SequentialFileFactory;
 
-public abstract class SequentialFileFactoryTestBase extends UnitTestCase
+public abstract class SequentialFileFactoryTestBase extends ServiceTestBase
 {
    @Override
    @Before
@@ -58,7 +58,7 @@ public abstract class SequentialFileFactoryTestBase extends UnitTestCase
 
       factory = null;
 
-      UnitTestCase.forceGC();
+      ServiceTestBase.forceGC();
 
       super.tearDown();
    }
@@ -337,14 +337,14 @@ public abstract class SequentialFileFactoryTestBase extends UnitTestCase
          Assert.assertEquals(rb3.limit(), bytesRead);
          rb3.rewind();
          rb3.get(rbytes3);
-         UnitTestCase.assertEqualsByteArrays(bytes3, rbytes3);
+         ServiceTestBase.assertEqualsByteArrays(bytes3, rbytes3);
 
          sf.position(rb1.limit());
 
          bytesRead = sf.read(rb2);
          Assert.assertEquals(rb2.limit(), bytesRead);
          rb2.get(rbytes2);
-         UnitTestCase.assertEqualsByteArrays(bytes2, rbytes2);
+         ServiceTestBase.assertEqualsByteArrays(bytes2, rbytes2);
 
          sf.position(0);
 
@@ -352,7 +352,7 @@ public abstract class SequentialFileFactoryTestBase extends UnitTestCase
          Assert.assertEquals(rb1.limit(), bytesRead);
          rb1.get(rbytes1);
 
-         UnitTestCase.assertEqualsByteArrays(bytes1, rbytes1);
+         ServiceTestBase.assertEqualsByteArrays(bytes1, rbytes1);
 
       }
       finally

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/TimedBufferTest.java
----------------------------------------------------------------------
diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/TimedBufferTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/TimedBufferTest.java
index 42258ea..2a2caea 100644
--- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/TimedBufferTest.java
+++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/TimedBufferTest.java
@@ -18,7 +18,7 @@ package org.apache.activemq.artemis.tests.unit.core.journal.impl;
 
 import org.apache.activemq.artemis.api.core.ActiveMQBuffer;
 import org.apache.activemq.artemis.api.core.ActiveMQBuffers;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.junit.Test;
 
 import java.nio.ByteBuffer;
@@ -34,7 +34,7 @@ import org.apache.activemq.artemis.core.journal.IOAsyncTask;
 import org.apache.activemq.artemis.core.journal.impl.TimedBuffer;
 import org.apache.activemq.artemis.core.journal.impl.TimedBufferObserver;
 
-public class TimedBufferTest extends UnitTestCase
+public class TimedBufferTest extends ServiceTestBase
 {
 
    // Constants -----------------------------------------------------
@@ -104,7 +104,7 @@ public class TimedBufferTest extends UnitTestCase
             byte[] bytes = new byte[10];
             for (int j = 0; j < 10; j++)
             {
-               bytes[j] = UnitTestCase.getSamplebyte(x++);
+               bytes[j] = ServiceTestBase.getSamplebyte(x++);
             }
 
             ActiveMQBuffer buff = ActiveMQBuffers.wrappedBuffer(bytes);
@@ -127,7 +127,7 @@ public class TimedBufferTest extends UnitTestCase
 
          for (int i = 0; i < 100; i++)
          {
-            Assert.assertEquals(UnitTestCase.getSamplebyte(i), flushedBuffer.get());
+            Assert.assertEquals(ServiceTestBase.getSamplebyte(i), flushedBuffer.get());
          }
       }
       finally
@@ -178,7 +178,7 @@ public class TimedBufferTest extends UnitTestCase
          byte[] bytes = new byte[10];
          for (int j = 0; j < 10; j++)
          {
-            bytes[j] = UnitTestCase.getSamplebyte(x++);
+            bytes[j] = ServiceTestBase.getSamplebyte(x++);
          }
 
          ActiveMQBuffer buff = ActiveMQBuffers.wrappedBuffer(bytes);
@@ -193,7 +193,7 @@ public class TimedBufferTest extends UnitTestCase
          bytes = new byte[10];
          for (int j = 0; j < 10; j++)
          {
-            bytes[j] = UnitTestCase.getSamplebyte(x++);
+            bytes[j] = ServiceTestBase.getSamplebyte(x++);
          }
 
          buff = ActiveMQBuffers.wrappedBuffer(bytes);
@@ -215,7 +215,7 @@ public class TimedBufferTest extends UnitTestCase
 
          for (int i = 0; i < 20; i++)
          {
-            Assert.assertEquals(UnitTestCase.getSamplebyte(i), flushedBuffer.get());
+            Assert.assertEquals(ServiceTestBase.getSamplebyte(i), flushedBuffer.get());
          }
       }
       finally
@@ -291,7 +291,7 @@ public class TimedBufferTest extends UnitTestCase
          byte[] bytes = new byte[10];
          for (int j = 0; j < 10; j++)
          {
-            bytes[j] = UnitTestCase.getSamplebyte(x++);
+            bytes[j] = ServiceTestBase.getSamplebyte(x++);
          }
 
          ActiveMQBuffer buff = ActiveMQBuffers.wrappedBuffer(bytes);
@@ -378,7 +378,7 @@ public class TimedBufferTest extends UnitTestCase
          byte[] bytes = new byte[10];
          for (int j = 0; j < 10; j++)
          {
-            bytes[j] = UnitTestCase.getSamplebyte(x++);
+            bytes[j] = ServiceTestBase.getSamplebyte(x++);
          }
 
          ActiveMQBuffer buff = ActiveMQBuffers.wrappedBuffer(bytes);

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/message/impl/MessageImplTest.java
----------------------------------------------------------------------
diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/message/impl/MessageImplTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/message/impl/MessageImplTest.java
index 49cdf32..d51b598 100644
--- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/message/impl/MessageImplTest.java
+++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/message/impl/MessageImplTest.java
@@ -23,7 +23,7 @@ import java.util.concurrent.atomic.AtomicInteger;
 import org.apache.activemq.artemis.api.core.ActiveMQBuffer;
 import org.apache.activemq.artemis.api.core.Message;
 import org.apache.activemq.artemis.api.core.SimpleString;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.apache.activemq.artemis.core.client.impl.ClientMessageImpl;
 import org.apache.activemq.artemis.core.protocol.core.impl.wireformat.SessionSendMessage;
 import org.apache.activemq.artemis.core.server.impl.ServerMessageImpl;
@@ -31,7 +31,7 @@ import org.apache.activemq.artemis.tests.util.RandomUtil;
 import org.junit.Assert;
 import org.junit.Test;
 
-public class MessageImplTest extends UnitTestCase
+public class MessageImplTest extends ServiceTestBase
 {
    @Test
    public void getSetAttributes()

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/paging/impl/PagePositionTest.java
----------------------------------------------------------------------
diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/paging/impl/PagePositionTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/paging/impl/PagePositionTest.java
index dc8c884..1b41cef 100644
--- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/paging/impl/PagePositionTest.java
+++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/paging/impl/PagePositionTest.java
@@ -16,10 +16,10 @@
  */
 package org.apache.activemq.artemis.tests.unit.core.paging.impl;
 
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.junit.Test;
 
-public class PagePositionTest extends UnitTestCase
+public class PagePositionTest extends ServiceTestBase
 {
 
    // Constants -----------------------------------------------------

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/paging/impl/PageTest.java
----------------------------------------------------------------------
diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/paging/impl/PageTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/paging/impl/PageTest.java
index d4dd295..3e56780 100644
--- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/paging/impl/PageTest.java
+++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/paging/impl/PageTest.java
@@ -23,7 +23,7 @@ import java.util.List;
 import org.apache.activemq.artemis.api.core.ActiveMQBuffer;
 import org.apache.activemq.artemis.api.core.SimpleString;
 import org.apache.activemq.artemis.tests.unit.core.journal.impl.fakes.FakeSequentialFileFactory;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.apache.activemq.artemis.core.journal.SequentialFile;
 import org.apache.activemq.artemis.core.journal.SequentialFileFactory;
 import org.apache.activemq.artemis.core.journal.impl.NIOSequentialFileFactory;
@@ -36,7 +36,7 @@ import org.apache.activemq.artemis.core.server.impl.ServerMessageImpl;
 import org.junit.Assert;
 import org.junit.Test;
 
-public class PageTest extends UnitTestCase
+public class PageTest extends ServiceTestBase
 {
    // Constants -----------------------------------------------------
 
@@ -114,7 +114,7 @@ public class PageTest extends UnitTestCase
       {
          Assert.assertEquals(simpleDestination, msgs.get(i).getMessage().getAddress());
 
-         UnitTestCase.assertEqualsByteArrays(buffers.get(i).toByteBuffer().array(), msgs.get(i)
+         ServiceTestBase.assertEqualsByteArrays(buffers.get(i).toByteBuffer().array(), msgs.get(i)
             .getMessage()
             .getBodyBuffer()
             .toByteBuffer()
@@ -186,7 +186,7 @@ public class PageTest extends UnitTestCase
       {
          Assert.assertEquals(simpleDestination, msgs.get(i).getMessage().getAddress());
 
-         UnitTestCase.assertEqualsByteArrays(buffers.get(i).toByteBuffer().array(), msgs.get(i)
+         ServiceTestBase.assertEqualsByteArrays(buffers.get(i).toByteBuffer().array(), msgs.get(i)
             .getMessage()
             .getBodyBuffer()
             .toByteBuffer()

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/paging/impl/PagingManagerImplTest.java
----------------------------------------------------------------------
diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/paging/impl/PagingManagerImplTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/paging/impl/PagingManagerImplTest.java
index 47a9e98..0ae40d9 100644
--- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/paging/impl/PagingManagerImplTest.java
+++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/paging/impl/PagingManagerImplTest.java
@@ -38,12 +38,12 @@ import org.apache.activemq.artemis.core.settings.impl.AddressFullMessagePolicy;
 import org.apache.activemq.artemis.core.settings.impl.AddressSettings;
 import org.apache.activemq.artemis.core.settings.impl.HierarchicalObjectRepository;
 import org.apache.activemq.artemis.tests.util.RandomUtil;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
 
-public class PagingManagerImplTest extends UnitTestCase
+public class PagingManagerImplTest extends ServiceTestBase
 {
    private final ReadLock lock = new ReentrantReadWriteLock().readLock();
 
@@ -86,7 +86,7 @@ public class PagingManagerImplTest extends UnitTestCase
 
       Assert.assertEquals(1, msgs.size());
 
-      UnitTestCase.assertEqualsByteArrays(msg.getBodyBuffer().writerIndex(), msg.getBodyBuffer().toByteBuffer().array(), msgs.get(0)
+      ServiceTestBase.assertEqualsByteArrays(msg.getBodyBuffer().writerIndex(), msg.getBodyBuffer().toByteBuffer().array(), msgs.get(0)
          .getMessage()
          .getBodyBuffer()
          .toByteBuffer()

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/paging/impl/PagingStoreImplTest.java
----------------------------------------------------------------------
diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/paging/impl/PagingStoreImplTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/paging/impl/PagingStoreImplTest.java
index 5a80874..1d468ba 100644
--- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/paging/impl/PagingStoreImplTest.java
+++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/paging/impl/PagingStoreImplTest.java
@@ -55,14 +55,14 @@ import org.apache.activemq.artemis.core.settings.impl.AddressSettings;
 import org.apache.activemq.artemis.tests.unit.core.journal.impl.fakes.FakeSequentialFileFactory;
 import org.apache.activemq.artemis.tests.unit.util.FakePagingManager;
 import org.apache.activemq.artemis.tests.util.RandomUtil;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.apache.activemq.artemis.utils.ExecutorFactory;
 import org.junit.After;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
 
-public class PagingStoreImplTest extends UnitTestCase
+public class PagingStoreImplTest extends ServiceTestBase
 {
 
    private static final SimpleString destinationTestName = new SimpleString("test");
@@ -130,7 +130,7 @@ public class PagingStoreImplTest extends UnitTestCase
    @Test
    public void testPageWithNIO() throws Exception
    {
-      UnitTestCase.recreateDirectory(getTestDir());
+      ServiceTestBase.recreateDirectory(getTestDir());
       testConcurrentPaging(new NIOSequentialFileFactory(getTestDir()), 1);
    }
 
@@ -327,7 +327,7 @@ public class PagingStoreImplTest extends UnitTestCase
          for (int i = 0; i < 5; i++)
          {
             Assert.assertEquals(sequence++, msg.get(i).getMessage().getMessageID());
-            UnitTestCase.assertEqualsBuffers(18, buffers.get(pageNr * 5 + i), msg.get(i).getMessage().getBodyBuffer());
+            ServiceTestBase.assertEqualsBuffers(18, buffers.get(pageNr * 5 + i), msg.get(i).getMessage().getBodyBuffer());
          }
       }
 
@@ -378,7 +378,7 @@ public class PagingStoreImplTest extends UnitTestCase
 
       Assert.assertEquals(1L, msgs.get(0).getMessage().getMessageID());
 
-      UnitTestCase.assertEqualsBuffers(18, buffers.get(0), msgs.get(0).getMessage().getBodyBuffer());
+      ServiceTestBase.assertEqualsBuffers(18, buffers.get(0), msgs.get(0).getMessage().getBodyBuffer());
 
       Assert.assertEquals(1, store.getNumberOfPages());
 
@@ -496,7 +496,7 @@ public class PagingStoreImplTest extends UnitTestCase
             try
             {
                // Wait every producer to produce at least one message
-               UnitTestCase.waitForLatch(latchStart);
+               ServiceTestBase.waitForLatch(latchStart);
 
                while (aliveProducers.get() > 0)
                {
@@ -559,7 +559,7 @@ public class PagingStoreImplTest extends UnitTestCase
             buffers2.put(id, msg.getMessage());
             Assert.assertNotNull(msgWritten);
             Assert.assertEquals(msg.getMessage().getAddress(), msgWritten.getAddress());
-            UnitTestCase.assertEqualsBuffers(10, msgWritten.getBodyBuffer(), msg.getMessage().getBodyBuffer());
+            ServiceTestBase.assertEqualsBuffers(10, msgWritten.getBodyBuffer(), msg.getMessage().getBodyBuffer());
          }
       }
 
@@ -627,7 +627,7 @@ public class PagingStoreImplTest extends UnitTestCase
             ServerMessage msgWritten = buffers2.remove(id);
             Assert.assertNotNull(msgWritten);
             Assert.assertEquals(msg.getMessage().getAddress(), msgWritten.getAddress());
-            UnitTestCase.assertEqualsByteArrays(msgWritten.getBodyBuffer().writerIndex(), msgWritten.getBodyBuffer()
+            ServiceTestBase.assertEqualsByteArrays(msgWritten.getBodyBuffer().writerIndex(), msgWritten.getBodyBuffer()
                .toByteBuffer()
                .array(),
                                                 msg.getMessage().getBodyBuffer().toByteBuffer().array());

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/persistence/impl/BatchIDGeneratorUnitTest.java
----------------------------------------------------------------------
diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/persistence/impl/BatchIDGeneratorUnitTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/persistence/impl/BatchIDGeneratorUnitTest.java
index 37fabd5..b68f3ef 100644
--- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/persistence/impl/BatchIDGeneratorUnitTest.java
+++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/persistence/impl/BatchIDGeneratorUnitTest.java
@@ -19,7 +19,7 @@ import java.util.ArrayList;
 
 import org.apache.activemq.artemis.api.core.ActiveMQBuffer;
 import org.apache.activemq.artemis.api.core.ActiveMQBuffers;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.apache.activemq.artemis.core.journal.Journal;
 import org.apache.activemq.artemis.core.journal.PreparedTransactionInfo;
 import org.apache.activemq.artemis.core.journal.RecordInfo;
@@ -32,7 +32,7 @@ import org.apache.activemq.artemis.core.persistence.impl.nullpm.NullStorageManag
 import org.junit.Assert;
 import org.junit.Test;
 
-public class BatchIDGeneratorUnitTest extends UnitTestCase
+public class BatchIDGeneratorUnitTest extends ServiceTestBase
 {
 
    @Test

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/persistence/impl/OperationContextUnitTest.java
----------------------------------------------------------------------
diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/persistence/impl/OperationContextUnitTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/persistence/impl/OperationContextUnitTest.java
index 7faf089..5400855 100644
--- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/persistence/impl/OperationContextUnitTest.java
+++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/persistence/impl/OperationContextUnitTest.java
@@ -23,13 +23,13 @@ import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicInteger;
 
 import org.apache.activemq.artemis.api.core.ActiveMQExceptionType;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.apache.activemq.artemis.core.journal.IOAsyncTask;
 import org.apache.activemq.artemis.core.persistence.impl.journal.OperationContextImpl;
 import org.junit.Assert;
 import org.junit.Test;
 
-public class OperationContextUnitTest extends UnitTestCase
+public class OperationContextUnitTest extends ServiceTestBase
 {
 
    // Constants -----------------------------------------------------

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/postoffice/impl/AddressImplTest.java
----------------------------------------------------------------------
diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/postoffice/impl/AddressImplTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/postoffice/impl/AddressImplTest.java
index e541a45..2dbc354 100644
--- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/postoffice/impl/AddressImplTest.java
+++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/postoffice/impl/AddressImplTest.java
@@ -16,7 +16,7 @@
  */
 package org.apache.activemq.artemis.tests.unit.core.postoffice.impl;
 
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.junit.Test;
 
 import org.junit.Assert;
@@ -25,7 +25,7 @@ import org.apache.activemq.artemis.api.core.SimpleString;
 import org.apache.activemq.artemis.core.postoffice.Address;
 import org.apache.activemq.artemis.core.postoffice.impl.AddressImpl;
 
-public class AddressImplTest extends UnitTestCase
+public class AddressImplTest extends ServiceTestBase
 {
    @Test
    public void testNoDots()

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/postoffice/impl/BindingsImplTest.java
----------------------------------------------------------------------
diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/postoffice/impl/BindingsImplTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/postoffice/impl/BindingsImplTest.java
index 330ee61..905f5ca 100644
--- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/postoffice/impl/BindingsImplTest.java
+++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/postoffice/impl/BindingsImplTest.java
@@ -17,7 +17,7 @@
 package org.apache.activemq.artemis.tests.unit.core.postoffice.impl;
 
 import org.apache.activemq.artemis.api.core.ActiveMQException;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.apache.activemq.artemis.core.server.impl.RefsOperation;
 import org.junit.Test;
 
@@ -42,7 +42,7 @@ import org.apache.activemq.artemis.core.server.impl.ServerMessageImpl;
 import org.apache.activemq.artemis.core.transaction.Transaction;
 import org.apache.activemq.artemis.core.transaction.TransactionOperation;
 
-public class BindingsImplTest extends UnitTestCase
+public class BindingsImplTest extends ServiceTestBase
 {
    // Constants -----------------------------------------------------
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/postoffice/impl/WildcardAddressManagerUnitTest.java
----------------------------------------------------------------------
diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/postoffice/impl/WildcardAddressManagerUnitTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/postoffice/impl/WildcardAddressManagerUnitTest.java
index f6360c2..4b3f51c 100644
--- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/postoffice/impl/WildcardAddressManagerUnitTest.java
+++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/postoffice/impl/WildcardAddressManagerUnitTest.java
@@ -20,7 +20,7 @@ import java.util.ArrayList;
 import java.util.Collection;
 
 import org.apache.activemq.artemis.api.core.SimpleString;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.apache.activemq.artemis.core.filter.Filter;
 import org.apache.activemq.artemis.core.postoffice.Binding;
 import org.apache.activemq.artemis.core.postoffice.BindingType;
@@ -37,7 +37,7 @@ import org.junit.Test;
 /**
  * This test is replicating the behaviour from https://issues.jboss.org/browse/HORNETQ-988.
  */
-public class WildcardAddressManagerUnitTest extends UnitTestCase
+public class WildcardAddressManagerUnitTest extends ServiceTestBase
 {
 
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/remoting/ActiveMQBufferTestBase.java
----------------------------------------------------------------------
diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/remoting/ActiveMQBufferTestBase.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/remoting/ActiveMQBufferTestBase.java
index c93a3bb..9268bf6 100644
--- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/remoting/ActiveMQBufferTestBase.java
+++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/remoting/ActiveMQBufferTestBase.java
@@ -16,7 +16,7 @@
  */
 package org.apache.activemq.artemis.tests.unit.core.remoting;
 import org.apache.activemq.artemis.api.core.ActiveMQBuffer;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.junit.Before;
 import org.junit.After;
 
@@ -27,7 +27,7 @@ import org.junit.Assert;
 import org.apache.activemq.artemis.api.core.SimpleString;
 import org.apache.activemq.artemis.tests.util.RandomUtil;
 
-public abstract class ActiveMQBufferTestBase extends UnitTestCase
+public abstract class ActiveMQBufferTestBase extends ServiceTestBase
 {
    // Constants -----------------------------------------------------
 
@@ -100,7 +100,7 @@ public abstract class ActiveMQBufferTestBase extends UnitTestCase
       SimpleString result = putAndGetNullableSimpleString(emptySimpleString);
 
       Assert.assertNotNull(result);
-      UnitTestCase.assertEqualsByteArrays(emptySimpleString.getData(), result.getData());
+      ServiceTestBase.assertEqualsByteArrays(emptySimpleString.getData(), result.getData());
    }
 
    @Test
@@ -110,7 +110,7 @@ public abstract class ActiveMQBufferTestBase extends UnitTestCase
       SimpleString result = putAndGetNullableSimpleString(junk);
 
       Assert.assertNotNull(result);
-      UnitTestCase.assertEqualsByteArrays(junk.getData(), result.getData());
+      ServiceTestBase.assertEqualsByteArrays(junk.getData(), result.getData());
    }
 
    @Test
@@ -144,7 +144,7 @@ public abstract class ActiveMQBufferTestBase extends UnitTestCase
 
       byte[] b = new byte[bytes.length];
       wrapper.readBytes(b);
-      UnitTestCase.assertEqualsByteArrays(bytes, b);
+      ServiceTestBase.assertEqualsByteArrays(bytes, b);
    }
 
    @Test
@@ -156,7 +156,7 @@ public abstract class ActiveMQBufferTestBase extends UnitTestCase
 
       byte[] b = new byte[bytes.length / 2];
       wrapper.readBytes(b, 0, b.length);
-      UnitTestCase.assertEqualsByteArrays(b.length, bytes, b);
+      ServiceTestBase.assertEqualsByteArrays(b.length, bytes, b);
    }
 
    @Test
@@ -289,7 +289,7 @@ public abstract class ActiveMQBufferTestBase extends UnitTestCase
 
       byte[] array = wrapper.toByteBuffer().array();
       Assert.assertEquals(wrapper.capacity(), array.length);
-      UnitTestCase.assertEqualsByteArrays(128, bytes, wrapper.toByteBuffer().array());
+      ServiceTestBase.assertEqualsByteArrays(128, bytes, wrapper.toByteBuffer().array());
    }
 
    @Test

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/remoting/impl/netty/NettyAcceptorFactoryTest.java
----------------------------------------------------------------------
diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/remoting/impl/netty/NettyAcceptorFactoryTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/remoting/impl/netty/NettyAcceptorFactoryTest.java
index ef018ca..e74a414 100644
--- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/remoting/impl/netty/NettyAcceptorFactoryTest.java
+++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/remoting/impl/netty/NettyAcceptorFactoryTest.java
@@ -30,11 +30,11 @@ import org.apache.activemq.artemis.spi.core.remoting.Acceptor;
 import org.apache.activemq.artemis.spi.core.remoting.BufferHandler;
 import org.apache.activemq.artemis.spi.core.remoting.Connection;
 import org.apache.activemq.artemis.spi.core.remoting.ConnectionLifeCycleListener;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.junit.Assert;
 import org.junit.Test;
 
-public class NettyAcceptorFactoryTest extends UnitTestCase
+public class NettyAcceptorFactoryTest extends ServiceTestBase
 {
    @Test
    public void testCreateAcceptor() throws Exception

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/remoting/impl/netty/NettyAcceptorTest.java
----------------------------------------------------------------------
diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/remoting/impl/netty/NettyAcceptorTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/remoting/impl/netty/NettyAcceptorTest.java
index 8ac99f7..a662696 100644
--- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/remoting/impl/netty/NettyAcceptorTest.java
+++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/remoting/impl/netty/NettyAcceptorTest.java
@@ -25,7 +25,7 @@ import java.util.concurrent.TimeUnit;
 import org.apache.activemq.artemis.api.config.ActiveMQDefaultConfiguration;
 import org.apache.activemq.artemis.api.core.ActiveMQBuffer;
 import org.apache.activemq.artemis.api.core.ActiveMQException;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.apache.activemq.artemis.core.remoting.impl.netty.NettyAcceptor;
 import org.apache.activemq.artemis.core.remoting.impl.netty.TransportConstants;
 import org.apache.activemq.artemis.core.server.ActiveMQComponent;
@@ -37,7 +37,7 @@ import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
 
-public class NettyAcceptorTest extends UnitTestCase
+public class NettyAcceptorTest extends ServiceTestBase
 {
    private ScheduledExecutorService pool2;
 
@@ -47,7 +47,7 @@ public class NettyAcceptorTest extends UnitTestCase
    {
       super.setUp();
 
-      UnitTestCase.checkFreePort(TransportConstants.DEFAULT_PORT);
+      ServiceTestBase.checkFreePort(TransportConstants.DEFAULT_PORT);
    }
 
    @Override
@@ -56,7 +56,7 @@ public class NettyAcceptorTest extends UnitTestCase
    {
       try
       {
-         UnitTestCase.checkFreePort(TransportConstants.DEFAULT_PORT);
+         ServiceTestBase.checkFreePort(TransportConstants.DEFAULT_PORT);
       }
       finally
       {
@@ -111,13 +111,13 @@ public class NettyAcceptorTest extends UnitTestCase
       Assert.assertTrue(acceptor.isStarted());
       acceptor.stop();
       Assert.assertFalse(acceptor.isStarted());
-      UnitTestCase.checkFreePort(TransportConstants.DEFAULT_PORT);
+      ServiceTestBase.checkFreePort(TransportConstants.DEFAULT_PORT);
 
       acceptor.start();
       Assert.assertTrue(acceptor.isStarted());
       acceptor.stop();
       Assert.assertFalse(acceptor.isStarted());
-      UnitTestCase.checkFreePort(TransportConstants.DEFAULT_PORT);
+      ServiceTestBase.checkFreePort(TransportConstants.DEFAULT_PORT);
 
       pool2.shutdown();
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/remoting/impl/netty/NettyConnectionTest.java
----------------------------------------------------------------------
diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/remoting/impl/netty/NettyConnectionTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/remoting/impl/netty/NettyConnectionTest.java
index 39dd7af..f63064a 100644
--- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/remoting/impl/netty/NettyConnectionTest.java
+++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/remoting/impl/netty/NettyConnectionTest.java
@@ -26,7 +26,7 @@ import io.netty.channel.embedded.EmbeddedChannel;
 import org.apache.activemq.artemis.api.core.ActiveMQBuffer;
 import org.apache.activemq.artemis.api.core.ActiveMQBuffers;
 import org.apache.activemq.artemis.api.core.ActiveMQException;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.apache.activemq.artemis.core.remoting.impl.netty.NettyConnection;
 import org.apache.activemq.artemis.core.server.ActiveMQComponent;
 import org.apache.activemq.artemis.spi.core.remoting.Connection;
@@ -34,7 +34,7 @@ import org.apache.activemq.artemis.spi.core.remoting.ConnectionLifeCycleListener
 import org.junit.Assert;
 import org.junit.Test;
 
-public class NettyConnectionTest extends UnitTestCase
+public class NettyConnectionTest extends ServiceTestBase
 {
    private static final Map<String, Object> emptyMap = Collections.emptyMap();
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/remoting/impl/netty/NettyConnectorTest.java
----------------------------------------------------------------------
diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/remoting/impl/netty/NettyConnectorTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/remoting/impl/netty/NettyConnectorTest.java
index b32a810..ea341ef 100644
--- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/remoting/impl/netty/NettyConnectorTest.java
+++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/remoting/impl/netty/NettyConnectorTest.java
@@ -18,7 +18,7 @@ package org.apache.activemq.artemis.tests.unit.core.remoting.impl.netty;
 
 import org.apache.activemq.artemis.api.core.ActiveMQBuffer;
 import org.apache.activemq.artemis.api.core.ActiveMQException;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.junit.Test;
 
 import java.util.HashMap;
@@ -34,7 +34,7 @@ import org.apache.activemq.artemis.spi.core.remoting.BufferHandler;
 import org.apache.activemq.artemis.spi.core.remoting.Connection;
 import org.apache.activemq.artemis.spi.core.remoting.ConnectionLifeCycleListener;
 
-public class NettyConnectorTest extends UnitTestCase
+public class NettyConnectorTest extends ServiceTestBase
 {
 
    @Test

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/remoting/impl/ssl/SSLSupportTest.java
----------------------------------------------------------------------
diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/remoting/impl/ssl/SSLSupportTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/remoting/impl/ssl/SSLSupportTest.java
index eb0d199..99789cf 100644
--- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/remoting/impl/ssl/SSLSupportTest.java
+++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/remoting/impl/ssl/SSLSupportTest.java
@@ -21,7 +21,7 @@ import java.net.URL;
 import java.util.Arrays;
 import java.util.Collection;
 
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.apache.activemq.artemis.core.remoting.impl.ssl.SSLSupport;
 import org.junit.Assert;
 import org.junit.Before;
@@ -30,7 +30,7 @@ import org.junit.runner.RunWith;
 import org.junit.runners.Parameterized;
 
 @RunWith(value = Parameterized.class)
-public class SSLSupportTest extends UnitTestCase
+public class SSLSupportTest extends ServiceTestBase
 {
    @Parameterized.Parameters(name = "storeType={0}")
    public static Collection getParameters()

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/security/impl/ActiveMQSecurityManagerImplTest.java
----------------------------------------------------------------------
diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/security/impl/ActiveMQSecurityManagerImplTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/security/impl/ActiveMQSecurityManagerImplTest.java
index 5bf1338..51fa4b5 100644
--- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/security/impl/ActiveMQSecurityManagerImplTest.java
+++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/security/impl/ActiveMQSecurityManagerImplTest.java
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 package org.apache.activemq.artemis.tests.unit.core.security.impl;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.junit.Before;
 import org.junit.After;
 
@@ -32,7 +32,7 @@ import org.apache.activemq.artemis.spi.core.security.ActiveMQSecurityManagerImpl
 /**
  * tests ActiveMQSecurityManagerImpl
  */
-public class ActiveMQSecurityManagerImplTest extends UnitTestCase
+public class ActiveMQSecurityManagerImplTest extends ServiceTestBase
 {
    private ActiveMQSecurityManagerImpl securityManager;
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/server/cluster/impl/ClusterConnectionBridgeTest.java
----------------------------------------------------------------------
diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/server/cluster/impl/ClusterConnectionBridgeTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/server/cluster/impl/ClusterConnectionBridgeTest.java
index fd763fa..48f6653 100644
--- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/server/cluster/impl/ClusterConnectionBridgeTest.java
+++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/server/cluster/impl/ClusterConnectionBridgeTest.java
@@ -17,11 +17,11 @@
 package org.apache.activemq.artemis.tests.unit.core.server.cluster.impl;
 
 import org.apache.activemq.artemis.api.core.management.ManagementHelper;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.apache.activemq.artemis.core.server.cluster.impl.ClusterConnectionBridge;
 import org.junit.Test;
 
-public class ClusterConnectionBridgeTest extends UnitTestCase
+public class ClusterConnectionBridgeTest extends ServiceTestBase
 {
    @Test
    public void testCreateSelectorFromAddressForNormalMatches()

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/server/cluster/impl/RemoteQueueBindImplTest.java
----------------------------------------------------------------------
diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/server/cluster/impl/RemoteQueueBindImplTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/server/cluster/impl/RemoteQueueBindImplTest.java
index 11363a2..4023192 100644
--- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/server/cluster/impl/RemoteQueueBindImplTest.java
+++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/server/cluster/impl/RemoteQueueBindImplTest.java
@@ -17,7 +17,7 @@
 package org.apache.activemq.artemis.tests.unit.core.server.cluster.impl;
 
 import org.apache.activemq.artemis.tests.unit.core.postoffice.impl.FakeQueue;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.junit.Test;
 
 import org.apache.activemq.artemis.api.core.SimpleString;
@@ -25,7 +25,7 @@ import org.apache.activemq.artemis.core.server.Queue;
 import org.apache.activemq.artemis.core.server.cluster.impl.RemoteQueueBindingImpl;
 import org.apache.activemq.artemis.tests.util.RandomUtil;
 
-public class RemoteQueueBindImplTest extends UnitTestCase
+public class RemoteQueueBindImplTest extends ServiceTestBase
 {
 
    // Constants -----------------------------------------------------

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/server/group/impl/SystemPropertyOverrideTest.java
----------------------------------------------------------------------
diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/server/group/impl/SystemPropertyOverrideTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/server/group/impl/SystemPropertyOverrideTest.java
index ba5d738..736e6e9 100644
--- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/server/group/impl/SystemPropertyOverrideTest.java
+++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/server/group/impl/SystemPropertyOverrideTest.java
@@ -17,10 +17,10 @@
 package org.apache.activemq.artemis.tests.unit.core.server.group.impl;
 
 import org.apache.activemq.artemis.api.core.SimpleString;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.apache.activemq.artemis.core.server.group.impl.GroupingHandlerConfiguration;
 
-public class SystemPropertyOverrideTest extends UnitTestCase
+public class SystemPropertyOverrideTest extends ServiceTestBase
 {
    // Constants -----------------------------------------------------
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/server/impl/FileLockTest.java
----------------------------------------------------------------------
diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/server/impl/FileLockTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/server/impl/FileLockTest.java
index 80c45de..3e71f4e 100644
--- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/server/impl/FileLockTest.java
+++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/server/impl/FileLockTest.java
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 package org.apache.activemq.artemis.tests.unit.core.server.impl;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.junit.Before;
 
 import org.junit.Test;
@@ -26,7 +26,7 @@ import org.apache.activemq.artemis.core.asyncio.impl.AsynchronousFileImpl;
 import org.apache.activemq.artemis.core.server.impl.AIOFileLockNodeManager;
 import org.apache.activemq.artemis.core.server.impl.FileLockNodeManager;
 
-public class FileLockTest extends UnitTestCase
+public class FileLockTest extends ServiceTestBase
 {
 
    @Override

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/server/impl/QueueImplTest.java
----------------------------------------------------------------------
diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/server/impl/QueueImplTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/server/impl/QueueImplTest.java
index add2da0..202079d 100644
--- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/server/impl/QueueImplTest.java
+++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/server/impl/QueueImplTest.java
@@ -34,7 +34,7 @@ import org.apache.activemq.artemis.api.core.client.ServerLocator;
 import org.apache.activemq.artemis.tests.unit.core.server.impl.fakes.FakeConsumer;
 import org.apache.activemq.artemis.tests.unit.core.server.impl.fakes.FakeFilter;
 import org.apache.activemq.artemis.tests.unit.core.server.impl.fakes.FakePostOffice;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.apache.activemq.artemis.core.filter.Filter;
 import org.apache.activemq.artemis.core.filter.impl.FilterImpl;
 import org.apache.activemq.artemis.core.postoffice.impl.LocalQueueBinding;
@@ -54,7 +54,7 @@ import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
 
-public class QueueImplTest extends UnitTestCase
+public class QueueImplTest extends ServiceTestBase
 {
    // The tests ----------------------------------------------------------------
 
@@ -1327,7 +1327,7 @@ public class QueueImplTest extends UnitTestCase
       final String MY_ADDRESS = "myAddress";
       final String MY_QUEUE = "myQueue";
 
-      ActiveMQServer server = ActiveMQServers.newActiveMQServer(createDefaultConfig(false), true);
+      ActiveMQServer server = ActiveMQServers.newActiveMQServer(createDefaultConfig(), true);
 
       AddressSettings defaultSetting = new AddressSettings();
       defaultSetting.setPageSizeBytes(10 * 1024);

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/jms/ActiveMQDestinationTest.java
----------------------------------------------------------------------
diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/jms/ActiveMQDestinationTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/jms/ActiveMQDestinationTest.java
index 0f60897..7ae56d3 100644
--- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/jms/ActiveMQDestinationTest.java
+++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/jms/ActiveMQDestinationTest.java
@@ -16,7 +16,7 @@
  */
 package org.apache.activemq.artemis.tests.unit.jms;
 
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.junit.Test;
 
 import javax.jms.JMSRuntimeException;
@@ -28,7 +28,7 @@ import org.junit.Assert;
 import org.apache.activemq.artemis.jms.client.ActiveMQDestination;
 import org.apache.activemq.artemis.tests.util.RandomUtil;
 
-public class ActiveMQDestinationTest extends UnitTestCase
+public class ActiveMQDestinationTest extends ServiceTestBase
 {
    // Constants -----------------------------------------------------
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/jms/client/ActiveMQMapMessageTest.java
----------------------------------------------------------------------
diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/jms/client/ActiveMQMapMessageTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/jms/client/ActiveMQMapMessageTest.java
index ee8f0a8..ad25b34 100644
--- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/jms/client/ActiveMQMapMessageTest.java
+++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/jms/client/ActiveMQMapMessageTest.java
@@ -18,13 +18,13 @@ package org.apache.activemq.artemis.tests.unit.jms.client;
 import javax.jms.MessageFormatException;
 
 import org.apache.activemq.artemis.tests.util.RandomUtil;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.apache.activemq.artemis.jms.client.ActiveMQMapMessage;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
 
-public class ActiveMQMapMessageTest extends UnitTestCase
+public class ActiveMQMapMessageTest extends ServiceTestBase
 {
    // Constants -----------------------------------------------------
 
@@ -693,7 +693,7 @@ public class ActiveMQMapMessageTest extends UnitTestCase
       ActiveMQMapMessage message = new ActiveMQMapMessage();
       message.setBytes(itemName, value);
 
-      UnitTestCase.assertEqualsByteArrays(value, message.getBytes(itemName));
+      ServiceTestBase.assertEqualsByteArrays(value, message.getBytes(itemName));
    }
 
    @Test

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/jms/client/ActiveMQStreamMessageTest.java
----------------------------------------------------------------------
diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/jms/client/ActiveMQStreamMessageTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/jms/client/ActiveMQStreamMessageTest.java
index 76e4fda..a29148d 100644
--- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/jms/client/ActiveMQStreamMessageTest.java
+++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/jms/client/ActiveMQStreamMessageTest.java
@@ -16,7 +16,7 @@
  */
 package org.apache.activemq.artemis.tests.unit.jms.client;
 
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.junit.Test;
 
 import java.util.ArrayList;
@@ -29,7 +29,7 @@ import org.junit.Assert;
 import org.apache.activemq.artemis.jms.client.ActiveMQStreamMessage;
 import org.apache.activemq.artemis.tests.util.RandomUtil;
 
-public class ActiveMQStreamMessageTest extends UnitTestCase
+public class ActiveMQStreamMessageTest extends ServiceTestBase
 {
    // Constants -----------------------------------------------------
 
@@ -180,7 +180,7 @@ public class ActiveMQStreamMessageTest extends UnitTestCase
       byte[] v = new byte[value.length];
       message.readBytes(v);
 
-      UnitTestCase.assertEqualsByteArrays(value, v);
+      ServiceTestBase.assertEqualsByteArrays(value, v);
    }
 
    @Test
@@ -195,7 +195,7 @@ public class ActiveMQStreamMessageTest extends UnitTestCase
       byte[] v = new byte[256];
       message.readBytes(v);
 
-      UnitTestCase.assertEqualsByteArrays(256, value, v);
+      ServiceTestBase.assertEqualsByteArrays(256, value, v);
    }
 
    @Test
@@ -922,7 +922,7 @@ public class ActiveMQStreamMessageTest extends UnitTestCase
       message.reset();
 
       byte[] v = (byte[])message.readObject();
-      UnitTestCase.assertEqualsByteArrays(value, v);
+      ServiceTestBase.assertEqualsByteArrays(value, v);
    }
 
    @Test
@@ -1041,7 +1041,7 @@ public class ActiveMQStreamMessageTest extends UnitTestCase
       Object v = reader.readType(message);
       if (value instanceof byte[])
       {
-         UnitTestCase.assertEqualsByteArrays((byte[])value, (byte[])v);
+         ServiceTestBase.assertEqualsByteArrays((byte[])value, (byte[])v);
       }
       else
       {

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/jms/client/JMSExceptionHelperTest.java
----------------------------------------------------------------------
diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/jms/client/JMSExceptionHelperTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/jms/client/JMSExceptionHelperTest.java
index d4a22f2..82a98a6 100644
--- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/jms/client/JMSExceptionHelperTest.java
+++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/jms/client/JMSExceptionHelperTest.java
@@ -28,12 +28,12 @@ import javax.jms.JMSSecurityException;
 
 import org.apache.activemq.artemis.api.core.ActiveMQException;
 import org.apache.activemq.artemis.api.core.ActiveMQExceptionType;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.apache.activemq.artemis.jms.client.JMSExceptionHelper;
 import org.junit.Assert;
 import org.junit.Test;
 
-public class JMSExceptionHelperTest extends UnitTestCase
+public class JMSExceptionHelperTest extends ServiceTestBase
 {
    // Constants -----------------------------------------------------
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/jms/client/SelectorTranslatorTest.java
----------------------------------------------------------------------
diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/jms/client/SelectorTranslatorTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/jms/client/SelectorTranslatorTest.java
index ca931e6..5f23ec9 100644
--- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/jms/client/SelectorTranslatorTest.java
+++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/jms/client/SelectorTranslatorTest.java
@@ -16,14 +16,14 @@
  */
 package org.apache.activemq.artemis.tests.unit.jms.client;
 
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.junit.Test;
 
 import org.junit.Assert;
 
 import org.apache.activemq.artemis.jms.client.SelectorTranslator;
 
-public class SelectorTranslatorTest extends UnitTestCase
+public class SelectorTranslatorTest extends ServiceTestBase
 {
    @Test
    public void testParseNull()

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/jms/misc/ManifestTest.java
----------------------------------------------------------------------
diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/jms/misc/ManifestTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/jms/misc/ManifestTest.java
index 559a96d..857cc0f 100644
--- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/jms/misc/ManifestTest.java
+++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/jms/misc/ManifestTest.java
@@ -16,7 +16,7 @@
  */
 package org.apache.activemq.artemis.tests.unit.jms.misc;
 
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.junit.Test;
 
 import java.io.File;
@@ -35,7 +35,7 @@ import org.apache.activemq.artemis.core.server.ActiveMQServers;
 import org.apache.activemq.artemis.jms.client.ActiveMQConnectionMetaData;
 import org.apache.activemq.artemis.tests.unit.UnitTestLogger;
 
-public class ManifestTest extends UnitTestCase
+public class ManifestTest extends ServiceTestBase
 {
    // Constants -----------------------------------------------------
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/jms/referenceable/ConnectionFactoryObjectFactoryTest.java
----------------------------------------------------------------------
diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/jms/referenceable/ConnectionFactoryObjectFactoryTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/jms/referenceable/ConnectionFactoryObjectFactoryTest.java
index 9884c7e..fe4f89c 100644
--- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/jms/referenceable/ConnectionFactoryObjectFactoryTest.java
+++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/jms/referenceable/ConnectionFactoryObjectFactoryTest.java
@@ -16,10 +16,10 @@
  */
 package org.apache.activemq.artemis.tests.unit.jms.referenceable;
 
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.junit.Test;
 
-public class ConnectionFactoryObjectFactoryTest extends UnitTestCase
+public class ConnectionFactoryObjectFactoryTest extends ServiceTestBase
 {
    // Constants -----------------------------------------------------
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/jms/referenceable/DestinationObjectFactoryTest.java
----------------------------------------------------------------------
diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/jms/referenceable/DestinationObjectFactoryTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/jms/referenceable/DestinationObjectFactoryTest.java
index 9b79d84..82d19ca 100644
--- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/jms/referenceable/DestinationObjectFactoryTest.java
+++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/jms/referenceable/DestinationObjectFactoryTest.java
@@ -16,7 +16,7 @@
  */
 package org.apache.activemq.artemis.tests.unit.jms.referenceable;
 
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.junit.Test;
 
 import javax.naming.Reference;
@@ -28,7 +28,7 @@ import org.apache.activemq.artemis.jms.client.ActiveMQDestination;
 import org.apache.activemq.artemis.jms.referenceable.DestinationObjectFactory;
 import org.apache.activemq.artemis.tests.util.RandomUtil;
 
-public class DestinationObjectFactoryTest extends UnitTestCase
+public class DestinationObjectFactoryTest extends ServiceTestBase
 {
    // Constants -----------------------------------------------------
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/ra/ActiveMQResourceAdapterConfigTest.java
----------------------------------------------------------------------
diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/ra/ActiveMQResourceAdapterConfigTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/ra/ActiveMQResourceAdapterConfigTest.java
index 1aa4168..ca3a81f 100644
--- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/ra/ActiveMQResourceAdapterConfigTest.java
+++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/ra/ActiveMQResourceAdapterConfigTest.java
@@ -25,7 +25,7 @@ import java.util.HashMap;
 import java.util.Map;
 
 import org.apache.activemq.artemis.ra.ActiveMQResourceAdapter;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.junit.Test;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
@@ -39,7 +39,7 @@ import org.xml.sax.InputSource;
  * this test should fail, if it does paste the new commented out configs into the ra.xml file and in here. don't forget to
  * add a description for each new property added and try and put it in the config some where appropriate.
  */
-public class ActiveMQResourceAdapterConfigTest extends UnitTestCase
+public class ActiveMQResourceAdapterConfigTest extends ServiceTestBase
 {
    private static String config = "" +
       "<config-property>\n" +

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/ra/ConnectionFactoryPropertiesTest.java
----------------------------------------------------------------------
diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/ra/ConnectionFactoryPropertiesTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/ra/ConnectionFactoryPropertiesTest.java
index a90d09f..335edf5 100644
--- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/ra/ConnectionFactoryPropertiesTest.java
+++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/ra/ConnectionFactoryPropertiesTest.java
@@ -21,14 +21,14 @@ import java.util.Set;
 import java.util.SortedSet;
 import java.util.TreeSet;
 
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
 import org.apache.activemq.artemis.ra.ActiveMQResourceAdapter;
 import org.junit.Test;
 
 import static java.beans.Introspector.getBeanInfo;
 
-public class ConnectionFactoryPropertiesTest extends UnitTestCase
+public class ConnectionFactoryPropertiesTest extends ServiceTestBase
 {
 
    private static final SortedSet<String> UNSUPPORTED_CF_PROPERTIES;

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/ActiveMQBufferInputStreamTest.java
----------------------------------------------------------------------
diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/ActiveMQBufferInputStreamTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/ActiveMQBufferInputStreamTest.java
index cf42ed4..1adcdf9 100644
--- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/ActiveMQBufferInputStreamTest.java
+++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/ActiveMQBufferInputStreamTest.java
@@ -18,11 +18,11 @@ package org.apache.activemq.artemis.tests.unit.util;
 
 import org.apache.activemq.artemis.api.core.ActiveMQBuffer;
 import org.apache.activemq.artemis.api.core.ActiveMQBuffers;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.apache.activemq.artemis.utils.ActiveMQBufferInputStream;
 import org.junit.Test;
 
-public class ActiveMQBufferInputStreamTest extends UnitTestCase
+public class ActiveMQBufferInputStreamTest extends ServiceTestBase
 {
 
    @Test

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/LinkedListTest.java
----------------------------------------------------------------------
diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/LinkedListTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/LinkedListTest.java
index ee4e62e..363320d 100644
--- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/LinkedListTest.java
+++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/LinkedListTest.java
@@ -22,13 +22,13 @@ import java.util.List;
 import java.util.NoSuchElementException;
 import java.util.concurrent.atomic.AtomicInteger;
 
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.apache.activemq.artemis.utils.LinkedListImpl;
 import org.apache.activemq.artemis.utils.LinkedListIterator;
 import org.junit.Before;
 import org.junit.Test;
 
-public class LinkedListTest extends UnitTestCase
+public class LinkedListTest extends ServiceTestBase
 {
    private LinkedListImpl<Integer> list;
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/ObjectInputStreamWithClassLoaderTest.java
----------------------------------------------------------------------
diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/ObjectInputStreamWithClassLoaderTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/ObjectInputStreamWithClassLoaderTest.java
index 3a41831..21aef5c 100644
--- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/ObjectInputStreamWithClassLoaderTest.java
+++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/ObjectInputStreamWithClassLoaderTest.java
@@ -16,7 +16,7 @@
  */
 package org.apache.activemq.artemis.tests.unit.util;
 
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.junit.Test;
 
 import java.io.ByteArrayInputStream;
@@ -40,7 +40,7 @@ import org.junit.Assert;
 
 import org.apache.activemq.artemis.utils.ObjectInputStreamWithClassLoader;
 
-public class ObjectInputStreamWithClassLoaderTest extends UnitTestCase
+public class ObjectInputStreamWithClassLoaderTest extends ServiceTestBase
 {
    // Constants -----------------------------------------------------
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/ReusableLatchTest.java
----------------------------------------------------------------------
diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/ReusableLatchTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/ReusableLatchTest.java
index 42893ce..95130c6 100644
--- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/ReusableLatchTest.java
+++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/ReusableLatchTest.java
@@ -19,12 +19,12 @@ package org.apache.activemq.artemis.tests.unit.util;
 import java.util.concurrent.CountDownLatch;
 
 import org.apache.activemq.artemis.tests.unit.UnitTestLogger;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.apache.activemq.artemis.utils.ReusableLatch;
 import org.junit.Assert;
 import org.junit.Test;
 
-public class ReusableLatchTest extends UnitTestCase
+public class ReusableLatchTest extends ServiceTestBase
 {
    @Test
    public void testLatchWithParameterizedDown() throws Exception

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/SoftValueMapTest.java
----------------------------------------------------------------------
diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/SoftValueMapTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/SoftValueMapTest.java
index 940bde7..7abea8f 100644
--- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/SoftValueMapTest.java
+++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/SoftValueMapTest.java
@@ -16,11 +16,11 @@
  */
 package org.apache.activemq.artemis.tests.unit.util;
 
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.apache.activemq.artemis.utils.SoftValueHashMap;
 import org.junit.Test;
 
-public class SoftValueMapTest extends UnitTestCase
+public class SoftValueMapTest extends ServiceTestBase
 {
 
    // Constants -----------------------------------------------------

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/UTF8Test.java
----------------------------------------------------------------------
diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/UTF8Test.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/UTF8Test.java
index 5d6f84d..4b0ba37 100644
--- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/UTF8Test.java
+++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/UTF8Test.java
@@ -17,7 +17,7 @@
 package org.apache.activemq.artemis.tests.unit.util;
 import org.apache.activemq.artemis.api.core.ActiveMQBuffer;
 import org.apache.activemq.artemis.api.core.ActiveMQBuffers;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.junit.After;
 
 import org.junit.Test;
@@ -35,7 +35,7 @@ import org.apache.activemq.artemis.utils.DataConstants;
 import org.apache.activemq.artemis.utils.Random;
 import org.apache.activemq.artemis.utils.UTF8Util;
 
-public class UTF8Test extends UnitTestCase
+public class UTF8Test extends ServiceTestBase
 {
 
    @Test

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/UUIDGeneratorTest.java
----------------------------------------------------------------------
diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/UUIDGeneratorTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/UUIDGeneratorTest.java
index 1d7a885..08604de 100644
--- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/UUIDGeneratorTest.java
+++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/UUIDGeneratorTest.java
@@ -16,12 +16,12 @@
  */
 package org.apache.activemq.artemis.tests.unit.util;
 
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.apache.activemq.artemis.utils.UUIDGenerator;
 import org.junit.Assert;
 import org.junit.Test;
 
-public class UUIDGeneratorTest extends UnitTestCase
+public class UUIDGeneratorTest extends ServiceTestBase
 {
    // Constants -----------------------------------------------------
 
@@ -58,15 +58,15 @@ public class UUIDGeneratorTest extends UnitTestCase
 
       byte[] fiveBytes = new byte[]{1, 2, 3, 4, 5};
       byte[] zeroPaddedFiveBytes = UUIDGenerator.getZeroPaddedSixBytes(fiveBytes);
-      UnitTestCase.assertEqualsByteArrays(new byte[]{1, 2, 3, 4, 5, 0}, zeroPaddedFiveBytes);
+      ServiceTestBase.assertEqualsByteArrays(new byte[]{1, 2, 3, 4, 5, 0}, zeroPaddedFiveBytes);
 
       byte[] fourBytes = new byte[]{1, 2, 3, 4};
       byte[] zeroPaddedFourBytes = UUIDGenerator.getZeroPaddedSixBytes(fourBytes);
-      UnitTestCase.assertEqualsByteArrays(new byte[]{1, 2, 3, 4, 0, 0}, zeroPaddedFourBytes);
+      ServiceTestBase.assertEqualsByteArrays(new byte[]{1, 2, 3, 4, 0, 0}, zeroPaddedFourBytes);
 
       byte[] threeBytes = new byte[]{1, 2, 3};
       byte[] zeroPaddedThreeBytes = UUIDGenerator.getZeroPaddedSixBytes(threeBytes);
-      UnitTestCase.assertEqualsByteArrays(new byte[]{1, 2, 3, 0, 0, 0}, zeroPaddedThreeBytes);
+      ServiceTestBase.assertEqualsByteArrays(new byte[]{1, 2, 3, 0, 0, 0}, zeroPaddedThreeBytes);
    }
 
    // Package protected ---------------------------------------------

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/UUIDTest.java
----------------------------------------------------------------------
diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/UUIDTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/UUIDTest.java
index 897d913..b202c48 100644
--- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/UUIDTest.java
+++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/UUIDTest.java
@@ -16,7 +16,7 @@
  */
 package org.apache.activemq.artemis.tests.unit.util;
 
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.junit.Test;
 
 import java.util.HashSet;
@@ -27,7 +27,7 @@ import org.junit.Assert;
 import org.apache.activemq.artemis.utils.UUID;
 import org.apache.activemq.artemis.utils.UUIDGenerator;
 
-public class UUIDTest extends UnitTestCase
+public class UUIDTest extends ServiceTestBase
 {
    static final int MANY_TIMES = 100000;
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/VersionLoaderTest.java
----------------------------------------------------------------------
diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/VersionLoaderTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/VersionLoaderTest.java
index 829b516..cc0a509 100644
--- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/VersionLoaderTest.java
+++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/VersionLoaderTest.java
@@ -19,13 +19,13 @@ package org.apache.activemq.artemis.tests.unit.util;
 import java.util.Properties;
 import java.util.StringTokenizer;
 
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.apache.activemq.artemis.core.version.Version;
 import org.apache.activemq.artemis.utils.VersionLoader;
 import org.junit.Assert;
 import org.junit.Test;
 
-public class VersionLoaderTest extends UnitTestCase
+public class VersionLoaderTest extends ServiceTestBase
 {
    // Constants -----------------------------------------------------
 


[06/13] activemq-artemis git commit: Refactor base test classes

Posted by an...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/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 892b585..fea0f95 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
@@ -27,7 +27,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.UnitTestCase;
 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;
@@ -214,7 +213,7 @@ public class RequestorTest extends ServiceTestBase
          }
       };
 
-      UnitTestCase.expectActiveMQException("ClientRequestor's session must not be closed",
+      ServiceTestBase.expectActiveMQException("ClientRequestor's session must not be closed",
               ActiveMQExceptionType.OBJECT_CLOSED,
               activeMQAction);
    }
@@ -258,7 +257,7 @@ public class RequestorTest extends ServiceTestBase
          }
       };
 
-      UnitTestCase.expectActiveMQException("can not send a request on a closed ClientRequestor",
+      ServiceTestBase.expectActiveMQException("can not send a request on a closed ClientRequestor",
                                            ActiveMQExceptionType.OBJECT_CLOSED, activeMQAction);
    }
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/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 0ce600d..23814fa 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
@@ -24,11 +24,10 @@ 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.integration.IntegrationTestLogger;
-import org.apache.activemq.artemis.tests.util.ServiceTestBase;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
 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.junit.Assert;
 import org.junit.Test;
 
@@ -118,7 +117,7 @@ public class SelfExpandingBufferTest extends ServiceTestBase
 
          msg2.getBodyBuffer().readBytes(receivedBytes);
 
-         UnitTestCase.assertEqualsByteArrays(bytes, receivedBytes);
+         ServiceTestBase.assertEqualsByteArrays(bytes, receivedBytes);
 
          msg2 = cons.receive(3000);
 
@@ -126,7 +125,7 @@ public class SelfExpandingBufferTest extends ServiceTestBase
 
          msg2.getBodyBuffer().readBytes(receivedBytes);
 
-         UnitTestCase.assertEqualsByteArrays(bytes, receivedBytes);
+         ServiceTestBase.assertEqualsByteArrays(bytes, receivedBytes);
       }
       finally
       {

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/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 372a8fd..debde03 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
@@ -16,19 +16,18 @@
  */
 package org.apache.activemq.artemis.tests.integration.client;
 
-import java.lang.ref.WeakReference;
-
 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.UnitTestCase;
 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.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
 
+import java.lang.ref.WeakReference;
+
 public class SessionCloseOnGCTest extends ServiceTestBase
 {
    private ActiveMQServer server;
@@ -70,7 +69,7 @@ public class SessionCloseOnGCTest extends ServiceTestBase
       locator.close();
 
       locator = null;
-      UnitTestCase.checkWeakReferences(wrs1, wrs2);
+      ServiceTestBase.checkWeakReferences(wrs1, wrs2);
 
       WeakReference<ClientSessionFactory> fref = new WeakReference<ClientSessionFactory>(factory);
 
@@ -78,7 +77,7 @@ public class SessionCloseOnGCTest extends ServiceTestBase
 
       factory = null;
 
-      UnitTestCase.checkWeakReferences(fref, wrs1, wrs2);
+      ServiceTestBase.checkWeakReferences(fref, wrs1, wrs2);
    }
 
    @Test
@@ -103,7 +102,7 @@ public class SessionCloseOnGCTest extends ServiceTestBase
       locator.close();
 
       locator = null;
-      UnitTestCase.checkWeakReferences(wrs1, wrs2);
+      ServiceTestBase.checkWeakReferences(wrs1, wrs2);
 
       WeakReference<ClientSessionFactory> fref = new WeakReference<ClientSessionFactory>(factory);
 
@@ -111,7 +110,7 @@ public class SessionCloseOnGCTest extends ServiceTestBase
 
       factory = null;
 
-      UnitTestCase.checkWeakReferences(fref, wrs1, wrs2);
+      ServiceTestBase.checkWeakReferences(fref, wrs1, wrs2);
    }
 
    @Test
@@ -134,13 +133,13 @@ public class SessionCloseOnGCTest extends ServiceTestBase
       locator.close();
 
       locator = null;
-      UnitTestCase.checkWeakReferences(wrs1, wrs2);
+      ServiceTestBase.checkWeakReferences(wrs1, wrs2);
 
       WeakReference<ClientSessionFactory> fref = new WeakReference<ClientSessionFactory>(factory);
 
       factory = null;
 
-      UnitTestCase.checkWeakReferences(fref, wrs1, wrs2);
+      ServiceTestBase.checkWeakReferences(fref, wrs1, wrs2);
    }
 
    @Test
@@ -160,13 +159,13 @@ public class SessionCloseOnGCTest extends ServiceTestBase
       locator.close();
 
       locator = null;
-      UnitTestCase.checkWeakReferences(wrs1, wrs2);
+      ServiceTestBase.checkWeakReferences(wrs1, wrs2);
 
       WeakReference<ClientSessionFactory> fref = new WeakReference<ClientSessionFactory>(factory);
 
       factory = null;
 
-      UnitTestCase.checkWeakReferences(fref, wrs1, wrs2);
+      ServiceTestBase.checkWeakReferences(fref, wrs1, wrs2);
    }
 
    @Test
@@ -181,7 +180,7 @@ public class SessionCloseOnGCTest extends ServiceTestBase
       locator.close();
 
       locator = null;
-      UnitTestCase.checkWeakReferences(fref);
+      ServiceTestBase.checkWeakReferences(fref);
    }
 
    @Test
@@ -197,7 +196,7 @@ public class SessionCloseOnGCTest extends ServiceTestBase
 
       session = null;
 
-      UnitTestCase.checkWeakReferences(wses);
+      ServiceTestBase.checkWeakReferences(wses);
 
       Assert.assertEquals(0, sf.numSessions());
       Assert.assertEquals(1, sf.numConnections());
@@ -223,7 +222,7 @@ public class SessionCloseOnGCTest extends ServiceTestBase
       session2 = null;
       session3 = null;
 
-      UnitTestCase.checkWeakReferences(ref1, ref2, ref3);
+      ServiceTestBase.checkWeakReferences(ref1, ref2, ref3);
 
       int count = 0;
       final int TOTAL_SLEEP_TIME = 400;

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/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 397556d..060d38b 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
@@ -15,34 +15,31 @@
  * 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.api.core.ActiveMQExceptionType;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
-import org.junit.Before;
-import org.junit.After;
-
-import org.junit.Test;
-
-import javax.transaction.xa.XAException;
-import javax.transaction.xa.XAResource;
-
-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.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.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.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;
+
+import javax.transaction.xa.XAException;
+import javax.transaction.xa.XAResource;
 
-public class SessionCloseTest extends UnitTestCase
+public class SessionCloseTest extends ServiceTestBase
 {
 
    // Constants -----------------------------------------------------
@@ -69,7 +66,7 @@ public class SessionCloseTest extends UnitTestCase
 
       Assert.assertTrue(session.isClosed());
 
-      UnitTestCase.expectActiveMQException(ActiveMQExceptionType.OBJECT_CLOSED, new ActiveMQAction()
+      ServiceTestBase.expectActiveMQException(ActiveMQExceptionType.OBJECT_CLOSED, new ActiveMQAction()
       {
          public void run() throws ActiveMQException
          {
@@ -77,7 +74,7 @@ public class SessionCloseTest extends UnitTestCase
          }
       });
 
-      UnitTestCase.expectActiveMQException(ActiveMQExceptionType.OBJECT_CLOSED, new ActiveMQAction()
+      ServiceTestBase.expectActiveMQException(ActiveMQExceptionType.OBJECT_CLOSED, new ActiveMQAction()
       {
          public void run() throws ActiveMQException
          {
@@ -85,7 +82,7 @@ public class SessionCloseTest extends UnitTestCase
          }
       });
 
-      UnitTestCase.expectActiveMQException(ActiveMQExceptionType.OBJECT_CLOSED, new ActiveMQAction()
+      ServiceTestBase.expectActiveMQException(ActiveMQExceptionType.OBJECT_CLOSED, new ActiveMQAction()
       {
          public void run() throws ActiveMQException
          {
@@ -95,7 +92,7 @@ public class SessionCloseTest extends UnitTestCase
          }
       });
 
-      UnitTestCase.expectActiveMQException(ActiveMQExceptionType.OBJECT_CLOSED, new ActiveMQAction()
+      ServiceTestBase.expectActiveMQException(ActiveMQExceptionType.OBJECT_CLOSED, new ActiveMQAction()
       {
          public void run() throws ActiveMQException
          {
@@ -103,7 +100,7 @@ public class SessionCloseTest extends UnitTestCase
          }
       });
 
-      UnitTestCase.expectActiveMQException(ActiveMQExceptionType.OBJECT_CLOSED, new ActiveMQAction()
+      ServiceTestBase.expectActiveMQException(ActiveMQExceptionType.OBJECT_CLOSED, new ActiveMQAction()
       {
          public void run() throws ActiveMQException
          {
@@ -111,7 +108,7 @@ public class SessionCloseTest extends UnitTestCase
          }
       });
 
-      UnitTestCase.expectActiveMQException(ActiveMQExceptionType.OBJECT_CLOSED, new ActiveMQAction()
+      ServiceTestBase.expectActiveMQException(ActiveMQExceptionType.OBJECT_CLOSED, new ActiveMQAction()
       {
          public void run() throws ActiveMQException
          {
@@ -119,7 +116,7 @@ public class SessionCloseTest extends UnitTestCase
          }
       });
 
-      UnitTestCase.expectActiveMQException(ActiveMQExceptionType.OBJECT_CLOSED, new ActiveMQAction()
+      ServiceTestBase.expectActiveMQException(ActiveMQExceptionType.OBJECT_CLOSED, new ActiveMQAction()
       {
          public void run() throws ActiveMQException
          {
@@ -127,7 +124,7 @@ public class SessionCloseTest extends UnitTestCase
          }
       });
 
-      UnitTestCase.expectActiveMQException(ActiveMQExceptionType.OBJECT_CLOSED, new ActiveMQAction()
+      ServiceTestBase.expectActiveMQException(ActiveMQExceptionType.OBJECT_CLOSED, new ActiveMQAction()
       {
          public void run() throws ActiveMQException
          {
@@ -135,7 +132,7 @@ public class SessionCloseTest extends UnitTestCase
          }
       });
 
-      UnitTestCase.expectActiveMQException(ActiveMQExceptionType.OBJECT_CLOSED, new ActiveMQAction()
+      ServiceTestBase.expectActiveMQException(ActiveMQExceptionType.OBJECT_CLOSED, new ActiveMQAction()
       {
          public void run() throws ActiveMQException
          {
@@ -143,7 +140,7 @@ public class SessionCloseTest extends UnitTestCase
          }
       });
 
-      UnitTestCase.expectActiveMQException(ActiveMQExceptionType.OBJECT_CLOSED, new ActiveMQAction()
+      ServiceTestBase.expectActiveMQException(ActiveMQExceptionType.OBJECT_CLOSED, new ActiveMQAction()
       {
          public void run() throws ActiveMQException
          {
@@ -164,7 +161,7 @@ public class SessionCloseTest extends UnitTestCase
       Assert.assertTrue(session.isXA());
       Assert.assertTrue(session.isClosed());
 
-      UnitTestCase.expectXAException(XAException.XA_RETRY, new ActiveMQAction()
+      ServiceTestBase.expectXAException(XAException.XA_RETRY, new ActiveMQAction()
       {
          public void run() throws XAException
          {
@@ -172,7 +169,7 @@ public class SessionCloseTest extends UnitTestCase
          }
       });
 
-      UnitTestCase.expectXAException(XAException.XAER_RMERR, new ActiveMQAction()
+      ServiceTestBase.expectXAException(XAException.XAER_RMERR, new ActiveMQAction()
       {
          public void run() throws XAException
          {
@@ -180,7 +177,7 @@ public class SessionCloseTest extends UnitTestCase
          }
       });
 
-      UnitTestCase.expectXAException(XAException.XAER_RMERR, new ActiveMQAction()
+      ServiceTestBase.expectXAException(XAException.XAER_RMERR, new ActiveMQAction()
       {
          public void run() throws XAException
          {
@@ -188,7 +185,7 @@ public class SessionCloseTest extends UnitTestCase
          }
       });
 
-      UnitTestCase.expectXAException(XAException.XAER_RMERR, new ActiveMQAction()
+      ServiceTestBase.expectXAException(XAException.XAER_RMERR, new ActiveMQAction()
       {
          public void run() throws XAException
          {
@@ -196,7 +193,7 @@ public class SessionCloseTest extends UnitTestCase
          }
       });
 
-      UnitTestCase.expectXAException(XAException.XAER_RMERR, new ActiveMQAction()
+      ServiceTestBase.expectXAException(XAException.XAER_RMERR, new ActiveMQAction()
       {
          public void run() throws XAException
          {
@@ -204,7 +201,7 @@ public class SessionCloseTest extends UnitTestCase
          }
       });
 
-      UnitTestCase.expectXAException(XAException.XAER_RMERR, new ActiveMQAction()
+      ServiceTestBase.expectXAException(XAException.XAER_RMERR, new ActiveMQAction()
       {
          public void run() throws XAException
          {
@@ -212,7 +209,7 @@ public class SessionCloseTest extends UnitTestCase
          }
       });
 
-      UnitTestCase.expectXAException(XAException.XAER_RMERR, new ActiveMQAction()
+      ServiceTestBase.expectXAException(XAException.XAER_RMERR, new ActiveMQAction()
       {
          public void run() throws XAException
          {
@@ -260,7 +257,7 @@ public class SessionCloseTest extends UnitTestCase
 
       server.start();
 
-      ServerLocator locator = ActiveMQClient.createServerLocatorWithoutHA(new TransportConfiguration(UnitTestCase.INVM_CONNECTOR_FACTORY));
+      ServerLocator locator = createInVMNonHALocator();
       sf = createSessionFactory(locator);
 
    }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/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 f1f75b6..add2724 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
@@ -37,7 +37,7 @@ import org.apache.activemq.artemis.api.core.client.ClientSessionFactory;
 import org.apache.activemq.artemis.api.core.client.MessageHandler;
 import org.apache.activemq.artemis.api.core.client.ServerLocator;
 import org.apache.activemq.artemis.tests.util.SingleServerTestBase;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+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;
@@ -574,7 +574,7 @@ public class TemporaryQueueTest extends SingleServerTestBase
          }
       };
 
-      UnitTestCase.expectActiveMQException("temp queue must not exist after the server detected the client crash",
+      ServiceTestBase.expectActiveMQException("temp queue must not exist after the server detected the client crash",
               ActiveMQExceptionType.QUEUE_DOES_NOT_EXIST, activeMQAction);
 
       session.close();

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/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 17383c0..3ada09d 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
@@ -15,15 +15,8 @@
  * 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.UnitTestCase;
-import org.junit.Before;
-import org.junit.After;
-
-import org.junit.Test;
-
-import org.junit.Assert;
 
+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;
@@ -31,13 +24,17 @@ 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.tests.util.ServiceTestBase;
+import org.junit.After;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
 
-public class WildCardRoutingTest extends UnitTestCase
+public class WildCardRoutingTest extends ServiceTestBase
 {
    private ActiveMQServer server;
    private ServerLocator locator;
@@ -784,7 +781,7 @@ public class WildCardRoutingTest extends UnitTestCase
    public void setUp() throws Exception
    {
       super.setUp();
-      TransportConfiguration transportConfig = new TransportConfiguration(UnitTestCase.INVM_ACCEPTOR_FACTORY);
+      TransportConfiguration transportConfig = new TransportConfiguration(ServiceTestBase.INVM_ACCEPTOR_FACTORY);
 
       Configuration configuration = createDefaultConfig()
          .setWildcardRoutingEnabled(true)
@@ -797,7 +794,7 @@ public class WildCardRoutingTest extends UnitTestCase
       server.start();
       server.getManagementService().enableNotifications(false);
       // then we create a client as normal
-      locator = ActiveMQClient.createServerLocatorWithoutHA(new TransportConfiguration(UnitTestCase.INVM_CONNECTOR_FACTORY));
+      locator = createInVMNonHALocator();
       sessionFactory = createSessionFactory(locator);
       clientSession = sessionFactory.createSession(false, true, true);
    }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/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 12d3f16..23b73f4 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
@@ -17,13 +17,11 @@
 package org.apache.activemq.artemis.tests.integration.cluster;
 
 import org.apache.activemq.artemis.api.core.ActiveMQClusterSecurityException;
-import org.apache.activemq.artemis.api.core.TransportConfiguration;
-import org.apache.activemq.artemis.api.core.client.ActiveMQClient;
 import org.apache.activemq.artemis.core.client.impl.ClientSessionFactoryInternal;
 import org.apache.activemq.artemis.core.client.impl.ServerLocatorImpl;
+import org.apache.activemq.artemis.core.server.cluster.ActiveMQServerSideProtocolManagerFactory;
 import org.apache.activemq.artemis.core.server.cluster.ClusterControl;
 import org.apache.activemq.artemis.core.server.cluster.ClusterController;
-import org.apache.activemq.artemis.core.server.cluster.ActiveMQServerSideProtocolManagerFactory;
 import org.apache.activemq.artemis.tests.integration.cluster.distribution.ClusterTestBase;
 import org.junit.After;
 import org.junit.Before;
@@ -70,7 +68,7 @@ public class ClusterControllerTest extends ClusterTestBase
    @Test
    public void controlWithDifferentConnector() throws Exception
    {
-      try (ServerLocatorImpl locator = (ServerLocatorImpl) ActiveMQClient.createServerLocatorWithoutHA(new TransportConfiguration(INVM_CONNECTOR_FACTORY)))
+      try (ServerLocatorImpl locator = (ServerLocatorImpl) createInVMNonHALocator())
       {
          locator.setProtocolManagerFactory(ActiveMQServerSideProtocolManagerFactory.getInstance());
          ClusterController controller = new ClusterController(getServer(0), getServer(0).getScheduledPool());
@@ -82,7 +80,7 @@ public class ClusterControllerTest extends ClusterTestBase
    @Test
    public void controlWithDifferentPassword() throws Exception
    {
-      try (ServerLocatorImpl locator = (ServerLocatorImpl) ActiveMQClient.createServerLocatorWithoutHA(new TransportConfiguration(INVM_CONNECTOR_FACTORY)))
+      try (ServerLocatorImpl locator = (ServerLocatorImpl) createInVMNonHALocator())
       {
          locator.setProtocolManagerFactory(ActiveMQServerSideProtocolManagerFactory.getInstance());
          ClusterController controller = new ClusterController(getServer(1), getServer(1).getScheduledPool());

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/RealNodeManagerTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/RealNodeManagerTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/RealNodeManagerTest.java
index a6ccc05..d81abcd 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/RealNodeManagerTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/RealNodeManagerTest.java
@@ -20,7 +20,7 @@ import java.util.ArrayList;
 import java.util.List;
 
 import org.apache.activemq.artemis.tests.util.SpawnedVMSupport;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.apache.activemq.artemis.core.server.NodeManager;
 import org.apache.activemq.artemis.core.server.impl.FileLockNodeManager;
 import org.apache.activemq.artemis.utils.UUID;
@@ -37,7 +37,7 @@ public class RealNodeManagerTest extends NodeManagerTest
       UUID id1 = nodeManager.getUUID();
       nodeManager.stop();
       nodeManager.start();
-      UnitTestCase.assertEqualsByteArrays(id1.asBytes(), nodeManager.getUUID().asBytes());
+      ServiceTestBase.assertEqualsByteArrays(id1.asBytes(), nodeManager.getUUID().asBytes());
       nodeManager.stop();
    }
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/bridge/BridgeTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/bridge/BridgeTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/bridge/BridgeTest.java
index 61e6f3b..219429a 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/bridge/BridgeTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/bridge/BridgeTest.java
@@ -16,33 +16,27 @@
  */
 package org.apache.activemq.artemis.tests.integration.cluster.bridge;
 
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.Semaphore;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.atomic.AtomicInteger;
-
 import org.apache.activemq.artemis.api.core.ActiveMQBuffer;
 import org.apache.activemq.artemis.api.core.ActiveMQException;
 import org.apache.activemq.artemis.api.core.Interceptor;
 import org.apache.activemq.artemis.api.core.SimpleString;
 import org.apache.activemq.artemis.api.core.TransportConfiguration;
+import org.apache.activemq.artemis.api.core.client.ActiveMQClient;
 import org.apache.activemq.artemis.api.core.client.ClientConsumer;
 import org.apache.activemq.artemis.api.core.client.ClientMessage;
 import org.apache.activemq.artemis.api.core.client.ClientProducer;
 import org.apache.activemq.artemis.api.core.client.ClientSession;
 import org.apache.activemq.artemis.api.core.client.ClientSessionFactory;
-import org.apache.activemq.artemis.api.core.client.ActiveMQClient;
 import org.apache.activemq.artemis.api.core.client.ServerLocator;
-import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
 import org.apache.activemq.artemis.core.config.BridgeConfiguration;
 import org.apache.activemq.artemis.core.config.CoreQueueConfiguration;
+import org.apache.activemq.artemis.core.journal.PreparedTransactionInfo;
+import org.apache.activemq.artemis.core.journal.RecordInfo;
+import org.apache.activemq.artemis.core.journal.SequentialFileFactory;
+import org.apache.activemq.artemis.core.journal.impl.JournalImpl;
+import org.apache.activemq.artemis.core.journal.impl.NIOSequentialFileFactory;
+import org.apache.activemq.artemis.core.persistence.impl.journal.DescribeJournal;
+import org.apache.activemq.artemis.core.persistence.impl.journal.JournalRecordIds;
 import org.apache.activemq.artemis.core.postoffice.DuplicateIDCache;
 import org.apache.activemq.artemis.core.postoffice.impl.PostOfficeImpl;
 import org.apache.activemq.artemis.core.protocol.core.Packet;
@@ -56,6 +50,7 @@ import org.apache.activemq.artemis.core.server.Queue;
 import org.apache.activemq.artemis.core.server.cluster.impl.BridgeImpl;
 import org.apache.activemq.artemis.core.transaction.impl.TransactionImpl;
 import org.apache.activemq.artemis.spi.core.protocol.RemotingConnection;
+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.utils.LinkedListIterator;
@@ -66,6 +61,18 @@ import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.junit.runners.Parameterized;
 
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.Semaphore;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicInteger;
+
 @RunWith(value = Parameterized.class)
 public class BridgeTest extends ServiceTestBase
 {
@@ -226,7 +233,7 @@ public class BridgeTest extends ServiceTestBase
 
          if (largeMessage)
          {
-            message.setBodyInputStream(UnitTestCase.createFakeLargeStream(1024 * 1024));
+            message.setBodyInputStream(ServiceTestBase.createFakeLargeStream(1024 * 1024));
          }
 
          message.putIntProperty(propKey, i);
@@ -403,7 +410,7 @@ public class BridgeTest extends ServiceTestBase
 
          if (largeMessage)
          {
-            message.setBodyInputStream(UnitTestCase.createFakeLargeStream(1024 * 1024));
+            message.setBodyInputStream(ServiceTestBase.createFakeLargeStream(1024 * 1024));
          }
 
          message.putIntProperty(propKey, i);
@@ -588,7 +595,7 @@ public class BridgeTest extends ServiceTestBase
 
          if (largeMessage)
          {
-            message.setBodyInputStream(UnitTestCase.createFakeLargeStream(1024 * 1024));
+            message.setBodyInputStream(ServiceTestBase.createFakeLargeStream(1024 * 1024));
          }
 
          producer0.send(message);
@@ -606,7 +613,7 @@ public class BridgeTest extends ServiceTestBase
 
          if (largeMessage)
          {
-            message.setBodyInputStream(UnitTestCase.createFakeLargeStream(1024 * 1024));
+            message.setBodyInputStream(ServiceTestBase.createFakeLargeStream(1024 * 1024));
          }
 
          producer0.send(message);
@@ -1869,4 +1876,59 @@ public class BridgeTest extends ServiceTestBase
 
 
    }
+
+   /**
+    * It will inspect the journal directly and determine if there are queues on this journal,
+    *
+    * @param serverToInvestigate
+    * @return a Map containing the reference counts per queue
+    * @throws Exception
+    */
+   protected Map<Long, AtomicInteger> loadQueues(ActiveMQServer serverToInvestigate) throws Exception
+   {
+      SequentialFileFactory messagesFF = new NIOSequentialFileFactory(serverToInvestigate.getConfiguration()
+                                                                              .getJournalDirectory());
+
+      JournalImpl messagesJournal = new JournalImpl(serverToInvestigate.getConfiguration().getJournalFileSize(),
+                                                    serverToInvestigate.getConfiguration().getJournalMinFiles(),
+                                                    0,
+                                                    0,
+                                                    messagesFF,
+                                                    "activemq-data",
+                                                    "amq",
+                                                    1);
+      List<RecordInfo> records = new LinkedList<RecordInfo>();
+
+      List<PreparedTransactionInfo> preparedTransactions = new LinkedList<PreparedTransactionInfo>();
+
+      messagesJournal.start();
+      messagesJournal.load(records, preparedTransactions, null);
+
+      // These are more immutable integers
+      Map<Long, AtomicInteger> messageRefCounts = new HashMap<Long, AtomicInteger>();
+
+      for (RecordInfo info : records)
+      {
+         Object o = DescribeJournal.newObjectEncoding(info);
+         if (info.getUserRecordType() == JournalRecordIds.ADD_REF)
+         {
+            DescribeJournal.ReferenceDescribe ref = (DescribeJournal.ReferenceDescribe) o;
+            AtomicInteger count = messageRefCounts.get(ref.refEncoding.queueID);
+            if (count == null)
+            {
+               count = new AtomicInteger(1);
+               messageRefCounts.put(ref.refEncoding.queueID, count);
+            }
+            else
+            {
+               count.incrementAndGet();
+            }
+         }
+      }
+
+      messagesJournal.stop();
+
+      return messageRefCounts;
+
+   }
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/bridge/BridgeTestBase.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/bridge/BridgeTestBase.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/bridge/BridgeTestBase.java
index 8bbce91..dd542f5 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/bridge/BridgeTestBase.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/bridge/BridgeTestBase.java
@@ -20,7 +20,7 @@ import java.util.Map;
 import java.util.concurrent.TimeUnit;
 
 import org.apache.activemq.artemis.api.core.TransportConfiguration;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+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.config.ha.SharedStoreSlavePolicyConfiguration;
@@ -31,7 +31,7 @@ import org.apache.activemq.artemis.core.server.NodeManager;
 import org.apache.activemq.artemis.tests.util.InVMNodeManagerServer;
 import org.junit.After;
 
-public abstract class BridgeTestBase extends UnitTestCase
+public abstract class BridgeTestBase extends ServiceTestBase
 {
 
    @Override

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/ClusterTestBase.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/ClusterTestBase.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/ClusterTestBase.java
index 323d7b3..16ce2bc 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/ClusterTestBase.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/ClusterTestBase.java
@@ -16,21 +16,6 @@
  */
 package org.apache.activemq.artemis.tests.integration.cluster.distribution;
 
-import java.io.PrintWriter;
-import java.io.StringWriter;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.atomic.AtomicInteger;
-
 import org.apache.activemq.artemis.api.config.ActiveMQDefaultConfiguration;
 import org.apache.activemq.artemis.api.core.ActiveMQException;
 import org.apache.activemq.artemis.api.core.BroadcastGroupConfiguration;
@@ -39,14 +24,13 @@ 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.UDPBroadcastEndpointFactory;
+import org.apache.activemq.artemis.api.core.client.ActiveMQClient;
 import org.apache.activemq.artemis.api.core.client.ClientConsumer;
 import org.apache.activemq.artemis.api.core.client.ClientMessage;
 import org.apache.activemq.artemis.api.core.client.ClientProducer;
 import org.apache.activemq.artemis.api.core.client.ClientSession;
 import org.apache.activemq.artemis.api.core.client.ClientSessionFactory;
-import org.apache.activemq.artemis.api.core.client.ActiveMQClient;
 import org.apache.activemq.artemis.api.core.client.ServerLocator;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
 import org.apache.activemq.artemis.core.client.impl.ServerLocatorInternal;
 import org.apache.activemq.artemis.core.client.impl.Topology;
 import org.apache.activemq.artemis.core.client.impl.TopologyMemberImpl;
@@ -68,9 +52,9 @@ import org.apache.activemq.artemis.core.remoting.impl.netty.TransportConstants;
 import org.apache.activemq.artemis.core.server.ActiveMQServer;
 import org.apache.activemq.artemis.core.server.ActiveMQServers;
 import org.apache.activemq.artemis.core.server.NodeManager;
+import org.apache.activemq.artemis.core.server.cluster.ActiveMQServerSideProtocolManagerFactory;
 import org.apache.activemq.artemis.core.server.cluster.ClusterConnection;
 import org.apache.activemq.artemis.core.server.cluster.ClusterManager;
-import org.apache.activemq.artemis.core.server.cluster.ActiveMQServerSideProtocolManagerFactory;
 import org.apache.activemq.artemis.core.server.cluster.RemoteQueueBinding;
 import org.apache.activemq.artemis.core.server.cluster.impl.ClusterConnectionImpl;
 import org.apache.activemq.artemis.core.server.cluster.qourum.SharedNothingBackupQuorum;
@@ -83,6 +67,21 @@ import org.junit.After;
 import org.junit.Assert;
 import org.junit.Before;
 
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicInteger;
+
 public abstract class ClusterTestBase extends ServiceTestBase
 {
    private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER;
@@ -138,7 +137,7 @@ public abstract class ClusterTestBase extends ServiceTestBase
 
       forceGC();
 
-      UnitTestCase.checkFreePort(ClusterTestBase.PORTS);
+      ServiceTestBase.checkFreePort(ClusterTestBase.PORTS);
 
       consumers = new ConsumerHolder[ClusterTestBase.MAX_CONSUMERS];
 
@@ -187,7 +186,7 @@ public abstract class ClusterTestBase extends ServiceTestBase
 
       super.tearDown();
 
-      UnitTestCase.checkFreePort(ClusterTestBase.PORTS);
+      ServiceTestBase.checkFreePort(ClusterTestBase.PORTS);
 
    }
 
@@ -663,7 +662,7 @@ public abstract class ClusterTestBase extends ServiceTestBase
       {
          // Proxy the failure and print a dump into System.out, so it is captured by Jenkins reports
          e.printStackTrace();
-         System.out.println(UnitTestCase.threadDump(" - fired by ClusterTestBase::addConsumer"));
+         System.out.println(ServiceTestBase.threadDump(" - fired by ClusterTestBase::addConsumer"));
 
          throw e;
       }
@@ -1541,11 +1540,11 @@ public abstract class ClusterTestBase extends ServiceTestBase
 
       if (netty)
       {
-         serverTotc = new TransportConfiguration(UnitTestCase.NETTY_CONNECTOR_FACTORY, params);
+         serverTotc = new TransportConfiguration(ServiceTestBase.NETTY_CONNECTOR_FACTORY, params);
       }
       else
       {
-         serverTotc = new TransportConfiguration(UnitTestCase.INVM_CONNECTOR_FACTORY, params);
+         serverTotc = new TransportConfiguration(INVM_CONNECTOR_FACTORY, params);
       }
 
       if (ha)
@@ -1582,11 +1581,11 @@ public abstract class ClusterTestBase extends ServiceTestBase
 
       if (netty)
       {
-         serverTotc = new TransportConfiguration(UnitTestCase.NETTY_CONNECTOR_FACTORY, params);
+         serverTotc = new TransportConfiguration(ServiceTestBase.NETTY_CONNECTOR_FACTORY, params);
       }
       else
       {
-         serverTotc = new TransportConfiguration(UnitTestCase.INVM_CONNECTOR_FACTORY, params);
+         serverTotc = new TransportConfiguration(INVM_CONNECTOR_FACTORY, params);
       }
 
       locators[node] = ActiveMQClient.createServerLocatorWithoutHA(serverTotc);

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/MessageRedistributionWithDiscoveryTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/MessageRedistributionWithDiscoveryTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/MessageRedistributionWithDiscoveryTest.java
index 0110362..f117f76 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/MessageRedistributionWithDiscoveryTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/MessageRedistributionWithDiscoveryTest.java
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 package org.apache.activemq.artemis.tests.integration.cluster.distribution;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.junit.Assert;
 import org.junit.Before;
 
@@ -34,9 +34,9 @@ import org.apache.activemq.artemis.core.settings.impl.AddressSettings;
 
 public class MessageRedistributionWithDiscoveryTest extends ClusterTestBase
 {
-   protected final String groupAddress = UnitTestCase.getUDPDiscoveryAddress();
+   protected final String groupAddress = ServiceTestBase.getUDPDiscoveryAddress();
 
-   protected final int groupPort = UnitTestCase.getUDPDiscoveryPort();
+   protected final int groupPort = ServiceTestBase.getUDPDiscoveryPort();
 
    protected boolean isNetty()
    {

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/SymmetricClusterTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/SymmetricClusterTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/SymmetricClusterTest.java
index 1bd25cc..71c83c0 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/SymmetricClusterTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/SymmetricClusterTest.java
@@ -16,7 +16,7 @@
  */
 package org.apache.activemq.artemis.tests.integration.cluster.distribution;
 import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.junit.Before;
 import org.junit.After;
 
@@ -153,7 +153,7 @@ public class SymmetricClusterTest extends ClusterTestBase
       }
       catch (Throwable e)
       {
-         System.out.println(UnitTestCase.threadDump("SymmetricClusterTest::testStopAllStartAll"));
+         System.out.println(ServiceTestBase.threadDump("SymmetricClusterTest::testStopAllStartAll"));
          throw e;
       }
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/SymmetricClusterWithBackupTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/SymmetricClusterWithBackupTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/SymmetricClusterWithBackupTest.java
index 6d37234..cd1d35c 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/SymmetricClusterWithBackupTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/SymmetricClusterWithBackupTest.java
@@ -18,7 +18,7 @@ package org.apache.activemq.artemis.tests.integration.cluster.distribution;
 
 import org.apache.activemq.artemis.core.config.ha.SharedStoreSlavePolicyConfiguration;
 import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.junit.Test;
 
 public class SymmetricClusterWithBackupTest extends SymmetricClusterTest
@@ -121,7 +121,7 @@ public class SymmetricClusterWithBackupTest extends SymmetricClusterTest
       }
       catch (Throwable e)
       {
-         System.out.println(UnitTestCase.threadDump("SymmetricClusterWithBackupTest::testStopAllStartAll"));
+         System.out.println(ServiceTestBase.threadDump("SymmetricClusterWithBackupTest::testStopAllStartAll"));
          throw e;
       }
    }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/SymmetricClusterWithDiscoveryTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/SymmetricClusterWithDiscoveryTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/SymmetricClusterWithDiscoveryTest.java
index 752c8f9..eee7afa 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/SymmetricClusterWithDiscoveryTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/SymmetricClusterWithDiscoveryTest.java
@@ -18,15 +18,15 @@ package org.apache.activemq.artemis.tests.integration.cluster.distribution;
 
 
 import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 
 public class SymmetricClusterWithDiscoveryTest extends SymmetricClusterTest
 {
    private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER;
 
-   protected final String groupAddress = UnitTestCase.getUDPDiscoveryAddress();
+   protected final String groupAddress = ServiceTestBase.getUDPDiscoveryAddress();
 
-   protected final int groupPort = UnitTestCase.getUDPDiscoveryPort();
+   protected final int groupPort = ServiceTestBase.getUDPDiscoveryPort();
 
    protected boolean isNetty()
    {

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/AutomaticColocatedQuorumVoteTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/AutomaticColocatedQuorumVoteTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/AutomaticColocatedQuorumVoteTest.java
index 07f749a..d251954 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/AutomaticColocatedQuorumVoteTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/AutomaticColocatedQuorumVoteTest.java
@@ -330,7 +330,11 @@ public class AutomaticColocatedQuorumVoteTest extends ServiceTestBase
          transportConfigurationList.add(otherLiveNode.getName());
          haPolicy.getExcludedConnectors().add(otherLiveNode.getName());
       }
-      configuration.addClusterConfiguration(basicClusterConnectionConfig(liveConnector.getName(), transportConfigurationList));
+
+      String[] input = new String[transportConfigurationList.size()];
+      transportConfigurationList.toArray(input);
+
+      configuration.addClusterConfiguration(basicClusterConnectionConfig(liveConnector.getName(), input));
       haPolicy.setBackupPortOffset(100);
       haPolicy.setBackupRequestRetries(-1);
       haPolicy.setBackupRequestRetryInterval(500);

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/BackupSyncLargeMessageTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/BackupSyncLargeMessageTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/BackupSyncLargeMessageTest.java
index 3e66bb9..386c306 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/BackupSyncLargeMessageTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/BackupSyncLargeMessageTest.java
@@ -18,7 +18,7 @@ package org.apache.activemq.artemis.tests.integration.cluster.failover;
 
 import org.apache.activemq.artemis.api.core.ActiveMQBuffer;
 import org.apache.activemq.artemis.api.core.ActiveMQException;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.junit.Test;
 
 import java.io.File;
@@ -130,7 +130,7 @@ public class BackupSyncLargeMessageTest extends BackupSyncJournalTest
       final ClientProducer producer = session.createProducer(FailoverTestBase.ADDRESS);
       final ClientMessage message = session.createMessage(true);
       final int largeMessageSize = 1000 * MIN_LARGE_MESSAGE;
-      message.setBodyInputStream(UnitTestCase.createFakeLargeStream(largeMessageSize));
+      message.setBodyInputStream(ServiceTestBase.createFakeLargeStream(largeMessageSize));
 
       final AtomicBoolean caughtException = new AtomicBoolean(false);
       final CountDownLatch latch = new CountDownLatch(1);
@@ -162,7 +162,7 @@ public class BackupSyncLargeMessageTest extends BackupSyncJournalTest
       Executors.defaultThreadFactory().newThread(r).start();
       waitForLatch(latch);
       startBackupFinishSyncing();
-      UnitTestCase.waitForLatch(latch2);
+      ServiceTestBase.waitForLatch(latch2);
       crash(session);
       assertFalse("no exceptions while sending message", caughtException.get());
 
@@ -174,7 +174,7 @@ public class BackupSyncLargeMessageTest extends BackupSyncJournalTest
       for (int j = 0; j < largeMessageSize; j++)
       {
          Assert.assertTrue("large msg , expecting " + largeMessageSize + " bytes, got " + j, buffer.readable());
-         Assert.assertEquals("equal at " + j, UnitTestCase.getSamplebyte(j), buffer.readByte());
+         Assert.assertEquals("equal at " + j, ServiceTestBase.getSamplebyte(j), buffer.readByte());
       }
       receiveMessages(consumer, 0, 20, true);
       assertNull("there should be no more messages!", consumer.receiveImmediate());

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/FailoverTestBase.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/FailoverTestBase.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/FailoverTestBase.java
index a93a6f2..fbc6cd0 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/FailoverTestBase.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/FailoverTestBase.java
@@ -16,26 +16,15 @@
  */
 package org.apache.activemq.artemis.tests.integration.cluster.failover;
 
-import java.io.IOException;
-import java.net.ServerSocket;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.TimeUnit;
-
 import org.apache.activemq.artemis.api.core.ActiveMQBuffer;
 import org.apache.activemq.artemis.api.core.SimpleString;
 import org.apache.activemq.artemis.api.core.TransportConfiguration;
+import org.apache.activemq.artemis.api.core.client.ActiveMQClient;
 import org.apache.activemq.artemis.api.core.client.ClientMessage;
 import org.apache.activemq.artemis.api.core.client.ClientSession;
 import org.apache.activemq.artemis.api.core.client.ClusterTopologyListener;
-import org.apache.activemq.artemis.api.core.client.ActiveMQClient;
 import org.apache.activemq.artemis.api.core.client.ServerLocator;
 import org.apache.activemq.artemis.api.core.client.TopologyMember;
-import org.apache.activemq.artemis.tests.integration.cluster.util.TestableServer;
-import org.apache.activemq.artemis.tests.util.ReplicatedBackupUtils;
-import org.apache.activemq.artemis.tests.util.ServiceTestBase;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
 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.ClusterConnectionConfiguration;
@@ -50,10 +39,20 @@ import org.apache.activemq.artemis.core.server.cluster.ha.ReplicatedPolicy;
 import org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl;
 import org.apache.activemq.artemis.core.server.impl.InVMNodeManager;
 import org.apache.activemq.artemis.tests.integration.cluster.util.SameProcessActiveMQServer;
+import org.apache.activemq.artemis.tests.integration.cluster.util.TestableServer;
+import org.apache.activemq.artemis.tests.util.ReplicatedBackupUtils;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.junit.After;
 import org.junit.Assert;
 import org.junit.Before;
 
+import java.io.IOException;
+import java.net.ServerSocket;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
+
 public abstract class FailoverTestBase extends ServiceTestBase
 {
    // Constants -----------------------------------------------------
@@ -143,7 +142,7 @@ public abstract class FailoverTestBase extends ServiceTestBase
    {
       try
       {
-         message.setBodyInputStream(UnitTestCase.createFakeLargeStream(LARGE_MESSAGE_SIZE));
+         message.setBodyInputStream(ServiceTestBase.createFakeLargeStream(LARGE_MESSAGE_SIZE));
       }
       catch (Exception e)
       {
@@ -164,7 +163,7 @@ public abstract class FailoverTestBase extends ServiceTestBase
       for (int j = 0; j < LARGE_MESSAGE_SIZE; j++)
       {
          Assert.assertTrue("msg " + i + ", expecting " + LARGE_MESSAGE_SIZE + " bytes, got " + j, buffer.readable());
-         Assert.assertEquals("equal at " + j, UnitTestCase.getSamplebyte(j), buffer.readByte());
+         Assert.assertEquals("equal at " + j, ServiceTestBase.getSamplebyte(j), buffer.readByte());
       }
    }
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/LiveToLiveFailoverTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/LiveToLiveFailoverTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/LiveToLiveFailoverTest.java
index 16647e9..ed99b57 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/LiveToLiveFailoverTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/LiveToLiveFailoverTest.java
@@ -32,6 +32,7 @@ import org.apache.activemq.artemis.tests.util.TransportConfigurationUtils;
 import org.junit.Assert;
 import org.junit.Test;
 
+import java.util.HashMap;
 import java.util.Map;
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.TimeUnit;
@@ -56,7 +57,7 @@ public class LiveToLiveFailoverTest extends FailoverTest
       TransportConfiguration liveConnector0 = getConnectorTransportConfiguration(true, 0);
       TransportConfiguration liveConnector1 = getConnectorTransportConfiguration(true, 1);
 
-      backupConfig = super.createDefaultConfig(1)
+      backupConfig = super.createDefaultConfig(1, new HashMap<String, Object>(), INVM_ACCEPTOR_FACTORY)
          .clearAcceptorConfigurations()
          .addAcceptorConfiguration(getAcceptorTransportConfiguration(true, 1))
          .setHAPolicyConfiguration(new ColocatedPolicyConfiguration()
@@ -72,7 +73,7 @@ public class LiveToLiveFailoverTest extends FailoverTest
 
       backupServer = createColocatedTestableServer(backupConfig, nodeManager1, nodeManager0, 1);
 
-      liveConfig = super.createDefaultConfig(0)
+      liveConfig = super.createDefaultConfig(0, new HashMap<String, Object>(), INVM_ACCEPTOR_FACTORY)
          .clearAcceptorConfigurations()
          .addAcceptorConfiguration(getAcceptorTransportConfiguration(true, 0))
          .setHAPolicyConfiguration(new ColocatedPolicyConfiguration()

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/MultipleLivesMultipleBackupsFailoverTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/MultipleLivesMultipleBackupsFailoverTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/MultipleLivesMultipleBackupsFailoverTest.java
index 5e1b641..3c6c2d7 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/MultipleLivesMultipleBackupsFailoverTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/MultipleLivesMultipleBackupsFailoverTest.java
@@ -33,9 +33,7 @@ import org.apache.activemq.artemis.tests.integration.cluster.util.TestableServer
 import org.junit.After;
 import org.junit.Test;
 
-import java.util.ArrayList;
 import java.util.HashMap;
-import java.util.List;
 import java.util.Map;
 
 /**
@@ -177,12 +175,12 @@ public class MultipleLivesMultipleBackupsFailoverTest extends MultipleBackupsFai
       TransportConfiguration backupConnector = createTransportConfiguration(isNetty(), false, generateParams(nodeid, isNetty()));
       config1.addConnectorConfiguration(backupConnector.getName(), backupConnector);
 
-      List<String> clusterNodes = new ArrayList<String>();
-      for (int node : otherClusterNodes)
+      String[] clusterNodes = new String[otherClusterNodes.length];
+      for (int i = 0; i < otherClusterNodes.length; i++)
       {
-         TransportConfiguration connector = createTransportConfiguration(isNetty(), false, generateParams(node, isNetty()));
+         TransportConfiguration connector = createTransportConfiguration(isNetty(), false, generateParams(otherClusterNodes[i], isNetty()));
          config1.addConnectorConfiguration(connector.getName(), connector);
-         clusterNodes.add(connector.getName());
+         clusterNodes[i] = connector.getName();
       }
       config1.addClusterConfiguration(basicClusterConnectionConfig(backupConnector.getName(), clusterNodes));
 
@@ -204,12 +202,12 @@ public class MultipleLivesMultipleBackupsFailoverTest extends MultipleBackupsFai
          .setLargeMessagesDirectory(getLargeMessagesDir() + "_" + liveNode)
          .addConnectorConfiguration(liveConnector.getName(), liveConnector);
 
-      List<String> pairs = new ArrayList<String>();
-      for (int node : otherLiveNodes)
+      String[] pairs = new String[otherLiveNodes.length];
+      for (int i = 0; i < otherLiveNodes.length; i++)
       {
-         TransportConfiguration otherLiveConnector = createTransportConfiguration(isNetty(), false, generateParams(node, isNetty()));
+         TransportConfiguration otherLiveConnector = createTransportConfiguration(isNetty(), false, generateParams(otherLiveNodes[i], isNetty()));
          config0.addConnectorConfiguration(otherLiveConnector.getName(), otherLiveConnector);
-         pairs.add(otherLiveConnector.getName());
+         pairs[i] = otherLiveConnector.getName();
       }
       config0.addClusterConfiguration(basicClusterConnectionConfig(liveConnector.getName(), pairs));
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/MultipleServerFailoverTestBase.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/MultipleServerFailoverTestBase.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/MultipleServerFailoverTestBase.java
index 86c1b9b..f4ca1c6 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/MultipleServerFailoverTestBase.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/MultipleServerFailoverTestBase.java
@@ -129,7 +129,9 @@ public abstract class MultipleServerFailoverTestBase extends ServiceTestBase
             }
          }
 
-         configuration.addClusterConfiguration(basicClusterConnectionConfig(livetc.getName(), connectors));
+         String[] input = new String[connectors.size()];
+         connectors.toArray(input);
+         configuration.addClusterConfiguration(basicClusterConnectionConfig(livetc.getName(), input));
          liveConfigs.add(configuration);
          ActiveMQServer server = createServer(true, configuration);
          TestableServer activeMQServer = new SameProcessActiveMQServer(server);
@@ -190,7 +192,9 @@ public abstract class MultipleServerFailoverTestBase extends ServiceTestBase
                connectors.add(staticTc.getName());
             }
          }
-         configuration.addClusterConfiguration(basicClusterConnectionConfig(backuptc.getName(), connectors));
+         String[] input = new String[connectors.size()];
+         connectors.toArray(input);
+         configuration.addClusterConfiguration(basicClusterConnectionConfig(backuptc.getName(), input));
          backupConfigs.add(configuration);
          ActiveMQServer server = createServer(true, configuration);
          TestableServer testableServer = new SameProcessActiveMQServer(server);

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/QuorumVoteServerConnectTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/QuorumVoteServerConnectTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/QuorumVoteServerConnectTest.java
index d6631ec..93d3f17 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/QuorumVoteServerConnectTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/QuorumVoteServerConnectTest.java
@@ -17,7 +17,7 @@
 package org.apache.activemq.artemis.tests.integration.cluster.failover;
 
 
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.apache.activemq.artemis.core.server.cluster.qourum.BooleanVote;
 import org.apache.activemq.artemis.core.server.cluster.qourum.QuorumVoteServerConnect;
 import org.apache.activemq.artemis.tests.integration.server.FakeStorageManager;
@@ -29,7 +29,7 @@ import java.util.Arrays;
 import java.util.Collection;
 
 @RunWith(Parameterized.class)
-public class QuorumVoteServerConnectTest extends UnitTestCase
+public class QuorumVoteServerConnectTest extends ServiceTestBase
 {
 
    private final int size;

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/SingleLiveMultipleBackupsFailoverTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/SingleLiveMultipleBackupsFailoverTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/SingleLiveMultipleBackupsFailoverTest.java
index f0a34af..efed080 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/SingleLiveMultipleBackupsFailoverTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/SingleLiveMultipleBackupsFailoverTest.java
@@ -33,9 +33,7 @@ import org.apache.activemq.artemis.tests.integration.cluster.util.TestableServer
 import org.junit.After;
 import org.junit.Test;
 
-import java.util.ArrayList;
 import java.util.HashMap;
-import java.util.List;
 import java.util.Map;
 
 /**
@@ -146,13 +144,12 @@ public class SingleLiveMultipleBackupsFailoverTest extends MultipleBackupsFailov
          .setPagingDirectory(getPageDir() + "_" + liveNode)
          .setLargeMessagesDirectory(getLargeMessagesDir() + "_" + liveNode);
 
-      List<String> staticConnectors = new ArrayList<String>();
-
-      for (int node : nodes)
+      String[] staticConnectors = new String[nodes.length];
+      for (int i = 0; i < nodes.length; i++)
       {
-         TransportConfiguration liveConnector = createTransportConfiguration(isNetty(), false, generateParams(node, isNetty()));
+         TransportConfiguration liveConnector = createTransportConfiguration(isNetty(), false, generateParams(nodes[i], isNetty()));
          config1.addConnectorConfiguration(liveConnector.getName(), liveConnector);
-         staticConnectors.add(liveConnector.getName());
+         staticConnectors[i] = liveConnector.getName();
       }
       config1.addClusterConfiguration(basicClusterConnectionConfig(backupConnector.getName(), staticConnectors));
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/reattach/MultiThreadRandomReattachTestBase.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/reattach/MultiThreadRandomReattachTestBase.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/reattach/MultiThreadRandomReattachTestBase.java
index c23177b..65fb198 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/reattach/MultiThreadRandomReattachTestBase.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/reattach/MultiThreadRandomReattachTestBase.java
@@ -17,7 +17,7 @@
 package org.apache.activemq.artemis.tests.integration.cluster.reattach;
 import org.apache.activemq.artemis.api.core.ActiveMQException;
 import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.junit.Before;
 import org.junit.After;
 
@@ -1277,7 +1277,7 @@ public abstract class MultiThreadRandomReattachTestBase extends MultiThreadReatt
    @After
    public void tearDown() throws Exception
    {
-      UnitTestCase.stopComponent(liveServer);
+      ServiceTestBase.stopComponent(liveServer);
 
       liveServer = null;
 
@@ -1317,7 +1317,7 @@ public abstract class MultiThreadRandomReattachTestBase extends MultiThreadReatt
    @Override
    protected void stop() throws Exception
    {
-      UnitTestCase.stopComponent(liveServer);
+      ServiceTestBase.stopComponent(liveServer);
 
       System.gc();
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/reattach/MultiThreadReattachSupportTestBase.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/reattach/MultiThreadReattachSupportTestBase.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/reattach/MultiThreadReattachSupportTestBase.java
index 7c5ac0a..cb6c3ad 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/reattach/MultiThreadReattachSupportTestBase.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/reattach/MultiThreadReattachSupportTestBase.java
@@ -15,17 +15,8 @@
  * limitations under the License.
  */
 package org.apache.activemq.artemis.tests.integration.cluster.reattach;
-import org.apache.activemq.artemis.api.core.ActiveMQNotConnectedException;
-import org.junit.Before;
-import org.junit.After;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Timer;
-import java.util.TimerTask;
-
-import org.junit.Assert;
 
+import org.apache.activemq.artemis.api.core.ActiveMQNotConnectedException;
 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;
@@ -35,7 +26,14 @@ import org.apache.activemq.artemis.core.protocol.core.impl.RemotingConnectionImp
 import org.apache.activemq.artemis.core.remoting.impl.invm.InVMConnector;
 import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger;
 import org.apache.activemq.artemis.tests.util.ServiceTestBase;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.junit.After;
+import org.junit.Assert;
+import org.junit.Before;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Timer;
+import java.util.TimerTask;
 
 public abstract class MultiThreadReattachSupportTestBase extends ServiceTestBase
 {
@@ -122,7 +120,7 @@ public abstract class MultiThreadReattachSupportTestBase extends ServiceTestBase
 
                   // Case a failure happened here, it should print the Thread dump
                   // Sending it to System.out, as it would show on the Tests report
-                  System.out.println(UnitTestCase.threadDump(" - fired by MultiThreadRandomReattachTestBase::runTestMultipleThreads (" + t.getLocalizedMessage() +
+                  System.out.println(ServiceTestBase.threadDump(" - fired by MultiThreadRandomReattachTestBase::runTestMultipleThreads (" + t.getLocalizedMessage() +
                                                              ")"));
                }
             }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/reattach/RandomReattachTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/reattach/RandomReattachTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/reattach/RandomReattachTest.java
index 18acd07..bc573c4 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/reattach/RandomReattachTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/reattach/RandomReattachTest.java
@@ -16,29 +16,18 @@
  */
 package org.apache.activemq.artemis.tests.integration.cluster.reattach;
 
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.Set;
-import java.util.Timer;
-import java.util.TimerTask;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.TimeUnit;
-
 import org.apache.activemq.artemis.api.core.ActiveMQException;
 import org.apache.activemq.artemis.api.core.ActiveMQNotConnectedException;
 import org.apache.activemq.artemis.api.core.SimpleString;
 import org.apache.activemq.artemis.api.core.TransportConfiguration;
+import org.apache.activemq.artemis.api.core.client.ActiveMQClient;
 import org.apache.activemq.artemis.api.core.client.ClientConsumer;
 import org.apache.activemq.artemis.api.core.client.ClientMessage;
 import org.apache.activemq.artemis.api.core.client.ClientProducer;
 import org.apache.activemq.artemis.api.core.client.ClientSession;
 import org.apache.activemq.artemis.api.core.client.ClientSessionFactory;
-import org.apache.activemq.artemis.api.core.client.ActiveMQClient;
 import org.apache.activemq.artemis.api.core.client.MessageHandler;
 import org.apache.activemq.artemis.api.core.client.ServerLocator;
-import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger;
-import org.apache.activemq.artemis.tests.util.ServiceTestBase;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
 import org.apache.activemq.artemis.core.client.impl.ClientSessionFactoryImpl;
 import org.apache.activemq.artemis.core.client.impl.ClientSessionInternal;
 import org.apache.activemq.artemis.core.config.Configuration;
@@ -46,12 +35,22 @@ import org.apache.activemq.artemis.core.remoting.impl.invm.InVMRegistry;
 import org.apache.activemq.artemis.core.server.ActiveMQServer;
 import org.apache.activemq.artemis.core.server.ActiveMQServers;
 import org.apache.activemq.artemis.jms.client.ActiveMQTextMessage;
+import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.junit.After;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
 
-public class RandomReattachTest extends UnitTestCase
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.Timer;
+import java.util.TimerTask;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
+
+public class RandomReattachTest extends ServiceTestBase
 {
    private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER;
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/topology/IsolatedTopologyTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/topology/IsolatedTopologyTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/topology/IsolatedTopologyTest.java
index ba2b163..e27e103 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/topology/IsolatedTopologyTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/topology/IsolatedTopologyTest.java
@@ -16,23 +16,22 @@
  */
 package org.apache.activemq.artemis.tests.integration.cluster.topology;
 
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
 import org.apache.activemq.artemis.api.core.TransportConfiguration;
-import org.apache.activemq.artemis.tests.util.ServiceTestBase;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
 import org.apache.activemq.artemis.core.client.impl.Topology;
 import org.apache.activemq.artemis.core.client.impl.TopologyMemberImpl;
 import org.apache.activemq.artemis.core.config.ClusterConnectionConfiguration;
 import org.apache.activemq.artemis.core.config.Configuration;
 import org.apache.activemq.artemis.core.remoting.impl.netty.TransportConstants;
 import org.apache.activemq.artemis.core.server.ActiveMQServer;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.junit.Assert;
 import org.junit.Test;
 
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
 public class IsolatedTopologyTest extends ServiceTestBase
 {
 
@@ -109,7 +108,7 @@ public class IsolatedTopologyTest extends ServiceTestBase
       params.put(TransportConstants.CLUSTER_CONNECTION, "cc1");
       params.put(org.apache.activemq.artemis.core.remoting.impl.invm.TransportConstants.SERVER_ID_PROP_NAME, "1");
 
-      TransportConfiguration acceptor1VM1 = new TransportConfiguration(UnitTestCase.INVM_ACCEPTOR_FACTORY,
+      TransportConfiguration acceptor1VM1 = new TransportConfiguration(ServiceTestBase.INVM_ACCEPTOR_FACTORY,
                                                                        params,
                                                                        "acceptor-cc1");
 
@@ -117,7 +116,7 @@ public class IsolatedTopologyTest extends ServiceTestBase
       params.put(TransportConstants.CLUSTER_CONNECTION, "cc2");
       params.put(org.apache.activemq.artemis.core.remoting.impl.invm.TransportConstants.SERVER_ID_PROP_NAME, "2");
 
-      TransportConfiguration acceptor2VM1 = new TransportConfiguration(UnitTestCase.INVM_ACCEPTOR_FACTORY,
+      TransportConfiguration acceptor2VM1 = new TransportConfiguration(ServiceTestBase.INVM_ACCEPTOR_FACTORY,
                                                                        params,
                                                                        "acceptor-cc2");
 
@@ -166,7 +165,7 @@ public class IsolatedTopologyTest extends ServiceTestBase
       params.put(TransportConstants.CLUSTER_CONNECTION, "cc1");
       params.put(org.apache.activemq.artemis.core.remoting.impl.invm.TransportConstants.SERVER_ID_PROP_NAME, "3");
 
-      TransportConfiguration acceptor1VM1 = new TransportConfiguration(UnitTestCase.INVM_ACCEPTOR_FACTORY,
+      TransportConfiguration acceptor1VM1 = new TransportConfiguration(ServiceTestBase.INVM_ACCEPTOR_FACTORY,
                                                                        params,
                                                                        "acceptor-cc1");
 
@@ -174,7 +173,7 @@ public class IsolatedTopologyTest extends ServiceTestBase
       params.put(TransportConstants.CLUSTER_CONNECTION, "cc2");
       params.put(org.apache.activemq.artemis.core.remoting.impl.invm.TransportConstants.SERVER_ID_PROP_NAME, "4");
 
-      TransportConfiguration acceptor2VM1 = new TransportConfiguration(UnitTestCase.INVM_ACCEPTOR_FACTORY,
+      TransportConfiguration acceptor2VM1 = new TransportConfiguration(ServiceTestBase.INVM_ACCEPTOR_FACTORY,
                                                                        params,
                                                                        "acceptor-cc2");
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/topology/TopologyClusterTestBase.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/topology/TopologyClusterTestBase.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/topology/TopologyClusterTestBase.java
index 6388083..54c3734 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/topology/TopologyClusterTestBase.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/topology/TopologyClusterTestBase.java
@@ -16,11 +16,6 @@
  */
 package org.apache.activemq.artemis.tests.integration.cluster.topology;
 
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.CountDownLatch;
-
 import org.apache.activemq.artemis.api.core.ActiveMQException;
 import org.apache.activemq.artemis.api.core.ActiveMQExceptionType;
 import org.apache.activemq.artemis.api.core.ActiveMQObjectClosedException;
@@ -32,21 +27,25 @@ import org.apache.activemq.artemis.api.core.client.ClientSessionFactory;
 import org.apache.activemq.artemis.api.core.client.ClusterTopologyListener;
 import org.apache.activemq.artemis.api.core.client.ServerLocator;
 import org.apache.activemq.artemis.api.core.client.TopologyMember;
-import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger;
-import org.apache.activemq.artemis.tests.integration.cluster.distribution.ClusterTestBase;
-import org.apache.activemq.artemis.tests.util.ServiceTestBase;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
 import org.apache.activemq.artemis.core.client.impl.ServerLocatorImpl;
 import org.apache.activemq.artemis.core.config.Configuration;
 import org.apache.activemq.artemis.core.server.ActiveMQServer;
 import org.apache.activemq.artemis.core.server.cluster.ClusterConnection;
 import org.apache.activemq.artemis.core.server.cluster.ClusterManager;
+import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger;
+import org.apache.activemq.artemis.tests.integration.cluster.distribution.ClusterTestBase;
 import org.apache.activemq.artemis.tests.util.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;
 
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.CountDownLatch;
+
 import static java.util.concurrent.TimeUnit.SECONDS;
 
 public abstract class TopologyClusterTestBase extends ClusterTestBase
@@ -396,7 +395,7 @@ public abstract class TopologyClusterTestBase extends ClusterTestBase
             s.getConfiguration().setSecurityEnabled(true);
          }
       }
-      Assert.assertEquals(UnitTestCase.CLUSTER_PASSWORD, config.getClusterPassword());
+      Assert.assertEquals(ServiceTestBase.CLUSTER_PASSWORD, config.getClusterPassword());
       config.setClusterPassword(config.getClusterPassword() + "-1-2-3-");
       startServers(0, 1, 2, 4, 3);
       int n = 0;
@@ -412,7 +411,7 @@ public abstract class TopologyClusterTestBase extends ClusterTestBase
       final String address = "foo1235";
       ServerLocator locator = createNonHALocator(isNetty());
       ClientSessionFactory sf = createSessionFactory(locator);
-      ClientSession session = sf.createSession(config.getClusterUser(), UnitTestCase.CLUSTER_PASSWORD, false, true, true, false, 1);
+      ClientSession session = sf.createSession(config.getClusterUser(), ServiceTestBase.CLUSTER_PASSWORD, false, true, true, false, 1);
       session.createQueue(address, address, true);
       ClientProducer producer = session.createProducer(address);
       sendMessages(session, producer, 100);

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/discovery/DiscoveryBaseTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/discovery/DiscoveryBaseTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/discovery/DiscoveryBaseTest.java
index bf610a3..0cc4e4c 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/discovery/DiscoveryBaseTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/discovery/DiscoveryBaseTest.java
@@ -28,7 +28,7 @@ import org.apache.activemq.artemis.api.core.SimpleString;
 import org.apache.activemq.artemis.api.core.TransportConfiguration;
 import org.apache.activemq.artemis.api.core.UDPBroadcastEndpointFactory;
 import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.apache.activemq.artemis.core.cluster.DiscoveryEntry;
 import org.apache.activemq.artemis.core.cluster.DiscoveryGroup;
 import org.apache.activemq.artemis.core.cluster.DiscoveryListener;
@@ -39,7 +39,7 @@ import org.apache.activemq.artemis.core.server.management.NotificationService;
 import org.apache.activemq.artemis.utils.UUIDGenerator;
 import org.junit.Assert;
 
-public class DiscoveryBaseTest extends UnitTestCase
+public class DiscoveryBaseTest extends ServiceTestBase
 {
    protected static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER;
 


[05/13] activemq-artemis git commit: Refactor base test classes

Posted by an...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/divert/PersistentDivertTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/divert/PersistentDivertTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/divert/PersistentDivertTest.java
index 7d46b2e..fa3d076 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/divert/PersistentDivertTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/divert/PersistentDivertTest.java
@@ -16,27 +16,24 @@
  */
 package org.apache.activemq.artemis.tests.integration.divert;
 
-import org.apache.activemq.artemis.tests.util.ServiceTestBase;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
-import org.junit.Test;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.junit.Assert;
-
 import org.apache.activemq.artemis.api.core.SimpleString;
+import org.apache.activemq.artemis.api.core.client.ActiveMQClient;
 import org.apache.activemq.artemis.api.core.client.ClientConsumer;
 import org.apache.activemq.artemis.api.core.client.ClientMessage;
 import org.apache.activemq.artemis.api.core.client.ClientProducer;
 import org.apache.activemq.artemis.api.core.client.ClientSession;
 import org.apache.activemq.artemis.api.core.client.ClientSessionFactory;
-import org.apache.activemq.artemis.api.core.client.ActiveMQClient;
 import org.apache.activemq.artemis.api.core.client.ServerLocator;
 import org.apache.activemq.artemis.core.config.Configuration;
 import org.apache.activemq.artemis.core.config.DivertConfiguration;
 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.Assert;
+import org.junit.Test;
+
+import java.util.ArrayList;
+import java.util.List;
 
 public class PersistentDivertTest extends ServiceTestBase
 {
@@ -144,7 +141,7 @@ public class PersistentDivertTest extends ServiceTestBase
 
          if (largeMessage)
          {
-            message.setBodyInputStream(UnitTestCase.createFakeLargeStream(minLargeMessageSize));
+            message.setBodyInputStream(ServiceTestBase.createFakeLargeStream(minLargeMessageSize));
          }
 
          message.putIntProperty(propKey, i);
@@ -235,7 +232,7 @@ public class PersistentDivertTest extends ServiceTestBase
    {
       for (int j = 0; j < minLargeMessageSize; j++)
       {
-         Assert.assertEquals(UnitTestCase.getSamplebyte(j), message.getBodyBuffer().readByte());
+         Assert.assertEquals(ServiceTestBase.getSamplebyte(j), message.getBodyBuffer().readByte());
       }
    }
 
@@ -332,7 +329,7 @@ public class PersistentDivertTest extends ServiceTestBase
 
          if (largeMessage)
          {
-            message.setBodyInputStream(UnitTestCase.createFakeLargeStream(minLargeMessageSize));
+            message.setBodyInputStream(ServiceTestBase.createFakeLargeStream(minLargeMessageSize));
          }
 
          producer.send(message);

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/embedded/ValidateAIOTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/embedded/ValidateAIOTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/embedded/ValidateAIOTest.java
index 81e9f74..afc2129 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/embedded/ValidateAIOTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/embedded/ValidateAIOTest.java
@@ -32,7 +32,7 @@ public class ValidateAIOTest extends ServiceTestBase
    @Test
    public void testValidateAIO() throws Exception
    {
-      Configuration config = createDefaultConfig(false)
+      Configuration config = createDefaultConfig()
          // This will force AsyncIO
          .setJournalType(JournalType.ASYNCIO);
       ActiveMQServer server = ActiveMQServers.newActiveMQServer(config, true);

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/http/CoreClientOverHttpTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/http/CoreClientOverHttpTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/http/CoreClientOverHttpTest.java
index 485a28a..611bcb5 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/http/CoreClientOverHttpTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/http/CoreClientOverHttpTest.java
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 package org.apache.activemq.artemis.tests.integration.http;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.junit.Before;
 
 import org.junit.Test;
@@ -40,7 +40,7 @@ import org.apache.activemq.artemis.core.server.ActiveMQServer;
 import org.apache.activemq.artemis.core.server.ActiveMQServers;
 import org.apache.activemq.artemis.jms.client.ActiveMQTextMessage;
 
-public class CoreClientOverHttpTest extends UnitTestCase
+public class CoreClientOverHttpTest extends ServiceTestBase
 {
    private static final SimpleString QUEUE = new SimpleString("CoreClientOverHttpTestQueue");
    private Configuration conf;

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/ActiveMQConnectionFactoryTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/ActiveMQConnectionFactoryTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/ActiveMQConnectionFactoryTest.java
index e4d1898..15d1428 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/ActiveMQConnectionFactoryTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/ActiveMQConnectionFactoryTest.java
@@ -16,7 +16,7 @@
  */
 package org.apache.activemq.artemis.tests.integration.jms;
 import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.apache.activemq.artemis.core.config.ha.SharedStoreMasterPolicyConfiguration;
 import org.junit.Before;
 
@@ -50,7 +50,7 @@ import org.apache.activemq.artemis.tests.util.RandomUtil;
  *
  * A ActiveMQConnectionFactoryTest
  */
-public class ActiveMQConnectionFactoryTest extends UnitTestCase
+public class ActiveMQConnectionFactoryTest extends ServiceTestBase
 {
    private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER;
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/FloodServerTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/FloodServerTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/FloodServerTest.java
index 7603397..68f93d2 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/FloodServerTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/FloodServerTest.java
@@ -45,13 +45,13 @@ import org.apache.activemq.artemis.core.server.ActiveMQServer;
 import org.apache.activemq.artemis.core.server.ActiveMQServers;
 import org.apache.activemq.artemis.jms.server.impl.JMSServerManagerImpl;
 import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 
 /**
  *
  * A FloodServerTest
  */
-public class FloodServerTest extends UnitTestCase
+public class FloodServerTest extends ServiceTestBase
 {
    // Constants -----------------------------------------------------
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/SimpleJNDIClientTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/SimpleJNDIClientTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/SimpleJNDIClientTest.java
index 73cc9f6..ed0c9bb 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/SimpleJNDIClientTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/SimpleJNDIClientTest.java
@@ -40,7 +40,7 @@ import org.apache.activemq.artemis.api.core.JGroupsPropertiesBroadcastEndpointFa
 import org.apache.activemq.artemis.api.core.TransportConfiguration;
 import org.apache.activemq.artemis.api.core.UDPBroadcastEndpointFactory;
 import org.apache.activemq.artemis.api.jms.JMSFactoryType;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+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.netty.TransportConstants;
@@ -56,7 +56,7 @@ import org.junit.Test;
  *
  * A ActiveMQConnectionFactoryTest
  */
-public class SimpleJNDIClientTest extends UnitTestCase
+public class SimpleJNDIClientTest extends ServiceTestBase
 {
    private final String groupAddress = getUDPDiscoveryAddress();
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/ReSendMessageTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/ReSendMessageTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/ReSendMessageTest.java
index 2f70bf3..fb6f125 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/ReSendMessageTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/ReSendMessageTest.java
@@ -34,7 +34,7 @@ import org.apache.activemq.artemis.api.core.client.ActiveMQClient;
 import org.apache.activemq.artemis.api.jms.ActiveMQJMSConstants;
 import org.apache.activemq.artemis.api.jms.JMSFactoryType;
 import org.apache.activemq.artemis.tests.util.JMSTestBase;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.junit.After;
 import org.junit.Assert;
 import org.junit.Before;
@@ -71,7 +71,7 @@ public class ReSendMessageTest extends JMSTestBase
       {
          BytesMessage bm = sess.createBytesMessage();
          bm.setObjectProperty(ActiveMQJMSConstants.JMS_ACTIVEMQ_INPUT_STREAM,
-                              UnitTestCase.createFakeLargeStream(2 * ActiveMQClient.DEFAULT_MIN_LARGE_MESSAGE_SIZE));
+                              ServiceTestBase.createFakeLargeStream(2 * ActiveMQClient.DEFAULT_MIN_LARGE_MESSAGE_SIZE));
          msgs.add(bm);
 
          MapMessage mm = sess.createMapMessage();
@@ -168,7 +168,7 @@ public class ReSendMessageTest extends JMSTestBase
 
             for (int i = 0; i < copiedBytes.getBodyLength(); i++)
             {
-               Assert.assertEquals(UnitTestCase.getSamplebyte(i), copiedBytes.readByte());
+               Assert.assertEquals(ServiceTestBase.getSamplebyte(i), copiedBytes.readByte());
             }
          }
          else if (copiedMessage instanceof MapMessage)

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/JMSReconnectTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/JMSReconnectTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/JMSReconnectTest.java
index 4434ea0..f991245 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/JMSReconnectTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/JMSReconnectTest.java
@@ -17,7 +17,7 @@
 package org.apache.activemq.artemis.tests.integration.jms.cluster;
 import org.apache.activemq.artemis.api.core.ActiveMQException;
 import org.apache.activemq.artemis.api.core.ActiveMQNotConnectedException;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.junit.Before;
 import org.junit.After;
 
@@ -54,7 +54,7 @@ import org.apache.activemq.artemis.jms.client.ActiveMQSession;
 import org.apache.activemq.artemis.spi.core.protocol.RemotingConnection;
 import org.apache.activemq.artemis.tests.util.RandomUtil;
 
-public class JMSReconnectTest extends UnitTestCase
+public class JMSReconnectTest extends ServiceTestBase
 {
 
    private ActiveMQServer liveService;

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/connection/CloseConnectionOnGCTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/connection/CloseConnectionOnGCTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/connection/CloseConnectionOnGCTest.java
index 4d25c25..a47eb6a 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/connection/CloseConnectionOnGCTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/connection/CloseConnectionOnGCTest.java
@@ -16,7 +16,7 @@
  */
 package org.apache.activemq.artemis.tests.integration.jms.connection;
 import org.apache.activemq.artemis.tests.util.JMSTestBase;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.junit.Before;
 import org.junit.After;
 
@@ -93,7 +93,7 @@ public class CloseConnectionOnGCTest extends JMSTestBase
 
       conn = null;
 
-      UnitTestCase.checkWeakReferences(wr);
+      ServiceTestBase.checkWeakReferences(wr);
 
       latch.await(5000, TimeUnit.MILLISECONDS);
       Assert.assertEquals(0, server.getRemotingService().getConnections().size());
@@ -130,7 +130,7 @@ public class CloseConnectionOnGCTest extends JMSTestBase
       conn2 = null;
       conn3 = null;
 
-      UnitTestCase.checkWeakReferences(wr1, wr2, wr3);
+      ServiceTestBase.checkWeakReferences(wr1, wr2, wr3);
 
       latch.await(5000, TimeUnit.MILLISECONDS);
 
@@ -174,7 +174,7 @@ public class CloseConnectionOnGCTest extends JMSTestBase
       conn2 = null;
       conn3 = null;
 
-      UnitTestCase.checkWeakReferences(wr1, wr2, wr3);
+      ServiceTestBase.checkWeakReferences(wr1, wr2, wr3);
 
       latch.await(5000, TimeUnit.MILLISECONDS);
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/connection/ExceptionListenerTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/connection/ExceptionListenerTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/connection/ExceptionListenerTest.java
index b89fa13..4f4724c 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/connection/ExceptionListenerTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/connection/ExceptionListenerTest.java
@@ -16,7 +16,7 @@
  */
 package org.apache.activemq.artemis.tests.integration.jms.connection;
 import org.apache.activemq.artemis.api.core.ActiveMQInternalErrorException;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.apache.activemq.artemis.core.registry.JndiBindingRegistry;
 import org.junit.Before;
 import org.junit.After;
@@ -50,7 +50,7 @@ import org.apache.activemq.artemis.tests.integration.jms.server.management.NullI
  *
  * A ExceptionListenerTest
  */
-public class ExceptionListenerTest extends UnitTestCase
+public class ExceptionListenerTest extends ServiceTestBase
 {
    private ActiveMQServer server;
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/largemessage/JMSLargeMessageTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/largemessage/JMSLargeMessageTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/largemessage/JMSLargeMessageTest.java
index 11d40b1..8c63be5 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/largemessage/JMSLargeMessageTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/largemessage/JMSLargeMessageTest.java
@@ -31,7 +31,7 @@ import java.util.concurrent.atomic.AtomicInteger;
 import java.util.concurrent.atomic.AtomicLong;
 
 import org.apache.activemq.artemis.tests.util.JMSTestBase;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.apache.activemq.artemis.utils.UUIDGenerator;
 import org.junit.After;
 import org.junit.Assert;
@@ -86,7 +86,7 @@ public class JMSLargeMessageTest extends JMSTestBase
 
       BytesMessage m = session.createBytesMessage();
 
-      m.setObjectProperty("JMS_AMQ_InputStream", UnitTestCase.createFakeLargeStream(1024 * 1024));
+      m.setObjectProperty("JMS_AMQ_InputStream", ServiceTestBase.createFakeLargeStream(1024 * 1024));
 
       prod.send(m);
 
@@ -112,7 +112,7 @@ public class JMSLargeMessageTest extends JMSTestBase
          Assert.assertEquals(1024, numberOfBytes);
          for (int j = 0; j < 1024; j++)
          {
-            Assert.assertEquals(UnitTestCase.getSamplebyte(i + j), data[j]);
+            Assert.assertEquals(ServiceTestBase.getSamplebyte(i + j), data[j]);
          }
       }
 
@@ -130,7 +130,7 @@ public class JMSLargeMessageTest extends JMSTestBase
 
       BytesMessage m = session.createBytesMessage();
 
-      m.setObjectProperty("JMS_AMQ_InputStream", UnitTestCase.createFakeLargeStream(10));
+      m.setObjectProperty("JMS_AMQ_InputStream", ServiceTestBase.createFakeLargeStream(10));
 
       prod.send(m);
 
@@ -154,7 +154,7 @@ public class JMSLargeMessageTest extends JMSTestBase
       Assert.assertEquals(10, numberOfBytes);
       for (int j = 0; j < numberOfBytes; j++)
       {
-         Assert.assertEquals(UnitTestCase.getSamplebyte(j), data[j]);
+         Assert.assertEquals(ServiceTestBase.getSamplebyte(j), data[j]);
       }
 
       Assert.assertNotNull(rm);
@@ -171,7 +171,7 @@ public class JMSLargeMessageTest extends JMSTestBase
 
       try
       {
-         msg.setObjectProperty("JMS_AMQ_InputStream", UnitTestCase.createFakeLargeStream(10));
+         msg.setObjectProperty("JMS_AMQ_InputStream", ServiceTestBase.createFakeLargeStream(10));
          Assert.fail("Exception was expected");
       }
       catch (JMSException e)
@@ -232,7 +232,7 @@ public class JMSLargeMessageTest extends JMSTestBase
 
       BytesMessage m = session.createBytesMessage();
 
-      m.setObjectProperty("JMS_AMQ_InputStream", UnitTestCase.createFakeLargeStream(msgSize));
+      m.setObjectProperty("JMS_AMQ_InputStream", ServiceTestBase.createFakeLargeStream(msgSize));
 
       prod.send(m);
 
@@ -262,7 +262,7 @@ public class JMSLargeMessageTest extends JMSTestBase
          public void write(final int b) throws IOException
          {
             numberOfBytes.incrementAndGet();
-            if (UnitTestCase.getSamplebyte(position++) != b)
+            if (ServiceTestBase.getSamplebyte(position++) != b)
             {
                System.out.println("Wrong byte at position " + position);
                numberOfErrors.incrementAndGet();
@@ -273,7 +273,7 @@ public class JMSLargeMessageTest extends JMSTestBase
 
       try
       {
-         rm.setObjectProperty("JMS_AMQ_InputStream", UnitTestCase.createFakeLargeStream(100));
+         rm.setObjectProperty("JMS_AMQ_InputStream", ServiceTestBase.createFakeLargeStream(100));
          Assert.fail("Exception expected!");
       }
       catch (MessageNotWriteableException expected)

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/JMSServerStartStopTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/JMSServerStartStopTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/JMSServerStartStopTest.java
index 5699bf2..88c67f7 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/JMSServerStartStopTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/JMSServerStartStopTest.java
@@ -29,7 +29,7 @@ import org.apache.activemq.artemis.api.core.TransportConfiguration;
 import org.apache.activemq.artemis.api.jms.ActiveMQJMSClient;
 import org.apache.activemq.artemis.api.jms.JMSFactoryType;
 import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.apache.activemq.artemis.core.config.FileDeploymentManager;
 import org.apache.activemq.artemis.core.config.impl.FileConfiguration;
 import org.apache.activemq.artemis.core.server.ActiveMQServer;
@@ -44,7 +44,7 @@ import org.junit.After;
 import org.junit.Assert;
 import org.junit.Test;
 
-public class JMSServerStartStopTest extends UnitTestCase
+public class JMSServerStartStopTest extends ServiceTestBase
 {
    private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER;
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/config/JMSConfigurationTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/config/JMSConfigurationTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/config/JMSConfigurationTest.java
index f341af2..048e710 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/config/JMSConfigurationTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/config/JMSConfigurationTest.java
@@ -56,7 +56,7 @@ public class JMSConfigurationTest extends ServiceTestBase
    {
       Context context = new InVMNamingContext();
 
-      Configuration coreConfiguration = createDefaultConfig(false);
+      Configuration coreConfiguration = createDefaultConfig();
       ActiveMQServer coreServer = new ActiveMQServerImpl(coreConfiguration);
 
       JMSConfiguration jmsConfiguration = new JMSConfigurationImpl();

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/management/ConnectionFactoryControlTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/management/ConnectionFactoryControlTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/management/ConnectionFactoryControlTest.java
index 46be23c..d810dbf 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/management/ConnectionFactoryControlTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/management/ConnectionFactoryControlTest.java
@@ -23,7 +23,7 @@ import javax.management.Notification;
 import org.apache.activemq.artemis.tests.integration.management.ManagementControlHelper;
 import org.apache.activemq.artemis.tests.integration.management.ManagementTestBase;
 import org.apache.activemq.artemis.tests.unit.util.InVMNamingContext;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.apache.activemq.artemis.core.registry.JndiBindingRegistry;
 import org.junit.Assert;
 import org.junit.Before;
@@ -155,11 +155,11 @@ public class ConnectionFactoryControlTest extends ManagementTestBase
     */
    protected void startServer() throws Exception
    {
-      Configuration conf = createDefaultConfig(false)
-         .addConnectorConfiguration("invm", new TransportConfiguration(UnitTestCase.INVM_CONNECTOR_FACTORY))
+      Configuration conf = createDefaultConfig()
+         .addConnectorConfiguration("invm", new TransportConfiguration(INVM_CONNECTOR_FACTORY))
          .setSecurityEnabled(false)
          .setJMXManagementEnabled(true)
-         .addAcceptorConfiguration(new TransportConfiguration(UnitTestCase.INVM_ACCEPTOR_FACTORY));
+         .addAcceptorConfiguration(new TransportConfiguration(ServiceTestBase.INVM_ACCEPTOR_FACTORY));
       server = ActiveMQServers.newActiveMQServer(conf, mbeanServer, true);
       server.start();
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/management/JMSQueueControlTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/management/JMSQueueControlTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/management/JMSQueueControlTest.java
index 558480b..6e61753 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/management/JMSQueueControlTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/management/JMSQueueControlTest.java
@@ -1388,7 +1388,8 @@ public class JMSQueueControlTest extends ManagementTestBase
 
       Configuration conf = createBasicConfig()
          .addAcceptorConfiguration(new TransportConfiguration(INVM_ACCEPTOR_FACTORY));
-      server = createServer(this.getName().contains("WithRealData"), conf, mbeanServer);
+      server = createServer(this.getName().contains("WithRealData"), conf);
+      server.setMBeanServer(mbeanServer);
 
       serverManager = new JMSServerManagerImpl(server);
       context = new InVMNamingContext();

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/management/JMSServerControlRestartTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/management/JMSServerControlRestartTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/management/JMSServerControlRestartTest.java
index 014c5c1..9d4c8db 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/management/JMSServerControlRestartTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/management/JMSServerControlRestartTest.java
@@ -32,7 +32,7 @@ import org.apache.activemq.artemis.api.jms.management.JMSServerControl;
 import org.apache.activemq.artemis.tests.integration.management.ManagementControlHelper;
 import org.apache.activemq.artemis.tests.integration.management.ManagementTestBase;
 import org.apache.activemq.artemis.tests.unit.util.InVMNamingContext;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.apache.activemq.artemis.core.config.Configuration;
 import org.apache.activemq.artemis.core.registry.JndiBindingRegistry;
 import org.apache.activemq.artemis.core.remoting.impl.invm.InVMAcceptorFactory;
@@ -61,13 +61,13 @@ public class JMSServerControlRestartTest extends ManagementTestBase
       String queueName = RandomUtil.randomString();
       String binding = RandomUtil.randomString();
 
-      UnitTestCase.checkNoBinding(context, binding);
+      ServiceTestBase.checkNoBinding(context, binding);
       checkNoResource(ObjectNameBuilder.DEFAULT.getJMSQueueObjectName(queueName));
 
       JMSServerControl control = ManagementControlHelper.createJMSServerControl(mbeanServer);
       control.createQueue(queueName, binding);
 
-      Object o = UnitTestCase.checkBinding(context, binding);
+      Object o = ServiceTestBase.checkBinding(context, binding);
       Assert.assertTrue(o instanceof Queue);
       Queue queue = (Queue) o;
       Assert.assertEquals(queueName, queue.getQueueName());
@@ -75,13 +75,13 @@ public class JMSServerControlRestartTest extends ManagementTestBase
 
       serverManager.stop();
 
-      UnitTestCase.checkNoBinding(context, binding);
+      ServiceTestBase.checkNoBinding(context, binding);
       checkNoResource(ObjectNameBuilder.DEFAULT.getJMSQueueObjectName(queueName));
 
       serverManager = createJMSServer();
       serverManager.start();
 
-      o = UnitTestCase.checkBinding(context, binding);
+      o = ServiceTestBase.checkBinding(context, binding);
       Assert.assertTrue(o instanceof Queue);
       queue = (Queue) o;
       Assert.assertEquals(queueName, queue.getQueueName());
@@ -94,7 +94,7 @@ public class JMSServerControlRestartTest extends ManagementTestBase
       String queueName = RandomUtil.randomString();
       String binding = RandomUtil.randomString();
 
-      UnitTestCase.checkNoBinding(context, binding);
+      ServiceTestBase.checkNoBinding(context, binding);
       checkNoResource(ObjectNameBuilder.DEFAULT.getJMSQueueObjectName(queueName));
 
       TransportConfiguration config = new TransportConfiguration(InVMConnectorFactory.class.getName());
@@ -109,7 +109,7 @@ public class JMSServerControlRestartTest extends ManagementTestBase
       Assert.assertTrue(JMSManagementHelper.hasOperationSucceeded(reply));
       connection.close();
 
-      Object o = UnitTestCase.checkBinding(context, binding);
+      Object o = ServiceTestBase.checkBinding(context, binding);
       Assert.assertTrue(o instanceof Queue);
       Queue queue = (Queue) o;
       Assert.assertEquals(queueName, queue.getQueueName());
@@ -117,13 +117,13 @@ public class JMSServerControlRestartTest extends ManagementTestBase
 
       serverManager.stop();
 
-      UnitTestCase.checkNoBinding(context, binding);
+      ServiceTestBase.checkNoBinding(context, binding);
       checkNoResource(ObjectNameBuilder.DEFAULT.getJMSQueueObjectName(queueName));
 
       serverManager = createJMSServer();
       serverManager.start();
 
-      o = UnitTestCase.checkBinding(context, binding);
+      o = ServiceTestBase.checkBinding(context, binding);
       Assert.assertTrue(o instanceof Queue);
       queue = (Queue) o;
       Assert.assertEquals(queueName, queue.getQueueName());

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/management/JMSServerControlTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/management/JMSServerControlTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/management/JMSServerControlTest.java
index 82a395c..2cecabb 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/management/JMSServerControlTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/management/JMSServerControlTest.java
@@ -51,7 +51,7 @@ import org.apache.activemq.artemis.api.jms.management.JMSServerControl;
 import org.apache.activemq.artemis.tests.integration.management.ManagementControlHelper;
 import org.apache.activemq.artemis.tests.integration.management.ManagementTestBase;
 import org.apache.activemq.artemis.tests.unit.util.InVMNamingContext;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.apache.activemq.artemis.core.config.Configuration;
 import org.apache.activemq.artemis.core.postoffice.QueueBinding;
 import org.apache.activemq.artemis.core.registry.JndiBindingRegistry;
@@ -134,22 +134,22 @@ public class JMSServerControlTest extends ManagementTestBase
       String queueName = RandomUtil.randomString();
 
       String bindingsCSV = JMSServerControlTest.toCSV(bindings);
-      UnitTestCase.checkNoBinding(context, bindingsCSV);
+      ServiceTestBase.checkNoBinding(context, bindingsCSV);
 
       checkNoResource(ObjectNameBuilder.DEFAULT.getJMSQueueObjectName(queueName));
 
       JMSServerControl control = createManagementControl();
       control.createQueue(queueName, bindingsCSV);
 
-      Object o = UnitTestCase.checkBinding(context, bindings[0]);
+      Object o = ServiceTestBase.checkBinding(context, bindings[0]);
       Assert.assertTrue(o instanceof Queue);
       Queue queue = (Queue) o;
       Assert.assertEquals(queueName, queue.getQueueName());
-      o = UnitTestCase.checkBinding(context, bindings[1]);
+      o = ServiceTestBase.checkBinding(context, bindings[1]);
       Assert.assertTrue(o instanceof Queue);
       queue = (Queue) o;
       Assert.assertEquals(queueName, queue.getQueueName());
-      o = UnitTestCase.checkBinding(context, bindings[2]);
+      o = ServiceTestBase.checkBinding(context, bindings[2]);
       Assert.assertTrue(o instanceof Queue);
       queue = (Queue) o;
       Assert.assertEquals(queueName, queue.getQueueName());
@@ -172,22 +172,22 @@ public class JMSServerControlTest extends ManagementTestBase
       String queueName = RandomUtil.randomString();
 
       String bindingsCSV = JMSServerControlTest.toCSV(bindings);
-      UnitTestCase.checkNoBinding(context, bindingsCSV);
+      ServiceTestBase.checkNoBinding(context, bindingsCSV);
 
       checkNoResource(ObjectNameBuilder.DEFAULT.getJMSQueueObjectName(queueName));
 
       JMSServerControl control = createManagementControl();
       control.createQueue(queueName, bindingsCSV);
 
-      Object o = UnitTestCase.checkBinding(context, "first,first");
+      Object o = ServiceTestBase.checkBinding(context, "first,first");
       Assert.assertTrue(o instanceof Queue);
       Queue queue = (Queue) o;
       Assert.assertEquals(queueName, queue.getQueueName());
-      o = UnitTestCase.checkBinding(context, "second,second");
+      o = ServiceTestBase.checkBinding(context, "second,second");
       Assert.assertTrue(o instanceof Queue);
       queue = (Queue) o;
       Assert.assertEquals(queueName, queue.getQueueName());
-      o = UnitTestCase.checkBinding(context, "third,third");
+      o = ServiceTestBase.checkBinding(context, "third,third");
       Assert.assertTrue(o instanceof Queue);
       queue = (Queue) o;
       Assert.assertEquals(queueName, queue.getQueueName());
@@ -210,7 +210,7 @@ public class JMSServerControlTest extends ManagementTestBase
       String queueName = RandomUtil.randomString();
 
       String bindingsCSV = JMSServerControlTest.toCSV(bindings);
-      UnitTestCase.checkNoBinding(context, bindingsCSV);
+      ServiceTestBase.checkNoBinding(context, bindingsCSV);
 
       checkNoResource(ObjectNameBuilder.DEFAULT.getJMSQueueObjectName(queueName));
 
@@ -218,7 +218,7 @@ public class JMSServerControlTest extends ManagementTestBase
       String selector = "foo='bar'";
       control.createQueue(queueName, bindingsCSV, selector);
 
-      Object o = UnitTestCase.checkBinding(context, bindings[0]);
+      Object o = ServiceTestBase.checkBinding(context, bindings[0]);
       Assert.assertTrue(o instanceof Queue);
       Queue queue = (Queue) o;
       // assertEquals(((ActiveMQDestination)queue).get);
@@ -228,7 +228,7 @@ public class JMSServerControlTest extends ManagementTestBase
          .getFilter()
          .getFilterString()
          .toString());
-      o = UnitTestCase.checkBinding(context, bindings[1]);
+      o = ServiceTestBase.checkBinding(context, bindings[1]);
       Assert.assertTrue(o instanceof Queue);
       queue = (Queue) o;
       Assert.assertEquals(queueName, queue.getQueueName());
@@ -237,7 +237,7 @@ public class JMSServerControlTest extends ManagementTestBase
          .getFilter()
          .getFilterString()
          .toString());
-      o = UnitTestCase.checkBinding(context, bindings[2]);
+      o = ServiceTestBase.checkBinding(context, bindings[2]);
       Assert.assertTrue(o instanceof Queue);
       queue = (Queue) o;
       Assert.assertEquals(queueName, queue.getQueueName());
@@ -261,13 +261,13 @@ public class JMSServerControlTest extends ManagementTestBase
       String queueName = RandomUtil.randomString();
       String binding = RandomUtil.randomString();
 
-      UnitTestCase.checkNoBinding(context, binding);
+      ServiceTestBase.checkNoBinding(context, binding);
       checkNoResource(ObjectNameBuilder.DEFAULT.getJMSQueueObjectName(queueName));
 
       JMSServerControl control = createManagementControl();
       control.createQueue(queueName, binding, null, false);
 
-      Object o = UnitTestCase.checkBinding(context, binding);
+      Object o = ServiceTestBase.checkBinding(context, binding);
       Assert.assertTrue(o instanceof Queue);
       Queue queue = (Queue) o;
       Assert.assertEquals(queueName, queue.getQueueName());
@@ -287,18 +287,18 @@ public class JMSServerControlTest extends ManagementTestBase
       String queueJNDIBinding = RandomUtil.randomString();
       String queueName = RandomUtil.randomString();
 
-      UnitTestCase.checkNoBinding(context, queueJNDIBinding);
+      ServiceTestBase.checkNoBinding(context, queueJNDIBinding);
       checkNoResource(ObjectNameBuilder.DEFAULT.getJMSQueueObjectName(queueName));
 
       JMSServerControl control = createManagementControl();
       control.createQueue(queueName, queueJNDIBinding);
 
-      UnitTestCase.checkBinding(context, queueJNDIBinding);
+      ServiceTestBase.checkBinding(context, queueJNDIBinding);
       checkResource(ObjectNameBuilder.DEFAULT.getJMSQueueObjectName(queueName));
 
       control.destroyQueue(queueName);
 
-      UnitTestCase.checkNoBinding(context, queueJNDIBinding);
+      ServiceTestBase.checkNoBinding(context, queueJNDIBinding);
       checkNoResource(ObjectNameBuilder.DEFAULT.getJMSQueueObjectName(queueName));
 
       Assert.assertNull(fakeJMSStorageManager.destinationMap.get(queueName));
@@ -310,17 +310,17 @@ public class JMSServerControlTest extends ManagementTestBase
       String queueJNDIBinding = RandomUtil.randomString();
       String queueName = RandomUtil.randomString();
 
-      UnitTestCase.checkNoBinding(context, queueJNDIBinding);
+      ServiceTestBase.checkNoBinding(context, queueJNDIBinding);
       checkNoResource(ObjectNameBuilder.DEFAULT.getJMSQueueObjectName(queueName));
 
       JMSServerControl control = createManagementControl();
       control.createQueue(queueName, queueJNDIBinding);
 
-      UnitTestCase.checkBinding(context, queueJNDIBinding);
+      ServiceTestBase.checkBinding(context, queueJNDIBinding);
       checkResource(ObjectNameBuilder.DEFAULT.getJMSQueueObjectName(queueName));
 
       ActiveMQConnectionFactory cf =
-         new ActiveMQConnectionFactory(false, new TransportConfiguration(UnitTestCase.INVM_CONNECTOR_FACTORY));
+         new ActiveMQConnectionFactory(false, new TransportConfiguration(INVM_CONNECTOR_FACTORY));
       ActiveMQConnection connection = (ActiveMQConnection) cf.createConnection();
       try
       {
@@ -330,7 +330,7 @@ public class JMSServerControlTest extends ManagementTestBase
 
          control.destroyQueue(queueName, true);
 
-         UnitTestCase.checkNoBinding(context, queueJNDIBinding);
+         ServiceTestBase.checkNoBinding(context, queueJNDIBinding);
          checkNoResource(ObjectNameBuilder.DEFAULT.getJMSQueueObjectName(queueName));
 
          Assert.assertNull(fakeJMSStorageManager.destinationMap.get(queueName));
@@ -367,16 +367,16 @@ public class JMSServerControlTest extends ManagementTestBase
       String queueJNDIBinding = RandomUtil.randomString();
       String queueName = RandomUtil.randomString();
 
-      UnitTestCase.checkNoBinding(context, queueJNDIBinding);
+      ServiceTestBase.checkNoBinding(context, queueJNDIBinding);
       checkNoResource(ObjectNameBuilder.DEFAULT.getJMSQueueObjectName(queueName));
 
       JMSServerControl control = createManagementControl();
       control.createQueue(queueName, queueJNDIBinding);
 
-      UnitTestCase.checkBinding(context, queueJNDIBinding);
+      ServiceTestBase.checkBinding(context, queueJNDIBinding);
       checkResource(ObjectNameBuilder.DEFAULT.getJMSQueueObjectName(queueName));
 
-      ActiveMQConnectionFactory cf = new ActiveMQConnectionFactory(false, new TransportConfiguration(UnitTestCase.INVM_CONNECTOR_FACTORY));
+      ActiveMQConnectionFactory cf = new ActiveMQConnectionFactory(false, new TransportConfiguration(INVM_CONNECTOR_FACTORY));
       ActiveMQConnection connection = (ActiveMQConnection) cf.createConnection();
       connection.start();
       try
@@ -397,7 +397,7 @@ public class JMSServerControlTest extends ManagementTestBase
             Assert.assertTrue(e.getMessage().startsWith("AMQ119025"));
          }
 
-         UnitTestCase.checkBinding(context, queueJNDIBinding);
+         ServiceTestBase.checkBinding(context, queueJNDIBinding);
          checkResource(ObjectNameBuilder.DEFAULT.getJMSQueueObjectName(queueName));
 
          Assert.assertNotNull(fakeJMSStorageManager.destinationMap.get(queueName));
@@ -422,16 +422,16 @@ public class JMSServerControlTest extends ManagementTestBase
       String topicJNDIBinding = RandomUtil.randomString();
       String topicName = RandomUtil.randomString();
 
-      UnitTestCase.checkNoBinding(context, topicJNDIBinding);
+      ServiceTestBase.checkNoBinding(context, topicJNDIBinding);
       checkNoResource(ObjectNameBuilder.DEFAULT.getJMSTopicObjectName(topicName));
 
       JMSServerControl control = createManagementControl();
       control.createTopic(topicName, topicJNDIBinding);
 
-      UnitTestCase.checkBinding(context, topicJNDIBinding);
+      ServiceTestBase.checkBinding(context, topicJNDIBinding);
       checkResource(ObjectNameBuilder.DEFAULT.getJMSTopicObjectName(topicName));
 
-      ActiveMQConnectionFactory cf = new ActiveMQConnectionFactory(false, new TransportConfiguration(UnitTestCase.INVM_CONNECTOR_FACTORY));
+      ActiveMQConnectionFactory cf = new ActiveMQConnectionFactory(false, new TransportConfiguration(INVM_CONNECTOR_FACTORY));
       ActiveMQConnection connection = (ActiveMQConnection) cf.createConnection();
       connection.start();
       try
@@ -452,7 +452,7 @@ public class JMSServerControlTest extends ManagementTestBase
             Assert.assertTrue(e.getMessage().startsWith("AMQ119025"));
          }
 
-         UnitTestCase.checkBinding(context, topicJNDIBinding);
+         ServiceTestBase.checkBinding(context, topicJNDIBinding);
          checkResource(ObjectNameBuilder.DEFAULT.getJMSTopicObjectName(topicName));
          Assert.assertFalse(cons.isClosed());
 
@@ -474,17 +474,17 @@ public class JMSServerControlTest extends ManagementTestBase
       String topicJNDIBinding = RandomUtil.randomString();
       String topicName = RandomUtil.randomString();
 
-      UnitTestCase.checkNoBinding(context, topicJNDIBinding);
+      ServiceTestBase.checkNoBinding(context, topicJNDIBinding);
       checkNoResource(ObjectNameBuilder.DEFAULT.getJMSTopicObjectName(topicName));
 
       JMSServerControl control = createManagementControl();
       control.createTopic(topicName, topicJNDIBinding);
 
-      UnitTestCase.checkBinding(context, topicJNDIBinding);
+      ServiceTestBase.checkBinding(context, topicJNDIBinding);
       checkResource(ObjectNameBuilder.DEFAULT.getJMSTopicObjectName(topicName));
 
       ActiveMQConnectionFactory cf =
-         new ActiveMQConnectionFactory(false, new TransportConfiguration(UnitTestCase.INVM_CONNECTOR_FACTORY));
+         new ActiveMQConnectionFactory(false, new TransportConfiguration(INVM_CONNECTOR_FACTORY));
       ActiveMQConnection connection = (ActiveMQConnection) cf.createConnection();
       try
       {
@@ -494,7 +494,7 @@ public class JMSServerControlTest extends ManagementTestBase
 
          control.destroyTopic(topicName, true);
 
-         UnitTestCase.checkNoBinding(context, topicJNDIBinding);
+         ServiceTestBase.checkNoBinding(context, topicJNDIBinding);
          checkNoResource(ObjectNameBuilder.DEFAULT.getJMSTopicObjectName(topicName));
 
          long time = System.currentTimeMillis();
@@ -529,17 +529,17 @@ public class JMSServerControlTest extends ManagementTestBase
       String queueJNDIBinding = RandomUtil.randomString();
       String queueName = RandomUtil.randomString();
 
-      UnitTestCase.checkNoBinding(context, queueJNDIBinding);
+      ServiceTestBase.checkNoBinding(context, queueJNDIBinding);
       checkNoResource(ObjectNameBuilder.DEFAULT.getJMSQueueObjectName(queueName));
 
       JMSServerControl control = createManagementControl();
       control.createQueue(queueName, queueJNDIBinding);
 
-      UnitTestCase.checkBinding(context, queueJNDIBinding);
+      ServiceTestBase.checkBinding(context, queueJNDIBinding);
       checkResource(ObjectNameBuilder.DEFAULT.getJMSQueueObjectName(queueName));
 
       ActiveMQConnectionFactory cf =
-         new ActiveMQConnectionFactory(false, new TransportConfiguration(UnitTestCase.NETTY_CONNECTOR_FACTORY));
+         new ActiveMQConnectionFactory(false, new TransportConfiguration(ServiceTestBase.NETTY_CONNECTOR_FACTORY));
       cf.setReconnectAttempts(-1);
       ActiveMQConnection connection = (ActiveMQConnection) cf.createConnection();
       try
@@ -550,7 +550,7 @@ public class JMSServerControlTest extends ManagementTestBase
 
          control.destroyQueue(queueName, true);
 
-         UnitTestCase.checkNoBinding(context, queueJNDIBinding);
+         ServiceTestBase.checkNoBinding(context, queueJNDIBinding);
          checkNoResource(ObjectNameBuilder.DEFAULT.getJMSQueueObjectName(queueName));
 
          Assert.assertNull(fakeJMSStorageManager.destinationMap.get(queueName));
@@ -610,24 +610,24 @@ public class JMSServerControlTest extends ManagementTestBase
       bindings[1] = RandomUtil.randomString();
       bindings[2] = RandomUtil.randomString();
       String topicJNDIBinding = JMSServerControlTest.toCSV(bindings);
-      UnitTestCase.checkNoBinding(context, topicJNDIBinding);
+      ServiceTestBase.checkNoBinding(context, topicJNDIBinding);
       String topicName = RandomUtil.randomString();
 
-      UnitTestCase.checkNoBinding(context, topicJNDIBinding);
+      ServiceTestBase.checkNoBinding(context, topicJNDIBinding);
       checkNoResource(ObjectNameBuilder.DEFAULT.getJMSTopicObjectName(topicName));
 
       JMSServerControl control = createManagementControl();
       control.createTopic(topicName, topicJNDIBinding);
 
-      Object o = UnitTestCase.checkBinding(context, bindings[0]);
+      Object o = ServiceTestBase.checkBinding(context, bindings[0]);
       Assert.assertTrue(o instanceof Topic);
       Topic topic = (Topic) o;
       Assert.assertEquals(topicName, topic.getTopicName());
-      o = UnitTestCase.checkBinding(context, bindings[1]);
+      o = ServiceTestBase.checkBinding(context, bindings[1]);
       Assert.assertTrue(o instanceof Topic);
       topic = (Topic) o;
       Assert.assertEquals(topicName, topic.getTopicName());
-      o = UnitTestCase.checkBinding(context, bindings[2]);
+      o = ServiceTestBase.checkBinding(context, bindings[2]);
       Assert.assertTrue(o instanceof Topic);
       topic = (Topic) o;
       Assert.assertEquals(topicName, topic.getTopicName());
@@ -646,7 +646,7 @@ public class JMSServerControlTest extends ManagementTestBase
       String topicJNDIBinding = RandomUtil.randomString();
       String topicName = RandomUtil.randomString();
 
-      UnitTestCase.checkNoBinding(context, topicJNDIBinding);
+      ServiceTestBase.checkNoBinding(context, topicJNDIBinding);
       checkNoResource(ObjectNameBuilder.DEFAULT.getJMSTopicObjectName(topicName));
 
       JMSServerControl control = createManagementControl();
@@ -673,7 +673,7 @@ public class JMSServerControlTest extends ManagementTestBase
       control.destroyTopic(topicName);
 
       Assert.assertNull(server.getManagementService().getResource(ResourceNames.CORE_ADDRESS + topicAddress));
-      UnitTestCase.checkNoBinding(context, topicJNDIBinding);
+      ServiceTestBase.checkNoBinding(context, topicJNDIBinding);
       checkNoResource(ObjectNameBuilder.DEFAULT.getJMSTopicObjectName(topicName));
 
       Assert.assertNull(fakeJMSStorageManager.destinationMap.get(topicName));
@@ -685,7 +685,7 @@ public class JMSServerControlTest extends ManagementTestBase
       String topicJNDIBinding = RandomUtil.randomString();
       String topicName = RandomUtil.randomString();
 
-      UnitTestCase.checkNoBinding(context, topicJNDIBinding);
+      ServiceTestBase.checkNoBinding(context, topicJNDIBinding);
       checkNoResource(ObjectNameBuilder.DEFAULT.getJMSTopicObjectName(topicName));
 
       JMSServerControl control = createManagementControl();
@@ -695,7 +695,7 @@ public class JMSServerControlTest extends ManagementTestBase
       Topic topic = (Topic) context.lookup(topicJNDIBinding);
       Assert.assertNotNull(topic);
       ActiveMQConnectionFactory cf =
-         new ActiveMQConnectionFactory(false, new TransportConfiguration(UnitTestCase.INVM_CONNECTOR_FACTORY));
+         new ActiveMQConnectionFactory(false, new TransportConfiguration(INVM_CONNECTOR_FACTORY));
       Connection connection = cf.createConnection();
       Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
       // create a consumer will create a Core queue bound to the topic address
@@ -722,7 +722,7 @@ public class JMSServerControlTest extends ManagementTestBase
       control.destroyTopic(topicName);
 
       Assert.assertNull(server.getManagementService().getResource(ResourceNames.CORE_ADDRESS + topicAddress));
-      UnitTestCase.checkNoBinding(context, topicJNDIBinding);
+      ServiceTestBase.checkNoBinding(context, topicJNDIBinding);
       checkNoResource(ObjectNameBuilder.DEFAULT.getJMSTopicObjectName(topicName));
 
       Assert.assertNull(fakeJMSStorageManager.destinationMap.get(topicName));
@@ -753,7 +753,7 @@ public class JMSServerControlTest extends ManagementTestBase
    {
       server.getConfiguration()
          .getConnectorConfigurations()
-         .put("tst", new TransportConfiguration(UnitTestCase.INVM_CONNECTOR_FACTORY));
+         .put("tst", new TransportConfiguration(INVM_CONNECTOR_FACTORY));
 
       doCreateConnectionFactory(new ConnectionFactoryCreator()
       {
@@ -930,7 +930,7 @@ public class JMSServerControlTest extends ManagementTestBase
 
       server.getConfiguration()
          .getConnectorConfigurations()
-         .put("tst", new TransportConfiguration(UnitTestCase.INVM_CONNECTOR_FACTORY));
+         .put("tst", new TransportConfiguration(INVM_CONNECTOR_FACTORY));
 
       control.createConnectionFactory(cfName, false, false, 3, "tst", cfJNDIBinding);
 
@@ -971,7 +971,7 @@ public class JMSServerControlTest extends ManagementTestBase
 
       server.getConfiguration()
          .getConnectorConfigurations()
-         .put("tst", new TransportConfiguration(UnitTestCase.INVM_CONNECTOR_FACTORY));
+         .put("tst", new TransportConfiguration(INVM_CONNECTOR_FACTORY));
 
       control.createConnectionFactory(cfName, false, false, 3, "tst", cfJNDIBinding);
 
@@ -1066,10 +1066,10 @@ public class JMSServerControlTest extends ManagementTestBase
    {
       Configuration conf = createBasicConfig()
          .setPersistenceEnabled(true)
-         .addAcceptorConfiguration(new TransportConfiguration(UnitTestCase.NETTY_ACCEPTOR_FACTORY))
-         .addAcceptorConfiguration(new TransportConfiguration(UnitTestCase.INVM_ACCEPTOR_FACTORY))
-         .addConnectorConfiguration("netty", new TransportConfiguration(UnitTestCase.NETTY_CONNECTOR_FACTORY))
-         .addConnectorConfiguration("invm", new TransportConfiguration(UnitTestCase.INVM_CONNECTOR_FACTORY));
+         .addAcceptorConfiguration(new TransportConfiguration(ServiceTestBase.NETTY_ACCEPTOR_FACTORY))
+         .addAcceptorConfiguration(new TransportConfiguration(ServiceTestBase.INVM_ACCEPTOR_FACTORY))
+         .addConnectorConfiguration("netty", new TransportConfiguration(ServiceTestBase.NETTY_CONNECTOR_FACTORY))
+         .addConnectorConfiguration("invm", new TransportConfiguration(INVM_CONNECTOR_FACTORY));
 
       server = addServer(ActiveMQServers.newActiveMQServer(conf, mbeanServer, true));
 
@@ -1130,7 +1130,7 @@ public class JMSServerControlTest extends ManagementTestBase
 
       for (Object cfJNDIBinding : cfJNDIBindings)
       {
-         UnitTestCase.checkNoBinding(context, cfJNDIBinding.toString());
+         ServiceTestBase.checkNoBinding(context, cfJNDIBinding.toString());
       }
       checkNoResource(ObjectNameBuilder.DEFAULT.getConnectionFactoryObjectName(cfName));
 
@@ -1139,7 +1139,7 @@ public class JMSServerControlTest extends ManagementTestBase
 
       for (Object cfJNDIBinding : cfJNDIBindings)
       {
-         Object o = UnitTestCase.checkBinding(context, cfJNDIBinding.toString());
+         Object o = ServiceTestBase.checkBinding(context, cfJNDIBinding.toString());
          Assert.assertTrue(o instanceof ConnectionFactory);
          ConnectionFactory cf = (ConnectionFactory) o;
          Connection connection = cf.createConnection();

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/AIOImportExportTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/AIOImportExportTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/AIOImportExportTest.java
index bba40ff..4b3ea24 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/AIOImportExportTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/AIOImportExportTest.java
@@ -18,7 +18,7 @@ package org.apache.activemq.artemis.tests.integration.journal;
 
 import java.io.File;
 
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.apache.activemq.artemis.core.journal.SequentialFileFactory;
 import org.apache.activemq.artemis.core.journal.impl.AIOSequentialFileFactory;
 import org.junit.BeforeClass;
@@ -36,7 +36,7 @@ public class AIOImportExportTest extends NIOImportExportTest
    {
       File file = new File(getTestDir());
 
-      UnitTestCase.deleteDirectory(file);
+      ServiceTestBase.deleteDirectory(file);
 
       file.mkdir();
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/AIOJournalCompactTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/AIOJournalCompactTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/AIOJournalCompactTest.java
index f713267..dd63460 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/AIOJournalCompactTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/AIOJournalCompactTest.java
@@ -18,7 +18,7 @@ package org.apache.activemq.artemis.tests.integration.journal;
 
 import java.io.File;
 
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.apache.activemq.artemis.core.journal.SequentialFileFactory;
 import org.apache.activemq.artemis.core.journal.impl.AIOSequentialFileFactory;
 import org.apache.activemq.artemis.core.journal.impl.JournalConstants;
@@ -37,7 +37,7 @@ public class AIOJournalCompactTest extends NIOJournalCompactTest
    {
       File file = new File(getTestDir());
 
-      UnitTestCase.deleteDirectory(file);
+      ServiceTestBase.deleteDirectory(file);
 
       file.mkdir();
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/JournalPerfTuneTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/JournalPerfTuneTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/JournalPerfTuneTest.java
index 8c70ae8..02efaa3 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/JournalPerfTuneTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/JournalPerfTuneTest.java
@@ -21,7 +21,7 @@ import java.util.concurrent.atomic.AtomicLong;
 
 import org.apache.activemq.artemis.api.core.ActiveMQBuffer;
 import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.apache.activemq.artemis.core.journal.EncodingSupport;
 import org.apache.activemq.artemis.core.journal.IOCompletion;
 import org.apache.activemq.artemis.core.journal.Journal;
@@ -37,7 +37,7 @@ import org.junit.Ignore;
 import org.junit.Test;
 
 @Ignore
-public class JournalPerfTuneTest extends UnitTestCase
+public class JournalPerfTuneTest extends ServiceTestBase
 {
    private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER;
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/NIOBufferedJournalCompactTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/NIOBufferedJournalCompactTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/NIOBufferedJournalCompactTest.java
index 1e358f6..da39e88 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/NIOBufferedJournalCompactTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/NIOBufferedJournalCompactTest.java
@@ -18,7 +18,7 @@ package org.apache.activemq.artemis.tests.integration.journal;
 
 import java.io.File;
 
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.apache.activemq.artemis.core.journal.SequentialFileFactory;
 import org.apache.activemq.artemis.core.journal.impl.NIOSequentialFileFactory;
 
@@ -30,7 +30,7 @@ public class NIOBufferedJournalCompactTest extends NIOJournalCompactTest
    {
       File file = new File(getTestDir());
 
-      UnitTestCase.deleteDirectory(file);
+      ServiceTestBase.deleteDirectory(file);
 
       file.mkdir();
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/NIOImportExportTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/NIOImportExportTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/NIOImportExportTest.java
index a31ead7..66e001b 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/NIOImportExportTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/NIOImportExportTest.java
@@ -17,7 +17,7 @@
 package org.apache.activemq.artemis.tests.integration.journal;
 import org.apache.activemq.artemis.tests.unit.core.journal.impl.JournalImplTestBase;
 import org.apache.activemq.artemis.tests.unit.core.journal.impl.fakes.SimpleEncoding;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.junit.After;
 
 import org.junit.Test;
@@ -39,7 +39,7 @@ public class NIOImportExportTest extends JournalImplTestBase
    {
       File file = new File(getTestDir());
 
-      UnitTestCase.deleteDirectory(file);
+      ServiceTestBase.deleteDirectory(file);
 
       file.mkdir();
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/NIOJournalCompactTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/NIOJournalCompactTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/NIOJournalCompactTest.java
index 028a8f3..acc98c8 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/NIOJournalCompactTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/NIOJournalCompactTest.java
@@ -48,7 +48,7 @@ import org.apache.activemq.artemis.core.persistence.impl.journal.OperationContex
 import org.apache.activemq.artemis.core.server.impl.ServerMessageImpl;
 import org.apache.activemq.artemis.tests.unit.core.journal.impl.JournalImplTestBase;
 import org.apache.activemq.artemis.tests.unit.core.journal.impl.fakes.SimpleEncoding;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.apache.activemq.artemis.utils.IDGenerator;
 import org.apache.activemq.artemis.utils.OrderedExecutorFactory;
 import org.apache.activemq.artemis.utils.SimpleIDGenerator;
@@ -556,7 +556,7 @@ public class NIOJournalCompactTest extends JournalImplTestBase
             System.out.println("Waiting on Compact");
             try
             {
-               UnitTestCase.waitForLatch(latchWait);
+               ServiceTestBase.waitForLatch(latchWait);
             }
             catch (InterruptedException e)
             {
@@ -650,7 +650,7 @@ public class NIOJournalCompactTest extends JournalImplTestBase
 
       t.start();
 
-      UnitTestCase.waitForLatch(latchDone);
+      ServiceTestBase.waitForLatch(latchDone);
 
       int nextID = NIOJournalCompactTest.NUMBER_OF_RECORDS;
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/NIOJournalImplTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/NIOJournalImplTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/NIOJournalImplTest.java
index 660b9d5..e99775b 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/NIOJournalImplTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/NIOJournalImplTest.java
@@ -20,7 +20,7 @@ import java.io.File;
 
 import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger;
 import org.apache.activemq.artemis.tests.unit.core.journal.impl.JournalImplTestUnit;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.apache.activemq.artemis.core.journal.SequentialFileFactory;
 import org.apache.activemq.artemis.core.journal.impl.NIOSequentialFileFactory;
 
@@ -35,7 +35,7 @@ public class NIOJournalImplTest extends JournalImplTestUnit
 
       NIOJournalImplTest.log.debug("deleting directory " + getTestDir());
 
-      UnitTestCase.deleteDirectory(file);
+      ServiceTestBase.deleteDirectory(file);
 
       file.mkdir();
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/ValidateTransactionHealthTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/ValidateTransactionHealthTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/ValidateTransactionHealthTest.java
index e1a9160..95ce97c 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/ValidateTransactionHealthTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/ValidateTransactionHealthTest.java
@@ -21,7 +21,7 @@ import java.util.List;
 import java.util.concurrent.atomic.AtomicLong;
 
 import org.apache.activemq.artemis.tests.util.SpawnedVMSupport;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.apache.activemq.artemis.tests.util.ServiceTestBase;
 import org.apache.activemq.artemis.core.asyncio.impl.AsynchronousFileImpl;
 import org.apache.activemq.artemis.core.journal.LoaderCallback;
 import org.apache.activemq.artemis.core.journal.PreparedTransactionInfo;
@@ -37,7 +37,7 @@ import org.junit.Test;
 /**
  * This test spawns a remote VM, as we want to "crash" the VM right after the journal is filled with data
  */
-public class ValidateTransactionHealthTest extends UnitTestCase
+public class ValidateTransactionHealthTest extends ServiceTestBase
 {
 
    private static final int OK = 10;

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/largemessage/LargeMessageTestBase.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/largemessage/LargeMessageTestBase.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/largemessage/LargeMessageTestBase.java
index 801fce6..d80ee58 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/largemessage/LargeMessageTestBase.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/largemessage/LargeMessageTestBase.java
@@ -16,17 +16,6 @@
  */
 package org.apache.activemq.artemis.tests.integration.largemessage;
 
-import javax.transaction.xa.XAResource;
-import javax.transaction.xa.Xid;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.util.Random;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.atomic.AtomicInteger;
-import java.util.concurrent.atomic.AtomicLong;
-
 import org.apache.activemq.artemis.api.core.ActiveMQBuffer;
 import org.apache.activemq.artemis.api.core.ActiveMQBuffers;
 import org.apache.activemq.artemis.api.core.ActiveMQException;
@@ -43,11 +32,21 @@ import org.apache.activemq.artemis.core.server.ActiveMQServer;
 import org.apache.activemq.artemis.core.server.Queue;
 import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger;
 import org.apache.activemq.artemis.tests.util.ServiceTestBase;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
 import org.apache.activemq.artemis.utils.DataConstants;
 import org.apache.activemq.artemis.utils.DeflaterReader;
 import org.junit.Assert;
 
+import javax.transaction.xa.XAResource;
+import javax.transaction.xa.Xid;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.util.Random;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicInteger;
+import java.util.concurrent.atomic.AtomicLong;
+
 public abstract class LargeMessageTestBase extends ServiceTestBase
 {
 
@@ -300,7 +299,7 @@ public abstract class LargeMessageTestBase extends ServiceTestBase
                               @Override
                               public void write(final byte[] b) throws IOException
                               {
-                                 if (b[0] == UnitTestCase.getSamplebyte(bytesRead.get()))
+                                 if (b[0] == ServiceTestBase.getSamplebyte(bytesRead.get()))
                                  {
                                     bytesRead.addAndGet(b.length);
                                     LargeMessageTestBase.log.debug("Read position " + bytesRead.get() + " on consumer");
@@ -314,7 +313,7 @@ public abstract class LargeMessageTestBase extends ServiceTestBase
                               @Override
                               public void write(final int b) throws IOException
                               {
-                                 if (b == UnitTestCase.getSamplebyte(bytesRead.get()))
+                                 if (b == ServiceTestBase.getSamplebyte(bytesRead.get()))
                                  {
                                     bytesRead.incrementAndGet();
                                  }
@@ -339,7 +338,7 @@ public abstract class LargeMessageTestBase extends ServiceTestBase
                                  LargeMessageTestBase.log.debug("Read " + b + " bytes");
                               }
 
-                              Assert.assertEquals(UnitTestCase.getSamplebyte(b), buffer.readByte());
+                              Assert.assertEquals(ServiceTestBase.getSamplebyte(b), buffer.readByte());
                            }
 
                            try
@@ -419,7 +418,7 @@ public abstract class LargeMessageTestBase extends ServiceTestBase
                         @Override
                         public void write(final byte[] b) throws IOException
                         {
-                           if (b[0] == UnitTestCase.getSamplebyte(bytesRead.get()))
+                           if (b[0] == ServiceTestBase.getSamplebyte(bytesRead.get()))
                            {
                               bytesRead.addAndGet(b.length);
                            }
@@ -461,7 +460,7 @@ public abstract class LargeMessageTestBase extends ServiceTestBase
                         {
                            LargeMessageTestBase.log.debug("Read " + b + " bytes");
                         }
-                        Assert.assertEquals(UnitTestCase.getSamplebyte(b), buffer.readByte());
+                        Assert.assertEquals(ServiceTestBase.getSamplebyte(b), buffer.readByte());
                      }
                   }
 
@@ -547,7 +546,7 @@ public abstract class LargeMessageTestBase extends ServiceTestBase
          if (numberOfBytes > 1024 * 1024 || i % 2 == 0)
          {
             LargeMessageTestBase.log.debug("Sending message (stream)" + i);
-            message.setBodyInputStream(UnitTestCase.createFakeLargeStream(numberOfBytes));
+            message.setBodyInputStream(ServiceTestBase.createFakeLargeStream(numberOfBytes));
          }
          else
          {
@@ -555,7 +554,7 @@ public abstract class LargeMessageTestBase extends ServiceTestBase
             byte[] bytes = new byte[(int) numberOfBytes];
             for (int j = 0; j < bytes.length; j++)
             {
-               bytes[j] = UnitTestCase.getSamplebyte(j);
+               bytes[j] = ServiceTestBase.getSamplebyte(j);
             }
             message.getBodyBuffer().writeBytes(bytes);
          }
@@ -607,7 +606,7 @@ public abstract class LargeMessageTestBase extends ServiceTestBase
 
       ClientMessage clientMessage = session.createMessage(persistent);
 
-      clientMessage.setBodyInputStream(UnitTestCase.createFakeLargeStream(numberOfBytes));
+      clientMessage.setBodyInputStream(ServiceTestBase.createFakeLargeStream(numberOfBytes));
 
       return clientMessage;
    }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/largemessage/ServerLargeMessageTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/largemessage/ServerLargeMessageTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/largemessage/ServerLargeMessageTest.java
index e2c1114..83aa6d5 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/largemessage/ServerLargeMessageTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/largemessage/ServerLargeMessageTest.java
@@ -17,14 +17,13 @@
 package org.apache.activemq.artemis.tests.integration.largemessage;
 
 import org.apache.activemq.artemis.api.core.Message;
+import org.apache.activemq.artemis.api.core.client.ActiveMQClient;
 import org.apache.activemq.artemis.api.core.client.ClientConsumer;
 import org.apache.activemq.artemis.api.core.client.ClientMessage;
 import org.apache.activemq.artemis.api.core.client.ClientProducer;
 import org.apache.activemq.artemis.api.core.client.ClientSession;
 import org.apache.activemq.artemis.api.core.client.ClientSessionFactory;
-import org.apache.activemq.artemis.api.core.client.ActiveMQClient;
 import org.apache.activemq.artemis.api.core.client.ServerLocator;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
 import org.apache.activemq.artemis.core.persistence.impl.journal.JournalStorageManager;
 import org.apache.activemq.artemis.core.persistence.impl.journal.LargeServerMessageImpl;
 import org.apache.activemq.artemis.core.server.ActiveMQServer;
@@ -67,7 +66,7 @@ public class ServerLargeMessageTest extends ServiceTestBase
 
          for (int i = 0; i < 2 * ActiveMQClient.DEFAULT_MIN_LARGE_MESSAGE_SIZE; i++)
          {
-            fileMessage.addBytes(new byte[]{UnitTestCase.getSamplebyte(i)});
+            fileMessage.addBytes(new byte[]{ServiceTestBase.getSamplebyte(i)});
          }
          // The server would be doing this
          fileMessage.putLongProperty(Message.HDR_LARGE_BODY_SIZE, 2 * ActiveMQClient.DEFAULT_MIN_LARGE_MESSAGE_SIZE);
@@ -97,7 +96,7 @@ public class ServerLargeMessageTest extends ServiceTestBase
 
          for (int i = 0; i < 2 * ActiveMQClient.DEFAULT_MIN_LARGE_MESSAGE_SIZE; i++)
          {
-            Assert.assertEquals(UnitTestCase.getSamplebyte(i), msg.getBodyBuffer().readByte());
+            Assert.assertEquals(ServiceTestBase.getSamplebyte(i), msg.getBodyBuffer().readByte());
          }
 
          msg.acknowledge();

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/AcceptorControlTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/AcceptorControlTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/AcceptorControlTest.java
index a89d615..1f73935 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/AcceptorControlTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/AcceptorControlTest.java
@@ -53,7 +53,8 @@ public class AcceptorControlTest extends ManagementTestBase
 
       Configuration conf = createBasicConfig()
          .addAcceptorConfiguration(acceptorConfig);
-      ActiveMQServer service = createServer(false, conf, mbeanServer);
+      ActiveMQServer service = createServer(false, conf);
+      service.setMBeanServer(mbeanServer);
       service.start();
 
       AcceptorControl acceptorControl = createManagementControl(acceptorConfig.getName());
@@ -70,7 +71,8 @@ public class AcceptorControlTest extends ManagementTestBase
                                                                          RandomUtil.randomString());
       Configuration conf = createBasicConfig()
          .addAcceptorConfiguration(acceptorConfig);
-      ActiveMQServer service = createServer(false, conf, mbeanServer);
+      ActiveMQServer service = createServer(false, conf);
+      service.setMBeanServer(mbeanServer);
       service.start();
 
       AcceptorControl acceptorControl = createManagementControl(acceptorConfig.getName());
@@ -129,7 +131,8 @@ public class AcceptorControlTest extends ManagementTestBase
                                                                          RandomUtil.randomString());
       Configuration conf = createBasicConfig()
          .addAcceptorConfiguration(acceptorConfig);
-      ActiveMQServer service = createServer(false, conf, mbeanServer);
+      ActiveMQServer service = createServer(false, conf);
+      service.setMBeanServer(mbeanServer);
       service.start();
 
       AcceptorControl acceptorControl = createManagementControl(acceptorConfig.getName());

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/99147d07/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/AcceptorControlUsingCoreTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/AcceptorControlUsingCoreTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/AcceptorControlUsingCoreTest.java
index 9b600a4..259360b 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/AcceptorControlUsingCoreTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/AcceptorControlUsingCoreTest.java
@@ -16,18 +16,14 @@
  */
 package org.apache.activemq.artemis.tests.integration.management;
 
-import org.junit.Test;
-
-import java.util.Map;
-
-import org.apache.activemq.artemis.api.core.TransportConfiguration;
 import org.apache.activemq.artemis.api.core.client.ClientSession;
 import org.apache.activemq.artemis.api.core.client.ClientSessionFactory;
-import org.apache.activemq.artemis.api.core.client.ActiveMQClient;
 import org.apache.activemq.artemis.api.core.client.ServerLocator;
 import org.apache.activemq.artemis.api.core.management.AcceptorControl;
 import org.apache.activemq.artemis.api.core.management.ResourceNames;
-import org.apache.activemq.artemis.tests.util.UnitTestCase;
+import org.junit.Test;
+
+import java.util.Map;
 
 public class AcceptorControlUsingCoreTest extends AcceptorControlTest
 {
@@ -47,7 +43,7 @@ public class AcceptorControlUsingCoreTest extends AcceptorControlTest
    @Override
    protected AcceptorControl createManagementControl(final String name) throws Exception
    {
-      ServerLocator locator = ActiveMQClient.createServerLocatorWithoutHA(new TransportConfiguration(UnitTestCase.INVM_CONNECTOR_FACTORY));
+      ServerLocator locator = createInVMNonHALocator();
       addServerLocator(locator);
       ClientSessionFactory sf = createSessionFactory(locator);
       session = sf.createSession(false, true, true);