You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by kl...@apache.org on 2019/05/07 16:22:12 UTC

[geode] branch develop updated (6defb1b -> d315756)

This is an automated email from the ASF dual-hosted git repository.

klund pushed a change to branch develop
in repository https://gitbox.apache.org/repos/asf/geode.git.


    from 6defb1b  GEODE-6743: Remove GFJsonObject and GFJsonArray classes (#3555)
     new 2a8259f  GEODE-6731: Make TestUtil delegate to ResourceUtils
     new 49a3eaa  GEODE-6731: Cleanup tests using ResourceUtils
     new d315756  GEODE-6742: Rename and move ExceptionsDUnitTest to integrationTest

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../geode/session/tests/ContainerInstall.java      |   75 +-
 ...scribeConfigAreFullyRedactedAcceptanceTest.java |   71 +-
 .../GradleBuildWithGeodeCoreAcceptanceTest.java    |   13 +-
 ...tandaloneClientManagementAPIAcceptanceTest.java |   14 +-
 .../internal/web/RestFunctionExecuteDUnitTest.java |   38 +-
 .../web/controllers/RestAPIsWithSSLDUnitTest.java  |   36 +-
 .../geode/AssemblyContentsIntegrationTest.java     |   17 +-
 .../org/apache/geode/BundledJarsJUnitTest.java     |   47 +-
 .../geode/GeodeDependencyJarIntegrationTest.java   |   14 +-
 .../rest/internal/web/RestSecurityWithSSLTest.java |    8 +-
 .../tools/pulse/PulseSecurityWithSSLTest.java      |   10 +-
 .../cli/CreateMappingCommandDUnitTest.java         |  309 ++--
 .../geode/ClusterCommunicationsDUnitTest.java      |  173 +-
 .../CacheServerSSLConnectionDUnitTest.java         |  361 ++--
 .../client/internal/SSLNoClientAuthDUnitTest.java  |  205 +--
 ...artitionedRegionCompactRangeIndexDUnitTest.java |  122 +-
 .../query/partitioned/PRQueryDUnitHelper.java      |  466 +++--
 .../apache/geode/cache30/CacheXml66DUnitTest.java  |  131 +-
 .../cache30/ReconnectWithCacheXMLDUnitTest.java    |   31 +-
 .../apache/geode/distributed/LocatorDUnitTest.java | 1918 ++++++++------------
 .../distributed/LocatorUDPSecurityDUnitTest.java   |   26 +-
 .../PartitionedRegionCacheXMLExampleDUnitTest.java |   15 +-
 .../cache/StartServerWithXmlDUnitTest.java         |   29 +-
 .../internal/jta/dunit/ExceptionsDUnitTest.java    |  294 ---
 .../internal/jta/dunit/IdleTimeOutDUnitTest.java   |    7 +-
 .../internal/jta/dunit/LoginTimeOutDUnitTest.java  |    7 +-
 .../internal/jta/dunit/MaxPoolSizeDUnitTest.java   |    7 +-
 .../jta/dunit/TransactionTimeOutDUnitTest.java     |    6 +-
 .../jta/dunit/TxnManagerMultiThreadDUnitTest.java  |    6 +-
 .../internal/jta/dunit/TxnTimeOutDUnitTest.java    |    6 +-
 .../geode/internal/tcp/TCPConduitDUnitTest.java    |    9 +-
 .../apache/geode/management/JMXMBeanDUnitTest.java |   16 +-
 ...DeployCommandFunctionRegistrationDUnitTest.java |    5 +-
 ...rConfigServerRestartWithJarDeployDUnitTest.java |    6 +-
 ...urationPersistenceServiceUsingDirDUnitTest.java |    7 +-
 .../configuration/DeployJarWithSSLDUnitTest.java   |    6 +-
 .../geode/pdx/JSONPdxClientServerDUnitTest.java    |    4 +-
 .../cache/client/internal/LocatorSSLJUnitTest.java |    5 +-
 .../index/DeclarativeIndexCreationJUnitTest.java   |    6 +-
 .../internal/tcpserver/TCPServerSSLJUnitTest.java  |    8 +-
 .../internal/cache/DiskRegCacheXmlJUnitTest.java   |    6 +-
 .../DiskRegionIllegalCacheXMLvaluesJUnitTest.java  |    5 +-
 .../tier/sockets/RedundancyLevelJUnitTest.java     |    6 +-
 .../AsyncEventQueueValidationsJUnitTest.java       |    8 +-
 .../datasource/AbstractPoolCacheJUnitTest.java     |    6 +-
 .../internal/datasource/CleanUpJUnitTest.java      |    7 +-
 .../ConnectionPoolCacheImplJUnitTest.java          |    5 +-
 .../datasource/ConnectionPoolingJUnitTest.java     |    6 +-
 .../datasource/DataSourceFactoryJUnitTest.java     |    6 +-
 .../internal/datasource/RestartJUnitTest.java      |    7 +-
 .../internal/jta/BlockingTimeOutJUnitTest.java     |    6 +-
 .../geode/internal/jta/DataSourceJTAJUnitTest.java |   18 +-
 .../internal/jta/GlobalTransactionJUnitTest.java   |    6 +-
 .../internal/jta/TransactionTimeOutJUnitTest.java  |    5 +-
 ...TransactionTimeoutExceptionIntegrationTest.java |  199 ++
 .../StatArchiveWriterReaderIntegrationTest.java    |   12 +-
 .../commands/HTTPServiceSSLSupportJUnitTest.java   |    5 +-
 .../internal/deployment/FunctionScannerTest.java   |    5 +-
 ...ionTimeoutExceptionIntegrationTest_cachejta.xml |  250 +++
 .../internal/membership/MembershipTestHook.java    |   14 +-
 .../cache/execute/FunctionAdapterJUnitTest.java    |    7 +-
 .../net/SocketCreatorFactoryJUnitTest.java         |   18 +-
 .../geode/internal/net/SocketCreatorJUnitTest.java |    4 +-
 .../geode/internal/util/PluckStacksUnitTest.java   |    6 +-
 .../generator/LdapUserCredentialGenerator.java     |   22 +-
 .../generator/PKCSCredentialGenerator.java         |   21 +-
 .../generator/XmlAuthzCredentialGenerator.java     |    9 +-
 .../apache/geode/experimental/driver/SSLTest.java  |   21 +-
 .../org/apache/geode/internal/jta/CacheUtils.java  |    6 +-
 .../org/apache/geode/test/util/ResourceUtils.java  |  198 +-
 .../java/org/apache/geode/util/test/TestUtil.java  |   81 -
 .../test/util/ResourceUtilsIntegrationTest.java    |    5 +-
 .../apache/geode/test/util/ResourceUtilsTest.java  |    4 +-
 .../cache/lucene/LuceneIndexCreationDUnitTest.java |    6 +-
 .../LuceneIndexXmlParserIntegrationJUnitTest.java  |    6 +-
 .../acceptance/CacheConnectionIntegrationTest.java |   15 +-
 .../v1/acceptance/CacheOperationsJUnitTest.java    |   18 +-
 .../geode/internal/cache/wan/WANTestBase.java      |   18 +-
 ...ewayReceiverXmlParsingValidationsJUnitTest.java |   14 +-
 .../cli/commands/ConnectCommandWithSSLTest.java    |    6 +-
 80 files changed, 2730 insertions(+), 2871 deletions(-)
 delete mode 100755 geode-core/src/distributedTest/java/org/apache/geode/internal/jta/dunit/ExceptionsDUnitTest.java
 create mode 100755 geode-core/src/integrationTest/java/org/apache/geode/internal/jta/TransactionTimeoutExceptionIntegrationTest.java
 create mode 100644 geode-core/src/integrationTest/resources/org/apache/geode/internal/jta/TransactionTimeoutExceptionIntegrationTest_cachejta.xml
 delete mode 100644 geode-junit/src/main/java/org/apache/geode/util/test/TestUtil.java


[geode] 02/03: GEODE-6731: Cleanup tests using ResourceUtils

Posted by kl...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

klund pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode.git

commit 49a3eaad3c492bbe96a58da8c48461f34026c3cf
Author: Kirk Lund <kl...@apache.org>
AuthorDate: Mon May 6 11:52:16 2019 -0700

    GEODE-6731: Cleanup tests using ResourceUtils
---
 .../geode/session/tests/ContainerInstall.java      |   71 +-
 .../GradleBuildWithGeodeCoreAcceptanceTest.java    |    6 +-
 ...tandaloneClientManagementAPIAcceptanceTest.java |    4 +-
 .../internal/web/RestFunctionExecuteDUnitTest.java |   30 +-
 .../web/controllers/RestAPIsWithSSLDUnitTest.java  |   19 +-
 .../geode/AssemblyContentsIntegrationTest.java     |   12 +-
 .../org/apache/geode/BundledJarsJUnitTest.java     |   42 +-
 .../geode/GeodeDependencyJarIntegrationTest.java   |    8 +-
 .../rest/internal/web/RestSecurityWithSSLTest.java |    3 +-
 .../tools/pulse/PulseSecurityWithSSLTest.java      |    4 +-
 .../cli/CreateMappingCommandDUnitTest.java         |  308 ++--
 .../geode/ClusterCommunicationsDUnitTest.java      |  170 +-
 .../CacheServerSSLConnectionDUnitTest.java         |  341 ++--
 .../client/internal/SSLNoClientAuthDUnitTest.java  |  185 +-
 ...artitionedRegionCompactRangeIndexDUnitTest.java |  117 +-
 .../query/partitioned/PRQueryDUnitHelper.java      |  460 +++--
 .../apache/geode/cache30/CacheXml66DUnitTest.java  |  117 +-
 .../cache30/ReconnectWithCacheXMLDUnitTest.java    |   25 +-
 .../apache/geode/distributed/LocatorDUnitTest.java | 1908 ++++++++------------
 .../distributed/LocatorUDPSecurityDUnitTest.java   |   26 +-
 .../PartitionedRegionCacheXMLExampleDUnitTest.java |   10 +-
 .../cache/StartServerWithXmlDUnitTest.java         |   24 +-
 .../internal/membership/MembershipTestHook.java    |   14 +-
 23 files changed, 1697 insertions(+), 2207 deletions(-)

diff --git a/geode-assembly/geode-assembly-test/src/main/java/org/apache/geode/session/tests/ContainerInstall.java b/geode-assembly/geode-assembly-test/src/main/java/org/apache/geode/session/tests/ContainerInstall.java
index 09d8e95..c52e1f4 100644
--- a/geode-assembly/geode-assembly-test/src/main/java/org/apache/geode/session/tests/ContainerInstall.java
+++ b/geode-assembly/geode-assembly-test/src/main/java/org/apache/geode/session/tests/ContainerInstall.java
@@ -58,14 +58,15 @@ import org.apache.geode.management.internal.configuration.utils.ZipUtils;
  * Subclasses provide installation of specific containers.
  */
 public abstract class ContainerInstall {
+
   private final IntSupplier portSupplier;
-  public static final Logger logger = LogService.getLogger();
-  public static final String TMP_DIR = createTempDir();
-  public static final String GEODE_BUILD_HOME = System.getenv("GEODE_HOME");
-  public static final String GEODE_BUILD_HOME_LIB = GEODE_BUILD_HOME + "/lib/";
-  public static final String DEFAULT_INSTALL_DIR = TMP_DIR + "/cargo_containers/";
-  public static final String DEFAULT_MODULE_EXTRACTION_DIR = TMP_DIR + "/cargo_modules/";
-  protected static final String DEFAULT_MODULE_LOCATION = GEODE_BUILD_HOME + "/tools/Modules/";
+  static final Logger logger = LogService.getLogger();
+  static final String TMP_DIR = createTempDir();
+  static final String GEODE_BUILD_HOME = System.getenv("GEODE_HOME");
+  static final String GEODE_BUILD_HOME_LIB = GEODE_BUILD_HOME + "/lib/";
+  private static final String DEFAULT_INSTALL_DIR = TMP_DIR + "/cargo_containers/";
+  private static final String DEFAULT_MODULE_EXTRACTION_DIR = TMP_DIR + "/cargo_modules/";
+  static final String DEFAULT_MODULE_LOCATION = GEODE_BUILD_HOME + "/tools/Modules/";
 
   protected IntSupplier portSupplier() {
     return portSupplier;
@@ -120,8 +121,6 @@ public abstract class ContainerInstall {
     public boolean isClientServer() {
       return isClientServer;
     }
-
-
   }
 
   public ContainerInstall(String name, String downloadURL, ConnectionType connectionType,
@@ -169,14 +168,14 @@ public abstract class ContainerInstall {
     logger.info("Installed container into " + getHome());
   }
 
-  public ServerContainer generateContainer(String containerDescriptors) throws IOException {
+  ServerContainer generateContainer(String containerDescriptors) throws IOException {
     return generateContainer(null, containerDescriptors);
   }
 
   /**
    * Cleans up the installation by deleting the extracted module and downloaded installation folders
    */
-  public void clearPreviousInstall(String installDir) throws IOException {
+  private void clearPreviousInstall(String installDir) throws IOException {
     File installFolder = new File(installDir);
     // Remove installs from previous runs in the same folder
     if (installFolder.exists()) {
@@ -185,7 +184,7 @@ public abstract class ContainerInstall {
     }
   }
 
-  public void setDefaultLocatorPort(int port) {
+  void setDefaultLocatorPort(int port) {
     defaultLocatorPort = port;
   }
 
@@ -195,7 +194,7 @@ public abstract class ContainerInstall {
    * Since an installation can only be client server or peer to peer there is no need for a function
    * which checks for a peer to peer installation (just check if not client server).
    */
-  public boolean isClientServer() {
+  boolean isClientServer() {
     return connType.isClientServer();
   }
 
@@ -212,14 +211,14 @@ public abstract class ContainerInstall {
    * The module contains jars needed for geode session setup as well as default templates for some
    * needed XML files.
    */
-  public String getModulePath() {
+  String getModulePath() {
     return modulePath;
   }
 
   /**
    * The path to the session testing WAR file
    */
-  public String getWarFilePath() {
+  String getWarFilePath() {
     return warFilePath;
   }
 
@@ -227,7 +226,7 @@ public abstract class ContainerInstall {
    * @return The enum {@link #connType} which represents the type of connection for this
    *         installation
    */
-  public ConnectionType getConnectionType() {
+  ConnectionType getConnectionType() {
     return connType;
   }
 
@@ -237,7 +236,7 @@ public abstract class ContainerInstall {
    * This is the address that a container uses by default. Containers themselves can have their own
    * personal locator address, but will default to this address unless specifically set.
    */
-  public String getDefaultLocatorAddress() {
+  String getDefaultLocatorAddress() {
     return defaultLocatorAddress;
   }
 
@@ -247,14 +246,14 @@ public abstract class ContainerInstall {
    * This is the port that a container uses by default. Containers themselves can have their own
    * personal locator port, but will default to this port unless specifically set.
    */
-  public int getDefaultLocatorPort() {
+  int getDefaultLocatorPort() {
     return defaultLocatorPort;
   }
 
   /**
    * Gets the cache XML file to use by default for this installation
    */
-  public File getCacheXMLFile() {
+  File getCacheXMLFile() {
     return new File(modulePath + "/conf/" + getConnectionType().getCacheXMLFileName());
   }
 
@@ -287,7 +286,7 @@ public abstract class ContainerInstall {
    * NOTE::This walks into the extensions folder and then uses a hardcoded path from there making it
    * very unreliable if things are moved.
    */
-  protected static String findSessionTestingWar() {
+  private static String findSessionTestingWar() {
     // Start out searching directory above current
     String curPath = "../";
 
@@ -322,15 +321,15 @@ public abstract class ContainerInstall {
    *        extract. Used as a search parameter to find the module archive.
    * @return The path to the non-archive (extracted) version of the module files
    */
-  protected static String findAndExtractModule(String geodeModuleLocation, String moduleName)
+  private static String findAndExtractModule(String geodeModuleLocation, String moduleName)
       throws IOException {
-    File modulePath = null;
     File modulesDir = new File(geodeModuleLocation);
 
-    boolean archive = false;
     logger.info("Trying to access build dir " + modulesDir);
 
     // Search directory for tomcat module folder/zip
+    boolean archive = false;
+    File modulePath = null;
     for (File file : modulesDir.listFiles()) {
 
       if (file.getName().toLowerCase().contains(moduleName)) {
@@ -386,7 +385,7 @@ public abstract class ContainerInstall {
    *        property value the current value. If false, replaces the current property value with the
    *        given property value
    */
-  protected static void editPropertyFile(String filePath, String propertyName, String propertyValue,
+  static void editPropertyFile(String filePath, String propertyName, String propertyValue,
       boolean append) throws Exception {
     FileInputStream input = new FileInputStream(filePath);
     Properties properties = new Properties();
@@ -405,29 +404,17 @@ public abstract class ContainerInstall {
     logger.info("Modified container Property file " + filePath);
   }
 
-  protected static void editXMLFile(String XMLPath, String tagId, String tagName,
+  static void editXMLFile(String XMLPath, String tagId, String tagName,
       String parentTagName, HashMap<String, String> attributes) {
     editXMLFile(XMLPath, tagId, tagName, tagName, parentTagName, attributes, false);
   }
 
-  protected static void editXMLFile(String XMLPath, String tagName, String parentTagName,
-      HashMap<String, String> attributes) {
-    editXMLFile(XMLPath, tagName, parentTagName, attributes, false);
-  }
-
-  protected static void editXMLFile(String XMLPath, String tagName, String parentTagName,
+  static void editXMLFile(String XMLPath, String tagName, String parentTagName,
       HashMap<String, String> attributes, boolean writeOnSimilarAttributeNames) {
     editXMLFile(XMLPath, null, tagName, tagName, parentTagName, attributes,
         writeOnSimilarAttributeNames);
   }
 
-  protected static void editXMLFile(String XMLPath, String tagName, String replacementTagName,
-      String parentTagName, HashMap<String, String> attributes,
-      boolean writeOnSimilarAttributeNames) {
-    editXMLFile(XMLPath, null, tagName, replacementTagName, parentTagName, attributes,
-        writeOnSimilarAttributeNames);
-  }
-
   /**
    * Edit the given xml file
    *
@@ -448,7 +435,7 @@ public abstract class ContainerInstall {
    *        rather than adding a new element. If false, create a new XML element (unless tagId is
    *        not null).
    */
-  protected static void editXMLFile(String XMLPath, String tagId, String tagName,
+  private static void editXMLFile(String XMLPath, String tagId, String tagName,
       String replacementTagName, String parentTagName, HashMap<String, String> attributes,
       boolean writeOnSimilarAttributeNames) {
 
@@ -586,7 +573,7 @@ public abstract class ContainerInstall {
     for (String key : attributes.keySet()) {
       Node attr = nodeAttrs.getNamedItem(key);
       if (attr == null
-          || (checkSimilarValues && !attr.getTextContent().equals(attributes.get(key)))) {
+          || checkSimilarValues && !attr.getTextContent().equals(attributes.get(key))) {
         return false;
       }
     }
@@ -594,8 +581,8 @@ public abstract class ContainerInstall {
     // Check to make sure the node does not have more than the attribute fields
     for (int i = 0; i < nodeAttrs.getLength(); i++) {
       String attr = nodeAttrs.item(i).getNodeName();
-      if (attributes.get(attr) == null || (checkSimilarValues
-          && !attributes.get(attr).equals(nodeAttrs.item(i).getTextContent()))) {
+      if (attributes.get(attr) == null || checkSimilarValues
+          && !attributes.get(attr).equals(nodeAttrs.item(i).getTextContent())) {
         return false;
       }
     }
diff --git a/geode-assembly/src/acceptanceTest/java/org/apache/geode/management/internal/rest/GradleBuildWithGeodeCoreAcceptanceTest.java b/geode-assembly/src/acceptanceTest/java/org/apache/geode/management/internal/rest/GradleBuildWithGeodeCoreAcceptanceTest.java
index 014ac84..229e054 100644
--- a/geode-assembly/src/acceptanceTest/java/org/apache/geode/management/internal/rest/GradleBuildWithGeodeCoreAcceptanceTest.java
+++ b/geode-assembly/src/acceptanceTest/java/org/apache/geode/management/internal/rest/GradleBuildWithGeodeCoreAcceptanceTest.java
@@ -12,7 +12,6 @@
  * or implied. See the License for the specific language governing permissions and limitations under
  * the License.
  */
-
 package org.apache.geode.management.internal.rest;
 
 import static org.apache.geode.test.util.ResourceUtils.copyDirectoryResource;
@@ -41,7 +40,7 @@ public class GradleBuildWithGeodeCoreAcceptanceTest {
   public TemporaryFolder temp = new TemporaryFolder();
 
   @Test
-  public void testBasicGradleBuild() throws Exception {
+  public void testBasicGradleBuild() {
     URL projectDir = getResource("/gradle-test-projects/management");
     assertThat(projectDir).isNotNull();
 
@@ -65,12 +64,11 @@ public class GradleBuildWithGeodeCoreAcceptanceTest {
     build.setStandardOutput(System.out);
     build.withArguments("-Pversion=" + geodeVersion,
         "-Pgroup=" + projectGroup,
-        "-PgeodeHome=" + geodeHome.toString());
+        "-PgeodeHome=" + geodeHome);
 
     build.forTasks("installDist", "run");
     build.run();
 
     connection.close();
   }
-
 }
diff --git a/geode-assembly/src/acceptanceTest/java/org/apache/geode/management/internal/rest/StandaloneClientManagementAPIAcceptanceTest.java b/geode-assembly/src/acceptanceTest/java/org/apache/geode/management/internal/rest/StandaloneClientManagementAPIAcceptanceTest.java
index 9832c58..20ddc37 100644
--- a/geode-assembly/src/acceptanceTest/java/org/apache/geode/management/internal/rest/StandaloneClientManagementAPIAcceptanceTest.java
+++ b/geode-assembly/src/acceptanceTest/java/org/apache/geode/management/internal/rest/StandaloneClientManagementAPIAcceptanceTest.java
@@ -12,7 +12,6 @@
  * or implied. See the License for the specific language governing permissions and limitations under
  * the License.
  */
-
 package org.apache.geode.management.internal.rest;
 
 import static org.apache.geode.test.util.ResourceUtils.createTempFileFromResource;
@@ -69,7 +68,7 @@ public class StandaloneClientManagementAPIAcceptanceTest {
 
   @BeforeClass
   public static void beforeClass() {
-    /**
+    /*
      * This file was generated with:
      * keytool -genkey -dname "CN=localhost" -alias self -validity 3650 -keyalg EC \
      * -keystore trusted.keystore -keypass password -storepass password \
@@ -82,7 +81,6 @@ public class StandaloneClientManagementAPIAcceptanceTest {
   }
 
   @Test
-  @Parameterized.Parameters
   public void clientCreatesRegionUsingClusterManagementService() throws Exception {
     JarBuilder jarBuilder = new JarBuilder();
     String filePath =
diff --git a/geode-assembly/src/distributedTest/java/org/apache/geode/rest/internal/web/RestFunctionExecuteDUnitTest.java b/geode-assembly/src/distributedTest/java/org/apache/geode/rest/internal/web/RestFunctionExecuteDUnitTest.java
index 1197785..dd63738 100644
--- a/geode-assembly/src/distributedTest/java/org/apache/geode/rest/internal/web/RestFunctionExecuteDUnitTest.java
+++ b/geode-assembly/src/distributedTest/java/org/apache/geode/rest/internal/web/RestFunctionExecuteDUnitTest.java
@@ -12,10 +12,8 @@
  * or implied. See the License for the specific language governing permissions and limitations under
  * the License.
  */
-
 package org.apache.geode.rest.internal.web;
 
-
 import static org.apache.geode.test.junit.rules.HttpResponseAssert.assertResponse;
 import static org.apache.geode.test.util.ResourceUtils.createTempFileFromResource;
 import static org.assertj.core.api.Assertions.assertThat;
@@ -38,7 +36,7 @@ import org.apache.geode.test.junit.categories.RestAPITest;
 import org.apache.geode.test.junit.rules.GeodeDevRestClient;
 import org.apache.geode.test.junit.rules.GfshCommandRule;
 
-@Category({RestAPITest.class})
+@Category(RestAPITest.class)
 public class RestFunctionExecuteDUnitTest {
 
   @ClassRule
@@ -47,8 +45,11 @@ public class RestFunctionExecuteDUnitTest {
   @ClassRule
   public static GfshCommandRule gfsh = new GfshCommandRule();
 
-  private static JarBuilder jarBuilder = new JarBuilder();
-  private static MemberVM locator, server1, server2;
+  private static final JarBuilder jarBuilder = new JarBuilder();
+
+  private static MemberVM locator;
+  private static MemberVM server1;
+  private static MemberVM server2;
 
   private GeodeDevRestClient client;
 
@@ -58,20 +59,19 @@ public class RestFunctionExecuteDUnitTest {
     File jarsToDeploy = new File(gfsh.getWorkingDir(), "function.jar");
     jarBuilder.buildJar(jarsToDeploy, loadClassToFile());
 
-
     Properties locatorProps = new Properties();
-    locatorProps.put(ConfigurationProperties.SECURITY_MANAGER,
+    locatorProps.setProperty(ConfigurationProperties.SECURITY_MANAGER,
         SimpleSecurityManager.class.getName());
     locator = cluster.startLocatorVM(0, locatorProps);
 
     Properties props = new Properties();
-    props.put(ConfigurationProperties.START_DEV_REST_API, "true");
-    props.put("security-username", "cluster");
-    props.put("security-password", "cluster");
-    props.put(ConfigurationProperties.GROUPS, "group1");
+    props.setProperty(ConfigurationProperties.START_DEV_REST_API, "true");
+    props.setProperty("security-username", "cluster");
+    props.setProperty("security-password", "cluster");
+    props.setProperty(ConfigurationProperties.GROUPS, "group1");
     server1 = cluster.startServerVM(1, props, locator.getPort());
 
-    props.put(ConfigurationProperties.GROUPS, "group2");
+    props.setProperty(ConfigurationProperties.GROUPS, "group2");
     server2 = cluster.startServerVM(2, props, locator.getPort());
 
     gfsh.connectAndVerify(locator);
@@ -82,7 +82,7 @@ public class RestFunctionExecuteDUnitTest {
   }
 
   @Test
-  public void connectToServer1() throws Exception {
+  public void connectToServer1() {
     client = new GeodeDevRestClient("localhost", server1.getHttpPort());
     assertResponse(client.doPost("/functions/myTestFunction", "dataRead", "dataRead", ""))
         .hasStatusCode(403);
@@ -101,7 +101,7 @@ public class RestFunctionExecuteDUnitTest {
   }
 
   @Test
-  public void connectToServer2() throws Exception {
+  public void connectToServer2() {
     // function is deployed on server1
     client = new GeodeDevRestClient("localhost", server2.getHttpPort());
     assertResponse(client.doPost("/functions/myTestFunction", "dataRead", "dataRead", ""))
@@ -118,6 +118,4 @@ public class RestFunctionExecuteDUnitTest {
 
     return new File(resourcePath);
   }
-
-
 }
diff --git a/geode-assembly/src/distributedTest/java/org/apache/geode/rest/internal/web/controllers/RestAPIsWithSSLDUnitTest.java b/geode-assembly/src/distributedTest/java/org/apache/geode/rest/internal/web/controllers/RestAPIsWithSSLDUnitTest.java
index 2715ce0..68d94c1 100644
--- a/geode-assembly/src/distributedTest/java/org/apache/geode/rest/internal/web/controllers/RestAPIsWithSSLDUnitTest.java
+++ b/geode-assembly/src/distributedTest/java/org/apache/geode/rest/internal/web/controllers/RestAPIsWithSSLDUnitTest.java
@@ -76,22 +76,27 @@ import org.apache.geode.cache.client.ClientRegionShortcut;
 import org.apache.geode.internal.security.SecurableCommunicationChannel;
 import org.apache.geode.test.dunit.rules.ClientVM;
 import org.apache.geode.test.dunit.rules.ClusterStartupRule;
+import org.apache.geode.test.dunit.rules.DistributedRestoreSystemProperties;
 import org.apache.geode.test.dunit.rules.MemberVM;
 import org.apache.geode.test.junit.categories.RestAPITest;
 
 /**
  * @since GemFire 8.0
  */
-@Category({RestAPITest.class})
+@Category(RestAPITest.class)
 public class RestAPIsWithSSLDUnitTest {
+
   private static final String PEOPLE_REGION_NAME = "People";
   private static final String INVALID_CLIENT_ALIAS = "INVALID_CLIENT_ALIAS";
 
-  public String urlContext = "/geode";
+  private String urlContext = "/geode";
 
   @Rule
   public ClusterStartupRule cluster = new ClusterStartupRule();
 
+  @Rule
+  public DistributedRestoreSystemProperties restoreSystemProperties =
+      new DistributedRestoreSystemProperties();
 
   private MemberVM server;
   private ClientVM client;
@@ -168,7 +173,6 @@ public class RestAPIsWithSSLDUnitTest {
   }
 
   private static CloseableHttpClient getSSLBasedHTTPClient(Properties properties) throws Exception {
-
     KeyStore clientKeys = KeyStore.getInstance("JKS");
     File keystoreJKSForPath = findKeyStoreJKS(properties);
     clientKeys.load(new FileInputStream(keystoreJKSForPath), "password".toCharArray());
@@ -193,7 +197,7 @@ public class RestAPIsWithSSLDUnitTest {
           }
         }).build();
 
-    // Host checking is disabled here , as tests might run on multiple hosts and
+    // Host checking is disabled here, as tests might run on multiple hosts and
     // host entries can not be assumed
     SSLConnectionSocketFactory sslConnectionSocketFactory = new SSLConnectionSocketFactory(
         sslcontext, SSLConnectionSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER);
@@ -229,11 +233,8 @@ public class RestAPIsWithSSLDUnitTest {
     assertEquals(json.get("gender").asText(), Gender.FEMALE.name());
   }
 
-  // Actual Tests starts here.
-
   @Test
   public void testSimpleSSL() throws Exception {
-
     Properties props = new Properties();
     props.setProperty(SSL_KEYSTORE, findTrustedJKSWithSingleEntry().getCanonicalPath());
     props.setProperty(SSL_TRUSTSTORE, findTrustedJKSWithSingleEntry().getCanonicalPath());
@@ -247,7 +248,6 @@ public class RestAPIsWithSSLDUnitTest {
 
   @Test
   public void testSimpleSSLWithMultiKey_KeyStore() throws Exception {
-
     Properties props = new Properties();
     props.setProperty(SSL_KEYSTORE,
         createTempFileFromResource(getClass(), "/org/apache/geode/internal/net/multiKey.jks")
@@ -267,7 +267,6 @@ public class RestAPIsWithSSLDUnitTest {
 
   @Test(expected = RuntimeException.class)
   public void testSimpleSSLWithMultiKey_KeyStore_WithInvalidClientKey() throws Exception {
-
     Properties props = new Properties();
     props.setProperty(SSL_KEYSTORE,
         createTempFileFromResource(getClass(), "/org/apache/geode/internal/net/multiKey.jks")
@@ -461,7 +460,6 @@ public class RestAPIsWithSSLDUnitTest {
 
   @Test
   public void testSimpleSSLLegacy() throws Exception {
-
     Properties props = new Properties();
     props.setProperty(HTTP_SERVICE_SSL_ENABLED, "true");
     props.setProperty(HTTP_SERVICE_SSL_KEYSTORE,
@@ -590,5 +588,4 @@ public class RestAPIsWithSSLDUnitTest {
     startClusterWithSSL(props);
     validateConnection(props);
   }
-
 }
diff --git a/geode-assembly/src/integrationTest/java/org/apache/geode/AssemblyContentsIntegrationTest.java b/geode-assembly/src/integrationTest/java/org/apache/geode/AssemblyContentsIntegrationTest.java
index 5ae9486..1e8632e 100644
--- a/geode-assembly/src/integrationTest/java/org/apache/geode/AssemblyContentsIntegrationTest.java
+++ b/geode-assembly/src/integrationTest/java/org/apache/geode/AssemblyContentsIntegrationTest.java
@@ -28,17 +28,23 @@ import java.util.stream.Collectors;
 
 import org.apache.commons.io.FileUtils;
 import org.junit.Before;
+import org.junit.Rule;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
 import org.apache.geode.test.junit.categories.RestAPITest;
+import org.apache.geode.test.junit.rules.RequiresGeodeHome;
 
-@Category({RestAPITest.class})
+@Category(RestAPITest.class)
 public class AssemblyContentsIntegrationTest {
 
   private static final String GEODE_HOME = System.getenv("GEODE_HOME");
+
   private Collection<String> expectedAssemblyContent;
 
+  @Rule
+  public RequiresGeodeHome requiresGeodeHome = new RequiresGeodeHome();
+
   @Before
   public void loadExpectedAssemblyContent() throws IOException {
     String assemblyContent =
@@ -55,7 +61,7 @@ public class AssemblyContentsIntegrationTest {
     Files.write(Paths.get("assembly_content.txt"), currentAssemblyContent);
 
     assertThat(currentAssemblyContent)
-        .describedAs("The assembly contents have changed. Verify dependencies and "
+        .as("The assembly contents have changed. Verify dependencies and "
             + "copy geode-assembly/build/integrationTest/assembly_content.txt to "
             + "geode-assembly/src/integrationTest/resources/assembly_content.txt")
         .containsExactlyElementsOf(expectedAssemblyContent);
@@ -69,7 +75,7 @@ public class AssemblyContentsIntegrationTest {
     Path geodeHomePath = Paths.get(GEODE_HOME);
 
     assertThat(geodeHomeDirectory)
-        .describedAs(
+        .as(
             "Please set the GEODE_HOME environment variable to the product installation directory.")
         .isDirectory();
 
diff --git a/geode-assembly/src/integrationTest/java/org/apache/geode/BundledJarsJUnitTest.java b/geode-assembly/src/integrationTest/java/org/apache/geode/BundledJarsJUnitTest.java
index bdc8ba4..d0c4818 100644
--- a/geode-assembly/src/integrationTest/java/org/apache/geode/BundledJarsJUnitTest.java
+++ b/geode-assembly/src/integrationTest/java/org/apache/geode/BundledJarsJUnitTest.java
@@ -19,9 +19,11 @@ import static org.junit.Assert.assertTrue;
 
 import java.io.File;
 import java.io.IOException;
+import java.io.UncheckedIOException;
 import java.nio.file.Files;
 import java.nio.file.Paths;
 import java.util.Collection;
+import java.util.Map;
 import java.util.Set;
 import java.util.TreeMap;
 import java.util.TreeSet;
@@ -31,18 +33,24 @@ import java.util.stream.Stream;
 
 import org.apache.commons.io.FileUtils;
 import org.junit.Before;
+import org.junit.Rule;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
 import org.apache.geode.test.junit.categories.RestAPITest;
+import org.apache.geode.test.junit.rules.RequiresGeodeHome;
 
-@Category({RestAPITest.class})
+@Category(RestAPITest.class)
 public class BundledJarsJUnitTest {
 
   private static final String VERSION_PATTERN = "[0-9-_.v]{3,}.*\\.jar$";
   private static final String GEODE_HOME = System.getenv("GEODE_HOME");
+
   private Set<String> expectedJars;
 
+  @Rule
+  public RequiresGeodeHome requiresGeodeHome = new RequiresGeodeHome();
+
   @Before
   public void loadExpectedJars() throws IOException {
     String expectedJarFile =
@@ -54,34 +62,39 @@ public class BundledJarsJUnitTest {
 
   @Test
   public void verifyBundledJarsHaveNotChanged() throws IOException {
-    TreeMap<String, String> sortedJars = getBundledJars();
+    Map<String, String> sortedJars = getBundledJars();
     Stream<String> lines =
         sortedJars.entrySet().stream().map(entry -> removeVersion(entry.getKey()));
     Set<String> bundledJarNames = new TreeSet<>(lines.collect(Collectors.toSet()));
 
     Files.write(Paths.get("bundled_jars.txt"), bundledJarNames);
 
-    TreeSet<String> newJars = new TreeSet<>(bundledJarNames);
+    Set<String> newJars = new TreeSet<>(bundledJarNames);
     newJars.removeAll(expectedJars);
-    TreeSet<String> missingJars = new TreeSet<>(expectedJars);
+
+    Set<String> missingJars = new TreeSet<>(expectedJars);
     missingJars.removeAll(bundledJarNames);
 
     String message =
         "The bundled jars have changed. Please make sure you update the licence and notice"
-            + "\nas described in https://cwiki.apache.org/confluence/display/GEODE/License+Guide+for+Contributors"
-            + "\nWhen fixed, copy geode-assembly/build/test/bundled_jars.txt"
-            + "\nto src/test/resources/expected_jars.txt" + "\nRemoved Jars\n--------------\n"
-            + String.join("\n", missingJars) + "\n\nAdded Jars\n--------------\n"
-            + String.join("\n", newJars) + "\n\n";
+            + System.lineSeparator()
+            + "as described in https://cwiki.apache.org/confluence/display/GEODE/License+Guide+for+Contributors"
+            + System.lineSeparator() + "When fixed, copy geode-assembly/build/test/bundled_jars.txt"
+            + System.lineSeparator() + "to src/test/resources/expected_jars.txt"
+            + System.lineSeparator() + "Removed Jars" + System.lineSeparator() + "--------------"
+            + System.lineSeparator() + String.join(System.lineSeparator(), missingJars)
+            + System.lineSeparator() + System.lineSeparator() + "Added Jars"
+            + System.lineSeparator() + "--------------" + System.lineSeparator()
+            + String.join(System.lineSeparator(), newJars) + System.lineSeparator()
+            + System.lineSeparator();
 
     assertTrue(message, expectedJars.equals(bundledJarNames));
-
   }
 
   /**
    * Find all of the jars bundled with the project. Key is the name of the jar, value is the path.
    */
-  private TreeMap<String, String> getBundledJars() {
+  private Map<String, String> getBundledJars() {
     File geodeHomeDirectory = new File(GEODE_HOME);
 
     assertTrue(
@@ -89,11 +102,11 @@ public class BundledJarsJUnitTest {
         geodeHomeDirectory.isDirectory());
 
     Collection<File> jars = FileUtils.listFiles(geodeHomeDirectory, new String[] {"jar"}, true);
-    TreeMap<String, String> sortedJars = new TreeMap<>();
+    Map<String, String> sortedJars = new TreeMap<>();
     jars.forEach(jar -> sortedJars.put(jar.getName(), jar.getPath()));
 
     Collection<File> wars = FileUtils.listFiles(geodeHomeDirectory, new String[] {"war"}, true);
-    TreeSet<File> sortedWars = new TreeSet<>(wars);
+    Set<File> sortedWars = new TreeSet<>(wars);
     sortedWars.stream().flatMap(BundledJarsJUnitTest::extractJarNames)
         .forEach(jar -> sortedJars.put(jar.getName(), jar.getPath()));
 
@@ -118,8 +131,7 @@ public class BundledJarsJUnitTest {
           // Materialize the list of files while the war is still open
           .collect(Collectors.toList()).stream();
     } catch (IOException e) {
-      throw new RuntimeException(e);
+      throw new UncheckedIOException(e);
     }
   }
-
 }
diff --git a/geode-assembly/src/integrationTest/java/org/apache/geode/GeodeDependencyJarIntegrationTest.java b/geode-assembly/src/integrationTest/java/org/apache/geode/GeodeDependencyJarIntegrationTest.java
index c5998d1..7b8a6ea 100644
--- a/geode-assembly/src/integrationTest/java/org/apache/geode/GeodeDependencyJarIntegrationTest.java
+++ b/geode-assembly/src/integrationTest/java/org/apache/geode/GeodeDependencyJarIntegrationTest.java
@@ -28,17 +28,23 @@ import java.util.jar.Manifest;
 import java.util.stream.Collectors;
 
 import org.junit.Before;
+import org.junit.Rule;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
 import org.apache.geode.test.junit.categories.RestAPITest;
+import org.apache.geode.test.junit.rules.RequiresGeodeHome;
 
-@Category({RestAPITest.class})
+@Category(RestAPITest.class)
 public class GeodeDependencyJarIntegrationTest {
 
   private static final String GEODE_HOME = System.getenv("GEODE_HOME");
+
   private List<String> expectedClasspathElements;
 
+  @Rule
+  public RequiresGeodeHome requiresGeodeHome = new RequiresGeodeHome();
+
   @Before
   public void loadExpectedClassPath() throws IOException {
     String dependencyClasspath =
diff --git a/geode-assembly/src/integrationTest/java/org/apache/geode/rest/internal/web/RestSecurityWithSSLTest.java b/geode-assembly/src/integrationTest/java/org/apache/geode/rest/internal/web/RestSecurityWithSSLTest.java
index 0bc239b..32f83f5 100644
--- a/geode-assembly/src/integrationTest/java/org/apache/geode/rest/internal/web/RestSecurityWithSSLTest.java
+++ b/geode-assembly/src/integrationTest/java/org/apache/geode/rest/internal/web/RestSecurityWithSSLTest.java
@@ -12,7 +12,6 @@
  * or implied. See the License for the specific language governing permissions and limitations under
  * the License.
  */
-
 package org.apache.geode.rest.internal.web;
 
 import static org.apache.geode.distributed.ConfigurationProperties.SECURITY_MANAGER;
@@ -43,7 +42,7 @@ import org.apache.geode.test.junit.rules.ServerStarterRule;
 @Category({SecurityTest.class, RestAPITest.class})
 public class RestSecurityWithSSLTest {
 
-  private static File KEYSTORE_FILE =
+  private static final File KEYSTORE_FILE =
       new File(createTempFileFromResource(RestSecurityWithSSLTest.class, "/ssl/trusted.keystore")
           .getAbsolutePath());
 
diff --git a/geode-assembly/src/integrationTest/java/org/apache/geode/tools/pulse/PulseSecurityWithSSLTest.java b/geode-assembly/src/integrationTest/java/org/apache/geode/tools/pulse/PulseSecurityWithSSLTest.java
index b5caa1f..3b899a2 100644
--- a/geode-assembly/src/integrationTest/java/org/apache/geode/tools/pulse/PulseSecurityWithSSLTest.java
+++ b/geode-assembly/src/integrationTest/java/org/apache/geode/tools/pulse/PulseSecurityWithSSLTest.java
@@ -12,7 +12,6 @@
  * or implied. See the License for the specific language governing permissions and limitations under
  * the License.
  */
-
 package org.apache.geode.tools.pulse;
 
 import static org.apache.geode.distributed.ConfigurationProperties.CLUSTER_SSL_ENABLED;
@@ -60,7 +59,7 @@ import org.apache.geode.test.junit.rules.LocatorStarterRule;
 @Category({SecurityTest.class, PulseTest.class})
 public class PulseSecurityWithSSLTest {
 
-  private static File jks =
+  private static final File jks =
       new File(createTempFileFromResource(PulseSecurityWithSSLTest.class, "/ssl/trusted.keystore")
           .getAbsolutePath());
 
@@ -132,5 +131,4 @@ public class PulseSecurityWithSSLTest {
 
     assertThat(JsonPath.parse(body).read("$.SystemAlerts.connectedFlag", Boolean.class)).isTrue();
   }
-
 }
diff --git a/geode-connectors/src/distributedTest/java/org/apache/geode/connectors/jdbc/internal/cli/CreateMappingCommandDUnitTest.java b/geode-connectors/src/distributedTest/java/org/apache/geode/connectors/jdbc/internal/cli/CreateMappingCommandDUnitTest.java
index e04519f..94d6a13 100644
--- a/geode-connectors/src/distributedTest/java/org/apache/geode/connectors/jdbc/internal/cli/CreateMappingCommandDUnitTest.java
+++ b/geode-connectors/src/distributedTest/java/org/apache/geode/connectors/jdbc/internal/cli/CreateMappingCommandDUnitTest.java
@@ -31,7 +31,6 @@ import static org.assertj.core.api.Assertions.assertThat;
 import java.io.File;
 import java.io.FileOutputStream;
 import java.io.IOException;
-import java.net.URISyntaxException;
 import java.sql.Connection;
 import java.sql.JDBCType;
 import java.sql.SQLException;
@@ -81,7 +80,7 @@ import org.apache.geode.test.junit.rules.GfshCommandRule;
 import org.apache.geode.test.junit.rules.serializable.SerializableTemporaryFolder;
 import org.apache.geode.test.junit.rules.serializable.SerializableTestName;
 
-@Category({JDBCConnectorTest.class})
+@Category(JDBCConnectorTest.class)
 public class CreateMappingCommandDUnitTest {
 
   private static final String TEST_REGION = "testRegion";
@@ -126,7 +125,7 @@ public class CreateMappingCommandDUnitTest {
   }
 
   @After
-  public void after() throws Exception {
+  public void after() {
     teardownDatabase();
   }
 
@@ -210,17 +209,14 @@ public class CreateMappingCommandDUnitTest {
         .statusIsSuccess();
   }
 
-  private static RegionMapping getRegionMappingFromClusterConfig(String regionName,
-      String groups) {
+  private static RegionMapping getRegionMappingFromClusterConfig(String regionName, String groups) {
     CacheConfig cacheConfig =
         InternalLocator.getLocator().getConfigurationPersistenceService().getCacheConfig(groups);
     RegionConfig regionConfig = cacheConfig.getRegions().stream()
         .filter(region -> region.getName().equals(convertRegionPathToName(regionName))).findFirst()
         .orElse(null);
-    RegionMapping regionMapping =
-        (RegionMapping) regionConfig.getCustomRegionElements().stream()
-            .filter(element -> element instanceof RegionMapping).findFirst().orElse(null);
-    return regionMapping;
+    return (RegionMapping) regionConfig.getCustomRegionElements().stream()
+        .filter(element -> element instanceof RegionMapping).findFirst().orElse(null);
   }
 
   private static RegionMapping getRegionMappingFromService(String regionName) {
@@ -229,8 +225,7 @@ public class CreateMappingCommandDUnitTest {
   }
 
   private static void validateAsyncEventQueueCreatedInClusterConfig(String regionName,
-      String groups,
-      boolean isParallel) {
+      String groups, boolean isParallel) {
     CacheConfig cacheConfig =
         InternalLocator.getLocator().getConfigurationPersistenceService().getCacheConfig(groups);
     List<CacheConfig.AsyncEventQueue> queueList = cacheConfig.getAsyncEventQueues();
@@ -243,8 +238,7 @@ public class CreateMappingCommandDUnitTest {
     assertThat(queue.isParallel()).isEqualTo(isParallel);
   }
 
-  private static CacheConfig.AsyncEventQueue findQueue(
-      List<CacheConfig.AsyncEventQueue> queueList,
+  private static CacheConfig.AsyncEventQueue findQueue(List<CacheConfig.AsyncEventQueue> queueList,
       String queueName) {
     for (CacheConfig.AsyncEventQueue queue : queueList) {
       if (queue.getId().equals(queueName)) {
@@ -261,8 +255,7 @@ public class CreateMappingCommandDUnitTest {
     return regionPath;
   }
 
-  private static void validateRegionAlteredInClusterConfig(String regionName,
-      String groups,
+  private static void validateRegionAlteredInClusterConfig(String regionName, String groups,
       boolean synchronous) {
     CacheConfig cacheConfig =
         InternalLocator.getLocator().getConfigurationPersistenceService().getCacheConfig(groups);
@@ -489,8 +482,7 @@ public class CreateMappingCommandDUnitTest {
   }
 
   private static void assertValidMappingOnLocator(RegionMapping mapping, String regionName,
-      String groups,
-      boolean synchronous, boolean isParallel) {
+      String groups, boolean synchronous, boolean isParallel) {
     assertValidMapping(mapping);
     validateRegionAlteredInClusterConfig(regionName, groups, synchronous);
     if (!synchronous) {
@@ -523,8 +515,7 @@ public class CreateMappingCommandDUnitTest {
   }
 
   private static void assertValidEmployeeMappingOnLocator(RegionMapping mapping, String regionName,
-      String groups,
-      boolean synchronous, boolean isParallel, String tableName) {
+      String groups, boolean synchronous, boolean isParallel, String tableName) {
     assertValidEmployeeMapping(mapping, tableName);
     validateRegionAlteredInClusterConfig(regionName, groups, synchronous);
     if (!synchronous) {
@@ -550,8 +541,7 @@ public class CreateMappingCommandDUnitTest {
   }
 
   private static void assertValidResourcePDXMappingOnServer(RegionMapping mapping,
-      String regionName,
-      boolean synchronous, boolean isParallel, String tableName) {
+      String regionName, boolean synchronous, boolean isParallel, String tableName) {
     assertValidResourcePDXMapping(mapping, tableName);
     validateRegionAlteredOnServer(regionName, synchronous);
     if (!synchronous) {
@@ -560,9 +550,7 @@ public class CreateMappingCommandDUnitTest {
   }
 
   private static void assertValidResourcePDXMappingOnLocator(RegionMapping mapping,
-      String regionName,
-      String groups,
-      boolean synchronous, boolean isParallel, String tableName) {
+      String regionName, String groups, boolean synchronous, boolean isParallel, String tableName) {
     assertValidResourcePDXMapping(mapping, tableName);
     validateRegionAlteredInClusterConfig(regionName, groups, synchronous);
     if (!synchronous) {
@@ -571,8 +559,7 @@ public class CreateMappingCommandDUnitTest {
   }
 
   private File loadTestResource(String fileName) {
-    String filePath =
-        createTempFileFromResource(this.getClass(), fileName).getAbsolutePath();
+    String filePath = createTempFileFromResource(getClass(), fileName).getAbsolutePath();
     assertThat(filePath).isNotNull();
 
     return new File(filePath);
@@ -588,8 +575,7 @@ public class CreateMappingCommandDUnitTest {
 
   private File createJar() throws IOException {
     JarBuilder jarBuilder = new JarBuilder();
-    File source = loadTestResource(
-        "/org/apache/geode/internal/ResourcePDX.java");
+    File source = loadTestResource("/org/apache/geode/internal/ResourcePDX.java");
 
     File outputJar = new File(temporaryFolder.getRoot(), "output.jar");
     jarBuilder.buildJar(outputJar, source);
@@ -598,8 +584,7 @@ public class CreateMappingCommandDUnitTest {
 
   private File createClassFile() throws IOException {
     final JavaCompiler javaCompiler = new JavaCompiler();
-    File source = loadTestResource(
-        "/org/apache/geode/internal/ResourcePDX.java");
+    File source = loadTestResource("/org/apache/geode/internal/ResourcePDX.java");
     List<CompiledSourceCode> compiledSourceCodes = javaCompiler.compile(source);
     String className = compiledSourceCodes.get(0).className;
     String fileName = className.substring(className.lastIndexOf(".") + 1) + ".class";
@@ -629,7 +614,7 @@ public class CreateMappingCommandDUnitTest {
   }
 
   @Test
-  public void createMappingWithDeployedPdxClassSucceeds() throws IOException, URISyntaxException {
+  public void createMappingWithDeployedPdxClassSucceeds() throws IOException {
     String region1Name = "region1";
     setupReplicate(region1Name);
 
@@ -657,7 +642,7 @@ public class CreateMappingCommandDUnitTest {
   }
 
   @Test
-  public void createMappingWithPdxClassFileSetToAJarFile() throws IOException, URISyntaxException {
+  public void createMappingWithPdxClassFileSetToAJarFile() throws IOException {
     String region1Name = "region1";
     setupReplicate(region1Name);
     File jarFile = createJar();
@@ -686,7 +671,7 @@ public class CreateMappingCommandDUnitTest {
   }
 
   @Test
-  public void createMappingWithNonExistingPdxClassFileFails() throws IOException {
+  public void createMappingWithNonExistingPdxClassFileFails() {
     String region1Name = "region1";
     setupReplicate(region1Name);
 
@@ -704,11 +689,10 @@ public class CreateMappingCommandDUnitTest {
   }
 
   @Test
-  public void createMappingWithInvalidJarPdxClassFileFails() throws IOException {
+  public void createMappingWithInvalidJarPdxClassFileFails() {
     String region1Name = "region1";
     setupReplicate(region1Name);
-    File invalidFile = loadTestResource(
-        "/org/apache/geode/internal/ResourcePDX.java");
+    File invalidFile = loadTestResource("/org/apache/geode/internal/ResourcePDX.java");
 
     CommandStringBuilder csb = new CommandStringBuilder(CREATE_MAPPING);
     csb.addOption(REGION_NAME, region1Name);
@@ -725,7 +709,7 @@ public class CreateMappingCommandDUnitTest {
 
   @Test
   public void createMappingWithPdxClassFileSetToAClassFile()
-      throws IOException, URISyntaxException {
+      throws IOException {
     String region1Name = "region1";
     setupReplicate(region1Name);
     File classFile = createClassFile();
@@ -882,130 +866,6 @@ public class CreateMappingCommandDUnitTest {
     });
   }
 
-  public static class Employee implements PdxSerializable {
-    private String id;
-    private String name;
-    private int age;
-
-    public Employee() {
-      // nothing
-    }
-
-    Employee(String id, String name, int age) {
-      this.id = id;
-      this.name = name;
-      this.age = age;
-    }
-
-    String getId() {
-      return id;
-    }
-
-    String getName() {
-      return name;
-    }
-
-    int getAge() {
-      return age;
-    }
-
-    @Override
-    public void toData(PdxWriter writer) {
-      writer.writeString("id", this.id);
-      writer.writeString("name", this.name);
-      writer.writeInt("age", this.age);
-    }
-
-    @Override
-    public void fromData(PdxReader reader) {
-      this.id = reader.readString("id");
-      this.name = reader.readString("name");
-      this.age = reader.readInt("age");
-    }
-  }
-
-  public static class EmployeeNumeric implements PdxSerializerObject {
-    private String id;
-    private String name;
-    private int age;
-    private float income;
-    private long refid;
-
-    public EmployeeNumeric() {
-      // nothing
-    }
-
-    EmployeeNumeric(String id, String name, int age, float income, long refid) {
-      this.id = id;
-      this.name = name;
-      this.age = age;
-      this.income = income;
-      this.refid = refid;
-    }
-
-    String getId() {
-      return id;
-    }
-
-    String getName() {
-      return name;
-    }
-
-    int getAge() {
-      return age;
-    }
-
-    float getIncome() {
-      return income;
-    }
-
-    void setIncome(float income) {
-      this.income = income;
-    }
-
-    long getRefid() {
-      return refid;
-    }
-
-    void setRefid(long refid) {
-      this.refid = refid;
-    }
-  }
-
-  public static class IdAndName implements PdxSerializable {
-    private String id;
-    private String name;
-
-    public IdAndName() {
-      // nothing
-    }
-
-    IdAndName(String id, String name) {
-      this.id = id;
-      this.name = name;
-    }
-
-    String getId() {
-      return id;
-    }
-
-    String getName() {
-      return name;
-    }
-
-    @Override
-    public void toData(PdxWriter writer) {
-      writer.writeString("myid", this.id);
-      writer.writeString("name", this.name);
-    }
-
-    @Override
-    public void fromData(PdxReader reader) {
-      this.id = reader.readString("myid");
-      this.name = reader.readString("name");
-    }
-  }
-
   @Test
   public void createMappingsWithExistingPdxName() {
     String region1Name = "region1";
@@ -1278,4 +1138,130 @@ public class CreateMappingCommandDUnitTest {
             + " must not already exist.");
   }
 
+  private static class Employee implements PdxSerializable {
+
+    private String id;
+    private String name;
+    private int age;
+
+    public Employee() {
+      // nothing
+    }
+
+    Employee(String id, String name, int age) {
+      this.id = id;
+      this.name = name;
+      this.age = age;
+    }
+
+    String getId() {
+      return id;
+    }
+
+    String getName() {
+      return name;
+    }
+
+    int getAge() {
+      return age;
+    }
+
+    @Override
+    public void toData(PdxWriter writer) {
+      writer.writeString("id", id);
+      writer.writeString("name", name);
+      writer.writeInt("age", age);
+    }
+
+    @Override
+    public void fromData(PdxReader reader) {
+      id = reader.readString("id");
+      name = reader.readString("name");
+      age = reader.readInt("age");
+    }
+  }
+
+  private static class EmployeeNumeric implements PdxSerializerObject {
+
+    private String id;
+    private String name;
+    private int age;
+    private float income;
+    private long refid;
+
+    public EmployeeNumeric() {
+      // nothing
+    }
+
+    EmployeeNumeric(String id, String name, int age, float income, long refid) {
+      this.id = id;
+      this.name = name;
+      this.age = age;
+      this.income = income;
+      this.refid = refid;
+    }
+
+    String getId() {
+      return id;
+    }
+
+    String getName() {
+      return name;
+    }
+
+    int getAge() {
+      return age;
+    }
+
+    float getIncome() {
+      return income;
+    }
+
+    void setIncome(float income) {
+      this.income = income;
+    }
+
+    long getRefid() {
+      return refid;
+    }
+
+    void setRefid(long refid) {
+      this.refid = refid;
+    }
+  }
+
+  private static class IdAndName implements PdxSerializable {
+
+    private String id;
+    private String name;
+
+    public IdAndName() {
+      // nothing
+    }
+
+    IdAndName(String id, String name) {
+      this.id = id;
+      this.name = name;
+    }
+
+    String getId() {
+      return id;
+    }
+
+    String getName() {
+      return name;
+    }
+
+    @Override
+    public void toData(PdxWriter writer) {
+      writer.writeString("myid", id);
+      writer.writeString("name", name);
+    }
+
+    @Override
+    public void fromData(PdxReader reader) {
+      id = reader.readString("myid");
+      name = reader.readString("name");
+    }
+  }
 }
diff --git a/geode-core/src/distributedTest/java/org/apache/geode/ClusterCommunicationsDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/ClusterCommunicationsDUnitTest.java
index 3c9d803..4d7bb23 100644
--- a/geode-core/src/distributedTest/java/org/apache/geode/ClusterCommunicationsDUnitTest.java
+++ b/geode-core/src/distributedTest/java/org/apache/geode/ClusterCommunicationsDUnitTest.java
@@ -31,6 +31,9 @@ import static org.apache.geode.distributed.ConfigurationProperties.USE_CLUSTER_C
 import static org.apache.geode.internal.DataSerializableFixedID.SERIAL_ACKED_MESSAGE;
 import static org.apache.geode.test.awaitility.GeodeAwaitility.await;
 import static org.apache.geode.test.awaitility.GeodeAwaitility.getTimeout;
+import static org.apache.geode.test.dunit.IgnoredException.addIgnoredException;
+import static org.apache.geode.test.dunit.Invoke.invokeInEveryVM;
+import static org.apache.geode.test.dunit.VM.getVM;
 import static org.apache.geode.test.util.ResourceUtils.createTempFileFromResource;
 import static org.assertj.core.api.Assertions.assertThat;
 
@@ -38,6 +41,7 @@ import java.io.DataInput;
 import java.io.DataOutput;
 import java.io.File;
 import java.io.IOException;
+import java.io.Serializable;
 import java.util.Arrays;
 import java.util.Collection;
 import java.util.Collections;
@@ -53,6 +57,8 @@ import org.junit.Test;
 import org.junit.experimental.categories.Category;
 import org.junit.runner.RunWith;
 import org.junit.runners.Parameterized;
+import org.junit.runners.Parameterized.Parameters;
+import org.junit.runners.Parameterized.UseParametersRunnerFactory;
 
 import org.apache.geode.cache.Cache;
 import org.apache.geode.cache.CacheFactory;
@@ -71,9 +77,8 @@ import org.apache.geode.distributed.internal.membership.gms.membership.GMSJoinLe
 import org.apache.geode.internal.DSFIDFactory;
 import org.apache.geode.internal.cache.DirectReplyMessage;
 import org.apache.geode.test.dunit.Host;
-import org.apache.geode.test.dunit.IgnoredException;
-import org.apache.geode.test.dunit.Invoke;
 import org.apache.geode.test.dunit.VM;
+import org.apache.geode.test.dunit.rules.DistributedRestoreSystemProperties;
 import org.apache.geode.test.dunit.rules.DistributedRule;
 import org.apache.geode.test.junit.categories.BackwardCompatibilityTest;
 import org.apache.geode.test.junit.categories.MembershipTest;
@@ -86,106 +91,89 @@ import org.apache.geode.test.version.VersionManager;
  */
 @Category({MembershipTest.class, BackwardCompatibilityTest.class})
 @RunWith(Parameterized.class)
-@Parameterized.UseParametersRunnerFactory(CategoryWithParameterizedRunnerFactory.class)
-public class ClusterCommunicationsDUnitTest implements java.io.Serializable {
+@UseParametersRunnerFactory(CategoryWithParameterizedRunnerFactory.class)
+public class ClusterCommunicationsDUnitTest implements Serializable {
 
-  private boolean conserveSockets;
-  private boolean useSSL;
+  private static final int NUM_SERVERS = 2;
+  private static final int SMALL_BUFFER_SIZE = 8000;
 
-  enum RunConfiguration {
-    SHARED_CONNECTIONS(true, false),
-    SHARED_CONNECTIONS_WITH_SSL(true, true),
-    UNSHARED_CONNECTIONS(false, false),
-    UNSHARED_CONNECTIONS_WITH_SSL(false, true);
+  private static final long serialVersionUID = -3438183140385150550L;
 
-    boolean useSSL;
-    boolean conserveSockets;
+  private static Cache cache;
 
-    RunConfiguration(boolean conserveSockets, boolean useSSL) {
-      this.useSSL = useSSL;
-      this.conserveSockets = conserveSockets;
-    }
-  }
+  private final String regionName = "clusterTestRegion";
 
-  @Parameterized.Parameters(name = "{0}")
+  private boolean conserveSockets;
+  private boolean useSSL;
+
+  @Parameters(name = "{0}")
   public static Collection<RunConfiguration> data() {
     return Arrays.asList(RunConfiguration.values());
   }
 
-  private static final int NUM_SERVERS = 2;
-  private static final int SMALL_BUFFER_SIZE = 8000;
-
-  private static final long serialVersionUID = -3438183140385150550L;
-
-  private static Cache cache;
-
   @Rule
   public DistributedRule distributedRule =
       DistributedRule.builder().withVMCount(NUM_SERVERS + 1).build();
 
   @Rule
-  public final SerializableTestName testName = new SerializableTestName();
+  public DistributedRestoreSystemProperties restoreSystemProperties =
+      new DistributedRestoreSystemProperties();
 
-  private final String regionName = "clusterTestRegion";
+  @Rule
+  public SerializableTestName testName = new SerializableTestName();
 
   public ClusterCommunicationsDUnitTest(RunConfiguration runConfiguration) {
-    this.useSSL = runConfiguration.useSSL;
-    this.conserveSockets = runConfiguration.conserveSockets;
+    useSSL = runConfiguration.useSSL;
+    conserveSockets = runConfiguration.conserveSockets;
   }
 
   @Before
   public void setUp() throws Exception {
-    final Boolean testWithSSL = useSSL;
-    final Boolean testWithConserveSocketsTrue = conserveSockets;
-    Invoke.invokeInEveryVM(() -> {
-      this.useSSL = testWithSSL;
-      this.conserveSockets = testWithConserveSocketsTrue;
-    });
-    IgnoredException.addIgnoredException("Socket Closed");
-    IgnoredException.addIgnoredException("Remote host closed connection during handshake");
+    addIgnoredException("Socket Closed");
+    addIgnoredException("Remote host closed connection during handshake");
   }
 
   @Test
   public void createEntryAndVerifyUpdate() {
-    int locatorPort = createLocator(VM.getVM(0));
+    int locatorPort = createLocator(getVM(0));
     for (int i = 1; i <= NUM_SERVERS; i++) {
-      createCacheAndRegion(VM.getVM(i), locatorPort);
+      createCacheAndRegion(getVM(i), locatorPort);
     }
-    performCreate(VM.getVM(1));
+    performCreate(getVM(1));
     for (int i = 1; i <= NUM_SERVERS; i++) {
-      verifyCreatedEntry(VM.getVM(i));
+      verifyCreatedEntry(getVM(i));
     }
-    performUpdate(VM.getVM(1));
+    performUpdate(getVM(1));
     for (int i = 1; i <= NUM_SERVERS; i++) {
-      verifyUpdatedEntry(VM.getVM(i));
+      verifyUpdatedEntry(getVM(i));
     }
   }
 
   @Test
   public void createEntryWithBigMessage() {
-    int locatorPort = createLocator(VM.getVM(0));
+    int locatorPort = createLocator(getVM(0));
     for (int i = 1; i <= NUM_SERVERS; i++) {
-      createCacheAndRegion(VM.getVM(i), locatorPort);
+      createCacheAndRegion(getVM(i), locatorPort);
     }
-    performCreateWithLargeValue(VM.getVM(1));
+    performCreateWithLargeValue(getVM(1));
     // fault the value into an empty cache - forces use of message chunking
     for (int i = 1; i <= NUM_SERVERS - 1; i++) {
-      verifyCreatedEntry(VM.getVM(i));
+      verifyCreatedEntry(getVM(i));
     }
   }
 
   @Test
   public void receiveBigResponse() {
-    Invoke.invokeInEveryVM(() -> DSFIDFactory.registerDSFID(SERIAL_ACKED_MESSAGE,
+    invokeInEveryVM(() -> DSFIDFactory.registerDSFID(SERIAL_ACKED_MESSAGE,
         SerialAckedMessageWithBigReply.class));
     try {
-      int locatorPort = createLocator(VM.getVM(0));
+      int locatorPort = createLocator(getVM(0));
       for (int i = 1; i <= NUM_SERVERS; i++) {
-        createCacheAndRegion(VM.getVM(i), locatorPort);
+        createCacheAndRegion(getVM(i), locatorPort);
       }
-      final DistributedMember vm2ID =
-          VM.getVM(2).invoke(() -> cache.getDistributedSystem().getDistributedMember());
-      VM.getVM(1).invoke("receive a large direct-reply message", () -> {
+      DistributedMember vm2ID =
+          getVM(2).invoke(() -> cache.getDistributedSystem().getDistributedMember());
+      getVM(1).invoke("receive a large direct-reply message", () -> {
         SerialAckedMessageWithBigReply messageWithBigReply = new SerialAckedMessageWithBigReply();
         await().until(() -> {
           messageWithBigReply.send(Collections.singleton(vm2ID));
@@ -193,7 +181,7 @@ public class ClusterCommunicationsDUnitTest implements java.io.Serializable {
         });
       });
     } finally {
-      Invoke.invokeInEveryVM(
+      invokeInEveryVM(
           () -> DSFIDFactory.registerDSFID(SERIAL_ACKED_MESSAGE, SerialAckedMessage.class));
     }
   }
@@ -209,7 +197,7 @@ public class ClusterCommunicationsDUnitTest implements java.io.Serializable {
     VM server1VM = Host.getHost(0).getVM(testVersion, 1);
     int locatorPort = createLocator(locatorVM);
     createCacheAndRegion(server1VM, locatorPort);
-    performCreate(VM.getVM(1));
+    performCreate(getVM(1));
 
     // roll the locator to the current version
     locatorVM.invoke("stop locator", () -> Locator.getLocator().stop());
@@ -234,7 +222,6 @@ public class ClusterCommunicationsDUnitTest implements java.io.Serializable {
     server1VM = Host.getHost(0).getVM(VersionManager.CURRENT_VERSION, 1);
     createCacheAndRegion(server1VM, locatorPort);
 
-
     verifyCreatedEntry(server1VM);
     verifyCreatedEntry(server2VM);
   }
@@ -246,7 +233,6 @@ public class ClusterCommunicationsDUnitTest implements java.io.Serializable {
     });
   }
 
-
   private void performCreate(VM memberVM) {
     memberVM.invoke("perform create", () -> cache
         .getRegion(regionName).put("testKey", "testValue"));
@@ -293,35 +279,50 @@ public class ClusterCommunicationsDUnitTest implements java.io.Serializable {
     // if you need to debug SSL communications use this property:
     // System.setProperty("javax.net.debug", "all");
     Properties properties = getDistributedSystemProperties();
-    properties.put(LOCATORS, "localhost[" + locatorPort + "]");
+    properties.setProperty(LOCATORS, "localhost[" + locatorPort + "]");
     return new CacheFactory(properties).create();
   }
 
   public Properties getDistributedSystemProperties() {
     Properties properties = new Properties();
-    properties.put(ENABLE_CLUSTER_CONFIGURATION, "false");
-    properties.put(USE_CLUSTER_CONFIGURATION, "false");
-    properties.put(NAME, "vm" + VM.getCurrentVMNum());
-    properties.put(CONSERVE_SOCKETS, "" + conserveSockets);
-    properties.put(SOCKET_LEASE_TIME, "10000");
-    properties.put(SOCKET_BUFFER_SIZE, "" + SMALL_BUFFER_SIZE);
+    properties.setProperty(ENABLE_CLUSTER_CONFIGURATION, "false");
+    properties.setProperty(USE_CLUSTER_CONFIGURATION, "false");
+    properties.setProperty(NAME, "vm" + VM.getCurrentVMNum());
+    properties.setProperty(CONSERVE_SOCKETS, "" + conserveSockets);
+    properties.setProperty(SOCKET_LEASE_TIME, "10000");
+    properties.setProperty(SOCKET_BUFFER_SIZE, "" + SMALL_BUFFER_SIZE);
 
     if (useSSL) {
-      properties.put(SSL_ENABLED_COMPONENTS, "cluster,locator");
-      properties.put(SSL_KEYSTORE,
-          createTempFileFromResource(this.getClass(), "server.keystore")
+      properties.setProperty(SSL_ENABLED_COMPONENTS, "cluster,locator");
+      properties
+          .setProperty(SSL_KEYSTORE, createTempFileFromResource(getClass(), "server.keystore")
               .getAbsolutePath());
-      properties.put(SSL_TRUSTSTORE,
-          createTempFileFromResource(this.getClass(), "server.keystore")
+      properties.setProperty(SSL_TRUSTSTORE,
+          createTempFileFromResource(getClass(), "server.keystore")
               .getAbsolutePath());
-      properties.put(SSL_PROTOCOLS, "TLSv1.2");
-      properties.put(SSL_KEYSTORE_PASSWORD, "password");
-      properties.put(SSL_TRUSTSTORE_PASSWORD, "password");
-      properties.put(SSL_REQUIRE_AUTHENTICATION, "true");
+      properties.setProperty(SSL_PROTOCOLS, "TLSv1.2");
+      properties.setProperty(SSL_KEYSTORE_PASSWORD, "password");
+      properties.setProperty(SSL_TRUSTSTORE_PASSWORD, "password");
+      properties.setProperty(SSL_REQUIRE_AUTHENTICATION, "true");
     }
     return properties;
   }
 
+  enum RunConfiguration {
+    SHARED_CONNECTIONS(true, false),
+    SHARED_CONNECTIONS_WITH_SSL(true, true),
+    UNSHARED_CONNECTIONS(false, false),
+    UNSHARED_CONNECTIONS_WITH_SSL(false, true);
+
+    boolean useSSL;
+    boolean conserveSockets;
+
+    RunConfiguration(boolean conserveSockets, boolean useSSL) {
+      this.useSSL = useSSL;
+      this.conserveSockets = conserveSockets;
+    }
+  }
+
   /**
    * SerialAckedMessageWithBigReply requires conserve-sockets=false and acts to send
    * a large reply message to the sender. You must have already created a cache in the
@@ -329,21 +330,19 @@ public class ClusterCommunicationsDUnitTest implements java.io.Serializable {
    * of SERIAL_ACKED_MESSAGE. Don't forget to reset the registration to
    * SerialAckedMessage at the end of the test.
    */
-  public static class SerialAckedMessageWithBigReply extends DistributionMessage
-      implements MessageWithReply,
-      DirectReplyMessage {
+  private static class SerialAckedMessageWithBigReply extends DistributionMessage
+      implements MessageWithReply, DirectReplyMessage {
     static final int DSFID = SERIAL_ACKED_MESSAGE;
 
     private int processorId;
-    private transient ClusterDistributionManager originDm;
-    private transient DirectReplyProcessor replyProcessor;
+    private ClusterDistributionManager originDm;
+    private DirectReplyProcessor replyProcessor;
 
     public SerialAckedMessageWithBigReply() {
-      super();
       InternalDistributedSystem ds = InternalDistributedSystem.getAnyInstance();
-      if (ds != null) { // this constructor is used in serialization as well as when sending to
-                        // others
-        this.originDm = (ClusterDistributionManager) ds.getDistributionManager();
+      // this constructor is used in serialization as well as when sending to others
+      if (ds != null) {
+        originDm = (ClusterDistributionManager) ds.getDistributionManager();
       }
     }
 
@@ -355,7 +354,7 @@ public class ClusterCommunicationsDUnitTest implements java.io.Serializable {
       processorId = replyProcessor.getProcessorId();
       setRecipients(recipients);
       Set failures = originDm.putOutgoing(this);
-      if (failures != null && failures.size() > 0) {
+      if (failures != null && !failures.isEmpty()) {
         for (Object failure : failures) {
           System.err.println("Unable to send serial acked message to " + failure);
         }
@@ -417,9 +416,8 @@ public class ClusterCommunicationsDUnitTest implements java.io.Serializable {
     @Override
     public void registerProcessor() {
       if (replyProcessor != null) {
-        this.processorId = this.replyProcessor.register();
+        processorId = replyProcessor.register();
       }
     }
   }
-
 }
diff --git a/geode-core/src/distributedTest/java/org/apache/geode/cache/client/internal/CacheServerSSLConnectionDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/cache/client/internal/CacheServerSSLConnectionDUnitTest.java
index 4a2d718..6d8d5e2 100644
--- a/geode-core/src/distributedTest/java/org/apache/geode/cache/client/internal/CacheServerSSLConnectionDUnitTest.java
+++ b/geode-core/src/distributedTest/java/org/apache/geode/cache/client/internal/CacheServerSSLConnectionDUnitTest.java
@@ -42,11 +42,15 @@ import static org.apache.geode.distributed.ConfigurationProperties.SSL_PROTOCOLS
 import static org.apache.geode.distributed.ConfigurationProperties.SSL_REQUIRE_AUTHENTICATION;
 import static org.apache.geode.distributed.ConfigurationProperties.SSL_TRUSTSTORE;
 import static org.apache.geode.distributed.ConfigurationProperties.SSL_TRUSTSTORE_PASSWORD;
+import static org.apache.geode.test.dunit.IgnoredException.addIgnoredException;
+import static org.apache.geode.test.dunit.Invoke.invokeInEveryVM;
+import static org.apache.geode.test.dunit.VM.getHostName;
+import static org.apache.geode.test.dunit.VM.getVM;
 import static org.apache.geode.test.util.ResourceUtils.createTempFileFromResource;
+import static org.assertj.core.api.Assertions.assertThat;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
 import java.io.File;
@@ -61,11 +65,19 @@ import java.util.List;
 import java.util.Properties;
 import java.util.concurrent.TimeUnit;
 
+import javax.net.ssl.SSLException;
+import javax.net.ssl.SSLHandshakeException;
+
+import org.junit.After;
 import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.Rule;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 import org.junit.runner.RunWith;
 import org.junit.runners.Parameterized;
+import org.junit.runners.Parameterized.Parameters;
+import org.junit.runners.Parameterized.UseParametersRunnerFactory;
 
 import org.apache.geode.cache.Cache;
 import org.apache.geode.cache.CacheFactory;
@@ -82,12 +94,11 @@ import org.apache.geode.distributed.Locator;
 import org.apache.geode.internal.security.SecurableCommunicationChannel;
 import org.apache.geode.security.AuthenticationRequiredException;
 import org.apache.geode.test.dunit.AsyncInvocation;
-import org.apache.geode.test.dunit.Host;
 import org.apache.geode.test.dunit.IgnoredException;
-import org.apache.geode.test.dunit.Invoke;
 import org.apache.geode.test.dunit.RMIException;
 import org.apache.geode.test.dunit.VM;
 import org.apache.geode.test.dunit.internal.JUnit4DistributedTestCase;
+import org.apache.geode.test.dunit.rules.DistributedRestoreSystemProperties;
 import org.apache.geode.test.junit.categories.ClientServerTest;
 import org.apache.geode.test.junit.runners.CategoryWithParameterizedRunnerFactory;
 
@@ -97,24 +108,10 @@ import org.apache.geode.test.junit.runners.CategoryWithParameterizedRunnerFactor
  */
 @Category({ClientServerTest.class})
 @RunWith(Parameterized.class)
-@Parameterized.UseParametersRunnerFactory(CategoryWithParameterizedRunnerFactory.class)
+@UseParametersRunnerFactory(CategoryWithParameterizedRunnerFactory.class)
+@SuppressWarnings("serial")
 public class CacheServerSSLConnectionDUnitTest extends JUnit4DistributedTestCase {
 
-  private static boolean useOldSSLSettings;
-
-  @Parameterized.Parameters
-  public static Collection<Boolean> data() {
-    List<Boolean> result = new ArrayList<>();
-    result.add(Boolean.TRUE);
-    result.add(Boolean.FALSE);
-    return result;
-  }
-
-  public CacheServerSSLConnectionDUnitTest(Boolean useOldSSLSettings) {
-    super();
-    CacheServerSSLConnectionDUnitTest.useOldSSLSettings = useOldSSLSettings.booleanValue();
-  }
-
   private static final String TRUSTED_STORE = "trusted.keystore";
   private static final String CLIENT_KEY_STORE = "default.keystore";
   private static final String CLIENT_TRUST_STORE = "default.keystore";
@@ -129,17 +126,27 @@ public class CacheServerSSLConnectionDUnitTest extends JUnit4DistributedTestCase
   private int cacheServerPort;
   private String hostName;
 
-  @Override
-  public final void preSetUp() throws Exception {
-    disconnectAllFromDS();
-    instance = this;
-    Invoke
-        .invokeInEveryVM(() -> instance = new CacheServerSSLConnectionDUnitTest(useOldSSLSettings));
+  private static boolean useOldSSLSettings;
+
+  @Parameters
+  public static Collection<Boolean> data() {
+    List<Boolean> result = new ArrayList<>();
+    result.add(Boolean.TRUE);
+    result.add(Boolean.FALSE);
+    return result;
+  }
+
+  public CacheServerSSLConnectionDUnitTest(Boolean useOldSSLSettings) {
+    CacheServerSSLConnectionDUnitTest.useOldSSLSettings = useOldSSLSettings;
   }
 
+  @Rule
+  public DistributedRestoreSystemProperties restoreSystemProperties =
+      new DistributedRestoreSystemProperties();
+
   @AfterClass
   public static void postClass() {
-    Invoke.invokeInEveryVM(() -> {
+    invokeInEveryVM(() -> {
       if (instance.cache != null) {
         instance.cache.close();
       }
@@ -151,7 +158,23 @@ public class CacheServerSSLConnectionDUnitTest extends JUnit4DistributedTestCase
     instance = null;
   }
 
-  public Cache createCache(Properties props) throws Exception {
+  @Before
+  public void setUp() {
+    disconnectAllFromDS();
+    instance = this;
+    invokeInEveryVM(() -> instance = new CacheServerSSLConnectionDUnitTest(useOldSSLSettings));
+  }
+
+  @After
+  public void tearDown() {
+    VM serverVM = getVM(1);
+    VM clientVM = getVM(2);
+
+    clientVM.invoke(() -> closeClientCacheTask());
+    serverVM.invoke(() -> closeCacheTask());
+  }
+
+  private Cache createCache(Properties props) throws Exception {
     props.setProperty(MCAST_PORT, "0");
     cache = new CacheFactory(props).create();
     if (cache == null) {
@@ -169,22 +192,21 @@ public class CacheServerSSLConnectionDUnitTest extends JUnit4DistributedTestCase
     return cacheServerPort;
   }
 
-  public int getCacheServerPort() {
+  private int getCacheServerPort() {
     return cacheServerPort;
   }
 
-  public String getCacheServerHost() {
+  private String getCacheServerHost() {
     return hostName;
   }
 
-  @SuppressWarnings("rawtypes")
-  public void setUpServerVM(final boolean cacheServerSslenabled, int optionalLocatorPort)
+  private void setUpServerVM(final boolean cacheServerSslenabled, int optionalLocatorPort)
       throws Exception {
     System.setProperty("javax.net.debug", "ssl,handshake");
 
     Properties gemFireProps = new Properties();
     if (optionalLocatorPort > 0) {
-      gemFireProps.put("locators", "localhost[" + optionalLocatorPort + "]");
+      gemFireProps.setProperty("locators", "localhost[" + optionalLocatorPort + "]");
     }
 
     String cacheServerSslprotocols = "any";
@@ -194,10 +216,10 @@ public class CacheServerSSLConnectionDUnitTest extends JUnit4DistributedTestCase
       getNewSSLSettings(gemFireProps, cacheServerSslprotocols, cacheServerSslciphers,
           cacheServerSslRequireAuth);
     } else {
-      gemFireProps.put(CLUSTER_SSL_ENABLED, String.valueOf(cacheServerSslenabled));
-      gemFireProps.put(CLUSTER_SSL_PROTOCOLS, cacheServerSslprotocols);
-      gemFireProps.put(CLUSTER_SSL_CIPHERS, cacheServerSslciphers);
-      gemFireProps.put(CLUSTER_SSL_REQUIRE_AUTHENTICATION,
+      gemFireProps.setProperty(CLUSTER_SSL_ENABLED, String.valueOf(cacheServerSslenabled));
+      gemFireProps.setProperty(CLUSTER_SSL_PROTOCOLS, cacheServerSslprotocols);
+      gemFireProps.setProperty(CLUSTER_SSL_CIPHERS, cacheServerSslciphers);
+      gemFireProps.setProperty(CLUSTER_SSL_REQUIRE_AUTHENTICATION,
           String.valueOf(cacheServerSslRequireAuth));
 
       String keyStore =
@@ -206,11 +228,11 @@ public class CacheServerSSLConnectionDUnitTest extends JUnit4DistributedTestCase
       String trustStore =
           createTempFileFromResource(CacheServerSSLConnectionDUnitTest.class,
               SERVER_TRUST_STORE).getAbsolutePath();
-      gemFireProps.put(CLUSTER_SSL_KEYSTORE_TYPE, "jks");
-      gemFireProps.put(CLUSTER_SSL_KEYSTORE, keyStore);
-      gemFireProps.put(CLUSTER_SSL_KEYSTORE_PASSWORD, "password");
-      gemFireProps.put(CLUSTER_SSL_TRUSTSTORE, trustStore);
-      gemFireProps.put(CLUSTER_SSL_TRUSTSTORE_PASSWORD, "password");
+      gemFireProps.setProperty(CLUSTER_SSL_KEYSTORE_TYPE, "jks");
+      gemFireProps.setProperty(CLUSTER_SSL_KEYSTORE, keyStore);
+      gemFireProps.setProperty(CLUSTER_SSL_KEYSTORE_PASSWORD, "password");
+      gemFireProps.setProperty(CLUSTER_SSL_TRUSTSTORE, trustStore);
+      gemFireProps.setProperty(CLUSTER_SSL_TRUSTSTORE_PASSWORD, "password");
     }
     StringWriter sw = new StringWriter();
     PrintWriter writer = new PrintWriter(sw);
@@ -225,11 +247,11 @@ public class CacheServerSSLConnectionDUnitTest extends JUnit4DistributedTestCase
 
   private void getNewSSLSettings(Properties gemFireProps, String cacheServerSslprotocols,
       String cacheServerSslciphers, boolean cacheServerSslRequireAuth) {
-    gemFireProps.put(SSL_ENABLED_COMPONENTS,
+    gemFireProps.setProperty(SSL_ENABLED_COMPONENTS,
         SecurableCommunicationChannel.CLUSTER + "," + SecurableCommunicationChannel.SERVER);
-    gemFireProps.put(SSL_PROTOCOLS, cacheServerSslprotocols);
-    gemFireProps.put(SSL_CIPHERS, cacheServerSslciphers);
-    gemFireProps.put(SSL_REQUIRE_AUTHENTICATION, String.valueOf(cacheServerSslRequireAuth));
+    gemFireProps.setProperty(SSL_PROTOCOLS, cacheServerSslprotocols);
+    gemFireProps.setProperty(SSL_CIPHERS, cacheServerSslciphers);
+    gemFireProps.setProperty(SSL_REQUIRE_AUTHENTICATION, String.valueOf(cacheServerSslRequireAuth));
 
     String keyStore =
         createTempFileFromResource(CacheServerSSLConnectionDUnitTest.class, SERVER_KEY_STORE)
@@ -237,17 +259,16 @@ public class CacheServerSSLConnectionDUnitTest extends JUnit4DistributedTestCase
     String trustStore =
         createTempFileFromResource(CacheServerSSLConnectionDUnitTest.class, SERVER_TRUST_STORE)
             .getAbsolutePath();
-    gemFireProps.put(SSL_KEYSTORE_TYPE, "jks");
-    gemFireProps.put(SSL_KEYSTORE, keyStore);
-    gemFireProps.put(SSL_KEYSTORE_PASSWORD, "password");
-    gemFireProps.put(SSL_TRUSTSTORE, trustStore);
-    gemFireProps.put(SSL_TRUSTSTORE_PASSWORD, "password");
+    gemFireProps.setProperty(SSL_KEYSTORE_TYPE, "jks");
+    gemFireProps.setProperty(SSL_KEYSTORE, keyStore);
+    gemFireProps.setProperty(SSL_KEYSTORE_PASSWORD, "password");
+    gemFireProps.setProperty(SSL_TRUSTSTORE, trustStore);
+    gemFireProps.setProperty(SSL_TRUSTSTORE_PASSWORD, "password");
   }
 
-  public void setUpClientVM(String host, int port, boolean cacheServerSslenabled,
+  private void setUpClientVM(String host, int port, boolean cacheServerSslenabled,
       boolean cacheServerSslRequireAuth, String keyStore, String trustStore, boolean subscription,
       boolean clientHasTrustedKeystore) {
-
     System.setProperty("javax.net.debug", "ssl,handshake");
     Properties gemFireProps = new Properties();
 
@@ -263,46 +284,46 @@ public class CacheServerSSLConnectionDUnitTest extends JUnit4DistributedTestCase
 
     if (cacheServerSslenabled) {
       if (useOldSSLSettings) {
-        gemFireProps.put(SERVER_SSL_ENABLED, String.valueOf(cacheServerSslenabled));
-        gemFireProps.put(SERVER_SSL_PROTOCOLS, cacheServerSslprotocols);
-        gemFireProps.put(SERVER_SSL_CIPHERS, cacheServerSslciphers);
-        gemFireProps.put(SERVER_SSL_REQUIRE_AUTHENTICATION,
+        gemFireProps.setProperty(SERVER_SSL_ENABLED, String.valueOf(cacheServerSslenabled));
+        gemFireProps.setProperty(SERVER_SSL_PROTOCOLS, cacheServerSslprotocols);
+        gemFireProps.setProperty(SERVER_SSL_CIPHERS, cacheServerSslciphers);
+        gemFireProps.setProperty(SERVER_SSL_REQUIRE_AUTHENTICATION,
             String.valueOf(cacheServerSslRequireAuth));
         if (clientHasTrustedKeystore) {
-          gemFireProps.put(SERVER_SSL_KEYSTORE_TYPE, "jks");
-          gemFireProps.put(SERVER_SSL_KEYSTORE, keyStorePath);
-          gemFireProps.put(SERVER_SSL_KEYSTORE_PASSWORD, "password");
-          gemFireProps.put(SERVER_SSL_TRUSTSTORE, trustStorePath);
-          gemFireProps.put(SERVER_SSL_TRUSTSTORE_PASSWORD, "password");
+          gemFireProps.setProperty(SERVER_SSL_KEYSTORE_TYPE, "jks");
+          gemFireProps.setProperty(SERVER_SSL_KEYSTORE, keyStorePath);
+          gemFireProps.setProperty(SERVER_SSL_KEYSTORE_PASSWORD, "password");
+          gemFireProps.setProperty(SERVER_SSL_TRUSTSTORE, trustStorePath);
+          gemFireProps.setProperty(SERVER_SSL_TRUSTSTORE_PASSWORD, "password");
         } else {
-          gemFireProps.put(SERVER_SSL_KEYSTORE_TYPE, "jks");
-          gemFireProps.put(SERVER_SSL_KEYSTORE, "");
-          gemFireProps.put(SERVER_SSL_KEYSTORE_PASSWORD, "password");
-          gemFireProps.put(SERVER_SSL_TRUSTSTORE, trustStorePath);
-          gemFireProps.put(SERVER_SSL_TRUSTSTORE_PASSWORD, "password");
+          gemFireProps.setProperty(SERVER_SSL_KEYSTORE_TYPE, "jks");
+          gemFireProps.setProperty(SERVER_SSL_KEYSTORE, "");
+          gemFireProps.setProperty(SERVER_SSL_KEYSTORE_PASSWORD, "password");
+          gemFireProps.setProperty(SERVER_SSL_TRUSTSTORE, trustStorePath);
+          gemFireProps.setProperty(SERVER_SSL_TRUSTSTORE_PASSWORD, "password");
         }
       } else {
-        gemFireProps.put(SSL_ENABLED_COMPONENTS, "server");
-        gemFireProps.put(SSL_CIPHERS, cacheServerSslciphers);
-        gemFireProps.put(SSL_PROTOCOLS, cacheServerSslprotocols);
-        gemFireProps.put(SSL_REQUIRE_AUTHENTICATION, String.valueOf(cacheServerSslRequireAuth));
+        gemFireProps.setProperty(SSL_ENABLED_COMPONENTS, "server");
+        gemFireProps.setProperty(SSL_CIPHERS, cacheServerSslciphers);
+        gemFireProps.setProperty(SSL_PROTOCOLS, cacheServerSslprotocols);
+        gemFireProps
+            .setProperty(SSL_REQUIRE_AUTHENTICATION, String.valueOf(cacheServerSslRequireAuth));
         if (clientHasTrustedKeystore) {
-          gemFireProps.put(SSL_KEYSTORE_TYPE, "jks");
-          gemFireProps.put(SSL_KEYSTORE, keyStorePath);
-          gemFireProps.put(SSL_KEYSTORE_PASSWORD, "password");
-          gemFireProps.put(SSL_TRUSTSTORE, trustStorePath);
-          gemFireProps.put(SSL_TRUSTSTORE_PASSWORD, "password");
+          gemFireProps.setProperty(SSL_KEYSTORE_TYPE, "jks");
+          gemFireProps.setProperty(SSL_KEYSTORE, keyStorePath);
+          gemFireProps.setProperty(SSL_KEYSTORE_PASSWORD, "password");
+          gemFireProps.setProperty(SSL_TRUSTSTORE, trustStorePath);
+          gemFireProps.setProperty(SSL_TRUSTSTORE_PASSWORD, "password");
         } else {
-          gemFireProps.put(SSL_KEYSTORE_TYPE, "jks");
-          gemFireProps.put(SSL_KEYSTORE, "");
-          gemFireProps.put(SSL_KEYSTORE_PASSWORD, "password");
-          gemFireProps.put(SSL_TRUSTSTORE, trustStorePath);
-          gemFireProps.put(SSL_TRUSTSTORE_PASSWORD, "password");
+          gemFireProps.setProperty(SSL_KEYSTORE_TYPE, "jks");
+          gemFireProps.setProperty(SSL_KEYSTORE, "");
+          gemFireProps.setProperty(SSL_KEYSTORE_PASSWORD, "password");
+          gemFireProps.setProperty(SSL_TRUSTSTORE, trustStorePath);
+          gemFireProps.setProperty(SSL_TRUSTSTORE_PASSWORD, "password");
         }
       }
     }
 
-
     StringWriter sw = new StringWriter();
     PrintWriter writer = new PrintWriter(sw);
     gemFireProps.list(writer);
@@ -319,48 +340,48 @@ public class CacheServerSSLConnectionDUnitTest extends JUnit4DistributedTestCase
     assertNotNull(region);
   }
 
-  public void doClientRegionTest() {
+  private void doClientRegionTest() {
     Region<String, String> region = clientCache.getRegion("serverRegion");
     assertEquals("servervalue", region.get("serverkey"));
     region.put("clientkey", "clientvalue");
     assertEquals("clientvalue", region.get("clientkey"));
   }
 
-  public void doServerRegionTest() {
+  private void doServerRegionTest() {
     Region<String, String> region = cache.getRegion("serverRegion");
     assertEquals("servervalue", region.get("serverkey"));
     assertEquals("clientvalue", region.get("clientkey"));
   }
 
 
-  public static void setUpServerVMTask(boolean cacheServerSslenabled, int optionalLocatorPort)
+  private static void setUpServerVMTask(boolean cacheServerSslenabled, int optionalLocatorPort)
       throws Exception {
     instance.setUpServerVM(cacheServerSslenabled, optionalLocatorPort);
   }
 
-  public static int createServerTask() throws Exception {
+  private static int createServerTask() throws Exception {
     return instance.createServer();
   }
 
-  public static void setUpClientVMTask(String host, int port, boolean cacheServerSslenabled,
+  private static void setUpClientVMTask(String host, int port, boolean cacheServerSslenabled,
       boolean cacheServerSslRequireAuth, String keyStore, String trustStore,
-      boolean clientHasTrustedKeystore) throws Exception {
+      boolean clientHasTrustedKeystore) {
     instance.setUpClientVM(host, port, cacheServerSslenabled, cacheServerSslRequireAuth, keyStore,
         trustStore, true, clientHasTrustedKeystore);
   }
 
-  public static void setUpClientVMTaskNoSubscription(String host, int port,
+  private static void setUpClientVMTaskNoSubscription(String host, int port,
       boolean cacheServerSslenabled, boolean cacheServerSslRequireAuth, String keyStore,
-      String trustStore) throws Exception {
+      String trustStore) {
     instance.setUpClientVM(host, port, cacheServerSslenabled, cacheServerSslRequireAuth, keyStore,
         trustStore, false, true);
   }
 
-  public static void doClientRegionTestTask() {
+  private static void doClientRegionTestTask() {
     instance.doClientRegionTest();
   }
 
-  public static void verifyServerDoesNotReceiveClientUpdate() {
+  private static void verifyServerDoesNotReceiveClientUpdate() {
     instance.doVerifyServerDoesNotReceiveClientUpdate();
   }
 
@@ -369,24 +390,24 @@ public class CacheServerSSLConnectionDUnitTest extends JUnit4DistributedTestCase
     assertFalse(region.containsKey("clientkey"));
   }
 
-  public static void doServerRegionTestTask() {
+  private static void doServerRegionTestTask() {
     instance.doServerRegionTest();
   }
 
-  public static Object[] getCacheServerEndPointTask() { // TODO: avoid Object[]
+  private static Object[] getCacheServerEndPointTask() { // TODO: avoid Object[]
     Object[] array = new Object[2];
     array[0] = instance.getCacheServerHost();
     array[1] = instance.getCacheServerPort();
     return array;
   }
 
-  public static void closeCacheTask() {
+  private static void closeCacheTask() {
     if (instance != null && instance.cache != null) {
       instance.cache.close();
     }
   }
 
-  public static void closeClientCacheTask() {
+  private static void closeClientCacheTask() {
     if (instance != null && instance.clientCache != null) {
       instance.clientCache.close();
     }
@@ -394,10 +415,9 @@ public class CacheServerSSLConnectionDUnitTest extends JUnit4DistributedTestCase
 
   @Test
   public void testCacheServerSSL() throws Exception {
-    final Host host = Host.getHost(0);
-    VM serverVM = host.getVM(1);
-    VM clientVM = host.getVM(2);
-    VM serverVM2 = host.getVM(3);
+    VM serverVM = getVM(1);
+    VM clientVM = getVM(2);
+    VM serverVM2 = getVM(3);
 
     boolean cacheServerSslenabled = true;
     boolean cacheClientSslenabled = true;
@@ -417,7 +437,7 @@ public class CacheServerSSLConnectionDUnitTest extends JUnit4DistributedTestCase
       serverVM2.invoke(() -> setUpServerVMTask(cacheServerSslenabled, locatorPort));
       serverVM2.invoke(() -> createServerTask());
 
-      String hostName = host.getHostName();
+      String hostName = getHostName();
 
       clientVM.invoke(() -> setUpClientVMTask(hostName, port, cacheClientSslenabled,
           cacheClientSslRequireAuth, CLIENT_KEY_STORE, CLIENT_TRUST_STORE, true));
@@ -430,25 +450,25 @@ public class CacheServerSSLConnectionDUnitTest extends JUnit4DistributedTestCase
 
   /**
    * GEODE-2898: A non-responsive SSL client can block a server's "acceptor" thread
+   *
    * <p>
    * Start a server and then connect to it without completing the SSL handshake
-   * </p>
+   *
    * <p>
    * Attempt to connect to the server using a real SSL client, demonstrating that the server is not
    * blocked and can process the new connection request.
-   * </p>
    */
   @Test
   public void clientSlowToHandshakeDoesNotBlockServer() throws Throwable {
-    final Host host = Host.getHost(0);
-    VM serverVM = host.getVM(1);
-    VM clientVM = host.getVM(2);
-    VM slowClientVM = host.getVM(3);
+    VM serverVM = getVM(1);
+    VM clientVM = getVM(2);
+    VM slowClientVM = getVM(3);
+
     getBlackboard().initBlackboard();
 
     // a plain-text socket is used to connect to an ssl server & the handshake
     // is never performed. The server will log this exception & it should be ignored
-    IgnoredException.addIgnoredException("javax.net.ssl.SSLHandshakeException", serverVM);
+    addIgnoredException(SSLHandshakeException.class);
 
     boolean cacheServerSslenabled = true;
     boolean cacheClientSslenabled = true;
@@ -457,7 +477,7 @@ public class CacheServerSSLConnectionDUnitTest extends JUnit4DistributedTestCase
     serverVM.invoke(() -> setUpServerVMTask(cacheServerSslenabled, 0));
     int port = serverVM.invoke(() -> createServerTask());
 
-    String hostName = host.getHostName();
+    String hostName = getHostName();
 
     AsyncInvocation slowAsync = slowClientVM.invokeAsync(() -> connectToServer(hostName, port));
     try {
@@ -470,18 +490,8 @@ public class CacheServerSSLConnectionDUnitTest extends JUnit4DistributedTestCase
 
     } finally {
       getBlackboard().signalGate("testIsCompleted");
-      try {
-        if (slowAsync.isAlive()) {
-          slowAsync.join(60000);
-        }
-        if (slowAsync.exceptionOccurred()) {
-          throw slowAsync.getException();
-        }
-      } finally {
-        assertFalse(slowAsync.isAlive());
-      }
+      slowAsync.await();
     }
-
   }
 
   private void connectToServer(String hostName, int port) throws Exception {
@@ -496,10 +506,9 @@ public class CacheServerSSLConnectionDUnitTest extends JUnit4DistributedTestCase
   }
 
   @Test
-  public void testNonSSLClient() throws Exception {
-    final Host host = Host.getHost(0);
-    VM serverVM = host.getVM(1);
-    VM clientVM = host.getVM(2);
+  public void testNonSSLClient() {
+    VM serverVM = getVM(1);
+    VM clientVM = getVM(2);
 
     boolean cacheServerSslenabled = true;
     boolean cacheClientSslenabled = false;
@@ -508,14 +517,12 @@ public class CacheServerSSLConnectionDUnitTest extends JUnit4DistributedTestCase
     serverVM.invoke(() -> setUpServerVMTask(cacheServerSslenabled, 0));
     serverVM.invoke(() -> createServerTask());
 
-    Object array[] = (Object[]) serverVM.invoke(() -> getCacheServerEndPointTask());
+    Object array[] = serverVM.invoke(() -> getCacheServerEndPointTask());
     String hostName = (String) array[0];
     int port = (Integer) array[1];
 
-    IgnoredException expect =
-        IgnoredException.addIgnoredException("javax.net.ssl.SSLException", serverVM);
-    IgnoredException expect2 = IgnoredException.addIgnoredException("IOException", serverVM);
-    try {
+    try (IgnoredException i1 = addIgnoredException(SSLException.class);
+        IgnoredException i2 = addIgnoredException(IOException.class)) {
       clientVM.invoke(() -> setUpClientVMTaskNoSubscription(hostName, port, cacheClientSslenabled,
           cacheClientSslRequireAuth, TRUSTED_STORE, TRUSTED_STORE));
       clientVM.invoke(() -> doClientRegionTestTask());
@@ -523,53 +530,39 @@ public class CacheServerSSLConnectionDUnitTest extends JUnit4DistributedTestCase
       fail("Test should fail as non-ssl client is trying to connect to ssl configured server");
 
     } catch (Exception rmiException) {
-      Throwable e = rmiException.getCause();
-      // getLogWriter().info("ExceptionCause at clientVM " + e);
-      if (e instanceof org.apache.geode.cache.client.ServerOperationException) {
-        Throwable t = e.getCause();
-        // getLogWriter().info("Cause is " + t);
-        assertTrue(t instanceof org.apache.geode.security.AuthenticationRequiredException);
-      } else {
-        // getLogWriter().error("Unexpected exception ", e);
-        fail("Unexpected Exception: " + e + " expected: " + AuthenticationRequiredException.class);
-      }
-    } finally {
-      expect.remove();
-      expect2.remove();
+      assertThat(rmiException).hasRootCauseInstanceOf(AuthenticationRequiredException.class);
     }
   }
 
   @Test
-  public void testSSLClientWithNoAuth() throws Exception {
-    final Host host = Host.getHost(0);
-    VM serverVM = host.getVM(1);
-    VM clientVM = host.getVM(2);
+  public void testSSLClientWithNoAuth() {
+    VM serverVM = getVM(1);
+    VM clientVM = getVM(2);
 
     boolean cacheServerSslenabled = true;
     boolean cacheClientSslenabled = true;
     boolean cacheClientSslRequireAuth = false;
 
-    IgnoredException.addIgnoredException("SSLHandshakeException");
-    IgnoredException.addIgnoredException("ValidatorException");
+    addIgnoredException("SSLHandshakeException");
+    addIgnoredException("ValidatorException");
 
     serverVM.invoke(() -> setUpServerVMTask(cacheServerSslenabled, 0));
     serverVM.invoke(() -> createServerTask());
 
-    Object array[] = (Object[]) serverVM.invoke(() -> getCacheServerEndPointTask());
+    Object array[] = serverVM.invoke(() -> getCacheServerEndPointTask());
     String hostName = (String) array[0];
     int port = (Integer) array[1];
 
     clientVM.invoke(() -> setUpClientVMTask(hostName, port, cacheClientSslenabled,
         cacheClientSslRequireAuth, CLIENT_KEY_STORE, CLIENT_TRUST_STORE, true));
-    clientVM.invoke(() -> CacheServerSSLConnectionDUnitTest.doClientRegionTestTask());
-    serverVM.invoke(() -> CacheServerSSLConnectionDUnitTest.doServerRegionTestTask());
+    clientVM.invoke(() -> doClientRegionTestTask());
+    serverVM.invoke(() -> doServerRegionTestTask());
   }
 
   @Test
-  public void untrustedClientIsRejected() throws Throwable {
-    final Host host = Host.getHost(0);
-    VM serverVM = host.getVM(1);
-    VM clientVM = host.getVM(2);
+  public void untrustedClientIsRejected() {
+    VM serverVM = getVM(1);
+    VM clientVM = getVM(2);
 
     boolean cacheServerSslenabled = true;
     boolean cacheClientSslenabled = true;
@@ -578,31 +571,28 @@ public class CacheServerSSLConnectionDUnitTest extends JUnit4DistributedTestCase
     serverVM.invoke(() -> setUpServerVMTask(cacheServerSslenabled, 0));
     serverVM.invoke(() -> createServerTask());
 
-    Object array[] = (Object[]) serverVM.invoke(() -> getCacheServerEndPointTask());
+    Object array[] = serverVM.invoke(() -> getCacheServerEndPointTask());
     String hostName = (String) array[0];
     int port = (Integer) array[1];
 
-    IgnoredException.addIgnoredException("SSLHandshakeException");
+    addIgnoredException("SSLHandshakeException");
 
     clientVM.invoke(() -> setUpClientVMTask(hostName, port, cacheClientSslenabled,
         cacheClientSslRequireAuth, "default.keystore", CLIENT_TRUST_STORE, false));
 
     try {
-      clientVM.invoke(() -> CacheServerSSLConnectionDUnitTest.doClientRegionTestTask());
+      clientVM.invoke(() -> doClientRegionTestTask());
       fail("client should not have been able to execute a cache operation");
     } catch (RMIException e) {
-      assertTrue("expected a NoAvailableServersException but received " + e.getCause(),
-          e.getCause() instanceof NoAvailableServersException);
+      assertThat(e).hasRootCauseInstanceOf(NoAvailableServersException.class);
     }
-    serverVM
-        .invoke(() -> CacheServerSSLConnectionDUnitTest.verifyServerDoesNotReceiveClientUpdate());
+    serverVM.invoke(() -> verifyServerDoesNotReceiveClientUpdate());
   }
 
   @Test
-  public void testSSLClientWithNonSSLServer() throws Exception {
-    final Host host = Host.getHost(0);
-    VM serverVM = host.getVM(1);
-    VM clientVM = host.getVM(2);
+  public void testSSLClientWithNonSSLServer() {
+    VM serverVM = getVM(1);
+    VM clientVM = getVM(2);
 
     boolean cacheServerSslenabled = false;
     boolean cacheClientSslenabled = true;
@@ -611,13 +601,11 @@ public class CacheServerSSLConnectionDUnitTest extends JUnit4DistributedTestCase
     serverVM.invoke(() -> setUpServerVMTask(cacheServerSslenabled, 0));
     serverVM.invoke(() -> createServerTask());
 
-    Object array[] = (Object[]) serverVM.invoke(() -> getCacheServerEndPointTask());
+    Object array[] = serverVM.invoke(() -> getCacheServerEndPointTask());
     String hostName = (String) array[0];
     int port = (Integer) array[1];
 
-    IgnoredException expect =
-        IgnoredException.addIgnoredException("javax.net.ssl.SSLHandshakeException", serverVM);
-    try {
+    try (IgnoredException i = addIgnoredException(SSLHandshakeException.class)) {
       clientVM.invoke(() -> setUpClientVMTask(hostName, port, cacheClientSslenabled,
           cacheClientSslRequireAuth, TRUSTED_STORE, TRUSTED_STORE, true));
       clientVM.invoke(() -> doClientRegionTestTask());
@@ -625,20 +613,9 @@ public class CacheServerSSLConnectionDUnitTest extends JUnit4DistributedTestCase
       fail(
           "Test should fail as ssl client with ssl enabled is trying to connect to server with ssl disabled");
 
-    } catch (Exception rmiException) {
+    } catch (Exception e) {
       // ignore
-    } finally {
-      expect.remove();
+      assertThat(e).hasRootCauseInstanceOf(NoAvailableServersException.class);
     }
   }
-
-  @Override
-  public final void preTearDown() throws Exception {
-    final Host host = Host.getHost(0);
-    VM serverVM = host.getVM(1);
-    VM clientVM = host.getVM(2);
-    clientVM.invoke(() -> closeClientCacheTask());
-    serverVM.invoke(() -> closeCacheTask());
-
-  }
 }
diff --git a/geode-core/src/distributedTest/java/org/apache/geode/cache/client/internal/SSLNoClientAuthDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/cache/client/internal/SSLNoClientAuthDUnitTest.java
index 6989849..54f1aa3 100644
--- a/geode-core/src/distributedTest/java/org/apache/geode/cache/client/internal/SSLNoClientAuthDUnitTest.java
+++ b/geode-core/src/distributedTest/java/org/apache/geode/cache/client/internal/SSLNoClientAuthDUnitTest.java
@@ -25,16 +25,18 @@ import static org.apache.geode.distributed.ConfigurationProperties.SERVER_SSL_PR
 import static org.apache.geode.distributed.ConfigurationProperties.SERVER_SSL_REQUIRE_AUTHENTICATION;
 import static org.apache.geode.distributed.ConfigurationProperties.SERVER_SSL_TRUSTSTORE;
 import static org.apache.geode.distributed.ConfigurationProperties.SERVER_SSL_TRUSTSTORE_PASSWORD;
+import static org.apache.geode.test.dunit.VM.getVM;
 import static org.apache.geode.test.util.ResourceUtils.createTempFileFromResource;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.fail;
 
 import java.io.IOException;
 import java.io.PrintWriter;
 import java.io.StringWriter;
 import java.util.Properties;
 
+import org.junit.After;
+import org.junit.Before;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
@@ -49,15 +51,11 @@ import org.apache.geode.cache.client.ClientRegionFactory;
 import org.apache.geode.cache.client.ClientRegionShortcut;
 import org.apache.geode.cache.server.CacheServer;
 import org.apache.geode.internal.AvailablePortHelper;
-import org.apache.geode.test.dunit.Host;
 import org.apache.geode.test.dunit.VM;
 import org.apache.geode.test.dunit.internal.JUnit4DistributedTestCase;
 import org.apache.geode.test.junit.categories.MembershipTest;
 
-/**
- * Test for GEODE-396
- */
-@Category({MembershipTest.class})
+@Category(MembershipTest.class)
 public class SSLNoClientAuthDUnitTest extends JUnit4DistributedTestCase {
 
   private Cache cache;
@@ -70,19 +68,56 @@ public class SSLNoClientAuthDUnitTest extends JUnit4DistributedTestCase {
 
   private static SSLNoClientAuthDUnitTest instance = new SSLNoClientAuthDUnitTest();
 
-  @Override
-  public final void preSetUp() throws Exception {
+  @Before
+  public void setUp() {
     disconnectAllFromDS();
   }
 
-  public Cache createCache(Properties props) throws Exception {
+  @After
+  public void tearDown() {
+    VM serverVM = getVM(1);
+    VM clientVM = getVM(2);
+
+    clientVM.invoke(() -> closeClientCacheTask());
+    serverVM.invoke(() -> closeCacheTask());
+  }
+
+  @Test
+  public void testSSLServerWithNoAuth() {
+    VM serverVM = getVM(1);
+    VM clientVM = getVM(2);
+
+    boolean cacheServerSslenabled = true;
+    boolean cacheClientSslenabled = true;
+    boolean cacheClientSslRequireAuth = true;
+
+    serverVM.invoke(() -> setUpServerVMTask(cacheServerSslenabled));
+    serverVM.invoke(() -> createServerTask());
+
+    Object array[] = serverVM.invoke(() -> getCacheServerEndPointTask());
+    String hostName = (String) array[0];
+    int port = (Integer) array[1];
+    Object params[] = new Object[6];
+    params[0] = hostName;
+    params[1] = port;
+    params[2] = cacheClientSslenabled;
+    params[3] = cacheClientSslRequireAuth;
+    params[4] = DEFAULT_STORE;
+    params[5] = DEFAULT_STORE;
+
+    clientVM.invoke(() -> setUpClientVMTask(hostName, port,
+        cacheClientSslenabled, cacheClientSslRequireAuth, DEFAULT_STORE, DEFAULT_STORE));
+    clientVM.invoke(() -> doClientRegionTestTask());
+    serverVM.invoke(() -> doServerRegionTestTask());
+  }
+
+  private void createCache(Properties props) throws Exception {
     props.setProperty(MCAST_PORT, "0");
     props.setProperty(LOCATORS, "");
     cache = new CacheFactory(props).create();
     if (cache == null) {
       throw new Exception("CacheFactory.create() returned null ");
     }
-    return cache;
   }
 
   private void createServer() throws IOException {
@@ -93,30 +128,26 @@ public class SSLNoClientAuthDUnitTest extends JUnit4DistributedTestCase {
     hostName = cacheServer.getHostnameForClients();
   }
 
-  public int getCacheServerPort() {
+  private int getCacheServerPort() {
     return cacheServerPort;
   }
 
-  public String getCacheServerHost() {
+  private String getCacheServerHost() {
     return hostName;
   }
 
-  public void stopCacheServer() {
-    this.cacheServer.stop();
-  }
-
-
-  @SuppressWarnings("rawtypes")
-  public void setUpServerVM(boolean cacheServerSslenabled) throws Exception {
+  private void setUpServerVM(boolean cacheServerSslenabled) throws Exception {
     Properties gemFireProps = new Properties();
 
     String cacheServerSslprotocols = "any";
     String cacheServerSslciphers = "any";
     boolean cacheServerSslRequireAuth = false;
-    gemFireProps.put(SERVER_SSL_ENABLED, String.valueOf(cacheServerSslenabled));
-    gemFireProps.put(SERVER_SSL_PROTOCOLS, cacheServerSslprotocols);
-    gemFireProps.put(SERVER_SSL_CIPHERS, cacheServerSslciphers);
-    gemFireProps.put(SERVER_SSL_REQUIRE_AUTHENTICATION, String.valueOf(cacheServerSslRequireAuth));
+
+    gemFireProps.setProperty(SERVER_SSL_ENABLED, String.valueOf(cacheServerSslenabled));
+    gemFireProps.setProperty(SERVER_SSL_PROTOCOLS, cacheServerSslprotocols);
+    gemFireProps.setProperty(SERVER_SSL_CIPHERS, cacheServerSslciphers);
+    gemFireProps
+        .setProperty(SERVER_SSL_REQUIRE_AUTHENTICATION, String.valueOf(cacheServerSslRequireAuth));
 
     String keyStore =
         createTempFileFromResource(SSLNoClientAuthDUnitTest.class, DEFAULT_STORE)
@@ -124,16 +155,15 @@ public class SSLNoClientAuthDUnitTest extends JUnit4DistributedTestCase {
     String trustStore =
         createTempFileFromResource(SSLNoClientAuthDUnitTest.class, DEFAULT_STORE)
             .getAbsolutePath();
-    gemFireProps.put(SERVER_SSL_KEYSTORE_TYPE, "jks");
-    gemFireProps.put(SERVER_SSL_KEYSTORE, keyStore);
-    gemFireProps.put(SERVER_SSL_KEYSTORE_PASSWORD, "password");
-    gemFireProps.put(SERVER_SSL_TRUSTSTORE, trustStore);
-    gemFireProps.put(SERVER_SSL_TRUSTSTORE_PASSWORD, "password");
+    gemFireProps.setProperty(SERVER_SSL_KEYSTORE_TYPE, "jks");
+    gemFireProps.setProperty(SERVER_SSL_KEYSTORE, keyStore);
+    gemFireProps.setProperty(SERVER_SSL_KEYSTORE_PASSWORD, "password");
+    gemFireProps.setProperty(SERVER_SSL_TRUSTSTORE, trustStore);
+    gemFireProps.setProperty(SERVER_SSL_TRUSTSTORE_PASSWORD, "password");
 
     StringWriter sw = new StringWriter();
     PrintWriter writer = new PrintWriter(sw);
     gemFireProps.list(writer);
-    System.out.println("Starting cacheserver ds with following properties \n" + sw);
     createCache(gemFireProps);
 
     RegionFactory factory = cache.createRegionFactory(RegionShortcut.REPLICATE);
@@ -141,9 +171,8 @@ public class SSLNoClientAuthDUnitTest extends JUnit4DistributedTestCase {
     r.put("serverkey", "servervalue");
   }
 
-  public void setUpClientVM(String host, int port, boolean cacheServerSslenabled,
+  private void setUpClientVM(String host, int port, boolean cacheServerSslenabled,
       boolean cacheServerSslRequireAuth, String keyStore, String trustStore) {
-
     Properties gemFireProps = new Properties();
 
     String cacheServerSslprotocols = "any";
@@ -156,21 +185,21 @@ public class SSLNoClientAuthDUnitTest extends JUnit4DistributedTestCase {
         createTempFileFromResource(SSLNoClientAuthDUnitTest.class, trustStore)
             .getAbsolutePath();
     // using new server-ssl-* properties
-    gemFireProps.put(SERVER_SSL_ENABLED, String.valueOf(cacheServerSslenabled));
-    gemFireProps.put(SERVER_SSL_PROTOCOLS, cacheServerSslprotocols);
-    gemFireProps.put(SERVER_SSL_CIPHERS, cacheServerSslciphers);
-    gemFireProps.put(SERVER_SSL_REQUIRE_AUTHENTICATION, String.valueOf(cacheServerSslRequireAuth));
-
-    gemFireProps.put(SERVER_SSL_KEYSTORE_TYPE, "jks");
-    gemFireProps.put(SERVER_SSL_KEYSTORE, keyStorePath);
-    gemFireProps.put(SERVER_SSL_KEYSTORE_PASSWORD, "password");
-    gemFireProps.put(SERVER_SSL_TRUSTSTORE, trustStorePath);
-    gemFireProps.put(SERVER_SSL_TRUSTSTORE_PASSWORD, "password");
+    gemFireProps.setProperty(SERVER_SSL_ENABLED, String.valueOf(cacheServerSslenabled));
+    gemFireProps.setProperty(SERVER_SSL_PROTOCOLS, cacheServerSslprotocols);
+    gemFireProps.setProperty(SERVER_SSL_CIPHERS, cacheServerSslciphers);
+    gemFireProps
+        .setProperty(SERVER_SSL_REQUIRE_AUTHENTICATION, String.valueOf(cacheServerSslRequireAuth));
+
+    gemFireProps.setProperty(SERVER_SSL_KEYSTORE_TYPE, "jks");
+    gemFireProps.setProperty(SERVER_SSL_KEYSTORE, keyStorePath);
+    gemFireProps.setProperty(SERVER_SSL_KEYSTORE_PASSWORD, "password");
+    gemFireProps.setProperty(SERVER_SSL_TRUSTSTORE, trustStorePath);
+    gemFireProps.setProperty(SERVER_SSL_TRUSTSTORE_PASSWORD, "password");
 
     StringWriter sw = new StringWriter();
     PrintWriter writer = new PrintWriter(sw);
     gemFireProps.list(writer);
-    System.out.println("Starting client ds with following properties \n" + sw.getBuffer());
 
     ClientCacheFactory clientCacheFactory = new ClientCacheFactory(gemFireProps);
     clientCacheFactory.addPoolServer(host, port);
@@ -182,107 +211,57 @@ public class SSLNoClientAuthDUnitTest extends JUnit4DistributedTestCase {
     assertNotNull(region);
   }
 
-  public void doClientRegionTest() {
+  private void doClientRegionTest() {
     Region<String, String> region = clientCache.getRegion("serverRegion");
     assertEquals("servervalue", region.get("serverkey"));
     region.put("clientkey", "clientvalue");
     assertEquals("clientvalue", region.get("clientkey"));
   }
 
-  public void doServerRegionTest() {
+  private void doServerRegionTest() {
     Region<String, String> region = cache.getRegion("serverRegion");
     assertEquals("servervalue", region.get("serverkey"));
     assertEquals("clientvalue", region.get("clientkey"));
   }
 
-
-  public static void setUpServerVMTask(boolean cacheServerSslenabled) throws Exception {
+  private static void setUpServerVMTask(boolean cacheServerSslenabled) throws Exception {
     instance.setUpServerVM(cacheServerSslenabled);
   }
 
-  public static void createServerTask() throws Exception {
+  private static void createServerTask() throws Exception {
     instance.createServer();
   }
 
-  public static void setUpClientVMTask(String host, int port, boolean cacheServerSslenabled,
-      boolean cacheServerSslRequireAuth, String keyStore, String trustStore) throws Exception {
+  private static void setUpClientVMTask(String host, int port, boolean cacheServerSslenabled,
+      boolean cacheServerSslRequireAuth, String keyStore, String trustStore) {
     instance.setUpClientVM(host, port, cacheServerSslenabled, cacheServerSslRequireAuth, keyStore,
         trustStore);
   }
 
-  public static void doClientRegionTestTask() {
+  private static void doClientRegionTestTask() {
     instance.doClientRegionTest();
   }
 
-  public static void doServerRegionTestTask() {
+  private static void doServerRegionTestTask() {
     instance.doServerRegionTest();
   }
 
-  public static Object[] getCacheServerEndPointTask() {
+  private static Object[] getCacheServerEndPointTask() {
     Object[] array = new Object[2];
     array[0] = instance.getCacheServerHost();
     array[1] = instance.getCacheServerPort();
     return array;
   }
 
-  public static void closeCacheTask() {
+  private static void closeCacheTask() {
     if (instance != null && instance.cache != null) {
       instance.cache.close();
     }
   }
 
-  public static void closeClientCacheTask() {
+  private static void closeClientCacheTask() {
     if (instance != null && instance.clientCache != null) {
       instance.clientCache.close();
     }
   }
-
-  /**
-   * Test for GEODE-396
-   */
-  @Test
-  public void testSSLServerWithNoAuth() throws Exception {
-    final Host host = Host.getHost(0);
-    VM serverVM = host.getVM(1);
-    VM clientVM = host.getVM(2);
-
-    boolean cacheServerSslenabled = true;
-    boolean cacheClientSslenabled = true;
-    boolean cacheClientSslRequireAuth = true;
-
-    serverVM.invoke(() -> SSLNoClientAuthDUnitTest.setUpServerVMTask(cacheServerSslenabled));
-    serverVM.invoke(() -> SSLNoClientAuthDUnitTest.createServerTask());
-
-    Object array[] =
-        (Object[]) serverVM.invoke(() -> SSLNoClientAuthDUnitTest.getCacheServerEndPointTask());
-    String hostName = (String) array[0];
-    int port = (Integer) array[1];
-    Object params[] = new Object[6];
-    params[0] = hostName;
-    params[1] = port;
-    params[2] = cacheClientSslenabled;
-    params[3] = cacheClientSslRequireAuth;
-    params[4] = DEFAULT_STORE;
-    params[5] = DEFAULT_STORE;
-    // getLogWriter().info("Starting client with server endpoint " + hostName + ":" + port);
-    try {
-      clientVM.invoke(() -> SSLNoClientAuthDUnitTest.setUpClientVMTask(hostName, port,
-          cacheClientSslenabled, cacheClientSslRequireAuth, DEFAULT_STORE, DEFAULT_STORE));
-      clientVM.invoke(() -> SSLNoClientAuthDUnitTest.doClientRegionTestTask());
-      serverVM.invoke(() -> SSLNoClientAuthDUnitTest.doServerRegionTestTask());
-    } catch (Exception rmiException) {
-      Throwable e = rmiException.getCause();
-      // getLogWriter().info("ExceptionCause at clientVM " + e);
-      fail("Unexpected Exception " + e);
-    }
-  }
-
-  @Override
-  public final void preTearDown() throws Exception {
-    final Host host = Host.getHost(0);
-    VM serverVM = host.getVM(1);
-    VM clientVM = host.getVM(2);
-    clientVM.invoke(() -> SSLNoClientAuthDUnitTest.closeClientCacheTask());
-    serverVM.invoke(() -> SSLNoClientAuthDUnitTest.closeCacheTask());
-  }
 }
diff --git a/geode-core/src/distributedTest/java/org/apache/geode/cache/query/dunit/PartitionedRegionCompactRangeIndexDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/cache/query/dunit/PartitionedRegionCompactRangeIndexDUnitTest.java
index f0b91d3..afb9b5d 100644
--- a/geode-core/src/distributedTest/java/org/apache/geode/cache/query/dunit/PartitionedRegionCompactRangeIndexDUnitTest.java
+++ b/geode-core/src/distributedTest/java/org/apache/geode/cache/query/dunit/PartitionedRegionCompactRangeIndexDUnitTest.java
@@ -16,9 +16,9 @@ package org.apache.geode.cache.query.dunit;
 
 import static org.apache.geode.distributed.ConfigurationProperties.CACHE_XML_FILE;
 import static org.apache.geode.distributed.ConfigurationProperties.LOCATORS;
+import static org.apache.geode.test.dunit.IgnoredException.addIgnoredException;
 import static org.apache.geode.test.util.ResourceUtils.createTempFileFromResource;
 import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.fail;
 
 import java.io.Serializable;
 import java.util.Collection;
@@ -34,29 +34,30 @@ import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
 import org.apache.geode.cache.Region;
+import org.apache.geode.cache.query.IndexNameConflictException;
 import org.apache.geode.cache.query.Query;
 import org.apache.geode.cache.query.QueryService;
 import org.apache.geode.cache.query.SelectResults;
 import org.apache.geode.cache.query.data.Portfolio;
 import org.apache.geode.test.dunit.DistributedTestUtils;
-import org.apache.geode.test.dunit.IgnoredException;
 import org.apache.geode.test.dunit.SerializableRunnable;
 import org.apache.geode.test.dunit.rules.ClusterStartupRule;
 import org.apache.geode.test.dunit.rules.MemberVM;
 import org.apache.geode.test.junit.categories.OQLQueryTest;
 
-@Category({OQLQueryTest.class})
+@Category(OQLQueryTest.class)
 public class PartitionedRegionCompactRangeIndexDUnitTest implements Serializable {
+
   @Rule
   public ClusterStartupRule clusterStartupRule = new ClusterStartupRule();
 
-  protected MemberVM locator;
+  private MemberVM locator;
 
-  Properties props;
+  private Properties props;
 
-  MemberVM server1;
-  MemberVM server2;
-  MemberVM server3;
+  private MemberVM server1;
+  private MemberVM server2;
+  private MemberVM server3;
 
   private Properties getSystemProperties(String cacheXML) {
     Properties props = new Properties();
@@ -67,22 +68,22 @@ public class PartitionedRegionCompactRangeIndexDUnitTest implements Serializable
   }
 
   @Before
-  public void before() throws Exception {
-    this.locator = this.clusterStartupRule.startLocatorVM(0);
+  public void before() {
+    locator = clusterStartupRule.startLocatorVM(0);
     props = getSystemProperties("PersistentPartitionWithIndex.xml");
 
-    server1 = this.clusterStartupRule.startServerVM(1, props, this.locator.getPort());
-    server2 = this.clusterStartupRule.startServerVM(2, props, this.locator.getPort());
-    server3 = this.clusterStartupRule.startServerVM(3, props, this.locator.getPort());
+    server1 = clusterStartupRule.startServerVM(1, props, locator.getPort());
+    server2 = clusterStartupRule.startServerVM(2, props, locator.getPort());
+    server3 = clusterStartupRule.startServerVM(3, props, locator.getPort());
 
     // Adding due to known race condition for creation of partitioned indexes via cache.xml
-    IgnoredException.addIgnoredException("IndexNameConflictException");
+    addIgnoredException(IndexNameConflictException.class);
   }
 
   @Test
-  public void testGIIUpdateWithIndexDoesNotDuplicateEntryInIndexWhenAlreadyRecoveredFromPersistence()
-      throws Exception {
-    String regionName = "persistentTestRegion"; // this region is created via cache.xml
+  public void testGIIUpdateWithIndexDoesNotDuplicateEntryInIndexWhenAlreadyRecoveredFromPersistence() {
+    // this region is created via cache.xml
+    String regionName = "persistentTestRegion";
     String idQuery = "select * from /" + regionName + " p where p.ID = 1";
     int idQueryExpectedSize = 1;
     int numEntries = 100;
@@ -97,8 +98,8 @@ public class PartitionedRegionCompactRangeIndexDUnitTest implements Serializable
     // update entries
     server3.invoke(() -> populateRegion(regionName, entries));
     clusterStartupRule.stop(1, false);
-    server1 = this.clusterStartupRule.startServerVM(1, props, this.locator.getPort());
-    server2 = this.clusterStartupRule.startServerVM(2, props, this.locator.getPort());
+    server1 = clusterStartupRule.startServerVM(1, props, locator.getPort());
+    server2 = clusterStartupRule.startServerVM(2, props, locator.getPort());
 
     server3.invoke(verifyQueryResultsSize(idQuery, idQueryExpectedSize));
     server2.invoke(verifyQueryResultsSize(idQuery, idQueryExpectedSize));
@@ -108,8 +109,8 @@ public class PartitionedRegionCompactRangeIndexDUnitTest implements Serializable
   @Test
   public void giiWithPersistenceAndStaleDataDueToUpdatesShouldCorrectlyPopulateIndexes()
       throws Exception {
-    String regionName = "persistentTestRegionWithEntrySetIndex"; // this region is created via
-                                                                 // cache.xml
+    // this region is created via cache.xml
+    String regionName = "persistentTestRegionWithEntrySetIndex";
     int numEntries = 100;
     Map<String, Portfolio> entries = new HashMap<>();
     IntStream.range(0, numEntries).forEach(i -> entries.put("key-" + i, new Portfolio(10000 + i)));
@@ -125,12 +126,12 @@ public class PartitionedRegionCompactRangeIndexDUnitTest implements Serializable
     clusterStartupRule.stop(3, false);
 
     Thread t3 =
-        new Thread(() -> this.clusterStartupRule.startServerVM(3, props, this.locator.getPort()));
+        new Thread(() -> clusterStartupRule.startServerVM(3, props, locator.getPort()));
     t3.start();
     Thread t1 =
-        new Thread(() -> this.clusterStartupRule.startServerVM(1, props, this.locator.getPort()));
+        new Thread(() -> clusterStartupRule.startServerVM(1, props, locator.getPort()));
     t1.start();
-    this.clusterStartupRule.startServerVM(2, props, this.locator.getPort());
+    clusterStartupRule.startServerVM(2, props, locator.getPort());
     t3.join();
     t1.join();
 
@@ -150,12 +151,11 @@ public class PartitionedRegionCompactRangeIndexDUnitTest implements Serializable
     });
   }
 
-
   @Test
   public void giiWithPersistenceAndStaleDataDueToSameUpdatesShouldCorrectlyPopulateIndexes()
       throws Exception {
-    String regionName = "persistentTestRegionWithEntrySetIndex"; // this region is created via
-    // cache.xml
+    // this region is created via cache.xml
+    String regionName = "persistentTestRegionWithEntrySetIndex";
     int numEntries = 100;
     Map<String, Portfolio> entries = new HashMap<>();
     IntStream.range(0, numEntries).forEach(i -> entries.put("key-" + i, new Portfolio(i)));
@@ -171,12 +171,12 @@ public class PartitionedRegionCompactRangeIndexDUnitTest implements Serializable
     clusterStartupRule.stop(3, false);
 
     Thread t3 =
-        new Thread(() -> this.clusterStartupRule.startServerVM(3, props, this.locator.getPort()));
+        new Thread(() -> clusterStartupRule.startServerVM(3, props, locator.getPort()));
     t3.start();
     Thread t1 =
-        new Thread(() -> this.clusterStartupRule.startServerVM(1, props, this.locator.getPort()));
+        new Thread(() -> clusterStartupRule.startServerVM(1, props, locator.getPort()));
     t1.start();
-    this.clusterStartupRule.startServerVM(2, props, this.locator.getPort());
+    clusterStartupRule.startServerVM(2, props, locator.getPort());
     t3.join();
     t1.join();
 
@@ -196,12 +196,11 @@ public class PartitionedRegionCompactRangeIndexDUnitTest implements Serializable
     });
   }
 
-
   @Test
   public void giiWithPersistenceAndStaleDataDueToUpdatesShouldCorrectlyPopulateIndexesWithEntrySet()
       throws Exception {
-    String regionName = "persistentTestRegionWithEntrySetIndex"; // this region is created via
-                                                                 // cache.xml
+    // this region is created via cache.xml
+    String regionName = "persistentTestRegionWithEntrySetIndex";
     int numEntries = 100;
     Map<String, Portfolio> entries = new HashMap<>();
     IntStream.range(0, numEntries).forEach(i -> entries.put("key-" + i, new Portfolio(10000 + i)));
@@ -218,12 +217,12 @@ public class PartitionedRegionCompactRangeIndexDUnitTest implements Serializable
     clusterStartupRule.stop(3, false);
 
     Thread t3 =
-        new Thread(() -> this.clusterStartupRule.startServerVM(3, props, this.locator.getPort()));
+        new Thread(() -> clusterStartupRule.startServerVM(3, props, locator.getPort()));
     t3.start();
     Thread t1 =
-        new Thread(() -> this.clusterStartupRule.startServerVM(1, props, this.locator.getPort()));
+        new Thread(() -> clusterStartupRule.startServerVM(1, props, locator.getPort()));
     t1.start();
-    this.clusterStartupRule.startServerVM(2, props, this.locator.getPort());
+    clusterStartupRule.startServerVM(2, props, locator.getPort());
     t3.join();
     t1.join();
 
@@ -246,8 +245,8 @@ public class PartitionedRegionCompactRangeIndexDUnitTest implements Serializable
   @Test
   public void giiWithPersistenceAndStaleDataDueToDeletesShouldProvideCorrectResultsWithEntrySet()
       throws Exception {
-    String regionName = "persistentTestRegionWithEntrySetIndex"; // this region is created via
-                                                                 // cache.xml
+    // this region is created via cache.xml
+    String regionName = "persistentTestRegionWithEntrySetIndex";
     int numEntries = 100;
     Map<String, Portfolio> entries = new HashMap<>();
     IntStream.range(0, numEntries).forEach(i -> entries.put("key-" + i, new Portfolio(i)));
@@ -260,12 +259,12 @@ public class PartitionedRegionCompactRangeIndexDUnitTest implements Serializable
     clusterStartupRule.stop(3, false);
 
     Thread t3 =
-        new Thread(() -> this.clusterStartupRule.startServerVM(3, props, this.locator.getPort()));
+        new Thread(() -> clusterStartupRule.startServerVM(3, props, locator.getPort()));
     t3.start();
     Thread t1 =
-        new Thread(() -> this.clusterStartupRule.startServerVM(1, props, this.locator.getPort()));
+        new Thread(() -> clusterStartupRule.startServerVM(1, props, locator.getPort()));
     t1.start();
-    this.clusterStartupRule.startServerVM(2, props, this.locator.getPort());
+    clusterStartupRule.startServerVM(2, props, locator.getPort());
     t3.join();
     t1.join();
 
@@ -288,8 +287,8 @@ public class PartitionedRegionCompactRangeIndexDUnitTest implements Serializable
   @Test
   public void giiWithPersistenceAndStaleDataDueToDeletesShouldHaveEmptyIndexesWithEntrySet()
       throws Exception {
-    String regionName = "persistentTestRegionWithEntrySetIndex"; // this region is created via
-                                                                 // cache.xml
+    // this region is created via cache.xml
+    String regionName = "persistentTestRegionWithEntrySetIndex";
     int numEntries = 100;
     Map<String, Portfolio> entries = new HashMap<>();
     IntStream.range(0, numEntries).forEach(i -> entries.put("key-" + i, new Portfolio(i)));
@@ -302,12 +301,12 @@ public class PartitionedRegionCompactRangeIndexDUnitTest implements Serializable
     clusterStartupRule.stop(3, false);
 
     Thread t3 =
-        new Thread(() -> this.clusterStartupRule.startServerVM(3, props, this.locator.getPort()));
+        new Thread(() -> clusterStartupRule.startServerVM(3, props, locator.getPort()));
     t3.start();
     Thread t1 =
-        new Thread(() -> this.clusterStartupRule.startServerVM(1, props, this.locator.getPort()));
+        new Thread(() -> clusterStartupRule.startServerVM(1, props, locator.getPort()));
     t1.start();
-    this.clusterStartupRule.startServerVM(2, props, this.locator.getPort());
+    clusterStartupRule.startServerVM(2, props, locator.getPort());
     t3.join();
     t1.join();
 
@@ -327,7 +326,8 @@ public class PartitionedRegionCompactRangeIndexDUnitTest implements Serializable
   @Test
   public void giiWithPersistenceAndStaleDataDueToDeletesShouldProvideCorrectResultsWithIndexes()
       throws Exception {
-    String regionName = "persistentTestRegion"; // this region is created via cache.xml
+    // this region is created via cache.xml
+    String regionName = "persistentTestRegion";
     int numEntries = 100;
     Map<String, Portfolio> entries = new HashMap<>();
     IntStream.range(0, numEntries).forEach(i -> entries.put("key-" + i, new Portfolio(i)));
@@ -339,12 +339,12 @@ public class PartitionedRegionCompactRangeIndexDUnitTest implements Serializable
     clusterStartupRule.stop(3, false);
 
     Thread t3 =
-        new Thread(() -> this.clusterStartupRule.startServerVM(3, props, this.locator.getPort()));
+        new Thread(() -> clusterStartupRule.startServerVM(3, props, locator.getPort()));
     t3.start();
     Thread t1 =
-        new Thread(() -> this.clusterStartupRule.startServerVM(1, props, this.locator.getPort()));
+        new Thread(() -> clusterStartupRule.startServerVM(1, props, locator.getPort()));
     t1.start();
-    this.clusterStartupRule.startServerVM(2, props, this.locator.getPort());
+    clusterStartupRule.startServerVM(2, props, locator.getPort());
     t3.join();
     t1.join();
 
@@ -367,7 +367,8 @@ public class PartitionedRegionCompactRangeIndexDUnitTest implements Serializable
   @Test
   public void giiWithPersistenceAndStaleDataDueToDeletesShouldHaveEmptyIndexes()
       throws Exception {
-    String regionName = "persistentTestRegion"; // this region is created via cache.xml
+    // this region is created via cache.xml
+    String regionName = "persistentTestRegion";
     int numEntries = 100;
     Map<String, Portfolio> entries = new HashMap<>();
     IntStream.range(0, numEntries).forEach(i -> entries.put("key-" + i, new Portfolio(i)));
@@ -380,12 +381,12 @@ public class PartitionedRegionCompactRangeIndexDUnitTest implements Serializable
     clusterStartupRule.stop(3, false);
 
     Thread t3 =
-        new Thread(() -> this.clusterStartupRule.startServerVM(3, props, this.locator.getPort()));
+        new Thread(() -> clusterStartupRule.startServerVM(3, props, locator.getPort()));
     t3.start();
     Thread t1 =
-        new Thread(() -> this.clusterStartupRule.startServerVM(1, props, this.locator.getPort()));
+        new Thread(() -> clusterStartupRule.startServerVM(1, props, locator.getPort()));
     t1.start();
-    this.clusterStartupRule.startServerVM(2, props, this.locator.getPort());
+    clusterStartupRule.startServerVM(2, props, locator.getPort());
     t3.join();
     t1.join();
 
@@ -403,13 +404,13 @@ public class PartitionedRegionCompactRangeIndexDUnitTest implements Serializable
   }
 
   private void verifyAllEntries(String query, Supplier<IntStream> idsSupplier, int numTimes,
-      int expectedSize) throws Exception {
+      int expectedSize) {
     for (int j = 0; j < numTimes; j++) {
       idsSupplier.get().forEach(i -> {
         try {
           verifyQueryResultsSize(query + i, expectedSize).run();
         } catch (Exception e) {
-          fail();
+          throw new RuntimeException(e);
         }
       });
     }
@@ -425,8 +426,8 @@ public class PartitionedRegionCompactRangeIndexDUnitTest implements Serializable
           SelectResults sr = (SelectResults) q.execute();
           assertEquals(expectedSize, sr.size());
         } catch (Exception e) {
-          e.printStackTrace();
-          fail("Exception occurred when executing verifyQueryResultsSize for query:" + query);
+          throw new RuntimeException(
+              "Exception occurred when executing verifyQueryResultsSize for query:" + query, e);
         }
       }
     };
diff --git a/geode-core/src/distributedTest/java/org/apache/geode/cache/query/partitioned/PRQueryDUnitHelper.java b/geode-core/src/distributedTest/java/org/apache/geode/cache/query/partitioned/PRQueryDUnitHelper.java
index 8fa8308..570ccbf 100755
--- a/geode-core/src/distributedTest/java/org/apache/geode/cache/query/partitioned/PRQueryDUnitHelper.java
+++ b/geode-core/src/distributedTest/java/org/apache/geode/cache/query/partitioned/PRQueryDUnitHelper.java
@@ -76,6 +76,7 @@ import org.apache.geode.internal.cache.GemFireCacheImpl;
 import org.apache.geode.internal.cache.LocalRegion;
 import org.apache.geode.internal.cache.PartitionedRegion;
 import org.apache.geode.test.dunit.Assert;
+import org.apache.geode.test.dunit.LogWriterUtils;
 import org.apache.geode.test.dunit.SerializableRunnable;
 import org.apache.geode.test.dunit.SerializableRunnableIF;
 import org.apache.geode.test.dunit.cache.internal.JUnit4CacheTestCase;
@@ -83,10 +84,12 @@ import org.apache.geode.test.dunit.internal.JUnit4DistributedTestCase;
 
 /**
  * This is a helper class for the various Partitioned Query DUnit Test Cases
+ *
+ * TODO: inline and then delete class PRQueryDUnitHelper
  */
 public class PRQueryDUnitHelper implements Serializable {
 
-  static Cache cache = null;
+  static Cache cache;
 
   public static void setCache(Cache cache) {
     PRQueryDUnitHelper.cache = cache;
@@ -96,10 +99,9 @@ public class PRQueryDUnitHelper implements Serializable {
     return cache;
   }
 
-  public CacheSerializableRunnable getCacheSerializableRunnableForLocalRegionCreation(
+  CacheSerializableRunnable getCacheSerializableRunnableForLocalRegionCreation(
       final String regionName, final Class constraint) {
-    SerializableRunnable createPrRegion;
-    createPrRegion = new CacheSerializableRunnable(regionName) {
+    return new CacheSerializableRunnable(regionName) {
       @Override
       public void run2() throws CacheException {
         Cache cache = getCache();
@@ -110,7 +112,7 @@ public class PRQueryDUnitHelper implements Serializable {
           attr.setScope(Scope.LOCAL);
           localRegion = cache.createRegion(regionName, attr.create());
         } catch (IllegalStateException ex) {
-          org.apache.geode.test.dunit.LogWriterUtils.getLogWriter().warning(
+          LogWriterUtils.getLogWriter().warning(
               "PRQueryDUnitHelper#getCacheSerializableRunnableForPRCreate: Creation caught IllegalStateException",
               ex);
         }
@@ -126,29 +128,21 @@ public class PRQueryDUnitHelper implements Serializable {
             !localRegion.isDestroyed());
       }
     };
-
-    return (CacheSerializableRunnable) createPrRegion;
   }
 
-  public CacheSerializableRunnable getCacheSerializableRunnableForLocalRegionWithAsyncIndexCreation(
+  CacheSerializableRunnable getCacheSerializableRunnableForLocalRegionWithAsyncIndexCreation(
       final String regionName, final Class constraint) {
-    SerializableRunnable createPrRegion;
-    createPrRegion = new CacheSerializableRunnable(regionName) {
+    return new CacheSerializableRunnable(regionName) {
       @Override
       public void run2() throws CacheException {
         Cache cache = getCache();
-        Region localRegion = null;
-        try {
-          AttributesFactory attr = new AttributesFactory();
-          attr.setValueConstraint(constraint);
-          attr.setScope(Scope.LOCAL);
-          attr.setIndexMaintenanceSynchronous(false);
-          localRegion = cache.createRegion(regionName, attr.create());
-        } catch (IllegalStateException ex) {
-          org.apache.geode.test.dunit.LogWriterUtils.getLogWriter().warning(
-              "PRQueryDUnitHelper#getCacheSerializableRunnableForPRCreate: Creation caught IllegalStateException",
-              ex);
-        }
+
+        AttributesFactory attr = new AttributesFactory();
+        attr.setValueConstraint(constraint);
+        attr.setScope(Scope.LOCAL);
+        attr.setIndexMaintenanceSynchronous(false);
+        Region localRegion = cache.createRegion(regionName, attr.create());
+
         assertNotNull(
             "PRQueryDUnitHelper#getCacheSerializableRunnableForPRCreate: Partitioned Region "
                 + regionName + " not in cache",
@@ -161,25 +155,17 @@ public class PRQueryDUnitHelper implements Serializable {
             !localRegion.isDestroyed());
       }
     };
-
-    return (CacheSerializableRunnable) createPrRegion;
   }
 
   public CacheSerializableRunnable getCacheSerializableRunnableForReplicatedRegionCreation(
       final String regionName) {
-    SerializableRunnable createPrRegion;
-    createPrRegion = new CacheSerializableRunnable(regionName) {
+    return new CacheSerializableRunnable(regionName) {
       @Override
       public void run2() throws CacheException {
         Cache cache = getCache();
-        Region localRegion = null;
-        try {
-          localRegion = cache.createRegionFactory(RegionShortcut.REPLICATE).create(regionName);
-        } catch (IllegalStateException ex) {
-          org.apache.geode.test.dunit.LogWriterUtils.getLogWriter().warning(
-              "PRQueryDUnitHelper#getCacheSerializableRunnableForPRCreate: Creation caught IllegalStateException",
-              ex);
-        }
+
+        Region localRegion = cache.createRegionFactory(RegionShortcut.REPLICATE).create(regionName);
+
         assertNotNull(
             "PRQueryDUnitHelper#getCacheSerializableRunnableForPRCreate: Partitioned Region "
                 + regionName + " not in cache",
@@ -192,8 +178,6 @@ public class PRQueryDUnitHelper implements Serializable {
             !localRegion.isDestroyed());
       }
     };
-
-    return (CacheSerializableRunnable) createPrRegion;
   }
 
   /**
@@ -203,14 +187,10 @@ public class PRQueryDUnitHelper implements Serializable {
    */
   public CacheSerializableRunnable getCacheSerializableRunnableForPRCreate(final String regionName,
       final int redundancy, final Class constraint) {
-
-    SerializableRunnable createPrRegion;
-    createPrRegion = new CacheSerializableRunnable(regionName) {
+    return new CacheSerializableRunnable(regionName) {
       @Override
       public void run2() throws CacheException {
-
         Cache cache = getCache();
-        Region partitionedregion = null;
         AttributesFactory attr = new AttributesFactory();
         attr.setValueConstraint(constraint);
 
@@ -219,7 +199,7 @@ public class PRQueryDUnitHelper implements Serializable {
 
         attr.setPartitionAttributes(prAttr);
 
-        partitionedregion = cache.createRegion(regionName, attr.create());
+        Region partitionedregion = cache.createRegion(regionName, attr.create());
         assertNotNull(
             "PRQueryDUnitHelper#getCacheSerializableRunnableForPRCreateWithRedundancy: Partitioned Region "
                 + regionName + " not in cache",
@@ -232,8 +212,6 @@ public class PRQueryDUnitHelper implements Serializable {
             !partitionedregion.isDestroyed());
       }
     };
-
-    return (CacheSerializableRunnable) createPrRegion;
   }
 
   /**
@@ -242,20 +220,16 @@ public class PRQueryDUnitHelper implements Serializable {
    *
    * @return cacheSerializable object
    */
-  public CacheSerializableRunnable getCacheSerializableRunnableForColocatedPRCreate(
+  CacheSerializableRunnable getCacheSerializableRunnableForColocatedPRCreate(
       final String regionName, final int redundancy, final Class constraint,
       boolean makePersistent) {
+    String childRegionName = regionName + "Child";
+    String diskName = "disk";
 
-    final String childRegionName = regionName + "Child";
-    final String diskName = "disk";
-    SerializableRunnable createPrRegion;
-    createPrRegion = new CacheSerializableRunnable(regionName) {
+    return new CacheSerializableRunnable(regionName) {
       @Override
       public void run2() throws CacheException {
-
         Cache cache = getCache();
-        Region partitionedregion = null;
-        Region childRegion = null;
         AttributesFactory attr = new AttributesFactory();
         attr.setValueConstraint(constraint);
         if (makePersistent) {
@@ -276,7 +250,7 @@ public class PRQueryDUnitHelper implements Serializable {
         attr.setPartitionAttributes(paf.create());
 
         // parent region
-        partitionedregion = cache.createRegion(regionName, attr.create());
+        Region partitionedregion = cache.createRegion(regionName, attr.create());
         assertNotNull(
             "PRQueryDUnitHelper#getCacheSerializableRunnableForPRCreateWithRedundancy: Partitioned Region "
                 + regionName + " not in cache",
@@ -292,11 +266,10 @@ public class PRQueryDUnitHelper implements Serializable {
         attr.setValueConstraint(constraint);
         paf.setColocatedWith(regionName);
         attr.setPartitionAttributes(paf.create());
-        childRegion = cache.createRegion(childRegionName, attr.create());
+
+        cache.createRegion(childRegionName, attr.create());
       }
     };
-
-    return (CacheSerializableRunnable) createPrRegion;
   }
 
   /**
@@ -305,20 +278,15 @@ public class PRQueryDUnitHelper implements Serializable {
    *
    * @return cacheSerializable object
    */
-  public CacheSerializableRunnable getCacheSerializableRunnableForColocatedParentCreate(
+  CacheSerializableRunnable getCacheSerializableRunnableForColocatedParentCreate(
       final String regionName, final int redundancy, final Class constraint,
       boolean makePersistent) {
+    String diskName = "disk";
 
-    final String childRegionName = regionName + "Child";
-    final String diskName = "disk";
-    SerializableRunnable createPrRegion;
-    createPrRegion = new CacheSerializableRunnable(regionName + "-NoChildRegion") {
+    return new CacheSerializableRunnable(regionName + "-NoChildRegion") {
       @Override
       public void run2() throws CacheException {
-
         Cache cache = getCache();
-        Region partitionedregion = null;
-        Region childRegion = null;
         AttributesFactory attr = new AttributesFactory();
         attr.setValueConstraint(constraint);
         if (makePersistent) {
@@ -339,7 +307,7 @@ public class PRQueryDUnitHelper implements Serializable {
         attr.setPartitionAttributes(paf.create());
 
         // parent region
-        partitionedregion = cache.createRegion(regionName, attr.create());
+        Region partitionedregion = cache.createRegion(regionName, attr.create());
         assertNotNull(
             "PRQueryDUnitHelper#getCacheSerializableRunnableForPRCreateWithRedundancy: Partitioned Region "
                 + regionName + " not in cache",
@@ -352,8 +320,6 @@ public class PRQueryDUnitHelper implements Serializable {
             !partitionedregion.isDestroyed());
       }
     };
-
-    return (CacheSerializableRunnable) createPrRegion;
   }
 
   /**
@@ -362,60 +328,58 @@ public class PRQueryDUnitHelper implements Serializable {
    *
    * @return cacheSerializable object
    */
-  public CacheSerializableRunnable getCacheSerializableRunnableForColocatedChildCreate(
+  CacheSerializableRunnable getCacheSerializableRunnableForColocatedChildCreate(
       final String regionName, final int redundancy, final Class constraint, boolean isPersistent) {
 
     final String childRegionName = regionName + "Child";
     final String diskName = "disk";
-    SerializableRunnable createPrRegion;
-    createPrRegion = new CacheSerializableRunnable(regionName + "-ChildRegion") {
-      @Override
-      public void run2() throws CacheException {
+    SerializableRunnable createPrRegion =
+        new CacheSerializableRunnable(regionName + "-ChildRegion") {
+          @Override
+          public void run2() throws CacheException {
 
-        Cache cache = getCache();
-        Region partitionedregion = null;
-        Region childRegion = null;
-        AttributesFactory attr = new AttributesFactory();
-        attr.setValueConstraint(constraint);
-        if (isPersistent) {
-          DiskStore ds = cache.findDiskStore(diskName);
-          if (ds == null) {
-            // ds = cache.createDiskStoreFactory().setDiskDirs(getDiskDirs())
-            ds = cache.createDiskStoreFactory()
-                .setDiskDirs(
-                    org.apache.geode.test.dunit.cache.internal.JUnit4CacheTestCase.getDiskDirs())
-                .create(diskName);
-          }
-          attr.setDataPolicy(DataPolicy.PERSISTENT_PARTITION);
-          attr.setDiskStoreName(diskName);
-        } else {
-          attr.setDataPolicy(DataPolicy.PARTITION);
-          attr.setDiskStoreName(null);
-        }
+            Cache cache = getCache();
+            Region partitionedregion = null;
+            AttributesFactory attr = new AttributesFactory();
+            attr.setValueConstraint(constraint);
+            if (isPersistent) {
+              DiskStore ds = cache.findDiskStore(diskName);
+              if (ds == null) {
+                // ds = cache.createDiskStoreFactory().setDiskDirs(getDiskDirs())
+                ds = cache.createDiskStoreFactory()
+                    .setDiskDirs(
+                        JUnit4CacheTestCase.getDiskDirs())
+                    .create(diskName);
+              }
+              attr.setDataPolicy(DataPolicy.PERSISTENT_PARTITION);
+              attr.setDiskStoreName(diskName);
+            } else {
+              attr.setDataPolicy(DataPolicy.PARTITION);
+              attr.setDiskStoreName(null);
+            }
 
-        PartitionAttributesFactory paf = new PartitionAttributesFactory();
-        paf.setRedundantCopies(redundancy);
-        attr.setPartitionAttributes(paf.create());
+            PartitionAttributesFactory paf = new PartitionAttributesFactory();
+            paf.setRedundantCopies(redundancy);
+            attr.setPartitionAttributes(paf.create());
 
-        // skip parent region creation
-        // partitionedregion = cache.createRegion(regionName, attr.create());
+            // skip parent region creation
+            // partitionedregion = cache.createRegion(regionName, attr.create());
 
-        // child region
-        attr.setValueConstraint(constraint);
-        paf.setColocatedWith(regionName);
-        attr.setPartitionAttributes(paf.create());
-        childRegion = cache.createRegion(childRegionName, attr.create());
-      }
-    };
+            // child region
+            attr.setValueConstraint(constraint);
+            paf.setColocatedWith(regionName);
+            attr.setPartitionAttributes(paf.create());
+            Region childRegion = cache.createRegion(childRegionName, attr.create());
+          }
+        };
 
     return (CacheSerializableRunnable) createPrRegion;
   }
 
-  public CacheSerializableRunnable getCacheSerializableRunnableForPRCreateLimitedBuckets(
+  CacheSerializableRunnable getCacheSerializableRunnableForPRCreateLimitedBuckets(
       final String regionName, final int redundancy, final int buckets) {
 
-    SerializableRunnable createPrRegion;
-    createPrRegion = new CacheSerializableRunnable(regionName) {
+    SerializableRunnable createPrRegion = new CacheSerializableRunnable(regionName) {
       @Override
       public void run2() throws CacheException {
 
@@ -429,7 +393,7 @@ public class PRQueryDUnitHelper implements Serializable {
           attr.setPartitionAttributes(prAttr);
           partitionedregion = cache.createRegion(regionName, attr.create());
         } catch (IllegalStateException ex) {
-          org.apache.geode.test.dunit.LogWriterUtils.getLogWriter().warning(
+          LogWriterUtils.getLogWriter().warning(
               "PRQueryDUnitHelper#getCacheSerializableRunnableForPRCreateWithRedundancy: Creation caught IllegalStateException",
               ex);
         }
@@ -449,11 +413,10 @@ public class PRQueryDUnitHelper implements Serializable {
     return (CacheSerializableRunnable) createPrRegion;
   }
 
-  public CacheSerializableRunnable getCacheSerializableRunnableForPersistentPRCreate(
+  CacheSerializableRunnable getCacheSerializableRunnableForPersistentPRCreate(
       final String regionName, final int redundancy, final Class constraint) {
 
-    SerializableRunnable createPrRegion;
-    createPrRegion = new CacheSerializableRunnable(regionName) {
+    SerializableRunnable createPrRegion = new CacheSerializableRunnable(regionName) {
       @Override
       public void run2() throws CacheException {
 
@@ -474,7 +437,7 @@ public class PRQueryDUnitHelper implements Serializable {
 
           partitionedregion = cache.createRegion(regionName, attr.create());
         } catch (IllegalStateException ex) {
-          org.apache.geode.test.dunit.LogWriterUtils.getLogWriter().warning(
+          LogWriterUtils.getLogWriter().warning(
               "PRQueryDUnitHelper#getCacheSerializableRunnableForPRCreateWithRedundancy: Creation caught IllegalStateException",
               ex);
         }
@@ -500,11 +463,10 @@ public class PRQueryDUnitHelper implements Serializable {
    * @return cacheSerializable object
    */
 
-  public CacheSerializableRunnable getCacheSerializableRunnableForPRColocatedCreate(
+  CacheSerializableRunnable getCacheSerializableRunnableForPRColocatedCreate(
       final String regionName, final int redundancy, final String coloRegionName) {
 
-    SerializableRunnable createPrRegion;
-    createPrRegion = new CacheSerializableRunnable(regionName) {
+    SerializableRunnable createPrRegion = new CacheSerializableRunnable(regionName) {
       @Override
       public void run2() throws CacheException {
 
@@ -522,7 +484,7 @@ public class PRQueryDUnitHelper implements Serializable {
 
           partitionedregion = cache.createRegion(regionName, attr.create());
         } catch (IllegalStateException ex) {
-          org.apache.geode.test.dunit.LogWriterUtils.getLogWriter().warning(
+          LogWriterUtils.getLogWriter().warning(
               "PRQueryDUnitHelper#getCacheSerializableRunnableForPRCreateWithRedundancy: Creation caught IllegalStateException",
               ex);
         }
@@ -610,11 +572,11 @@ public class PRQueryDUnitHelper implements Serializable {
               }
             } catch (EntryExistsException e) {
               // Do nothing let it go
-              org.apache.geode.test.dunit.LogWriterUtils.getLogWriter()
+              LogWriterUtils.getLogWriter()
                   .info("EntryExistsException was thrown for key " + j);
             } catch (EntryNotFoundException e) {
               // Do nothing let it go
-              org.apache.geode.test.dunit.LogWriterUtils.getLogWriter()
+              LogWriterUtils.getLogWriter()
                   .info("EntryNotFoundException was thrown for key " + j);
             }
           }
@@ -629,7 +591,7 @@ public class PRQueryDUnitHelper implements Serializable {
    *
    * @return cacheSerializable object
    */
-  public CacheSerializableRunnable getCacheSerializableRunnableForPRDuplicatePuts(
+  CacheSerializableRunnable getCacheSerializableRunnableForPRDuplicatePuts(
       final String regionName, final Object[] portfolio, final int from, final int to) {
     SerializableRunnable prPuts = new CacheSerializableRunnable("PRPuts") {
       @Override
@@ -648,7 +610,7 @@ public class PRQueryDUnitHelper implements Serializable {
    *
    * @return cacheSerializable object
    */
-  public CacheSerializableRunnable getCacheSerializableRunnableForPRPutsKeyValue(
+  CacheSerializableRunnable getCacheSerializableRunnableForPRPutsKeyValue(
       final String regionName, final Object[] portfolio, final int from, final int to) {
     SerializableRunnable prPuts = new CacheSerializableRunnable("PRPuts") {
       @Override
@@ -669,12 +631,12 @@ public class PRQueryDUnitHelper implements Serializable {
    * 3. Compares the appropriate resultSet <br>
    */
 
-  public CacheSerializableRunnable getCacheSerializableRunnableForPRQueryAndCompareResults(
+  CacheSerializableRunnable getCacheSerializableRunnableForPRQueryAndCompareResults(
       final String regionName, final String localRegion) {
     return getCacheSerializableRunnableForPRQueryAndCompareResults(regionName, localRegion, false);
   }
 
-  public CacheSerializableRunnable getCacheSerializableRunnableForPRQueryAndCompareResults(
+  CacheSerializableRunnable getCacheSerializableRunnableForPRQueryAndCompareResults(
       final String regionName, final String localRegion,
       final boolean fullQueryOnPortfolioPositions) {
 
@@ -731,10 +693,10 @@ public class PRQueryDUnitHelper implements Serializable {
         }
 
         QueryService qs = getCache().getQueryService();
-        Object[] params;
         try {
           for (int j = 0; j < queries.length; j++) {
             synchronized (region) {
+              Object[] params;
               if (fullQueryOnPortfolioPositions) {
                 params = new Object[] {local, new Double((j % 25) * 1.0 + 1)};
                 r[j][0] = qs.newQuery(queries[j]).execute(params);
@@ -763,7 +725,7 @@ public class PRQueryDUnitHelper implements Serializable {
         }
 
         catch (QueryException e) {
-          org.apache.geode.test.dunit.LogWriterUtils.getLogWriter().error(
+          LogWriterUtils.getLogWriter().error(
               "PRQueryDUnitHelper#getCacheSerializableRunnableForPRQueryAndCompareResults: Caught QueryException while querying"
                   + e,
               e);
@@ -773,12 +735,12 @@ public class PRQueryDUnitHelper implements Serializable {
         }
 
         catch (RegionDestroyedException rde) {
-          org.apache.geode.test.dunit.LogWriterUtils.getLogWriter().info(
+          LogWriterUtils.getLogWriter().info(
               "PRQueryDUnitHelper#getCacheSerializableRunnableForPRQueryAndCompareResults: Caught a RegionDestroyedException while querying as expected ",
               rde);
 
         } catch (CancelException cce) {
-          org.apache.geode.test.dunit.LogWriterUtils.getLogWriter().info(
+          LogWriterUtils.getLogWriter().info(
               "PRQueryDUnitHelper#getCacheSerializableRunnableForPRQueryAndCompareResults: Caught a CancelException while querying as expected ",
               cce);
 
@@ -796,7 +758,7 @@ public class PRQueryDUnitHelper implements Serializable {
   }
 
 
-  public CacheSerializableRunnable getCacheSerializableRunnableForPROrderByQueryAndCompareResults(
+  CacheSerializableRunnable getCacheSerializableRunnableForPROrderByQueryAndCompareResults(
       final String regionName, final String localRegion) {
     SerializableRunnable PrRegion = new CacheSerializableRunnable("PRQuery") {
       @Override
@@ -856,17 +818,16 @@ public class PRQueryDUnitHelper implements Serializable {
               .info("<ExpectedException action=add>" + expectedException + "</ExpectedException>");
         }
 
-        String distinct = "SELECT DISTINCT ";
         QueryService qs = getCache().getQueryService();
         Object[] params;
 
 
         try {
+          String distinct = "SELECT DISTINCT ";
           for (int j = 0; j < queries.length; j++) {
-            String qStr = null;
             synchronized (region) {
               // Execute on local region.
-              qStr = (distinct + queries[j].replace("REGION_NAME", localRegion));
+              String qStr = (distinct + queries[j].replace("REGION_NAME", localRegion));
               r[j][0] = qs.newQuery(qStr).execute();
 
               // Execute on remote region.
@@ -875,7 +836,7 @@ public class PRQueryDUnitHelper implements Serializable {
             }
           }
 
-          org.apache.geode.test.dunit.LogWriterUtils.getLogWriter().info(
+          LogWriterUtils.getLogWriter().info(
               "PRQueryDUnitHelper#getCacheSerializableRunnableForPRQueryAndCompareResults: Queries Executed successfully on Local region & PR Region");
 
           StructSetOrResultsSet ssORrs = new StructSetOrResultsSet();
@@ -890,7 +851,7 @@ public class PRQueryDUnitHelper implements Serializable {
         }
 
         catch (QueryException e) {
-          org.apache.geode.test.dunit.LogWriterUtils.getLogWriter().error(
+          LogWriterUtils.getLogWriter().error(
               "PRQueryDUnitHelper#getCacheSerializableRunnableForPRQueryAndCompareResults: Caught QueryException while querying"
                   + e,
               e);
@@ -900,12 +861,12 @@ public class PRQueryDUnitHelper implements Serializable {
         }
 
         catch (RegionDestroyedException rde) {
-          org.apache.geode.test.dunit.LogWriterUtils.getLogWriter().info(
+          LogWriterUtils.getLogWriter().info(
               "PRQueryDUnitHelper#getCacheSerializableRunnableForPRQueryAndCompareResults: Caught a RegionDestroyedException while querying as expected ",
               rde);
 
         } catch (CancelException cce) {
-          org.apache.geode.test.dunit.LogWriterUtils.getLogWriter().info(
+          LogWriterUtils.getLogWriter().info(
               "PRQueryDUnitHelper#getCacheSerializableRunnableForPRQueryAndCompareResults: Caught a CancelException while querying as expected ",
               cce);
 
@@ -922,7 +883,7 @@ public class PRQueryDUnitHelper implements Serializable {
     return (CacheSerializableRunnable) PrRegion;
   }
 
-  public CacheSerializableRunnable getCacheSerializableRunnableForPROrderByQueryAndVerifyOrder(
+  CacheSerializableRunnable getCacheSerializableRunnableForPROrderByQueryAndVerifyOrder(
       final String regionName, final String localRegion) {
     SerializableRunnable PrRegion = new CacheSerializableRunnable("PRQuery") {
       @Override
@@ -931,36 +892,6 @@ public class PRQueryDUnitHelper implements Serializable {
         Cache cache = getCache();
         // Querying the localRegion and the PR region
 
-        String[] queries = new String[] {"p.status from /REGION_NAME p order by p.status",
-            "status, ID from /REGION_NAME order by status, ID",
-            "p.status, p.ID from /REGION_NAME p order by p.status, p.ID",
-            "key.ID from /REGION_NAME.keys key order by key.ID",
-            "key.ID, key.status from /REGION_NAME.keys key order by key.status, key.ID",
-            "key.ID, key.status from /REGION_NAME.keys key order by key.status desc, key.ID",
-            "key.ID, key.status from /REGION_NAME.keys key order by key.status, key.ID desc",
-            "p.status, p.ID from /REGION_NAME p order by p.status asc, p.ID",
-            "p.ID, p.status from /REGION_NAME p order by p.ID desc, p.status asc",
-            "p.ID from /REGION_NAME p, p.positions.values order by p.ID",
-            "p.ID, p.status from /REGION_NAME p, p.positions.values order by p.status, p.ID",
-            "pos.secId from /REGION_NAME p, p.positions.values pos order by pos.secId",
-            "p.ID, pos.secId from /REGION_NAME p, p.positions.values pos order by pos.secId, p.ID",
-            "p.iD from /REGION_NAME p order by p.iD",
-            "p.iD, p.status from /REGION_NAME p order by p.iD",
-            "iD, status from /REGION_NAME order by iD",
-            "p.getID() from /REGION_NAME p order by p.getID()",
-            "p.names[1] from /REGION_NAME p order by p.names[1]",
-            "p.position1.secId, p.ID from /REGION_NAME p order by p.position1.secId desc, p.ID",
-            "p.ID, p.position1.secId from /REGION_NAME p order by p.position1.secId, p.ID",
-            "e.key.ID from /REGION_NAME.entries e order by e.key.ID",
-            "e.key.ID, e.value.status from /REGION_NAME.entries e order by e.key.ID",
-            "e.key.ID, e.value.status from /REGION_NAME.entrySet e order by e.key.ID desc , e.value.status desc",
-            "e.key, e.value from /REGION_NAME.entrySet e order by e.key.ID, e.value.status desc",
-            "e.key from /REGION_NAME.entrySet e order by e.key.ID desc, e.key.pkid desc",
-            "p.ID, pos.secId from /REGION_NAME p, p.positions.values pos order by p.ID, pos.secId",
-            "p.ID, pos.secId from /REGION_NAME p, p.positions.values pos order by p.ID desc, pos.secId desc",
-            "p.ID, pos.secId from /REGION_NAME p, p.positions.values pos order by p.ID desc, pos.secId",};
-
-        Object r[][] = new Object[1][2];
         Region region = cache.getRegion(regionName);
         assertNotNull(region);
 
@@ -974,17 +905,45 @@ public class PRQueryDUnitHelper implements Serializable {
               .info("<ExpectedException action=add>" + expectedException + "</ExpectedException>");
         }
 
-        String distinct = "SELECT DISTINCT ";
         QueryService qs = getCache().getQueryService();
         Object[] params;
         StructSetOrResultsSet ssORrs = new StructSetOrResultsSet();
 
         try {
+          String distinct = "SELECT DISTINCT ";
+          Object[][] r = new Object[1][2];
+          String[] queries = new String[] {"p.status from /REGION_NAME p order by p.status",
+              "status, ID from /REGION_NAME order by status, ID",
+              "p.status, p.ID from /REGION_NAME p order by p.status, p.ID",
+              "key.ID from /REGION_NAME.keys key order by key.ID",
+              "key.ID, key.status from /REGION_NAME.keys key order by key.status, key.ID",
+              "key.ID, key.status from /REGION_NAME.keys key order by key.status desc, key.ID",
+              "key.ID, key.status from /REGION_NAME.keys key order by key.status, key.ID desc",
+              "p.status, p.ID from /REGION_NAME p order by p.status asc, p.ID",
+              "p.ID, p.status from /REGION_NAME p order by p.ID desc, p.status asc",
+              "p.ID from /REGION_NAME p, p.positions.values order by p.ID",
+              "p.ID, p.status from /REGION_NAME p, p.positions.values order by p.status, p.ID",
+              "pos.secId from /REGION_NAME p, p.positions.values pos order by pos.secId",
+              "p.ID, pos.secId from /REGION_NAME p, p.positions.values pos order by pos.secId, p.ID",
+              "p.iD from /REGION_NAME p order by p.iD",
+              "p.iD, p.status from /REGION_NAME p order by p.iD",
+              "iD, status from /REGION_NAME order by iD",
+              "p.getID() from /REGION_NAME p order by p.getID()",
+              "p.names[1] from /REGION_NAME p order by p.names[1]",
+              "p.position1.secId, p.ID from /REGION_NAME p order by p.position1.secId desc, p.ID",
+              "p.ID, p.position1.secId from /REGION_NAME p order by p.position1.secId, p.ID",
+              "e.key.ID from /REGION_NAME.entries e order by e.key.ID",
+              "e.key.ID, e.value.status from /REGION_NAME.entries e order by e.key.ID",
+              "e.key.ID, e.value.status from /REGION_NAME.entrySet e order by e.key.ID desc , e.value.status desc",
+              "e.key, e.value from /REGION_NAME.entrySet e order by e.key.ID, e.value.status desc",
+              "e.key from /REGION_NAME.entrySet e order by e.key.ID desc, e.key.pkid desc",
+              "p.ID, pos.secId from /REGION_NAME p, p.positions.values pos order by p.ID, pos.secId",
+              "p.ID, pos.secId from /REGION_NAME p, p.positions.values pos order by p.ID desc, pos.secId desc",
+              "p.ID, pos.secId from /REGION_NAME p, p.positions.values pos order by p.ID desc, pos.secId",};
           for (final String query : queries) {
-            String qStr = null;
             synchronized (region) {
               // Execute on local region.
-              qStr = (distinct + query.replace("REGION_NAME", localRegion));
+              String qStr = (distinct + query.replace("REGION_NAME", localRegion));
               r[0][0] = qs.newQuery(qStr).execute();
 
               // Execute on remote region.
@@ -994,7 +953,7 @@ public class PRQueryDUnitHelper implements Serializable {
             }
           }
 
-          org.apache.geode.test.dunit.LogWriterUtils.getLogWriter().info(
+          LogWriterUtils.getLogWriter().info(
               "PRQueryDUnitHelper#getCacheSerializableRunnableForPRQueryAndCompareResults: Queries Executed successfully on Local region & PR Region");
         } catch (QueryInvocationTargetException e) {
           // throw an unchecked exception so the controller can examine the cause and see whether or
@@ -1005,7 +964,7 @@ public class PRQueryDUnitHelper implements Serializable {
         }
 
         catch (QueryException e) {
-          org.apache.geode.test.dunit.LogWriterUtils.getLogWriter().error(
+          LogWriterUtils.getLogWriter().error(
               "PRQueryDUnitHelper#getCacheSerializableRunnableForPRQueryAndCompareResults: Caught QueryException while querying"
                   + e,
               e);
@@ -1015,12 +974,12 @@ public class PRQueryDUnitHelper implements Serializable {
         }
 
         catch (RegionDestroyedException rde) {
-          org.apache.geode.test.dunit.LogWriterUtils.getLogWriter().info(
+          LogWriterUtils.getLogWriter().info(
               "PRQueryDUnitHelper#getCacheSerializableRunnableForPRQueryAndCompareResults: Caught a RegionDestroyedException while querying as expected ",
               rde);
 
         } catch (CancelException cce) {
-          org.apache.geode.test.dunit.LogWriterUtils.getLogWriter().info(
+          LogWriterUtils.getLogWriter().info(
               "PRQueryDUnitHelper#getCacheSerializableRunnableForPRQueryAndCompareResults: Caught a CancelException while querying as expected ",
               cce);
 
@@ -1037,7 +996,7 @@ public class PRQueryDUnitHelper implements Serializable {
     return (CacheSerializableRunnable) PrRegion;
   }
 
-  public CacheSerializableRunnable getCacheSerializableRunnableForPROrderByQueryWithLimit(
+  CacheSerializableRunnable getCacheSerializableRunnableForPROrderByQueryWithLimit(
       final String regionName, final String localRegion) {
     SerializableRunnable PrRegion = new CacheSerializableRunnable("PRQuery") {
       @Override
@@ -1087,18 +1046,17 @@ public class PRQueryDUnitHelper implements Serializable {
               .info("<ExpectedException action=add>" + expectedException + "</ExpectedException>");
         }
 
-        String distinct = "<TRACE>SELECT DISTINCT ";
         QueryService qs = getCache().getQueryService();
         Object[] params;
 
         try {
+          String distinct = "<TRACE>SELECT DISTINCT ";
           for (int l = 1; l <= 3; l++) {
             String[] rq = new String[queries.length];
             for (int j = 0; j < queries.length; j++) {
-              String qStr = null;
               synchronized (region) {
                 // Execute on local region.
-                qStr = (distinct + queries[j].replace("REGION_NAME", localRegion));
+                String qStr = (distinct + queries[j].replace("REGION_NAME", localRegion));
                 qStr += (" LIMIT " + (l * l));
                 rq[j] = qStr;
                 SelectResults sr = (SelectResults) qs.newQuery(qStr).execute();
@@ -1128,7 +1086,7 @@ public class PRQueryDUnitHelper implements Serializable {
             ssORrs.CompareQueryResultsWithoutAndWithIndexes(r, queries.length, true, rq);
 
           }
-          org.apache.geode.test.dunit.LogWriterUtils.getLogWriter().info(
+          LogWriterUtils.getLogWriter().info(
               "PRQueryDUnitHelper#getCacheSerializableRunnableForPRQueryAndCompareResults: Queries Executed successfully on Local region & PR Region");
         } catch (QueryInvocationTargetException e) {
           // throw an unchecked exception so the controller can examine the cause and see whether or
@@ -1139,7 +1097,7 @@ public class PRQueryDUnitHelper implements Serializable {
         }
 
         catch (QueryException e) {
-          org.apache.geode.test.dunit.LogWriterUtils.getLogWriter().error(
+          LogWriterUtils.getLogWriter().error(
               "PRQueryDUnitHelper#getCacheSerializableRunnableForPRQueryAndCompareResults: Caught QueryException while querying"
                   + e,
               e);
@@ -1149,12 +1107,12 @@ public class PRQueryDUnitHelper implements Serializable {
         }
 
         catch (RegionDestroyedException rde) {
-          org.apache.geode.test.dunit.LogWriterUtils.getLogWriter().info(
+          LogWriterUtils.getLogWriter().info(
               "PRQueryDUnitHelper#getCacheSerializableRunnableForPRQueryAndCompareResults: Caught a RegionDestroyedException while querying as expected ",
               rde);
 
         } catch (CancelException cce) {
-          org.apache.geode.test.dunit.LogWriterUtils.getLogWriter().info(
+          LogWriterUtils.getLogWriter().info(
               "PRQueryDUnitHelper#getCacheSerializableRunnableForPRQueryAndCompareResults: Caught a CancelException while querying as expected ",
               cce);
 
@@ -1171,7 +1129,7 @@ public class PRQueryDUnitHelper implements Serializable {
     return (CacheSerializableRunnable) PrRegion;
   }
 
-  public CacheSerializableRunnable getCacheSerializableRunnableForPRCountStarQueries(
+  CacheSerializableRunnable getCacheSerializableRunnableForPRCountStarQueries(
       final String regionName, final String localRegion) {
     SerializableRunnable PrRegion = new CacheSerializableRunnable("PRCountStarQuery") {
       @Override
@@ -1234,10 +1192,9 @@ public class PRQueryDUnitHelper implements Serializable {
 
         try {
           for (int j = 0; j < queries.length; j++) {
-            String qStr = null;
             synchronized (region) {
               // Execute on PR region.
-              qStr = queries[j];
+              String qStr = queries[j];
               SelectResults sr = (SelectResults) qs.newQuery(qStr).execute();
               r[j][0] = sr;
 
@@ -1248,7 +1205,7 @@ public class PRQueryDUnitHelper implements Serializable {
               r[j][1] = srr;
             }
           }
-          org.apache.geode.test.dunit.LogWriterUtils.getLogWriter().info(
+          LogWriterUtils.getLogWriter().info(
               "PRQueryDUnitHelper#getCacheSerializableRunnableForPRQueryAndCompareResults: Queries Executed successfully on Local region & PR Region");
 
           StructSetOrResultsSet ssORrs = new StructSetOrResultsSet();
@@ -1264,7 +1221,7 @@ public class PRQueryDUnitHelper implements Serializable {
         }
 
         catch (QueryException e) {
-          org.apache.geode.test.dunit.LogWriterUtils.getLogWriter().error(
+          LogWriterUtils.getLogWriter().error(
               "PRQueryDUnitHelper#getCacheSerializableRunnableForPRQueryAndCompareResults: Caught QueryException while querying"
                   + e,
               e);
@@ -1274,12 +1231,12 @@ public class PRQueryDUnitHelper implements Serializable {
         }
 
         catch (RegionDestroyedException rde) {
-          org.apache.geode.test.dunit.LogWriterUtils.getLogWriter().info(
+          LogWriterUtils.getLogWriter().info(
               "PRQueryDUnitHelper#getCacheSerializableRunnableForPRQueryAndCompareResults: Caught a RegionDestroyedException while querying as expected ",
               rde);
 
         } catch (CancelException cce) {
-          org.apache.geode.test.dunit.LogWriterUtils.getLogWriter().info(
+          LogWriterUtils.getLogWriter().info(
               "PRQueryDUnitHelper#getCacheSerializableRunnableForPRQueryAndCompareResults: Caught a CancelException while querying as expected ",
               cce);
 
@@ -1299,7 +1256,7 @@ public class PRQueryDUnitHelper implements Serializable {
   /**
    * Insure queries on a pr is using index if not fail.
    */
-  public CacheSerializableRunnable getCacheSerializableRunnableForIndexUsageCheck() {
+  CacheSerializableRunnable getCacheSerializableRunnableForIndexUsageCheck() {
     SerializableRunnable PrIndexCheck = new CacheSerializableRunnable("PrIndexCheck") {
       @Override
       public void run2() {
@@ -1361,7 +1318,7 @@ public class PRQueryDUnitHelper implements Serializable {
    * 3. Compares the appropriate resultSet <br>
    */
 
-  public CacheSerializableRunnable getCacheSerializableRunnableForPRQueryWithConstantsAndComparingResults(
+  CacheSerializableRunnable getCacheSerializableRunnableForPRQueryWithConstantsAndComparingResults(
       final String regionName, final String localRegion) {
     SerializableRunnable PrRegion = new CacheSerializableRunnable("PRQuery") {
       @Override
@@ -1381,13 +1338,13 @@ public class PRQueryDUnitHelper implements Serializable {
             r[j][1] = region.query(query[j]);
           }
 
-          org.apache.geode.test.dunit.LogWriterUtils.getLogWriter().info(
+          LogWriterUtils.getLogWriter().info(
               "PRQueryDUnitHelper#getCacheSerializableRunnableForPRQueryWithConstantsAndComparingResults: Queries Executed successfully on Local region & PR Region");
 
           compareTwoQueryResults(r, query.length);
 
         } catch (QueryException e) {
-          org.apache.geode.test.dunit.LogWriterUtils.getLogWriter().error(
+          LogWriterUtils.getLogWriter().error(
               "PRQueryDUnitHelper#getCacheSerializableRunnableForPRQueryWithConstantsAndComparingResults: Caught an Exception while querying Constants"
                   + e,
               e);
@@ -1409,20 +1366,18 @@ public class PRQueryDUnitHelper implements Serializable {
 
   public CacheSerializableRunnable getCacheSerializableRunnableForPRAccessorCreate(
       final String regionName, final int redundancy, final Class constraint) {
-    SerializableRunnable createPrRegion;
-    createPrRegion = new CacheSerializableRunnable(regionName) {
+    SerializableRunnable createPrRegion = new CacheSerializableRunnable(regionName) {
       @Override
       public void run2() throws CacheException {
         Cache cache = getCache();
-        Region partitionedregion = null;
-        int maxMem = 0;
         AttributesFactory attr = new AttributesFactory();
         attr.setValueConstraint(constraint);
         PartitionAttributesFactory paf = new PartitionAttributesFactory();
+        int maxMem = 0;
         PartitionAttributes prAttr =
             paf.setLocalMaxMemory(maxMem).setRedundantCopies(redundancy).create();
         attr.setPartitionAttributes(prAttr);
-        partitionedregion = cache.createRegion(regionName, attr.create());
+        Region partitionedregion = cache.createRegion(regionName, attr.create());
         assertNotNull(
             "PRQueryDUnitHelper#getCacheSerializableRunnableForPRAccessorCreate: Partitioned Region "
                 + regionName + " not in cache",
@@ -1446,25 +1401,21 @@ public class PRQueryDUnitHelper implements Serializable {
    * @param Object[][] @param length @return
    */
 
-  public void compareTwoQueryResults(Object[][] r, int len) {
-
-    Set set1 = null;
-    Set set2 = null;
-    ObjectType type1, type2;
+  private void compareTwoQueryResults(Object[][] r, int len) {
 
     for (int j = 0; j < len; j++) {
       if ((r[j][0] != null) && (r[j][1] != null)) {
-        type1 = ((SelectResults) r[j][0]).getCollectionType().getElementType();
+        ObjectType type1 = ((SelectResults) r[j][0]).getCollectionType().getElementType();
         assertNotNull("PRQueryDUnitHelper#compareTwoQueryResults: Type 1 is NULL " + type1, type1);
-        type2 = ((SelectResults) r[j][1]).getCollectionType().getElementType();
+        ObjectType type2 = ((SelectResults) r[j][1]).getCollectionType().getElementType();
         assertNotNull("PRQueryDUnitHelper#compareTwoQueryResults: Type 2 is NULL " + type2, type2);
         if ((type1.getClass().getName()).equals(type2.getClass().getName())) {
-          org.apache.geode.test.dunit.LogWriterUtils.getLogWriter().info(
+          LogWriterUtils.getLogWriter().info(
               "PRQueryDUnitHelper#compareTwoQueryResults: Both Search Results are of the same Type i.e.--> "
                   + ((SelectResults) r[j][0]).getCollectionType().getElementType());
 
         } else {
-          org.apache.geode.test.dunit.LogWriterUtils.getLogWriter()
+          LogWriterUtils.getLogWriter()
               .error("PRQueryDUnitHelper#compareTwoQueryResults: Classes are : "
                   + type1.getClass().getName() + " " + type2.getClass().getName());
 
@@ -1474,20 +1425,20 @@ public class PRQueryDUnitHelper implements Serializable {
         int size0 = ((SelectResults) r[j][0]).size();
         int size1 = ((SelectResults) r[j][1]).size();
         if (size0 == size1) {
-          org.apache.geode.test.dunit.LogWriterUtils.getLogWriter().info(
+          LogWriterUtils.getLogWriter().info(
               "PRQueryDUnitHelper#compareTwoQueryResults: Both Search Results are non-zero and are of Same Size i.e.  Size= "
                   + size1 + ";j=" + j);
 
         } else {
-          org.apache.geode.test.dunit.LogWriterUtils.getLogWriter().error(
+          LogWriterUtils.getLogWriter().error(
               "PRQueryDUnitHelper#compareTwoQueryResults: FAILED:Search resultSet size are different in both cases; size0="
                   + size0 + ";size1=" + size1 + ";j=" + j);
           fail(
               "PRQueryDUnitHelper#compareTwoQueryResults: FAILED:Search resultSet size are different in both cases; size0="
                   + size0 + ";size1=" + size1 + ";j=" + j);
         }
-        set2 = (((SelectResults) r[j][1]).asSet());
-        set1 = (((SelectResults) r[j][0]).asSet());
+        Set set2 = (((SelectResults) r[j][1]).asSet());
+        Set set1 = (((SelectResults) r[j][0]).asSet());
 
         assertEquals("PRQueryDUnitHelper#compareTwoQueryResults: FAILED: "
             + "result contents are not equal, ", set1, set2);
@@ -1506,7 +1457,7 @@ public class PRQueryDUnitHelper implements Serializable {
    * @return cacheSerializable object
    */
 
-  public CacheSerializableRunnable getCacheSerializableRunnableForPRInvalidQuery(
+  CacheSerializableRunnable getCacheSerializableRunnableForPRInvalidQuery(
       final String regionName) {
     SerializableRunnable PrRegion = new CacheSerializableRunnable("PRQuery") {
       @Override
@@ -1515,11 +1466,10 @@ public class PRQueryDUnitHelper implements Serializable {
         Cache cache = getCache();
         // Querying the PR region with an Invalid query string
 
-        String query = "INVALID QUERY";
-
         Region region = cache.getRegion(regionName);
         try {
 
+          String query = "INVALID QUERY";
           region.query(query);
           fail(
               "PRQueryDUnitHelper#getCacheSerializableRunnableForPRInvalidQuery: InvalidQueryException expected");
@@ -1527,7 +1477,7 @@ public class PRQueryDUnitHelper implements Serializable {
           // pass
         } catch (QueryException qe) {
 
-          org.apache.geode.test.dunit.LogWriterUtils.getLogWriter().error(
+          LogWriterUtils.getLogWriter().error(
               "PRQueryDUnitHelper#getCacheSerializableRunnableForPRInvalidQuery: Caught another Exception while querying , Exception is "
                   + qe,
               qe);
@@ -1550,24 +1500,24 @@ public class PRQueryDUnitHelper implements Serializable {
    * @return cacheSerializable object
    */
 
-  public CacheSerializableRunnable getCacheSerializableRunnableForRegionClose(
+  CacheSerializableRunnable getCacheSerializableRunnableForRegionClose(
       final String regionName, final int redundancy, final Class constraint) {
     SerializableRunnable PrRegion = new CacheSerializableRunnable("regionClose") {
       @Override
       public void run2() throws CacheException {
         Cache cache = getCache();
         final String expectedRegionDestroyedException = RegionDestroyedException.class.getName();
-        final String expectedReplyException = ReplyException.class.getName();
         getCache().getLogger().info("<ExpectedException action=add>"
             + expectedRegionDestroyedException + "</ExpectedException>");
+        final String expectedReplyException = ReplyException.class.getName();
         getCache().getLogger().info(
             "<ExpectedException action=add>" + expectedReplyException + "</ExpectedException>");
 
         Region region = cache.getRegion(regionName);
-        org.apache.geode.test.dunit.LogWriterUtils.getLogWriter().info(
+        LogWriterUtils.getLogWriter().info(
             "PROperationWithQueryDUnitTest#getCacheSerializableRunnableForRegionClose: Closing region");
         region.close();
-        org.apache.geode.test.dunit.LogWriterUtils.getLogWriter().info(
+        LogWriterUtils.getLogWriter().info(
             "PROperationWithQueryDUnitTest#getCacheSerializableRunnableForRegionClose: Region Closed on VM ");
         AttributesFactory attr = new AttributesFactory();
         attr.setValueConstraint(constraint);
@@ -1575,7 +1525,7 @@ public class PRQueryDUnitHelper implements Serializable {
         PartitionAttributes prAttr = paf.setRedundantCopies(redundancy).create();
         attr.setPartitionAttributes(prAttr);
         cache.createRegion(regionName, attr.create());
-        org.apache.geode.test.dunit.LogWriterUtils.getLogWriter().info(
+        LogWriterUtils.getLogWriter().info(
             "PROperationWithQueryDUnitTest#getCacheSerializableRunnableForRegionClose: Region Recreated on VM ");
         getCache().getLogger().info(
             "<ExpectedException action=remove>" + expectedReplyException + "</ExpectedException>");
@@ -1639,7 +1589,7 @@ public class PRQueryDUnitHelper implements Serializable {
   /**
    * This function defines a appropriate index on a PR given the name and other parameters.
    */
-  public CacheSerializableRunnable getCacheSerializableRunnableForDefineIndex(
+  CacheSerializableRunnable getCacheSerializableRunnableForDefineIndex(
       final String prRegionName, final ArrayList<String> indexName,
       final ArrayList<String> indexedExpression) {
     return getCacheSerializableRunnableForDefineIndex(prRegionName, indexName, indexedExpression,
@@ -1680,7 +1630,7 @@ public class PRQueryDUnitHelper implements Serializable {
     return (CacheSerializableRunnable) prIndexCreator;
   }
 
-  public CacheSerializableRunnable getCacheSerializableRunnableForRRIndexCreate(
+  CacheSerializableRunnable getCacheSerializableRunnableForRRIndexCreate(
       final String rrRegionName, final String indexName, final String indexedExpression,
       final String fromClause, final String alias) {
 
@@ -1754,13 +1704,13 @@ public class PRQueryDUnitHelper implements Serializable {
   }
 
 
-  public File findFile(String fileName) {
+  File findFile(String fileName) {
     return new File(
         createTempFileFromResource(PRQueryDUnitHelper.class, fileName)
             .getAbsolutePath());
   }
 
-  public CacheSerializableRunnable getCacheSerializableRunnableForIndexCreationCheck(
+  CacheSerializableRunnable getCacheSerializableRunnableForIndexCreationCheck(
       final String name) {
     return new CacheSerializableRunnable("PrIndexCreationCheck") {
       @Override
@@ -1790,7 +1740,7 @@ public class PRQueryDUnitHelper implements Serializable {
    * This function creates a duplicate index should throw an IndexNameConflictException and if not
    * the test should fail.
    */
-  public CacheSerializableRunnable getCacheSerializableRunnableForDuplicatePRIndexCreate(
+  CacheSerializableRunnable getCacheSerializableRunnableForDuplicatePRIndexCreate(
       final String prRegionName, final String indexName, final String indexedExpression,
       final String fromClause, final String alias) {
     SerializableRunnable prIndexCreator =
@@ -1832,7 +1782,7 @@ public class PRQueryDUnitHelper implements Serializable {
    * @param name name of the partitioned regions
    */
 
-  public CacheSerializableRunnable getCacheSerializableRunnableForRemoveIndex(final String name,
+  CacheSerializableRunnable getCacheSerializableRunnableForRemoveIndex(final String name,
       final boolean random) {
     return new CacheSerializableRunnable("PrRemoveIndex") {
       @Override
@@ -1878,7 +1828,7 @@ public class PRQueryDUnitHelper implements Serializable {
     };
   }
 
-  public SerializableRunnableIF getCacheSerializableRunnableForPRColocatedDataSetQueryAndCompareResults(
+  SerializableRunnableIF getCacheSerializableRunnableForPRColocatedDataSetQueryAndCompareResults(
       final String name, final String coloName, final String localName,
       final String coloLocalName) {
 
@@ -1903,8 +1853,7 @@ public class PRQueryDUnitHelper implements Serializable {
             "r1.ID = r2.id AND (r1.positions.size < r2.positions.size OR r1.positions.size > 0)",};
 
         Object r[][] = new Object[queries.length][2];
-        Region region = null;
-        region = cache.getRegion(name);
+        Region region = cache.getRegion(name);
         assertNotNull(region);
         region = cache.getRegion(coloName);
         assertNotNull(region);
@@ -1948,7 +1897,7 @@ public class PRQueryDUnitHelper implements Serializable {
                 .execute();
             r[j][1] = r2.asList();
           }
-          org.apache.geode.test.dunit.LogWriterUtils.getLogWriter().info(
+          LogWriterUtils.getLogWriter().info(
               "PRQueryDUnitHelper#getCacheSerializableRunnableForPRQueryAndCompareResults: Queries Executed successfully on Local region & PR Region");
 
           // compareTwoQueryResults(r, queries.length);
@@ -1963,7 +1912,7 @@ public class PRQueryDUnitHelper implements Serializable {
               "PRQueryDUnitHelper#getCacheSerializableRunnableForPRQueryAndCompareResults: Caught unexpected query exception",
               e);
         } catch (QueryException e) {
-          org.apache.geode.test.dunit.LogWriterUtils.getLogWriter().error(
+          LogWriterUtils.getLogWriter().error(
               "PRQueryDUnitHelper#getCacheSerializableRunnableForPRQueryAndCompareResults: Caught QueryException while querying"
                   + e,
               e);
@@ -1971,12 +1920,12 @@ public class PRQueryDUnitHelper implements Serializable {
               "PRQueryDUnitHelper#getCacheSerializableRunnableForPRQueryAndCompareResults: Caught unexpected query exception",
               e);
         } catch (RegionDestroyedException rde) {
-          org.apache.geode.test.dunit.LogWriterUtils.getLogWriter().info(
+          LogWriterUtils.getLogWriter().info(
               "PRQueryDUnitHelper#getCacheSerializableRunnableForPRQueryAndCompareResults: Caught a RegionDestroyedException while querying as expected ",
               rde);
 
         } catch (CancelException cce) {
-          org.apache.geode.test.dunit.LogWriterUtils.getLogWriter().info(
+          LogWriterUtils.getLogWriter().info(
               "PRQueryDUnitHelper#getCacheSerializableRunnableForPRQueryAndCompareResults: Caught a CancelException while querying as expected ",
               cce);
 
@@ -1993,7 +1942,7 @@ public class PRQueryDUnitHelper implements Serializable {
 
   }
 
-  public SerializableRunnableIF getCacheSerializableRunnableForPRAndRRQueryAndCompareResults(
+  SerializableRunnableIF getCacheSerializableRunnableForPRAndRRQueryAndCompareResults(
       final String name, final String coloName, final String localName,
       final String coloLocalName) {
 
@@ -2018,8 +1967,7 @@ public class PRQueryDUnitHelper implements Serializable {
             "r1.ID = r2.id AND (r1.positions.size < r2.positions.size OR r1.positions.size > 0)",};
 
         Object r[][] = new Object[queries.length][2];
-        Region region = null;
-        region = cache.getRegion(name);
+        Region region = cache.getRegion(name);
         assertNotNull(region);
         region = cache.getRegion(coloName);
         assertNotNull(region);
@@ -2062,7 +2010,7 @@ public class PRQueryDUnitHelper implements Serializable {
                 .execute();
             r[j][1] = r2.asList();
           }
-          org.apache.geode.test.dunit.LogWriterUtils.getLogWriter().info(
+          LogWriterUtils.getLogWriter().info(
               "PRQueryDUnitHelper#getCacheSerializableRunnableForPRQueryAndCompareResults: Queries Executed successfully on Local region & PR Region");
 
           // compareTwoQueryResults(r, queries.length);
@@ -2077,7 +2025,7 @@ public class PRQueryDUnitHelper implements Serializable {
               "PRQueryDUnitHelper#getCacheSerializableRunnableForPRQueryAndCompareResults: Caught unexpected query exception",
               e);
         } catch (QueryException e) {
-          org.apache.geode.test.dunit.LogWriterUtils.getLogWriter().error(
+          LogWriterUtils.getLogWriter().error(
               "PRQueryDUnitHelper#getCacheSerializableRunnableForPRQueryAndCompareResults: Caught QueryException while querying"
                   + e,
               e);
@@ -2085,12 +2033,12 @@ public class PRQueryDUnitHelper implements Serializable {
               "PRQueryDUnitHelper#getCacheSerializableRunnableForPRQueryAndCompareResults: Caught unexpected query exception",
               e);
         } catch (RegionDestroyedException rde) {
-          org.apache.geode.test.dunit.LogWriterUtils.getLogWriter().info(
+          LogWriterUtils.getLogWriter().info(
               "PRQueryDUnitHelper#getCacheSerializableRunnableForPRQueryAndCompareResults: Caught a RegionDestroyedException while querying as expected ",
               rde);
 
         } catch (CancelException cce) {
-          org.apache.geode.test.dunit.LogWriterUtils.getLogWriter().info(
+          LogWriterUtils.getLogWriter().info(
               "PRQueryDUnitHelper#getCacheSerializableRunnableForPRQueryAndCompareResults: Caught a CancelException while querying as expected ",
               cce);
 
@@ -2108,7 +2056,7 @@ public class PRQueryDUnitHelper implements Serializable {
   }
 
 
-  public SerializableRunnableIF getCacheSerializableRunnableForPRAndRRQueryWithCompactAndRangeIndexAndCompareResults(
+  SerializableRunnableIF getCacheSerializableRunnableForPRAndRRQueryWithCompactAndRangeIndexAndCompareResults(
       final String name, final String coloName, final String localName,
       final String coloLocalName) {
 
@@ -2132,8 +2080,7 @@ public class PRQueryDUnitHelper implements Serializable {
             "r1.ID = pos2.id AND (r1.positions.size < r2.positions.size OR r1.positions.size > 0)",};
 
         Object r[][] = new Object[queries.length][2];
-        Region region = null;
-        region = cache.getRegion(name);
+        Region region = cache.getRegion(name);
         assertNotNull(region);
         region = cache.getRegion(coloName);
         assertNotNull(region);
@@ -2175,7 +2122,7 @@ public class PRQueryDUnitHelper implements Serializable {
                 .execute();
             r[j][1] = r2.asList();
           }
-          org.apache.geode.test.dunit.LogWriterUtils.getLogWriter().info(
+          LogWriterUtils.getLogWriter().info(
               "PRQueryDUnitHelper#getCacheSerializableRunnableForPRQueryAndCompareResults: Queries Executed successfully on Local region & PR Region");
 
           StructSetOrResultsSet ssORrs = new StructSetOrResultsSet();
@@ -2189,7 +2136,7 @@ public class PRQueryDUnitHelper implements Serializable {
               "PRQueryDUnitHelper#getCacheSerializableRunnableForPRQueryAndCompareResults: Caught unexpected query exception",
               e);
         } catch (QueryException e) {
-          org.apache.geode.test.dunit.LogWriterUtils.getLogWriter().error(
+          LogWriterUtils.getLogWriter().error(
               "PRQueryDUnitHelper#getCacheSerializableRunnableForPRQueryAndCompareResults: Caught QueryException while querying"
                   + e,
               e);
@@ -2197,12 +2144,12 @@ public class PRQueryDUnitHelper implements Serializable {
               "PRQueryDUnitHelper#getCacheSerializableRunnableForPRQueryAndCompareResults: Caught unexpected query exception",
               e);
         } catch (RegionDestroyedException rde) {
-          org.apache.geode.test.dunit.LogWriterUtils.getLogWriter().info(
+          LogWriterUtils.getLogWriter().info(
               "PRQueryDUnitHelper#getCacheSerializableRunnableForPRQueryAndCompareResults: Caught a RegionDestroyedException while querying as expected ",
               rde);
 
         } catch (CancelException cce) {
-          org.apache.geode.test.dunit.LogWriterUtils.getLogWriter().info(
+          LogWriterUtils.getLogWriter().info(
               "PRQueryDUnitHelper#getCacheSerializableRunnableForPRQueryAndCompareResults: Caught a CancelException while querying as expected ",
               cce);
 
@@ -2248,8 +2195,7 @@ public class PRQueryDUnitHelper implements Serializable {
             "r1.ID = r2.id AND (r1.positions.size < r2.positions.size OR r1.positions.size > 0)",};
 
         Object r[][] = new Object[queries.length][2];
-        Region region = null;
-        region = cache.getRegion(name);
+        Region region = cache.getRegion(name);
         assertNotNull(region);
         region = cache.getRegion(coloName);
         assertNotNull(region);
@@ -2291,7 +2237,7 @@ public class PRQueryDUnitHelper implements Serializable {
                 .execute();
             r[j][1] = r2.asList();
           }
-          org.apache.geode.test.dunit.LogWriterUtils.getLogWriter().info(
+          LogWriterUtils.getLogWriter().info(
               "PRQueryDUnitHelper#getCacheSerializableRunnableForPRQueryAndCompareResults: Queries Executed successfully on Local region & PR Region");
 
           StructSetOrResultsSet ssORrs = new StructSetOrResultsSet();
@@ -2305,7 +2251,7 @@ public class PRQueryDUnitHelper implements Serializable {
               "PRQueryDUnitHelper#getCacheSerializableRunnableForPRQueryAndCompareResults: Caught unexpected query exception",
               e);
         } catch (QueryException e) {
-          org.apache.geode.test.dunit.LogWriterUtils.getLogWriter().error(
+          LogWriterUtils.getLogWriter().error(
               "PRQueryDUnitHelper#getCacheSerializableRunnableForPRQueryAndCompareResults: Caught QueryException while querying"
                   + e,
               e);
@@ -2313,12 +2259,12 @@ public class PRQueryDUnitHelper implements Serializable {
               "PRQueryDUnitHelper#getCacheSerializableRunnableForPRQueryAndCompareResults: Caught unexpected query exception",
               e);
         } catch (RegionDestroyedException rde) {
-          org.apache.geode.test.dunit.LogWriterUtils.getLogWriter().info(
+          LogWriterUtils.getLogWriter().info(
               "PRQueryDUnitHelper#getCacheSerializableRunnableForPRQueryAndCompareResults: Caught a RegionDestroyedException while querying as expected ",
               rde);
 
         } catch (CancelException cce) {
-          org.apache.geode.test.dunit.LogWriterUtils.getLogWriter().info(
+          LogWriterUtils.getLogWriter().info(
               "PRQueryDUnitHelper#getCacheSerializableRunnableForPRQueryAndCompareResults: Caught a CancelException while querying as expected ",
               cce);
 
@@ -2332,10 +2278,8 @@ public class PRQueryDUnitHelper implements Serializable {
       }
     };
     return PrRegion;
-
   }
 
-  // Helper classes and function
   public static class TestQueryFunction implements Function {
 
     @Override
@@ -2350,8 +2294,7 @@ public class PRQueryDUnitHelper implements Serializable {
 
     private final String id;
 
-    public TestQueryFunction(String id) {
-      super();
+    TestQueryFunction(String id) {
       this.id = id;
     }
 
@@ -2363,21 +2306,20 @@ public class PRQueryDUnitHelper implements Serializable {
       try {
         Query query = queryService.newQuery(qstr);
         context.getResultSender().sendResult(
-            (ArrayList) ((SelectResults) query.execute((RegionFunctionContext) context)).asList());
+            ((SelectResults) query.execute((RegionFunctionContext) context)).asList());
         context.getResultSender().lastResult(null);
       } catch (Exception e) {
-        e.printStackTrace();
         throw new FunctionException(e);
       }
     }
 
     @Override
     public String getId() {
-      return this.id;
+      return id;
     }
   }
 
-  public SerializableRunnable getCacheSerializableRunnableForCloseCache() {
+  SerializableRunnable getCacheSerializableRunnableForCloseCache() {
     return new SerializableRunnable() {
       @Override
       public void run() {
diff --git a/geode-core/src/distributedTest/java/org/apache/geode/cache30/CacheXml66DUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/cache30/CacheXml66DUnitTest.java
index a85b65d..4954dd7 100644
--- a/geode-core/src/distributedTest/java/org/apache/geode/cache30/CacheXml66DUnitTest.java
+++ b/geode-core/src/distributedTest/java/org/apache/geode/cache30/CacheXml66DUnitTest.java
@@ -15,6 +15,7 @@
 package org.apache.geode.cache30;
 
 import static org.apache.geode.distributed.ConfigurationProperties.ROLES;
+import static org.apache.geode.test.dunit.IgnoredException.addIgnoredException;
 import static org.apache.geode.test.util.ResourceUtils.createTempFileFromResource;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
@@ -278,7 +279,7 @@ public abstract class CacheXml66DUnitTest extends CacheXmlTestCase {
     attrs.setPoolName("mypool");
     attrs.setDataPolicy(DataPolicy.EMPTY); // required for multiuser mode
     cache.createVMRegion("rootNORMAL", attrs);
-    IgnoredException.addIgnoredException("Connection refused: connect");
+    addIgnoredException("Connection refused: connect");
     testXml(cache);
     Cache c = getCache();
     assertNotNull(c);
@@ -1471,8 +1472,8 @@ public abstract class CacheXml66DUnitTest extends CacheXmlTestCase {
     CacheTransactionManagerCreation txMgrCreation = new CacheTransactionManagerCreation();
     txMgrCreation.setWriter(new TestTransactionWriter());
     cc.addCacheTransactionManagerCreation(txMgrCreation);
-    IgnoredException expectedException = IgnoredException
-        .addIgnoredException("A TransactionWriter cannot be registered on a client");
+    IgnoredException expectedException =
+        addIgnoredException("A TransactionWriter cannot be registered on a client");
     try {
       testXml(cc);
       fail("expected exception not thrown");
@@ -1668,7 +1669,7 @@ public abstract class CacheXml66DUnitTest extends CacheXmlTestCase {
     rmc.setEvictionHeapPercentage(high);
     rmc.setCriticalHeapPercentage(low);
     cache.setResourceManagerCreation(rmc);
-    IgnoredException expectedException = IgnoredException.addIgnoredException(
+    IgnoredException expectedException = addIgnoredException(
         "Eviction percentage must be less than the critical percentage.");
     try {
       testXml(cache);
@@ -1719,18 +1720,18 @@ public abstract class CacheXml66DUnitTest extends CacheXmlTestCase {
   // A bunch of classes for use in testing the serialization schtuff
   public static class DS1 implements DataSerializable {
     @Override
-    public void fromData(DataInput in) throws IOException, ClassNotFoundException {}
+    public void fromData(DataInput in) {}
 
     @Override
-    public void toData(DataOutput out) throws IOException {}
+    public void toData(DataOutput out) {}
   };
 
   public static class DS2 implements DataSerializable {
     @Override
-    public void fromData(DataInput in) throws IOException, ClassNotFoundException {}
+    public void fromData(DataInput in) {}
 
     @Override
-    public void toData(DataOutput out) throws IOException {}
+    public void toData(DataOutput out) {}
   };
 
   public static class NotDataSerializable implements Serializable {
@@ -1740,7 +1741,7 @@ public abstract class CacheXml66DUnitTest extends CacheXmlTestCase {
     public GoodSerializer() {}
 
     @Override
-    public Object fromData(DataInput in) throws IOException, ClassNotFoundException {
+    public Object fromData(DataInput in) {
       return null;
     }
 
@@ -1755,14 +1756,14 @@ public abstract class CacheXml66DUnitTest extends CacheXmlTestCase {
     }
 
     @Override
-    public boolean toData(Object o, DataOutput out) throws IOException {
+    public boolean toData(Object o, DataOutput out) {
       return false;
     }
   }
 
   public static class BadSerializer extends DataSerializer {
     @Override
-    public Object fromData(DataInput in) throws IOException, ClassNotFoundException {
+    public Object fromData(DataInput in) {
       return null;
     }
 
@@ -1777,7 +1778,7 @@ public abstract class CacheXml66DUnitTest extends CacheXmlTestCase {
     }
 
     @Override
-    public boolean toData(Object o, DataOutput out) throws IOException {
+    public boolean toData(Object o, DataOutput out) {
       return false;
     }
   }
@@ -1806,7 +1807,7 @@ public abstract class CacheXml66DUnitTest extends CacheXmlTestCase {
     cc.setSerializerCreation(sc);
 
     IgnoredException expectedException =
-        IgnoredException.addIgnoredException("While reading Cache XML file");
+        addIgnoredException("While reading Cache XML file");
     try {
       testXml(cc);
       fail("Instantiator should not have registered due to bad class.");
@@ -1821,7 +1822,7 @@ public abstract class CacheXml66DUnitTest extends CacheXmlTestCase {
     cc.setSerializerCreation(sc);
 
     IgnoredException expectedException1 =
-        IgnoredException.addIgnoredException("While reading Cache XML file");
+        addIgnoredException("While reading Cache XML file");
     try {
       testXml(cc);
       fail("Serializer should not have registered due to bad class.");
@@ -2384,7 +2385,7 @@ public abstract class CacheXml66DUnitTest extends CacheXmlTestCase {
     RegionAttributesCreation attrs = new RegionAttributesCreation(cache);
     attrs.setPoolName("mypool");
     cache.createVMRegion("rootNORMAL", attrs);
-    IgnoredException expectedException = IgnoredException.addIgnoredException(
+    IgnoredException expectedException = addIgnoredException(
         String.format("The connection pool %s has not been created",
             "mypool"));
     try {
@@ -2405,7 +2406,7 @@ public abstract class CacheXml66DUnitTest extends CacheXmlTestCase {
       // now make sure declarative cache can't create the same pool
       CacheCreation cache = new CacheCreation();
       cache.createPoolFactory().addLocator(ALIAS2, 12345).create("mypool");
-      IgnoredException expectedException = IgnoredException.addIgnoredException(
+      IgnoredException expectedException = addIgnoredException(
           String.format("A pool named %s already exists", "mypool"));
       try {
         testXml(cache);
@@ -2421,10 +2422,10 @@ public abstract class CacheXml66DUnitTest extends CacheXmlTestCase {
 
   @Test
   public void testDynamicRegionFactoryConnectionPool() throws Exception, IOException {
-    IgnoredException.addIgnoredException("Connection reset");
-    IgnoredException.addIgnoredException("SocketTimeoutException");
-    IgnoredException.addIgnoredException("ServerConnectivityException");
-    IgnoredException.addIgnoredException("Socket Closed");
+    addIgnoredException("Connection reset");
+    addIgnoredException("SocketTimeoutException");
+    addIgnoredException("ServerConnectivityException");
+    addIgnoredException("Socket Closed");
     getSystem();
     VM vm0 = Host.getHost(0).getVM(0);
     final int port = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
@@ -2845,7 +2846,7 @@ public abstract class CacheXml66DUnitTest extends CacheXmlTestCase {
    * leaving the functionality for future comparisons (by hand of course).
    */
   @Test
-  public void testPartitionedRegionInstantiation() throws Exception {
+  public void testPartitionedRegionInstantiation() {
     CacheCreation cache = new CacheCreation();
     RegionAttributesCreation attrs = new RegionAttributesCreation(cache);
 
@@ -3051,8 +3052,8 @@ public abstract class CacheXml66DUnitTest extends CacheXmlTestCase {
   @Override
   public Properties getDistributedSystemProperties() {
     Properties props = super.getDistributedSystemProperties();
-    if (this.xmlProps != null) {
-      for (Iterator iter = this.xmlProps.entrySet().iterator(); iter.hasNext();) {
+    if (xmlProps != null) {
+      for (Iterator iter = xmlProps.entrySet().iterator(); iter.hasNext();) {
         Map.Entry entry = (Map.Entry) iter.next();
         String key = (String) entry.getKey();
         String value = (String) entry.getValue();
@@ -3103,13 +3104,13 @@ public abstract class CacheXml66DUnitTest extends CacheXmlTestCase {
       // will not think the a required role is missing
       Properties config = new Properties();
       config.setProperty(ROLES, MY_ROLES);
-      this.xmlProps = config;
+      xmlProps = config;
     }
     DistributedRegion.ignoreReconnect = true;
     try {
       testXml(cache);
     } finally {
-      this.xmlProps = null;
+      xmlProps = null;
       try {
         preTearDown();
       } finally {
@@ -3194,7 +3195,7 @@ public abstract class CacheXml66DUnitTest extends CacheXmlTestCase {
     factory.setEvictionAttributes(ev);
     // RegionAttributes atts = factory.create();
     createRegion(name, factory.create());
-    finishCacheXml(this.temporaryFolder.getRoot(), getUniqueName(), getUseSchema(),
+    finishCacheXml(temporaryFolder.getRoot(), getUniqueName(), getUseSchema(),
         getGemFireVersion());
     Region r = getRootRegion().getSubregion(name);
 
@@ -3346,7 +3347,7 @@ public abstract class CacheXml66DUnitTest extends CacheXmlTestCase {
   public void testUnknownNamedAttributes() throws Exception {
     setXmlFile(findFile("unknownNamedAttributes.xml"));
 
-    IgnoredException expectedException = IgnoredException.addIgnoredException(
+    IgnoredException expectedException = addIgnoredException(
         "Cannot reference non-existing region attributes named");
     try {
       getCache();
@@ -3381,8 +3382,8 @@ public abstract class CacheXml66DUnitTest extends CacheXmlTestCase {
 
     setXmlFile(findFile("sameRootRegion.xml"));
 
-    IgnoredException.addIgnoredException("While reading Cache XML file");
-    IgnoredException.addIgnoredException("org.apache.geode.cache.RegionExistsException");
+    addIgnoredException("While reading Cache XML file");
+    addIgnoredException("org.apache.geode.cache.RegionExistsException");
     try {
       getCache();
       fail("Should have thrown a CacheXmlException");
@@ -3407,7 +3408,7 @@ public abstract class CacheXml66DUnitTest extends CacheXmlTestCase {
   public void testCreateSameSubregionTwice() throws Exception {
     CacheCreation cache = new CacheCreation();
     RegionAttributesCreation attrs = new RegionAttributesCreation(cache);
-    String name = this.getUniqueName();
+    String name = getUniqueName();
 
     Region root = cache.createRegion("root", attrs);
 
@@ -3423,8 +3424,8 @@ public abstract class CacheXml66DUnitTest extends CacheXmlTestCase {
 
     setXmlFile(findFile("sameSubregion.xml"));
 
-    IgnoredException.addIgnoredException("While reading Cache XML file");
-    IgnoredException.addIgnoredException("org.apache.geode.cache.RegionExistsException");
+    addIgnoredException("While reading Cache XML file");
+    addIgnoredException("org.apache.geode.cache.RegionExistsException");
     try {
       getCache();
       fail("Should have thrown a CacheXmlException");
@@ -3870,15 +3871,15 @@ public abstract class CacheXml66DUnitTest extends CacheXmlTestCase {
    * Tests creating a cache with a non-existent XML file
    */
   @Test
-  public void testNonExistentFile() throws Exception {
+  public void testNonExistentFile() {
     // System.out.println("testNonExistentFile - start: " + System.currentTimeMillis());
-    File nonExistent = new File(this.getName() + ".xml");
+    File nonExistent = new File(getName() + ".xml");
     nonExistent.delete();
     // System.out.println("testNonExistentFile - deleted: " + System.currentTimeMillis());
     setXmlFile(nonExistent);
     // System.out.println("testNonExistentFile - set: " + System.currentTimeMillis());
 
-    IgnoredException expectedException = IgnoredException.addIgnoredException(
+    IgnoredException expectedException = addIgnoredException(
         String.format("Declarative Cache XML file/resource %s does not exist.",
             nonExistent.getPath()));
     try {
@@ -3897,13 +3898,13 @@ public abstract class CacheXml66DUnitTest extends CacheXmlTestCase {
    * Tests creating a cache with a XML file that is a directory
    */
   @Test
-  public void testXmlFileIsDirectory() throws Exception {
-    File dir = new File(this.getName() + "dir");
+  public void testXmlFileIsDirectory() {
+    File dir = new File(getName() + "dir");
     dir.mkdirs();
     dir.deleteOnExit();
     setXmlFile(dir);
 
-    IgnoredException expectedException = IgnoredException.addIgnoredException(
+    IgnoredException expectedException = addIgnoredException(
         String.format("Declarative XML file %s is not a file.", dir));
     try {
       getCache();
@@ -4080,7 +4081,7 @@ public abstract class CacheXml66DUnitTest extends CacheXmlTestCase {
     setXmlFile(findFile("malformed.xml"));
 
     IgnoredException expectedException =
-        IgnoredException.addIgnoredException("While reading Cache XML file");
+        addIgnoredException("While reading Cache XML file");
     try {
       getCache();
       fail("Should have thrown a CacheXmlException");
@@ -4100,7 +4101,7 @@ public abstract class CacheXml66DUnitTest extends CacheXmlTestCase {
     setXmlFile(findFile("badInt.xml"));
 
     IgnoredException expectedException =
-        IgnoredException.addIgnoredException("While reading Cache XML file");
+        addIgnoredException("While reading Cache XML file");
     try {
       getCache();
       fail("Should have thrown a CacheXmlException");
@@ -4123,7 +4124,7 @@ public abstract class CacheXml66DUnitTest extends CacheXmlTestCase {
     setXmlFile(findFile("badFloat.xml"));
 
     IgnoredException expectedException =
-        IgnoredException.addIgnoredException("While reading Cache XML file");
+        addIgnoredException("While reading Cache XML file");
     try {
       getCache();
       fail("Should have thrown a CacheXmlException");
@@ -4143,7 +4144,7 @@ public abstract class CacheXml66DUnitTest extends CacheXmlTestCase {
     setXmlFile(findFile("badScope.xml"));
 
     IgnoredException expectedException =
-        IgnoredException.addIgnoredException("While reading Cache XML file");
+        addIgnoredException("While reading Cache XML file");
     try {
       getCache();
       fail("Should have thrown a CacheXmlException");
@@ -4163,7 +4164,7 @@ public abstract class CacheXml66DUnitTest extends CacheXmlTestCase {
     setXmlFile(findFile("badKeyConstraintClass.xml"));
 
     IgnoredException expectedException =
-        IgnoredException.addIgnoredException("While reading Cache XML file");
+        addIgnoredException("While reading Cache XML file");
     try {
       getCache();
       fail("Should have thrown a CacheXmlException");
@@ -4194,7 +4195,7 @@ public abstract class CacheXml66DUnitTest extends CacheXmlTestCase {
     setXmlFile(findFile("callbackWithException.xml"));
 
     IgnoredException expectedException =
-        IgnoredException.addIgnoredException("While reading Cache XML file");
+        addIgnoredException("While reading Cache XML file");
     try {
       getCache();
       fail("Should have thrown a CacheXmlException");
@@ -4217,7 +4218,7 @@ public abstract class CacheXml66DUnitTest extends CacheXmlTestCase {
     setXmlFile(findFile("loaderNotLoader.xml"));
 
     IgnoredException expectedException =
-        IgnoredException.addIgnoredException("While reading Cache XML file");
+        addIgnoredException("While reading Cache XML file");
     try {
       getCache();
       fail("Should have thrown a CacheXmlException");
@@ -4290,8 +4291,8 @@ public abstract class CacheXml66DUnitTest extends CacheXmlTestCase {
     CacheCreation cache = new CacheCreation();
 
     RegionAttributesCreation attrs = new RegionAttributesCreation(cache);
-    File[] dirs = new File[] {new File(this.getUniqueName() + "-dir1"),
-        new File(this.getUniqueName() + "-dir2")};
+    File[] dirs = new File[] {new File(getUniqueName() + "-dir1"),
+        new File(getUniqueName() + "-dir2")};
     for (int i = 0; i < dirs.length; i++) {
       dirs[i].mkdirs();
       dirs[i].deleteOnExit();
@@ -4363,7 +4364,7 @@ public abstract class CacheXml66DUnitTest extends CacheXmlTestCase {
   @Ignore // TODO: why is testExampleCacheXmlFile @Ignored?
   public void testExampleCacheXmlFile() throws Exception {
     // Check for old example files
-    String dirName = "examples_" + this.getGemFireVersion();
+    String dirName = "examples_" + getGemFireVersion();
     File dir = null;
     try {
       dir = findFile(dirName);
@@ -4426,11 +4427,11 @@ public abstract class CacheXml66DUnitTest extends CacheXmlTestCase {
 
     @Override
     public Properties getConfig() {
-      if (null == this.props) {
-        this.props = new Properties();
+      if (null == props) {
+        props = new Properties();
       }
-      this.props.setProperty("EvictionObjectSizerColor", "blue");
-      return this.props;
+      props.setProperty("EvictionObjectSizerColor", "blue");
+      return props;
     }
 
     @Override
@@ -4447,7 +4448,7 @@ public abstract class CacheXml66DUnitTest extends CacheXmlTestCase {
         return false;
       }
       EvictionObjectSizer other = (EvictionObjectSizer) obj;
-      if (!this.props.equals(other.props)) {
+      if (!props.equals(other.props)) {
         return false;
       }
       return true;
@@ -4562,7 +4563,7 @@ public abstract class CacheXml66DUnitTest extends CacheXmlTestCase {
      * Creates a new loader and initializes its properties
      */
     public CacheLoaderWithDeclarables() {
-      this.props = new Properties();
+      props = new Properties();
       props.put("KEY1", "VALUE1");
       props.put("KEY2", new TestDeclarable());
     }
@@ -4571,18 +4572,18 @@ public abstract class CacheXml66DUnitTest extends CacheXmlTestCase {
      * Returns whether or not this {@code Declarable} was initialized.
      */
     public boolean isInitialized() {
-      return this.initialized;
+      return initialized;
     }
 
     @Override
     public void init(Properties props) {
-      this.initialized = true;
+      initialized = true;
       assertEquals(this.props, props);
     }
 
     @Override
     public Properties getConfig() {
-      return this.props;
+      return props;
     }
 
     @Override
@@ -4595,7 +4596,7 @@ public abstract class CacheXml66DUnitTest extends CacheXmlTestCase {
     public boolean equals(Object o) {
       if (o instanceof CacheLoaderWithDeclarables) {
         CacheLoaderWithDeclarables other = (CacheLoaderWithDeclarables) o;
-        return this.props.equals(other.props);
+        return props.equals(other.props);
 
       } else {
         return false;
diff --git a/geode-core/src/distributedTest/java/org/apache/geode/cache30/ReconnectWithCacheXMLDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/cache30/ReconnectWithCacheXMLDUnitTest.java
index c8fd582..2f886e2 100755
--- a/geode-core/src/distributedTest/java/org/apache/geode/cache30/ReconnectWithCacheXMLDUnitTest.java
+++ b/geode-core/src/distributedTest/java/org/apache/geode/cache30/ReconnectWithCacheXMLDUnitTest.java
@@ -22,6 +22,7 @@ import static org.junit.Assert.assertEquals;
 import java.util.Properties;
 import java.util.concurrent.atomic.AtomicBoolean;
 
+import org.junit.Rule;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
@@ -35,6 +36,7 @@ import org.apache.geode.distributed.internal.membership.MembershipTestHook;
 import org.apache.geode.distributed.internal.membership.gms.MembershipManagerHelper;
 import org.apache.geode.internal.AvailablePortHelper;
 import org.apache.geode.test.dunit.cache.internal.JUnit4CacheTestCase;
+import org.apache.geode.test.dunit.rules.DistributedRestoreSystemProperties;
 import org.apache.geode.test.junit.categories.ClientServerTest;
 import org.apache.geode.test.junit.categories.MembershipTest;
 
@@ -44,15 +46,15 @@ import org.apache.geode.test.junit.categories.MembershipTest;
  * GEODE-2732.
  */
 @Category({MembershipTest.class, ClientServerTest.class})
+@SuppressWarnings("serial")
 public class ReconnectWithCacheXMLDUnitTest extends JUnit4CacheTestCase {
-  private static final long serialVersionUID = 1L;
+
   private String xmlProperty = DistributionConfig.GEMFIRE_PREFIX + "autoReconnect-useCacheXMLFile";
   private String oldPropertySetting;
 
-
-  public ReconnectWithCacheXMLDUnitTest() {
-    super();
-  }
+  @Rule
+  public DistributedRestoreSystemProperties restoreSystemProperties =
+      new DistributedRestoreSystemProperties();
 
   @Override
   public final void postSetUp() {
@@ -74,10 +76,10 @@ public class ReconnectWithCacheXMLDUnitTest extends JUnit4CacheTestCase {
     String fileName =
         createTempFileFromResource(getClass(), "ReconnectWithCacheXMLDUnitTest.xml")
             .getAbsolutePath();
-    result.put(ConfigurationProperties.CACHE_XML_FILE, fileName);
-    result.put(ConfigurationProperties.ENABLE_NETWORK_PARTITION_DETECTION, "true");
-    result.put(ConfigurationProperties.DISABLE_AUTO_RECONNECT, "false");
-    result.put(ConfigurationProperties.MAX_WAIT_TIME_RECONNECT, "2000");
+    result.setProperty(ConfigurationProperties.CACHE_XML_FILE, fileName);
+    result.setProperty(ConfigurationProperties.ENABLE_NETWORK_PARTITION_DETECTION, "true");
+    result.setProperty(ConfigurationProperties.DISABLE_AUTO_RECONNECT, "false");
+    result.setProperty(ConfigurationProperties.MAX_WAIT_TIME_RECONNECT, "2000");
     return result;
   }
 
@@ -87,15 +89,12 @@ public class ReconnectWithCacheXMLDUnitTest extends JUnit4CacheTestCase {
         .withDisableDefaultServer(true);
     Cache cache = getCache();
 
-    final AtomicBoolean membershipFailed = new AtomicBoolean();
+    AtomicBoolean membershipFailed = new AtomicBoolean();
     MembershipManagerHelper.addTestHook(cache.getDistributedSystem(), new MembershipTestHook() {
       @Override
       public void beforeMembershipFailure(String reason, Throwable cause) {
         membershipFailed.set(true);
       }
-
-      @Override
-      public void afterMembershipFailure(String reason, Throwable cause) {}
     });
     MembershipManagerHelper.crashDistributedSystem(cache.getDistributedSystem());
     assertTrue(membershipFailed.get());
diff --git a/geode-core/src/distributedTest/java/org/apache/geode/distributed/LocatorDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/distributed/LocatorDUnitTest.java
index caf04de..4381ef7 100644
--- a/geode-core/src/distributedTest/java/org/apache/geode/distributed/LocatorDUnitTest.java
+++ b/geode-core/src/distributedTest/java/org/apache/geode/distributed/LocatorDUnitTest.java
@@ -39,8 +39,15 @@ import static org.apache.geode.distributed.ConfigurationProperties.SSL_TRUSTSTOR
 import static org.apache.geode.distributed.ConfigurationProperties.SSL_TRUSTSTORE_PASSWORD;
 import static org.apache.geode.distributed.ConfigurationProperties.START_LOCATOR;
 import static org.apache.geode.distributed.ConfigurationProperties.USE_CLUSTER_CONFIGURATION;
-import static org.apache.geode.internal.logging.LogWriterLevel.ALL;
+import static org.apache.geode.internal.security.SecurableCommunicationChannel.LOCATOR;
 import static org.apache.geode.test.awaitility.GeodeAwaitility.await;
+import static org.apache.geode.test.dunit.Disconnect.disconnectFromDS;
+import static org.apache.geode.test.dunit.DistributedTestUtils.deleteLocatorStateFile;
+import static org.apache.geode.test.dunit.IgnoredException.addIgnoredException;
+import static org.apache.geode.test.dunit.VM.getController;
+import static org.apache.geode.test.dunit.VM.getHostName;
+import static org.apache.geode.test.dunit.VM.getVM;
+import static org.apache.geode.test.dunit.VM.toArray;
 import static org.apache.geode.test.util.ResourceUtils.createTempFileFromResource;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
@@ -52,12 +59,13 @@ import static org.junit.Assert.fail;
 
 import java.io.File;
 import java.io.IOException;
+import java.io.Serializable;
+import java.net.ConnectException;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
 import java.util.Properties;
 import java.util.Set;
-import java.util.concurrent.TimeUnit;
 
 import org.apache.logging.log4j.Logger;
 import org.junit.After;
@@ -68,7 +76,6 @@ import org.junit.experimental.categories.Category;
 
 import org.apache.geode.ForcedDisconnectException;
 import org.apache.geode.GemFireConfigException;
-import org.apache.geode.LogWriter;
 import org.apache.geode.SystemConnectException;
 import org.apache.geode.cache.Cache;
 import org.apache.geode.cache.CacheFactory;
@@ -89,17 +96,12 @@ import org.apache.geode.distributed.internal.membership.gms.MembershipManagerHel
 import org.apache.geode.distributed.internal.tcpserver.LocatorCancelException;
 import org.apache.geode.internal.AvailablePort;
 import org.apache.geode.internal.AvailablePortHelper;
-import org.apache.geode.internal.cache.GemFireCacheImpl;
-import org.apache.geode.internal.logging.LocalLogWriter;
 import org.apache.geode.internal.logging.LogService;
-import org.apache.geode.internal.security.SecurableCommunicationChannel;
 import org.apache.geode.internal.tcp.Connection;
 import org.apache.geode.test.dunit.AsyncInvocation;
 import org.apache.geode.test.dunit.DUnitBlackboard;
 import org.apache.geode.test.dunit.DistributedTestUtils;
-import org.apache.geode.test.dunit.Host;
 import org.apache.geode.test.dunit.IgnoredException;
-import org.apache.geode.test.dunit.LogWriterUtils;
 import org.apache.geode.test.dunit.NetworkUtils;
 import org.apache.geode.test.dunit.RMIException;
 import org.apache.geode.test.dunit.SerializableRunnable;
@@ -107,6 +109,7 @@ import org.apache.geode.test.dunit.VM;
 import org.apache.geode.test.dunit.Wait;
 import org.apache.geode.test.dunit.internal.DUnitLauncher;
 import org.apache.geode.test.dunit.rules.DistributedRule;
+import org.apache.geode.test.dunit.rules.SharedErrorCollector;
 import org.apache.geode.test.junit.categories.MembershipTest;
 
 /**
@@ -114,20 +117,73 @@ import org.apache.geode.test.junit.categories.MembershipTest;
  *
  * @since GemFire 4.0
  */
-@Category({MembershipTest.class})
-public class LocatorDUnitTest implements java.io.Serializable {
+@Category(MembershipTest.class)
+@SuppressWarnings("serial")
+public class LocatorDUnitTest implements Serializable {
   private static final Logger logger = LogService.getLogger();
 
-  private static DUnitBlackboard blackboard;
-  private static TestHook hook;
-  static volatile InternalDistributedSystem system = null;
+  protected static volatile InternalDistributedSystem system;
+  private static volatile DUnitBlackboard blackboard;
+  private static volatile TestHook hook;
+
   protected int port1;
   private int port2;
+  private int port3;
+  private int port4;
+
+  protected String hostName;
+
+  protected VM vm0;
+  private VM vm1;
+  private VM vm2;
+  private VM vm3;
+  private VM vm4;
+
+  @Rule
+  public DistributedRule distributedRule = new DistributedRule(6);
 
   @Rule
-  public DistributedRule distributedRule =
-      DistributedRule.builder().withVMCount(6).build();
+  public SharedErrorCollector errorCollector = new SharedErrorCollector();
+
+  @Before
+  public void setUp() {
+    addIgnoredException("Removing shunned member");
+
+    vm0 = getVM(0);
+    vm1 = getVM(1);
+    vm2 = getVM(2);
+    vm3 = getVM(3);
+    vm4 = getVM(4);
+
+    hostName = NetworkUtils.getServerHostName();
+
+    int ports[] = AvailablePortHelper.getRandomAvailableTCPPorts(4);
+    port1 = ports[0];
+    port2 = ports[1];
+    port3 = ports[2];
+    port4 = ports[3];
+    deleteLocatorStateFile(port1, port2, port3, port4);
+  }
+
+  @After
+  public void tearDown() {
+    for (VM vm : toArray(getController(), vm0, vm1, vm2, vm3, vm4)) {
+      vm.invoke(() -> {
+        stopLocator();
+        disconnectFromDS();
+        system = null;
+        blackboard = null;
+        hook = null;
+      });
+    }
 
+    // delete locator state files so they don't accidentally get used by other tests
+    for (int port : new int[] {port1, port2, port3, port4}) {
+      if (port > 0) {
+        deleteLocatorStateFile(port);
+      }
+    }
+  }
 
   private static DUnitBlackboard getBlackboard() {
     if (blackboard == null) {
@@ -153,18 +209,14 @@ public class LocatorDUnitTest implements java.io.Serializable {
     MembershipManagerHelper.inhibitForcedDisconnectLogging(false);
   }
 
-
   /**
    * return the distributed member id for the ds on this vm
    */
   private static DistributedMember getDistributedMember(Properties props) {
-    props.put("name", "vm_" + VM.getCurrentVMNum());
+    props.setProperty("name", "vm_" + VM.getCurrentVMNum());
     DistributedSystem sys = getConnectedDistributedSystem(props);
-    sys.getLogWriter().info("<ExpectedException action=add>service failure</ExpectedException>");
-    sys.getLogWriter().info(
-        "<ExpectedException action=add>org.apache.geode.ConnectException</ExpectedException>");
-    sys.getLogWriter().info(
-        "<ExpectedException action=add>org.apache.geode.ForcedDisconnectException</ExpectedException>");
+    addIgnoredException("service failure");
+    addIgnoredException(ForcedDisconnectException.class);
     return sys.getDistributedMember();
   }
 
@@ -172,7 +224,7 @@ public class LocatorDUnitTest implements java.io.Serializable {
    * find a running locator and return its distributed member id
    */
   private static DistributedMember getLocatorDistributedMember() {
-    return (Locator.getLocator()).getDistributedSystem().getDistributedMember();
+    return Locator.getLocator().getDistributedSystem().getDistributedMember();
   }
 
   /**
@@ -191,8 +243,6 @@ public class LocatorDUnitTest implements java.io.Serializable {
     }
   }
 
-  //////// Test Methods
-
   /**
    * This tests that the locator can resume control as coordinator after all locators have been shut
    * down and one is restarted. It's necessary to have a lock service start so elder failover is
@@ -201,29 +251,24 @@ public class LocatorDUnitTest implements java.io.Serializable {
    */
   @Test
   public void testCollocatedLocatorWithSecurity() {
-    VM vm1 = VM.getVM(1);
-    VM vm2 = VM.getVM(2);
-    VM vm3 = VM.getVM(3);
-
-    port1 = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
-    DistributedTestUtils.deleteLocatorStateFile(port1);
-
-    final String locators = NetworkUtils.getServerHostName() + "[" + port1 + "]";
-    final Properties properties = new Properties();
-    properties.put(MCAST_PORT, "0");
-    properties.put(START_LOCATOR, locators);
-    properties.put(LOG_LEVEL, logger.getLevel().name());
-    properties.put(SECURITY_PEER_AUTH_INIT, "org.apache.geode.distributed.AuthInitializer.create");
-    properties.put(SECURITY_PEER_AUTHENTICATOR,
+    String locators = hostName + "[" + port1 + "]";
+
+    Properties properties = new Properties();
+    properties.setProperty(SECURITY_PEER_AUTH_INIT,
+        "org.apache.geode.distributed.AuthInitializer.create");
+    properties.setProperty(SECURITY_PEER_AUTHENTICATOR,
         "org.apache.geode.distributed.MyAuthenticator.create");
+    properties.setProperty(START_LOCATOR, locators);
     addDSProps(properties);
+
     system = getConnectedDistributedSystem(properties);
     assertThat(system.getDistributedMember().getVmKind())
         .describedAs("expected the VM to have NORMAL vmKind")
         .isEqualTo(ClusterDistributionManager.NORMAL_DM_TYPE);
 
     properties.remove(START_LOCATOR);
-    properties.put(LOCATORS, locators);
+    properties.setProperty(LOCATORS, locators);
+
     SerializableRunnable startSystem = new SerializableRunnable("start system") {
       @Override
       public void run() {
@@ -253,15 +298,14 @@ public class LocatorDUnitTest implements java.io.Serializable {
     system.disconnect();
 
     vm1.invoke("ensure grantor failover", () -> {
-      DistributedLockService serviceNamed =
-          DistributedLockService.getServiceNamed("test service");
+      DistributedLockService serviceNamed = DistributedLockService.getServiceNamed("test service");
       serviceNamed.lock("foo3", 0, 0);
-      await()
-          .until(serviceNamed::isLockGrantor);
+      await().until(serviceNamed::isLockGrantor);
       assertThat(serviceNamed.isLockGrantor()).isTrue();
     });
 
-    properties.put(START_LOCATOR, locators);
+    properties.setProperty(START_LOCATOR, locators);
+
     system = getConnectedDistributedSystem(properties);
     System.out.println("done connecting distributed system.  Membership view is "
         + MembershipManagerHelper.getMembershipManager(system).getView());
@@ -289,7 +333,6 @@ public class LocatorDUnitTest implements java.io.Serializable {
     vm3.invoke(startSystem);
     vm3.invoke("get the lock service and lock something(2)",
         () -> DistributedLockService.create("test service", system).lock("foo5", 0, 0));
-
   }
 
   /**
@@ -300,232 +343,172 @@ public class LocatorDUnitTest implements java.io.Serializable {
    */
   @Test
   public void testStartTwoLocators() throws Exception {
-    VM loc1 = VM.getVM(1);
-    VM loc2 = VM.getVM(2);
-
-    int ports[] = AvailablePortHelper.getRandomAvailableTCPPorts(2);
-    final int port1 = ports[0];
-    this.port1 = port1;
-    final int port2 = ports[1];
-    this.port2 = port2; // for cleanup in tearDown2
-    DistributedTestUtils.deleteLocatorStateFile(port1);
-    DistributedTestUtils.deleteLocatorStateFile(port2);
-    final String host0 = NetworkUtils.getServerHostName();
-    final String locators = host0 + "[" + port1 + "]," + host0 + "[" + port2 + "]";
-    final Properties properties = getClusterProperties(locators, "false");
+    String locators = hostName + "[" + port1 + "]," + hostName + "[" + port2 + "]";
+
+    Properties properties = getClusterProperties(locators, "false");
     addDSProps(properties);
 
-    startVerifyAndStopLocator(loc1, loc2, port1, port2, properties);
-    startVerifyAndStopLocator(loc1, loc2, port1, port2, properties);
-    startVerifyAndStopLocator(loc1, loc2, port1, port2, properties);
+    startVerifyAndStopLocator(vm1, vm2, port1, port2, properties);
+    startVerifyAndStopLocator(vm1, vm2, port1, port2, properties);
+    startVerifyAndStopLocator(vm1, vm2, port1, port2, properties);
   }
 
   @Test
   public void testStartTwoLocatorsWithSingleKeystoreSSL() throws Exception {
-    VM loc1 = VM.getVM(1);
-    VM loc2 = VM.getVM(2);
-
-    int ports[] = AvailablePortHelper.getRandomAvailableTCPPorts(2);
-    final int port1 = ports[0];
-    this.port1 = port1;
-    final int port2 = ports[1];
-    this.port2 = port2; // for cleanup in tearDown2
-    DistributedTestUtils.deleteLocatorStateFile(port1);
-    DistributedTestUtils.deleteLocatorStateFile(port2);
-    final String host0 = NetworkUtils.getServerHostName();
-    final String locators = host0 + "[" + port1 + "]," + host0 + "[" + port2 + "]";
-    final Properties properties = getClusterProperties(locators, "false");
-    properties.put(SSL_CIPHERS, "any");
-    properties.put(SSL_PROTOCOLS, "TLSv1,TLSv1.1,TLSv1.2");
-    properties.put(SSL_KEYSTORE, getSingleKeyKeystore());
-    properties.put(SSL_KEYSTORE_PASSWORD, "password");
-    properties.put(SSL_KEYSTORE_TYPE, "JKS");
-    properties.put(SSL_TRUSTSTORE, getSingleKeyKeystore());
-    properties.put(SSL_TRUSTSTORE_PASSWORD, "password");
-    properties.put(SSL_ENABLED_COMPONENTS, SecurableCommunicationChannel.LOCATOR.getConstant());
-
-    startVerifyAndStopLocator(loc1, loc2, port1, port2, properties);
+    String locators = hostName + "[" + port1 + "]," + hostName + "[" + port2 + "]";
+
+    Properties properties = getClusterProperties(locators, "false");
+    properties.setProperty(SSL_CIPHERS, "any");
+    properties.setProperty(SSL_ENABLED_COMPONENTS, LOCATOR.getConstant());
+    properties.setProperty(SSL_KEYSTORE, getSingleKeyKeystore());
+    properties.setProperty(SSL_KEYSTORE_PASSWORD, "password");
+    properties.setProperty(SSL_KEYSTORE_TYPE, "JKS");
+    properties.setProperty(SSL_PROTOCOLS, "TLSv1,TLSv1.1,TLSv1.2");
+    properties.setProperty(SSL_TRUSTSTORE, getSingleKeyKeystore());
+    properties.setProperty(SSL_TRUSTSTORE_PASSWORD, "password");
+
+    startVerifyAndStopLocator(vm1, vm2, port1, port2, properties);
   }
 
   @Test
   public void testStartTwoLocatorsWithMultiKeystoreSSL() throws Exception {
-    VM loc1 = VM.getVM(1);
-    VM loc2 = VM.getVM(2);
-
-    int ports[] = AvailablePortHelper.getRandomAvailableTCPPorts(2);
-    final int port1 = ports[0];
-    this.port1 = port1;
-    final int port2 = ports[1];
-    this.port2 = port2; // for cleanup in tearDown2
-    DistributedTestUtils.deleteLocatorStateFile(port1);
-    DistributedTestUtils.deleteLocatorStateFile(port2);
-    final String host0 = NetworkUtils.getServerHostName();
-    final String locators = host0 + "[" + port1 + "]," + host0 + "[" + port2 + "]";
-    final Properties properties = getClusterProperties(locators, "false");
-    properties.put(SSL_CIPHERS, "any");
-    properties.put(SSL_PROTOCOLS, "any");
-    properties.put(SSL_KEYSTORE, getMultiKeyKeystore());
-    properties.put(SSL_KEYSTORE_PASSWORD, "password");
-    properties.put(SSL_KEYSTORE_TYPE, "JKS");
-    properties.put(SSL_TRUSTSTORE, getMultiKeyTruststore());
-    properties.put(SSL_TRUSTSTORE_PASSWORD, "password");
-    properties.put(SSL_LOCATOR_ALIAS, "locatorkey");
-    properties.put(SSL_ENABLED_COMPONENTS, SecurableCommunicationChannel.LOCATOR.getConstant());
-
-    startVerifyAndStopLocator(loc1, loc2, port1, port2, properties);
+    String locators = hostName + "[" + port1 + "]," + hostName + "[" + port2 + "]";
+
+    Properties properties = getClusterProperties(locators, "false");
+    properties.setProperty(SSL_CIPHERS, "any");
+    properties.setProperty(SSL_ENABLED_COMPONENTS, LOCATOR.getConstant());
+    properties.setProperty(SSL_KEYSTORE, getMultiKeyKeystore());
+    properties.setProperty(SSL_KEYSTORE_PASSWORD, "password");
+    properties.setProperty(SSL_KEYSTORE_TYPE, "JKS");
+    properties.setProperty(SSL_TRUSTSTORE, getMultiKeyTruststore());
+    properties.setProperty(SSL_TRUSTSTORE_PASSWORD, "password");
+    properties.setProperty(SSL_LOCATOR_ALIAS, "locatorkey");
+    properties.setProperty(SSL_PROTOCOLS, "any");
+
+    startVerifyAndStopLocator(vm1, vm2, port1, port2, properties);
   }
 
   @Test
   public void testNonSSLLocatorDiesWhenConnectingToSSLLocator() {
-    IgnoredException.addIgnoredException("Unrecognized SSL message, plaintext connection");
-    IgnoredException.addIgnoredException("LocatorCancelException");
-
-    final String hostname = NetworkUtils.getServerHostName();
-    VM loc1 = VM.getVM(1);
-    VM loc2 = VM.getVM(2);
-    port1 = -1;
-    port2 = -1;
-    final Properties properties = new Properties();
-    properties.put(MCAST_PORT, "0");
-    properties.put(ENABLE_NETWORK_PARTITION_DETECTION, "false");
-    properties.put(DISABLE_AUTO_RECONNECT, "true");
-    properties.put(MEMBER_TIMEOUT, "2000");
-    properties.put(LOG_LEVEL, logger.getLevel().name());
-    properties.put(ENABLE_CLUSTER_CONFIGURATION, "false");
-    properties.put(USE_CLUSTER_CONFIGURATION, "false");
-    properties.put(SSL_CIPHERS, "any");
-    properties.put(SSL_PROTOCOLS, "any");
-    properties.put(SSL_KEYSTORE, getSingleKeyKeystore());
-    properties.put(SSL_KEYSTORE_PASSWORD, "password");
-    properties.put(SSL_KEYSTORE_TYPE, "JKS");
-    properties.put(SSL_TRUSTSTORE, getSingleKeyKeystore());
-    properties.put(SSL_TRUSTSTORE_PASSWORD, "password");
-    properties.put(SSL_REQUIRE_AUTHENTICATION, "true");
-    properties.put(SSL_ENABLED_COMPONENTS, SecurableCommunicationChannel.LOCATOR.getConstant());
+    addIgnoredException("Unrecognized SSL message, plaintext connection");
+    addIgnoredException(LocatorCancelException.class);
+
+    Properties properties = new Properties();
+    properties.setProperty(DISABLE_AUTO_RECONNECT, "true");
+    properties.setProperty(ENABLE_CLUSTER_CONFIGURATION, "false");
+    properties.setProperty(ENABLE_NETWORK_PARTITION_DETECTION, "false");
+    properties.setProperty(MEMBER_TIMEOUT, "2000");
+    properties.setProperty(USE_CLUSTER_CONFIGURATION, "false");
+    properties.setProperty(SSL_CIPHERS, "any");
+    properties.setProperty(SSL_ENABLED_COMPONENTS, LOCATOR.getConstant());
+    properties.setProperty(SSL_KEYSTORE, getSingleKeyKeystore());
+    properties.setProperty(SSL_KEYSTORE_PASSWORD, "password");
+    properties.setProperty(SSL_KEYSTORE_TYPE, "JKS");
+    properties.setProperty(SSL_PROTOCOLS, "any");
+    properties.setProperty(SSL_REQUIRE_AUTHENTICATION, "true");
+    properties.setProperty(SSL_TRUSTSTORE, getSingleKeyKeystore());
+    properties.setProperty(SSL_TRUSTSTORE_PASSWORD, "password");
 
     // we set port1 so that the state file gets cleaned up later.
-    port1 = startLocatorGetPort(loc1, properties, 0);
+    port1 = startLocatorGetPort(vm1, properties, 0);
 
-    loc1.invoke("expect only one member in system",
+    vm1.invoke("expect only one member in system",
         () -> expectSystemToContainThisManyMembers(1));
 
+    properties.setProperty(LOCATORS, hostName + "[" + port1 + "]");
     properties.remove(SSL_ENABLED_COMPONENTS);
-    properties.put(LOCATORS, hostname + "[" + port1 + "]");
 
     // we set port2 so that the state file gets cleaned up later.
-    loc2.invoke(() -> {
+    vm2.invoke(() -> {
       assertThatThrownBy(() -> startLocatorBase(properties, 0))
           .isInstanceOfAny(LocatorCancelException.class, SystemConnectException.class);
 
       assertThat(Locator.getLocator()).isNull();
     });
 
-    loc1.invoke("expect only one member in system",
+    vm1.invoke("expect only one member in system",
         () -> expectSystemToContainThisManyMembers(1));
 
-    loc1.invoke("stop locator", LocatorDUnitTest::stopLocator);
+    vm1.invoke("stop locator", LocatorDUnitTest::stopLocator);
   }
 
   @Test
   public void testSSLEnabledLocatorDiesWhenConnectingToNonSSLLocator() {
-    IgnoredException.addIgnoredException("Remote host closed connection during handshake");
-    IgnoredException.addIgnoredException("Unrecognized SSL message, plaintext connection");
-    IgnoredException.addIgnoredException("LocatorCancelException");
-
-    VM loc1 = VM.getVM(1);
-    VM loc2 = VM.getVM(2);
+    addIgnoredException("Remote host closed connection during handshake");
+    addIgnoredException("Unrecognized SSL message, plaintext connection");
+    addIgnoredException("LocatorCancelException");
 
-    final String hostname = NetworkUtils.getServerHostName();
-    final Properties properties = getClusterProperties("", "false");
+    Properties properties = getClusterProperties("", "false");
     properties.remove(LOCATORS);
-    properties.put(SSL_CIPHERS, "any");
-    properties.put(SSL_PROTOCOLS, "any");
+    properties.setProperty(SSL_CIPHERS, "any");
+    properties.setProperty(SSL_PROTOCOLS, "any");
 
     // we set port1 so that the state file gets cleaned up later.
-    port1 = startLocatorGetPort(loc1, properties, 0);
-    loc1.invoke("expectSystemToContainThisManyMembers",
+    port1 = startLocatorGetPort(vm1, properties, 0);
+    vm1.invoke("expectSystemToContainThisManyMembers",
         () -> expectSystemToContainThisManyMembers(1));
 
-    properties.put(SSL_KEYSTORE, getSingleKeyKeystore());
-    properties.put(SSL_KEYSTORE_PASSWORD, "password");
-    properties.put(SSL_KEYSTORE_TYPE, "JKS");
-    properties.put(SSL_TRUSTSTORE, getSingleKeyKeystore());
-    properties.put(SSL_TRUSTSTORE_PASSWORD, "password");
-    properties.put(SSL_REQUIRE_AUTHENTICATION, "true");
-    properties.put(USE_CLUSTER_CONFIGURATION, "false");
-    properties.put(ENABLE_CLUSTER_CONFIGURATION, "false");
-    properties.put(SSL_ENABLED_COMPONENTS, SecurableCommunicationChannel.LOCATOR.getConstant());
+    properties.setProperty(ENABLE_CLUSTER_CONFIGURATION, "false");
+    properties.setProperty(SSL_KEYSTORE, getSingleKeyKeystore());
+    properties.setProperty(SSL_KEYSTORE_PASSWORD, "password");
+    properties.setProperty(SSL_KEYSTORE_TYPE, "JKS");
+    properties.setProperty(SSL_REQUIRE_AUTHENTICATION, "true");
+    properties.setProperty(SSL_TRUSTSTORE, getSingleKeyKeystore());
+    properties.setProperty(SSL_TRUSTSTORE_PASSWORD, "password");
+    properties.setProperty(SSL_ENABLED_COMPONENTS, LOCATOR.getConstant());
+    properties.setProperty(USE_CLUSTER_CONFIGURATION, "false");
 
-    final String locators = hostname + "[" + port1 + "]";
-    properties.put(LOCATORS, locators);
+    String locators = hostName + "[" + port1 + "]";
 
+    properties.setProperty(LOCATORS, locators);
 
     // we set port2 so that the state file gets cleaned up later.
-    assertThatThrownBy(() -> startLocatorGetPort(loc2, properties, 0))
+    assertThatThrownBy(() -> startLocatorGetPort(vm2, properties, 0))
         .isInstanceOfAny(LocatorCancelException.class, RMIException.class);
     assertThat(Locator.getLocator()).isNull();
 
-    loc1.invoke("expectSystemToContainThisManyMembers",
+    vm1.invoke("expectSystemToContainThisManyMembers",
         () -> expectSystemToContainThisManyMembers(1));
 
-    loc1.invoke("stop locator", LocatorDUnitTest::stopLocator);
+    vm1.invoke("stop locator", LocatorDUnitTest::stopLocator);
   }
 
   @Test
   public void testStartTwoLocatorsWithDifferentSSLCertificates() {
-    IgnoredException.addIgnoredException("Remote host closed connection during handshake");
-    IgnoredException
-        .addIgnoredException("unable to find valid certification path to requested target");
-    IgnoredException.addIgnoredException("Received fatal alert: certificate_unknown");
-    IgnoredException.addIgnoredException("LocatorCancelException");
-    IgnoredException.addIgnoredException("Unrecognized SSL message, plaintext connection");
-
-    VM loc1 = VM.getVM(1);
-    VM loc2 = VM.getVM(2);
-
-    int ports[] = AvailablePortHelper.getRandomAvailableTCPPorts(2);
-    final int port1 = ports[0];
-    this.port1 = port1;
-    final int port2 = ports[1];
-    this.port2 = port2; // for cleanup in tearDown2
-    DistributedTestUtils.deleteLocatorStateFile(port1);
-    DistributedTestUtils.deleteLocatorStateFile(port2);
-    final String host0 = NetworkUtils.getServerHostName();
-    final String locators = host0 + "[" + port1 + "]," + host0 + "[" + port2 + "]";
-    final Properties properties = getClusterProperties(locators, "false");
-    properties.put(SSL_CIPHERS, "any");
-    properties.put(SSL_PROTOCOLS, "any");
-    properties.put(SSL_KEYSTORE, getSingleKeyKeystore());
-    properties.put(SSL_KEYSTORE_PASSWORD, "password");
-    properties.put(SSL_KEYSTORE_TYPE, "JKS");
-    properties.put(SSL_TRUSTSTORE, getSingleKeyKeystore());
-    properties.put(SSL_TRUSTSTORE_PASSWORD, "password");
-    properties.put(SSL_REQUIRE_AUTHENTICATION, "true");
-    properties.put(SSL_ENABLED_COMPONENTS, SecurableCommunicationChannel.LOCATOR.getConstant());
-
-    try {
-      startLocator(loc1, properties, port1);
-      loc1.invoke("expectSystemToContainThisManyMembers",
-          () -> expectSystemToContainThisManyMembers(1));
-
-      properties.put(SSL_KEYSTORE, getMultiKeyKeystore());
-      properties.put(SSL_TRUSTSTORE, getMultiKeyTruststore());
-      properties.put(SSL_LOCATOR_ALIAS, "locatorkey");
-
-      assertThatThrownBy(() -> startLocator(loc2, properties, port2))
-          .isInstanceOfAny(LocatorCancelException.class, RMIException.class);
-      assertThat(Locator.getLocator()).isNull();
+    addIgnoredException("Remote host closed connection during handshake");
+    addIgnoredException("unable to find valid certification path to requested target");
+    addIgnoredException("Received fatal alert: certificate_unknown");
+    addIgnoredException("LocatorCancelException");
+    addIgnoredException("Unrecognized SSL message, plaintext connection");
+
+    String locators = hostName + "[" + port1 + "]," + hostName + "[" + port2 + "]";
+
+    Properties properties = getClusterProperties(locators, "false");
+    properties.setProperty(SSL_CIPHERS, "any");
+    properties.setProperty(SSL_ENABLED_COMPONENTS, LOCATOR.getConstant());
+    properties.setProperty(SSL_KEYSTORE, getSingleKeyKeystore());
+    properties.setProperty(SSL_KEYSTORE_PASSWORD, "password");
+    properties.setProperty(SSL_KEYSTORE_TYPE, "JKS");
+    properties.setProperty(SSL_PROTOCOLS, "any");
+    properties.setProperty(SSL_REQUIRE_AUTHENTICATION, "true");
+    properties.setProperty(SSL_TRUSTSTORE, getSingleKeyKeystore());
+    properties.setProperty(SSL_TRUSTSTORE_PASSWORD, "password");
+
+    startLocator(vm1, properties, port1);
+
+    vm1.invoke("expectSystemToContainThisManyMembers",
+        () -> expectSystemToContainThisManyMembers(1));
 
+    properties.setProperty(SSL_KEYSTORE, getMultiKeyKeystore());
+    properties.setProperty(SSL_LOCATOR_ALIAS, "locatorkey");
+    properties.setProperty(SSL_TRUSTSTORE, getMultiKeyTruststore());
 
+    assertThatThrownBy(() -> startLocator(vm2, properties, port2))
+        .isInstanceOfAny(LocatorCancelException.class, RMIException.class);
+    assertThat(Locator.getLocator()).isNull();
 
-    } finally {
-      try {
-        loc1.invoke("expectSystemToContainThisManyMembers",
-            () -> expectSystemToContainThisManyMembers(1));
-      } finally {
-        loc1.invoke("stop locator", LocatorDUnitTest::stopLocator);
-      }
-    }
+    vm1.invoke("expectSystemToContainThisManyMembers",
+        () -> expectSystemToContainThisManyMembers(1));
   }
 
   /**
@@ -533,70 +516,56 @@ public class LocatorDUnitTest implements java.io.Serializable {
    */
   @Test
   public void testLeadMemberSelection() throws Exception {
-    VM vm1 = VM.getVM(1);
-    VM vm2 = VM.getVM(2);
-    VM vm3 = VM.getVM(3);
-
-    port1 = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
-    DistributedTestUtils.deleteLocatorStateFile(port1);
-    final String locators = NetworkUtils.getServerHostName() + "[" + port1 + "]";
-    final Properties properties = getBasicProperties(locators);
-    properties.put(ENABLE_NETWORK_PARTITION_DETECTION, "true");
-    properties.put(DISABLE_AUTO_RECONNECT, "true");
+    String locators = hostName + "[" + port1 + "]";
 
+    Properties properties = getBasicProperties(locators);
+    properties.setProperty(DISABLE_AUTO_RECONNECT, "true");
+    properties.setProperty(ENABLE_NETWORK_PARTITION_DETECTION, "true");
     addDSProps(properties);
-    File logFile = new File("");
-    if (logFile.exists()) {
-      assertThat(logFile.delete()).isTrue();
-    }
-    Locator locator = Locator.startLocatorAndDS(port1, logFile, properties);
-    try {
-      system = (InternalDistributedSystem) locator.getDistributedSystem();
 
-      assertThat(MembershipManagerHelper.getLeadMember(system)).isNull();
+    Locator locator = Locator.startLocatorAndDS(port1, null, properties);
 
-      // connect three vms and then watch the lead member selection as they
-      // are disconnected/reconnected
-      properties.put("name", "vm1");
+    system = (InternalDistributedSystem) locator.getDistributedSystem();
 
-      DistributedMember mem1 = vm1.invoke(() -> getDistributedMember(properties));
+    assertThat(MembershipManagerHelper.getLeadMember(system)).isNull();
 
-      waitForMemberToBecomeLeadMemberOfDistributedSystem(mem1, system);
+    // connect three vms and then watch the lead member selection as they
+    // are disconnected/reconnected
+    properties.setProperty("name", "vm1");
 
-      properties.put("name", "vm2");
-      DistributedMember mem2 = vm2.invoke(() -> getDistributedMember(properties));
-      waitForMemberToBecomeLeadMemberOfDistributedSystem(mem1, system);
+    DistributedMember mem1 = vm1.invoke(() -> getDistributedMember(properties));
 
-      properties.put("name", "vm3");
-      DistributedMember mem3 = vm3.invoke(() -> getDistributedMember(properties));
-      waitForMemberToBecomeLeadMemberOfDistributedSystem(mem1, system);
+    waitForMemberToBecomeLeadMemberOfDistributedSystem(mem1, system);
 
-      // after disconnecting the first vm, the second one should become the leader
-      vm1.invoke(LocatorDUnitTest::disconnectDistributedSystem);
-      MembershipManagerHelper.getMembershipManager(system).waitForDeparture(mem1);
-      waitForMemberToBecomeLeadMemberOfDistributedSystem(mem2, system);
+    properties.setProperty("name", "vm2");
+    DistributedMember mem2 = vm2.invoke(() -> getDistributedMember(properties));
+    waitForMemberToBecomeLeadMemberOfDistributedSystem(mem1, system);
 
-      properties.put("name", "vm1");
-      mem1 = vm1.invoke(() -> getDistributedMember(properties));
-      waitForMemberToBecomeLeadMemberOfDistributedSystem(mem2, system);
+    properties.setProperty("name", "vm3");
+    DistributedMember mem3 = vm3.invoke(() -> getDistributedMember(properties));
+    waitForMemberToBecomeLeadMemberOfDistributedSystem(mem1, system);
 
-      vm2.invoke(LocatorDUnitTest::disconnectDistributedSystem);
-      MembershipManagerHelper.getMembershipManager(system).waitForDeparture(mem2);
-      waitForMemberToBecomeLeadMemberOfDistributedSystem(mem3, system);
+    // after disconnecting the first vm, the second one should become the leader
+    vm1.invoke(LocatorDUnitTest::disconnectDistributedSystem);
+    MembershipManagerHelper.getMembershipManager(system).waitForDeparture(mem1);
+    waitForMemberToBecomeLeadMemberOfDistributedSystem(mem2, system);
 
-      vm1.invoke(LocatorDUnitTest::disconnectDistributedSystem);
-      MembershipManagerHelper.getMembershipManager(system).waitForDeparture(mem1);
-      waitForMemberToBecomeLeadMemberOfDistributedSystem(mem3, system);
+    properties.setProperty("name", "vm1");
+    mem1 = vm1.invoke(() -> getDistributedMember(properties));
+    waitForMemberToBecomeLeadMemberOfDistributedSystem(mem2, system);
 
-      vm3.invoke(LocatorDUnitTest::disconnectDistributedSystem);
-      MembershipManagerHelper.getMembershipManager(system).waitForDeparture(mem3);
-      waitForMemberToBecomeLeadMemberOfDistributedSystem(null, system);
+    vm2.invoke(LocatorDUnitTest::disconnectDistributedSystem);
+    MembershipManagerHelper.getMembershipManager(system).waitForDeparture(mem2);
+    waitForMemberToBecomeLeadMemberOfDistributedSystem(mem3, system);
 
-    } finally {
-      locator.stop();
-    }
-  }
+    vm1.invoke(LocatorDUnitTest::disconnectDistributedSystem);
+    MembershipManagerHelper.getMembershipManager(system).waitForDeparture(mem1);
+    waitForMemberToBecomeLeadMemberOfDistributedSystem(mem3, system);
 
+    vm3.invoke(LocatorDUnitTest::disconnectDistributedSystem);
+    MembershipManagerHelper.getMembershipManager(system).waitForDeparture(mem3);
+    waitForMemberToBecomeLeadMemberOfDistributedSystem(null, system);
+  }
 
   /**
    * test lead member and coordinator failure with network partition detection enabled. It would be
@@ -615,98 +584,70 @@ public class LocatorDUnitTest implements java.io.Serializable {
    */
   @Test
   public void testLeadAndCoordFailure() throws Exception {
-    IgnoredException.addIgnoredException("Possible loss of quorum due");
-
-    VM vm1 = VM.getVM(1);
-    VM vm2 = VM.getVM(2);
-    VM locatorVM = VM.getVM(3);
-    Locator locator = null;
-
-    int ports[] = AvailablePortHelper.getRandomAvailableTCPPorts(2);
-    final int port1 = ports[0];
-    this.port1 = port1;
-    final int port2 = ports[1];
-    DistributedTestUtils.deleteLocatorStateFile(port1, port2);
-    final String host0 = NetworkUtils.getServerHostName();
-    final String locators = host0 + "[" + port1 + "]," + host0 + "[" + port2 + "]";
-    final Properties properties = getClusterProperties(locators, "true");
+    addIgnoredException("Possible loss of quorum due");
 
+    String locators = hostName + "[" + port1 + "]," + hostName + "[" + port2 + "]";
+
+    Properties properties = getClusterProperties(locators, "true");
     addDSProps(properties);
-    try {
-      File logFile = new File("");
-      locator = Locator.startLocatorAndDS(port1, logFile, properties);
-      system = (InternalDistributedSystem) locator.getDistributedSystem();
-      system.getLogWriter()
-          .info("<ExpectedException action=add>java.net.ConnectException</ExpectedException>");
-      MembershipManagerHelper.inhibitForcedDisconnectLogging(true);
-      startLocator(locatorVM, properties, port2);
 
-      assertThat(MembershipManagerHelper.getLeadMember(system)).isNull();
+    Locator locator = Locator.startLocatorAndDS(port1, null, properties);
+    system = (InternalDistributedSystem) locator.getDistributedSystem();
 
-      // properties.put("log-level", getDUnitLogLevel());
+    addIgnoredException(ConnectException.class);
+    MembershipManagerHelper.inhibitForcedDisconnectLogging(true);
+    startLocator(vm3, properties, port2);
 
-      DistributedMember mem1 = vm1.invoke(() -> getDistributedMember(properties));
-      vm2.invoke(() -> getDistributedMember(properties));
-      waitForMemberToBecomeLeadMemberOfDistributedSystem(mem1, system);
+    assertThat(MembershipManagerHelper.getLeadMember(system)).isNull();
 
-      assertThat(system.getDistributedMember())
-          .isEqualTo(MembershipManagerHelper.getCoordinator(system));
+    DistributedMember mem1 = vm1.invoke(() -> getDistributedMember(properties));
+    vm2.invoke(() -> getDistributedMember(properties));
+    waitForMemberToBecomeLeadMemberOfDistributedSystem(mem1, system);
 
-      // crash the second vm and the locator. Should be okay
-      DistributedTestUtils.crashDistributedSystem(vm2);
-      locatorVM.invoke(() -> {
-        Locator loc = Locator.getLocator();
-        MembershipManagerHelper.crashDistributedSystem(loc.getDistributedSystem());
-        loc.stop();
-      });
+    assertThat(system.getDistributedMember())
+        .isEqualTo(MembershipManagerHelper.getCoordinator(system));
 
-      assertThat(vm1.invoke(LocatorDUnitTest::isSystemConnected))
-          .describedAs("Distributed system should not have disconnected").isTrue();
+    // crash the second vm and the locator. Should be okay
+    DistributedTestUtils.crashDistributedSystem(vm2);
+    vm3.invoke(() -> {
+      Locator loc = Locator.getLocator();
+      MembershipManagerHelper.crashDistributedSystem(loc.getDistributedSystem());
+      loc.stop();
+    });
 
-      // ensure quorumLost is properly invoked
-      ClusterDistributionManager dm =
-          (ClusterDistributionManager) ((InternalDistributedSystem) system)
-              .getDistributionManager();
-      MyMembershipListener listener = new MyMembershipListener();
-      dm.addMembershipListener(listener);
-      // ensure there is an unordered reader thread for the member
-      new HighPriorityAckedMessage().send(Collections.singleton(mem1), false);
+    assertThat(vm1.invoke(LocatorDUnitTest::isSystemConnected))
+        .describedAs("Distributed system should not have disconnected").isTrue();
 
-      // disconnect the first vm and demonstrate that the third vm and the
-      // locator notice the failure and exit
-      DistributedTestUtils.crashDistributedSystem(vm1);
+    // ensure quorumLost is properly invoked
+    DistributionManager dm = system.getDistributionManager();
+    MyMembershipListener listener = new MyMembershipListener();
+    dm.addMembershipListener(listener);
+    // ensure there is an unordered reader thread for the member
+    new HighPriorityAckedMessage().send(Collections.singleton(mem1), false);
 
-      /*
-       * This vm is watching vm1, which is watching vm2 which is watching locatorVM. It will take 3
-       * * (3
-       * * member-timeout) milliseconds to detect the full failure and eject the lost members from
-       * the view.
-       */
+    // disconnect the first vm and demonstrate that the third vm and the
+    // locator notice the failure and exit
+    DistributedTestUtils.crashDistributedSystem(vm1);
 
-      logger.info("waiting for my distributed system to disconnect due to partition detection");
+    /*
+     * This vm is watching vm1, which is watching vm2 which is watching locatorVM. It will take 3
+     * (3 member-timeout) milliseconds to detect the full failure and eject the lost members from
+     * the view.
+     */
 
-      await().until(() -> !system.isConnected());
+    logger.info("waiting for my distributed system to disconnect due to partition detection");
 
-      if (system.isConnected()) {
-        fail(
-            "Distributed system did not disconnect as expected - network partition detection is broken");
-      }
-      // quorumLost should be invoked if we get a ForcedDisconnect in this situation
-      assertThat(listener.quorumLostInvoked).describedAs("expected quorumLost to be invoked")
-          .isTrue();
-      assertThat(listener.suspectReasons.contains(Connection.INITIATING_SUSPECT_PROCESSING))
-          .describedAs("expected suspect processing initiated by TCPConduit").isTrue();
-    } finally {
-      if (locator != null) {
-        locator.stop();
-      }
-      LogWriter bLogger = new LocalLogWriter(ALL.intLevel(), System.out);
-      bLogger.info("<ExpectedException action=remove>service failure</ExpectedException>");
-      bLogger
-          .info("<ExpectedException action=remove>java.net.ConnectException</ExpectedException>");
-      bLogger.info(
-          "<ExpectedException action=remove>org.apache.geode.ForcedDisconnectException</ExpectedException>");
+    await().until(() -> !system.isConnected());
+
+    if (system.isConnected()) {
+      fail(
+          "Distributed system did not disconnect as expected - network partition detection is broken");
     }
+    // quorumLost should be invoked if we get a ForcedDisconnect in this situation
+    assertThat(listener.quorumLostInvoked).describedAs("expected quorumLost to be invoked")
+        .isTrue();
+    assertThat(listener.suspectReasons.contains(Connection.INITIATING_SUSPECT_PROCESSING))
+        .describedAs("expected suspect processing initiated by TCPConduit").isTrue();
   }
 
   /**
@@ -722,96 +663,61 @@ public class LocatorDUnitTest implements java.io.Serializable {
    */
   @Test
   public void testLeadFailureAndCoordShutdown() throws Exception {
-    VM vm1 = VM.getVM(1);
-    VM vm2 = VM.getVM(2);
-    VM locatorVM = VM.getVM(3);
-    Locator locator = null;
-
-    final int[] ports = AvailablePortHelper.getRandomAvailableTCPPorts(2);
-    final int port1 = ports[0];
-    this.port1 = port1;
-    final int port2 = ports[1];
-    this.port2 = port2;
-    DistributedTestUtils.deleteLocatorStateFile(port1, port2);
-    final String host0 = NetworkUtils.getServerHostName();
-    final String locators = host0 + "[" + port1 + "]," + host0 + "[" + port2 + "]";
-    final Properties properties = getClusterProperties(locators, "true");
+    String locators = hostName + "[" + port1 + "]," + hostName + "[" + port2 + "]";
 
+    Properties properties = getClusterProperties(locators, "true");
     addDSProps(properties);
 
-    try {
-      File logFile = new File("");
-      locator = Locator.startLocatorAndDS(port1, logFile, properties);
-      system = (InternalDistributedSystem) locator.getDistributedSystem();
-      locatorVM.invoke(() -> {
-        File lf = new File("");
-        try {
-          Locator loc = Locator.startLocatorAndDS(port2, lf, properties);
-          system = (InternalDistributedSystem) loc.getDistributedSystem();
-          MembershipManagerHelper.inhibitForcedDisconnectLogging(true);
-        } catch (IOException ios) {
-          throw new RuntimeException("Unable to start locator2", ios);
-        }
-      });
-
-      assertThat(MembershipManagerHelper.getLeadMember(system)).isNull();
+    Locator locator = Locator.startLocatorAndDS(port1, null, properties);
+    system = (InternalDistributedSystem) locator.getDistributedSystem();
 
-      DistributedMember mem1 = vm1.invoke(() -> getDistributedMember(properties));
-      DistributedMember mem2 = vm2.invoke(() -> getDistributedMember(properties));
+    vm3.invoke(() -> {
+      Locator loc = Locator.startLocatorAndDS(port2, null, properties);
+      system = (InternalDistributedSystem) loc.getDistributedSystem();
+      MembershipManagerHelper.inhibitForcedDisconnectLogging(true);
+    });
 
-      assertThat(mem1).isEqualTo(MembershipManagerHelper.getLeadMember(system));
+    assertThat(MembershipManagerHelper.getLeadMember(system)).isNull();
 
-      assertThat(system.getDistributedMember())
-          .isEqualTo(MembershipManagerHelper.getCoordinator(system));
+    DistributedMember mem1 = vm1.invoke(() -> getDistributedMember(properties));
+    DistributedMember mem2 = vm2.invoke(() -> getDistributedMember(properties));
 
-      MembershipManagerHelper.inhibitForcedDisconnectLogging(true);
+    assertThat(mem1).isEqualTo(MembershipManagerHelper.getLeadMember(system));
 
-      // crash the lead vm. Should be okay
-      vm1.invoke(() -> {
-        LogWriter logWriter = LocatorDUnitTest.system.getLogWriter();
-        assertThat(logWriter).isNotNull();
-        logWriter
-            .info("<ExpectedException action=add>service failure</ExpectedException>");
-        logWriter.info(
-            "<ExpectedException action=add>org.apache.geode.ConnectException</ExpectedException>");
-        logWriter.info(
-            "<ExpectedException action=add>org.apache.geode.ForcedDisconnectException</ExpectedException>");
-        MembershipManagerHelper.crashDistributedSystem(LocatorDUnitTest.system);
-      });
-
-      waitUntilTheSystemIsConnected(vm2, locatorVM);
-      // stop the locator normally. This should also be okay
-      locator.stop();
+    assertThat(system.getDistributedMember())
+        .isEqualTo(MembershipManagerHelper.getCoordinator(system));
 
-      await()
-          .until(() -> {
-            assertThat(Locator.getLocator()).describedAs("locator is not stopped").isNull();
-            return true;
-          });
+    MembershipManagerHelper.inhibitForcedDisconnectLogging(true);
 
-      checkSystemConnectedInVMs(vm2, locatorVM);
+    // crash the lead vm. Should be okay
+    vm1.invoke(() -> {
+      addIgnoredException("service failure");
+      addIgnoredException(ForcedDisconnectException.class);
+      MembershipManagerHelper.crashDistributedSystem(system);
+    });
 
-      // the remaining non-locator member should now be the lead member
-      assertEquals(
-          "This test sometimes fails.  If the log contains "
-              + "'failed to collect all ACKs' it is a false failure.",
-          mem2, vm2.invoke(LocatorDUnitTest::getLeadMember));
+    waitUntilTheSystemIsConnected(vm2, vm3);
+    // stop the locator normally. This should also be okay
+    locator.stop();
 
-      // disconnect the first vm and demonstrate that the third vm and the
-      // locator notice the failure and exit
-      vm2.invoke(LocatorDUnitTest::disconnectDistributedSystem);
-      locatorVM.invoke(LocatorDUnitTest::stopLocator);
-    } finally {
-      MembershipManagerHelper.inhibitForcedDisconnectLogging(false);
-      if (locator != null) {
-        locator.stop();
-      }
-      try {
-        locatorVM.invoke(LocatorDUnitTest::stopLocator);
-      } catch (Exception e) {
-        logger.error("failed to stop locator in vm 3", e);
-      }
-    }
+    await()
+        .until(() -> {
+          assertThat(Locator.getLocator()).describedAs("locator is not stopped").isNull();
+          return true;
+        });
+
+    checkSystemConnectedInVMs(vm2, vm3);
+
+    // the remaining non-locator member should now be the lead member
+    assertEquals(
+        "This test sometimes fails.  If the log contains "
+            + "'failed to collect all ACKs' it is a false failure.",
+        mem2, vm2.invoke(LocatorDUnitTest::getLeadMember));
+
+    // disconnect the first vm and demonstrate that the third vm and the
+    // locator notice the failure and exit
+    vm2.invoke(LocatorDUnitTest::disconnectDistributedSystem);
+    vm3.invoke(LocatorDUnitTest::stopLocator);
   }
 
   /**
@@ -825,128 +731,84 @@ public class LocatorDUnitTest implements java.io.Serializable {
    * We then shut down the group coordinator and observe the second locator pick up the job and the
    * remaining member continues to operate normally.
    */
-  // disabled on trunk - should be re-enabled on cedar_dev_Oct12
-  // this test leaves a CloserThread around forever that logs "pausing" messages every 500 ms
   @Test
   public void testForceDisconnectAndPeerShutdownCause() throws Exception {
-    Host host = Host.getHost(0);
-    VM vm1 = VM.getVM(1);
-    VM vm2 = VM.getVM(2);
-    VM locvm = VM.getVM(3);
-    Locator locator = null;
-
-    int ports[] = AvailablePortHelper.getRandomAvailableTCPPorts(2);
-    final int port1 = ports[0];
-    this.port1 = port1;
-    final int port2 = ports[1];
-    DistributedTestUtils.deleteLocatorStateFile(port1, port2);
-    final String host0 = NetworkUtils.getServerHostName(host);
-    final String locators = host0 + "[" + port1 + "]," + host0 + "[" + port2 + "]";
-
-    final Properties properties = new Properties();
-    properties.put(MCAST_PORT, "0");
-    properties.put(LOCATORS, locators);
-    properties.put(ENABLE_NETWORK_PARTITION_DETECTION, "true");
-    properties.put(DISABLE_AUTO_RECONNECT, "true");
-    properties.put(MEMBER_TIMEOUT, "2000");
-    properties.put(LOG_LEVEL, LogWriterUtils.getDUnitLogLevel());
-
+    String locators = hostName + "[" + port1 + "]," + hostName + "[" + port2 + "]";
+
+    Properties properties = new Properties();
+    properties.setProperty(MCAST_PORT, "0");
+    properties.setProperty(LOCATORS, locators);
+    properties.setProperty(ENABLE_NETWORK_PARTITION_DETECTION, "true");
+    properties.setProperty(DISABLE_AUTO_RECONNECT, "true");
+    properties.setProperty(MEMBER_TIMEOUT, "2000");
     addDSProps(properties);
 
-    try {
-      final String uname = "testForceDisconnectAndPeerShutdownCause";
-      File logFile = new File("");
-      locator = Locator.startLocatorAndDS(port1, logFile, properties);
-      system = (InternalDistributedSystem) locator.getDistributedSystem();
-      locvm.invoke(() -> {
-        File lf = new File("");
-        try {
-          Locator loc = Locator.startLocatorAndDS(port2, lf, properties);
-          system = (InternalDistributedSystem) loc.getDistributedSystem();
-        } catch (IOException ios) {
-          throw new RuntimeException("Unable to start locator2", ios);
-        }
-      });
+    Locator locator = Locator.startLocatorAndDS(port1, null, properties);
+    system = (InternalDistributedSystem) locator.getDistributedSystem();
 
-      SerializableRunnable crashSystem = new SerializableRunnable("Crash system") {
-        @Override
-        public void run() {
-          DistributedSystem msys = LocatorDUnitTest.system;
-          msys.getLogWriter()
-              .info("<ExpectedException action=add>service failure</ExpectedException>");
-          msys.getLogWriter().info(
-              "<ExpectedException action=add>org.apache.geode.ConnectException</ExpectedException>");
-          msys.getLogWriter().info(
-              "<ExpectedException action=add>org.apache.geode.ForcedDisconnectException</ExpectedException>");
-          msys.getLogWriter()
-              .info("<ExpectedException action=add>Possible loss of quorum</ExpectedException>");
-          hook = new TestHook();
-          MembershipManagerHelper.getMembershipManager(msys).registerTestHook(hook);
-          try {
-            MembershipManagerHelper.crashDistributedSystem(msys);
-          } finally {
-            hook.reset();
-          }
-        }
-      };
+    vm3.invoke(() -> {
+      Locator loc = Locator.startLocatorAndDS(port2, null, properties);
+      system = (InternalDistributedSystem) loc.getDistributedSystem();
+    });
 
-      assertNull(MembershipManagerHelper.getLeadMember(system));
+    SerializableRunnable crashSystem = new SerializableRunnable("Crash system") {
+      @Override
+      public void run() {
+        addIgnoredException("service failure");
+        addIgnoredException("Possible loss of quorum");
+        addIgnoredException(ForcedDisconnectException.class);
 
-      final DistributedMember mem1 = vm1.invoke(() -> getDistributedMember(properties));
-      final DistributedMember mem2 = vm2.invoke(() -> getDistributedMember(properties));
+        hook = new TestHook();
+        MembershipManagerHelper.getMembershipManager(system).registerTestHook(hook);
+        try {
+          MembershipManagerHelper.crashDistributedSystem(system);
+        } finally {
+          hook.reset();
+        }
+      }
+    };
 
-      assertEquals(mem1, MembershipManagerHelper.getLeadMember(system));
+    assertNull(MembershipManagerHelper.getLeadMember(system));
 
-      assertEquals(system.getDistributedMember(), MembershipManagerHelper.getCoordinator(system));
+    DistributedMember mem1 = vm1.invoke(() -> getDistributedMember(properties));
+    DistributedMember mem2 = vm2.invoke(() -> getDistributedMember(properties));
 
-      assertTrue("Distributed system should not have disconnected", isSystemConnected());
+    assertEquals(mem1, MembershipManagerHelper.getLeadMember(system));
 
-      assertTrue("Distributed system should not have disconnected",
-          vm2.invoke(() -> LocatorDUnitTest.isSystemConnected()));
+    assertEquals(system.getDistributedMember(), MembershipManagerHelper.getCoordinator(system));
 
-      assertTrue("Distributed system should not have disconnected",
-          locvm.invoke(() -> LocatorDUnitTest.isSystemConnected()));
+    assertTrue("Distributed system should not have disconnected", isSystemConnected());
 
-      vm2.invokeAsync(crashSystem);
+    assertTrue("Distributed system should not have disconnected",
+        vm2.invoke(() -> isSystemConnected()));
 
-      Wait.pause(1000); // 4 x the member-timeout
+    assertTrue("Distributed system should not have disconnected",
+        vm3.invoke(() -> isSystemConnected()));
 
+    vm2.invokeAsync(crashSystem);
 
-      // request member removal for first peer from second peer.
-      vm2.invoke(new SerializableRunnable("Request Member Removal") {
+    Wait.pause(1000); // 4 x the member-timeout
 
-        @Override
-        public void run() {
-          DistributedSystem msys = LocatorDUnitTest.system;
-          MembershipManager mmgr = MembershipManagerHelper.getMembershipManager(msys);
+    // request member removal for first peer from second peer.
+    vm2.invoke(new SerializableRunnable("Request Member Removal") {
 
-          // check for shutdown cause in MembershipManager. Following call should
-          // throw DistributedSystemDisconnectedException which should have cause as
-          // ForceDisconnectException.
-          try {
-            msys.getLogWriter().info(
-                "<ExpectedException action=add>Membership: requesting removal of </ExpectedException>");
-            mmgr.requestMemberRemoval(mem1, "test reasons");
-            msys.getLogWriter().info(
-                "<ExpectedException action=remove>Membership: requesting removal of </ExpectedException>");
-            fail("It should have thrown exception in requestMemberRemoval");
-          } catch (DistributedSystemDisconnectedException e) {
-            Throwable cause = e.getCause();
-            assertTrue("This should have been ForceDisconnectException but found " + cause,
-                cause instanceof ForcedDisconnectException);
-          } finally {
-            hook.reset();
-          }
+      @Override
+      public void run() {
+        MembershipManager mmgr = MembershipManagerHelper.getMembershipManager(system);
+
+        // check for shutdown cause in MembershipManager. Following call should
+        // throw DistributedSystemDisconnectedException which should have cause as
+        // ForceDisconnectException.
+        try (IgnoredException i = addIgnoredException("Membership: requesting removal of")) {
+          mmgr.requestMemberRemoval(mem1, "test reasons");
+          fail("It should have thrown exception in requestMemberRemoval");
+        } catch (DistributedSystemDisconnectedException e) {
+          assertThat(e).hasRootCauseInstanceOf(ForcedDisconnectException.class);
+        } finally {
+          hook.reset();
         }
-      });
-
-    } finally {
-      if (locator != null) {
-        locator.stop();
       }
-      locvm.invoke(() -> stopLocator());
-      assertTrue("locator is not stopped", Locator.getLocators().isEmpty());
-    }
+    });
   }
 
   /**
@@ -959,148 +821,110 @@ public class LocatorDUnitTest implements java.io.Serializable {
    */
   @Test
   public void testLeadShutdownAndCoordFailure() throws Exception {
-    VM memberThatWillBeShutdownVM = VM.getVM(1);
-    VM memberVM = VM.getVM(2);
-    VM locatorThatWillBeShutdownVM = VM.getVM(3);
-    Locator locator = null;
-    int ports[] = AvailablePortHelper.getRandomAvailableTCPPorts(2);
-    final int port1 = ports[0];
-    this.port1 = port1;
-    final int port2 = ports[1];
-    DistributedTestUtils.deleteLocatorStateFile(port1, port2);
-    final String host0 = NetworkUtils.getServerHostName();
-    final String locators = host0 + "[" + port1 + "]," + host0 + "[" + port2 + "]";
-    final Properties properties = getClusterProperties(locators, "true");
+    VM memberThatWillBeShutdownVM = vm1;
+    VM memberVM = vm2;
+    VM locatorThatWillBeShutdownVM = vm3;
 
-    addDSProps(properties);
-    try {
-      locatorThatWillBeShutdownVM.invoke(() -> {
-        Locator localLocator;
-        try {
-          localLocator = Locator.startLocatorAndDS(port2, new File(""), properties);
-          system = (InternalDistributedSystem) localLocator.getDistributedSystem();
-          assertThat(localLocator.getDistributedSystem().isConnected()).isTrue();
-        } catch (IOException ios) {
-          throw new RuntimeException("Unable to start locator1", ios);
-        }
-      });
+    String locators = hostName + "[" + port1 + "]," + hostName + "[" + port2 + "]";
 
-      // Test runner will be locator 2
-      locator = Locator.startLocatorAndDS(port1, new File(""), properties);
-      system = (InternalDistributedSystem) locator.getDistributedSystem();
-      assertThat(locator.getDistributedSystem().isConnected()).isTrue();
-      DistributedSystem testRunnerLocatorDS = locator.getDistributedSystem();
-      testRunnerLocatorDS.getLogWriter().info(
-          "<ExpectedException action=add>org.apache.geode.ForcedDisconnectException</ExpectedException>");
-      assertThat(MembershipManagerHelper.getLeadMember(testRunnerLocatorDS))
-          .describedAs("There was a lead member when there should not be.").isNull();
-
-      DistributedMember distributedMemberThatWillBeShutdown =
-          memberThatWillBeShutdownVM.invoke(() -> getDistributedMember(properties));
-      memberThatWillBeShutdownVM
-          .invoke(() -> MembershipManagerHelper.inhibitForcedDisconnectLogging(true));
-
-      DistributedMember distributedMember = memberVM.invoke(() -> getDistributedMember(properties));
-
-      DistributedMember locatorMemberToBeShutdown =
-          locatorThatWillBeShutdownVM.invoke(LocatorDUnitTest::getLocatorDistributedMember);
-
-      waitForMemberToBecomeLeadMemberOfDistributedSystem(distributedMemberThatWillBeShutdown,
-          testRunnerLocatorDS);
-      DistributedMember oldLeader = MembershipManagerHelper.getLeadMember(testRunnerLocatorDS);
-
-      assertThat(locatorMemberToBeShutdown)
-          .isEqualTo(MembershipManagerHelper.getCoordinator(testRunnerLocatorDS));
-      DistributedMember oldCoordinator =
-          MembershipManagerHelper.getCoordinator(testRunnerLocatorDS);
-
-      // crash the lead locator. Should be okay
-      locatorThatWillBeShutdownVM.invoke("crash locator", () -> {
-        Locator loc = Locator.getLocator();
-        DistributedSystem distributedSystem = loc.getDistributedSystem();
-        LogWriter logWriter = distributedSystem.getLogWriter();
-        assertThat(logWriter).isNotNull();
-        logWriter
-            .info("<ExpectedException action=add>service failure</ExpectedException>");
-        logWriter.info(
-            "<ExpectedException action=add>org.apache.geode.ForcedDisconnectException</ExpectedException>");
-        logWriter.info(
-            "<ExpectedException action=add>org.apache.geode.ConnectException</ExpectedException>");
-        MembershipManagerHelper.crashDistributedSystem(distributedSystem);
-        loc.stop();
-      });
+    Properties properties = getClusterProperties(locators, "true");
+    addDSProps(properties);
 
-      await().until(testRunnerLocatorDS::isConnected);
+    locatorThatWillBeShutdownVM.invoke(() -> {
+      Locator localLocator = Locator.startLocatorAndDS(port2, null, properties);
+      system = (InternalDistributedSystem) localLocator.getDistributedSystem();
+      assertThat(localLocator.getDistributedSystem().isConnected()).isTrue();
+    });
 
-      waitUntilTheSystemIsConnected(memberThatWillBeShutdownVM, memberVM);
+    // Test runner will be locator 2
+    Locator locator = Locator.startLocatorAndDS(port1, null, properties);
+    system = (InternalDistributedSystem) locator.getDistributedSystem();
+    assertThat(locator.getDistributedSystem().isConnected()).isTrue();
+    DistributedSystem testRunnerLocatorDS = locator.getDistributedSystem();
+    addIgnoredException(ForcedDisconnectException.class);
+    assertThat(MembershipManagerHelper.getLeadMember(testRunnerLocatorDS))
+        .describedAs("There was a lead member when there should not be.").isNull();
+
+    DistributedMember distributedMemberThatWillBeShutdown =
+        memberThatWillBeShutdownVM.invoke(() -> getDistributedMember(properties));
+    memberThatWillBeShutdownVM
+        .invoke(() -> MembershipManagerHelper.inhibitForcedDisconnectLogging(true));
+
+    DistributedMember distributedMember = memberVM.invoke(() -> getDistributedMember(properties));
+
+    DistributedMember locatorMemberToBeShutdown =
+        locatorThatWillBeShutdownVM.invoke(LocatorDUnitTest::getLocatorDistributedMember);
+
+    waitForMemberToBecomeLeadMemberOfDistributedSystem(distributedMemberThatWillBeShutdown,
+        testRunnerLocatorDS);
+    DistributedMember oldLeader = MembershipManagerHelper.getLeadMember(testRunnerLocatorDS);
+
+    assertThat(locatorMemberToBeShutdown)
+        .isEqualTo(MembershipManagerHelper.getCoordinator(testRunnerLocatorDS));
+    DistributedMember oldCoordinator =
+        MembershipManagerHelper.getCoordinator(testRunnerLocatorDS);
+
+    // crash the lead locator. Should be okay
+    locatorThatWillBeShutdownVM.invoke("crash locator", () -> {
+      Locator loc = Locator.getLocator();
+      DistributedSystem distributedSystem = loc.getDistributedSystem();
+      addIgnoredException("service failure");
+      addIgnoredException(ForcedDisconnectException.class);
+      MembershipManagerHelper.crashDistributedSystem(distributedSystem);
+      loc.stop();
+    });
 
-      // disconnect the first vm and demonstrate that the non-lead vm and the
-      // locator notice the failure and continue to run
-      memberThatWillBeShutdownVM.invoke(LocatorDUnitTest::disconnectDistributedSystem);
-      await().until(
-          () -> memberThatWillBeShutdownVM.invoke(() -> !LocatorDUnitTest.isSystemConnected()));
-      await().until(() -> memberVM.invoke(LocatorDUnitTest::isSystemConnected));
+    await().until(testRunnerLocatorDS::isConnected);
 
-      assertThat(memberVM.invoke(LocatorDUnitTest::isSystemConnected))
-          .describedAs("Distributed system should not have disconnected").isTrue();
+    waitUntilTheSystemIsConnected(memberThatWillBeShutdownVM, memberVM);
 
-      await("waiting for the old coordinator to drop out").until(
-          () -> MembershipManagerHelper.getCoordinator(testRunnerLocatorDS) != oldCoordinator);
+    // disconnect the first vm and demonstrate that the non-lead vm and the
+    // locator notice the failure and continue to run
+    memberThatWillBeShutdownVM.invoke(LocatorDUnitTest::disconnectDistributedSystem);
+    await().until(
+        () -> memberThatWillBeShutdownVM.invoke(() -> !isSystemConnected()));
+    await().until(() -> memberVM.invoke(LocatorDUnitTest::isSystemConnected));
 
-      await().until(() -> {
-        DistributedMember survivingDistributedMember = testRunnerLocatorDS.getDistributedMember();
-        DistributedMember coordinator = MembershipManagerHelper.getCoordinator(testRunnerLocatorDS);
-        assertThat(survivingDistributedMember).isEqualTo(coordinator);
-        return true;
-      });
+    assertThat(memberVM.invoke(LocatorDUnitTest::isSystemConnected))
+        .describedAs("Distributed system should not have disconnected").isTrue();
 
-      await("Waiting for the old leader to drop out")
-          .pollInterval(1, TimeUnit.SECONDS).until(() -> {
-            DistributedMember leader = MembershipManagerHelper.getLeadMember(testRunnerLocatorDS);
-            return leader != oldLeader;
-          });
+    await("waiting for the old coordinator to drop out").until(
+        () -> MembershipManagerHelper.getCoordinator(testRunnerLocatorDS) != oldCoordinator);
 
-      await().until(() -> {
-        assertThat(distributedMember)
-            .isEqualTo(MembershipManagerHelper.getLeadMember(testRunnerLocatorDS));
-        return true;
-      });
+    await().untilAsserted(() -> {
+      DistributedMember survivingDistributedMember = testRunnerLocatorDS.getDistributedMember();
+      DistributedMember coordinator = MembershipManagerHelper.getCoordinator(testRunnerLocatorDS);
+      assertThat(survivingDistributedMember).isEqualTo(coordinator);
+    });
 
-    } finally {
-      memberVM.invoke(LocatorDUnitTest::disconnectDistributedSystem);
+    await("Waiting for the old leader to drop out")
+        .pollInterval(1, SECONDS).until(() -> {
+          DistributedMember leader = MembershipManagerHelper.getLeadMember(testRunnerLocatorDS);
+          return leader != oldLeader;
+        });
 
-      if (locator != null) {
-        locator.stop();
-      }
-      locatorThatWillBeShutdownVM.invoke(LocatorDUnitTest::stopLocator);
-    }
+    await().untilAsserted(() -> {
+      assertThat(distributedMember)
+          .isEqualTo(MembershipManagerHelper.getLeadMember(testRunnerLocatorDS));
+    });
   }
 
-
   /**
    * Tests that attempting to connect to a distributed system in which no locator is defined throws
    * an exception.
    */
   @Test
   public void testNoLocator() {
-    int port = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
-    DistributedTestUtils.deleteLocatorStateFile(port1);
-    String locators = NetworkUtils.getServerHostName() + "[" + port + "]";
-    Properties props = getBasicProperties(locators);
+    String locators = hostName + "[" + port2 + "]";
 
+    Properties props = getBasicProperties(locators);
     addDSProps(props);
-    final String expected = "java.net.ConnectException";
-    final String addExpected = "<ExpectedException action=add>" + expected + "</ExpectedException>";
-    final String removeExpected =
-        "<ExpectedException action=remove>" + expected + "</ExpectedException>";
 
-    LogWriter bgexecLogger = new LocalLogWriter(ALL.intLevel(), System.out);
-    bgexecLogger.info(addExpected);
+    addIgnoredException(ConnectException.class);
 
-    boolean exceptionOccurred = true;
     try {
       getConnectedDistributedSystem(props);
-      exceptionOccurred = false;
+      fail("Should have thrown a GemFireConfigException");
 
     } catch (DistributionException ex) {
       // I guess it can throw this too...
@@ -1108,17 +932,6 @@ public class LocatorDUnitTest implements java.io.Serializable {
     } catch (GemFireConfigException ex) {
       String s = ex.getMessage();
       assertThat(s.contains("Locator does not exist")).isTrue();
-
-    } catch (Exception ex) {
-      // if you see this fail, determine if unexpected exception is expected
-      // if expected then add in a catch block for it above this catch
-      throw new RuntimeException("Failed with unexpected exception", ex);
-    } finally {
-      bgexecLogger.info(removeExpected);
-    }
-
-    if (!exceptionOccurred) {
-      fail("Should have thrown a GemFireConfigException");
     }
   }
 
@@ -1131,62 +944,46 @@ public class LocatorDUnitTest implements java.io.Serializable {
    */
   @Test
   public void testOneLocator() {
-    VM vm0 = VM.getVM(0);
-    VM vm1 = VM.getVM(1);
-    VM vm2 = VM.getVM(2);
-
-    final int port = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
-    DistributedTestUtils.deleteLocatorStateFile(port1);
-    final String locators = NetworkUtils.getServerHostName() + "[" + port + "]";
+    String locators = hostName + "[" + port2 + "]";
 
-    startLocatorWithSomeBasicProperties(vm0, port);
+    startLocatorWithSomeBasicProperties(vm0, port2);
 
-    try {
-      SerializableRunnable connect = new SerializableRunnable("Connect to " + locators) {
-        @Override
-        public void run() {
-          Properties props = getBasicProperties(locators);
-          props.setProperty(MEMBER_TIMEOUT, "1000");
-          addDSProps(props);
-          getConnectedDistributedSystem(props);
-        }
-      };
+    SerializableRunnable connect = new SerializableRunnable("Connect to " + locators) {
+      @Override
+      public void run() {
+        Properties props = getBasicProperties(locators);
+        props.setProperty(MEMBER_TIMEOUT, "1000");
+        addDSProps(props);
 
-      vm1.invoke(connect);
-      vm2.invoke(connect);
+        getConnectedDistributedSystem(props);
+      }
+    };
 
-      Properties props = getBasicProperties(locators);
-      props.setProperty(MEMBER_TIMEOUT, "1000");
-      addDSProps(props);
-      system = getConnectedDistributedSystem(props);
+    vm1.invoke(connect);
+    vm2.invoke(connect);
 
-      final DistributedMember coord = MembershipManagerHelper.getCoordinator(system);
-      logger.info("coordinator before termination of locator is " + coord);
+    Properties props = getBasicProperties(locators);
+    props.setProperty(MEMBER_TIMEOUT, "1000");
+    addDSProps(props);
 
-      vm0.invoke(LocatorDUnitTest::stopLocator);
+    system = getConnectedDistributedSystem(props);
 
-      // now ensure that one of the remaining members became the coordinator
+    DistributedMember coord = MembershipManagerHelper.getCoordinator(system);
+    logger.info("coordinator before termination of locator is " + coord);
 
-      await()
-          .until(() -> !coord.equals(MembershipManagerHelper.getCoordinator(system)));
+    vm0.invoke(LocatorDUnitTest::stopLocator);
 
-      DistributedMember newCoord = MembershipManagerHelper.getCoordinator(system);
-      logger.info("coordinator after shutdown of locator was " + newCoord);
-      if (coord.equals(newCoord)) {
-        fail("another member should have become coordinator after the locator was stopped");
-      }
+    // now ensure that one of the remaining members became the coordinator
 
-      system.disconnect();
+    await().until(() -> !coord.equals(MembershipManagerHelper.getCoordinator(system)));
 
-      vm1.invoke(LocatorDUnitTest::disconnectDistributedSystem);
-      vm2.invoke(LocatorDUnitTest::disconnectDistributedSystem);
-
-    } finally {
-      vm0.invoke(LocatorDUnitTest::stopLocator);
+    DistributedMember newCoord = MembershipManagerHelper.getCoordinator(system);
+    logger.info("coordinator after shutdown of locator was " + newCoord);
+    if (coord.equals(newCoord)) {
+      fail("another member should have become coordinator after the locator was stopped");
     }
   }
 
-
   /**
    * Tests starting one locator in a remote VM and having multiple members of the distributed system
    * join it. This ensures that members start up okay, and that handling of a stopped locator is
@@ -1195,82 +992,60 @@ public class LocatorDUnitTest implements java.io.Serializable {
    */
   @Test
   public void testLocatorBecomesCoordinator() {
-    final String expected = "java.net.ConnectException";
-    final String addExpected = "<ExpectedException action=add>" + expected + "</ExpectedException>";
-    final String removeExpected =
-        "<ExpectedException action=remove>" + expected + "</ExpectedException>";
+    addIgnoredException(ConnectException.class);
 
-    VM vm0 = VM.getVM(0);
-    VM vm1 = VM.getVM(1);
-    VM vm2 = VM.getVM(2);
+    String locators = hostName + "[" + port2 + "]";
 
-    final int port = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
-    DistributedTestUtils.deleteLocatorStateFile(port1);
-    final String locators = NetworkUtils.getServerHostName() + "[" + port + "]";
+    startLocatorPreferredCoordinators(vm0, port2);
 
-    startLocatorPreferredCoordinators(vm0, port);
-
-    try {
-
-      final Properties props = new Properties();
-      props.setProperty(LOCATORS, locators);
-      props.setProperty(ENABLE_NETWORK_PARTITION_DETECTION, "true");
+    Properties props = new Properties();
+    props.setProperty(LOCATORS, locators);
+    props.setProperty(ENABLE_NETWORK_PARTITION_DETECTION, "true");
+    addDSProps(props);
 
-      addDSProps(props);
-      vm1.invoke(() -> {
-        DistributedSystem sys = getSystem(props);
-        sys.getLogWriter().info(addExpected);
-      });
-      vm2.invoke(() -> {
-        DistributedSystem sys = getSystem(props);
-        sys.getLogWriter().info(addExpected);
-      });
+    vm1.invoke(() -> {
+      getSystem(props);
+    });
+    vm2.invoke(() -> {
+      getSystem(props);
+    });
 
-      system = getSystem(props);
+    system = getSystem(props);
 
-      final DistributedMember coord = MembershipManagerHelper.getCoordinator(system);
-      logger.info("coordinator before termination of locator is " + coord);
+    DistributedMember coord = MembershipManagerHelper.getCoordinator(system);
+    logger.info("coordinator before termination of locator is " + coord);
 
-      vm0.invoke(LocatorDUnitTest::stopLocator);
+    vm0.invoke(LocatorDUnitTest::stopLocator);
 
-      // now ensure that one of the remaining members became the coordinator
-      await()
-          .until(() -> !coord.equals(MembershipManagerHelper.getCoordinator(system)));
+    // now ensure that one of the remaining members became the coordinator
+    await().until(() -> !coord.equals(MembershipManagerHelper.getCoordinator(system)));
 
-      DistributedMember newCoord = MembershipManagerHelper.getCoordinator(system);
-      logger.info("coordinator after shutdown of locator was " + newCoord);
-      if (newCoord == null || coord.equals(newCoord)) {
-        fail("another member should have become coordinator after the locator was stopped: "
-            + newCoord);
-      }
+    DistributedMember newCoord = MembershipManagerHelper.getCoordinator(system);
+    logger.info("coordinator after shutdown of locator was " + newCoord);
+    if (newCoord == null || coord.equals(newCoord)) {
+      fail("another member should have become coordinator after the locator was stopped: "
+          + newCoord);
+    }
 
-      // restart the locator to demonstrate reconnection & make disconnects faster
-      // it should also regain the role of coordinator, so we check to make sure
-      // that the coordinator has changed
-      startLocatorPreferredCoordinators(vm0, port);
+    // restart the locator to demonstrate reconnection & make disconnects faster
+    // it should also regain the role of coordinator, so we check to make sure
+    // that the coordinator has changed
+    startLocatorPreferredCoordinators(vm0, port2);
 
-      final DistributedMember tempCoord = newCoord;
+    DistributedMember tempCoord = newCoord;
 
-      await()
-          .until(() -> !tempCoord.equals(MembershipManagerHelper.getCoordinator(system)));
+    await().until(() -> !tempCoord.equals(MembershipManagerHelper.getCoordinator(system)));
 
-      system.disconnect();
-      LogWriter bgexecLogger = new LocalLogWriter(ALL.intLevel(), System.out);
-      bgexecLogger.info(removeExpected);
+    system.disconnect();
 
-      checkConnectionAndPrintInfo(vm1);
-      checkConnectionAndPrintInfo(vm2);
-      vm0.invoke(LocatorDUnitTest::stopLocator);
-    } finally {
-      vm0.invoke(LocatorDUnitTest::stopLocator);
-    }
+    checkConnectionAndPrintInfo(vm1);
+    checkConnectionAndPrintInfo(vm2);
   }
 
   @Test
   public void testConcurrentLocatorStartup() throws Exception {
     List<AvailablePort.Keeper> portKeepers =
         AvailablePortHelper.getRandomAvailableTCPPortKeepers(4);
-    List<AsyncInvocation<Object>> asyncInvocations = new ArrayList(portKeepers.size());
     StringBuilder sb = new StringBuilder(100);
     for (int i = 0; i < portKeepers.size(); i++) {
       AvailablePort.Keeper keeper = portKeepers.get(i);
@@ -1280,20 +1055,19 @@ public class LocatorDUnitTest implements java.io.Serializable {
       }
     }
     String locators = sb.toString();
+
     Properties dsProps = getClusterProperties(locators, "false");
+
+    List<AsyncInvocation<Object>> asyncInvocations = new ArrayList<>(portKeepers.size());
+
     for (int i = 0; i < portKeepers.size(); i++) {
       AvailablePort.Keeper keeper = portKeepers.get(i);
-      final int port = keeper.getPort();
-      DistributedTestUtils.deleteLocatorStateFile(port);
+      int port = keeper.getPort();
       keeper.release();
-      AsyncInvocation<Object> startLocator = VM.getVM(i).invokeAsync("start locator " + i, () -> {
+      AsyncInvocation<Object> startLocator = getVM(i).invokeAsync("start locator " + i, () -> {
         DUnitBlackboard blackboard = getBlackboard();
         blackboard.signalGate("" + port);
-        try {
-          blackboard.waitForGate("startLocators", 5, MINUTES);
-        } catch (InterruptedException e) {
-          throw new RuntimeException("test was interrupted");
-        }
+        blackboard.waitForGate("startLocators", 5, MINUTES);
         startLocatorBase(dsProps, port);
         assertTrue(isSystemConnected());
         System.out.println("Locator startup completed");
@@ -1308,15 +1082,9 @@ public class LocatorDUnitTest implements java.io.Serializable {
       asyncInvocations.get(i).await();
     }
     for (int i = 0; i < asyncInvocations.size(); i++) {
-      assertTrue(VM.getVM(i).invoke("assert all in same cluster", () -> CacheFactory
+      assertTrue(getVM(i).invoke("assert all in same cluster", () -> CacheFactory
           .getAnyInstance().getDistributedSystem().getAllOtherMembers().size() == expectedCount));
     }
-    for (int i = 0; i < asyncInvocations.size(); i++) {
-      VM.getVM(i).invoke(() -> {
-        Locator.getLocator().stop();
-        system = null;
-      });
-    }
   }
 
   /**
@@ -1324,63 +1092,37 @@ public class LocatorDUnitTest implements java.io.Serializable {
    */
   @Test
   public void testTwoLocatorsTwoServers() {
-    VM vm0 = VM.getVM(0);
-    VM vm1 = VM.getVM(1);
-    VM vm2 = VM.getVM(2);
-    VM vm3 = VM.getVM(3);
-
-    int[] freeTCPPorts = AvailablePortHelper.getRandomAvailableTCPPorts(2);
-    final int port1 = freeTCPPorts[0];
-    this.port1 = port1;
-    final int port2 = freeTCPPorts[1];
-    this.port2 = port2;
-    DistributedTestUtils.deleteLocatorStateFile(port1, port2);
-    final String host0 = NetworkUtils.getServerHostName();
-    final String locators = host0 + "[" + port1 + "]," + host0 + "[" + port2 + "]";
-
-    final Properties dsProps = getBasicProperties(locators);
+    String locators = hostName + "[" + port1 + "]," + hostName + "[" + port2 + "]";
+
+    Properties dsProps = getBasicProperties(locators);
     addDSProps(dsProps);
 
     startLocator(vm0, dsProps, port1);
-    try {
-      startLocator(vm3, dsProps, port2);
-      try {
-
-        SerializableRunnable connect = new SerializableRunnable("Connect to " + locators) {
-          @Override
-          public void run() {
-            Properties props = getBasicProperties(locators);
-            addDSProps(props);
-            getConnectedDistributedSystem(props);
-          }
-        };
-        vm1.invoke(connect);
-        vm2.invoke(connect);
 
-        Properties props = getBasicProperties(locators);
+    startLocator(vm3, dsProps, port2);
 
+    SerializableRunnable connect = new SerializableRunnable("Connect to " + locators) {
+      @Override
+      public void run() {
+        Properties props = getBasicProperties(locators);
         addDSProps(props);
-        system = getConnectedDistributedSystem(props);
-
-        await().until(() -> system.getDM().getViewMembers().size() >= 3);
+        getConnectedDistributedSystem(props);
+      }
+    };
+    vm1.invoke(connect);
+    vm2.invoke(connect);
 
-        // three applications plus
-        assertThat(system.getDM().getViewMembers().size()).isEqualTo(5);
+    Properties props = getBasicProperties(locators);
 
-        system.disconnect();
+    addDSProps(props);
+    system = getConnectedDistributedSystem(props);
 
-        vm1.invoke(LocatorDUnitTest::disconnectDistributedSystem);
-        vm2.invoke(LocatorDUnitTest::disconnectDistributedSystem);
+    await().until(() -> system.getDM().getViewMembers().size() >= 3);
 
-      } finally {
-        vm3.invoke(LocatorDUnitTest::stopLocator);
-      }
-    } finally {
-      vm0.invoke(LocatorDUnitTest::stopLocator);
-    }
+    // three applications plus
+    assertThat(system.getDM().getViewMembers().size()).isEqualTo(5);
   }
 
-
   private void waitUntilLocatorBecomesCoordinator() {
     await().until(() -> system != null && system.isConnected() &&
         getCoordinator()
@@ -1405,230 +1147,183 @@ public class LocatorDUnitTest implements java.io.Serializable {
    */
   @Test
   public void testMultipleLocatorsRestartingAtSameTime() {
-    VM vm0 = VM.getVM(0);
-    VM vm1 = VM.getVM(1);
-    VM vm2 = VM.getVM(2);
-    VM vm3 = VM.getVM(3);
-    VM vm4 = VM.getVM(4);
-
-    int[] freeTCPPorts = AvailablePortHelper.getRandomAvailableTCPPorts(3);
-    this.port1 = freeTCPPorts[0];
-    this.port2 = freeTCPPorts[1];
-    int port3 = freeTCPPorts[2];
-    DistributedTestUtils.deleteLocatorStateFile(port1, port2, port3);
-    final String host0 = NetworkUtils.getServerHostName();
-    final String locators =
-        host0 + "[" + port1 + "]," + host0 + "[" + port2 + "]," + host0 + "[" + port3 + "]";
-
-    final Properties dsProps = getBasicProperties(locators);
+    String locators =
+        hostName + "[" + port1 + "]," + hostName + "[" + port2 + "]," + hostName + "[" + port3
+            + "]";
+
+    Properties dsProps = getBasicProperties(locators);
     dsProps.setProperty(LOG_LEVEL, logger.getLevel().name());
     dsProps.setProperty(ENABLE_NETWORK_PARTITION_DETECTION, "true");
-
     addDSProps(dsProps);
+
     startLocator(vm0, dsProps, port1);
     startLocator(vm1, dsProps, port2);
     startLocator(vm2, dsProps, port3);
 
-    try {
-      vm3.invoke(() -> {
-        getConnectedDistributedSystem(dsProps);
-        return true;
-      });
-      vm4.invoke(() -> {
-        getConnectedDistributedSystem(dsProps);
-        return true;
-      });
+    vm3.invoke(() -> {
+      getConnectedDistributedSystem(dsProps);
+    });
+    vm4.invoke(() -> {
+      getConnectedDistributedSystem(dsProps);
+    });
 
-      system = getConnectedDistributedSystem(dsProps);
-
-      await().until(() -> system.getDM().getViewMembers().size() == 6);
-
-      // three applications plus
-      assertThat(system.getDM().getViewMembers().size()).isEqualTo(6);
-
-      vm0.invoke(LocatorDUnitTest::stopLocator);
-      vm1.invoke(LocatorDUnitTest::stopLocator);
-      vm2.invoke(LocatorDUnitTest::stopLocator);
-
-      await()
-          .until(() -> system.getDM().getMembershipManager().getView().size() <= 3);
-
-      final String newLocators = host0 + "[" + port2 + "]," + host0 + "[" + port3 + "]";
-      dsProps.setProperty(LOCATORS, newLocators);
-
-      final InternalDistributedMember currentCoordinator = getCoordinator();
-      DistributedMember vm3ID = vm3.invoke(() -> system.getDM().getDistributionManagerId());
-      assertEquals(
-          "View is " + system.getDM().getMembershipManager().getView() + " and vm3's ID is "
-              + vm3ID,
-          vm3ID, vm3.invoke(
-              () -> system.getDistributionManager().getMembershipManager().getView().getCreator()));
-
-      startLocator(vm1, dsProps, port2);
-      startLocator(vm2, dsProps, port3);
-
-      await()
-          .until(() -> !getCoordinator().equals(currentCoordinator)
-              && system.getDM().getAllHostedLocators().size() == 2);
-
-      vm1.invoke("waitUntilLocatorBecomesCoordinator", this::waitUntilLocatorBecomesCoordinator);
-      vm2.invoke("waitUntilLocatorBecomesCoordinator", this::waitUntilLocatorBecomesCoordinator);
-      vm3.invoke("waitUntilLocatorBecomesCoordinator", this::waitUntilLocatorBecomesCoordinator);
-      vm4.invoke("waitUntilLocatorBecomesCoordinator", this::waitUntilLocatorBecomesCoordinator);
-
-      int netViewId = vm1.invoke("Checking ViewCreator", () -> getView().getViewId());
-      assertThat((int) vm2.invoke("checking ViewID", () -> getView().getViewId()))
-          .isEqualTo(netViewId);
-      assertThat((int) vm3.invoke("checking ViewID", () -> getView().getViewId()))
-          .isEqualTo(netViewId);
-      assertThat((int) vm4.invoke("checking ViewID", () -> getView().getViewId()))
-          .isEqualTo(netViewId);
-      assertThat((boolean) vm4
-          .invoke("Checking ViewCreator",
-              () -> system.getDistributedMember().equals(getView().getCreator()))).isFalse();
-      // Given the start up order of servers, this server is the elder server
-      assertFalse(vm3
-          .invoke("Checking ViewCreator",
-              () -> system.getDistributedMember().equals(getView().getCreator())));
-      if (vm1.invoke(() -> system.getDistributedMember().equals(getView().getCreator()))) {
-        assertThat((boolean) vm2.invoke("Checking ViewCreator",
-            () -> system.getDistributedMember().equals(getView().getCreator())))
-                .isFalse();
-      } else {
-        assertThat((boolean) vm2.invoke("Checking ViewCreator",
-            () -> system.getDistributedMember().equals(getView().getCreator())))
-                .isTrue();
-      }
+    system = getConnectedDistributedSystem(dsProps);
 
-    } finally {
-      system.disconnect();
-      vm3.invoke(LocatorDUnitTest::disconnectDistributedSystem);
-      vm4.invoke(LocatorDUnitTest::disconnectDistributedSystem);
-      vm2.invoke(LocatorDUnitTest::stopLocator);
-      vm1.invoke(LocatorDUnitTest::stopLocator);
+    await().until(() -> system.getDM().getViewMembers().size() == 6);
+
+    // three applications plus
+    assertThat(system.getDM().getViewMembers().size()).isEqualTo(6);
+
+    vm0.invoke(LocatorDUnitTest::stopLocator);
+    vm1.invoke(LocatorDUnitTest::stopLocator);
+    vm2.invoke(LocatorDUnitTest::stopLocator);
+
+    await()
+        .until(() -> system.getDM().getMembershipManager().getView().size() <= 3);
+
+    String newLocators = hostName + "[" + port2 + "]," + hostName + "[" + port3 + "]";
+    dsProps.setProperty(LOCATORS, newLocators);
+
+    InternalDistributedMember currentCoordinator = getCoordinator();
+    DistributedMember vm3ID = vm3.invoke(() -> system.getDM().getDistributionManagerId());
+    assertEquals(
+        "View is " + system.getDM().getMembershipManager().getView() + " and vm3's ID is "
+            + vm3ID,
+        vm3ID, vm3.invoke(
+            () -> system.getDistributionManager().getMembershipManager().getView().getCreator()));
+
+    startLocator(vm1, dsProps, port2);
+    startLocator(vm2, dsProps, port3);
+
+    await()
+        .until(() -> !getCoordinator().equals(currentCoordinator)
+            && system.getDM().getAllHostedLocators().size() == 2);
+
+    vm1.invoke("waitUntilLocatorBecomesCoordinator", this::waitUntilLocatorBecomesCoordinator);
+    vm2.invoke("waitUntilLocatorBecomesCoordinator", this::waitUntilLocatorBecomesCoordinator);
+    vm3.invoke("waitUntilLocatorBecomesCoordinator", this::waitUntilLocatorBecomesCoordinator);
+    vm4.invoke("waitUntilLocatorBecomesCoordinator", this::waitUntilLocatorBecomesCoordinator);
+
+    int netViewId = vm1.invoke("Checking ViewCreator", () -> getView().getViewId());
+    assertThat((int) vm2.invoke("checking ViewID", () -> getView().getViewId()))
+        .isEqualTo(netViewId);
+    assertThat((int) vm3.invoke("checking ViewID", () -> getView().getViewId()))
+        .isEqualTo(netViewId);
+    assertThat((int) vm4.invoke("checking ViewID", () -> getView().getViewId()))
+        .isEqualTo(netViewId);
+    assertThat((boolean) vm4
+        .invoke("Checking ViewCreator",
+            () -> system.getDistributedMember().equals(getView().getCreator()))).isFalse();
+    // Given the start up order of servers, this server is the elder server
+    assertFalse(vm3
+        .invoke("Checking ViewCreator",
+            () -> system.getDistributedMember().equals(getView().getCreator())));
+    if (vm1.invoke(() -> system.getDistributedMember().equals(getView().getCreator()))) {
+      assertThat((boolean) vm2.invoke("Checking ViewCreator",
+          () -> system.getDistributedMember().equals(getView().getCreator())))
+              .isFalse();
+    } else {
+      assertThat((boolean) vm2.invoke("Checking ViewCreator",
+          () -> system.getDistributedMember().equals(getView().getCreator())))
+              .isTrue();
     }
   }
 
-
   @Test
   public void testMultipleLocatorsRestartingAtSameTimeWithMissingServers() throws Exception {
-    IgnoredException.addIgnoredException("ForcedDisconnectException");
-    IgnoredException.addIgnoredException("Possible loss of quorum");
-    IgnoredException.addIgnoredException("java.lang.Exception: Message id is");
-
-    VM vm0 = VM.getVM(0);
-    VM vm1 = VM.getVM(1);
-    VM vm2 = VM.getVM(2);
-    VM vm3 = VM.getVM(3);
-    VM vm4 = VM.getVM(4);
-
-    int[] freeTCPPorts = AvailablePortHelper.getRandomAvailableTCPPorts(3);
-    this.port1 = freeTCPPorts[0];
-    this.port2 = freeTCPPorts[1];
-    int port3 = freeTCPPorts[2];
-    DistributedTestUtils.deleteLocatorStateFile(port1, port2, port3);
-    final String host0 = NetworkUtils.getServerHostName();
-    final String locators =
-        host0 + "[" + port1 + "]," + host0 + "[" + port2 + "]," + host0 + "[" + port3 + "]";
-
-    final Properties dsProps = getBasicProperties(locators);
+    addIgnoredException("ForcedDisconnectException");
+    addIgnoredException("Possible loss of quorum");
+    addIgnoredException("java.lang.Exception: Message id is");
+
+    String locators =
+        hostName + "[" + port1 + "]," + hostName + "[" + port2 + "]," + hostName + "[" + port3
+            + "]";
+
+    Properties dsProps = getBasicProperties(locators);
     dsProps.setProperty(LOG_LEVEL, logger.getLevel().name());
     dsProps.setProperty(DISABLE_AUTO_RECONNECT, "true");
     dsProps.setProperty(MEMBER_TIMEOUT, "2000");
-
     addDSProps(dsProps);
+
     startLocator(vm0, dsProps, port1);
     startLocator(vm1, dsProps, port2);
     startLocator(vm2, dsProps, port3);
 
-    try {
-      vm3.invoke(() -> {
-        getConnectedDistributedSystem(dsProps);
-        return true;
-      });
-      vm4.invoke(() -> {
-        getConnectedDistributedSystem(dsProps);
+    vm3.invoke(() -> {
+      getConnectedDistributedSystem(dsProps);
+    });
+    vm4.invoke(() -> {
+      getConnectedDistributedSystem(dsProps);
 
-        await()
-            .until(() -> system.getDM().getViewMembers()
-                .size() == 5);
-        return true;
-      });
+      await().until(() -> system.getDM().getViewMembers().size() == 5);
+    });
 
-      vm0.invoke(this::forceDisconnect);
-      vm1.invoke(this::forceDisconnect);
-      vm2.invoke(this::forceDisconnect);
+    vm0.invoke(this::forceDisconnect);
+    vm1.invoke(this::forceDisconnect);
+    vm2.invoke(this::forceDisconnect);
 
-      SerializableRunnable waitForDisconnect = new SerializableRunnable("waitForDisconnect") {
-        @Override
-        public void run() {
-          await()
-              .until(() -> system == null);
-        }
-      };
-      vm0.invoke(() -> waitForDisconnect);
-      vm1.invoke(() -> waitForDisconnect);
-      vm2.invoke(() -> waitForDisconnect);
+    SerializableRunnable waitForDisconnect = new SerializableRunnable("waitForDisconnect") {
+      @Override
+      public void run() {
+        await()
+            .until(() -> system == null);
+      }
+    };
+    vm0.invoke(() -> waitForDisconnect);
+    vm1.invoke(() -> waitForDisconnect);
+    vm2.invoke(() -> waitForDisconnect);
+
+    String newLocators = hostName + "[" + port2 + "]," + hostName + "[" + port3 + "]";
+    dsProps.setProperty(LOCATORS, newLocators);
+
+    getBlackboard().initBlackboard();
+    AsyncInvocation async1 = vm1.invokeAsync(() -> {
+      getBlackboard().signalGate("vm1ready");
+      getBlackboard().waitForGate("readyToConnect", 30, SECONDS);
+      System.out.println("vm1 is ready to connect");
+      startLocatorBase(dsProps, port2);
+    });
+    AsyncInvocation async2 = vm2.invokeAsync(() -> {
+      getBlackboard().signalGate("vm2ready");
+      getBlackboard().waitForGate("readyToConnect", 30, SECONDS);
+      System.out.println("vm2 is ready to connect");
+      startLocatorBase(dsProps, port3);
+    });
+    getBlackboard().waitForGate("vm1ready", 30, SECONDS);
+    getBlackboard().waitForGate("vm2ready", 30, SECONDS);
+    getBlackboard().signalGate("readyToConnect");
 
-      final String newLocators = host0 + "[" + port2 + "]," + host0 + "[" + port3 + "]";
-      dsProps.setProperty(LOCATORS, newLocators);
+    async1.await();
+    async2.await();
 
-      getBlackboard().initBlackboard();
-      AsyncInvocation async1 = vm1.invokeAsync(() -> {
-        getBlackboard().signalGate("vm1ready");
-        getBlackboard().waitForGate("readyToConnect", 30, SECONDS);
-        System.out.println("vm1 is ready to connect");
-        startLocatorBase(dsProps, port2);
-      });
-      AsyncInvocation async2 = vm2.invokeAsync(() -> {
-        getBlackboard().signalGate("vm2ready");
-        getBlackboard().waitForGate("readyToConnect", 30, SECONDS);
-        System.out.println("vm2 is ready to connect");
-        startLocatorBase(dsProps, port3);
-      });
-      getBlackboard().waitForGate("vm1ready", 30, SECONDS);
-      getBlackboard().waitForGate("vm2ready", 30, SECONDS);
-      getBlackboard().signalGate("readyToConnect");
-      async1.join();
-      async2.join();
-
-      vm1.invoke("waitUntilLocatorBecomesCoordinator", this::waitUntilLocatorBecomesCoordinator);
-      vm2.invoke("waitUntilLocatorBecomesCoordinator", this::waitUntilLocatorBecomesCoordinator);
-
-      if (vm1.invoke(() -> system.getDistributedMember().equals(getView().getCreator()))) {
-        assertFalse(
-            vm2.invoke("Checking ViewCreator",
-                () -> system.getDistributedMember().equals(getView().getCreator())));
-      } else {
-        assertTrue(
-            vm2.invoke("Checking ViewCreator",
-                () -> system.getDistributedMember().equals(getView().getCreator())));
-      }
+    vm1.invoke("waitUntilLocatorBecomesCoordinator", this::waitUntilLocatorBecomesCoordinator);
+    vm2.invoke("waitUntilLocatorBecomesCoordinator", this::waitUntilLocatorBecomesCoordinator);
 
-    } finally {
-      vm2.invoke(LocatorDUnitTest::stopLocator);
-      vm1.invoke(LocatorDUnitTest::stopLocator);
+    if (vm1.invoke(() -> system.getDistributedMember().equals(getView().getCreator()))) {
+      assertFalse(
+          vm2.invoke("Checking ViewCreator",
+              () -> system.getDistributedMember().equals(getView().getCreator())));
+    } else {
+      assertTrue(
+          vm2.invoke("Checking ViewCreator",
+              () -> system.getDistributedMember().equals(getView().getCreator())));
     }
   }
 
-
   /**
    * Tests that a VM can connect to a locator that is hosted in its own VM.
    */
   @Test
   public void testConnectToOwnLocator() throws Exception {
-    port1 = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
-    DistributedTestUtils.deleteLocatorStateFile(port1);
-
-    final String locators = NetworkUtils.getServerHostName() + "[" + port1 + "]";
+    String locators = hostName + "[" + port1 + "]";
 
     Properties props = getBasicProperties(locators);
     props.setProperty(ENABLE_CLUSTER_CONFIGURATION, "false");
-    Locator locator = Locator.startLocatorAndDS(port1, new File(""), props);
+
+    Locator locator = Locator.startLocatorAndDS(port1, null, props);
     system = (InternalDistributedSystem) locator.getDistributedSystem();
     system.disconnect();
     locator.stop();
-
   }
 
   /**
@@ -1636,35 +1331,19 @@ public class LocatorDUnitTest implements java.io.Serializable {
    */
   @Test
   public void testHostingMultipleLocators() throws Exception {
-    int[] randomAvailableTCPPorts = AvailablePortHelper.getRandomAvailableTCPPorts(2);
-    port1 = randomAvailableTCPPorts[0];
-    File logFile1 = new File("");
-    DistributedTestUtils.deleteLocatorStateFile(port1);
-    Locator locator1 = Locator.startLocator(port1, logFile1);
+    Locator.startLocator(port1, null);
 
     try {
+      Locator.startLocator(port2, null);
+      fail("expected second locator start to fail.");
+    } catch (IllegalStateException expected) {
+    }
 
-      int port2 = randomAvailableTCPPorts[1];
-      DistributedTestUtils.deleteLocatorStateFile(port2);
-
-      try {
-        Locator.startLocator(port2, new File(""));
-        fail("expected second locator start to fail.");
-      } catch (IllegalStateException expected) {
-      }
-
-      final String host0 = NetworkUtils.getServerHostName();
-      final String locators = host0 + "[" + port1 + "]," + host0 + "[" + port2 + "]";
-
-      Properties props = getBasicProperties(locators);
-      props.setProperty(LOG_LEVEL, logger.getLevel().name());
-      getConnectedDistributedSystem(props);
+    String locators = hostName + "[" + port1 + "]," + hostName + "[" + port2 + "]";
 
-      disconnectDistributedSystem();
+    Properties props = getBasicProperties(locators);
 
-    } finally {
-      locator1.stop();
-    }
+    getConnectedDistributedSystem(props);
   }
 
   /**
@@ -1674,136 +1353,79 @@ public class LocatorDUnitTest implements java.io.Serializable {
    */
   @Test
   public void testRestartLocator() throws Exception {
-    port1 = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
-    DistributedTestUtils.deleteLocatorStateFile(port1);
-    File logFile = new File("");
     File stateFile = new File("locator" + port1 + "state.dat");
-    VM vm = VM.getVM(0);
-    final Properties properties =
-        getBasicProperties(Host.getHost(0).getHostName() + "[" + port1 + "]");
+
+    Properties properties = getBasicProperties(getHostName() + "[" + port1 + "]");
     properties.setProperty(ENABLE_CLUSTER_CONFIGURATION, "false");
     properties.setProperty(LOG_LEVEL, DUnitLauncher.logLevel);
     addDSProps(properties);
+
     if (stateFile.exists()) {
       assertThat(stateFile.delete()).isTrue();
-
     }
 
     logger.info("Starting locator");
-    Locator locator = Locator.startLocatorAndDS(port1, logFile, properties);
+    Locator locator = Locator.startLocatorAndDS(port1, null, properties);
     system = (InternalDistributedSystem) locator.getDistributedSystem();
-    try {
 
-      vm.invoke(() -> {
-        getConnectedDistributedSystem(properties);
-        return true;
-      });
-
-      logger.info("Stopping locator");
-      locator.stop();
-
-      logger.info("Starting locator");
-      locator = Locator.startLocatorAndDS(port1, logFile, properties);
-      system = (InternalDistributedSystem) locator.getDistributedSystem();
+    vm0.invoke(() -> {
+      getConnectedDistributedSystem(properties);
+    });
 
-      vm.invoke("disconnect", () -> {
-        getConnectedDistributedSystem(properties).disconnect();
-        return null;
-      });
+    logger.info("Stopping locator");
+    locator.stop();
 
-    } finally {
-      locator.stop();
-    }
+    logger.info("Starting locator");
+    locator = Locator.startLocatorAndDS(port1, null, properties);
+    system = (InternalDistributedSystem) locator.getDistributedSystem();
 
+    vm0.invoke("disconnect", () -> {
+      getConnectedDistributedSystem(properties).disconnect();
+    });
   }
 
   /**
-   * See GEODE-3588 - a locator is restarted twice with a server and ends up in a split-brain
+   * a locator is restarted twice with a server and ends up in a split-brain
    */
   @Test
   public void testRestartLocatorMultipleTimes() throws Exception {
-    port1 = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
-    DistributedTestUtils.deleteLocatorStateFile(port1);
-    File logFile = new File("");
     File stateFile = new File("locator" + port1 + "state.dat");
-    VM vm = VM.getVM(0);
-    final Properties properties =
-        getBasicProperties(Host.getHost(0).getHostName() + "[" + port1 + "]");
+
+    Properties properties = getBasicProperties(getHostName() + "[" + port1 + "]");
     addDSProps(properties);
+
     if (stateFile.exists()) {
       assertThat(stateFile.delete()).isTrue();
     }
 
-    Locator locator = Locator.startLocatorAndDS(port1, logFile, properties);
+    Locator locator = Locator.startLocatorAndDS(port1, null, properties);
     system = (InternalDistributedSystem) locator.getDistributedSystem();
 
-    vm.invoke(() -> {
+    vm0.invoke(() -> {
       getConnectedDistributedSystem(properties);
-      return null;
     });
 
-    try {
-      locator.stop();
-      locator = Locator.startLocatorAndDS(port1, logFile, properties);
-      system = (InternalDistributedSystem) locator.getDistributedSystem();
-      assertEquals(2, ((InternalDistributedSystem) locator.getDistributedSystem()).getDM()
-          .getViewMembers().size());
-
-      locator.stop();
-      locator = Locator.startLocatorAndDS(port1, logFile, properties);
-      system = (InternalDistributedSystem) locator.getDistributedSystem();
-      assertEquals(2, ((InternalDistributedSystem) locator.getDistributedSystem()).getDM()
-          .getViewMembers().size());
-
-    } finally {
-      vm.invoke("disconnect", () -> {
-        getConnectedDistributedSystem(properties).disconnect();
-        return null;
-      });
-      locator.stop();
-    }
-
-  }
-
-  @Before
-  public final void setUp() {
-    port1 = -1;
-    port2 = -1;
-    IgnoredException.addIgnoredException("Removing shunned member");
-  }
+    locator.stop();
+    locator = Locator.startLocatorAndDS(port1, null, properties);
+    system = (InternalDistributedSystem) locator.getDistributedSystem();
+    assertEquals(2, ((InternalDistributedSystem) locator.getDistributedSystem()).getDM()
+        .getViewMembers().size());
 
-  @After
-  public final void tearDown() {
-    if (Locator.hasLocator()) {
-      Locator.getLocator().stop();
-    }
-    GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
-    if (cache != null && !cache.isClosed()) {
-      cache.close();
-    }
-    // delete locator state files so they don't accidentally
-    // get used by other tests
-    if (port1 > 0) {
-      DistributedTestUtils.deleteLocatorStateFile(port1);
-    }
-    if (port2 > 0) {
-      DistributedTestUtils.deleteLocatorStateFile(port2);
-    }
-    if (system != null) {
-      system.disconnect();
-      system = null;
-    }
+    locator.stop();
+    locator = Locator.startLocatorAndDS(port1, null, properties);
+    system = (InternalDistributedSystem) locator.getDistributedSystem();
+    assertEquals(2, ((InternalDistributedSystem) locator.getDistributedSystem()).getDM()
+        .getViewMembers().size());
   }
 
-  // for child classes
   protected void addDSProps(Properties p) {
-    p.put(ENABLE_CLUSTER_CONFIGURATION, "false");
-    p.put(USE_CLUSTER_CONFIGURATION, "false");
+    p.setProperty(ENABLE_CLUSTER_CONFIGURATION, "false");
+    p.setProperty(USE_CLUSTER_CONFIGURATION, "false");
   }
 
-  protected static InternalDistributedSystem getConnectedDistributedSystem(Properties properties) {
+  static InternalDistributedSystem getConnectedDistributedSystem(Properties properties) {
     if (system == null || !system.isConnected()) {
-      properties.put(NAME, "vm" + VM.getCurrentVMNum());
+      properties.setProperty(NAME, "vm" + VM.getCurrentVMNum());
       system = (InternalDistributedSystem) DistributedSystem.connect(properties);
     }
     return system;
@@ -1811,7 +1433,7 @@ public class LocatorDUnitTest implements java.io.Serializable {
 
   private void startLocatorWithPortAndProperties(final int port, final Properties properties)
       throws IOException {
-    Locator locator = Locator.startLocatorAndDS(port, new File(""), properties);
+    Locator locator = Locator.startLocatorAndDS(port, null, properties);
     system = (InternalDistributedSystem) locator.getDistributedSystem();
     assertThat(locator).isNotNull();
   }
@@ -1871,7 +1493,7 @@ public class LocatorDUnitTest implements java.io.Serializable {
       if (member != null) {
         return member.equals(lead);
       }
-      return (lead == null);
+      return lead == null;
     });
   }
 
@@ -1885,21 +1507,17 @@ public class LocatorDUnitTest implements java.io.Serializable {
     });
   }
 
-  private Locator startLocatorBase(Properties properties, int port) {
-    File lf = new File("");
-    try {
-      properties.put(NAME, "vm" + VM.getCurrentVMNum());
-      Locator locator = Locator.startLocatorAndDS(port, lf, properties);
-      system = (InternalDistributedSystem) locator.getDistributedSystem();
-      return locator;
-    } catch (IOException ios) {
-      throw new RuntimeException("Unable to start locator", ios);
-    }
+  private Locator startLocatorBase(Properties properties, int port) throws IOException {
+    properties.setProperty(NAME, "vm" + VM.getCurrentVMNum());
+
+    Locator locator = Locator.startLocatorAndDS(port, null, properties);
+    system = (InternalDistributedSystem) locator.getDistributedSystem();
+
+    return locator;
   }
 
   void startLocatorWithSomeBasicProperties(VM vm, int port) {
     Properties locProps = new Properties();
-    locProps.setProperty(MCAST_PORT, "0");
     locProps.setProperty(MEMBER_TIMEOUT, "1000");
     addDSProps(locProps);
 
@@ -1909,14 +1527,15 @@ public class LocatorDUnitTest implements java.io.Serializable {
   private void startLocatorPreferredCoordinators(VM vm0, int port) {
     try {
       System.setProperty(InternalLocator.LOCATORS_PREFERRED_AS_COORDINATORS, "true");
+
       Properties locProps1 = new Properties();
-      locProps1.put(MCAST_PORT, "0");
-      locProps1.put(LOG_LEVEL, logger.getLevel().name());
+      locProps1.setProperty(MCAST_PORT, "0");
+      locProps1.setProperty(LOG_LEVEL, logger.getLevel().name());
       addDSProps(locProps1);
 
       startLocator(vm0, locProps1, port);
     } finally {
-      System.getProperties().remove(InternalLocator.LOCATORS_PREFERRED_AS_COORDINATORS);
+      System.clearProperty(InternalLocator.LOCATORS_PREFERRED_AS_COORDINATORS);
     }
   }
 
@@ -1934,11 +1553,6 @@ public class LocatorDUnitTest implements java.io.Serializable {
       if (sys != null && sys.isConnected()) {
         sys.disconnect();
       }
-      // connectExceptions occur during disconnect, so we need the
-      // ExpectedException hint to be in effect until this point
-      LogWriter bLogger = new LocalLogWriter(ALL.intLevel(), System.out);
-      bLogger
-          .info("<ExpectedException action=remove>java.net.ConnectException</ExpectedException>");
     });
   }
 
@@ -1948,25 +1562,22 @@ public class LocatorDUnitTest implements java.io.Serializable {
 
   Properties getBasicProperties(String locators) {
     Properties props = new Properties();
-    props.setProperty(MCAST_PORT, "0");
     props.setProperty(LOCATORS, locators);
     return props;
   }
 
   private Properties getClusterProperties(String locators, String s) {
-    final Properties properties = getBasicProperties(locators);
-    properties.put(ENABLE_NETWORK_PARTITION_DETECTION, s);
-    properties.put(DISABLE_AUTO_RECONNECT, "true");
-    properties.put(MEMBER_TIMEOUT, "2000");
-    properties.put(LOG_LEVEL, logger.getLevel().name());
-    properties.put(ENABLE_CLUSTER_CONFIGURATION, "false");
-    properties.put(USE_CLUSTER_CONFIGURATION, "false");
-    properties.put(LOCATOR_WAIT_TIME, "10"); // seconds
+    Properties properties = getBasicProperties(locators);
+    properties.setProperty(DISABLE_AUTO_RECONNECT, "true");
+    properties.setProperty(ENABLE_CLUSTER_CONFIGURATION, "false");
+    properties.setProperty(ENABLE_NETWORK_PARTITION_DETECTION, s);
+    properties.setProperty(LOCATOR_WAIT_TIME, "10"); // seconds
+    properties.setProperty(MEMBER_TIMEOUT, "2000");
+    properties.setProperty(USE_CLUSTER_CONFIGURATION, "false");
     return properties;
   }
 
   private void waitUntilTheSystemIsConnected(VM vm2, VM locatorVM) {
-
     await().until(() -> {
       assertThat(isSystemConnected())
           .describedAs("Distributed system should not have disconnected")
@@ -1977,9 +1588,10 @@ public class LocatorDUnitTest implements java.io.Serializable {
     });
   }
 
-
-  // New test hook which blocks before closing channel.
-  static class TestHook implements MembershipTestHook {
+  /**
+   * New test hook which blocks before closing channel.
+   */
+  private class TestHook implements MembershipTestHook {
 
     volatile boolean unboundedWait = true;
 
@@ -1992,31 +1604,31 @@ public class LocatorDUnitTest implements java.io.Serializable {
           Wait.pause(1000);
         }
       } else {
-        cause.printStackTrace();
+        errorCollector.addError(cause);
       }
     }
 
-    @Override
-    public void afterMembershipFailure(String reason, Throwable cause) {}
-
     void reset() {
       unboundedWait = false;
     }
-
   }
 
-  static class MyMembershipListener implements MembershipListener {
+  private static class MyMembershipListener implements MembershipListener {
 
-    boolean quorumLostInvoked;
+    volatile boolean quorumLostInvoked;
     final List<String> suspectReasons = new ArrayList<>(50);
 
     @Override
     public void memberJoined(DistributionManager distributionManager,
-        InternalDistributedMember id) {}
+        InternalDistributedMember id) {
+      // nothing
+    }
 
     @Override
     public void memberDeparted(DistributionManager distributionManager,
-        InternalDistributedMember id, boolean crashed) {}
+        InternalDistributedMember id, boolean crashed) {
+      // nothing
+    }
 
     @Override
     public void memberSuspect(DistributionManager distributionManager, InternalDistributedMember id,
diff --git a/geode-core/src/distributedTest/java/org/apache/geode/distributed/LocatorUDPSecurityDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/distributed/LocatorUDPSecurityDUnitTest.java
index ba584be..ab778c2 100644
--- a/geode-core/src/distributedTest/java/org/apache/geode/distributed/LocatorUDPSecurityDUnitTest.java
+++ b/geode-core/src/distributedTest/java/org/apache/geode/distributed/LocatorUDPSecurityDUnitTest.java
@@ -25,22 +25,12 @@ import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
 import org.apache.geode.GemFireConfigException;
-import org.apache.geode.internal.AvailablePort;
-import org.apache.geode.test.dunit.DistributedTestUtils;
-import org.apache.geode.test.dunit.NetworkUtils;
-import org.apache.geode.test.dunit.VM;
 import org.apache.geode.test.junit.categories.MembershipTest;
 
-@Category({MembershipTest.class})
+@Category(MembershipTest.class)
 public class LocatorUDPSecurityDUnitTest extends LocatorDUnitTest {
 
   @Override
-  @Test
-  public void testMultipleLocatorsRestartingAtSameTimeWithMissingServers() throws Exception {
-    super.testMultipleLocatorsRestartingAtSameTimeWithMissingServers();
-  }
-
-  @Override
   protected void addDSProps(Properties p) {
     super.addDSProps(p);
     p.setProperty(SECURITY_UDP_DHALGO, "AES:128");
@@ -48,23 +38,17 @@ public class LocatorUDPSecurityDUnitTest extends LocatorDUnitTest {
 
   @Test
   public void testLocatorWithUDPSecurityButServer() {
-    VM vm = VM.getVM(0);
-
-    final int port = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
-    DistributedTestUtils.deleteLocatorStateFile(port1);
-    final String locators = NetworkUtils.getServerHostName() + "[" + port + "]";
+    String locators = hostName + "[" + port1 + "]";
 
-    startLocatorWithSomeBasicProperties(vm, port);
+    startLocatorWithSomeBasicProperties(vm0, port1);
 
     try {
       Properties props = getBasicProperties(locators);
       props.setProperty(MEMBER_TIMEOUT, "1000");
       system = getConnectedDistributedSystem(props);
       fail("Should not have reached this line, it should have caught the exception.");
-    } catch (GemFireConfigException gce) {
-      assertThat(gce.getMessage()).contains("Rejecting findCoordinatorRequest");
-    } finally {
-      vm.invoke(LocatorDUnitTest::stopLocator);
+    } catch (GemFireConfigException e) {
+      assertThat(e.getMessage()).contains("Rejecting findCoordinatorRequest");
     }
   }
 }
diff --git a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/PartitionedRegionCacheXMLExampleDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/PartitionedRegionCacheXMLExampleDUnitTest.java
index aed3a0d..c705634 100755
--- a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/PartitionedRegionCacheXMLExampleDUnitTest.java
+++ b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/PartitionedRegionCacheXMLExampleDUnitTest.java
@@ -16,7 +16,7 @@ package org.apache.geode.internal.cache;
 
 import static org.apache.geode.cache.Region.SEPARATOR;
 import static org.apache.geode.distributed.ConfigurationProperties.CACHE_XML_FILE;
-import static org.apache.geode.test.dunit.Host.getHost;
+import static org.apache.geode.test.dunit.VM.getVM;
 import static org.apache.geode.test.util.ResourceUtils.createTempFileFromResource;
 import static org.assertj.core.api.Assertions.assertThat;
 
@@ -33,7 +33,6 @@ import org.apache.geode.test.dunit.cache.CacheTestCase;
 /**
  * This class tests regions created by xml files
  */
-
 public class PartitionedRegionCacheXMLExampleDUnitTest extends CacheTestCase {
 
   private static final String CACHE_XML_FILE_1 = "PartitionRegionCacheExample1.xml";
@@ -44,14 +43,15 @@ public class PartitionedRegionCacheXMLExampleDUnitTest extends CacheTestCase {
   private static final String PARTITIONED_SUBREGION_NAME =
       SEPARATOR + "root" + SEPARATOR + "PartitionedSubRegion";
 
+  private String cacheXmlFileName;
+
   private VM vm0;
   private VM vm1;
-  private String cacheXmlFileName;
 
   @Before
   public void setUp() throws Exception {
-    vm0 = getHost(0).getVM(0);
-    vm1 = getHost(0).getVM(1);
+    vm0 = getVM(0);
+    vm1 = getVM(1);
   }
 
   @After
diff --git a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/StartServerWithXmlDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/StartServerWithXmlDUnitTest.java
index ff5a6d8..9d41094 100644
--- a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/StartServerWithXmlDUnitTest.java
+++ b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/StartServerWithXmlDUnitTest.java
@@ -12,7 +12,6 @@
  * or implied. See the License for the specific language governing permissions and limitations under
  * the License.
  */
-
 package org.apache.geode.internal.cache;
 
 import static org.apache.geode.distributed.ConfigurationProperties.CACHE_XML_FILE;
@@ -22,6 +21,7 @@ import static org.assertj.core.api.Assertions.assertThat;
 
 import java.util.Properties;
 
+import org.junit.After;
 import org.junit.Before;
 import org.junit.Rule;
 import org.junit.Test;
@@ -35,6 +35,8 @@ import org.apache.geode.test.dunit.rules.MemberVM;
 
 public class StartServerWithXmlDUnitTest {
 
+  private static Cache cache;
+
   private VM server;
   private MemberVM locator;
 
@@ -45,28 +47,36 @@ public class StartServerWithXmlDUnitTest {
   public void before() throws Exception {
     locator = cluster.startLocatorVM(0);
 
-    Properties props = new Properties();
     String locators = "localhost[" + locator.getPort() + "]";
-    props.setProperty(LOCATORS, locators);
     String cacheXmlPath =
         createTempFileFromResource(getClass(), "CacheServerWithZeroPort.xml")
             .getAbsolutePath();
+
+    Properties props = new Properties();
+    props.setProperty(LOCATORS, locators);
     props.setProperty(CACHE_XML_FILE, cacheXmlPath);
 
     server = cluster.getVM(1);
 
     server.invoke(() -> {
       ServerLauncherParameters.INSTANCE.withBindAddress("localhost");
-      CacheFactory cf = new CacheFactory(props);
-      Cache cache = cf.create();
+      cache = new CacheFactory(props).create();
+    });
+  }
+
+  @After
+  public void tearDown() {
+    server.invoke(() -> {
+      cache.close();
+      cache = null;
     });
   }
 
   @Test
   public void startServerWithXMLNotToStartDefaultCacheServer() {
-    // Verify that when there is a declarative cache server then we dont launch default server
+    // Verify that when there is a declarative cache server then we don't launch default server
     server.invoke(() -> {
-      assertThat(GemFireCacheImpl.getInstance().getCacheServers().size()).isEqualTo(1);
+      assertThat(cache.getCacheServers().size()).isEqualTo(1);
     });
   }
 }
diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/MembershipTestHook.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/MembershipTestHook.java
index b9c45bf..1db7d89 100644
--- a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/MembershipTestHook.java
+++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/MembershipTestHook.java
@@ -15,19 +15,21 @@
 package org.apache.geode.distributed.internal.membership;
 
 /**
- * Test hook for hydra test development
- *
- *
+ * Test hook for membership test development
  */
 public interface MembershipTestHook {
+
   /**
    * test hook invoked prior to shutting down distributed system
    */
-  void beforeMembershipFailure(String reason, Throwable cause);
+  default void beforeMembershipFailure(String reason, Throwable cause) {
+    // nothing
+  }
 
   /**
    * test hook invoked after shutting down distributed system
    */
-  void afterMembershipFailure(String reason, Throwable cause);
-
+  default void afterMembershipFailure(String reason, Throwable cause) {
+    // nothing
+  }
 }


[geode] 03/03: GEODE-6742: Rename and move ExceptionsDUnitTest to integrationTest

Posted by kl...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

klund pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode.git

commit d315756f958e91875bbe79179de1ed37141502b6
Author: Kirk Lund <kl...@apache.org>
AuthorDate: Mon May 6 11:04:10 2019 -0700

    GEODE-6742: Rename and move ExceptionsDUnitTest to integrationTest
    
    * Rename to TransactionTimeoutExceptionIntegrationTest.
    * Fix up the tests with catchThrowable and assertions.
    * Move cachejta.xml and newDB to TemporaryFolder.
    * Use apache commons utils instead of inlined code.
    * Use just the XAPooledDataSource.
---
 .../internal/jta/dunit/ExceptionsDUnitTest.java    | 296 ---------------------
 ...TransactionTimeoutExceptionIntegrationTest.java | 199 ++++++++++++++
 ...ionTimeoutExceptionIntegrationTest_cachejta.xml | 250 +++++++++++++++++
 3 files changed, 449 insertions(+), 296 deletions(-)

diff --git a/geode-core/src/distributedTest/java/org/apache/geode/internal/jta/dunit/ExceptionsDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/internal/jta/dunit/ExceptionsDUnitTest.java
deleted file mode 100755
index 60cf828..0000000
--- a/geode-core/src/distributedTest/java/org/apache/geode/internal/jta/dunit/ExceptionsDUnitTest.java
+++ /dev/null
@@ -1,296 +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.geode.internal.jta.dunit;
-
-import static org.apache.geode.distributed.ConfigurationProperties.CACHE_XML_FILE;
-import static org.apache.geode.test.util.ResourceUtils.createTempFileFromResource;
-import static org.junit.Assert.fail;
-
-import java.io.BufferedReader;
-import java.io.BufferedWriter;
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.FileReader;
-import java.io.IOException;
-import java.io.OutputStreamWriter;
-import java.sql.SQLException;
-import java.util.Properties;
-
-import javax.naming.Context;
-import javax.sql.DataSource;
-import javax.transaction.UserTransaction;
-
-import org.apache.geode.cache.Cache;
-import org.apache.geode.cache.CacheFactory;
-import org.apache.geode.distributed.DistributedSystem;
-import org.apache.geode.internal.OSProcess;
-import org.apache.geode.internal.jta.CacheUtils;
-import org.apache.geode.test.dunit.Host;
-import org.apache.geode.test.dunit.LogWriterUtils;
-import org.apache.geode.test.dunit.VM;
-import org.apache.geode.test.dunit.internal.JUnit4DistributedTestCase;
-
-// TODO: this is a broken test that does not run
-public class ExceptionsDUnitTest extends JUnit4DistributedTestCase {
-
-  static DistributedSystem ds;
-  static Cache cache;
-  // private static String tblName;
-
-  private static String readFile(String filename) throws IOException {
-    // String lineSep = System.getProperty("\n");
-    BufferedReader br = new BufferedReader(new FileReader(filename));
-    String nextLine = "";
-    StringBuffer sb = new StringBuffer();
-    while ((nextLine = br.readLine()) != null) {
-      sb.append(nextLine);
-      //
-      // note:
-      // BufferedReader strips the EOL character.
-      //
-      // sb.append(lineSep);
-    }
-    LogWriterUtils.getLogWriter().fine("***********\n " + sb);
-    return sb.toString();
-  }
-
-  public ExceptionsDUnitTest() {
-    super();
-  }
-
-  private static String modifyFile(String str) throws IOException {
-    String search = "<jndi-binding type=\"XAPooledDataSource\"";
-    String last_search = "</jndi-binding>";
-    String newDB = "newDB_" + OSProcess.getId();
-    String jndi_str =
-        "<jndi-binding type=\"XAPooledDataSource\" jndi-name=\"XAPooledDataSource\"          jdbc-driver-class=\"org.apache.derby.jdbc.EmbeddedDriver\" init-pool-size=\"5\" max-pool-size=\"5\" idle-timeout-seconds=\"600\" blocking-timeout-seconds=\"6\" login-timeout-seconds=\"2\" conn-pooled-datasource-class=\"org.apache.derby.jdbc.EmbeddedConnectionPoolDataSource\" xa-datasource-class=\"org.apache.derby.jdbc.EmbeddedXADataSource\" user-name=\"mitul\" password=\"83f0069202c571faf1ae6c42b [...]
-            + newDB + ";create=true\" >";
-    String config_prop = "<config-property>"
-        + "<config-property-name>description</config-property-name>"
-        + "<config-property-type>java.lang.String</config-property-type>"
-        + "<config-property-value>hi</config-property-value>" + "</config-property>"
-        + "<config-property>" + "<config-property-name>user</config-property-name>"
-        + "<config-property-type>java.lang.String</config-property-type>"
-        + "<config-property-value>jeeves</config-property-value>" + "</config-property>"
-        + "<config-property>" + "<config-property-name>password</config-property-name>"
-        + "<config-property-type>java.lang.String</config-property-type>"
-        + "<config-property-value>83f0069202c571faf1ae6c42b4ad46030e4e31c17409e19a</config-property-value>        "
-        + "</config-property>" + "<config-property>"
-        + "<config-property-name>databaseName</config-property-name>"
-        + "<config-property-type>java.lang.String</config-property-type>"
-        + "<config-property-value>" + newDB + "</config-property-value>" + "</config-property>\n";
-    String new_str = jndi_str + config_prop;
-    /*
-     * String new_str = " <jndi-binding type=\"XAPooledDataSource\" jndi-name=\"XAPooledDataSource\"
-     * jdbc-driver-class=\"org.apache.derby.jdbc.EmbeddedDriver\"
-     * init-pool-size=\"5\" max-pool-size=\"5\" idle-timeout-seconds=\"600\"
-     * blocking-timeout-seconds=\"6\" login-timeout-seconds=\"2\"
-     * conn-pooled-datasource-class=\"org.apache.derby.jdbc.EmbeddedConnectionPoolDataSource\"
-     * xa-datasource-class=\"org.apache.derby.jdbc.EmbeddedXADataSource\" user-name=\"mitul\"
-     * password=\"83f0069202c571faf1ae6c42b4ad46030e4e31c17409e19a\"
-     * connection-url=\"jdbc:derby:"+newDB+";create=true\" > <property
-     * key=\"description\" value=\"hi\"/> <property key=\"databaseName\"
-     * value=\""+newDB+"\"/> <property key=\"user\" value=\"mitul\"/> <property key=\"password\"
-     * value=\"83f0069202c571faf1ae6c42b4ad46030e4e31c17409e19a\"/>";
-     */
-    int n1 = str.indexOf(search);
-    LogWriterUtils.getLogWriter().fine("Start Index = " + n1);
-    int n2 = str.indexOf(last_search, n1);
-    StringBuffer sbuff = new StringBuffer(str);
-    LogWriterUtils.getLogWriter().fine("END Index = " + n2);
-    String modified_str = sbuff.replace(n1, n2, new_str).toString();
-    return modified_str;
-  }
-
-  public static void init() throws Exception {
-    Properties props = new Properties();
-    int pid = OSProcess.getId();
-    String path = File.createTempFile("dunit-cachejta_", ".xml").getAbsolutePath();
-    /** * Return file as string and then modify the string accordingly ** */
-    String file_as_str = readFile(
-        createTempFileFromResource(CacheUtils.class, "cachejta.xml")
-            .getAbsolutePath());
-    file_as_str = file_as_str.replaceAll("newDB", "newDB_" + pid);
-    String modified_file_str = modifyFile(file_as_str);
-    FileOutputStream fos = new FileOutputStream(path);
-    BufferedWriter wr = new BufferedWriter(new OutputStreamWriter(fos));
-    wr.write(modified_file_str);
-    wr.flush();
-    wr.close();
-    props.setProperty(CACHE_XML_FILE, path);
-    // String tableName = "";
-    // props.setProperty(DistributionConfig.ConfigurationProperties.MCAST_PORT, "10339");
-    try {
-      // ds = DistributedSystem.connect(props);
-      ds = (new ExceptionsDUnitTest()).getSystem(props);
-      cache = CacheFactory.create(ds);
-    } catch (Exception e) {
-      e.printStackTrace(System.err);
-      throw new Exception("" + e);
-    }
-  }
-
-  public static Cache getCache() {
-    return cache;
-  }
-
-  public static void startCache() {
-    try {
-      if (cache == null || cache.isClosed()) {
-        cache = CacheFactory.create(ds);
-      }
-    } catch (Exception e) {
-      e.printStackTrace();
-    }
-  }
-
-  public static void closeCache() {
-    try {
-      if (cache != null && !cache.isClosed()) {
-        cache.close();
-      }
-    } catch (Exception e) {
-      e.printStackTrace();
-    }
-    try {
-      if (ds != null)
-        ds.disconnect();
-    } catch (Exception e) {
-      LogWriterUtils.getLogWriter().fine("Error in disconnecting from Distributed System");
-    }
-  }
-
-  @Override
-  public final void postSetUp() throws Exception {
-    Host host = Host.getHost(0);
-    VM vm0 = host.getVM(0);
-    vm0.invoke(() -> ExceptionsDUnitTest.init());
-  }
-
-  @Override
-  public final void preTearDown() throws Exception {
-    Host host = Host.getHost(0);
-    VM vm0 = host.getVM(0);
-    vm0.invoke(() -> ExceptionsDUnitTest.closeCache());
-  }
-
-  public static void testBlockingTimeOut() {
-    Host host = Host.getHost(0);
-    VM vm0 = host.getVM(0);
-    vm0.invoke(() -> ExceptionsDUnitTest.runTest1());
-  }
-
-  public static void testLoginTimeOut() {
-    Host host = Host.getHost(0);
-    VM vm0 = host.getVM(0);
-    vm0.invoke(() -> ExceptionsDUnitTest.runTest2());
-  }
-
-  public static void testTransactionTimeOut() {
-    Host host = Host.getHost(0);
-    VM vm0 = host.getVM(0);
-    vm0.invoke(() -> ExceptionsDUnitTest.runTest3());
-  }
-
-  public static void runTest1() throws Exception {
-    boolean exceptionOccurred = false;
-    try {
-      Context ctx = cache.getJNDIContext();
-      DataSource ds1 = null;
-      DataSource ds2 = null;
-      ds1 = (DataSource) ctx.lookup("java:/XAPooledDataSource");
-      ds2 = (DataSource) ctx.lookup("java:/SimpleDataSource");
-      ds2.getConnection();
-      ds1 = (DataSource) ctx.lookup("java:/XAPooledDataSource");
-      UserTransaction utx = (UserTransaction) ctx.lookup("java:/UserTransaction");
-      utx.begin();
-      ds1.getConnection();
-      Thread.sleep(8000);
-      try {
-        utx.commit();
-      } catch (Exception e) {
-        exceptionOccurred = true;
-      }
-      if (!exceptionOccurred)
-        fail("Exception did not occur on commit although was supposed" + "occur");
-    } catch (Exception e) {
-      LogWriterUtils.getLogWriter().fine("Exception caught in runTest1 due to : " + e);
-      fail("failed in runTest1 due to " + e);
-    }
-  }
-
-  public static void runTest2() throws Exception {
-    boolean exceptionOccurred1 = false;
-    boolean exceptionOccurred2 = false;
-    try {
-      Context ctx = cache.getJNDIContext();
-      DataSource ds1 = null;
-      DataSource ds2 = null;
-      ds1 = (DataSource) ctx.lookup("java:/XAPooledDataSource");
-      ds2 = (DataSource) ctx.lookup("java:/SimpleDataSource");
-      ds2.getConnection();
-      ds1.getConnection();
-      ds1.getConnection();
-      ds1.getConnection();
-      ds1.getConnection();
-      ds1.getConnection();
-      UserTransaction utx = (UserTransaction) ctx.lookup("java:/UserTransaction");
-      utx.begin();
-      try {
-        ds1.getConnection();
-        Thread.sleep(8000);
-      } catch (SQLException e) {
-        exceptionOccurred1 = true;
-      }
-      try {
-        utx.commit();
-      } catch (Exception e) {
-        exceptionOccurred2 = true;
-      }
-      if (!exceptionOccurred1)
-        fail("Exception (Login-Time-Out)did not occur although was supposed" + "to occur");
-      if (exceptionOccurred2)
-        fail("Exception did occur on commit, although was not supposed" + "to occur");
-    } catch (Exception e) {
-      fail("failed in runTest2 due to " + e);
-    }
-  }
-
-  public static void runTest3() throws Exception {
-    boolean exceptionOccurred = false;
-    try {
-      Context ctx = cache.getJNDIContext();
-      DataSource ds1 = null;
-      DataSource ds2 = null;
-      ds1 = (DataSource) ctx.lookup("java:/XAPooledDataSource");
-      ds2 = (DataSource) ctx.lookup("java:/SimpleDataSource");
-      ds2.getConnection();
-      UserTransaction utx = (UserTransaction) ctx.lookup("java:/UserTransaction");
-      utx.begin();
-      utx.setTransactionTimeout(2);
-      ds1.getConnection();
-      Thread.sleep(4000);
-      try {
-        utx.commit();
-      } catch (Exception e) {
-        exceptionOccurred = true;
-      }
-      if (!exceptionOccurred)
-        fail("Exception (Transaction-Time-Out)did not occur although was supposed" + "to occur");
-    } catch (Exception e) {
-      fail("failed in runTest3 due to " + e);
-    }
-  }
-}
diff --git a/geode-core/src/integrationTest/java/org/apache/geode/internal/jta/TransactionTimeoutExceptionIntegrationTest.java b/geode-core/src/integrationTest/java/org/apache/geode/internal/jta/TransactionTimeoutExceptionIntegrationTest.java
new file mode 100755
index 0000000..b13f9f5
--- /dev/null
+++ b/geode-core/src/integrationTest/java/org/apache/geode/internal/jta/TransactionTimeoutExceptionIntegrationTest.java
@@ -0,0 +1,199 @@
+/*
+ * 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.geode.internal.jta;
+
+import static org.apache.geode.distributed.ConfigurationProperties.CACHE_XML_FILE;
+import static org.apache.geode.test.util.ResourceUtils.getResource;
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.assertj.core.api.Assertions.catchThrowable;
+
+import java.io.File;
+import java.nio.charset.Charset;
+import java.sql.SQLException;
+import java.time.Duration;
+import java.util.Properties;
+import java.util.regex.Pattern;
+
+import javax.naming.Context;
+import javax.sql.DataSource;
+import javax.transaction.SystemException;
+import javax.transaction.UserTransaction;
+import javax.transaction.xa.XAException;
+
+import org.apache.commons.io.FileUtils;
+import org.apache.commons.io.IOUtils;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.TemporaryFolder;
+
+import org.apache.geode.cache.Cache;
+import org.apache.geode.cache.CacheFactory;
+import org.apache.geode.internal.process.ProcessUtils;
+
+/**
+ * Fixed up (best as possible) and re-enabled JTA tests from ExceptionsDUnitTest. Treat these as
+ * characterization tests because I think some of this behavior is not strictly correct.
+ */
+public class TransactionTimeoutExceptionIntegrationTest {
+
+  private static final Pattern NEW_DB_PATTERN = Pattern.compile("newDB");
+  private static final int DATA_SOURCE_POOL_SIZE = 2;
+  private static final int BLOCKING_TIMEOUT_SECONDS = 6;
+  private static final int IDLE_TIMEOUT_SECONDS = 600;
+  private static final int LOGIN_TIMEOUT_SECONDS = 2;
+  private static final int TRANSACTION_TIMEOUT_SECONDS = 2;
+
+  private Cache cache;
+
+  @Rule
+  public TemporaryFolder temporaryFolder = new TemporaryFolder();
+
+  @Before
+  public void setUp() throws Exception {
+    String derbySystemHome = temporaryFolder.newFolder("derby").getAbsolutePath();
+    System.setProperty("derby.system.home", derbySystemHome);
+
+    String newDB = "newDB_" + ProcessUtils.identifyPid();
+
+    String input =
+        IOUtils.toString(getResource("TransactionTimeoutExceptionIntegrationTest_cachejta.xml"),
+            Charset.defaultCharset());
+    input = NEW_DB_PATTERN.matcher(input).replaceAll(newDB);
+    String output = modifyCacheJtaXml(input, newDB);
+    File cacheJtaXmlFile = temporaryFolder.newFile("cachejta.xml");
+
+    FileUtils.writeStringToFile(cacheJtaXmlFile, output, Charset.defaultCharset());
+
+    Properties props = new Properties();
+    props.setProperty(CACHE_XML_FILE, cacheJtaXmlFile.getAbsolutePath());
+
+    cache = new CacheFactory(props).create();
+  }
+
+  @After
+  public void tearDown() throws Exception {
+    cache.close();
+  }
+
+  @Test
+  public void testBlockingTimeOut() throws Exception {
+    Context jndiContext = cache.getJNDIContext();
+    DataSource dataSource = (DataSource) jndiContext.lookup("java:/XAPooledDataSource");
+    UserTransaction utx = (UserTransaction) jndiContext.lookup("java:/UserTransaction");
+    utx.begin();
+    dataSource.getConnection();
+
+    // sleep longer than the blocking timeout (nothing exposed to await on)
+    Thread.sleep(Duration.ofSeconds(BLOCKING_TIMEOUT_SECONDS * 2).toMillis());
+
+    Throwable thrown = catchThrowable(() -> utx.commit());
+
+    // NOTE: XAException is double-wrapped in SystemException (probably unintentional)
+    assertThat(thrown)
+        .isInstanceOf(SystemException.class);
+    assertThat(thrown.getCause())
+        .isInstanceOf(SystemException.class)
+        .hasCauseInstanceOf(XAException.class)
+        .hasMessageContaining("No current connection");
+  }
+
+  @Test
+  public void testLoginTimeOut() throws Exception {
+    Context jndiContext = cache.getJNDIContext();
+    DataSource dataSource = (DataSource) jndiContext.lookup("java:/XAPooledDataSource");
+    for (int i = 0; i < DATA_SOURCE_POOL_SIZE; i++) {
+      dataSource.getConnection();
+    }
+
+    Throwable thrown = catchThrowable(() -> dataSource.getConnection());
+
+    assertThat(thrown)
+        .isInstanceOf(SQLException.class)
+        .hasMessageContaining("Login time-out exceeded");
+  }
+
+  @Test
+  public void testTransactionTimeOut() throws Exception {
+    Context jndiContext = cache.getJNDIContext();
+    DataSource dataSource = (DataSource) jndiContext.lookup("java:/XAPooledDataSource");
+    dataSource.getConnection();
+    UserTransaction utx = (UserTransaction) jndiContext.lookup("java:/UserTransaction");
+    utx.begin();
+    utx.setTransactionTimeout(TRANSACTION_TIMEOUT_SECONDS);
+
+    // sleep longer than the transaction timeout (nothing exposed to await on)
+    Thread.sleep(Duration.ofSeconds(TRANSACTION_TIMEOUT_SECONDS * 2).toMillis());
+
+    Throwable thrown = catchThrowable(() -> utx.commit());
+
+    assertThat(thrown)
+        .isInstanceOf(IllegalStateException.class)
+        .hasMessageContaining("Transaction is null, cannot commit a null transaction");
+  }
+
+  private String modifyCacheJtaXml(String jtaConfig, String newDB) {
+    String begin = "<jndi-binding type=\"XAPooledDataSource\"";
+    String end = "</jndi-binding>";
+    String jndiBinding =
+        "<jndi-binding type=\"XAPooledDataSource\" " +
+            "jndi-name=\"XAPooledDataSource\" " +
+            "jdbc-driver-class=\"org.apache.derby.jdbc.EmbeddedDriver\" " +
+            "init-pool-size=\"" + DATA_SOURCE_POOL_SIZE + "\" " +
+            "max-pool-size=\"" + DATA_SOURCE_POOL_SIZE + "\" " +
+            "idle-timeout-seconds=\"" + IDLE_TIMEOUT_SECONDS + "\" " +
+            "blocking-timeout-seconds=\"" + BLOCKING_TIMEOUT_SECONDS + "\" " +
+            "login-timeout-seconds=\"" + LOGIN_TIMEOUT_SECONDS + "\" " +
+            "conn-pooled-datasource-class=\"org.apache.derby.jdbc.EmbeddedConnectionPoolDataSource\" "
+            +
+            "xa-datasource-class=\"org.apache.derby.jdbc.EmbeddedXADataSource\" " +
+            "user-name=\"mitul\" " +
+            "password=\"83f0069202c571faf1ae6c42b4ad46030e4e31c17409e19a\" " +
+            "connection-url=\"jdbc:derby:" + newDB + ";create=true\" >";
+    String configProperty =
+        "<config-property>" +
+            "<config-property-name>description</config-property-name>" +
+            "<config-property-type>java.lang.String</config-property-type>" +
+            "<config-property-value>hi</config-property-value>" +
+            "</config-property>" +
+            "<config-property>" +
+            "<config-property-name>user</config-property-name>" +
+            "<config-property-type>java.lang.String</config-property-type>" +
+            "<config-property-value>jeeves</config-property-value>" +
+            "</config-property>" +
+            "<config-property>" +
+            "<config-property-name>password</config-property-name>" +
+            "<config-property-type>java.lang.String</config-property-type>" +
+            "<config-property-value>" +
+            "83f0069202c571faf1ae6c42b4ad46030e4e31c17409e19a" +
+            "</config-property-value>" +
+            "</config-property>" +
+            "<config-property>" +
+            "<config-property-name>databaseName</config-property-name>" +
+            "<config-property-type>java.lang.String</config-property-type>" +
+            "<config-property-value>" + newDB + "</config-property-value>" +
+            "</config-property>" +
+            System.lineSeparator();
+
+    String modifiedConfig = jndiBinding + configProperty;
+
+    int indexOfBegin = jtaConfig.indexOf(begin);
+    int indexOfEnd = jtaConfig.indexOf(end, indexOfBegin);
+
+    return new StringBuilder(jtaConfig).replace(indexOfBegin, indexOfEnd, modifiedConfig)
+        .toString();
+  }
+}
diff --git a/geode-core/src/integrationTest/resources/org/apache/geode/internal/jta/TransactionTimeoutExceptionIntegrationTest_cachejta.xml b/geode-core/src/integrationTest/resources/org/apache/geode/internal/jta/TransactionTimeoutExceptionIntegrationTest_cachejta.xml
new file mode 100644
index 0000000..fc26388
--- /dev/null
+++ b/geode-core/src/integrationTest/resources/org/apache/geode/internal/jta/TransactionTimeoutExceptionIntegrationTest_cachejta.xml
@@ -0,0 +1,250 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ 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.
+  -->
+<!DOCTYPE cache PUBLIC
+        "-//GemStone Systems, Inc.//GemFire Declarative Caching 7.0//EN"
+        "http://www.gemstone.com/dtd/cache7_0.dtd">
+<cache lock-lease="120" lock-timeout="60" search-timeout="300">
+    <vm-root-region name="root">
+        <region-attributes scope="distributed-no-ack" data-policy="normal" initial-capacity="16" load-factor="0.75" concurrency-level="16" statistics-enabled="true">
+            <region-time-to-live>
+                <expiration-attributes timeout="0" action="invalidate"/>
+            </region-time-to-live>
+            <region-idle-time>
+                <expiration-attributes timeout="0" action="invalidate"/>
+            </region-idle-time>
+            <entry-time-to-live>
+                <expiration-attributes timeout="0" action="invalidate"/>
+            </entry-time-to-live>
+            <entry-idle-time>
+                <expiration-attributes timeout="0" action="invalidate"/>
+            </entry-idle-time>
+        </region-attributes>
+        <entry>
+            <key>
+                <string>Application Version</string>
+            </key>
+            <value>
+                <string>1.0</string>
+            </value>
+        </entry>
+    </vm-root-region>
+
+    <jndi-bindings>
+        <jndi-binding type="SimpleDataSource" jndi-name="SimpleDataSource"
+                      jdbc-driver-class="org.apache.derby.jdbc.EmbeddedDriver"
+                      init-pool-size="2" max-pool-size="7"
+                      idle-timeout-seconds="40"
+                      blocking-timeout-seconds="40"
+                      login-timeout-seconds="60"
+                      conn-pooled-datasource-class="org.apache.derby.jdbc.EmbeddedConnectionPoolDataSource"
+                      xa-datasource-class="org.apache.derby.jdbc.EmbeddedXADataSource"
+                      user-name="mitul"
+                      password="83f0069202c571faf1ae6c42b4ad46030e4e31c17409e19a"
+                      connection-url="jdbc:derby:newDB;create=true">
+            <config-property>
+                <config-property-name>description</config-property-name>
+                <config-property-type>java.lang.String</config-property-type>
+                <config-property-value>hi</config-property-value>
+            </config-property>
+
+            <config-property>
+                <config-property-name>databaseName</config-property-name>
+                <config-property-type>java.lang.String</config-property-type>
+                <config-property-value>newDB</config-property-value>
+            </config-property>
+        </jndi-binding>
+
+        <jndi-binding type="PooledDataSource" jndi-name="PooledDataSource"
+                      jdbc-driver-class="org.apache.derby.jdbc.EmbeddedDriver"
+                      init-pool-size="2" max-pool-size="7"
+                      idle-timeout-seconds="20"
+                      blocking-timeout-seconds="20"
+                      login-timeout-seconds="30"
+                      conn-pooled-datasource-class="org.apache.geode.internal.jta.CacheJTAPooledDataSourceFactory"
+                      xa-datasource-class="org.apache.derby.jdbc.EmbeddedXADataSource"
+                      user-name="mitul"
+                      password="83f0069202c571faf1ae6c42b4ad46030e4e31c17409e19a"
+                      connection-url="jdbc:derby:newDB;create=true">
+
+            <config-property>
+                <config-property-name>description</config-property-name>
+                <config-property-type>java.lang.String</config-property-type>
+                <config-property-value>hi</config-property-value>
+            </config-property>
+
+            <config-property>
+                <config-property-name>user</config-property-name>
+                <config-property-type>java.lang.String</config-property-type>
+                <config-property-value>mitul</config-property-value>
+            </config-property>
+
+            <config-property>
+                <config-property-name>password</config-property-name>
+                <config-property-type>java.lang.String</config-property-type>
+                <config-property-value>83f0069202c571faf1ae6c42b4ad46030e4e31c17409e19a</config-property-value>
+            </config-property>
+
+            <config-property>
+                <config-property-name>databaseName</config-property-name>
+                <config-property-type>java.lang.String</config-property-type>
+                <config-property-value>newDB</config-property-value>
+            </config-property>
+
+        </jndi-binding>
+
+        <jndi-binding type="XAPooledDataSource" jndi-name="XAPooledDataSource"
+                      jdbc-driver-class="org.apache.derby.jdbc.EmbeddedDriver"
+                      init-pool-size="2" max-pool-size="7"
+                      idle-timeout-seconds="20"
+                      blocking-timeout-seconds="20"
+                      login-timeout-seconds="30"
+                      conn-pooled-datasource-class="org.apache.derby.jdbc.EmbeddedConnectionPoolDataSource"
+                      xa-datasource-class="org.apache.derby.jdbc.EmbeddedXADataSource"
+                      user-name="mitul"
+                      password="83f0069202c571faf1ae6c42b4ad46030e4e31c17409e19a"
+                      connection-url="jdbc:derby:newDB;create=true">
+            <config-property>
+                <config-property-name>description</config-property-name>
+                <config-property-type>java.lang.String</config-property-type>
+                <config-property-value>hi</config-property-value>
+            </config-property>
+
+            <config-property>
+                <config-property-name>user</config-property-name>
+                <config-property-type>java.lang.String</config-property-type>
+                <config-property-value>mitul</config-property-value>
+            </config-property>
+
+            <config-property>
+                <config-property-name>password</config-property-name>
+                <config-property-type>java.lang.String</config-property-type>
+                <config-property-value>83f0069202c571faf1ae6c42b4ad46030e4e31c17409e19a</config-property-value>
+            </config-property>
+
+            <config-property>
+                <config-property-name>databaseName</config-property-name>
+                <config-property-type>java.lang.String</config-property-type>
+                <config-property-value>newDB</config-property-value>
+            </config-property>
+
+        </jndi-binding>
+        <jndi-binding type="XAPooledDataSource" jndi-name="XAHydraPooledDataSource"
+                      jdbc-driver-class="org.apache.derby.jdbc.EmbeddedDriver"
+                      init-pool-size="2" max-pool-size="30"
+                      idle-timeout-seconds="300"
+                      blocking-timeout-seconds="300"
+                      login-timeout-seconds="50"
+                      conn-pooled-datasource-class="org.apache.derby.jdbc.EmbeddedConnectionPoolDataSource"
+                      xa-datasource-class="org.apache.derby.jdbc.EmbeddedXADataSource"
+                      user-name="mitul"
+                      password="83f0069202c571faf1ae6c42b4ad46030e4e31c17409e19a"
+                      connection-url="jdbc:derby:newDB;create=true">
+            <config-property>
+                <config-property-name>description</config-property-name>
+                <config-property-type>java.lang.String</config-property-type>
+                <config-property-value>hi</config-property-value>
+            </config-property>
+
+            <config-property>
+                <config-property-name>user</config-property-name>
+                <config-property-type>java.lang.String</config-property-type>
+                <config-property-value>mitul</config-property-value>
+            </config-property>
+
+            <config-property>
+                <config-property-name>password</config-property-name>
+                <config-property-type>java.lang.String</config-property-type>
+                <config-property-value>83f0069202c571faf1ae6c42b4ad46030e4e31c17409e19a</config-property-value>
+            </config-property>
+
+            <config-property>
+                <config-property-name>databaseName</config-property-name>
+                <config-property-type>java.lang.String</config-property-type>
+                <config-property-value>newDB</config-property-value>
+            </config-property>
+
+        </jndi-binding>
+
+        <jndi-binding type="XAPooledDataSource" jndi-name="XAMultiThreadedDataSource"
+                      jdbc-driver-class="org.apache.derby.jdbc.EmbeddedDriver"
+                      init-pool-size="2" max-pool-size="5"
+                      idle-timeout-seconds="300"
+                      blocking-timeout-seconds="300"
+                      login-timeout-seconds="300"
+                      conn-pooled-datasource-class="org.apache.derby.jdbc.EmbeddedConnectionPoolDataSource"
+                      xa-datasource-class="org.apache.derby.jdbc.EmbeddedXADataSource"
+                      user-name="mitul"
+                      password="83f0069202c571faf1ae6c42b4ad46030e4e31c17409e19a"
+                      connection-url="jdbc:derby:newDB;create=true">
+            <config-property>
+                <config-property-name>description</config-property-name>
+                <config-property-type>java.lang.String</config-property-type>
+                <config-property-value>hi</config-property-value>
+            </config-property>
+
+            <config-property>
+                <config-property-name>user</config-property-name>
+                <config-property-type>java.lang.String</config-property-type>
+                <config-property-value>mitul</config-property-value>
+            </config-property>
+
+            <config-property>
+                <config-property-name>password</config-property-name>
+                <config-property-type>java.lang.String</config-property-type>
+                <config-property-value>83f0069202c571faf1ae6c42b4ad46030e4e31c17409e19a</config-property-value>
+            </config-property>
+
+            <config-property>
+                <config-property-name>databaseName</config-property-name>
+                <config-property-type>java.lang.String</config-property-type>
+                <config-property-value>newDB</config-property-value>
+            </config-property>
+
+        </jndi-binding>
+    </jndi-bindings>
+</cache>
+<!--
+Binding TransactionManager
+Case 1: Use of GemFire JNDI Context
+GemFire TransactionManager will be bound to the GemFire JNDI tree.
+
+Case 2: Application Server JNDI Context
+    If a TransactionManager is associated with Application Server JNDI tree (if exists),
+    the GemFire system will make reference of that. Otherwise GemFire TransactionManager
+    will be bound to the Application Server JNDI tree.
+
+Binding UserTransaction
+    UserTransaction will be bound to same JNDI tree where GemFire TransactionManager is bound.
+  If an Application Server TransactionManager bound to Application Server JNDI tree
+  GemFire UserTransaction will not be bound at all.
+
+Lookup for UserTransaction
+
+Case 1: Use of Application Server JNDI tree and Application Server TransactionManager is available.
+    GemFire UserTransaction will not come into picture.
+    Should be referred as per Application Server specification.
+Case 2: In any other case (Includes use of GemFire JNDI tree, Application Server JNDI tree with
+GemFire TransactionManager)
+    UserTransaction will be looked up with java:/UserTransaction
+
+
+Binding and Lookup of DataSource
+ In all scenario, the GemFire DataSource will be bound to the available JNDI tree.
+ jndi-name attribute of jndi-binding element is key binding parameters.
+ if the value of jndi-name is aDataSource, it will be bound as java:/aDataSource.
+ The type attribute of jndi-binding element should be SimpleDataSource, PooledDataSource
+ or XAPooledDataSource.
+-->


[geode] 01/03: GEODE-6731: Make TestUtil delegate to ResourceUtils

Posted by kl...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

klund pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode.git

commit 2a8259fd873ef0d5000cfe4bb2e3f513b61510fc
Author: Kirk Lund <kl...@apache.org>
AuthorDate: Thu May 2 11:00:10 2019 -0700

    GEODE-6731: Make TestUtil delegate to ResourceUtils
    
    * Make TestUtil delegate to ResourceUtils.
    * Add deprecation annotations and javadocs.
    * Use static import for all uses of ResourceUtils.
---
 .../geode/session/tests/ContainerInstall.java      |   4 +-
 ...scribeConfigAreFullyRedactedAcceptanceTest.java |  71 ++++----
 .../GradleBuildWithGeodeCoreAcceptanceTest.java    |   7 +-
 ...tandaloneClientManagementAPIAcceptanceTest.java |  10 +-
 .../internal/web/RestFunctionExecuteDUnitTest.java |   8 +-
 .../web/controllers/RestAPIsWithSSLDUnitTest.java  |  17 +-
 .../geode/AssemblyContentsIntegrationTest.java     |   5 +-
 .../org/apache/geode/BundledJarsJUnitTest.java     |   5 +-
 .../geode/GeodeDependencyJarIntegrationTest.java   |   6 +-
 .../rest/internal/web/RestSecurityWithSSLTest.java |   5 +-
 .../tools/pulse/PulseSecurityWithSSLTest.java      |   6 +-
 .../cli/CreateMappingCommandDUnitTest.java         |   5 +-
 .../geode/ClusterCommunicationsDUnitTest.java      |  11 +-
 .../CacheServerSSLConnectionDUnitTest.java         |  20 ++-
 .../client/internal/SSLNoClientAuthDUnitTest.java  |  18 +-
 ...artitionedRegionCompactRangeIndexDUnitTest.java |   5 +-
 .../query/partitioned/PRQueryDUnitHelper.java      |   6 +-
 .../apache/geode/cache30/CacheXml66DUnitTest.java  |  14 +-
 .../cache30/ReconnectWithCacheXMLDUnitTest.java    |   6 +-
 .../apache/geode/distributed/LocatorDUnitTest.java |  10 +-
 .../PartitionedRegionCacheXMLExampleDUnitTest.java |   5 +-
 .../cache/StartServerWithXmlDUnitTest.java         |   7 +-
 .../internal/jta/dunit/ExceptionsDUnitTest.java    |   8 +-
 .../internal/jta/dunit/IdleTimeOutDUnitTest.java   |   7 +-
 .../internal/jta/dunit/LoginTimeOutDUnitTest.java  |   7 +-
 .../internal/jta/dunit/MaxPoolSizeDUnitTest.java   |   7 +-
 .../jta/dunit/TransactionTimeOutDUnitTest.java     |   6 +-
 .../jta/dunit/TxnManagerMultiThreadDUnitTest.java  |   6 +-
 .../internal/jta/dunit/TxnTimeOutDUnitTest.java    |   6 +-
 .../geode/internal/tcp/TCPConduitDUnitTest.java    |   9 +-
 .../apache/geode/management/JMXMBeanDUnitTest.java |  16 +-
 ...DeployCommandFunctionRegistrationDUnitTest.java |   5 +-
 ...rConfigServerRestartWithJarDeployDUnitTest.java |   6 +-
 ...urationPersistenceServiceUsingDirDUnitTest.java |   7 +-
 .../configuration/DeployJarWithSSLDUnitTest.java   |   6 +-
 .../geode/pdx/JSONPdxClientServerDUnitTest.java    |   4 +-
 .../cache/client/internal/LocatorSSLJUnitTest.java |   5 +-
 .../index/DeclarativeIndexCreationJUnitTest.java   |   6 +-
 .../internal/tcpserver/TCPServerSSLJUnitTest.java  |   8 +-
 .../internal/cache/DiskRegCacheXmlJUnitTest.java   |   6 +-
 .../DiskRegionIllegalCacheXMLvaluesJUnitTest.java  |   5 +-
 .../tier/sockets/RedundancyLevelJUnitTest.java     |   6 +-
 .../AsyncEventQueueValidationsJUnitTest.java       |   8 +-
 .../datasource/AbstractPoolCacheJUnitTest.java     |   6 +-
 .../internal/datasource/CleanUpJUnitTest.java      |   7 +-
 .../ConnectionPoolCacheImplJUnitTest.java          |   5 +-
 .../datasource/ConnectionPoolingJUnitTest.java     |   6 +-
 .../datasource/DataSourceFactoryJUnitTest.java     |   6 +-
 .../internal/datasource/RestartJUnitTest.java      |   7 +-
 .../internal/jta/BlockingTimeOutJUnitTest.java     |   6 +-
 .../geode/internal/jta/DataSourceJTAJUnitTest.java |  18 +-
 .../internal/jta/GlobalTransactionJUnitTest.java   |   6 +-
 .../internal/jta/TransactionTimeOutJUnitTest.java  |   5 +-
 .../StatArchiveWriterReaderIntegrationTest.java    |  12 +-
 .../commands/HTTPServiceSSLSupportJUnitTest.java   |   5 +-
 .../internal/deployment/FunctionScannerTest.java   |   5 +-
 .../cache/execute/FunctionAdapterJUnitTest.java    |   7 +-
 .../net/SocketCreatorFactoryJUnitTest.java         |  18 +-
 .../geode/internal/net/SocketCreatorJUnitTest.java |   4 +-
 .../geode/internal/util/PluckStacksUnitTest.java   |   6 +-
 .../generator/LdapUserCredentialGenerator.java     |  22 ++-
 .../generator/PKCSCredentialGenerator.java         |  21 ++-
 .../generator/XmlAuthzCredentialGenerator.java     |   9 +-
 .../apache/geode/experimental/driver/SSLTest.java  |  21 ++-
 .../org/apache/geode/internal/jta/CacheUtils.java  |   6 +-
 .../org/apache/geode/test/util/ResourceUtils.java  | 198 ++++++++++++++++++---
 .../java/org/apache/geode/util/test/TestUtil.java  |  81 ---------
 .../test/util/ResourceUtilsIntegrationTest.java    |   5 +-
 .../apache/geode/test/util/ResourceUtilsTest.java  |   4 +-
 .../cache/lucene/LuceneIndexCreationDUnitTest.java |   6 +-
 .../LuceneIndexXmlParserIntegrationJUnitTest.java  |   6 +-
 .../acceptance/CacheConnectionIntegrationTest.java |  15 +-
 .../v1/acceptance/CacheOperationsJUnitTest.java    |  18 +-
 .../geode/internal/cache/wan/WANTestBase.java      |  18 +-
 ...ewayReceiverXmlParsingValidationsJUnitTest.java |  14 +-
 .../cli/commands/ConnectCommandWithSSLTest.java    |   6 +-
 76 files changed, 595 insertions(+), 379 deletions(-)

diff --git a/geode-assembly/geode-assembly-test/src/main/java/org/apache/geode/session/tests/ContainerInstall.java b/geode-assembly/geode-assembly-test/src/main/java/org/apache/geode/session/tests/ContainerInstall.java
index c064aeb..09d8e95 100644
--- a/geode-assembly/geode-assembly-test/src/main/java/org/apache/geode/session/tests/ContainerInstall.java
+++ b/geode-assembly/geode-assembly-test/src/main/java/org/apache/geode/session/tests/ContainerInstall.java
@@ -14,6 +14,7 @@
  */
 package org.apache.geode.session.tests;
 
+import static org.apache.geode.test.util.ResourceUtils.getResource;
 import static org.assertj.core.api.Assertions.assertThat;
 
 import java.io.File;
@@ -47,7 +48,6 @@ import org.w3c.dom.NodeList;
 
 import org.apache.geode.internal.logging.LogService;
 import org.apache.geode.management.internal.configuration.utils.ZipUtils;
-import org.apache.geode.util.test.TestUtil;
 
 /**
  * Base class for handling downloading and configuring J2EE containers.
@@ -145,7 +145,7 @@ public abstract class ContainerInstall {
 
     clearPreviousInstall(installDir);
 
-    String resource = TestUtil.getResourcePath(getClass(), "/" + downloadURL);
+    String resource = getResource(getClass(), "/" + downloadURL).getPath();
     URL url = Paths.get(resource).toUri().toURL();
     logger.info("Installing container from URL " + url);
 
diff --git a/geode-assembly/src/acceptanceTest/java/org/apache/geode/management/internal/cli/commands/LogsAndDescribeConfigAreFullyRedactedAcceptanceTest.java b/geode-assembly/src/acceptanceTest/java/org/apache/geode/management/internal/cli/commands/LogsAndDescribeConfigAreFullyRedactedAcceptanceTest.java
index 82ab969..1c0cc17 100644
--- a/geode-assembly/src/acceptanceTest/java/org/apache/geode/management/internal/cli/commands/LogsAndDescribeConfigAreFullyRedactedAcceptanceTest.java
+++ b/geode-assembly/src/acceptanceTest/java/org/apache/geode/management/internal/cli/commands/LogsAndDescribeConfigAreFullyRedactedAcceptanceTest.java
@@ -16,6 +16,7 @@ package org.apache.geode.management.internal.cli.commands;
 
 import static org.apache.geode.distributed.ConfigurationProperties.LOG_LEVEL;
 import static org.apache.geode.distributed.ConfigurationProperties.SECURITY_MANAGER;
+import static org.apache.geode.test.util.ResourceUtils.getResource;
 import static org.assertj.core.api.Assertions.assertThat;
 
 import java.io.File;
@@ -36,22 +37,23 @@ import org.apache.geode.examples.security.ExampleSecurityManager;
 import org.apache.geode.management.internal.cli.util.CommandStringBuilder;
 import org.apache.geode.test.junit.categories.LoggingTest;
 import org.apache.geode.test.junit.categories.SecurityTest;
+import org.apache.geode.test.junit.rules.RequiresGeodeHome;
 import org.apache.geode.test.junit.rules.gfsh.GfshExecution;
 import org.apache.geode.test.junit.rules.gfsh.GfshRule;
-import org.apache.geode.util.test.TestUtil;
 
 /**
  * This test class expects a "security.json" file to be visible on the member classpath. The
- * security.json is consumed by {@link org.apache.geode.examples.security.ExampleSecurityManager}
- * and should contain each username/password combination present (even though not all will actually
- * be consumed by the Security Manager).
+ * security.json is consumed by {@link ExampleSecurityManager} and should contain each
+ * username/password combination present (even though not all will actually be consumed by the
+ * Security Manager).
  *
+ * <p>
  * Each password shares the string below for easier log scanning.
  */
 @Category({SecurityTest.class, LoggingTest.class})
 public class LogsAndDescribeConfigAreFullyRedactedAcceptanceTest {
 
-  private static String sharedPasswordString = "abcdefg";
+  private static final String sharedPasswordString = "abcdefg";
 
   private File propertyFile;
   private File securityPropertyFile;
@@ -59,6 +61,9 @@ public class LogsAndDescribeConfigAreFullyRedactedAcceptanceTest {
   @Rule
   public GfshRule gfsh = new GfshRule();
 
+  @Rule
+  public RequiresGeodeHome geodeHome = new RequiresGeodeHome();
+
   @Before
   public void createDirectoriesAndFiles() throws Exception {
     propertyFile = gfsh.getTemporaryFolder().newFile("geode.properties");
@@ -85,36 +90,32 @@ public class LogsAndDescribeConfigAreFullyRedactedAcceptanceTest {
     startSecureLocatorAndServer();
   }
 
-  private void startSecureLocatorAndServer() throws Exception {
-    try {
-      // The json is in the root resource directory.
-      String securityJson = TestUtil.getResourcePath(
-          LogsAndDescribeConfigAreFullyRedactedAcceptanceTest.class, "/security.json");
-      // We want to add the folder to the classpath, so we strip off the filename.
-      securityJson = securityJson.substring(0, securityJson.length() - "security.json".length());
-      String startLocatorCmd =
-          new CommandStringBuilder("start locator").addOption("name", "test-locator")
-              .addOption("properties-file", propertyFile.getAbsolutePath())
-              .addOption("security-properties-file", securityPropertyFile.getAbsolutePath())
-              .addOption("J", "-Dsecure-username-jd=user-jd")
-              .addOption("J", "-Dsecure-password-jd=password-jd")
-              .addOption("classpath", securityJson).getCommandString();
-
-      String startServerCmd = new CommandStringBuilder("start server")
-          .addOption("name", "test-server").addOption("user", "viaStartMemberOptions")
-          .addOption("password", sharedPasswordString + "-viaStartMemberOptions")
-          .addOption("properties-file", propertyFile.getAbsolutePath())
-          .addOption("security-properties-file", securityPropertyFile.getAbsolutePath())
-          .addOption("J", "-Dsecure-username-jd=user-jd")
-          .addOption("J", "-Dsecure-password-jd=" + sharedPasswordString + "-password-jd")
-          .addOption("server-port", "0")
-          .addOption("classpath", securityJson).getCommandString();
-
-      gfsh.execute(startLocatorCmd, startServerCmd);
-    } catch (Exception e) {
-      throw new Exception(
-          "Cluster could not start, failing beyond the intended scope of this test.", e);
-    }
+  private void startSecureLocatorAndServer() {
+    // The json is in the root resource directory.
+    String securityJson =
+        getResource(LogsAndDescribeConfigAreFullyRedactedAcceptanceTest.class,
+            "/security.json").getPath();
+    // We want to add the folder to the classpath, so we strip off the filename.
+    securityJson = securityJson.substring(0, securityJson.length() - "security.json".length());
+    String startLocatorCmd =
+        new CommandStringBuilder("start locator").addOption("name", "test-locator")
+            .addOption("properties-file", propertyFile.getAbsolutePath())
+            .addOption("security-properties-file", securityPropertyFile.getAbsolutePath())
+            .addOption("J", "-Dsecure-username-jd=user-jd")
+            .addOption("J", "-Dsecure-password-jd=password-jd")
+            .addOption("classpath", securityJson).getCommandString();
+
+    String startServerCmd = new CommandStringBuilder("start server")
+        .addOption("name", "test-server").addOption("user", "viaStartMemberOptions")
+        .addOption("password", sharedPasswordString + "-viaStartMemberOptions")
+        .addOption("properties-file", propertyFile.getAbsolutePath())
+        .addOption("security-properties-file", securityPropertyFile.getAbsolutePath())
+        .addOption("J", "-Dsecure-username-jd=user-jd")
+        .addOption("J", "-Dsecure-password-jd=" + sharedPasswordString + "-password-jd")
+        .addOption("server-port", "0")
+        .addOption("classpath", securityJson).getCommandString();
+
+    gfsh.execute(startLocatorCmd, startServerCmd);
   }
 
   @Test
diff --git a/geode-assembly/src/acceptanceTest/java/org/apache/geode/management/internal/rest/GradleBuildWithGeodeCoreAcceptanceTest.java b/geode-assembly/src/acceptanceTest/java/org/apache/geode/management/internal/rest/GradleBuildWithGeodeCoreAcceptanceTest.java
index 2013584..014ac84 100644
--- a/geode-assembly/src/acceptanceTest/java/org/apache/geode/management/internal/rest/GradleBuildWithGeodeCoreAcceptanceTest.java
+++ b/geode-assembly/src/acceptanceTest/java/org/apache/geode/management/internal/rest/GradleBuildWithGeodeCoreAcceptanceTest.java
@@ -15,6 +15,8 @@
 
 package org.apache.geode.management.internal.rest;
 
+import static org.apache.geode.test.util.ResourceUtils.copyDirectoryResource;
+import static org.apache.geode.test.util.ResourceUtils.getResource;
 import static org.assertj.core.api.Assertions.assertThat;
 
 import java.io.File;
@@ -29,7 +31,6 @@ import org.junit.rules.TemporaryFolder;
 
 import org.apache.geode.internal.GemFireVersion;
 import org.apache.geode.test.junit.rules.RequiresGeodeHome;
-import org.apache.geode.test.util.ResourceUtils;
 
 public class GradleBuildWithGeodeCoreAcceptanceTest {
 
@@ -41,7 +42,7 @@ public class GradleBuildWithGeodeCoreAcceptanceTest {
 
   @Test
   public void testBasicGradleBuild() throws Exception {
-    URL projectDir = ResourceUtils.getResource("/gradle-test-projects/management");
+    URL projectDir = getResource("/gradle-test-projects/management");
     assertThat(projectDir).isNotNull();
 
     String projectGroup = System.getProperty("projectGroup");
@@ -51,7 +52,7 @@ public class GradleBuildWithGeodeCoreAcceptanceTest {
     String geodeVersion = GemFireVersion.getGemFireVersion();
 
     File buildDir = temp.getRoot();
-    ResourceUtils.copyDirectoryResource(projectDir, buildDir);
+    copyDirectoryResource(projectDir, buildDir);
 
     GradleConnector connector = GradleConnector.newConnector();
     connector.useBuildDistribution();
diff --git a/geode-assembly/src/acceptanceTest/java/org/apache/geode/management/internal/rest/StandaloneClientManagementAPIAcceptanceTest.java b/geode-assembly/src/acceptanceTest/java/org/apache/geode/management/internal/rest/StandaloneClientManagementAPIAcceptanceTest.java
index ddd8e9b..9832c58 100644
--- a/geode-assembly/src/acceptanceTest/java/org/apache/geode/management/internal/rest/StandaloneClientManagementAPIAcceptanceTest.java
+++ b/geode-assembly/src/acceptanceTest/java/org/apache/geode/management/internal/rest/StandaloneClientManagementAPIAcceptanceTest.java
@@ -15,6 +15,7 @@
 
 package org.apache.geode.management.internal.rest;
 
+import static org.apache.geode.test.util.ResourceUtils.createTempFileFromResource;
 import static org.assertj.core.api.Assertions.assertThat;
 
 import java.io.File;
@@ -45,7 +46,6 @@ import org.apache.geode.test.junit.rules.gfsh.GfshRule;
 import org.apache.geode.test.junit.rules.gfsh.GfshScript;
 import org.apache.geode.test.junit.rules.gfsh.internal.ProcessLogger;
 import org.apache.geode.test.junit.runners.CategoryWithParameterizedRunnerFactory;
-import org.apache.geode.util.test.TestUtil;
 
 @RunWith(Parameterized.class)
 @UseParametersRunnerFactory(CategoryWithParameterizedRunnerFactory.class)
@@ -75,8 +75,9 @@ public class StandaloneClientManagementAPIAcceptanceTest {
      * -keystore trusted.keystore -keypass password -storepass password \
      * -ext san=ip:127.0.0.1,dns:localhost -storetype jks
      */
-    trustStorePath = TestUtil.getResourcePath(StandaloneClientManagementAPIAcceptanceTest.class,
-        "/ssl/trusted.keystore");
+    trustStorePath =
+        createTempFileFromResource(StandaloneClientManagementAPIAcceptanceTest.class,
+            "/ssl/trusted.keystore").getAbsolutePath();
     assertThat(trustStorePath).as("java file resource not found").isNotBlank();
   }
 
@@ -85,7 +86,8 @@ public class StandaloneClientManagementAPIAcceptanceTest {
   public void clientCreatesRegionUsingClusterManagementService() throws Exception {
     JarBuilder jarBuilder = new JarBuilder();
     String filePath =
-        TestUtil.getResourcePath(this.getClass(), "/ManagementClientCreateRegion.java");
+        createTempFileFromResource(this.getClass(), "/ManagementClientCreateRegion.java")
+            .getAbsolutePath();
     assertThat(filePath).as("java file resource not found").isNotBlank();
 
     File outputJar = new File(tempDir.getRoot(), "output.jar");
diff --git a/geode-assembly/src/distributedTest/java/org/apache/geode/rest/internal/web/RestFunctionExecuteDUnitTest.java b/geode-assembly/src/distributedTest/java/org/apache/geode/rest/internal/web/RestFunctionExecuteDUnitTest.java
index 0541f22..1197785 100644
--- a/geode-assembly/src/distributedTest/java/org/apache/geode/rest/internal/web/RestFunctionExecuteDUnitTest.java
+++ b/geode-assembly/src/distributedTest/java/org/apache/geode/rest/internal/web/RestFunctionExecuteDUnitTest.java
@@ -17,6 +17,7 @@ package org.apache.geode.rest.internal.web;
 
 
 import static org.apache.geode.test.junit.rules.HttpResponseAssert.assertResponse;
+import static org.apache.geode.test.util.ResourceUtils.createTempFileFromResource;
 import static org.assertj.core.api.Assertions.assertThat;
 
 import java.io.File;
@@ -36,7 +37,6 @@ import org.apache.geode.test.dunit.rules.MemberVM;
 import org.apache.geode.test.junit.categories.RestAPITest;
 import org.apache.geode.test.junit.rules.GeodeDevRestClient;
 import org.apache.geode.test.junit.rules.GfshCommandRule;
-import org.apache.geode.util.test.TestUtil;
 
 @Category({RestAPITest.class})
 public class RestFunctionExecuteDUnitTest {
@@ -110,8 +110,10 @@ public class RestFunctionExecuteDUnitTest {
 
   // find ImplementsFunction.java in the geode-core resource
   private static File loadClassToFile() {
-    String resourcePath = TestUtil.getResourcePath(Function.class.getClassLoader(),
-        "org/apache/geode/management/internal/deployment/ImplementsFunction.java");
+    String resourcePath =
+        createTempFileFromResource(Function.class.getClassLoader(),
+            "org/apache/geode/management/internal/deployment/ImplementsFunction.java")
+                .getAbsolutePath();
     assertThat(resourcePath).isNotNull();
 
     return new File(resourcePath);
diff --git a/geode-assembly/src/distributedTest/java/org/apache/geode/rest/internal/web/controllers/RestAPIsWithSSLDUnitTest.java b/geode-assembly/src/distributedTest/java/org/apache/geode/rest/internal/web/controllers/RestAPIsWithSSLDUnitTest.java
index e876f6c..2715ce0 100644
--- a/geode-assembly/src/distributedTest/java/org/apache/geode/rest/internal/web/controllers/RestAPIsWithSSLDUnitTest.java
+++ b/geode-assembly/src/distributedTest/java/org/apache/geode/rest/internal/web/controllers/RestAPIsWithSSLDUnitTest.java
@@ -34,6 +34,7 @@ import static org.apache.geode.distributed.ConfigurationProperties.SSL_TRUSTSTOR
 import static org.apache.geode.distributed.ConfigurationProperties.SSL_TRUSTSTORE_PASSWORD;
 import static org.apache.geode.distributed.ConfigurationProperties.SSL_WEB_ALIAS;
 import static org.apache.geode.distributed.ConfigurationProperties.SSL_WEB_SERVICE_REQUIRE_AUTHENTICATION;
+import static org.apache.geode.test.util.ResourceUtils.createTempFileFromResource;
 import static org.junit.Assert.assertEquals;
 
 import java.io.BufferedReader;
@@ -77,7 +78,6 @@ import org.apache.geode.test.dunit.rules.ClientVM;
 import org.apache.geode.test.dunit.rules.ClusterStartupRule;
 import org.apache.geode.test.dunit.rules.MemberVM;
 import org.apache.geode.test.junit.categories.RestAPITest;
-import org.apache.geode.util.test.TestUtil;
 
 /**
  * @since GemFire 8.0
@@ -99,7 +99,8 @@ public class RestAPIsWithSSLDUnitTest {
 
   private static File findTrustedJKSWithSingleEntry() {
     return new File(
-        TestUtil.getResourcePath(RestAPIsWithSSLDUnitTest.class, "/ssl/trusted.keystore"));
+        createTempFileFromResource(RestAPIsWithSSLDUnitTest.class, "/ssl/trusted.keystore")
+            .getAbsolutePath());
   }
 
   private static File findTrustStore(Properties props) {
@@ -249,9 +250,11 @@ public class RestAPIsWithSSLDUnitTest {
 
     Properties props = new Properties();
     props.setProperty(SSL_KEYSTORE,
-        TestUtil.getResourcePath(getClass(), "/org/apache/geode/internal/net/multiKey.jks"));
+        createTempFileFromResource(getClass(), "/org/apache/geode/internal/net/multiKey.jks")
+            .getAbsolutePath());
     props.setProperty(SSL_TRUSTSTORE,
-        TestUtil.getResourcePath(getClass(), "/org/apache/geode/internal/net/multiKeyTrust.jks"));
+        createTempFileFromResource(getClass(),
+            "/org/apache/geode/internal/net/multiKeyTrust.jks").getAbsolutePath());
     props.setProperty(SSL_KEYSTORE_PASSWORD, "password");
     props.setProperty(SSL_TRUSTSTORE_PASSWORD, "password");
     props.setProperty(SSL_KEYSTORE_TYPE, "JKS");
@@ -267,9 +270,11 @@ public class RestAPIsWithSSLDUnitTest {
 
     Properties props = new Properties();
     props.setProperty(SSL_KEYSTORE,
-        TestUtil.getResourcePath(getClass(), "/org/apache/geode/internal/net/multiKey.jks"));
+        createTempFileFromResource(getClass(), "/org/apache/geode/internal/net/multiKey.jks")
+            .getAbsolutePath());
     props.setProperty(SSL_TRUSTSTORE,
-        TestUtil.getResourcePath(getClass(), "/org/apache/geode/internal/net/multiKeyTrust.jks"));
+        createTempFileFromResource(getClass(),
+            "/org/apache/geode/internal/net/multiKeyTrust.jks").getAbsolutePath());
     props.setProperty(SSL_KEYSTORE_PASSWORD, "password");
     props.setProperty(SSL_TRUSTSTORE_PASSWORD, "password");
     props.setProperty(SSL_KEYSTORE_TYPE, "JKS");
diff --git a/geode-assembly/src/integrationTest/java/org/apache/geode/AssemblyContentsIntegrationTest.java b/geode-assembly/src/integrationTest/java/org/apache/geode/AssemblyContentsIntegrationTest.java
index 4d74481..5ae9486 100644
--- a/geode-assembly/src/integrationTest/java/org/apache/geode/AssemblyContentsIntegrationTest.java
+++ b/geode-assembly/src/integrationTest/java/org/apache/geode/AssemblyContentsIntegrationTest.java
@@ -14,6 +14,7 @@
  */
 package org.apache.geode;
 
+import static org.apache.geode.test.util.ResourceUtils.createTempFileFromResource;
 import static org.assertj.core.api.Assertions.assertThat;
 
 import java.io.File;
@@ -31,7 +32,6 @@ import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
 import org.apache.geode.test.junit.categories.RestAPITest;
-import org.apache.geode.util.test.TestUtil;
 
 @Category({RestAPITest.class})
 public class AssemblyContentsIntegrationTest {
@@ -42,7 +42,8 @@ public class AssemblyContentsIntegrationTest {
   @Before
   public void loadExpectedAssemblyContent() throws IOException {
     String assemblyContent =
-        TestUtil.getResourcePath(AssemblyContentsIntegrationTest.class, "/assembly_content.txt");
+        createTempFileFromResource(AssemblyContentsIntegrationTest.class,
+            "/assembly_content.txt").getAbsolutePath();
 
     expectedAssemblyContent =
         Files.lines(Paths.get(assemblyContent)).collect(Collectors.toCollection(TreeSet::new));
diff --git a/geode-assembly/src/integrationTest/java/org/apache/geode/BundledJarsJUnitTest.java b/geode-assembly/src/integrationTest/java/org/apache/geode/BundledJarsJUnitTest.java
index 5f26144..bdc8ba4 100644
--- a/geode-assembly/src/integrationTest/java/org/apache/geode/BundledJarsJUnitTest.java
+++ b/geode-assembly/src/integrationTest/java/org/apache/geode/BundledJarsJUnitTest.java
@@ -14,6 +14,7 @@
  */
 package org.apache.geode;
 
+import static org.apache.geode.test.util.ResourceUtils.createTempFileFromResource;
 import static org.junit.Assert.assertTrue;
 
 import java.io.File;
@@ -34,7 +35,6 @@ import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
 import org.apache.geode.test.junit.categories.RestAPITest;
-import org.apache.geode.util.test.TestUtil;
 
 @Category({RestAPITest.class})
 public class BundledJarsJUnitTest {
@@ -46,7 +46,8 @@ public class BundledJarsJUnitTest {
   @Before
   public void loadExpectedJars() throws IOException {
     String expectedJarFile =
-        TestUtil.getResourcePath(BundledJarsJUnitTest.class, "/expected_jars.txt");
+        createTempFileFromResource(BundledJarsJUnitTest.class, "/expected_jars.txt")
+            .getAbsolutePath();
 
     expectedJars = Files.lines(Paths.get(expectedJarFile)).collect(Collectors.toSet());
   }
diff --git a/geode-assembly/src/integrationTest/java/org/apache/geode/GeodeDependencyJarIntegrationTest.java b/geode-assembly/src/integrationTest/java/org/apache/geode/GeodeDependencyJarIntegrationTest.java
index 6d7e4c1..c5998d1 100644
--- a/geode-assembly/src/integrationTest/java/org/apache/geode/GeodeDependencyJarIntegrationTest.java
+++ b/geode-assembly/src/integrationTest/java/org/apache/geode/GeodeDependencyJarIntegrationTest.java
@@ -14,6 +14,7 @@
  */
 package org.apache.geode;
 
+import static org.apache.geode.test.util.ResourceUtils.createTempFileFromResource;
 import static org.assertj.core.api.Assertions.assertThat;
 
 import java.io.File;
@@ -31,7 +32,6 @@ import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
 import org.apache.geode.test.junit.categories.RestAPITest;
-import org.apache.geode.util.test.TestUtil;
 
 @Category({RestAPITest.class})
 public class GeodeDependencyJarIntegrationTest {
@@ -42,8 +42,8 @@ public class GeodeDependencyJarIntegrationTest {
   @Before
   public void loadExpectedClassPath() throws IOException {
     String dependencyClasspath =
-        TestUtil.getResourcePath(AssemblyContentsIntegrationTest.class,
-            "/dependency_classpath.txt");
+        createTempFileFromResource(AssemblyContentsIntegrationTest.class,
+            "/dependency_classpath.txt").getAbsolutePath();
 
     expectedClasspathElements =
         Files.lines(Paths.get(dependencyClasspath)).collect(Collectors.toList());
diff --git a/geode-assembly/src/integrationTest/java/org/apache/geode/rest/internal/web/RestSecurityWithSSLTest.java b/geode-assembly/src/integrationTest/java/org/apache/geode/rest/internal/web/RestSecurityWithSSLTest.java
index 02dc83a..0bc239b 100644
--- a/geode-assembly/src/integrationTest/java/org/apache/geode/rest/internal/web/RestSecurityWithSSLTest.java
+++ b/geode-assembly/src/integrationTest/java/org/apache/geode/rest/internal/web/RestSecurityWithSSLTest.java
@@ -24,7 +24,7 @@ import static org.apache.geode.distributed.ConfigurationProperties.SSL_PROTOCOLS
 import static org.apache.geode.distributed.ConfigurationProperties.SSL_TRUSTSTORE;
 import static org.apache.geode.distributed.ConfigurationProperties.SSL_TRUSTSTORE_PASSWORD;
 import static org.apache.geode.test.junit.rules.HttpResponseAssert.assertResponse;
-import static org.apache.geode.util.test.TestUtil.getResourcePath;
+import static org.apache.geode.test.util.ResourceUtils.createTempFileFromResource;
 
 import java.io.File;
 
@@ -44,7 +44,8 @@ import org.apache.geode.test.junit.rules.ServerStarterRule;
 public class RestSecurityWithSSLTest {
 
   private static File KEYSTORE_FILE =
-      new File(getResourcePath(RestSecurityWithSSLTest.class, "/ssl/trusted.keystore"));
+      new File(createTempFileFromResource(RestSecurityWithSSLTest.class, "/ssl/trusted.keystore")
+          .getAbsolutePath());
 
   @Rule
   public RequiresGeodeHome requiresGeodeHome = new RequiresGeodeHome();
diff --git a/geode-assembly/src/integrationTest/java/org/apache/geode/tools/pulse/PulseSecurityWithSSLTest.java b/geode-assembly/src/integrationTest/java/org/apache/geode/tools/pulse/PulseSecurityWithSSLTest.java
index 49aeaa9..b5caa1f 100644
--- a/geode-assembly/src/integrationTest/java/org/apache/geode/tools/pulse/PulseSecurityWithSSLTest.java
+++ b/geode-assembly/src/integrationTest/java/org/apache/geode/tools/pulse/PulseSecurityWithSSLTest.java
@@ -37,7 +37,7 @@ import static org.apache.geode.distributed.ConfigurationProperties.SSL_KEYSTORE_
 import static org.apache.geode.distributed.ConfigurationProperties.SSL_PROTOCOLS;
 import static org.apache.geode.distributed.ConfigurationProperties.SSL_TRUSTSTORE;
 import static org.apache.geode.distributed.ConfigurationProperties.SSL_TRUSTSTORE_PASSWORD;
-import static org.apache.geode.util.test.TestUtil.getResourcePath;
+import static org.apache.geode.test.util.ResourceUtils.createTempFileFromResource;
 import static org.assertj.core.api.Assertions.assertThat;
 
 import java.io.File;
@@ -57,12 +57,12 @@ import org.apache.geode.test.junit.categories.SecurityTest;
 import org.apache.geode.test.junit.rules.GeodeHttpClientRule;
 import org.apache.geode.test.junit.rules.LocatorStarterRule;
 
-
 @Category({SecurityTest.class, PulseTest.class})
 public class PulseSecurityWithSSLTest {
 
   private static File jks =
-      new File(getResourcePath(PulseSecurityWithSSLTest.class, "/ssl/trusted.keystore"));
+      new File(createTempFileFromResource(PulseSecurityWithSSLTest.class, "/ssl/trusted.keystore")
+          .getAbsolutePath());
 
   @Rule
   public LocatorStarterRule locator = new LocatorStarterRule().withHttpService();
diff --git a/geode-connectors/src/distributedTest/java/org/apache/geode/connectors/jdbc/internal/cli/CreateMappingCommandDUnitTest.java b/geode-connectors/src/distributedTest/java/org/apache/geode/connectors/jdbc/internal/cli/CreateMappingCommandDUnitTest.java
index ffa121e..e04519f 100644
--- a/geode-connectors/src/distributedTest/java/org/apache/geode/connectors/jdbc/internal/cli/CreateMappingCommandDUnitTest.java
+++ b/geode-connectors/src/distributedTest/java/org/apache/geode/connectors/jdbc/internal/cli/CreateMappingCommandDUnitTest.java
@@ -25,6 +25,7 @@ import static org.apache.geode.connectors.util.internal.MappingConstants.REGION_
 import static org.apache.geode.connectors.util.internal.MappingConstants.SCHEMA_NAME;
 import static org.apache.geode.connectors.util.internal.MappingConstants.SYNCHRONOUS_NAME;
 import static org.apache.geode.connectors.util.internal.MappingConstants.TABLE_NAME;
+import static org.apache.geode.test.util.ResourceUtils.createTempFileFromResource;
 import static org.assertj.core.api.Assertions.assertThat;
 
 import java.io.File;
@@ -79,7 +80,6 @@ import org.apache.geode.test.junit.categories.JDBCConnectorTest;
 import org.apache.geode.test.junit.rules.GfshCommandRule;
 import org.apache.geode.test.junit.rules.serializable.SerializableTemporaryFolder;
 import org.apache.geode.test.junit.rules.serializable.SerializableTestName;
-import org.apache.geode.util.test.TestUtil;
 
 @Category({JDBCConnectorTest.class})
 public class CreateMappingCommandDUnitTest {
@@ -571,7 +571,8 @@ public class CreateMappingCommandDUnitTest {
   }
 
   private File loadTestResource(String fileName) {
-    String filePath = TestUtil.getResourcePath(this.getClass(), fileName);
+    String filePath =
+        createTempFileFromResource(this.getClass(), fileName).getAbsolutePath();
     assertThat(filePath).isNotNull();
 
     return new File(filePath);
diff --git a/geode-core/src/distributedTest/java/org/apache/geode/ClusterCommunicationsDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/ClusterCommunicationsDUnitTest.java
index 1568740..3c9d803 100644
--- a/geode-core/src/distributedTest/java/org/apache/geode/ClusterCommunicationsDUnitTest.java
+++ b/geode-core/src/distributedTest/java/org/apache/geode/ClusterCommunicationsDUnitTest.java
@@ -31,6 +31,7 @@ import static org.apache.geode.distributed.ConfigurationProperties.USE_CLUSTER_C
 import static org.apache.geode.internal.DataSerializableFixedID.SERIAL_ACKED_MESSAGE;
 import static org.apache.geode.test.awaitility.GeodeAwaitility.await;
 import static org.apache.geode.test.awaitility.GeodeAwaitility.getTimeout;
+import static org.apache.geode.test.util.ResourceUtils.createTempFileFromResource;
 import static org.assertj.core.api.Assertions.assertThat;
 
 import java.io.DataInput;
@@ -79,8 +80,6 @@ import org.apache.geode.test.junit.categories.MembershipTest;
 import org.apache.geode.test.junit.rules.serializable.SerializableTestName;
 import org.apache.geode.test.junit.runners.CategoryWithParameterizedRunnerFactory;
 import org.apache.geode.test.version.VersionManager;
-import org.apache.geode.util.test.TestUtil;
-
 
 /**
  * This class tests cluster tcp/ip communications both with and without SSL enabled
@@ -309,8 +308,12 @@ public class ClusterCommunicationsDUnitTest implements java.io.Serializable {
 
     if (useSSL) {
       properties.put(SSL_ENABLED_COMPONENTS, "cluster,locator");
-      properties.put(SSL_KEYSTORE, TestUtil.getResourcePath(this.getClass(), "server.keystore"));
-      properties.put(SSL_TRUSTSTORE, TestUtil.getResourcePath(this.getClass(), "server.keystore"));
+      properties.put(SSL_KEYSTORE,
+          createTempFileFromResource(this.getClass(), "server.keystore")
+              .getAbsolutePath());
+      properties.put(SSL_TRUSTSTORE,
+          createTempFileFromResource(this.getClass(), "server.keystore")
+              .getAbsolutePath());
       properties.put(SSL_PROTOCOLS, "TLSv1.2");
       properties.put(SSL_KEYSTORE_PASSWORD, "password");
       properties.put(SSL_TRUSTSTORE_PASSWORD, "password");
diff --git a/geode-core/src/distributedTest/java/org/apache/geode/cache/client/internal/CacheServerSSLConnectionDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/cache/client/internal/CacheServerSSLConnectionDUnitTest.java
index 986d04e..4a2d718 100644
--- a/geode-core/src/distributedTest/java/org/apache/geode/cache/client/internal/CacheServerSSLConnectionDUnitTest.java
+++ b/geode-core/src/distributedTest/java/org/apache/geode/cache/client/internal/CacheServerSSLConnectionDUnitTest.java
@@ -42,6 +42,7 @@ import static org.apache.geode.distributed.ConfigurationProperties.SSL_PROTOCOLS
 import static org.apache.geode.distributed.ConfigurationProperties.SSL_REQUIRE_AUTHENTICATION;
 import static org.apache.geode.distributed.ConfigurationProperties.SSL_TRUSTSTORE;
 import static org.apache.geode.distributed.ConfigurationProperties.SSL_TRUSTSTORE_PASSWORD;
+import static org.apache.geode.test.util.ResourceUtils.createTempFileFromResource;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotNull;
@@ -89,7 +90,6 @@ import org.apache.geode.test.dunit.VM;
 import org.apache.geode.test.dunit.internal.JUnit4DistributedTestCase;
 import org.apache.geode.test.junit.categories.ClientServerTest;
 import org.apache.geode.test.junit.runners.CategoryWithParameterizedRunnerFactory;
-import org.apache.geode.util.test.TestUtil;
 
 /**
  * Tests cacheserver ssl support added. See https://svn.gemstone.com/trac/gemfire/ticket/48995 for
@@ -201,9 +201,11 @@ public class CacheServerSSLConnectionDUnitTest extends JUnit4DistributedTestCase
           String.valueOf(cacheServerSslRequireAuth));
 
       String keyStore =
-          TestUtil.getResourcePath(CacheServerSSLConnectionDUnitTest.class, SERVER_KEY_STORE);
+          createTempFileFromResource(CacheServerSSLConnectionDUnitTest.class, SERVER_KEY_STORE)
+              .getAbsolutePath();
       String trustStore =
-          TestUtil.getResourcePath(CacheServerSSLConnectionDUnitTest.class, SERVER_TRUST_STORE);
+          createTempFileFromResource(CacheServerSSLConnectionDUnitTest.class,
+              SERVER_TRUST_STORE).getAbsolutePath();
       gemFireProps.put(CLUSTER_SSL_KEYSTORE_TYPE, "jks");
       gemFireProps.put(CLUSTER_SSL_KEYSTORE, keyStore);
       gemFireProps.put(CLUSTER_SSL_KEYSTORE_PASSWORD, "password");
@@ -230,9 +232,11 @@ public class CacheServerSSLConnectionDUnitTest extends JUnit4DistributedTestCase
     gemFireProps.put(SSL_REQUIRE_AUTHENTICATION, String.valueOf(cacheServerSslRequireAuth));
 
     String keyStore =
-        TestUtil.getResourcePath(CacheServerSSLConnectionDUnitTest.class, SERVER_KEY_STORE);
+        createTempFileFromResource(CacheServerSSLConnectionDUnitTest.class, SERVER_KEY_STORE)
+            .getAbsolutePath();
     String trustStore =
-        TestUtil.getResourcePath(CacheServerSSLConnectionDUnitTest.class, SERVER_TRUST_STORE);
+        createTempFileFromResource(CacheServerSSLConnectionDUnitTest.class, SERVER_TRUST_STORE)
+            .getAbsolutePath();
     gemFireProps.put(SSL_KEYSTORE_TYPE, "jks");
     gemFireProps.put(SSL_KEYSTORE, keyStore);
     gemFireProps.put(SSL_KEYSTORE_PASSWORD, "password");
@@ -251,9 +255,11 @@ public class CacheServerSSLConnectionDUnitTest extends JUnit4DistributedTestCase
     String cacheServerSslciphers = "any";
 
     String keyStorePath =
-        TestUtil.getResourcePath(CacheServerSSLConnectionDUnitTest.class, keyStore);
+        createTempFileFromResource(CacheServerSSLConnectionDUnitTest.class, keyStore)
+            .getAbsolutePath();
     String trustStorePath =
-        TestUtil.getResourcePath(CacheServerSSLConnectionDUnitTest.class, trustStore);
+        createTempFileFromResource(CacheServerSSLConnectionDUnitTest.class, trustStore)
+            .getAbsolutePath();
 
     if (cacheServerSslenabled) {
       if (useOldSSLSettings) {
diff --git a/geode-core/src/distributedTest/java/org/apache/geode/cache/client/internal/SSLNoClientAuthDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/cache/client/internal/SSLNoClientAuthDUnitTest.java
index c1c39fc..6989849 100644
--- a/geode-core/src/distributedTest/java/org/apache/geode/cache/client/internal/SSLNoClientAuthDUnitTest.java
+++ b/geode-core/src/distributedTest/java/org/apache/geode/cache/client/internal/SSLNoClientAuthDUnitTest.java
@@ -25,6 +25,7 @@ import static org.apache.geode.distributed.ConfigurationProperties.SERVER_SSL_PR
 import static org.apache.geode.distributed.ConfigurationProperties.SERVER_SSL_REQUIRE_AUTHENTICATION;
 import static org.apache.geode.distributed.ConfigurationProperties.SERVER_SSL_TRUSTSTORE;
 import static org.apache.geode.distributed.ConfigurationProperties.SERVER_SSL_TRUSTSTORE_PASSWORD;
+import static org.apache.geode.test.util.ResourceUtils.createTempFileFromResource;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.fail;
@@ -52,7 +53,6 @@ import org.apache.geode.test.dunit.Host;
 import org.apache.geode.test.dunit.VM;
 import org.apache.geode.test.dunit.internal.JUnit4DistributedTestCase;
 import org.apache.geode.test.junit.categories.MembershipTest;
-import org.apache.geode.util.test.TestUtil;
 
 /**
  * Test for GEODE-396
@@ -118,8 +118,12 @@ public class SSLNoClientAuthDUnitTest extends JUnit4DistributedTestCase {
     gemFireProps.put(SERVER_SSL_CIPHERS, cacheServerSslciphers);
     gemFireProps.put(SERVER_SSL_REQUIRE_AUTHENTICATION, String.valueOf(cacheServerSslRequireAuth));
 
-    String keyStore = TestUtil.getResourcePath(SSLNoClientAuthDUnitTest.class, DEFAULT_STORE);
-    String trustStore = TestUtil.getResourcePath(SSLNoClientAuthDUnitTest.class, DEFAULT_STORE);
+    String keyStore =
+        createTempFileFromResource(SSLNoClientAuthDUnitTest.class, DEFAULT_STORE)
+            .getAbsolutePath();
+    String trustStore =
+        createTempFileFromResource(SSLNoClientAuthDUnitTest.class, DEFAULT_STORE)
+            .getAbsolutePath();
     gemFireProps.put(SERVER_SSL_KEYSTORE_TYPE, "jks");
     gemFireProps.put(SERVER_SSL_KEYSTORE, keyStore);
     gemFireProps.put(SERVER_SSL_KEYSTORE_PASSWORD, "password");
@@ -145,8 +149,12 @@ public class SSLNoClientAuthDUnitTest extends JUnit4DistributedTestCase {
     String cacheServerSslprotocols = "any";
     String cacheServerSslciphers = "any";
 
-    String keyStorePath = TestUtil.getResourcePath(SSLNoClientAuthDUnitTest.class, keyStore);
-    String trustStorePath = TestUtil.getResourcePath(SSLNoClientAuthDUnitTest.class, trustStore);
+    String keyStorePath =
+        createTempFileFromResource(SSLNoClientAuthDUnitTest.class, keyStore)
+            .getAbsolutePath();
+    String trustStorePath =
+        createTempFileFromResource(SSLNoClientAuthDUnitTest.class, trustStore)
+            .getAbsolutePath();
     // using new server-ssl-* properties
     gemFireProps.put(SERVER_SSL_ENABLED, String.valueOf(cacheServerSslenabled));
     gemFireProps.put(SERVER_SSL_PROTOCOLS, cacheServerSslprotocols);
diff --git a/geode-core/src/distributedTest/java/org/apache/geode/cache/query/dunit/PartitionedRegionCompactRangeIndexDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/cache/query/dunit/PartitionedRegionCompactRangeIndexDUnitTest.java
index c20c8b8..f0b91d3 100644
--- a/geode-core/src/distributedTest/java/org/apache/geode/cache/query/dunit/PartitionedRegionCompactRangeIndexDUnitTest.java
+++ b/geode-core/src/distributedTest/java/org/apache/geode/cache/query/dunit/PartitionedRegionCompactRangeIndexDUnitTest.java
@@ -16,6 +16,7 @@ package org.apache.geode.cache.query.dunit;
 
 import static org.apache.geode.distributed.ConfigurationProperties.CACHE_XML_FILE;
 import static org.apache.geode.distributed.ConfigurationProperties.LOCATORS;
+import static org.apache.geode.test.util.ResourceUtils.createTempFileFromResource;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.fail;
 
@@ -43,7 +44,6 @@ import org.apache.geode.test.dunit.SerializableRunnable;
 import org.apache.geode.test.dunit.rules.ClusterStartupRule;
 import org.apache.geode.test.dunit.rules.MemberVM;
 import org.apache.geode.test.junit.categories.OQLQueryTest;
-import org.apache.geode.util.test.TestUtil;
 
 @Category({OQLQueryTest.class})
 public class PartitionedRegionCompactRangeIndexDUnitTest implements Serializable {
@@ -61,7 +61,8 @@ public class PartitionedRegionCompactRangeIndexDUnitTest implements Serializable
   private Properties getSystemProperties(String cacheXML) {
     Properties props = new Properties();
     props.setProperty(LOCATORS, "localhost[" + DistributedTestUtils.getDUnitLocatorPort() + "]");
-    props.setProperty(CACHE_XML_FILE, TestUtil.getResourcePath(getClass(), cacheXML));
+    props.setProperty(CACHE_XML_FILE,
+        createTempFileFromResource(getClass(), cacheXML).getAbsolutePath());
     return props;
   }
 
diff --git a/geode-core/src/distributedTest/java/org/apache/geode/cache/query/partitioned/PRQueryDUnitHelper.java b/geode-core/src/distributedTest/java/org/apache/geode/cache/query/partitioned/PRQueryDUnitHelper.java
index b233148..8fa8308 100755
--- a/geode-core/src/distributedTest/java/org/apache/geode/cache/query/partitioned/PRQueryDUnitHelper.java
+++ b/geode-core/src/distributedTest/java/org/apache/geode/cache/query/partitioned/PRQueryDUnitHelper.java
@@ -14,6 +14,7 @@
  */
 package org.apache.geode.cache.query.partitioned;
 
+import static org.apache.geode.test.util.ResourceUtils.createTempFileFromResource;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
@@ -79,7 +80,6 @@ import org.apache.geode.test.dunit.SerializableRunnable;
 import org.apache.geode.test.dunit.SerializableRunnableIF;
 import org.apache.geode.test.dunit.cache.internal.JUnit4CacheTestCase;
 import org.apache.geode.test.dunit.internal.JUnit4DistributedTestCase;
-import org.apache.geode.util.test.TestUtil;
 
 /**
  * This is a helper class for the various Partitioned Query DUnit Test Cases
@@ -1755,7 +1755,9 @@ public class PRQueryDUnitHelper implements Serializable {
 
 
   public File findFile(String fileName) {
-    return new File(TestUtil.getResourcePath(PRQueryDUnitHelper.class, fileName));
+    return new File(
+        createTempFileFromResource(PRQueryDUnitHelper.class, fileName)
+            .getAbsolutePath());
   }
 
   public CacheSerializableRunnable getCacheSerializableRunnableForIndexCreationCheck(
diff --git a/geode-core/src/distributedTest/java/org/apache/geode/cache30/CacheXml66DUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/cache30/CacheXml66DUnitTest.java
index 29b0e34..a85b65d 100644
--- a/geode-core/src/distributedTest/java/org/apache/geode/cache30/CacheXml66DUnitTest.java
+++ b/geode-core/src/distributedTest/java/org/apache/geode/cache30/CacheXml66DUnitTest.java
@@ -15,6 +15,7 @@
 package org.apache.geode.cache30;
 
 import static org.apache.geode.distributed.ConfigurationProperties.ROLES;
+import static org.apache.geode.test.util.ResourceUtils.createTempFileFromResource;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotNull;
@@ -138,7 +139,6 @@ import org.apache.geode.test.dunit.LogWriterUtils;
 import org.apache.geode.test.dunit.NetworkUtils;
 import org.apache.geode.test.dunit.SerializableCallable;
 import org.apache.geode.test.dunit.VM;
-import org.apache.geode.util.test.TestUtil;
 
 /**
  * Tests 7.0 cache.xml feature : Fixed Partitioning.
@@ -4388,18 +4388,18 @@ public abstract class CacheXml66DUnitTest extends CacheXmlTestCase {
 
     } else {
 
-      File example = new File(TestUtil.getResourcePath(getClass(),
-          "/org/apache/geode/cache/doc-files/example-cache.xml"));
+      File example = new File(createTempFileFromResource(getClass(),
+          "/org/apache/geode/cache/doc-files/example-cache.xml").getAbsolutePath());
       FileInputStream fis = new FileInputStream(example);
       CacheXmlParser.parse(fis);
 
-      File example2 = new File(TestUtil.getResourcePath(getClass(),
-          "/org/apache/geode/cache/doc-files/example2-cache.xml"));
+      File example2 = new File(createTempFileFromResource(getClass(),
+          "/org/apache/geode/cache/doc-files/example2-cache.xml").getAbsolutePath());
       fis = new FileInputStream(example2);
       CacheXmlParser.parse(fis);
 
-      File example3 = new File(TestUtil.getResourcePath(getClass(),
-          "/org/apache/geode/cache/doc-files/example3-cache.xml"));
+      File example3 = new File(createTempFileFromResource(getClass(),
+          "/org/apache/geode/cache/doc-files/example3-cache.xml").getAbsolutePath());
       fis = new FileInputStream(example3);
       CacheXmlParser.parse(fis);
     }
diff --git a/geode-core/src/distributedTest/java/org/apache/geode/cache30/ReconnectWithCacheXMLDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/cache30/ReconnectWithCacheXMLDUnitTest.java
index db50b44..c8fd582 100755
--- a/geode-core/src/distributedTest/java/org/apache/geode/cache30/ReconnectWithCacheXMLDUnitTest.java
+++ b/geode-core/src/distributedTest/java/org/apache/geode/cache30/ReconnectWithCacheXMLDUnitTest.java
@@ -16,6 +16,7 @@ package org.apache.geode.cache30;
 
 import static org.apache.geode.internal.Assert.assertTrue;
 import static org.apache.geode.test.awaitility.GeodeAwaitility.await;
+import static org.apache.geode.test.util.ResourceUtils.createTempFileFromResource;
 import static org.junit.Assert.assertEquals;
 
 import java.util.Properties;
@@ -36,7 +37,6 @@ import org.apache.geode.internal.AvailablePortHelper;
 import org.apache.geode.test.dunit.cache.internal.JUnit4CacheTestCase;
 import org.apache.geode.test.junit.categories.ClientServerTest;
 import org.apache.geode.test.junit.categories.MembershipTest;
-import org.apache.geode.util.test.TestUtil;
 
 /**
  * This test exercises auto-reconnect functionality when there is a cache-server that was started by
@@ -71,7 +71,9 @@ public class ReconnectWithCacheXMLDUnitTest extends JUnit4CacheTestCase {
   @Override
   public Properties getDistributedSystemProperties() {
     Properties result = super.getDistributedSystemProperties();
-    String fileName = TestUtil.getResourcePath(getClass(), "ReconnectWithCacheXMLDUnitTest.xml");
+    String fileName =
+        createTempFileFromResource(getClass(), "ReconnectWithCacheXMLDUnitTest.xml")
+            .getAbsolutePath();
     result.put(ConfigurationProperties.CACHE_XML_FILE, fileName);
     result.put(ConfigurationProperties.ENABLE_NETWORK_PARTITION_DETECTION, "true");
     result.put(ConfigurationProperties.DISABLE_AUTO_RECONNECT, "false");
diff --git a/geode-core/src/distributedTest/java/org/apache/geode/distributed/LocatorDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/distributed/LocatorDUnitTest.java
index e07f572..caf04de 100644
--- a/geode-core/src/distributedTest/java/org/apache/geode/distributed/LocatorDUnitTest.java
+++ b/geode-core/src/distributedTest/java/org/apache/geode/distributed/LocatorDUnitTest.java
@@ -41,6 +41,7 @@ import static org.apache.geode.distributed.ConfigurationProperties.START_LOCATOR
 import static org.apache.geode.distributed.ConfigurationProperties.USE_CLUSTER_CONFIGURATION;
 import static org.apache.geode.internal.logging.LogWriterLevel.ALL;
 import static org.apache.geode.test.awaitility.GeodeAwaitility.await;
+import static org.apache.geode.test.util.ResourceUtils.createTempFileFromResource;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.junit.Assert.assertEquals;
@@ -107,7 +108,6 @@ import org.apache.geode.test.dunit.Wait;
 import org.apache.geode.test.dunit.internal.DUnitLauncher;
 import org.apache.geode.test.dunit.rules.DistributedRule;
 import org.apache.geode.test.junit.categories.MembershipTest;
-import org.apache.geode.util.test.TestUtil;
 
 /**
  * Tests the ability of the {@link Locator} API to start and stop locators running in remote VMs.
@@ -1817,15 +1817,17 @@ public class LocatorDUnitTest implements java.io.Serializable {
   }
 
   private String getSingleKeyKeystore() {
-    return TestUtil.getResourcePath(getClass(), "/ssl/trusted.keystore");
+    return createTempFileFromResource(getClass(), "/ssl/trusted.keystore").getAbsolutePath();
   }
 
   private String getMultiKeyKeystore() {
-    return TestUtil.getResourcePath(getClass(), "/org/apache/geode/internal/net/multiKey.jks");
+    return createTempFileFromResource(getClass(), "/org/apache/geode/internal/net/multiKey.jks")
+        .getAbsolutePath();
   }
 
   private String getMultiKeyTruststore() {
-    return TestUtil.getResourcePath(getClass(), "/org/apache/geode/internal/net/multiKeyTrust.jks");
+    return createTempFileFromResource(getClass(),
+        "/org/apache/geode/internal/net/multiKeyTrust.jks").getAbsolutePath();
   }
 
   private void startVerifyAndStopLocator(VM loc1, VM loc2, int port1, int port2,
diff --git a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/PartitionedRegionCacheXMLExampleDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/PartitionedRegionCacheXMLExampleDUnitTest.java
index b8db17f..aed3a0d 100755
--- a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/PartitionedRegionCacheXMLExampleDUnitTest.java
+++ b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/PartitionedRegionCacheXMLExampleDUnitTest.java
@@ -17,6 +17,7 @@ package org.apache.geode.internal.cache;
 import static org.apache.geode.cache.Region.SEPARATOR;
 import static org.apache.geode.distributed.ConfigurationProperties.CACHE_XML_FILE;
 import static org.apache.geode.test.dunit.Host.getHost;
+import static org.apache.geode.test.util.ResourceUtils.createTempFileFromResource;
 import static org.assertj.core.api.Assertions.assertThat;
 
 import java.util.Properties;
@@ -28,7 +29,6 @@ import org.junit.Test;
 import org.apache.geode.cache.Region;
 import org.apache.geode.test.dunit.VM;
 import org.apache.geode.test.dunit.cache.CacheTestCase;
-import org.apache.geode.util.test.TestUtil;
 
 /**
  * This class tests regions created by xml files
@@ -97,7 +97,8 @@ public class PartitionedRegionCacheXMLExampleDUnitTest extends CacheTestCase {
 
   private void createCache(String cacheXmlFileName) {
     Properties config = new Properties();
-    String cacheXmlPath = TestUtil.getResourcePath(getClass(), cacheXmlFileName);
+    String cacheXmlPath =
+        createTempFileFromResource(getClass(), cacheXmlFileName).getAbsolutePath();
     config.setProperty(CACHE_XML_FILE, cacheXmlPath);
 
     getSystem(config);
diff --git a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/StartServerWithXmlDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/StartServerWithXmlDUnitTest.java
index 9c3af80..ff5a6d8 100644
--- a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/StartServerWithXmlDUnitTest.java
+++ b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/StartServerWithXmlDUnitTest.java
@@ -17,6 +17,7 @@ package org.apache.geode.internal.cache;
 
 import static org.apache.geode.distributed.ConfigurationProperties.CACHE_XML_FILE;
 import static org.apache.geode.distributed.ConfigurationProperties.LOCATORS;
+import static org.apache.geode.test.util.ResourceUtils.createTempFileFromResource;
 import static org.assertj.core.api.Assertions.assertThat;
 
 import java.util.Properties;
@@ -31,8 +32,6 @@ import org.apache.geode.distributed.ServerLauncherParameters;
 import org.apache.geode.test.dunit.VM;
 import org.apache.geode.test.dunit.rules.ClusterStartupRule;
 import org.apache.geode.test.dunit.rules.MemberVM;
-import org.apache.geode.util.test.TestUtil;
-
 
 public class StartServerWithXmlDUnitTest {
 
@@ -49,7 +48,9 @@ public class StartServerWithXmlDUnitTest {
     Properties props = new Properties();
     String locators = "localhost[" + locator.getPort() + "]";
     props.setProperty(LOCATORS, locators);
-    String cacheXmlPath = TestUtil.getResourcePath(getClass(), "CacheServerWithZeroPort.xml");
+    String cacheXmlPath =
+        createTempFileFromResource(getClass(), "CacheServerWithZeroPort.xml")
+            .getAbsolutePath();
     props.setProperty(CACHE_XML_FILE, cacheXmlPath);
 
     server = cluster.getVM(1);
diff --git a/geode-core/src/distributedTest/java/org/apache/geode/internal/jta/dunit/ExceptionsDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/internal/jta/dunit/ExceptionsDUnitTest.java
index 3a1acb1..60cf828 100755
--- a/geode-core/src/distributedTest/java/org/apache/geode/internal/jta/dunit/ExceptionsDUnitTest.java
+++ b/geode-core/src/distributedTest/java/org/apache/geode/internal/jta/dunit/ExceptionsDUnitTest.java
@@ -15,6 +15,7 @@
 package org.apache.geode.internal.jta.dunit;
 
 import static org.apache.geode.distributed.ConfigurationProperties.CACHE_XML_FILE;
+import static org.apache.geode.test.util.ResourceUtils.createTempFileFromResource;
 import static org.junit.Assert.fail;
 
 import java.io.BufferedReader;
@@ -40,9 +41,8 @@ import org.apache.geode.test.dunit.Host;
 import org.apache.geode.test.dunit.LogWriterUtils;
 import org.apache.geode.test.dunit.VM;
 import org.apache.geode.test.dunit.internal.JUnit4DistributedTestCase;
-import org.apache.geode.util.test.TestUtil;
-
 
+// TODO: this is a broken test that does not run
 public class ExceptionsDUnitTest extends JUnit4DistributedTestCase {
 
   static DistributedSystem ds;
@@ -119,7 +119,9 @@ public class ExceptionsDUnitTest extends JUnit4DistributedTestCase {
     int pid = OSProcess.getId();
     String path = File.createTempFile("dunit-cachejta_", ".xml").getAbsolutePath();
     /** * Return file as string and then modify the string accordingly ** */
-    String file_as_str = readFile(TestUtil.getResourcePath(CacheUtils.class, "cachejta.xml"));
+    String file_as_str = readFile(
+        createTempFileFromResource(CacheUtils.class, "cachejta.xml")
+            .getAbsolutePath());
     file_as_str = file_as_str.replaceAll("newDB", "newDB_" + pid);
     String modified_file_str = modifyFile(file_as_str);
     FileOutputStream fos = new FileOutputStream(path);
diff --git a/geode-core/src/distributedTest/java/org/apache/geode/internal/jta/dunit/IdleTimeOutDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/internal/jta/dunit/IdleTimeOutDUnitTest.java
index 2030d18..56a12f6 100755
--- a/geode-core/src/distributedTest/java/org/apache/geode/internal/jta/dunit/IdleTimeOutDUnitTest.java
+++ b/geode-core/src/distributedTest/java/org/apache/geode/internal/jta/dunit/IdleTimeOutDUnitTest.java
@@ -15,6 +15,7 @@
 package org.apache.geode.internal.jta.dunit;
 
 import static org.apache.geode.distributed.ConfigurationProperties.CACHE_XML_FILE;
+import static org.apache.geode.test.util.ResourceUtils.createTempFileFromResource;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.fail;
 
@@ -48,8 +49,6 @@ import org.apache.geode.test.dunit.LogWriterUtils;
 import org.apache.geode.test.dunit.ThreadUtils;
 import org.apache.geode.test.dunit.VM;
 import org.apache.geode.test.dunit.internal.JUnit4DistributedTestCase;
-import org.apache.geode.util.test.TestUtil;
-
 
 public class IdleTimeOutDUnitTest extends JUnit4DistributedTestCase {
 
@@ -132,7 +131,9 @@ public class IdleTimeOutDUnitTest extends JUnit4DistributedTestCase {
     path = File.createTempFile("dunit-cachejta_", ".xml").getAbsolutePath();
     LogWriterUtils.getLogWriter().fine("PATH " + path);
     /** * Return file as string and then modify the string accordingly ** */
-    String file_as_str = readFile(TestUtil.getResourcePath(CacheUtils.class, "cachejta.xml"));
+    String file_as_str = readFile(
+        createTempFileFromResource(CacheUtils.class, "cachejta.xml")
+            .getAbsolutePath());
     file_as_str = file_as_str.replaceAll("newDB", "newDB_" + pid);
     String modified_file_str = modifyFile(file_as_str);
     FileOutputStream fos = new FileOutputStream(path);
diff --git a/geode-core/src/distributedTest/java/org/apache/geode/internal/jta/dunit/LoginTimeOutDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/internal/jta/dunit/LoginTimeOutDUnitTest.java
index a2daca2..aaa1444 100755
--- a/geode-core/src/distributedTest/java/org/apache/geode/internal/jta/dunit/LoginTimeOutDUnitTest.java
+++ b/geode-core/src/distributedTest/java/org/apache/geode/internal/jta/dunit/LoginTimeOutDUnitTest.java
@@ -16,6 +16,7 @@ package org.apache.geode.internal.jta.dunit;
 
 import static org.apache.geode.distributed.ConfigurationProperties.CACHE_XML_FILE;
 import static org.apache.geode.distributed.ConfigurationProperties.MCAST_PORT;
+import static org.apache.geode.test.util.ResourceUtils.createTempFileFromResource;
 import static org.junit.Assert.fail;
 
 import java.io.BufferedReader;
@@ -53,8 +54,6 @@ import org.apache.geode.test.dunit.ThreadUtils;
 import org.apache.geode.test.dunit.VM;
 import org.apache.geode.test.dunit.WaitCriterion;
 import org.apache.geode.test.dunit.internal.JUnit4DistributedTestCase;
-import org.apache.geode.util.test.TestUtil;
-
 
 public class LoginTimeOutDUnitTest extends JUnit4DistributedTestCase {
   private static final Logger logger = LogService.getLogger();
@@ -132,7 +131,9 @@ public class LoginTimeOutDUnitTest extends JUnit4DistributedTestCase {
     String path = File.createTempFile("dunit-cachejta_", ".xml").getAbsolutePath();
     logger.debug("PATH " + path);
     /** * Return file as string and then modify the string accordingly ** */
-    String file_as_str = readFile(TestUtil.getResourcePath(CacheUtils.class, "cachejta.xml"));
+    String file_as_str = readFile(
+        createTempFileFromResource(CacheUtils.class, "cachejta.xml")
+            .getAbsolutePath());
     file_as_str = file_as_str.replaceAll("newDB", "newDB_" + pid);
     String modified_file_str = modifyFile(file_as_str);
     FileOutputStream fos = new FileOutputStream(path);
diff --git a/geode-core/src/distributedTest/java/org/apache/geode/internal/jta/dunit/MaxPoolSizeDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/internal/jta/dunit/MaxPoolSizeDUnitTest.java
index 9180db9..e396fe9 100755
--- a/geode-core/src/distributedTest/java/org/apache/geode/internal/jta/dunit/MaxPoolSizeDUnitTest.java
+++ b/geode-core/src/distributedTest/java/org/apache/geode/internal/jta/dunit/MaxPoolSizeDUnitTest.java
@@ -16,6 +16,7 @@ package org.apache.geode.internal.jta.dunit;
 
 import static org.apache.geode.distributed.ConfigurationProperties.CACHE_XML_FILE;
 import static org.apache.geode.test.dunit.Assert.fail;
+import static org.apache.geode.test.util.ResourceUtils.createTempFileFromResource;
 
 import java.io.BufferedReader;
 import java.io.BufferedWriter;
@@ -47,8 +48,6 @@ import org.apache.geode.test.dunit.LogWriterUtils;
 import org.apache.geode.test.dunit.ThreadUtils;
 import org.apache.geode.test.dunit.VM;
 import org.apache.geode.test.dunit.internal.JUnit4DistributedTestCase;
-import org.apache.geode.util.test.TestUtil;
-
 
 public class MaxPoolSizeDUnitTest extends JUnit4DistributedTestCase {
 
@@ -123,7 +122,9 @@ public class MaxPoolSizeDUnitTest extends JUnit4DistributedTestCase {
     String path = File.createTempFile("dunit-cachejta_", ".xml").getAbsolutePath();
     LogWriterUtils.getLogWriter().fine("PATH " + path);
     /** * Return file as string and then modify the string accordingly ** */
-    String file_as_str = readFile(TestUtil.getResourcePath(CacheUtils.class, "cachejta.xml"));
+    String file_as_str = readFile(
+        createTempFileFromResource(CacheUtils.class, "cachejta.xml")
+            .getAbsolutePath());
     file_as_str = file_as_str.replaceAll("newDB", "newDB_" + pid);
     String modified_file_str = modifyFile(file_as_str);
     FileOutputStream fos = new FileOutputStream(path);
diff --git a/geode-core/src/distributedTest/java/org/apache/geode/internal/jta/dunit/TransactionTimeOutDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/internal/jta/dunit/TransactionTimeOutDUnitTest.java
index eb1d17b..8ee9c1e 100755
--- a/geode-core/src/distributedTest/java/org/apache/geode/internal/jta/dunit/TransactionTimeOutDUnitTest.java
+++ b/geode-core/src/distributedTest/java/org/apache/geode/internal/jta/dunit/TransactionTimeOutDUnitTest.java
@@ -16,6 +16,7 @@ package org.apache.geode.internal.jta.dunit;
 
 import static org.apache.geode.distributed.ConfigurationProperties.CACHE_XML_FILE;
 import static org.apache.geode.test.dunit.Assert.fail;
+import static org.apache.geode.test.util.ResourceUtils.createTempFileFromResource;
 
 import java.io.BufferedReader;
 import java.io.BufferedWriter;
@@ -49,7 +50,6 @@ import org.apache.geode.test.dunit.LogWriterUtils;
 import org.apache.geode.test.dunit.ThreadUtils;
 import org.apache.geode.test.dunit.VM;
 import org.apache.geode.test.dunit.internal.JUnit4DistributedTestCase;
-import org.apache.geode.util.test.TestUtil;
 
 /**
  * This test tests TransactionTimeOut functionality
@@ -65,7 +65,9 @@ public class TransactionTimeOutDUnitTest extends JUnit4DistributedTestCase {
     Properties props = new Properties();
     int pid = OSProcess.getId();
     String path = File.createTempFile("dunit-cachejta_", ".xml").getAbsolutePath();
-    String file_as_str = readFile(TestUtil.getResourcePath(CacheUtils.class, "cachejta.xml"));
+    String file_as_str = readFile(
+        createTempFileFromResource(CacheUtils.class, "cachejta.xml")
+            .getAbsolutePath());
     String modified_file_str = file_as_str.replaceAll("newDB", "newDB_" + pid);
     FileOutputStream fos = new FileOutputStream(path);
     BufferedWriter wr = new BufferedWriter(new OutputStreamWriter(fos));
diff --git a/geode-core/src/distributedTest/java/org/apache/geode/internal/jta/dunit/TxnManagerMultiThreadDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/internal/jta/dunit/TxnManagerMultiThreadDUnitTest.java
index f38298d..237812f 100755
--- a/geode-core/src/distributedTest/java/org/apache/geode/internal/jta/dunit/TxnManagerMultiThreadDUnitTest.java
+++ b/geode-core/src/distributedTest/java/org/apache/geode/internal/jta/dunit/TxnManagerMultiThreadDUnitTest.java
@@ -16,6 +16,7 @@ package org.apache.geode.internal.jta.dunit;
 
 import static org.apache.geode.distributed.ConfigurationProperties.CACHE_XML_FILE;
 import static org.apache.geode.test.dunit.Assert.fail;
+import static org.apache.geode.test.util.ResourceUtils.createTempFileFromResource;
 
 import java.io.BufferedReader;
 import java.io.BufferedWriter;
@@ -52,7 +53,6 @@ import org.apache.geode.test.dunit.LogWriterUtils;
 import org.apache.geode.test.dunit.ThreadUtils;
 import org.apache.geode.test.dunit.VM;
 import org.apache.geode.test.dunit.internal.JUnit4DistributedTestCase;
-import org.apache.geode.util.test.TestUtil;
 
 /**
  * This test case is to test the following test scenarios: 1) Behaviour of Transaction Manager in
@@ -168,7 +168,9 @@ public class TxnManagerMultiThreadDUnitTest extends JUnit4DistributedTestCase {
     String path = File.createTempFile("dunit-cachejta_", ".xml").getAbsolutePath();
     LogWriterUtils.getLogWriter().fine("PATH " + path);
     /** * Return file as string and then modify the string accordingly ** */
-    String file_as_str = readFile(TestUtil.getResourcePath(CacheUtils.class, "cachejta.xml"));
+    String file_as_str = readFile(
+        createTempFileFromResource(CacheUtils.class, "cachejta.xml")
+            .getAbsolutePath());
     file_as_str = file_as_str.replaceAll("newDB", "newDB_" + pid);
     String modified_file_str = modifyFile(file_as_str);
     String modified_file_str1 = modifyFile1(modified_file_str);
diff --git a/geode-core/src/distributedTest/java/org/apache/geode/internal/jta/dunit/TxnTimeOutDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/internal/jta/dunit/TxnTimeOutDUnitTest.java
index b9a3958..183349a 100755
--- a/geode-core/src/distributedTest/java/org/apache/geode/internal/jta/dunit/TxnTimeOutDUnitTest.java
+++ b/geode-core/src/distributedTest/java/org/apache/geode/internal/jta/dunit/TxnTimeOutDUnitTest.java
@@ -17,6 +17,7 @@ package org.apache.geode.internal.jta.dunit;
 import static org.apache.geode.distributed.ConfigurationProperties.CACHE_XML_FILE;
 import static org.apache.geode.distributed.ConfigurationProperties.LOG_LEVEL;
 import static org.apache.geode.test.dunit.Assert.fail;
+import static org.apache.geode.test.util.ResourceUtils.createTempFileFromResource;
 
 import java.io.BufferedReader;
 import java.io.BufferedWriter;
@@ -47,7 +48,6 @@ import org.apache.geode.test.dunit.LogWriterUtils;
 import org.apache.geode.test.dunit.ThreadUtils;
 import org.apache.geode.test.dunit.VM;
 import org.apache.geode.test.dunit.internal.JUnit4DistributedTestCase;
-import org.apache.geode.util.test.TestUtil;
 
 /**
  * This test sees if the TransactionTimeOut works properly
@@ -62,7 +62,9 @@ public class TxnTimeOutDUnitTest extends JUnit4DistributedTestCase {
     Properties props = new Properties();
     int pid = OSProcess.getId();
     String path = File.createTempFile("dunit-cachejta_", ".xml").getAbsolutePath();
-    String file_as_str = readFile(TestUtil.getResourcePath(CacheUtils.class, "cachejta.xml"));
+    String file_as_str = readFile(
+        createTempFileFromResource(CacheUtils.class, "cachejta.xml")
+            .getAbsolutePath());
     String modified_file_str = file_as_str.replaceAll("newDB", "newDB_" + pid);
     FileOutputStream fos = new FileOutputStream(path);
     BufferedWriter wr = new BufferedWriter(new OutputStreamWriter(fos));
diff --git a/geode-core/src/distributedTest/java/org/apache/geode/internal/tcp/TCPConduitDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/internal/tcp/TCPConduitDUnitTest.java
index 4da4a18..9462c72 100644
--- a/geode-core/src/distributedTest/java/org/apache/geode/internal/tcp/TCPConduitDUnitTest.java
+++ b/geode-core/src/distributedTest/java/org/apache/geode/internal/tcp/TCPConduitDUnitTest.java
@@ -15,6 +15,7 @@
 package org.apache.geode.internal.tcp;
 
 import static org.apache.geode.test.awaitility.GeodeAwaitility.await;
+import static org.apache.geode.test.util.ResourceUtils.createTempFileFromResource;
 
 import java.io.File;
 import java.io.IOException;
@@ -36,9 +37,6 @@ import org.apache.geode.test.dunit.DistributedTestUtils;
 import org.apache.geode.test.dunit.IgnoredException;
 import org.apache.geode.test.dunit.VM;
 import org.apache.geode.test.junit.runners.CategoryWithParameterizedRunnerFactory;
-import org.apache.geode.util.test.TestUtil;
-
-
 
 @RunWith(Parameterized.class)
 @Parameterized.UseParametersRunnerFactory(CategoryWithParameterizedRunnerFactory.class)
@@ -55,8 +53,9 @@ public class TCPConduitDUnitTest extends DistributedTestCase {
     Properties SSL = new Properties();
     SSL.putAll(nonSSL);
 
-    final String keystorePath = TestUtil.getResourcePath(TCPConduitDUnitTest.class,
-        "/org/apache/geode/cache/client/internal/default.keystore");
+    final String keystorePath =
+        createTempFileFromResource(TCPConduitDUnitTest.class,
+            "/org/apache/geode/cache/client/internal/default.keystore").getAbsolutePath();
 
     SSL.setProperty(ConfigurationProperties.SSL_ENABLED_COMPONENTS, "cluster");
     SSL.setProperty(ConfigurationProperties.SSL_KEYSTORE, keystorePath);
diff --git a/geode-core/src/distributedTest/java/org/apache/geode/management/JMXMBeanDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/management/JMXMBeanDUnitTest.java
index f5b7257..15918e0 100644
--- a/geode-core/src/distributedTest/java/org/apache/geode/management/JMXMBeanDUnitTest.java
+++ b/geode-core/src/distributedTest/java/org/apache/geode/management/JMXMBeanDUnitTest.java
@@ -34,6 +34,7 @@ import static org.apache.geode.distributed.ConfigurationProperties.SSL_PROTOCOLS
 import static org.apache.geode.distributed.ConfigurationProperties.SSL_TRUSTSTORE;
 import static org.apache.geode.distributed.ConfigurationProperties.SSL_TRUSTSTORE_PASSWORD;
 import static org.apache.geode.test.dunit.VM.getVM;
+import static org.apache.geode.test.util.ResourceUtils.createTempFileFromResource;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.junit.Assert.assertEquals;
@@ -62,7 +63,6 @@ import org.apache.geode.test.dunit.rules.ClusterStartupRule;
 import org.apache.geode.test.dunit.rules.DistributedRule;
 import org.apache.geode.test.junit.categories.JMXTest;
 import org.apache.geode.test.junit.rules.MBeanServerConnectionRule;
-import org.apache.geode.util.test.TestUtil;
 
 /**
  * All the non-ssl enabled locators need to be in a different VM than the ssl enabled locators in
@@ -95,11 +95,15 @@ public class JMXMBeanDUnitTest implements Serializable {
 
   @BeforeClass
   public static void beforeClass() {
-    singleKeystore = TestUtil.getResourcePath(JMXMBeanDUnitTest.class, "/ssl/trusted.keystore");
-    multiKeystore = TestUtil.getResourcePath(JMXMBeanDUnitTest.class,
-        "/org/apache/geode/internal/net/multiKey.jks");
-    multiKeyTruststore = TestUtil.getResourcePath(JMXMBeanDUnitTest.class,
-        "/org/apache/geode/internal/net/multiKeyTrust.jks");
+    singleKeystore =
+        createTempFileFromResource(JMXMBeanDUnitTest.class, "/ssl/trusted.keystore")
+            .getAbsolutePath();
+    multiKeystore =
+        createTempFileFromResource(JMXMBeanDUnitTest.class,
+            "/org/apache/geode/internal/net/multiKey.jks").getAbsolutePath();
+    multiKeyTruststore =
+        createTempFileFromResource(JMXMBeanDUnitTest.class,
+            "/org/apache/geode/internal/net/multiKeyTrust.jks").getAbsolutePath();
 
     // setting up properties used to set the ssl properties used by the locators
     legacySSLProperties = new Properties();
diff --git a/geode-core/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/DeployCommandFunctionRegistrationDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/DeployCommandFunctionRegistrationDUnitTest.java
index ee28502..0d094a6 100644
--- a/geode-core/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/DeployCommandFunctionRegistrationDUnitTest.java
+++ b/geode-core/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/DeployCommandFunctionRegistrationDUnitTest.java
@@ -14,6 +14,7 @@
  */
 package org.apache.geode.management.internal.cli.commands;
 
+import static org.apache.geode.test.util.ResourceUtils.createTempFileFromResource;
 import static org.assertj.core.api.Assertions.assertThat;
 
 import java.io.File;
@@ -36,7 +37,6 @@ import org.apache.geode.test.dunit.rules.MemberVM;
 import org.apache.geode.test.junit.categories.FunctionServiceTest;
 import org.apache.geode.test.junit.rules.GfshCommandRule;
 import org.apache.geode.test.junit.rules.serializable.SerializableTemporaryFolder;
-import org.apache.geode.util.test.TestUtil;
 
 @Category({FunctionServiceTest.class})
 public class DeployCommandFunctionRegistrationDUnitTest {
@@ -95,7 +95,8 @@ public class DeployCommandFunctionRegistrationDUnitTest {
   }
 
   private File loadTestResource(String fileName) throws URISyntaxException {
-    String filePath = TestUtil.getResourcePath(this.getClass(), fileName);
+    String filePath =
+        createTempFileFromResource(this.getClass(), fileName).getAbsolutePath();
     assertThat(filePath).isNotNull();
 
     return new File(filePath);
diff --git a/geode-core/src/distributedTest/java/org/apache/geode/management/internal/configuration/ClusterConfigServerRestartWithJarDeployDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/management/internal/configuration/ClusterConfigServerRestartWithJarDeployDUnitTest.java
index 1cb7d7f..75cbf45 100644
--- a/geode-core/src/distributedTest/java/org/apache/geode/management/internal/configuration/ClusterConfigServerRestartWithJarDeployDUnitTest.java
+++ b/geode-core/src/distributedTest/java/org/apache/geode/management/internal/configuration/ClusterConfigServerRestartWithJarDeployDUnitTest.java
@@ -15,6 +15,7 @@
 
 package org.apache.geode.management.internal.configuration;
 
+import static org.apache.geode.test.util.ResourceUtils.createTempFileFromResource;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.fail;
 
@@ -40,7 +41,6 @@ import org.apache.geode.test.dunit.rules.ClusterStartupRule;
 import org.apache.geode.test.dunit.rules.MemberVM;
 import org.apache.geode.test.junit.rules.GfshCommandRule;
 import org.apache.geode.test.junit.rules.serializable.SerializableTemporaryFolder;
-import org.apache.geode.util.test.TestUtil;
 
 public class ClusterConfigServerRestartWithJarDeployDUnitTest {
 
@@ -87,8 +87,8 @@ public class ClusterConfigServerRestartWithJarDeployDUnitTest {
   private File getFunctionJar() throws IOException {
     JarBuilder jarBuilder = new JarBuilder();
     String filePath =
-        TestUtil.getResourcePath(this.getClass(),
-            "/ClusterConfigServerRestartWithJarDeployFunction.java");
+        createTempFileFromResource(this.getClass(),
+            "/ClusterConfigServerRestartWithJarDeployFunction.java").getAbsolutePath();
     assertThat(filePath).as("java file resource not found").isNotBlank();
 
     File functionJar = new File(temporaryFolder.newFolder(), "output.jar");
diff --git a/geode-core/src/distributedTest/java/org/apache/geode/management/internal/configuration/ConfigurationPersistenceServiceUsingDirDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/management/internal/configuration/ConfigurationPersistenceServiceUsingDirDUnitTest.java
index 22c450c..dfc7e59 100644
--- a/geode-core/src/distributedTest/java/org/apache/geode/management/internal/configuration/ConfigurationPersistenceServiceUsingDirDUnitTest.java
+++ b/geode-core/src/distributedTest/java/org/apache/geode/management/internal/configuration/ConfigurationPersistenceServiceUsingDirDUnitTest.java
@@ -25,6 +25,7 @@ import static org.apache.geode.distributed.ConfigurationProperties.USE_CLUSTER_C
 import static org.apache.geode.internal.AvailablePortHelper.getRandomAvailableTCPPorts;
 import static org.apache.geode.test.awaitility.GeodeAwaitility.await;
 import static org.apache.geode.test.dunit.Host.getHost;
+import static org.apache.geode.test.util.ResourceUtils.createTempFileFromResource;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
 
@@ -45,7 +46,6 @@ import org.apache.geode.distributed.internal.InternalConfigurationPersistenceSer
 import org.apache.geode.distributed.internal.InternalLocator;
 import org.apache.geode.test.dunit.VM;
 import org.apache.geode.test.dunit.cache.internal.JUnit4CacheTestCase;
-import org.apache.geode.util.test.TestUtil;
 
 public class ConfigurationPersistenceServiceUsingDirDUnitTest extends JUnit4CacheTestCase {
 
@@ -256,8 +256,9 @@ public class ConfigurationPersistenceServiceUsingDirDUnitTest extends JUnit4Cach
 
   private void copyClusterXml(final VM vm, final String clusterXml) {
     vm.invoke("Copying new cluster.xml from " + clusterXml, () -> {
-      String clusterXmlPath = TestUtil
-          .getResourcePath(ConfigurationPersistenceServiceUsingDirDUnitTest.class, clusterXml);
+      String clusterXmlPath =
+          createTempFileFromResource(ConfigurationPersistenceServiceUsingDirDUnitTest.class,
+              clusterXml).getAbsolutePath();
       InputStream cacheXml = new FileInputStream(clusterXmlPath);
       assertNotNull("Could not create InputStream from " + clusterXmlPath, cacheXml);
       Files.createDirectories(Paths.get("cluster_config", "cluster"));
diff --git a/geode-core/src/distributedTest/java/org/apache/geode/management/internal/configuration/DeployJarWithSSLDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/management/internal/configuration/DeployJarWithSSLDUnitTest.java
index 6920d4a..10d314f 100644
--- a/geode-core/src/distributedTest/java/org/apache/geode/management/internal/configuration/DeployJarWithSSLDUnitTest.java
+++ b/geode-core/src/distributedTest/java/org/apache/geode/management/internal/configuration/DeployJarWithSSLDUnitTest.java
@@ -24,7 +24,7 @@ import static org.apache.geode.distributed.ConfigurationProperties.SSL_PROTOCOLS
 import static org.apache.geode.distributed.ConfigurationProperties.SSL_TRUSTSTORE;
 import static org.apache.geode.distributed.ConfigurationProperties.SSL_TRUSTSTORE_PASSWORD;
 import static org.apache.geode.distributed.ConfigurationProperties.SSL_TRUSTSTORE_TYPE;
-import static org.apache.geode.util.test.TestUtil.getResourcePath;
+import static org.apache.geode.test.util.ResourceUtils.createTempFileFromResource;
 
 import java.io.File;
 import java.io.FileOutputStream;
@@ -42,11 +42,11 @@ import org.apache.geode.test.dunit.rules.ClusterStartupRule;
 import org.apache.geode.test.dunit.rules.MemberVM;
 import org.apache.geode.test.junit.rules.GfshCommandRule;
 
-
 public class DeployJarWithSSLDUnitTest {
 
   private static File jks =
-      new File(getResourcePath(DeployJarWithSSLDUnitTest.class, "/ssl/trusted.keystore"));
+      new File(createTempFileFromResource(DeployJarWithSSLDUnitTest.class, "/ssl/trusted.keystore")
+          .getAbsolutePath());
 
   @Rule
   public TemporaryFolder temporaryFolder = new TemporaryFolder();
diff --git a/geode-core/src/distributedTest/java/org/apache/geode/pdx/JSONPdxClientServerDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/pdx/JSONPdxClientServerDUnitTest.java
index 21a3970..5559e60 100755
--- a/geode-core/src/distributedTest/java/org/apache/geode/pdx/JSONPdxClientServerDUnitTest.java
+++ b/geode-core/src/distributedTest/java/org/apache/geode/pdx/JSONPdxClientServerDUnitTest.java
@@ -50,7 +50,7 @@ import org.apache.geode.test.dunit.SerializableCallable;
 import org.apache.geode.test.dunit.VM;
 import org.apache.geode.test.dunit.cache.internal.JUnit4CacheTestCase;
 import org.apache.geode.test.junit.categories.RestAPITest;
-import org.apache.geode.util.test.TestUtil;
+import org.apache.geode.test.util.ResourceUtils;
 
 @Category({RestAPITest.class})
 public class JSONPdxClientServerDUnitTest extends JUnit4CacheTestCase {
@@ -239,7 +239,7 @@ public class JSONPdxClientServerDUnitTest extends JUnit4CacheTestCase {
   }
 
   String getJSONDir(String file) {
-    String path = TestUtil.getResourcePath(getClass(), file);
+    String path = ResourceUtils.getResource(getClass(), file).getPath();
     return new File(path).getParent();
   }
 
diff --git a/geode-core/src/integrationTest/java/org/apache/geode/cache/client/internal/LocatorSSLJUnitTest.java b/geode-core/src/integrationTest/java/org/apache/geode/cache/client/internal/LocatorSSLJUnitTest.java
index 18a84f5..df9c211 100644
--- a/geode-core/src/integrationTest/java/org/apache/geode/cache/client/internal/LocatorSSLJUnitTest.java
+++ b/geode-core/src/integrationTest/java/org/apache/geode/cache/client/internal/LocatorSSLJUnitTest.java
@@ -21,6 +21,7 @@ import static org.apache.geode.distributed.ConfigurationProperties.SSL_KEYSTORE_
 import static org.apache.geode.distributed.ConfigurationProperties.SSL_KEYSTORE_TYPE;
 import static org.apache.geode.distributed.ConfigurationProperties.SSL_TRUSTSTORE;
 import static org.apache.geode.distributed.ConfigurationProperties.SSL_TRUSTSTORE_PASSWORD;
+import static org.apache.geode.test.util.ResourceUtils.createTempFileFromResource;
 
 import java.io.IOException;
 import java.util.Properties;
@@ -32,12 +33,12 @@ import org.junit.experimental.categories.Category;
 import org.apache.geode.distributed.Locator;
 import org.apache.geode.internal.net.SSLConfigurationFactory;
 import org.apache.geode.test.junit.categories.ClientServerTest;
-import org.apache.geode.util.test.TestUtil;
 
 @Category({ClientServerTest.class})
 public class LocatorSSLJUnitTest {
   private final String KEY_STORE =
-      TestUtil.getResourcePath(LocatorSSLJUnitTest.class, "default.keystore");
+      createTempFileFromResource(LocatorSSLJUnitTest.class, "default.keystore")
+          .getAbsolutePath();
 
   @After
   public void tearDownTest() {
diff --git a/geode-core/src/integrationTest/java/org/apache/geode/cache/query/internal/index/DeclarativeIndexCreationJUnitTest.java b/geode-core/src/integrationTest/java/org/apache/geode/cache/query/internal/index/DeclarativeIndexCreationJUnitTest.java
index 947766d..1baeed1 100644
--- a/geode-core/src/integrationTest/java/org/apache/geode/cache/query/internal/index/DeclarativeIndexCreationJUnitTest.java
+++ b/geode-core/src/integrationTest/java/org/apache/geode/cache/query/internal/index/DeclarativeIndexCreationJUnitTest.java
@@ -20,6 +20,7 @@ package org.apache.geode.cache.query.internal.index;
 
 import static org.apache.geode.distributed.ConfigurationProperties.CACHE_XML_FILE;
 import static org.apache.geode.distributed.ConfigurationProperties.MCAST_PORT;
+import static org.apache.geode.test.util.ResourceUtils.createTempFileFromResource;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
@@ -39,7 +40,6 @@ import org.apache.geode.cache.query.CacheUtils;
 import org.apache.geode.distributed.DistributedSystem;
 import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.test.junit.categories.OQLIndexTest;
-import org.apache.geode.util.test.TestUtil;
 
 @Category({OQLIndexTest.class})
 public class DeclarativeIndexCreationJUnitTest {
@@ -50,7 +50,9 @@ public class DeclarativeIndexCreationJUnitTest {
   @Before
   public void setUp() throws Exception {
     Properties props = new Properties();
-    props.setProperty(CACHE_XML_FILE, TestUtil.getResourcePath(getClass(), "cachequeryindex.xml"));
+    props.setProperty(CACHE_XML_FILE,
+        createTempFileFromResource(getClass(), "cachequeryindex.xml")
+            .getAbsolutePath());
     props.setProperty(MCAST_PORT, "0");
     ds = DistributedSystem.connect(props);
     cache = CacheFactory.create(ds);
diff --git a/geode-core/src/integrationTest/java/org/apache/geode/distributed/internal/tcpserver/TCPServerSSLJUnitTest.java b/geode-core/src/integrationTest/java/org/apache/geode/distributed/internal/tcpserver/TCPServerSSLJUnitTest.java
index ad0248e..f3d841a 100644
--- a/geode-core/src/integrationTest/java/org/apache/geode/distributed/internal/tcpserver/TCPServerSSLJUnitTest.java
+++ b/geode-core/src/integrationTest/java/org/apache/geode/distributed/internal/tcpserver/TCPServerSSLJUnitTest.java
@@ -22,6 +22,7 @@ import static org.apache.geode.distributed.ConfigurationProperties.SSL_KEYSTORE_
 import static org.apache.geode.distributed.ConfigurationProperties.SSL_PROTOCOLS;
 import static org.apache.geode.distributed.ConfigurationProperties.SSL_TRUSTSTORE;
 import static org.apache.geode.distributed.ConfigurationProperties.SSL_TRUSTSTORE_PASSWORD;
+import static org.apache.geode.test.util.ResourceUtils.createTempFileFromResource;
 
 import java.io.IOException;
 import java.net.InetAddress;
@@ -49,7 +50,6 @@ import org.apache.geode.internal.net.SocketCreator;
 import org.apache.geode.internal.net.SocketCreatorFactory;
 import org.apache.geode.internal.security.SecurableCommunicationChannel;
 import org.apache.geode.test.junit.categories.MembershipTest;
-import org.apache.geode.util.test.TestUtil;
 
 @Category({MembershipTest.class})
 public class TCPServerSSLJUnitTest {
@@ -110,9 +110,11 @@ public class TCPServerSSLJUnitTest {
     sslProperties.setProperty(SSL_ENABLED_COMPONENTS,
         SecurableCommunicationChannel.LOCATOR.getConstant());
     sslProperties.setProperty(SSL_KEYSTORE,
-        TestUtil.getResourcePath(getClass(), "/org/apache/geode/internal/net/multiKey.jks"));
+        createTempFileFromResource(getClass(), "/org/apache/geode/internal/net/multiKey.jks")
+            .getAbsolutePath());
     sslProperties.setProperty(SSL_TRUSTSTORE,
-        TestUtil.getResourcePath(getClass(), "/org/apache/geode/internal/net/multiKeyTrust.jks"));
+        createTempFileFromResource(getClass(),
+            "/org/apache/geode/internal/net/multiKeyTrust.jks").getAbsolutePath());
     sslProperties.setProperty(SSL_KEYSTORE_PASSWORD, "password");
     sslProperties.setProperty(SSL_TRUSTSTORE_PASSWORD, "password");
     sslProperties.setProperty(SSL_KEYSTORE_TYPE, "JKS");
diff --git a/geode-core/src/integrationTest/java/org/apache/geode/internal/cache/DiskRegCacheXmlJUnitTest.java b/geode-core/src/integrationTest/java/org/apache/geode/internal/cache/DiskRegCacheXmlJUnitTest.java
index 5afb158..641d61e 100644
--- a/geode-core/src/integrationTest/java/org/apache/geode/internal/cache/DiskRegCacheXmlJUnitTest.java
+++ b/geode-core/src/integrationTest/java/org/apache/geode/internal/cache/DiskRegCacheXmlJUnitTest.java
@@ -17,6 +17,7 @@ package org.apache.geode.internal.cache;
 import static org.apache.geode.distributed.ConfigurationProperties.CACHE_XML_FILE;
 import static org.apache.geode.distributed.ConfigurationProperties.MCAST_PORT;
 import static org.apache.geode.distributed.ConfigurationProperties.NAME;
+import static org.apache.geode.test.util.ResourceUtils.createTempFileFromResource;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
@@ -36,7 +37,6 @@ import org.apache.geode.cache.DiskStore;
 import org.apache.geode.cache.Region;
 import org.apache.geode.cache.RegionAttributes;
 import org.apache.geode.distributed.DistributedSystem;
-import org.apache.geode.util.test.TestUtil;
 
 /**
  * This test is for testing Disk attributes set via xml.
@@ -71,7 +71,9 @@ public class DiskRegCacheXmlJUnitTest {
     // Connect to the GemFire distributed system
     Properties props = new Properties();
     props.setProperty(NAME, "test");
-    String path = TestUtil.getResourcePath(getClass(), "DiskRegCacheXmlJUnitTest.xml");
+    String path =
+        createTempFileFromResource(getClass(), "DiskRegCacheXmlJUnitTest.xml")
+            .getAbsolutePath();
     props.setProperty(MCAST_PORT, "0");
     props.setProperty(CACHE_XML_FILE, path);
     ds = DistributedSystem.connect(props);
diff --git a/geode-core/src/integrationTest/java/org/apache/geode/internal/cache/DiskRegionIllegalCacheXMLvaluesJUnitTest.java b/geode-core/src/integrationTest/java/org/apache/geode/internal/cache/DiskRegionIllegalCacheXMLvaluesJUnitTest.java
index ea2005e..21d2f24 100755
--- a/geode-core/src/integrationTest/java/org/apache/geode/internal/cache/DiskRegionIllegalCacheXMLvaluesJUnitTest.java
+++ b/geode-core/src/integrationTest/java/org/apache/geode/internal/cache/DiskRegionIllegalCacheXMLvaluesJUnitTest.java
@@ -16,6 +16,7 @@ package org.apache.geode.internal.cache;
 
 import static org.apache.geode.distributed.ConfigurationProperties.CACHE_XML_FILE;
 import static org.apache.geode.distributed.ConfigurationProperties.MCAST_PORT;
+import static org.apache.geode.test.util.ResourceUtils.createTempFileFromResource;
 import static org.junit.Assert.fail;
 
 import java.io.File;
@@ -27,7 +28,6 @@ import org.junit.Test;
 import org.apache.geode.cache.CacheFactory;
 import org.apache.geode.cache.CacheXmlException;
 import org.apache.geode.distributed.DistributedSystem;
-import org.apache.geode.util.test.TestUtil;
 
 /**
  * This test tests Illegal arguements being passed to create disk regions. The creation of the DWA
@@ -44,7 +44,8 @@ public class DiskRegionIllegalCacheXMLvaluesJUnitTest {
       dir.deleteOnExit();
       Properties props = new Properties();
       props.setProperty(MCAST_PORT, "0");
-      props.setProperty(CACHE_XML_FILE, TestUtil.getResourcePath(getClass(), path));
+      props.setProperty(CACHE_XML_FILE,
+          createTempFileFromResource(getClass(), path).getAbsolutePath());
       ds = DistributedSystem.connect(props);
       try {
 
diff --git a/geode-core/src/integrationTest/java/org/apache/geode/internal/cache/tier/sockets/RedundancyLevelJUnitTest.java b/geode-core/src/integrationTest/java/org/apache/geode/internal/cache/tier/sockets/RedundancyLevelJUnitTest.java
index 58714e1..b5b2ad1 100644
--- a/geode-core/src/integrationTest/java/org/apache/geode/internal/cache/tier/sockets/RedundancyLevelJUnitTest.java
+++ b/geode-core/src/integrationTest/java/org/apache/geode/internal/cache/tier/sockets/RedundancyLevelJUnitTest.java
@@ -17,6 +17,7 @@ package org.apache.geode.internal.cache.tier.sockets;
 import static org.apache.geode.distributed.ConfigurationProperties.CACHE_XML_FILE;
 import static org.apache.geode.distributed.ConfigurationProperties.LOCATORS;
 import static org.apache.geode.distributed.ConfigurationProperties.MCAST_PORT;
+import static org.apache.geode.test.util.ResourceUtils.createTempFileFromResource;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 
@@ -33,7 +34,6 @@ import org.apache.geode.cache.client.Pool;
 import org.apache.geode.cache.client.PoolManager;
 import org.apache.geode.distributed.DistributedSystem;
 import org.apache.geode.test.junit.categories.ClientSubscriptionTest;
-import org.apache.geode.util.test.TestUtil;
 
 /**
  * Tests the proper intialization of redundancyLevel property.
@@ -87,7 +87,9 @@ public class RedundancyLevelJUnitTest {
    */
   @Test
   public void testRedundancyLevelSetThroughXML() {
-    String path = TestUtil.getResourcePath(getClass(), "RedundancyLevelJUnitTest.xml");
+    String path =
+        createTempFileFromResource(getClass(), "RedundancyLevelJUnitTest.xml")
+            .getAbsolutePath();
 
     Properties p = new Properties();
     p.setProperty(MCAST_PORT, "0");
diff --git a/geode-core/src/integrationTest/java/org/apache/geode/internal/cache/wan/asyncqueue/AsyncEventQueueValidationsJUnitTest.java b/geode-core/src/integrationTest/java/org/apache/geode/internal/cache/wan/asyncqueue/AsyncEventQueueValidationsJUnitTest.java
index 9eadeef..381a3a4 100644
--- a/geode-core/src/integrationTest/java/org/apache/geode/internal/cache/wan/asyncqueue/AsyncEventQueueValidationsJUnitTest.java
+++ b/geode-core/src/integrationTest/java/org/apache/geode/internal/cache/wan/asyncqueue/AsyncEventQueueValidationsJUnitTest.java
@@ -18,6 +18,7 @@ import static junitparams.JUnitParamsRunner.$;
 import static org.apache.geode.distributed.ConfigurationProperties.CACHE_XML_FILE;
 import static org.apache.geode.distributed.ConfigurationProperties.MCAST_PORT;
 import static org.apache.geode.test.awaitility.GeodeAwaitility.await;
+import static org.apache.geode.test.util.ResourceUtils.createTempFileFromResource;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
@@ -40,7 +41,6 @@ import org.apache.geode.cache.wan.GatewaySender.OrderPolicy;
 import org.apache.geode.internal.cache.wan.AsyncEventQueueConfigurationException;
 import org.apache.geode.internal.cache.wan.MyGatewayEventFilter;
 import org.apache.geode.test.junit.categories.AEQTest;
-import org.apache.geode.util.test.TestUtil;
 
 @Category({AEQTest.class})
 @RunWith(JUnitParamsRunner.class)
@@ -90,8 +90,10 @@ public class AsyncEventQueueValidationsJUnitTest {
   @Parameters(method = "getCacheXmlFileBaseNames")
   public void testAsyncEventQueueConfiguredFromXmlUsesFilter(String cacheXmlFileBaseName) {
     // Create cache with xml
-    String cacheXmlFileName = TestUtil.getResourcePath(getClass(),
-        getClass().getSimpleName() + "." + cacheXmlFileBaseName + ".cache.xml");
+    String cacheXmlFileName =
+        createTempFileFromResource(getClass(),
+            getClass().getSimpleName() + "." + cacheXmlFileBaseName + ".cache.xml")
+                .getAbsolutePath();
     cache = new CacheFactory().set(MCAST_PORT, "0").set(CACHE_XML_FILE, cacheXmlFileName).create();
 
     // Get region and do puts
diff --git a/geode-core/src/integrationTest/java/org/apache/geode/internal/datasource/AbstractPoolCacheJUnitTest.java b/geode-core/src/integrationTest/java/org/apache/geode/internal/datasource/AbstractPoolCacheJUnitTest.java
index 1110bfa..7ead2a6 100644
--- a/geode-core/src/integrationTest/java/org/apache/geode/internal/datasource/AbstractPoolCacheJUnitTest.java
+++ b/geode-core/src/integrationTest/java/org/apache/geode/internal/datasource/AbstractPoolCacheJUnitTest.java
@@ -23,6 +23,7 @@ import static org.apache.geode.distributed.ConfigurationProperties.CACHE_XML_FIL
 import static org.apache.geode.distributed.ConfigurationProperties.LOCATORS;
 import static org.apache.geode.distributed.ConfigurationProperties.LOG_LEVEL;
 import static org.apache.geode.distributed.ConfigurationProperties.MCAST_PORT;
+import static org.apache.geode.test.util.ResourceUtils.createTempFileFromResource;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.fail;
 
@@ -45,7 +46,6 @@ import org.junit.Test;
 import org.apache.geode.cache.Cache;
 import org.apache.geode.cache.CacheFactory;
 import org.apache.geode.distributed.DistributedSystem;
-import org.apache.geode.util.test.TestUtil;
 
 public class AbstractPoolCacheJUnitTest {
 
@@ -59,7 +59,9 @@ public class AbstractPoolCacheJUnitTest {
     props.setProperty(LOG_LEVEL, "info");
     props.setProperty(MCAST_PORT, "0");
     props.setProperty(LOCATORS, "");
-    String path = TestUtil.getResourcePath(AbstractPoolCacheJUnitTest.class, "/jta/cachejta.xml");
+    String path =
+        createTempFileFromResource(AbstractPoolCacheJUnitTest.class, "/jta/cachejta.xml")
+            .getAbsolutePath();
     props.setProperty(CACHE_XML_FILE, path);
     ds1 = DistributedSystem.connect(props);
     cache = CacheFactory.create(ds1);
diff --git a/geode-core/src/integrationTest/java/org/apache/geode/internal/datasource/CleanUpJUnitTest.java b/geode-core/src/integrationTest/java/org/apache/geode/internal/datasource/CleanUpJUnitTest.java
index 6b7433e..3d54b15 100644
--- a/geode-core/src/integrationTest/java/org/apache/geode/internal/datasource/CleanUpJUnitTest.java
+++ b/geode-core/src/integrationTest/java/org/apache/geode/internal/datasource/CleanUpJUnitTest.java
@@ -19,6 +19,7 @@ package org.apache.geode.internal.datasource;
 
 import static org.apache.geode.distributed.ConfigurationProperties.CACHE_XML_FILE;
 import static org.apache.geode.distributed.ConfigurationProperties.MCAST_PORT;
+import static org.apache.geode.test.util.ResourceUtils.createTempFileFromResource;
 import static org.junit.Assert.fail;
 
 import java.sql.Connection;
@@ -33,8 +34,6 @@ import org.junit.Test;
 import org.apache.geode.cache.Cache;
 import org.apache.geode.cache.CacheFactory;
 import org.apache.geode.distributed.DistributedSystem;
-import org.apache.geode.util.test.TestUtil;
-
 
 /**
  *
@@ -51,7 +50,9 @@ public class CleanUpJUnitTest {
   public void setUp() {
     props = new Properties();
     props.setProperty(MCAST_PORT, "0");
-    String path = TestUtil.getResourcePath(CleanUpJUnitTest.class, "/jta/cachejta.xml");
+    String path =
+        createTempFileFromResource(CleanUpJUnitTest.class, "/jta/cachejta.xml")
+            .getAbsolutePath();
     props.setProperty(CACHE_XML_FILE, path);
     ds1 = DistributedSystem.connect(props);
     cache = CacheFactory.create(ds1);
diff --git a/geode-core/src/integrationTest/java/org/apache/geode/internal/datasource/ConnectionPoolCacheImplJUnitTest.java b/geode-core/src/integrationTest/java/org/apache/geode/internal/datasource/ConnectionPoolCacheImplJUnitTest.java
index 0fd5e12..e8fdad2 100644
--- a/geode-core/src/integrationTest/java/org/apache/geode/internal/datasource/ConnectionPoolCacheImplJUnitTest.java
+++ b/geode-core/src/integrationTest/java/org/apache/geode/internal/datasource/ConnectionPoolCacheImplJUnitTest.java
@@ -21,6 +21,7 @@ package org.apache.geode.internal.datasource;
 
 import static org.apache.geode.distributed.ConfigurationProperties.CACHE_XML_FILE;
 import static org.apache.geode.distributed.ConfigurationProperties.MCAST_PORT;
+import static org.apache.geode.test.util.ResourceUtils.createTempFileFromResource;
 import static org.junit.Assert.fail;
 
 import java.sql.Connection;
@@ -35,7 +36,6 @@ import org.junit.Test;
 import org.apache.geode.cache.Cache;
 import org.apache.geode.cache.CacheFactory;
 import org.apache.geode.distributed.DistributedSystem;
-import org.apache.geode.util.test.TestUtil;
 
 /*
  * this is a Multithreaded test for datasource connection pool.
@@ -53,7 +53,8 @@ public class ConnectionPoolCacheImplJUnitTest {
       props = new Properties();
       props.setProperty(MCAST_PORT, "0");
       String path =
-          TestUtil.getResourcePath(ConnectionPoolCacheImplJUnitTest.class, "/jta/cachejta.xml");
+          createTempFileFromResource(ConnectionPoolCacheImplJUnitTest.class,
+              "/jta/cachejta.xml").getAbsolutePath();
       props.setProperty(CACHE_XML_FILE, path);
       ds1 = DistributedSystem.connect(props);
       cache = CacheFactory.create(ds1);
diff --git a/geode-core/src/integrationTest/java/org/apache/geode/internal/datasource/ConnectionPoolingJUnitTest.java b/geode-core/src/integrationTest/java/org/apache/geode/internal/datasource/ConnectionPoolingJUnitTest.java
index 4c6355c..b63658a 100755
--- a/geode-core/src/integrationTest/java/org/apache/geode/internal/datasource/ConnectionPoolingJUnitTest.java
+++ b/geode-core/src/integrationTest/java/org/apache/geode/internal/datasource/ConnectionPoolingJUnitTest.java
@@ -16,6 +16,7 @@ package org.apache.geode.internal.datasource;
 
 import static org.apache.geode.distributed.ConfigurationProperties.CACHE_XML_FILE;
 import static org.apache.geode.distributed.ConfigurationProperties.MCAST_PORT;
+import static org.apache.geode.test.util.ResourceUtils.createTempFileFromResource;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.fail;
 
@@ -41,7 +42,6 @@ import org.apache.geode.cache.Cache;
 import org.apache.geode.cache.CacheFactory;
 import org.apache.geode.distributed.DistributedSystem;
 import org.apache.geode.internal.logging.LogService;
-import org.apache.geode.util.test.TestUtil;
 
 public class ConnectionPoolingJUnitTest {
   private static final Logger logger = LogService.getLogger();
@@ -61,7 +61,9 @@ public class ConnectionPoolingJUnitTest {
     encounteredException = false;
     props = new Properties();
     props.setProperty(MCAST_PORT, "0");
-    String path = TestUtil.getResourcePath(ConnectionPoolingJUnitTest.class, "/jta/cachejta.xml");
+    String path =
+        createTempFileFromResource(ConnectionPoolingJUnitTest.class, "/jta/cachejta.xml")
+            .getAbsolutePath();
     props.setProperty(CACHE_XML_FILE, path);
     ds1 = DistributedSystem.connect(props);
     cache = CacheFactory.create(ds1);
diff --git a/geode-core/src/integrationTest/java/org/apache/geode/internal/datasource/DataSourceFactoryJUnitTest.java b/geode-core/src/integrationTest/java/org/apache/geode/internal/datasource/DataSourceFactoryJUnitTest.java
index 067fcf3..eac946e 100644
--- a/geode-core/src/integrationTest/java/org/apache/geode/internal/datasource/DataSourceFactoryJUnitTest.java
+++ b/geode-core/src/integrationTest/java/org/apache/geode/internal/datasource/DataSourceFactoryJUnitTest.java
@@ -16,6 +16,7 @@ package org.apache.geode.internal.datasource;
 
 import static org.apache.geode.distributed.ConfigurationProperties.CACHE_XML_FILE;
 import static org.apache.geode.distributed.ConfigurationProperties.MCAST_PORT;
+import static org.apache.geode.test.util.ResourceUtils.createTempFileFromResource;
 import static org.junit.Assert.fail;
 
 import java.sql.Connection;
@@ -31,7 +32,6 @@ import org.junit.Test;
 import org.apache.geode.cache.Cache;
 import org.apache.geode.cache.CacheFactory;
 import org.apache.geode.distributed.DistributedSystem;
-import org.apache.geode.util.test.TestUtil;
 
 public class DataSourceFactoryJUnitTest {
 
@@ -43,7 +43,9 @@ public class DataSourceFactoryJUnitTest {
   public void setUp() {
     props = new Properties();
     props.setProperty(MCAST_PORT, "0");
-    String path = TestUtil.getResourcePath(DataSourceFactoryJUnitTest.class, "/jta/cachejta.xml");
+    String path =
+        createTempFileFromResource(DataSourceFactoryJUnitTest.class, "/jta/cachejta.xml")
+            .getAbsolutePath();
     props.setProperty(CACHE_XML_FILE, path);
     ds1 = DistributedSystem.connect(props);
     cache = CacheFactory.create(ds1);
diff --git a/geode-core/src/integrationTest/java/org/apache/geode/internal/datasource/RestartJUnitTest.java b/geode-core/src/integrationTest/java/org/apache/geode/internal/datasource/RestartJUnitTest.java
index 3dc1810..1a74be0 100644
--- a/geode-core/src/integrationTest/java/org/apache/geode/internal/datasource/RestartJUnitTest.java
+++ b/geode-core/src/integrationTest/java/org/apache/geode/internal/datasource/RestartJUnitTest.java
@@ -19,6 +19,7 @@ package org.apache.geode.internal.datasource;
 
 import static org.apache.geode.distributed.ConfigurationProperties.CACHE_XML_FILE;
 import static org.apache.geode.distributed.ConfigurationProperties.MCAST_PORT;
+import static org.apache.geode.test.util.ResourceUtils.createTempFileFromResource;
 import static org.junit.Assert.assertNotSame;
 import static org.junit.Assert.fail;
 
@@ -32,8 +33,6 @@ import org.apache.geode.cache.Cache;
 import org.apache.geode.cache.CacheFactory;
 import org.apache.geode.distributed.DistributedSystem;
 import org.apache.geode.internal.jndi.JNDIInvoker;
-import org.apache.geode.util.test.TestUtil;
-
 
 /**
  *
@@ -53,7 +52,9 @@ public class RestartJUnitTest {
     try {
       props = new Properties();
       props.setProperty(MCAST_PORT, "0");
-      String path = TestUtil.getResourcePath(RestartJUnitTest.class, "/jta/cachejta.xml");
+      String path =
+          createTempFileFromResource(RestartJUnitTest.class, "/jta/cachejta.xml")
+              .getAbsolutePath();
       props.setProperty(CACHE_XML_FILE, path);
 
       ds1 = DistributedSystem.connect(props);
diff --git a/geode-core/src/integrationTest/java/org/apache/geode/internal/jta/BlockingTimeOutJUnitTest.java b/geode-core/src/integrationTest/java/org/apache/geode/internal/jta/BlockingTimeOutJUnitTest.java
index 230ab34..a863c22 100755
--- a/geode-core/src/integrationTest/java/org/apache/geode/internal/jta/BlockingTimeOutJUnitTest.java
+++ b/geode-core/src/integrationTest/java/org/apache/geode/internal/jta/BlockingTimeOutJUnitTest.java
@@ -17,6 +17,7 @@ package org.apache.geode.internal.jta;
 import static org.apache.geode.distributed.ConfigurationProperties.CACHE_XML_FILE;
 import static org.apache.geode.distributed.ConfigurationProperties.LOCATORS;
 import static org.apache.geode.distributed.ConfigurationProperties.MCAST_PORT;
+import static org.apache.geode.test.util.ResourceUtils.createTempFileFromResource;
 import static org.junit.Assert.assertNotNull;
 
 import java.io.BufferedReader;
@@ -45,7 +46,6 @@ import org.apache.geode.cache.CacheFactory;
 import org.apache.geode.distributed.DistributedSystem;
 import org.apache.geode.distributed.internal.InternalDistributedSystem;
 import org.apache.geode.internal.logging.LogService;
-import org.apache.geode.util.test.TestUtil;
 
 public class BlockingTimeOutJUnitTest {
   private static final Logger logger = LogService.getLogger();
@@ -133,7 +133,9 @@ public class BlockingTimeOutJUnitTest {
     path = File.createTempFile("dunit-cachejta_", ".xml").getAbsolutePath();
     logger.debug("PATH " + path);
     /** * Return file as string and then modify the string accordingly ** */
-    String file_as_str = readFile(TestUtil.getResourcePath(CacheUtils.class, "cachejta.xml"));
+    String file_as_str = readFile(
+        createTempFileFromResource(CacheUtils.class, "cachejta.xml")
+            .getAbsolutePath());
     file_as_str = file_as_str.replaceAll("newDB", "newDB_" + pid);
     String modified_file_str = modifyFile(file_as_str);
     FileOutputStream fos = new FileOutputStream(path);
diff --git a/geode-core/src/integrationTest/java/org/apache/geode/internal/jta/DataSourceJTAJUnitTest.java b/geode-core/src/integrationTest/java/org/apache/geode/internal/jta/DataSourceJTAJUnitTest.java
index d60f623..1f442dc 100755
--- a/geode-core/src/integrationTest/java/org/apache/geode/internal/jta/DataSourceJTAJUnitTest.java
+++ b/geode-core/src/integrationTest/java/org/apache/geode/internal/jta/DataSourceJTAJUnitTest.java
@@ -17,6 +17,7 @@ package org.apache.geode.internal.jta;
 import static org.apache.geode.distributed.ConfigurationProperties.CACHE_XML_FILE;
 import static org.apache.geode.distributed.ConfigurationProperties.LOCATORS;
 import static org.apache.geode.distributed.ConfigurationProperties.MCAST_PORT;
+import static org.apache.geode.test.util.ResourceUtils.createTempFileFromResource;
 
 import java.sql.Connection;
 import java.sql.SQLException;
@@ -36,7 +37,6 @@ import org.apache.geode.cache.Cache;
 import org.apache.geode.cache.Region;
 import org.apache.geode.distributed.DistributedSystem;
 import org.apache.geode.distributed.internal.InternalDistributedSystem;
-import org.apache.geode.util.test.TestUtil;
 
 /**
  * This test case is to test the following test scenarios: 1) Get Simple DS outside transaction,
@@ -87,7 +87,9 @@ public class DataSourceJTAJUnitTest {
     // call to init method
     try {
       Properties props = new Properties();
-      String path = TestUtil.getResourcePath(CacheUtils.class, "cachejta.xml");
+      String path =
+          createTempFileFromResource(CacheUtils.class, "cachejta.xml")
+              .getAbsolutePath();
       props.setProperty(CACHE_XML_FILE, path);
       ds = connect(props);
       tableName = CacheUtils.init(ds, "JTATest");
@@ -263,7 +265,9 @@ public class DataSourceJTAJUnitTest {
     // call to init method
     try {
       Properties props = new Properties();
-      String path = TestUtil.getResourcePath(CacheUtils.class, "cachejta.xml");
+      String path =
+          createTempFileFromResource(CacheUtils.class, "cachejta.xml")
+              .getAbsolutePath();
       props.setProperty(CACHE_XML_FILE, path);
       ds = connect(props);
       tableName = CacheUtils.init(ds, "JTATest");
@@ -551,7 +555,9 @@ public class DataSourceJTAJUnitTest {
     // call to init method
     try {
       Properties props = new Properties();
-      String path = TestUtil.getResourcePath(CacheUtils.class, "cachejta.xml");
+      String path =
+          createTempFileFromResource(CacheUtils.class, "cachejta.xml")
+              .getAbsolutePath();
       props.setProperty(CACHE_XML_FILE, path);
       ds = connect(props);
       tableName = CacheUtils.init(ds, "JTATest");
@@ -712,7 +718,9 @@ public class DataSourceJTAJUnitTest {
     // call to init method
     try {
       Properties props = new Properties();
-      String path = TestUtil.getResourcePath(CacheUtils.class, "cachejta.xml");
+      String path =
+          createTempFileFromResource(CacheUtils.class, "cachejta.xml")
+              .getAbsolutePath();
       props.setProperty(CACHE_XML_FILE, path);
       ds = connect(props);
       tableName = CacheUtils.init(ds, "JTATest");
diff --git a/geode-core/src/integrationTest/java/org/apache/geode/internal/jta/GlobalTransactionJUnitTest.java b/geode-core/src/integrationTest/java/org/apache/geode/internal/jta/GlobalTransactionJUnitTest.java
index 6d8e6bc..1eaeb14 100644
--- a/geode-core/src/integrationTest/java/org/apache/geode/internal/jta/GlobalTransactionJUnitTest.java
+++ b/geode-core/src/integrationTest/java/org/apache/geode/internal/jta/GlobalTransactionJUnitTest.java
@@ -16,6 +16,7 @@ package org.apache.geode.internal.jta;
 
 import static org.apache.geode.distributed.ConfigurationProperties.CACHE_XML_FILE;
 import static org.apache.geode.distributed.ConfigurationProperties.MCAST_PORT;
+import static org.apache.geode.test.util.ResourceUtils.createTempFileFromResource;
 import static org.junit.Assert.fail;
 
 import java.sql.Connection;
@@ -39,7 +40,6 @@ import org.apache.geode.cache.CacheFactory;
 import org.apache.geode.distributed.DistributedSystem;
 import org.apache.geode.internal.datasource.GemFireBasicDataSource;
 import org.apache.geode.internal.datasource.GemFireTransactionDataSource;
-import org.apache.geode.util.test.TestUtil;
 
 public class GlobalTransactionJUnitTest {
 
@@ -53,7 +53,9 @@ public class GlobalTransactionJUnitTest {
   public void setUp() throws Exception {
     props = new Properties();
     props.setProperty(MCAST_PORT, "0");
-    String path = TestUtil.getResourcePath(GlobalTransactionJUnitTest.class, "/jta/cachejta.xml");
+    String path =
+        createTempFileFromResource(GlobalTransactionJUnitTest.class, "/jta/cachejta.xml")
+            .getAbsolutePath();
     props.setProperty(CACHE_XML_FILE, path);
     ds1 = DistributedSystem.connect(props);
     cache = CacheFactory.create(ds1);
diff --git a/geode-core/src/integrationTest/java/org/apache/geode/internal/jta/TransactionTimeOutJUnitTest.java b/geode-core/src/integrationTest/java/org/apache/geode/internal/jta/TransactionTimeOutJUnitTest.java
index c02e804..579b024 100755
--- a/geode-core/src/integrationTest/java/org/apache/geode/internal/jta/TransactionTimeOutJUnitTest.java
+++ b/geode-core/src/integrationTest/java/org/apache/geode/internal/jta/TransactionTimeOutJUnitTest.java
@@ -16,6 +16,7 @@ package org.apache.geode.internal.jta;
 
 import static org.apache.geode.distributed.ConfigurationProperties.CACHE_XML_FILE;
 import static org.apache.geode.distributed.ConfigurationProperties.MCAST_PORT;
+import static org.apache.geode.test.util.ResourceUtils.createTempFileFromResource;
 import static org.junit.Assert.fail;
 
 import java.io.BufferedReader;
@@ -47,7 +48,6 @@ import org.apache.geode.cache.Cache;
 import org.apache.geode.cache.CacheFactory;
 import org.apache.geode.distributed.DistributedSystem;
 import org.apache.geode.internal.datasource.GemFireTransactionDataSource;
-import org.apache.geode.util.test.TestUtil;
 
 /**
  * TODO: this test has no assertions or validations of any sort
@@ -73,7 +73,8 @@ public class TransactionTimeOutJUnitTest {
 
     String path = tmpFile.getAbsolutePath();
     String file_as_str =
-        readFile(TestUtil.getResourcePath(TransactionTimeOutJUnitTest.class, "/jta/cachejta.xml"));
+        readFile(createTempFileFromResource(TransactionTimeOutJUnitTest.class, "/jta/cachejta.xml")
+            .getAbsolutePath());
     String modified_file_str = file_as_str.replaceAll("newDB", "newDB_" + pid);
 
     FileOutputStream fos = new FileOutputStream(path);
diff --git a/geode-core/src/integrationTest/java/org/apache/geode/internal/statistics/StatArchiveWriterReaderIntegrationTest.java b/geode-core/src/integrationTest/java/org/apache/geode/internal/statistics/StatArchiveWriterReaderIntegrationTest.java
index a320f2a..65028fb 100755
--- a/geode-core/src/integrationTest/java/org/apache/geode/internal/statistics/StatArchiveWriterReaderIntegrationTest.java
+++ b/geode-core/src/integrationTest/java/org/apache/geode/internal/statistics/StatArchiveWriterReaderIntegrationTest.java
@@ -17,6 +17,7 @@ package org.apache.geode.internal.statistics;
 import static org.apache.geode.internal.statistics.StatArchiveFormat.NANOS_PER_MILLI;
 import static org.apache.geode.internal.statistics.TestStatArchiveWriter.WRITER_INITIAL_DATE_MILLIS;
 import static org.apache.geode.internal.statistics.TestStatArchiveWriter.WRITER_PREVIOUS_TIMESTAMP_NANOS;
+import static org.apache.geode.test.util.ResourceUtils.createTempFileFromResource;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotNull;
@@ -54,7 +55,6 @@ import org.apache.geode.StatisticsType;
 import org.apache.geode.internal.NanoTimer;
 import org.apache.geode.internal.statistics.StatArchiveReader.StatValue;
 import org.apache.geode.test.junit.categories.StatisticsTest;
-import org.apache.geode.util.test.TestUtil;
 
 /**
  * Integration tests for {@link StatArchiveWriter} and {@link StatArchiveReader}.
@@ -989,8 +989,9 @@ public class StatArchiveWriterReaderIntegrationTest {
 
     // validate byte content of stat archive file against saved expected file
 
-    final File expected = new File(TestUtil.getResourcePath(getClass(),
-        "StatArchiveWriterReaderJUnitTest_" + this.testName.getMethodName() + "_expected.gfs"));
+    final File expected = new File(createTempFileFromResource(getClass(),
+        "StatArchiveWriterReaderJUnitTest_" + this.testName.getMethodName() + "_expected.gfs")
+            .getAbsolutePath());
     assertTrue(expected + " does not exist!", expected.exists());
     assertEquals(expected.length(), actual.length());
 
@@ -1394,8 +1395,9 @@ public class StatArchiveWriterReaderIntegrationTest {
 
     // validate byte content of stat archive file against saved expected file
 
-    final File expected = new File(TestUtil.getResourcePath(getClass(),
-        "StatArchiveWriterReaderJUnitTest_" + this.testName.getMethodName() + "_expected.gfs"));
+    final File expected = new File(createTempFileFromResource(getClass(),
+        "StatArchiveWriterReaderJUnitTest_" + this.testName.getMethodName() + "_expected.gfs")
+            .getAbsolutePath());
     assertTrue(expected + " does not exist!", expected.exists());
     assertEquals(expected.length(), actual.length());
 
diff --git a/geode-core/src/integrationTest/java/org/apache/geode/management/internal/cli/commands/HTTPServiceSSLSupportJUnitTest.java b/geode-core/src/integrationTest/java/org/apache/geode/management/internal/cli/commands/HTTPServiceSSLSupportJUnitTest.java
index e5587d8..e8cb1be 100644
--- a/geode-core/src/integrationTest/java/org/apache/geode/management/internal/cli/commands/HTTPServiceSSLSupportJUnitTest.java
+++ b/geode-core/src/integrationTest/java/org/apache/geode/management/internal/cli/commands/HTTPServiceSSLSupportJUnitTest.java
@@ -23,6 +23,7 @@ import static org.apache.geode.distributed.ConfigurationProperties.CLUSTER_SSL_R
 import static org.apache.geode.distributed.ConfigurationProperties.CLUSTER_SSL_TRUSTSTORE;
 import static org.apache.geode.distributed.ConfigurationProperties.CLUSTER_SSL_TRUSTSTORE_PASSWORD;
 import static org.apache.geode.distributed.ConfigurationProperties.MCAST_PORT;
+import static org.apache.geode.test.util.ResourceUtils.createTempFileFromResource;
 import static org.junit.Assert.assertEquals;
 
 import java.io.File;
@@ -35,7 +36,6 @@ import org.junit.Test;
 import org.apache.geode.distributed.internal.DistributionConfig;
 import org.apache.geode.distributed.internal.DistributionConfigImpl;
 import org.apache.geode.internal.net.SocketCreatorFactory;
-import org.apache.geode.util.test.TestUtil;
 
 /**
  * @since GemFire 8.1
@@ -62,7 +62,8 @@ public class HTTPServiceSSLSupportJUnitTest {
 
   private static File findTrustedJKS() {
     return new File(
-        TestUtil.getResourcePath(HTTPServiceSSLSupportJUnitTest.class, "/ssl/trusted.keystore"));
+        createTempFileFromResource(HTTPServiceSSLSupportJUnitTest.class,
+            "/ssl/trusted.keystore").getAbsolutePath());
   }
 
   public static String makePath(String[] strings) {
diff --git a/geode-core/src/integrationTest/java/org/apache/geode/management/internal/deployment/FunctionScannerTest.java b/geode-core/src/integrationTest/java/org/apache/geode/management/internal/deployment/FunctionScannerTest.java
index 8555e0d..e7be9ae 100644
--- a/geode-core/src/integrationTest/java/org/apache/geode/management/internal/deployment/FunctionScannerTest.java
+++ b/geode-core/src/integrationTest/java/org/apache/geode/management/internal/deployment/FunctionScannerTest.java
@@ -14,6 +14,7 @@
  */
 package org.apache.geode.management.internal.deployment;
 
+import static org.apache.geode.test.util.ResourceUtils.createTempFileFromResource;
 import static org.assertj.core.api.Assertions.assertThat;
 
 import java.io.File;
@@ -28,7 +29,6 @@ import org.junit.rules.TemporaryFolder;
 
 import org.apache.geode.test.compiler.JarBuilder;
 import org.apache.geode.test.junit.categories.GfshTest;
-import org.apache.geode.util.test.TestUtil;
 
 @Category({GfshTest.class})
 public class FunctionScannerTest {
@@ -111,7 +111,8 @@ public class FunctionScannerTest {
   }
 
   private File loadTestResource(String fileName) {
-    String filePath = TestUtil.getResourcePath(this.getClass(), fileName);
+    String filePath =
+        createTempFileFromResource(this.getClass(), fileName).getAbsolutePath();
     assertThat(filePath).isNotNull();
 
     return new File(filePath);
diff --git a/geode-core/src/test/java/org/apache/geode/cache/execute/FunctionAdapterJUnitTest.java b/geode-core/src/test/java/org/apache/geode/cache/execute/FunctionAdapterJUnitTest.java
index aa6e2bc..f792a6b 100644
--- a/geode-core/src/test/java/org/apache/geode/cache/execute/FunctionAdapterJUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/cache/execute/FunctionAdapterJUnitTest.java
@@ -15,6 +15,7 @@
 
 package org.apache.geode.cache.execute;
 
+import static org.apache.geode.test.util.ResourceUtils.createTempFileFromResource;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
@@ -28,7 +29,6 @@ import org.junit.Test;
 import org.apache.geode.internal.InternalDataSerializer;
 import org.apache.geode.internal.Version;
 import org.apache.geode.internal.VersionedDataInputStream;
-import org.apache.geode.util.test.TestUtil;
 
 public class FunctionAdapterJUnitTest {
 
@@ -72,8 +72,9 @@ public class FunctionAdapterJUnitTest {
   public void deserializePreGeodeFunctionAdapterShouldNotThrowIncompatibleException()
       throws Exception {
     FileInputStream fis =
-        new FileInputStream(TestUtil.getResourcePath(getClass(), getClass().getSimpleName() + "."
-            + "serializedFunctionAdapterWithDifferentSerialVersionUID.ser"));
+        new FileInputStream(
+            createTempFileFromResource(getClass(), getClass().getSimpleName() + "."
+                + "serializedFunctionAdapterWithDifferentSerialVersionUID.ser").getAbsolutePath());
 
     DataInputStream dis = new VersionedDataInputStream(new DataInputStream(fis), Version.GFE_82);
     Object o = InternalDataSerializer.basicReadObject(dis);
diff --git a/geode-core/src/test/java/org/apache/geode/internal/net/SocketCreatorFactoryJUnitTest.java b/geode-core/src/test/java/org/apache/geode/internal/net/SocketCreatorFactoryJUnitTest.java
index 6d2c807..07ff006 100644
--- a/geode-core/src/test/java/org/apache/geode/internal/net/SocketCreatorFactoryJUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/net/SocketCreatorFactoryJUnitTest.java
@@ -71,6 +71,7 @@ import static org.apache.geode.distributed.ConfigurationProperties.SSL_PROTOCOLS
 import static org.apache.geode.distributed.ConfigurationProperties.SSL_REQUIRE_AUTHENTICATION;
 import static org.apache.geode.distributed.ConfigurationProperties.SSL_TRUSTSTORE;
 import static org.apache.geode.distributed.ConfigurationProperties.SSL_TRUSTSTORE_PASSWORD;
+import static org.apache.geode.test.util.ResourceUtils.createTempFileFromResource;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
 
@@ -85,7 +86,6 @@ import org.junit.experimental.categories.Category;
 import org.apache.geode.distributed.internal.DistributionConfigImpl;
 import org.apache.geode.internal.security.SecurableCommunicationChannel;
 import org.apache.geode.test.junit.categories.MembershipTest;
-import org.apache.geode.util.test.TestUtil;
 
 @Category({MembershipTest.class})
 public class SocketCreatorFactoryJUnitTest {
@@ -300,9 +300,11 @@ public class SocketCreatorFactoryJUnitTest {
     Properties properties = configureSSLProperties(SecurableCommunicationChannel.ALL.getConstant());
 
     properties.setProperty(SSL_KEYSTORE,
-        TestUtil.getResourcePath(getClass(), "/org/apache/geode/internal/net/multiKey.jks"));
+        createTempFileFromResource(getClass(), "/org/apache/geode/internal/net/multiKey.jks")
+            .getAbsolutePath());
     properties.setProperty(SSL_TRUSTSTORE,
-        TestUtil.getResourcePath(getClass(), "/org/apache/geode/internal/net/multiKeyTrust.jks"));
+        createTempFileFromResource(getClass(),
+            "/org/apache/geode/internal/net/multiKeyTrust.jks").getAbsolutePath());
 
     properties.setProperty(SSL_CLUSTER_ALIAS, "clusterKey");
     properties.setProperty(SSL_DEFAULT_ALIAS, "serverKey");
@@ -329,9 +331,11 @@ public class SocketCreatorFactoryJUnitTest {
     Properties properties = configureSSLProperties(SecurableCommunicationChannel.ALL.getConstant());
 
     properties.setProperty(SSL_KEYSTORE,
-        TestUtil.getResourcePath(getClass(), "/org/apache/geode/internal/net/multiKey.jks"));
+        createTempFileFromResource(getClass(), "/org/apache/geode/internal/net/multiKey.jks")
+            .getAbsolutePath());
     properties.setProperty(SSL_TRUSTSTORE,
-        TestUtil.getResourcePath(getClass(), "/org/apache/geode/internal/net/multiKeyTrust.jks"));
+        createTempFileFromResource(getClass(),
+            "/org/apache/geode/internal/net/multiKeyTrust.jks").getAbsolutePath());
 
     DistributionConfigImpl distributionConfig = new DistributionConfigImpl(properties);
     SocketCreatorFactory.setDistributionConfig(distributionConfig);
@@ -549,6 +553,8 @@ public class SocketCreatorFactoryJUnitTest {
   }
 
   private File findTestJKS() {
-    return new File(TestUtil.getResourcePath(getClass(), "/ssl/trusted.keystore"));
+    return new File(
+        createTempFileFromResource(getClass(), "/ssl/trusted.keystore")
+            .getAbsolutePath());
   }
 }
diff --git a/geode-core/src/test/java/org/apache/geode/internal/net/SocketCreatorJUnitTest.java b/geode-core/src/test/java/org/apache/geode/internal/net/SocketCreatorJUnitTest.java
index 4769789..2e4421f 100644
--- a/geode-core/src/test/java/org/apache/geode/internal/net/SocketCreatorJUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/net/SocketCreatorJUnitTest.java
@@ -14,6 +14,7 @@
  */
 package org.apache.geode.internal.net;
 
+import static org.apache.geode.test.util.ResourceUtils.createTempFileFromResource;
 import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.never;
@@ -31,7 +32,6 @@ import org.junit.experimental.categories.Category;
 
 import org.apache.geode.internal.admin.SSLConfig;
 import org.apache.geode.test.junit.categories.MembershipTest;
-import org.apache.geode.util.test.TestUtil;
 
 @Category({MembershipTest.class})
 public class SocketCreatorJUnitTest {
@@ -99,6 +99,6 @@ public class SocketCreatorJUnitTest {
   }
 
   private String getSingleKeyKeystore() {
-    return TestUtil.getResourcePath(getClass(), "/ssl/trusted.keystore");
+    return createTempFileFromResource(getClass(), "/ssl/trusted.keystore").getAbsolutePath();
   }
 }
diff --git a/geode-core/src/test/java/org/apache/geode/internal/util/PluckStacksUnitTest.java b/geode-core/src/test/java/org/apache/geode/internal/util/PluckStacksUnitTest.java
index 6d07b88..4a481f7 100644
--- a/geode-core/src/test/java/org/apache/geode/internal/util/PluckStacksUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/util/PluckStacksUnitTest.java
@@ -14,6 +14,7 @@
  */
 package org.apache.geode.internal.util;
 
+import static org.apache.geode.test.util.ResourceUtils.createTempFileFromResource;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotEquals;
 
@@ -24,15 +25,14 @@ import java.util.Map;
 
 import org.junit.Test;
 
-import org.apache.geode.util.test.TestUtil;
-
 public class PluckStacksUnitTest {
 
 
   @Test
   public void testPluckingStacksFromJVMGeneratedDump() throws Exception {
     LineNumberReader reader = new LineNumberReader(
-        new FileReader(TestUtil.getResourcePath(getClass(), "PluckStacksJstackGeneratedDump.txt")));
+        new FileReader(createTempFileFromResource(getClass(), "PluckStacksJstackGeneratedDump.txt")
+            .getAbsolutePath()));
 
     Map<String, List<PluckStacks.ThreadStack>> dumps =
         new PluckStacks().getThreadDumps(reader, "PluckStacksSystemGeneratedDump.txt");
diff --git a/geode-dunit/src/main/java/org/apache/geode/security/generator/LdapUserCredentialGenerator.java b/geode-dunit/src/main/java/org/apache/geode/security/generator/LdapUserCredentialGenerator.java
index b339ae9..fa39a92 100755
--- a/geode-dunit/src/main/java/org/apache/geode/security/generator/LdapUserCredentialGenerator.java
+++ b/geode-dunit/src/main/java/org/apache/geode/security/generator/LdapUserCredentialGenerator.java
@@ -15,6 +15,7 @@
 package org.apache.geode.security.generator;
 
 import static org.apache.geode.distributed.ConfigurationProperties.SECURITY_CLIENT_DHALGO;
+import static org.apache.geode.test.util.ResourceUtils.createTempFileFromResource;
 
 import java.security.Principal;
 import java.util.Properties;
@@ -28,7 +29,6 @@ import org.apache.geode.internal.logging.LogService;
 import org.apache.geode.security.templates.LdapUserAuthenticator;
 import org.apache.geode.security.templates.UserPasswordAuthInit;
 import org.apache.geode.test.dunit.Assert;
-import org.apache.geode.util.test.TestUtil;
 
 public class LdapUserCredentialGenerator extends CredentialGenerator {
 
@@ -66,8 +66,9 @@ public class LdapUserCredentialGenerator extends CredentialGenerator {
     }
 
     if (serverAuthEnabled) {
-      String keyStoreFile = TestUtil.getResourcePath(LdapUserCredentialGenerator.class,
-          PKCSCredentialGenerator.keyStoreDir + "/gemfire1.keystore");
+      String keyStoreFile =
+          createTempFileFromResource(LdapUserCredentialGenerator.class,
+              PKCSCredentialGenerator.keyStoreDir + "/gemfire1.keystore").getAbsolutePath();
       extraProps.setProperty(Handshake.PRIVATE_KEY_FILE_PROP, keyStoreFile);
       extraProps.setProperty(Handshake.PRIVATE_KEY_ALIAS_PROP, DistributionConfig.GEMFIRE_PREFIX);
       extraProps.setProperty(Handshake.PRIVATE_KEY_PASSWD_PROP, "gemfire");
@@ -103,8 +104,9 @@ public class LdapUserCredentialGenerator extends CredentialGenerator {
     props.setProperty(SECURITY_CLIENT_DHALGO, CIPHERS[RANDOM.nextInt(CIPHERS.length)]);
 
     if (serverAuthEnabled) {
-      final String keyStoreFile = TestUtil.getResourcePath(PKCSCredentialGenerator.class,
-          PKCSCredentialGenerator.keyStoreDir + "/publickeyfile");
+      final String keyStoreFile =
+          createTempFileFromResource(PKCSCredentialGenerator.class,
+              PKCSCredentialGenerator.keyStoreDir + "/publickeyfile").getAbsolutePath();
       props.setProperty(Handshake.PUBLIC_KEY_FILE_PROP, keyStoreFile);
       props.setProperty(Handshake.PUBLIC_KEY_PASSWD_PROP, "gemfire");
     }
@@ -141,8 +143,9 @@ public class LdapUserCredentialGenerator extends CredentialGenerator {
     props.setProperty(SECURITY_CLIENT_DHALGO, CIPHERS[RANDOM.nextInt(CIPHERS.length)]);
 
     if (serverAuthEnabled) {
-      final String keyStoreFile = TestUtil.getResourcePath(PKCSCredentialGenerator.class,
-          PKCSCredentialGenerator.keyStoreDir + "/publickeyfile");
+      final String keyStoreFile =
+          createTempFileFromResource(PKCSCredentialGenerator.class,
+              PKCSCredentialGenerator.keyStoreDir + "/publickeyfile").getAbsolutePath();
       props.setProperty(Handshake.PUBLIC_KEY_FILE_PROP, keyStoreFile);
       props.setProperty(Handshake.PUBLIC_KEY_PASSWD_PROP, "gemfire");
     }
@@ -158,8 +161,9 @@ public class LdapUserCredentialGenerator extends CredentialGenerator {
     props.setProperty(SECURITY_CLIENT_DHALGO, CIPHERS[RANDOM.nextInt(CIPHERS.length)]);
 
     if (serverAuthEnabled) {
-      final String keyStoreFile = TestUtil.getResourcePath(PKCSCredentialGenerator.class,
-          PKCSCredentialGenerator.keyStoreDir + "/publickeyfile");
+      final String keyStoreFile =
+          createTempFileFromResource(PKCSCredentialGenerator.class,
+              PKCSCredentialGenerator.keyStoreDir + "/publickeyfile").getAbsolutePath();
       props.setProperty(Handshake.PUBLIC_KEY_FILE_PROP, keyStoreFile);
       props.setProperty(Handshake.PUBLIC_KEY_PASSWD_PROP, "gemfire");
     }
diff --git a/geode-dunit/src/main/java/org/apache/geode/security/generator/PKCSCredentialGenerator.java b/geode-dunit/src/main/java/org/apache/geode/security/generator/PKCSCredentialGenerator.java
index f98f34e..3def27f 100755
--- a/geode-dunit/src/main/java/org/apache/geode/security/generator/PKCSCredentialGenerator.java
+++ b/geode-dunit/src/main/java/org/apache/geode/security/generator/PKCSCredentialGenerator.java
@@ -14,6 +14,8 @@
  */
 package org.apache.geode.security.generator;
 
+import static org.apache.geode.test.util.ResourceUtils.createTempFileFromResource;
+
 import java.security.Principal;
 import java.security.Provider;
 import java.security.Security;
@@ -21,7 +23,6 @@ import java.util.Properties;
 
 import org.apache.geode.security.templates.PKCSAuthInit;
 import org.apache.geode.security.templates.PKCSAuthenticator;
-import org.apache.geode.util.test.TestUtil;
 
 public class PKCSCredentialGenerator extends CredentialGenerator {
 
@@ -51,7 +52,8 @@ public class PKCSCredentialGenerator extends CredentialGenerator {
   @Override
   protected Properties initialize() throws IllegalArgumentException {
     final String keyStoreFile =
-        TestUtil.getResourcePath(PKCSCredentialGenerator.class, keyStoreDir + "/publickeyfile");
+        createTempFileFromResource(PKCSCredentialGenerator.class,
+            keyStoreDir + "/publickeyfile").getAbsolutePath();
 
     final Properties props = new Properties();
     props.setProperty(PKCSAuthenticator.PUBLIC_KEY_FILE, keyStoreFile);
@@ -77,8 +79,9 @@ public class PKCSCredentialGenerator extends CredentialGenerator {
 
   @Override
   public Properties getInvalidCredentials(int index) {
-    final String keyStoreFile = TestUtil.getResourcePath(PKCSCredentialGenerator.class,
-        keyStoreDir + "/gemfire11.keystore");
+    final String keyStoreFile =
+        createTempFileFromResource(PKCSCredentialGenerator.class,
+            keyStoreDir + "/gemfire11.keystore").getAbsolutePath();
 
     final Properties props = new Properties();
     props.setProperty(PKCSAuthInit.KEYSTORE_FILE_PATH, keyStoreFile);
@@ -91,8 +94,9 @@ public class PKCSCredentialGenerator extends CredentialGenerator {
   @Override
   public Properties getValidCredentials(int index) {
     final int aliasnum = (index % 10) + 1;
-    final String keyStoreFile = TestUtil.getResourcePath(PKCSCredentialGenerator.class,
-        keyStoreDir + "/gemfire" + aliasnum + ".keystore");
+    final String keyStoreFile =
+        createTempFileFromResource(PKCSCredentialGenerator.class,
+            keyStoreDir + "/gemfire" + aliasnum + ".keystore").getAbsolutePath();
 
     final Properties props = new Properties();
     props.setProperty(PKCSAuthInit.KEYSTORE_FILE_PATH, keyStoreFile);
@@ -104,8 +108,9 @@ public class PKCSCredentialGenerator extends CredentialGenerator {
 
   @Override
   public Properties getValidCredentials(Principal principal) {
-    final String keyStoreFile = TestUtil.getResourcePath(PKCSCredentialGenerator.class,
-        keyStoreDir + principal.getName() + ".keystore");
+    final String keyStoreFile =
+        createTempFileFromResource(PKCSCredentialGenerator.class,
+            keyStoreDir + principal.getName() + ".keystore").getAbsolutePath();
 
     final Properties props = new Properties();
     props.setProperty(PKCSAuthInit.KEYSTORE_FILE_PATH, keyStoreFile);
diff --git a/geode-dunit/src/main/java/org/apache/geode/security/generator/XmlAuthzCredentialGenerator.java b/geode-dunit/src/main/java/org/apache/geode/security/generator/XmlAuthzCredentialGenerator.java
index d80e5e0..a6f2141 100755
--- a/geode-dunit/src/main/java/org/apache/geode/security/generator/XmlAuthzCredentialGenerator.java
+++ b/geode-dunit/src/main/java/org/apache/geode/security/generator/XmlAuthzCredentialGenerator.java
@@ -14,6 +14,8 @@
  */
 package org.apache.geode.security.generator;
 
+import static org.apache.geode.test.util.ResourceUtils.createTempFileFromResource;
+
 import java.security.Principal;
 import java.util.HashSet;
 import java.util.Properties;
@@ -22,7 +24,6 @@ import java.util.Set;
 import org.apache.geode.cache.operations.OperationContext.OperationCode;
 import org.apache.geode.security.templates.UsernamePrincipal;
 import org.apache.geode.security.templates.XmlAuthorization;
-import org.apache.geode.util.test.TestUtil;
 
 public class XmlAuthzCredentialGenerator extends AuthzCredentialGenerator {
 
@@ -82,12 +83,14 @@ public class XmlAuthzCredentialGenerator extends AuthzCredentialGenerator {
 
     if (this.generator.classCode().isDummy()) {
       final String xmlFilename =
-          TestUtil.getResourcePath(XmlAuthzCredentialGenerator.class, dirName + dummyXml);
+          createTempFileFromResource(XmlAuthzCredentialGenerator.class, dirName + dummyXml)
+              .getAbsolutePath();
       sysProps.setProperty(XmlAuthorization.DOC_URI_PROP_NAME, xmlFilename);
 
     } else if (this.generator.classCode().isLDAP()) {
       final String xmlFilename =
-          TestUtil.getResourcePath(XmlAuthzCredentialGenerator.class, dirName + ldapXml);
+          createTempFileFromResource(XmlAuthzCredentialGenerator.class, dirName + ldapXml)
+              .getAbsolutePath();
       sysProps.setProperty(XmlAuthorization.DOC_URI_PROP_NAME, xmlFilename);
 
       // } else if (this.generator.classCode().isPKCS()) {
diff --git a/geode-experimental-driver/src/integrationTest/java/org/apache/geode/experimental/driver/SSLTest.java b/geode-experimental-driver/src/integrationTest/java/org/apache/geode/experimental/driver/SSLTest.java
index 20a3ba3..f094eb4 100644
--- a/geode-experimental-driver/src/integrationTest/java/org/apache/geode/experimental/driver/SSLTest.java
+++ b/geode-experimental-driver/src/integrationTest/java/org/apache/geode/experimental/driver/SSLTest.java
@@ -24,6 +24,7 @@ import static org.apache.geode.distributed.ConfigurationProperties.SSL_REQUIRE_A
 import static org.apache.geode.distributed.ConfigurationProperties.SSL_TRUSTSTORE;
 import static org.apache.geode.distributed.ConfigurationProperties.SSL_TRUSTSTORE_PASSWORD;
 import static org.apache.geode.internal.Assert.assertTrue;
+import static org.apache.geode.test.util.ResourceUtils.createTempFileFromResource;
 import static org.hamcrest.Matchers.anyOf;
 import static org.hamcrest.Matchers.instanceOf;
 import static org.junit.Assert.assertEquals;
@@ -52,7 +53,6 @@ import org.apache.geode.distributed.ConfigurationProperties;
 import org.apache.geode.distributed.Locator;
 import org.apache.geode.internal.net.SocketCreatorFactory;
 import org.apache.geode.test.junit.categories.ClientServerTest;
-import org.apache.geode.util.test.TestUtil;
 
 @Category({ClientServerTest.class})
 public class SSLTest {
@@ -63,19 +63,24 @@ public class SSLTest {
   public ExpectedException expectedException = ExpectedException.none();
 
   private final String DEFAULT_KEY_STORE =
-      TestUtil.getResourcePath(SSLTest.class, "default.keystore");
+      createTempFileFromResource(SSLTest.class, "default.keystore").getAbsolutePath();
   private final String SERVER_KEY_STORE =
-      TestUtil.getResourcePath(SSLTest.class, "cacheserver.keystore");
+      createTempFileFromResource(SSLTest.class, "cacheserver.keystore")
+          .getAbsolutePath();
   private final String SERVER_TRUST_STORE =
-      TestUtil.getResourcePath(SSLTest.class, "cacheserver.truststore");
+      createTempFileFromResource(SSLTest.class, "cacheserver.truststore")
+          .getAbsolutePath();
   private final String BOGUSSERVER_KEY_STORE =
-      TestUtil.getResourcePath(SSLTest.class, "bogusserver.keystore");
+      createTempFileFromResource(SSLTest.class, "bogusserver.keystore")
+          .getAbsolutePath();
   private final String BOGUSCLIENT_KEY_STORE =
-      TestUtil.getResourcePath(SSLTest.class, "bogusclient.keystore");
+      createTempFileFromResource(SSLTest.class, "bogusclient.keystore")
+          .getAbsolutePath();
   private final String CLIENT_KEY_STORE =
-      TestUtil.getResourcePath(SSLTest.class, "client.keystore");
+      createTempFileFromResource(SSLTest.class, "client.keystore").getAbsolutePath();
   private final String CLIENT_TRUST_STORE =
-      TestUtil.getResourcePath(SSLTest.class, "client.truststore");
+      createTempFileFromResource(SSLTest.class, "client.truststore")
+          .getAbsolutePath();
   private Locator locator;
   private Cache cache;
   private Driver driver;
diff --git a/geode-junit/src/main/java/org/apache/geode/internal/jta/CacheUtils.java b/geode-junit/src/main/java/org/apache/geode/internal/jta/CacheUtils.java
index 1dbec0d..530ca78 100644
--- a/geode-junit/src/main/java/org/apache/geode/internal/jta/CacheUtils.java
+++ b/geode-junit/src/main/java/org/apache/geode/internal/jta/CacheUtils.java
@@ -22,6 +22,7 @@ package org.apache.geode.internal.jta;
 
 import static org.apache.geode.distributed.ConfigurationProperties.CACHE_XML_FILE;
 import static org.apache.geode.distributed.ConfigurationProperties.MCAST_PORT;
+import static org.apache.geode.test.util.ResourceUtils.createTempFileFromResource;
 
 import java.sql.Connection;
 import java.sql.ResultSet;
@@ -39,7 +40,6 @@ import org.apache.geode.cache.Cache;
 import org.apache.geode.cache.CacheFactory;
 import org.apache.geode.cache.query.QueryService;
 import org.apache.geode.distributed.DistributedSystem;
-import org.apache.geode.util.test.TestUtil;
 
 public class CacheUtils {
   public static DistributedSystem ds;
@@ -57,7 +57,9 @@ public class CacheUtils {
 
   public static String init(String className) throws Exception {
     Properties props = new Properties();
-    props.setProperty(CACHE_XML_FILE, TestUtil.getResourcePath(CacheUtils.class, "cachejta.xml"));
+    props.setProperty(CACHE_XML_FILE,
+        createTempFileFromResource(CacheUtils.class, "cachejta.xml")
+            .getAbsolutePath());
     String tableName = "";
     props.setProperty(MCAST_PORT, "0");
 
diff --git a/geode-junit/src/main/java/org/apache/geode/test/util/ResourceUtils.java b/geode-junit/src/main/java/org/apache/geode/test/util/ResourceUtils.java
index 9631531..cdd6f9d 100644
--- a/geode-junit/src/main/java/org/apache/geode/test/util/ResourceUtils.java
+++ b/geode-junit/src/main/java/org/apache/geode/test/util/ResourceUtils.java
@@ -21,7 +21,7 @@ import static org.assertj.core.api.Assertions.assertThat;
 import java.io.File;
 import java.io.FileOutputStream;
 import java.io.IOException;
-import java.net.URISyntaxException;
+import java.io.UncheckedIOException;
 import java.net.URL;
 
 import com.google.common.io.Resources;
@@ -35,13 +35,20 @@ import org.apache.commons.io.IOUtils;
  * <p>
  * See also {@link Resources#getResource(String)} and {@link Resources#getResource(Class, String)}.
  */
+@SuppressWarnings("unused")
 public class ResourceUtils {
 
   /**
    * Returns the class identified by {@code depth} element of the call stack.
+   *
+   * @throws ClassNotFoundException wrapped in RuntimeException if the class cannot be located
    */
-  public static Class<?> getCallerClass(final int depth) throws ClassNotFoundException {
-    return Class.forName(getCallerClassName(depth + 1));
+  public static Class<?> getCallerClass(final int depth) {
+    try {
+      return Class.forName(getCallerClassName(depth + 1));
+    } catch (ClassNotFoundException e) {
+      throw new RuntimeException(e);
+    }
   }
 
   /**
@@ -55,35 +62,177 @@ public class ResourceUtils {
    * Finds {@code resourceName} using the {@code ClassLoader} of the caller class.
    *
    * @return the URL of the resource
+   *
+   * @throws AssertionError if the resource cannot be located
+   *
+   * @throws ClassNotFoundException wrapped in RuntimeException if the class cannot be located
    */
-  public static URL getResource(final String resourceName) throws ClassNotFoundException {
-    URL configResource = getCallerClass(2).getResource(resourceName);
-    assertThat(configResource).as(resourceName).isNotNull();
-    return configResource;
+  public static URL getResource(final String resourceName) {
+    URL resource = getCallerClass(2).getResource(resourceName);
+    assertThat(resource).as(resourceName).isNotNull();
+    return resource;
   }
 
   /**
    * Finds {@code resourceName} using the {@code ClassLoader} of {@code classInSamePackage}.
    *
    * @return the URL of the resource
+   *
+   * @throws AssertionError if the resource cannot be located
    */
   public static URL getResource(final Class<?> classInSamePackage, final String resourceName) {
-    URL configResource = classInSamePackage.getResource(resourceName);
-    assertThat(configResource).as(resourceName).isNotNull();
-    return configResource;
+    URL resource = classInSamePackage.getResource(resourceName);
+    assertThat(resource).as(resourceName).isNotNull();
+    return resource;
+  }
+
+  /**
+   * Finds {@code resourceName} using the specified {@code ClassLoader}.
+   *
+   * @return the URL of the resource
+   *
+   * @throws AssertionError if the resource cannot be located
+   */
+  public static URL getResource(final ClassLoader classLoader, final String resourceName) {
+    URL resource = classLoader.getResource(resourceName);
+    assertThat(resource).as(resourceName).isNotNull();
+    return resource;
   }
 
   /**
    * Copies a {@code resource} to a {@code file} in {@code targetFolder}.
    *
    * @return the newly created file
+   *
+   * @throws AssertionError if the resource cannot be located
+   *
+   * @throws UncheckedIOException if an I/O exception occurs or the file exists but is a directory
+   *         rather than a regular file, does not exist but cannot be created, or cannot be opened
+   *         for any other reason
    */
   public static File createFileFromResource(final URL resource, final File targetFolder,
-      final String fileName) throws IOException, URISyntaxException {
-    File targetFile = new File(targetFolder, fileName);
-    IOUtils.copy(resource.openStream(), new FileOutputStream(targetFile));
-    assertThat(targetFile).hasSameContentAs(new File(resource.toURI()));
-    return targetFile;
+      final String fileName) {
+    try {
+      File targetFile = new File(targetFolder, fileName);
+      IOUtils.copy(resource.openStream(), new FileOutputStream(targetFile));
+      return targetFile;
+    } catch (IOException e) {
+      throw new UncheckedIOException(e);
+    }
+  }
+
+  /**
+   * Copies a {@code resourceName} using the specified {@code ClassLoader} to a {@code file} in
+   * {@code targetFolder}.
+   *
+   * @return the newly created file
+   *
+   * @throws AssertionError if the resource cannot be located
+   *
+   * @throws UncheckedIOException if an I/O exception occurs or the file exists but is a directory
+   *         rather than a regular file, does not exist but cannot be created, or cannot be opened
+   *         for any other reason
+   */
+  public static File createFileFromResource(final ClassLoader classLoader,
+      final String resourceName, final File targetFolder, final String fileName) {
+    URL resource = getResource(classLoader, resourceName);
+    return createFileFromResource(resource, targetFolder, fileName);
+  }
+
+  /**
+   * Copies a {@code resource} to a {@code file} in {@code targetFolder}.
+   *
+   * @return the newly created file
+   *
+   * @throws AssertionError if the resource cannot be located
+   *
+   * @throws UncheckedIOException if an I/O exception occurs or the file exists but is a directory
+   *         rather than a regular file, does not exist but cannot be created, or cannot be opened
+   *         for any other reason
+   */
+  public static File createTempFileFromResource(final URL resource, final String fileName) {
+    try {
+      File targetFile = File.createTempFile(fileName, null);
+      targetFile.deleteOnExit();
+      IOUtils.copy(resource.openStream(), new FileOutputStream(targetFile));
+      return targetFile;
+    } catch (IOException e) {
+      throw new UncheckedIOException(e);
+    }
+  }
+
+  /**
+   * Copies a {@code resourceName} using the {@code ClassLoader} of {@code classInSamePackage} to a
+   * {@code file} in the temporary-file directory.
+   *
+   * @return the newly created file
+   *
+   * @throws AssertionError if the resource cannot be located
+   *
+   * @throws UncheckedIOException if an I/O exception occurs or the file exists but is a directory
+   *         rather than a regular file, does not exist but cannot be created, or cannot be opened
+   *         for any other reason
+   */
+  public static File createTempFileFromResource(final Class<?> classInSamePackage,
+      final String resourceName, final String fileName) {
+    URL resource = getResource(classInSamePackage, resourceName);
+    return createTempFileFromResource(resource, fileName);
+  }
+
+  /**
+   * Copies a {@code resourceName} using the specified {@code ClassLoader} to a {@code file} in
+   * the temporary-file directory.
+   *
+   * @return the newly created file
+   *
+   * @throws AssertionError if the resource cannot be located
+   *
+   * @throws UncheckedIOException if an I/O exception occurs or the file exists but is a directory
+   *         rather than a regular file, does not exist but cannot be created, or cannot be opened
+   *         for any other reason
+   */
+  public static File createTempFileFromResource(final ClassLoader classLoader,
+      final String resourceName, final String fileName) {
+    URL resource = getResource(classLoader, resourceName);
+    return createTempFileFromResource(resource, fileName);
+  }
+
+  /**
+   * Copies a {@code resourceName} using the {@code ClassLoader} of {@code classInSamePackage} to a
+   * {@code file} in the temporary-file directory.
+   *
+   * @return the newly created file
+   *
+   * @throws AssertionError if the resource cannot be located
+   *
+   * @throws UncheckedIOException if an I/O exception occurs or the file exists but is a directory
+   *         rather than a regular file, does not exist but cannot be created, or cannot be opened
+   *         for any other reason
+   */
+  public static File createTempFileFromResource(final Class<?> classInSamePackage,
+      final String resourceName) {
+    String fileName = resourceName.replaceFirst(".*/", "");
+    URL resource = getResource(classInSamePackage, resourceName);
+    return createTempFileFromResource(resource, fileName);
+  }
+
+  /**
+   * Copies a {@code resourceName} using the specified {@code ClassLoader} to a {@code file} in
+   * the temporary-file directory.
+   *
+   * @return the newly created file
+   *
+   * @throws AssertionError if the resource cannot be located
+   *
+   * @throws UncheckedIOException if an I/O exception occurs or the file exists but is a directory
+   *         rather than a regular file, does not exist but cannot be created, or cannot be opened
+   *         for any other reason
+   */
+  public static File createTempFileFromResource(final ClassLoader classLoader,
+      final String resourceName) {
+    String fileName = resourceName.replaceFirst(".*/", "");
+    URL resource = getResource(classLoader, resourceName);
+    return createTempFileFromResource(resource, fileName);
   }
 
   /**
@@ -92,11 +241,20 @@ public class ResourceUtils {
    * @param resource a file-based resource referencing a directory
    * @param targetFolder the directory to which to copy the resource and all files within that
    *        resource.
+   *
+   * @throws AssertionError if the resulting file does not exist
+   *
+   * @throws UncheckedIOException if an I/O exception occurs or the file exists but is a directory
+   *         rather than a regular file, does not exist but cannot be created, or cannot be opened
+   *         for any other reason
    */
-  public static void copyDirectoryResource(final URL resource, final File targetFolder)
-      throws IOException {
-    File source = new File(resource.getPath());
-    assertThat(source.exists()).as("Source does not exist: " + resource.getPath());
-    FileUtils.copyDirectory(source, targetFolder);
+  public static void copyDirectoryResource(final URL resource, final File targetFolder) {
+    try {
+      File source = new File(resource.getPath());
+      assertThat(source.exists()).as("Source does not exist: " + resource.getPath());
+      FileUtils.copyDirectory(source, targetFolder);
+    } catch (IOException e) {
+      throw new UncheckedIOException(e);
+    }
   }
 }
diff --git a/geode-junit/src/main/java/org/apache/geode/util/test/TestUtil.java b/geode-junit/src/main/java/org/apache/geode/util/test/TestUtil.java
deleted file mode 100644
index 4192867..0000000
--- a/geode-junit/src/main/java/org/apache/geode/util/test/TestUtil.java
+++ /dev/null
@@ -1,81 +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.geode.util.test;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.URISyntaxException;
-import java.net.URL;
-import java.nio.file.FileSystemNotFoundException;
-import java.nio.file.Paths;
-
-import org.apache.commons.io.FileUtils;
-
-public class TestUtil {
-
-  /**
-   * Return the path to a named resource. This finds the resource on the classpath using the rules
-   * of class.getResource. For a relative path it will look in the same package as the class, for an
-   * absolute path it will start from the base package.
-   *
-   * Best practice is to put the resource in the same package as your test class and load it with
-   * this method.
-   *
-   * @param clazz the class to look relative too
-   * @param name the name of the resource, eg "cache.xml"
-   */
-  public static String getResourcePath(Class<?> clazz, String name) {
-    URL resource = clazz.getResource(name);
-    return getResourcePath(name, resource);
-  }
-
-  /**
-   * Return the path to a named resource. This finds the resource on the classpath using the rules
-   * of ClassLoader.getResource.
-   *
-   * @param classLoader the ClassLoader to look up resource in
-   * @param name the name of the resource, eg "cache.xml"
-   */
-  public static String getResourcePath(ClassLoader classLoader, String name) {
-    URL resource = classLoader.getResource(name);
-    return getResourcePath(name, resource);
-  }
-
-  private static String getResourcePath(String name, URL resource) {
-    if (resource == null) {
-      throw new RuntimeException("Could not find resource " + name);
-    }
-    try {
-      return Paths.get(resource.toURI()).toAbsolutePath().toString();
-    } catch (FileSystemNotFoundException e) {
-      // create a temporary copy when Paths.get() fails (eg: jar:file:/...)
-      return createTemporaryCopy(name, resource);
-    } catch (URISyntaxException e) {
-      throw new RuntimeException("Failed getting path to resource " + name, e);
-    }
-  }
-
-  private static String createTemporaryCopy(String name, URL resource) {
-    try {
-      String filename = name.replaceFirst(".*/", "");
-      File tmpFile = File.createTempFile(filename, null);
-      tmpFile.deleteOnExit();
-      FileUtils.copyURLToFile(resource, tmpFile);
-      return tmpFile.getAbsolutePath();
-    } catch (IOException e1) {
-      throw new RuntimeException("Failed getting path to resource " + name, e1);
-    }
-  }
-}
diff --git a/geode-junit/src/test/java/org/apache/geode/test/util/ResourceUtilsIntegrationTest.java b/geode-junit/src/test/java/org/apache/geode/test/util/ResourceUtilsIntegrationTest.java
index 9c00e7d..9185e3c 100644
--- a/geode-junit/src/test/java/org/apache/geode/test/util/ResourceUtilsIntegrationTest.java
+++ b/geode-junit/src/test/java/org/apache/geode/test/util/ResourceUtilsIntegrationTest.java
@@ -16,6 +16,7 @@
  */
 package org.apache.geode.test.util;
 
+import static org.apache.geode.test.util.ResourceUtils.getResource;
 import static org.assertj.core.api.Assertions.assertThat;
 
 import java.io.File;
@@ -41,9 +42,9 @@ public class ResourceUtilsIntegrationTest {
   public TemporaryFolder temporaryFolder = new TemporaryFolder();
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     resourceName = ResourceUtilsTest.class.getSimpleName() + RESOURCE_SUFFIX;
-    resource = ResourceUtils.getResource(ResourceUtilsTest.class, resourceName);
+    resource = getResource(ResourceUtilsTest.class, resourceName);
   }
 
   @Test
diff --git a/geode-junit/src/test/java/org/apache/geode/test/util/ResourceUtilsTest.java b/geode-junit/src/test/java/org/apache/geode/test/util/ResourceUtilsTest.java
index 24c3c7a..0a8a042 100644
--- a/geode-junit/src/test/java/org/apache/geode/test/util/ResourceUtilsTest.java
+++ b/geode-junit/src/test/java/org/apache/geode/test/util/ResourceUtilsTest.java
@@ -34,7 +34,7 @@ public class ResourceUtilsTest {
   private String resourceName;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     className = getClass().getName();
     resourceName = getClass().getSimpleName() + RESOURCE_SUFFIX;
   }
@@ -45,7 +45,7 @@ public class ResourceUtilsTest {
   }
 
   @Test
-  public void getCallerClass() throws Exception {
+  public void getCallerClass() {
     assertThat(ResourceUtils.getCallerClass(1)).isEqualTo(getClass());
   }
 
diff --git a/geode-lucene/src/distributedTest/java/org/apache/geode/cache/lucene/LuceneIndexCreationDUnitTest.java b/geode-lucene/src/distributedTest/java/org/apache/geode/cache/lucene/LuceneIndexCreationDUnitTest.java
index d7062c4..c5f3c9e 100644
--- a/geode-lucene/src/distributedTest/java/org/apache/geode/cache/lucene/LuceneIndexCreationDUnitTest.java
+++ b/geode-lucene/src/distributedTest/java/org/apache/geode/cache/lucene/LuceneIndexCreationDUnitTest.java
@@ -26,6 +26,7 @@ import static org.apache.geode.cache.lucene.test.LuceneTestUtilities.CANNOT_CREA
 import static org.apache.geode.cache.lucene.test.LuceneTestUtilities.CANNOT_CREATE_LUCENE_INDEX_DIFFERENT_SERIALIZER;
 import static org.apache.geode.cache.lucene.test.LuceneTestUtilities.INDEX_NAME;
 import static org.apache.geode.cache.lucene.test.LuceneTestUtilities.REGION_NAME;
+import static org.apache.geode.test.util.ResourceUtils.createTempFileFromResource;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.fail;
@@ -59,7 +60,6 @@ import org.apache.geode.cache.lucene.test.TestObject;
 import org.apache.geode.test.dunit.AsyncInvocation;
 import org.apache.geode.test.dunit.SerializableRunnableIF;
 import org.apache.geode.test.junit.categories.LuceneTest;
-import org.apache.geode.util.test.TestUtil;
 
 @Category({LuceneTest.class})
 @RunWith(JUnitParamsRunner.class)
@@ -469,8 +469,8 @@ public class LuceneIndexCreationDUnitTest extends LuceneDUnitTest {
   }
 
   protected String getXmlFileForTest(String testName) {
-    return TestUtil.getResourcePath(getClass(),
-        getClassSimpleName() + "." + testName + ".cache.xml");
+    return createTempFileFromResource(getClass(),
+        getClassSimpleName() + "." + testName + ".cache.xml").getAbsolutePath();
   }
 
   protected String getClassSimpleName() {
diff --git a/geode-lucene/src/integrationTest/java/org/apache/geode/cache/lucene/internal/xml/LuceneIndexXmlParserIntegrationJUnitTest.java b/geode-lucene/src/integrationTest/java/org/apache/geode/cache/lucene/internal/xml/LuceneIndexXmlParserIntegrationJUnitTest.java
index 38c6ef4..095d55a 100644
--- a/geode-lucene/src/integrationTest/java/org/apache/geode/cache/lucene/internal/xml/LuceneIndexXmlParserIntegrationJUnitTest.java
+++ b/geode-lucene/src/integrationTest/java/org/apache/geode/cache/lucene/internal/xml/LuceneIndexXmlParserIntegrationJUnitTest.java
@@ -17,6 +17,7 @@ package org.apache.geode.cache.lucene.internal.xml;
 
 import static org.apache.geode.distributed.ConfigurationProperties.CACHE_XML_FILE;
 import static org.apache.geode.distributed.ConfigurationProperties.MCAST_PORT;
+import static org.apache.geode.test.util.ResourceUtils.createTempFileFromResource;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.junit.Assert.assertArrayEquals;
 import static org.junit.Assert.assertEquals;
@@ -52,7 +53,6 @@ import org.apache.geode.internal.cache.xmlcache.CacheCreation;
 import org.apache.geode.internal.cache.xmlcache.CacheXmlParser;
 import org.apache.geode.internal.cache.xmlcache.RegionCreation;
 import org.apache.geode.test.junit.categories.LuceneTest;
-import org.apache.geode.util.test.TestUtil;
 
 @Category({LuceneTest.class})
 public class LuceneIndexXmlParserIntegrationJUnitTest {
@@ -232,8 +232,8 @@ public class LuceneIndexXmlParserIntegrationJUnitTest {
   }
 
   private String getXmlFileForTest() {
-    return TestUtil.getResourcePath(getClass(),
-        getClass().getSimpleName() + "." + name.getMethodName() + ".cache.xml");
+    return createTempFileFromResource(getClass(),
+        getClass().getSimpleName() + "." + name.getMethodName() + ".cache.xml").getAbsolutePath();
   }
 
 }
diff --git a/geode-protobuf/src/integrationTest/java/org/apache/geode/internal/protocol/protobuf/v1/acceptance/CacheConnectionIntegrationTest.java b/geode-protobuf/src/integrationTest/java/org/apache/geode/internal/protocol/protobuf/v1/acceptance/CacheConnectionIntegrationTest.java
index 064800b..fac1d34 100644
--- a/geode-protobuf/src/integrationTest/java/org/apache/geode/internal/protocol/protobuf/v1/acceptance/CacheConnectionIntegrationTest.java
+++ b/geode-protobuf/src/integrationTest/java/org/apache/geode/internal/protocol/protobuf/v1/acceptance/CacheConnectionIntegrationTest.java
@@ -26,6 +26,7 @@ import static org.apache.geode.distributed.ConfigurationProperties.SSL_TRUSTSTOR
 import static org.apache.geode.distributed.ConfigurationProperties.SSL_TRUSTSTORE_PASSWORD;
 import static org.apache.geode.internal.protocol.protobuf.v1.MessageUtil.validateGetResponse;
 import static org.apache.geode.test.awaitility.GeodeAwaitility.await;
+import static org.apache.geode.test.util.ResourceUtils.createTempFileFromResource;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
@@ -73,7 +74,6 @@ import org.apache.geode.internal.protocol.protobuf.v1.serializer.ProtobufProtoco
 import org.apache.geode.internal.protocol.protobuf.v1.serializer.exception.InvalidProtocolMessageException;
 import org.apache.geode.test.junit.categories.ClientServerTest;
 import org.apache.geode.test.junit.runners.CategoryWithParameterizedRunnerFactory;
-import org.apache.geode.util.test.TestUtil;
 
 /**
  * Test that using the magic byte to indicate intend ot use ProtoBuf messages works
@@ -232,9 +232,12 @@ public class CacheConnectionIntegrationTest {
   }
 
   private void updatePropertiesForSSLCache(Properties properties) {
-    String keyStore = TestUtil.getResourcePath(CacheConnectionIntegrationTest.class, DEFAULT_STORE);
+    String keyStore =
+        createTempFileFromResource(CacheConnectionIntegrationTest.class, DEFAULT_STORE)
+            .getAbsolutePath();
     String trustStore =
-        TestUtil.getResourcePath(CacheConnectionIntegrationTest.class, DEFAULT_STORE);
+        createTempFileFromResource(CacheConnectionIntegrationTest.class, DEFAULT_STORE)
+            .getAbsolutePath();
 
     properties.setProperty(SSL_ENABLED_COMPONENTS, "server");
     properties.setProperty(SSL_PROTOCOLS, SSL_PROTOCOLS_VALUE);
@@ -250,9 +253,11 @@ public class CacheConnectionIntegrationTest {
 
   private Socket getSSLSocket() throws IOException {
     String keyStorePath =
-        TestUtil.getResourcePath(CacheConnectionIntegrationTest.class, DEFAULT_STORE);
+        createTempFileFromResource(CacheConnectionIntegrationTest.class, DEFAULT_STORE)
+            .getAbsolutePath();
     String trustStorePath =
-        TestUtil.getResourcePath(CacheConnectionIntegrationTest.class, DEFAULT_STORE);
+        createTempFileFromResource(CacheConnectionIntegrationTest.class, DEFAULT_STORE)
+            .getAbsolutePath();
 
     SSLConfig sslConfig = new SSLConfig();
     sslConfig.setEnabled(true);
diff --git a/geode-protobuf/src/integrationTest/java/org/apache/geode/internal/protocol/protobuf/v1/acceptance/CacheOperationsJUnitTest.java b/geode-protobuf/src/integrationTest/java/org/apache/geode/internal/protocol/protobuf/v1/acceptance/CacheOperationsJUnitTest.java
index c907704..d30b692 100644
--- a/geode-protobuf/src/integrationTest/java/org/apache/geode/internal/protocol/protobuf/v1/acceptance/CacheOperationsJUnitTest.java
+++ b/geode-protobuf/src/integrationTest/java/org/apache/geode/internal/protocol/protobuf/v1/acceptance/CacheOperationsJUnitTest.java
@@ -24,6 +24,7 @@ import static org.apache.geode.distributed.ConfigurationProperties.SSL_TRUSTSTOR
 import static org.apache.geode.distributed.ConfigurationProperties.SSL_TRUSTSTORE_PASSWORD;
 import static org.apache.geode.internal.protocol.protobuf.v1.MessageUtil.validateGetResponse;
 import static org.apache.geode.test.awaitility.GeodeAwaitility.await;
+import static org.apache.geode.test.util.ResourceUtils.createTempFileFromResource;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
 
@@ -67,7 +68,6 @@ import org.apache.geode.internal.protocol.protobuf.v1.serializer.ProtobufProtoco
 import org.apache.geode.internal.protocol.protobuf.v1.serializer.exception.InvalidProtocolMessageException;
 import org.apache.geode.internal.protocol.protobuf.v1.utilities.ProtobufUtilities;
 import org.apache.geode.test.junit.categories.ClientServerTest;
-import org.apache.geode.util.test.TestUtil;
 
 /**
  * Test operations using ProtoBuf
@@ -362,8 +362,12 @@ public class CacheOperationsJUnitTest {
   }
 
   private void updatePropertiesForSSLCache(Properties properties) {
-    String keyStore = TestUtil.getResourcePath(CacheOperationsJUnitTest.class, DEFAULT_STORE);
-    String trustStore = TestUtil.getResourcePath(CacheOperationsJUnitTest.class, DEFAULT_STORE);
+    String keyStore =
+        createTempFileFromResource(CacheOperationsJUnitTest.class, DEFAULT_STORE)
+            .getAbsolutePath();
+    String trustStore =
+        createTempFileFromResource(CacheOperationsJUnitTest.class, DEFAULT_STORE)
+            .getAbsolutePath();
 
     properties.put(SSL_ENABLED_COMPONENTS, "server");
     properties.put(ConfigurationProperties.SSL_PROTOCOLS, SSL_PROTOCOLS);
@@ -378,8 +382,12 @@ public class CacheOperationsJUnitTest {
   }
 
   private Socket getSSLSocket() throws IOException {
-    String keyStorePath = TestUtil.getResourcePath(CacheOperationsJUnitTest.class, DEFAULT_STORE);
-    String trustStorePath = TestUtil.getResourcePath(CacheOperationsJUnitTest.class, DEFAULT_STORE);
+    String keyStorePath =
+        createTempFileFromResource(CacheOperationsJUnitTest.class, DEFAULT_STORE)
+            .getAbsolutePath();
+    String trustStorePath =
+        createTempFileFromResource(CacheOperationsJUnitTest.class, DEFAULT_STORE)
+            .getAbsolutePath();
 
     SSLConfig sslConfig = new SSLConfig();
     sslConfig.setEnabled(true);
diff --git a/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/WANTestBase.java b/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/WANTestBase.java
index 9c7a2b3..d86c970 100644
--- a/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/WANTestBase.java
+++ b/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/WANTestBase.java
@@ -38,6 +38,7 @@ import static org.apache.geode.distributed.ConfigurationProperties.REMOTE_LOCATO
 import static org.apache.geode.distributed.ConfigurationProperties.START_LOCATOR;
 import static org.apache.geode.test.awaitility.GeodeAwaitility.await;
 import static org.apache.geode.test.dunit.Host.getHost;
+import static org.apache.geode.test.util.ResourceUtils.createTempFileFromResource;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.hamcrest.Matchers.greaterThan;
@@ -180,7 +181,6 @@ import org.apache.geode.test.dunit.VM;
 import org.apache.geode.test.dunit.WaitCriterion;
 import org.apache.geode.test.dunit.internal.JUnit4DistributedTestCase;
 import org.apache.geode.test.junit.categories.WanTest;
-import org.apache.geode.util.test.TestUtil;
 
 @Category({WanTest.class})
 public class WANTestBase extends DistributedTestCase {
@@ -944,11 +944,11 @@ public class WANTestBase extends DistributedTestCase {
 
     gemFireProps.put(GATEWAY_SSL_KEYSTORE_TYPE, "jks");
     // this uses the default.keystore which is all jdk compliant in geode-dunit module
-    gemFireProps.put(GATEWAY_SSL_KEYSTORE, TestUtil.getResourcePath(WANTestBase.class,
-        "/org/apache/geode/cache/client/internal/default.keystore"));
+    gemFireProps.put(GATEWAY_SSL_KEYSTORE, createTempFileFromResource(WANTestBase.class,
+        "/org/apache/geode/cache/client/internal/default.keystore").getAbsolutePath());
     gemFireProps.put(GATEWAY_SSL_KEYSTORE_PASSWORD, "password");
-    gemFireProps.put(GATEWAY_SSL_TRUSTSTORE, TestUtil.getResourcePath(WANTestBase.class,
-        "/org/apache/geode/cache/client/internal/default.keystore"));
+    gemFireProps.put(GATEWAY_SSL_TRUSTSTORE, createTempFileFromResource(WANTestBase.class,
+        "/org/apache/geode/cache/client/internal/default.keystore").getAbsolutePath());
     gemFireProps.put(GATEWAY_SSL_TRUSTSTORE_PASSWORD, "password");
 
     gemFireProps.setProperty(MCAST_PORT, "0");
@@ -2033,11 +2033,11 @@ public class WANTestBase extends DistributedTestCase {
     gemFireProps.put(GATEWAY_SSL_REQUIRE_AUTHENTICATION, "true");
 
     gemFireProps.put(GATEWAY_SSL_KEYSTORE_TYPE, "jks");
-    gemFireProps.put(GATEWAY_SSL_KEYSTORE, TestUtil.getResourcePath(WANTestBase.class,
-        "/org/apache/geode/cache/client/internal/default.keystore"));
+    gemFireProps.put(GATEWAY_SSL_KEYSTORE, createTempFileFromResource(WANTestBase.class,
+        "/org/apache/geode/cache/client/internal/default.keystore").getAbsolutePath());
     gemFireProps.put(GATEWAY_SSL_KEYSTORE_PASSWORD, "password");
-    gemFireProps.put(GATEWAY_SSL_TRUSTSTORE, TestUtil.getResourcePath(WANTestBase.class,
-        "/org/apache/geode/cache/client/internal/default.keystore"));
+    gemFireProps.put(GATEWAY_SSL_TRUSTSTORE, createTempFileFromResource(WANTestBase.class,
+        "/org/apache/geode/cache/client/internal/default.keystore").getAbsolutePath());
     gemFireProps.put(GATEWAY_SSL_TRUSTSTORE_PASSWORD, "password");
 
     gemFireProps.setProperty(MCAST_PORT, "0");
diff --git a/geode-wan/src/integrationTest/java/org/apache/geode/internal/cache/wan/GatewayReceiverXmlParsingValidationsJUnitTest.java b/geode-wan/src/integrationTest/java/org/apache/geode/internal/cache/wan/GatewayReceiverXmlParsingValidationsJUnitTest.java
index a5f2cbf..369421b 100644
--- a/geode-wan/src/integrationTest/java/org/apache/geode/internal/cache/wan/GatewayReceiverXmlParsingValidationsJUnitTest.java
+++ b/geode-wan/src/integrationTest/java/org/apache/geode/internal/cache/wan/GatewayReceiverXmlParsingValidationsJUnitTest.java
@@ -17,6 +17,7 @@ package org.apache.geode.internal.cache.wan;
 import static org.apache.geode.distributed.ConfigurationProperties.CACHE_XML_FILE;
 import static org.apache.geode.distributed.ConfigurationProperties.MCAST_PORT;
 import static org.apache.geode.internal.Assert.assertTrue;
+import static org.apache.geode.test.util.ResourceUtils.createTempFileFromResource;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.junit.Assert.assertEquals;
 import static org.mockito.Mockito.mock;
@@ -46,7 +47,6 @@ import org.apache.geode.internal.cache.wan.spi.WANFactory;
 import org.apache.geode.test.junit.categories.WanTest;
 import org.apache.geode.test.junit.rules.serializable.SerializableTestName;
 import org.apache.geode.test.junit.runners.CategoryWithParameterizedRunnerFactory;
-import org.apache.geode.util.test.TestUtil;
 
 @Category({WanTest.class})
 @RunWith(Parameterized.class)
@@ -68,15 +68,19 @@ public class GatewayReceiverXmlParsingValidationsJUnitTest {
 
   @Test(expected = CacheXmlException.class)
   public void multipleReceiversShouldThrowException() {
-    String cacheXmlFileName = TestUtil.getResourcePath(getClass(),
-        getClass().getSimpleName() + "." + testName.getMethodName() + ".cache.xml");
+    String cacheXmlFileName =
+        createTempFileFromResource(getClass(),
+            getClass().getSimpleName() + "." + testName.getMethodName() + ".cache.xml")
+                .getAbsolutePath();
     cache = new CacheFactory().set(MCAST_PORT, "0").set(CACHE_XML_FILE, cacheXmlFileName).create();
   }
 
   @Test
   public void correctConfiguration() {
-    String cacheXmlFileName = TestUtil.getResourcePath(getClass(),
-        getClass().getSimpleName() + "." + testName.getMethodName() + ".cache.xml");
+    String cacheXmlFileName =
+        createTempFileFromResource(getClass(),
+            getClass().getSimpleName() + "." + testName.getMethodName() + ".cache.xml")
+                .getAbsolutePath();
     cache = new CacheFactory().set(MCAST_PORT, "0").set(CACHE_XML_FILE, cacheXmlFileName).create();
 
     assertThat(cache.getGatewayReceivers()).isNotEmpty();
diff --git a/geode-web/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/ConnectCommandWithSSLTest.java b/geode-web/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/ConnectCommandWithSSLTest.java
index c039f22..a90f9a3 100644
--- a/geode-web/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/ConnectCommandWithSSLTest.java
+++ b/geode-web/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/ConnectCommandWithSSLTest.java
@@ -48,6 +48,7 @@ import static org.apache.geode.distributed.ConfigurationProperties.SSL_PROTOCOLS
 import static org.apache.geode.distributed.ConfigurationProperties.SSL_TRUSTSTORE;
 import static org.apache.geode.distributed.ConfigurationProperties.SSL_TRUSTSTORE_PASSWORD;
 import static org.apache.geode.distributed.ConfigurationProperties.SSL_TRUSTSTORE_TYPE;
+import static org.apache.geode.test.util.ResourceUtils.createTempFileFromResource;
 import static org.assertj.core.api.Assertions.assertThat;
 
 import java.io.File;
@@ -69,7 +70,6 @@ import org.apache.geode.test.dunit.rules.ClusterStartupRule;
 import org.apache.geode.test.dunit.rules.MemberVM;
 import org.apache.geode.test.junit.categories.GfshTest;
 import org.apache.geode.test.junit.rules.GfshCommandRule;
-import org.apache.geode.util.test.TestUtil;
 
 @Category({GfshTest.class})
 public class ConnectCommandWithSSLTest {
@@ -86,8 +86,8 @@ public class ConnectCommandWithSSLTest {
      * -ext san=ip:127.0.0.1 -storetype jks
      */
 
-    jks = new File(TestUtil.getResourcePath(ConnectCommandWithSSLTest.class.getClassLoader(),
-        "ssl/trusted.keystore"));
+    jks = new File(createTempFileFromResource(ConnectCommandWithSSLTest.class.getClassLoader(),
+        "ssl/trusted.keystore").getAbsolutePath());
   }
 
   private static final Properties sslProperties = new Properties() {