geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ladyva...@apache.org
Subject [geode] branch develop updated: GEODE-3338 Refactor WAN command tests to use new Rules
Date Tue, 31 Oct 2017 20:31:38 GMT
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/develop by this push:
     new d0a2c3d  GEODE-3338 Refactor WAN command tests to use new Rules
d0a2c3d is described below

commit d0a2c3d1cd34e9abe13c9f4089e59cc09bfab500
Author: Lynn Hughes-Godfrey <lhughesgodfrey@pivotal.io>
AuthorDate: Fri Oct 27 17:08:42 2017 -0700

    GEODE-3338 Refactor WAN command tests to use new Rules
    
    This commit includes refactoring the 13 test classes in WAN Command tests to
    use the new Test Rules vs. the deprecated CliCommandTestBase.
    In addition to GEODE-3338, please refer to GEODE-3362 through GEODE-3374
    (one per test plus one to remove WANCommandTestBase) all of which are included
    as sub jiras for GEODE-1359.
    
    - Remove use of deprecated APIs in CliCommandTestBase
    - Remove WANCommandTestBase (all classes extended this class)
    - Refactored to use new rules
    - Removed FlakyTest specification for GEODE-1355, GEODE-1395, GEODE-1418
    and GEODE-1448.
---
 ...teAndDestroyGatewaySenderCommandsDUnitTest.java | 354 +++++++-----
 .../CreateGatewayReceiverCommandDUnitTest.java     | 632 +++++++++++----------
 .../CreateGatewaySenderCommandDUnitTest.java       |  73 ++-
 .../DestroyGatewaySenderCommandDUnitTest.java      |  56 +-
 .../PauseGatewaySenderCommandDUnitTest.java        | 259 +++++----
 .../ResumeGatewaySenderCommandDUnitTest.java       | 342 ++++++-----
 .../StartGatewayReceiverCommandDUnitTest.java      | 245 +++++---
 .../StartGatewaySenderCommandDUnitTest.java        | 254 +++++----
 .../StatusGatewayReceiverCommandDUnitTest.java     | 185 ++++--
 .../StatusGatewaySenderCommandDUnitTest.java       | 263 ++++++---
 .../StopGatewayReceiverCommandDUnitTest.java       | 254 ++++++---
 .../StopGatewaySenderCommandDUnitTest.java         | 255 +++++----
 .../cache/wan/wancommand/WANCommandTestBase.java   | 559 ------------------
 .../cache/wan/wancommand/WANCommandUtils.java      | 344 +++++++++++
 .../wan/wancommand/WanCommandListDUnitTest.java    | 248 ++++----
 15 files changed, 2416 insertions(+), 1907 deletions(-)

diff --git a/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/wancommand/CreateAndDestroyGatewaySenderCommandsDUnitTest.java b/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/wancommand/CreateAndDestroyGatewaySenderCommandsDUnitTest.java
index f89ca29..5c8b047 100644
--- a/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/wancommand/CreateAndDestroyGatewaySenderCommandsDUnitTest.java
+++ b/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/wancommand/CreateAndDestroyGatewaySenderCommandsDUnitTest.java
@@ -14,6 +14,13 @@
  */
 package org.apache.geode.internal.cache.wan.wancommand;
 
+import static org.apache.geode.distributed.ConfigurationProperties.DISTRIBUTED_SYSTEM_ID;
+import static org.apache.geode.distributed.ConfigurationProperties.GROUPS;
+import static org.apache.geode.distributed.ConfigurationProperties.REMOTE_LOCATORS;
+import static org.apache.geode.internal.cache.wan.wancommand.WANCommandUtils.getMemberIdCallable;
+import static org.apache.geode.internal.cache.wan.wancommand.WANCommandUtils.verifySenderAttributes;
+import static org.apache.geode.internal.cache.wan.wancommand.WANCommandUtils.verifySenderDestroyed;
+import static org.apache.geode.internal.cache.wan.wancommand.WANCommandUtils.verifySenderState;
 import static org.apache.geode.test.dunit.Assert.assertEquals;
 import static org.apache.geode.test.dunit.Assert.assertTrue;
 import static org.apache.geode.test.dunit.Assert.fail;
@@ -22,73 +29,107 @@ import static org.apache.geode.test.dunit.LogWriterUtils.getLogWriter;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
-
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
+import java.util.Properties;
 
 import org.apache.geode.cache.wan.GatewaySender;
-import org.apache.geode.cache.wan.GatewaySender.OrderPolicy;
 import org.apache.geode.distributed.DistributedMember;
 import org.apache.geode.management.cli.Result;
+import org.apache.geode.test.dunit.rules.LocatorServerStartupRule;
+import org.apache.geode.test.dunit.rules.MemberVM;
+import org.apache.geode.test.junit.rules.GfshShellConnectionRule;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
 import org.apache.geode.management.internal.cli.i18n.CliStrings;
 import org.apache.geode.management.internal.cli.result.CommandResult;
 import org.apache.geode.management.internal.cli.result.TabularResultData;
 import org.apache.geode.test.dunit.IgnoredException;
-import org.apache.geode.test.dunit.VM;
 import org.apache.geode.test.junit.categories.DistributedTest;
 
 @Category(DistributedTest.class)
-public class CreateAndDestroyGatewaySenderCommandsDUnitTest extends WANCommandTestBase {
+public class CreateAndDestroyGatewaySenderCommandsDUnitTest {
+
+  @Rule
+  public LocatorServerStartupRule locatorServerStartupRule = new LocatorServerStartupRule();
+
+  @Rule
+  public GfshShellConnectionRule gfsh = new GfshShellConnectionRule();
+
+  private MemberVM locatorSite1;
+  private MemberVM locatorSite2;
+  private MemberVM server1;
+  private MemberVM server2;
+  private MemberVM server3;
+
+  @Before
+  public void before() throws Exception {
+    Properties props = new Properties();
+    props.setProperty(DISTRIBUTED_SYSTEM_ID, "" + 1);
+    locatorSite1 = locatorServerStartupRule.startLocatorVM(1, props);
+
+    props.setProperty(DISTRIBUTED_SYSTEM_ID, "" + 2);
+    props.setProperty(REMOTE_LOCATORS, "localhost[" + locatorSite1.getPort() + "]");
+    locatorSite2 = locatorServerStartupRule.startLocatorVM(2, props);
+
+    // Connect Gfsh to locator.
+    gfsh.connectAndVerify(locatorSite1);
+
+  }
+
   /**
    * GatewaySender with all default attributes
    */
   @Test
-  public void testCreateDestroyGatewaySenderWithDefault() {
-    Integer dsIdPort = vm1.invoke(() -> createFirstLocatorWithDSId(1));
-    propsSetUp(dsIdPort);
+  public void testCreateDestroyGatewaySenderWithDefault() throws Exception {
 
-    vm2.invoke(() -> createFirstRemoteLocator(2, dsIdPort));
-    vm3.invoke(() -> createCache(dsIdPort));
-    vm4.invoke(() -> createCache(dsIdPort));
-    vm5.invoke(() -> createCache(dsIdPort));
+    Integer locator1Port = locatorSite1.getPort();
 
+    // setup servers in Site #1
+    server1 = locatorServerStartupRule.startServerVM(3, locator1Port);
+    server2 = locatorServerStartupRule.startServerVM(4, locator1Port);
+    server3 = locatorServerStartupRule.startServerVM(5, locator1Port);
+
+    // create gateway senders to Site #2
     String command = CliStrings.CREATE_GATEWAYSENDER + " --" + CliStrings.CREATE_GATEWAYSENDER__ID
         + "=ln" + " --" + CliStrings.CREATE_GATEWAYSENDER__REMOTEDISTRIBUTEDSYSTEMID + "=2";
     CommandResult cmdResult = executeCommandWithIgnoredExceptions(command);
     if (cmdResult != null) {
-      String strCmdResult = commandResultToString(cmdResult);
+      String strCmdResult = cmdResult.toString();
       getLogWriter().info(
           "testCreateDestroyGatewaySenderWithDefault stringResult : " + strCmdResult + ">>>>");
-      assertEquals(Result.Status.OK, cmdResult.getStatus());
 
       TabularResultData resultData = (TabularResultData) cmdResult.getResultData();
       List<String> status = resultData.retrieveAllValues("Status");
-      assertEquals(5, status.size());
+      assertEquals(3, status.size());
       for (String stat : status) {
         assertTrue("GatewaySender creation failed with: " + stat, !stat.contains("ERROR:"));
       }
     } else {
       fail("testCreateDestroyGatewaySenderWithDefault failed as did not get CommandResult");
     }
-    vm3.invoke(() -> verifySenderState("ln", true, false));
-    vm4.invoke(() -> verifySenderState("ln", true, false));
-    vm5.invoke(() -> verifySenderState("ln", true, false));
+
+    server1.invoke(() -> verifySenderState("ln", true, false));
+    server2.invoke(() -> verifySenderState("ln", true, false));
+    server3.invoke(() -> verifySenderState("ln", true, false));
+
+    // destroy gateway sender and verify AEQs cleaned up
     doDestroyAndVerifyGatewaySender("ln", null, null, "testCreateDestroyGatewaySenderWithDefault",
-        Arrays.asList(vm3, vm4, vm5), 5, false);
+        Arrays.asList(server1, server2, server3), 3, false);
   }
 
   /**
    * + * GatewaySender with given attribute values +
    */
   @Test
-  public void testCreateDestroyGatewaySender() {
-    Integer dsIdPort = vm1.invoke(() -> createFirstLocatorWithDSId(1));
-    propsSetUp(dsIdPort);
+  public void testCreateDestroyGatewaySender() throws Exception {
+    Integer locator1Port = locatorSite1.getPort();
 
-    vm2.invoke(() -> createFirstRemoteLocator(2, dsIdPort));
-    vm3.invoke(() -> createCache(dsIdPort));
-    vm4.invoke(() -> createCache(dsIdPort));
-    vm5.invoke(() -> createCache(dsIdPort));
+    // setup servers in Site #1
+    server1 = locatorServerStartupRule.startServerVM(3, locator1Port);
+    server2 = locatorServerStartupRule.startServerVM(4, locator1Port);
+    server3 = locatorServerStartupRule.startServerVM(5, locator1Port);
 
     int socketReadTimeout = GatewaySender.MINIMUM_SOCKET_READ_TIMEOUT + 1000;
     String command = CliStrings.CREATE_GATEWAYSENDER + " --" + CliStrings.CREATE_GATEWAYSENDER__ID
@@ -108,44 +149,45 @@ public class CreateAndDestroyGatewaySenderCommandsDUnitTest extends WANCommandTe
         + CliStrings.CREATE_GATEWAYSENDER__ORDERPOLICY + "=THREAD";
     CommandResult cmdResult = executeCommandWithIgnoredExceptions(command);
     if (cmdResult != null) {
-      String strCmdResult = commandResultToString(cmdResult);
+      String strCmdResult = cmdResult.toString();
       getLogWriter().info("testCreateDestroyGatewaySender stringResult : " + strCmdResult + ">>>>");
       assertEquals(Result.Status.OK, cmdResult.getStatus());
 
       TabularResultData resultData = (TabularResultData) cmdResult.getResultData();
       List<String> status = resultData.retrieveAllValues("Status");
-      assertEquals(5, status.size());
+      assertEquals(3, status.size());
       for (String stat : status) {
         assertTrue("GatewaySender creation failed with: " + stat, !stat.contains("ERROR:"));
       }
     } else {
       fail("testCreateDestroyGatewaySender failed as did not get CommandResult");
     }
-    vm3.invoke(() -> verifySenderState("ln", false, false));
-    vm4.invoke(() -> verifySenderState("ln", false, false));
-    vm5.invoke(() -> verifySenderState("ln", false, false));
-    vm3.invoke(() -> verifySenderAttributes("ln", 2, false, true, 1000, socketReadTimeout, true,
-        1000, 5000, true, false, 1000, 100, 2, OrderPolicy.THREAD, null, null));
-    vm4.invoke(() -> verifySenderAttributes("ln", 2, false, true, 1000, socketReadTimeout, true,
-        1000, 5000, true, false, 1000, 100, 2, OrderPolicy.THREAD, null, null));
-    vm5.invoke(() -> verifySenderAttributes("ln", 2, false, true, 1000, socketReadTimeout, true,
-        1000, 5000, true, false, 1000, 100, 2, OrderPolicy.THREAD, null, null));
+    server1.invoke(() -> verifySenderState("ln", false, false));
+    server2.invoke(() -> verifySenderState("ln", false, false));
+    server3.invoke(() -> verifySenderState("ln", false, false));
+
+    server1.invoke(() -> verifySenderAttributes("ln", 2, false, true, 1000, socketReadTimeout, true,
+        1000, 5000, true, false, 1000, 100, 2, GatewaySender.OrderPolicy.THREAD, null, null));
+    server2.invoke(() -> verifySenderAttributes("ln", 2, false, true, 1000, socketReadTimeout, true,
+        1000, 5000, true, false, 1000, 100, 2, GatewaySender.OrderPolicy.THREAD, null, null));
+    server3.invoke(() -> verifySenderAttributes("ln", 2, false, true, 1000, socketReadTimeout, true,
+        1000, 5000, true, false, 1000, 100, 2, GatewaySender.OrderPolicy.THREAD, null, null));
+
     doDestroyAndVerifyGatewaySender("ln", null, null, "testCreateDestroyGatewaySender",
-        Arrays.asList(vm3, vm4, vm5), 5, false);
+        Arrays.asList(server1, server2, server3), 3, false);
   }
 
   /**
    * GatewaySender with given attribute values and event filters.
    */
   @Test
-  public void testCreateDestroyGatewaySenderWithGatewayEventFilters() {
-    Integer dsIdPort = vm1.invoke(() -> createFirstLocatorWithDSId(1));
-    propsSetUp(dsIdPort);
+  public void testCreateDestroyGatewaySenderWithGatewayEventFilters() throws Exception {
+    Integer locator1Port = locatorSite1.getPort();
 
-    vm2.invoke(() -> createFirstRemoteLocator(2, dsIdPort));
-    vm3.invoke(() -> createCache(dsIdPort));
-    vm4.invoke(() -> createCache(dsIdPort));
-    vm5.invoke(() -> createCache(dsIdPort));
+    // setup servers in Site #1
+    server1 = locatorServerStartupRule.startServerVM(3, locator1Port);
+    server2 = locatorServerStartupRule.startServerVM(4, locator1Port);
+    server3 = locatorServerStartupRule.startServerVM(5, locator1Port);
 
     int socketReadTimeout = GatewaySender.MINIMUM_SOCKET_READ_TIMEOUT + 1000;
     String command = CliStrings.CREATE_GATEWAYSENDER + " --" + CliStrings.CREATE_GATEWAYSENDER__ID
@@ -167,13 +209,13 @@ public class CreateAndDestroyGatewaySenderCommandsDUnitTest extends WANCommandTe
         + "=org.apache.geode.cache30.MyGatewayEventFilter1,org.apache.geode.cache30.MyGatewayEventFilter2";
     CommandResult cmdResult = executeCommandWithIgnoredExceptions(command);
     if (cmdResult != null) {
-      String strCmdResult = commandResultToString(cmdResult);
+      String strCmdResult = cmdResult.toString();
       getLogWriter().info("testCreateDestroyGatewaySenderWithGatewayEventFilters stringResult : "
           + strCmdResult + ">>>>");
       assertEquals(Result.Status.OK, cmdResult.getStatus());
       TabularResultData resultData = (TabularResultData) cmdResult.getResultData();
       List<String> status = resultData.retrieveAllValues("Status");
-      assertEquals(5, status.size());
+      assertEquals(3, status.size());
       for (String stat : status) {
         assertTrue("GatewaySender creation failed with: " + stat, !stat.contains("ERROR:"));
       }
@@ -181,35 +223,42 @@ public class CreateAndDestroyGatewaySenderCommandsDUnitTest extends WANCommandTe
       fail(
           "testCreateDestroyGatewaySenderWithGatewayEventFilters failed as did not get CommandResult");
     }
-    vm3.invoke(() -> verifySenderState("ln", false, false));
-    vm4.invoke(() -> verifySenderState("ln", false, false));
-    vm5.invoke(() -> verifySenderState("ln", false, false));
+
+    server1.invoke(() -> verifySenderState("ln", false, false));
+    server2.invoke(() -> verifySenderState("ln", false, false));
+    server3.invoke(() -> verifySenderState("ln", false, false));
+
     List<String> eventFilters = new ArrayList<String>();
     eventFilters.add("org.apache.geode.cache30.MyGatewayEventFilter1");
     eventFilters.add("org.apache.geode.cache30.MyGatewayEventFilter2");
-    vm3.invoke(() -> verifySenderAttributes("ln", 2, false, true, 1000, socketReadTimeout, true,
-        1000, 5000, true, false, 1000, 100, 2, OrderPolicy.THREAD, eventFilters, null));
-    vm4.invoke(() -> verifySenderAttributes("ln", 2, false, true, 1000, socketReadTimeout, true,
-        1000, 5000, true, false, 1000, 100, 2, OrderPolicy.THREAD, eventFilters, null));
-    vm5.invoke(() -> verifySenderAttributes("ln", 2, false, true, 1000, socketReadTimeout, true,
-        1000, 5000, true, false, 1000, 100, 2, OrderPolicy.THREAD, eventFilters, null));
+
+    server1.invoke(
+        () -> verifySenderAttributes("ln", 2, false, true, 1000, socketReadTimeout, true, 1000,
+            5000, true, false, 1000, 100, 2, GatewaySender.OrderPolicy.THREAD, eventFilters, null));
+    server2.invoke(
+        () -> verifySenderAttributes("ln", 2, false, true, 1000, socketReadTimeout, true, 1000,
+            5000, true, false, 1000, 100, 2, GatewaySender.OrderPolicy.THREAD, eventFilters, null));
+    server3.invoke(() -> verifySenderAttributes("ln", 2, false, true, 1000, socketReadTimeout, true,
+
+        1000, 5000, true, false, 1000, 100, 2, GatewaySender.OrderPolicy.THREAD, eventFilters,
+        null));
+
     doDestroyAndVerifyGatewaySender("ln", null, null,
-        "testCreateDestroyGatewaySenderWithGatewayEventFilters", Arrays.asList(vm3, vm4, vm5), 5,
-        false);
+        "testCreateDestroyGatewaySenderWithGatewayEventFilters",
+        Arrays.asList(server1, server2, server3), 3, false);
   }
 
   /**
    * GatewaySender with given attribute values and transport filters.
    */
   @Test
-  public void testCreateDestroyGatewaySenderWithGatewayTransportFilters() {
-    Integer dsIdPort = vm1.invoke(() -> createFirstLocatorWithDSId(1));
-    propsSetUp(dsIdPort);
+  public void testCreateDestroyGatewaySenderWithGatewayTransportFilters() throws Exception {
+    Integer locator1Port = locatorSite1.getPort();
 
-    vm2.invoke(() -> createFirstRemoteLocator(2, dsIdPort));
-    vm3.invoke(() -> createCache(dsIdPort));
-    vm4.invoke(() -> createCache(dsIdPort));
-    vm5.invoke(() -> createCache(dsIdPort));
+    // setup servers in Site #1
+    server1 = locatorServerStartupRule.startServerVM(3, locator1Port);
+    server2 = locatorServerStartupRule.startServerVM(4, locator1Port);
+    server3 = locatorServerStartupRule.startServerVM(5, locator1Port);
 
     int socketReadTimeout = GatewaySender.MINIMUM_SOCKET_READ_TIMEOUT + 1000;
     String command = CliStrings.CREATE_GATEWAYSENDER + " --" + CliStrings.CREATE_GATEWAYSENDER__ID
@@ -231,14 +280,14 @@ public class CreateAndDestroyGatewaySenderCommandsDUnitTest extends WANCommandTe
         + "=org.apache.geode.cache30.MyGatewayTransportFilter1";
     CommandResult cmdResult = executeCommandWithIgnoredExceptions(command);
     if (cmdResult != null) {
-      String strCmdResult = commandResultToString(cmdResult);
+      String strCmdResult = cmdResult.toString();
       getLogWriter()
           .info("testCreateDestroyGatewaySenderWithGatewayTransportFilters stringResult : "
               + strCmdResult + ">>>>");
       assertEquals(Result.Status.OK, cmdResult.getStatus());
       TabularResultData resultData = (TabularResultData) cmdResult.getResultData();
       List<String> status = resultData.retrieveAllValues("Status");
-      assertEquals(5, status.size());
+      assertEquals(3, status.size());
       for (String stat : status) {
         assertTrue("GatewaySender creation failed with: " + stat, !stat.contains("ERROR:"));
       }
@@ -246,39 +295,44 @@ public class CreateAndDestroyGatewaySenderCommandsDUnitTest extends WANCommandTe
       fail(
           "testCreateDestroyGatewaySenderWithGatewayTransportFilters failed as did not get CommandResult");
     }
-    vm3.invoke(() -> verifySenderState("ln", false, false));
-    vm4.invoke(() -> verifySenderState("ln", false, false));
-    vm5.invoke(() -> verifySenderState("ln", false, false));
+
+    server1.invoke(() -> verifySenderState("ln", false, false));
+    server2.invoke(() -> verifySenderState("ln", false, false));
+    server2.invoke(() -> verifySenderState("ln", false, false));
+
     List<String> transportFilters = new ArrayList<String>();
     transportFilters.add("org.apache.geode.cache30.MyGatewayTransportFilter1");
-    vm3.invoke(() -> verifySenderAttributes("ln", 2, false, true, 1000, socketReadTimeout, true,
-        1000, 5000, true, false, 1000, 100, 2, OrderPolicy.THREAD, null, transportFilters));
-    vm4.invoke(() -> verifySenderAttributes("ln", 2, false, true, 1000, socketReadTimeout, true,
-        1000, 5000, true, false, 1000, 100, 2, OrderPolicy.THREAD, null, transportFilters));
-    vm5.invoke(() -> verifySenderAttributes("ln", 2, false, true, 1000, socketReadTimeout, true,
-        1000, 5000, true, false, 1000, 100, 2, OrderPolicy.THREAD, null, transportFilters));
+    server1.invoke(() -> verifySenderAttributes("ln", 2, false, true, 1000, socketReadTimeout, true,
+        1000, 5000, true, false, 1000, 100, 2, GatewaySender.OrderPolicy.THREAD, null,
+        transportFilters));
+    server2.invoke(() -> verifySenderAttributes("ln", 2, false, true, 1000, socketReadTimeout, true,
+        1000, 5000, true, false, 1000, 100, 2, GatewaySender.OrderPolicy.THREAD, null,
+        transportFilters));
+    server3.invoke(() -> verifySenderAttributes("ln", 2, false, true, 1000, socketReadTimeout, true,
+        1000, 5000, true, false, 1000, 100, 2, GatewaySender.OrderPolicy.THREAD, null,
+        transportFilters));
+
     doDestroyAndVerifyGatewaySender("ln", null, null,
-        "testCreateDestroyGatewaySenderWithGatewayTransportFilters", Arrays.asList(vm3, vm4, vm5),
-        5, false);
+        "testCreateDestroyGatewaySenderWithGatewayTransportFilters",
+        Arrays.asList(server1, server2, server3), 3, false);
   }
 
   /**
    * GatewaySender with given attribute values on given member.
    */
   @Test
-  public void testCreateDestroyGatewaySender_OnMember() {
-    Integer dsIdPort = vm1.invoke(() -> createFirstLocatorWithDSId(1));
-    propsSetUp(dsIdPort);
+  public void testCreateDestroyGatewaySender_OnMember() throws Exception {
+    Integer locator1Port = locatorSite1.getPort();
 
-    vm2.invoke(() -> createFirstRemoteLocator(2, dsIdPort));
-    vm3.invoke(() -> createCache(dsIdPort));
-    vm4.invoke(() -> createCache(dsIdPort));
-    vm5.invoke(() -> createCache(dsIdPort));
+    // setup servers in Site #1
+    server1 = locatorServerStartupRule.startServerVM(3, locator1Port);
+    server2 = locatorServerStartupRule.startServerVM(4, locator1Port);
+    server3 = locatorServerStartupRule.startServerVM(5, locator1Port);
 
-    final DistributedMember vm3Member = vm3.invoke(this::getMember);
+    final DistributedMember server1DM = (DistributedMember) server1.invoke(getMemberIdCallable());
     int socketReadTimeout = GatewaySender.MINIMUM_SOCKET_READ_TIMEOUT + 1000;
     String command = CliStrings.CREATE_GATEWAYSENDER + " --" + CliStrings.CREATE_GATEWAYSENDER__ID
-        + "=ln" + " --" + CliStrings.MEMBER + "=" + vm3Member.getId() + " --"
+        + "=ln" + " --" + CliStrings.MEMBER + "=" + server1DM.getId() + " --"
         + CliStrings.CREATE_GATEWAYSENDER__REMOTEDISTRIBUTEDSYSTEMID + "=2" + " --"
         + CliStrings.CREATE_GATEWAYSENDER__PARALLEL + "=false" + " --"
         + CliStrings.CREATE_GATEWAYSENDER__MANUALSTART + "=true" + " --"
@@ -295,7 +349,7 @@ public class CreateAndDestroyGatewaySenderCommandsDUnitTest extends WANCommandTe
         + CliStrings.CREATE_GATEWAYSENDER__ORDERPOLICY + "=THREAD";
     CommandResult cmdResult = executeCommandWithIgnoredExceptions(command);
     if (cmdResult != null) {
-      String strCmdResult = commandResultToString(cmdResult);
+      String strCmdResult = cmdResult.toString();
       getLogWriter()
           .info("testCreateDestroyGatewaySender_OnMember stringResult : " + strCmdResult + ">>>>");
       assertEquals(Result.Status.OK, cmdResult.getStatus());
@@ -308,25 +362,26 @@ public class CreateAndDestroyGatewaySenderCommandsDUnitTest extends WANCommandTe
     } else {
       fail("testCreateDestroyGatewaySender_OnMember failed as did not get CommandResult");
     }
-    vm3.invoke(() -> verifySenderState("ln", false, false));
-    vm3.invoke(() -> verifySenderAttributes("ln", 2, false, true, 1000, socketReadTimeout, true,
-        1000, 5000, true, false, 1000, 100, 2, OrderPolicy.THREAD, null, null));
-    doDestroyAndVerifyGatewaySender("ln", null, vm3Member,
-        "testCreateDestroyGatewaySender_OnMember", Arrays.asList(vm3), 1, false);
+
+    server1.invoke(() -> verifySenderState("ln", false, false));
+    server1.invoke(() -> verifySenderAttributes("ln", 2, false, true, 1000, socketReadTimeout, true,
+        1000, 5000, true, false, 1000, 100, 2, GatewaySender.OrderPolicy.THREAD, null, null));
+
+    doDestroyAndVerifyGatewaySender("ln", null, server1DM.getId(),
+        "testCreateDestroyGatewaySender_OnMember", Arrays.asList(server1), 1, false);
   }
 
   /**
    * GatewaySender with given attribute values on given group
    */
   @Test
-  public void testCreateDestroyGatewaySender_Group() {
-    Integer dsIdPort = vm1.invoke(() -> createFirstLocatorWithDSId(1));
-    propsSetUp(dsIdPort);
+  public void testCreateDestroyGatewaySender_Group() throws Exception {
+    Integer locator1Port = locatorSite1.getPort();
 
-    vm2.invoke(() -> createFirstRemoteLocator(2, dsIdPort));
-    vm3.invoke(() -> createCacheWithGroups(dsIdPort, "SenderGroup1"));
-    vm4.invoke(() -> createCacheWithGroups(dsIdPort, "SenderGroup1"));
-    vm5.invoke(() -> createCacheWithGroups(dsIdPort, "SenderGroup1"));
+    // setup servers in Site #1
+    server1 = startServerWithGroups(3, "SenderGroup1", locator1Port);
+    server2 = startServerWithGroups(4, "SenderGroup1", locator1Port);
+    server3 = startServerWithGroups(5, "SenderGroup1", locator1Port);
 
     int socketReadTimeout = GatewaySender.MINIMUM_SOCKET_READ_TIMEOUT + 1000;
     String command = CliStrings.CREATE_GATEWAYSENDER + " --" + CliStrings.CREATE_GATEWAYSENDER__ID
@@ -347,7 +402,7 @@ public class CreateAndDestroyGatewaySenderCommandsDUnitTest extends WANCommandTe
         + CliStrings.CREATE_GATEWAYSENDER__ORDERPOLICY + "=THREAD";
     CommandResult cmdResult = executeCommandWithIgnoredExceptions(command);
     if (cmdResult != null) {
-      String strCmdResult = commandResultToString(cmdResult);
+      String strCmdResult = cmdResult.toString();
       getLogWriter()
           .info("testCreateDestroyGatewaySender_Group stringResult : " + strCmdResult + ">>>>");
       assertEquals(Result.Status.OK, cmdResult.getStatus());
@@ -361,11 +416,13 @@ public class CreateAndDestroyGatewaySenderCommandsDUnitTest extends WANCommandTe
     } else {
       fail("testCreateDestroyGatewaySender_Group failed as did not get CommandResult");
     }
-    vm3.invoke(() -> verifySenderState("ln", true, false));
-    vm4.invoke(() -> verifySenderState("ln", true, false));
-    vm5.invoke(() -> verifySenderState("ln", true, false));
+
+    server1.invoke(() -> verifySenderState("ln", true, false));
+    server2.invoke(() -> verifySenderState("ln", true, false));
+    server3.invoke(() -> verifySenderState("ln", true, false));
+
     doDestroyAndVerifyGatewaySender("ln", "SenderGroup1", null,
-        "testCreateDestroyGatewaySender_Group", Arrays.asList(vm3, vm4, vm5), 3, false);
+        "testCreateDestroyGatewaySender_Group", Arrays.asList(server1, server2, server3), 3, false);
   }
 
   /**
@@ -373,14 +430,13 @@ public class CreateAndDestroyGatewaySenderCommandsDUnitTest extends WANCommandTe
    * group.
    */
   @Test
-  public void testCreateDestroyGatewaySender_Group_Scenario2() {
-    Integer dsIdPort = vm1.invoke(() -> createFirstLocatorWithDSId(1));
-    propsSetUp(dsIdPort);
+  public void testCreateDestroyGatewaySender_Group_Scenario2() throws Exception {
+    Integer locator1Port = locatorSite1.getPort();
 
-    vm2.invoke(() -> createFirstRemoteLocator(2, dsIdPort));
-    vm3.invoke(() -> createCacheWithGroups(dsIdPort, "SenderGroup1"));
-    vm4.invoke(() -> createCacheWithGroups(dsIdPort, "SenderGroup1"));
-    vm5.invoke(() -> createCacheWithGroups(dsIdPort, "SenderGroup2"));
+    // setup servers in Site #1
+    server1 = startServerWithGroups(3, "SenderGroup1", locator1Port);
+    server2 = startServerWithGroups(4, "SenderGroup1", locator1Port);
+    server3 = startServerWithGroups(5, "SenderGroup2", locator1Port);
 
     int socketReadTimeout = GatewaySender.MINIMUM_SOCKET_READ_TIMEOUT + 1000;
     String command = CliStrings.CREATE_GATEWAYSENDER + " --" + CliStrings.CREATE_GATEWAYSENDER__ID
@@ -401,7 +457,7 @@ public class CreateAndDestroyGatewaySenderCommandsDUnitTest extends WANCommandTe
         + CliStrings.CREATE_GATEWAYSENDER__ORDERPOLICY + "=THREAD";
     CommandResult cmdResult = executeCommandWithIgnoredExceptions(command);
     if (cmdResult != null) {
-      String strCmdResult = commandResultToString(cmdResult);
+      String strCmdResult = cmdResult.toString();
       getLogWriter().info(
           "testCreateDestroyGatewaySender_Group_Scenario2 stringResult : " + strCmdResult + ">>>>");
       assertEquals(Result.Status.OK, cmdResult.getStatus());
@@ -414,24 +470,26 @@ public class CreateAndDestroyGatewaySenderCommandsDUnitTest extends WANCommandTe
     } else {
       fail("testCreateDestroyGatewaySender_Group_Scenario2 failed as did not get CommandResult");
     }
-    vm3.invoke(() -> verifySenderState("ln", true, false));
-    vm4.invoke(() -> verifySenderState("ln", true, false));
+
+    server1.invoke(() -> verifySenderState("ln", true, false));
+    server2.invoke(() -> verifySenderState("ln", true, false));
+
     doDestroyAndVerifyGatewaySender("ln", "SenderGroup1", null,
-        "testCreateDestroyGatewaySender_Group_Scenario2", Arrays.asList(vm3, vm4), 2, false);
+        "testCreateDestroyGatewaySender_Group_Scenario2", Arrays.asList(server1, server2), 2,
+        false);
   }
 
   /**
    * + * Parallel GatewaySender with given attribute values +
    */
   @Test
-  public void testCreateDestroyParallelGatewaySender() {
-    Integer dsIdPort = vm1.invoke(() -> createFirstLocatorWithDSId(1));
-    propsSetUp(dsIdPort);
+  public void testCreateDestroyParallelGatewaySender() throws Exception {
+    Integer locator1Port = locatorSite1.getPort();
 
-    vm2.invoke(() -> createFirstRemoteLocator(2, dsIdPort));
-    vm3.invoke(() -> createCache(dsIdPort));
-    vm4.invoke(() -> createCache(dsIdPort));
-    vm5.invoke(() -> createCache(dsIdPort));
+    // setup servers in Site #1
+    server1 = locatorServerStartupRule.startServerVM(3, locator1Port);
+    server2 = locatorServerStartupRule.startServerVM(4, locator1Port);
+    server3 = locatorServerStartupRule.startServerVM(5, locator1Port);
 
     int socketReadTimeout = GatewaySender.MINIMUM_SOCKET_READ_TIMEOUT + 1000;
     String command = CliStrings.CREATE_GATEWAYSENDER + " --" + CliStrings.CREATE_GATEWAYSENDER__ID
@@ -449,63 +507,65 @@ public class CreateAndDestroyGatewaySenderCommandsDUnitTest extends WANCommandTe
         + CliStrings.CREATE_GATEWAYSENDER__ALERTTHRESHOLD + "=100";
     CommandResult cmdResult = executeCommandWithIgnoredExceptions(command);
     if (cmdResult != null) {
-      String strCmdResult = commandResultToString(cmdResult);
+      String strCmdResult = cmdResult.toString();
       getLogWriter()
           .info("testCreateDestroyParallelGatewaySender stringResult : " + strCmdResult + ">>>>");
       assertEquals(Result.Status.OK, cmdResult.getStatus());
 
       TabularResultData resultData = (TabularResultData) cmdResult.getResultData();
       List<String> status = resultData.retrieveAllValues("Status");
-      assertEquals(5, status.size());
+      assertEquals(3, status.size());
       for (String stat : status) {
         assertTrue("GatewaySender creation failed with: " + stat, !stat.contains("ERROR:"));
       }
     } else {
       fail("testCreateDestroyParallelGatewaySender failed as did not get CommandResult");
     }
-    vm3.invoke(() -> verifySenderState("ln", false, false));
-    vm4.invoke(() -> verifySenderState("ln", false, false));
-    vm5.invoke(() -> verifySenderState("ln", false, false));
-    vm3.invoke(
+
+    server1.invoke(() -> verifySenderState("ln", false, false));
+    server2.invoke(() -> verifySenderState("ln", false, false));
+    server3.invoke(() -> verifySenderState("ln", false, false));
+
+    server1.invoke(
         () -> verifySenderAttributes("ln", 2, true, true, 1000, socketReadTimeout, true, 1000, 5000,
             true, false, 1000, 100, GatewaySender.DEFAULT_DISPATCHER_THREADS, null, null, null));
-    vm4.invoke(
+    server2.invoke(
         () -> verifySenderAttributes("ln", 2, true, true, 1000, socketReadTimeout, true, 1000, 5000,
             true, false, 1000, 100, GatewaySender.DEFAULT_DISPATCHER_THREADS, null, null, null));
-    vm5.invoke(
+    server3.invoke(
         () -> verifySenderAttributes("ln", 2, true, true, 1000, socketReadTimeout, true, 1000, 5000,
             true, false, 1000, 100, GatewaySender.DEFAULT_DISPATCHER_THREADS, null, null, null));
+
     doDestroyAndVerifyGatewaySender("ln", null, null, "testCreateDestroyParallelGatewaySender",
-        Arrays.asList(vm3, vm4), 5, true);
+        Arrays.asList(server1, server2), 3, true);
   }
 
   /**
    * doDestroyAndVerifyGatewaySender helper command.
    *
-   * @param id if of the Gateway Sender
+   * @param id id of the Gateway Sender
    * @param group Group for the GatewaySender
-   * @param member Distributed Member for memeber id.
+   * @param DMId String representing DistributedMember id
    * @param testName testName for the logging
    * @param vms list of vms where to verify the destroyed gateway sender
    * @param size command result.
    * @param isParallel true if parallel , false otherwise.
    */
   private void doDestroyAndVerifyGatewaySender(final String id, final String group,
-      final DistributedMember member, final String testName, final List<VM> vms, final int size,
-      final boolean isParallel) {
+      final String DMId, final String testName, final List<MemberVM> vms, final int size,
+      final boolean isParallel) throws Exception {
     String command =
         CliStrings.DESTROY_GATEWAYSENDER + " --" + CliStrings.DESTROY_GATEWAYSENDER__ID + "=" + id;
     if (group != null) {
       command += " --" + CliStrings.GROUP + "=" + group;
     }
-    if (member != null) {
-      command += " --" + CliStrings.MEMBER + "=" + member.getId();
+    if (DMId != null) {
+      command += " --" + CliStrings.MEMBER + "=" + DMId;
     }
     final CommandResult cmdResult = executeCommandWithIgnoredExceptions(command);
     if (cmdResult != null) {
-      String strCmdResult = commandResultToString(cmdResult);
+      String strCmdResult = cmdResult.toString();
       getLogWriter().info(testName + " stringResult : " + strCmdResult + ">>>>");
-      assertEquals(Result.Status.OK, cmdResult.getStatus());
 
       TabularResultData resultData = (TabularResultData) cmdResult.getResultData();
       List<String> status = resultData.retrieveAllValues("Status");
@@ -516,17 +576,23 @@ public class CreateAndDestroyGatewaySenderCommandsDUnitTest extends WANCommandTe
     } else {
       fail(testName + " failed as did not get CommandResult");
     }
-    for (VM vm : vms) {
+    for (MemberVM vm : vms) {
       vm.invoke(() -> verifySenderDestroyed(id, isParallel));
     }
   }
 
-  private CommandResult executeCommandWithIgnoredExceptions(String command) {
+  private CommandResult executeCommandWithIgnoredExceptions(String command) throws Exception {
     final IgnoredException ignored = IgnoredException.addIgnoredException("Could not connect");
     try {
-      return executeCommand(command);
+      return gfsh.executeCommand(command);
     } finally {
       ignored.remove();
     }
   }
+
+  private MemberVM startServerWithGroups(int index, String groups, int locPort) throws Exception {
+    Properties props = new Properties();
+    props.setProperty(GROUPS, groups);
+    return locatorServerStartupRule.startServerVM(index, props, locPort);
+  }
 }
diff --git a/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/wancommand/CreateGatewayReceiverCommandDUnitTest.java b/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/wancommand/CreateGatewayReceiverCommandDUnitTest.java
index 27da5da..fdd7109 100644
--- a/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/wancommand/CreateGatewayReceiverCommandDUnitTest.java
+++ b/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/wancommand/CreateGatewayReceiverCommandDUnitTest.java
@@ -14,6 +14,16 @@
  */
 package org.apache.geode.internal.cache.wan.wancommand;
 
+import static org.apache.geode.distributed.ConfigurationProperties.BIND_ADDRESS;
+import static org.apache.geode.distributed.ConfigurationProperties.DISTRIBUTED_SYSTEM_ID;
+import static org.apache.geode.distributed.ConfigurationProperties.GROUPS;
+import static org.apache.geode.distributed.ConfigurationProperties.REMOTE_LOCATORS;
+import static org.apache.geode.distributed.ConfigurationProperties.SERVER_BIND_ADDRESS;
+import static org.apache.geode.internal.cache.wan.wancommand.WANCommandUtils.getMemberIdCallable;
+import static org.apache.geode.internal.cache.wan.wancommand.WANCommandUtils.verifyGatewayReceiverProfile;
+import static org.apache.geode.internal.cache.wan.wancommand.WANCommandUtils.verifyGatewayReceiverServerLocations;
+import static org.apache.geode.internal.cache.wan.wancommand.WANCommandUtils.verifyReceiverCreationWithAttributes;
+import static org.apache.geode.management.internal.cli.i18n.CliStrings.GROUP;
 import static org.apache.geode.test.dunit.Assert.assertEquals;
 import static org.apache.geode.test.dunit.Assert.assertTrue;
 import static org.apache.geode.test.dunit.Assert.fail;
@@ -22,8 +32,14 @@ import static org.apache.geode.test.dunit.LogWriterUtils.getLogWriter;
 import java.net.InetAddress;
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Properties;
 
 import org.apache.geode.internal.net.SocketCreator;
+import org.apache.geode.test.dunit.rules.LocatorServerStartupRule;
+import org.apache.geode.test.dunit.rules.MemberVM;
+import org.apache.geode.test.junit.rules.GfshShellConnectionRule;
+import org.junit.Before;
+import org.junit.Rule;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
@@ -33,60 +49,82 @@ import org.apache.geode.management.cli.Result;
 import org.apache.geode.management.internal.cli.i18n.CliStrings;
 import org.apache.geode.management.internal.cli.result.CommandResult;
 import org.apache.geode.management.internal.cli.result.TabularResultData;
-import org.apache.geode.test.dunit.Host;
-import org.apache.geode.test.dunit.VM;
 import org.apache.geode.test.junit.categories.DistributedTest;
-import org.apache.geode.test.junit.categories.FlakyTest;
 
 /**
  * DUnit tests for 'create gateway-receiver' command.
  */
 @Category(DistributedTest.class)
-public class CreateGatewayReceiverCommandDUnitTest extends WANCommandTestBase {
+public class CreateGatewayReceiverCommandDUnitTest {
 
   private static final long serialVersionUID = 1L;
 
+  @Rule
+  public LocatorServerStartupRule locatorServerStartupRule = new LocatorServerStartupRule();
+
+  @Rule
+  public GfshShellConnectionRule gfsh = new GfshShellConnectionRule();
+
+  private MemberVM locatorSite1;
+  private MemberVM locatorSite2;
+  private MemberVM server1;
+  private MemberVM server2;
+  private MemberVM server3;
+
+  @Before
+  public void before() throws Exception {
+    Properties props = new Properties();
+    props.setProperty(DISTRIBUTED_SYSTEM_ID, "" + 1);
+    locatorSite1 = locatorServerStartupRule.startLocatorVM(1, props);
+
+    props.setProperty(DISTRIBUTED_SYSTEM_ID, "" + 2);
+    props.setProperty(REMOTE_LOCATORS, "localhost[" + locatorSite1.getPort() + "]");
+    locatorSite2 = locatorServerStartupRule.startLocatorVM(2, props);
+
+    // Connect Gfsh to locator.
+    gfsh.connectAndVerify(locatorSite1);
+  }
+
   /**
    * GatewayReceiver with all default attributes
    */
   @Test
   public void testCreateGatewayReceiverWithDefault() throws Exception {
-    VM puneLocator = Host.getLocator();
-    int dsIdPort = puneLocator.invoke(this::getLocatorPort);
-    propsSetUp(dsIdPort);
-    vm2.invoke(() -> createFirstRemoteLocator(2, dsIdPort));
 
-    vm3.invoke(() -> createCache(dsIdPort));
-    vm4.invoke(() -> createCache(dsIdPort));
-    vm5.invoke(() -> createCache(dsIdPort));
+    Integer locator1Port = locatorSite1.getPort();
+
+    // setup servers in Site #1
+    server1 = locatorServerStartupRule.startServerVM(3, locator1Port);
+    server2 = locatorServerStartupRule.startServerVM(4, locator1Port);
+    server3 = locatorServerStartupRule.startServerVM(5, locator1Port);
 
     String command = CliStrings.CREATE_GATEWAYRECEIVER;
-    executeCommandAndVerifyStatus(command, 4);
+    executeCommandAndVerifyStatus(command, 3);
 
     // if neither bind-address or hostname-for-senders is set, profile
     // uses AcceptorImpl.getExternalAddress() to derive canonical hostname
     // when the Profile (and ServerLocation) are created
     String hostname = getHostName();
 
-    vm3.invoke(() -> verifyGatewayReceiverProfile(hostname));
-    vm4.invoke(() -> verifyGatewayReceiverProfile(hostname));
-    vm5.invoke(() -> verifyGatewayReceiverProfile(hostname));
+    server1.invoke(() -> verifyGatewayReceiverProfile(hostname));
+    server2.invoke(() -> verifyGatewayReceiverProfile(hostname));
+    server3.invoke(() -> verifyGatewayReceiverProfile(hostname));
 
-    vm3.invoke(() -> verifyGatewayReceiverServerLocations(dsIdPort, hostname));
-    vm4.invoke(() -> verifyGatewayReceiverServerLocations(dsIdPort, hostname));
-    vm5.invoke(() -> verifyGatewayReceiverServerLocations(dsIdPort, hostname));
+    server1.invoke(() -> verifyGatewayReceiverServerLocations(locator1Port, hostname));
+    server2.invoke(() -> verifyGatewayReceiverServerLocations(locator1Port, hostname));
+    server3.invoke(() -> verifyGatewayReceiverServerLocations(locator1Port, hostname));
 
-    vm3.invoke(() -> verifyReceiverCreationWithAttributes(!GatewayReceiver.DEFAULT_MANUAL_START,
+    server1.invoke(() -> verifyReceiverCreationWithAttributes(!GatewayReceiver.DEFAULT_MANUAL_START,
         GatewayReceiver.DEFAULT_START_PORT, GatewayReceiver.DEFAULT_END_PORT,
         GatewayReceiver.DEFAULT_BIND_ADDRESS, GatewayReceiver.DEFAULT_MAXIMUM_TIME_BETWEEN_PINGS,
         GatewayReceiver.DEFAULT_SOCKET_BUFFER_SIZE, null,
         GatewayReceiver.DEFAULT_HOSTNAME_FOR_SENDERS));
-    vm4.invoke(() -> verifyReceiverCreationWithAttributes(!GatewayReceiver.DEFAULT_MANUAL_START,
+    server2.invoke(() -> verifyReceiverCreationWithAttributes(!GatewayReceiver.DEFAULT_MANUAL_START,
         GatewayReceiver.DEFAULT_START_PORT, GatewayReceiver.DEFAULT_END_PORT,
         GatewayReceiver.DEFAULT_BIND_ADDRESS, GatewayReceiver.DEFAULT_MAXIMUM_TIME_BETWEEN_PINGS,
         GatewayReceiver.DEFAULT_SOCKET_BUFFER_SIZE, null,
         GatewayReceiver.DEFAULT_HOSTNAME_FOR_SENDERS));
-    vm5.invoke(() -> verifyReceiverCreationWithAttributes(!GatewayReceiver.DEFAULT_MANUAL_START,
+    server3.invoke(() -> verifyReceiverCreationWithAttributes(!GatewayReceiver.DEFAULT_MANUAL_START,
         GatewayReceiver.DEFAULT_START_PORT, GatewayReceiver.DEFAULT_END_PORT,
         GatewayReceiver.DEFAULT_BIND_ADDRESS, GatewayReceiver.DEFAULT_MAXIMUM_TIME_BETWEEN_PINGS,
         GatewayReceiver.DEFAULT_SOCKET_BUFFER_SIZE, null,
@@ -102,16 +140,14 @@ public class CreateGatewayReceiverCommandDUnitTest extends WANCommandTestBase {
   }
 
   private void executeCommandAndVerifyStatus(String command, int numGatewayReceivers) {
-    CommandResult cmdResult = executeCommand(command);
+    CommandResult cmdResult = gfsh.executeCommand(command);
     if (cmdResult != null) {
-      String strCmdResult = commandResultToString(cmdResult);
+      String strCmdResult = cmdResult.toString();
       getLogWriter().info("testCreateGatewayReceiver stringResult : " + strCmdResult + ">>>>");
       assertEquals(Result.Status.OK, cmdResult.getStatus());
 
       TabularResultData resultData = (TabularResultData) cmdResult.getResultData();
       List<String> status = resultData.retrieveAllValues("Status");
-      // expected size of 4 includes the manager node when we don't set the receiver groups to
-      // ignore it)
       assertEquals(numGatewayReceivers, status.size());
       // verify there is no error in the status
       for (String stat : status) {
@@ -126,15 +162,14 @@ public class CreateGatewayReceiverCommandDUnitTest extends WANCommandTestBase {
    * GatewayReceiver with given attributes
    */
   @Test
-  public void testCreateGatewayReceiver() {
-    VM puneLocator = Host.getLocator();
-    int dsIdPort = puneLocator.invoke(this::getLocatorPort);
-    propsSetUp(dsIdPort);
-    vm2.invoke(() -> createFirstRemoteLocator(2, dsIdPort));
+  public void testCreateGatewayReceiver() throws Exception {
 
-    vm3.invoke(() -> createCache(dsIdPort));
-    vm4.invoke(() -> createCache(dsIdPort));
-    vm5.invoke(() -> createCache(dsIdPort));
+    Integer locator1Port = locatorSite1.getPort();
+
+    // setup servers in Site #1
+    server1 = locatorServerStartupRule.startServerVM(3, locator1Port);
+    server2 = locatorServerStartupRule.startServerVM(4, locator1Port);
+    server3 = locatorServerStartupRule.startServerVM(5, locator1Port);
 
     String command =
         CliStrings.CREATE_GATEWAYRECEIVER + " --" + CliStrings.CREATE_GATEWAYRECEIVER__MANUALSTART
@@ -143,16 +178,16 @@ public class CreateGatewayReceiverCommandDUnitTest extends WANCommandTestBase {
             + CliStrings.CREATE_GATEWAYRECEIVER__ENDPORT + "=11000" + " --"
             + CliStrings.CREATE_GATEWAYRECEIVER__MAXTIMEBETWEENPINGS + "=100000" + " --"
             + CliStrings.CREATE_GATEWAYRECEIVER__SOCKETBUFFERSIZE + "=512000";
-    executeCommandAndVerifyStatus(command, 4);
+    executeCommandAndVerifyStatus(command, 3);
 
     // cannot verify Profile/ServerLocation when manualStart is true
 
-    vm3.invoke(() -> verifyReceiverCreationWithAttributes(false, 10000, 11000, "localhost", 100000,
-        512000, null, GatewayReceiver.DEFAULT_HOSTNAME_FOR_SENDERS));
-    vm4.invoke(() -> verifyReceiverCreationWithAttributes(false, 10000, 11000, "localhost", 100000,
-        512000, null, GatewayReceiver.DEFAULT_HOSTNAME_FOR_SENDERS));
-    vm5.invoke(() -> verifyReceiverCreationWithAttributes(false, 10000, 11000, "localhost", 100000,
-        512000, null, GatewayReceiver.DEFAULT_HOSTNAME_FOR_SENDERS));
+    server1.invoke(() -> verifyReceiverCreationWithAttributes(false, 10000, 11000, "localhost",
+        100000, 512000, null, GatewayReceiver.DEFAULT_HOSTNAME_FOR_SENDERS));
+    server2.invoke(() -> verifyReceiverCreationWithAttributes(false, 10000, 11000, "localhost",
+        100000, 512000, null, GatewayReceiver.DEFAULT_HOSTNAME_FOR_SENDERS));
+    server3.invoke(() -> verifyReceiverCreationWithAttributes(false, 10000, 11000, "localhost",
+        100000, 512000, null, GatewayReceiver.DEFAULT_HOSTNAME_FOR_SENDERS));
   }
 
   /**
@@ -160,14 +195,13 @@ public class CreateGatewayReceiverCommandDUnitTest extends WANCommandTestBase {
    */
   @Test
   public void testCreateGatewayReceiverWithHostnameForSenders() throws Exception {
-    VM puneLocator = Host.getLocator();
-    int dsIdPort = puneLocator.invoke(this::getLocatorPort);
-    propsSetUp(dsIdPort);
-    vm2.invoke(() -> createFirstRemoteLocator(2, dsIdPort));
 
-    vm3.invoke(() -> createCache(dsIdPort));
-    vm4.invoke(() -> createCache(dsIdPort));
-    vm5.invoke(() -> createCache(dsIdPort));
+    Integer locator1Port = locatorSite1.getPort();
+
+    // setup servers in Site #1
+    server1 = locatorServerStartupRule.startServerVM(3, locator1Port);
+    server2 = locatorServerStartupRule.startServerVM(4, locator1Port);
+    server3 = locatorServerStartupRule.startServerVM(5, locator1Port);
 
     String hostnameForSenders = getHostName();
     String command =
@@ -177,23 +211,23 @@ public class CreateGatewayReceiverCommandDUnitTest extends WANCommandTestBase {
             + " --" + CliStrings.CREATE_GATEWAYRECEIVER__ENDPORT + "=11000" + " --"
             + CliStrings.CREATE_GATEWAYRECEIVER__MAXTIMEBETWEENPINGS + "=100000" + " --"
             + CliStrings.CREATE_GATEWAYRECEIVER__SOCKETBUFFERSIZE + "=512000";
-    executeCommandAndVerifyStatus(command, 4);
+    executeCommandAndVerifyStatus(command, 3);
 
     // verify hostname-for-senders is used when configured
-    vm3.invoke(() -> verifyGatewayReceiverProfile(hostnameForSenders));
-    vm4.invoke(() -> verifyGatewayReceiverProfile(hostnameForSenders));
-    vm5.invoke(() -> verifyGatewayReceiverProfile(hostnameForSenders));
-
-    vm3.invoke(() -> verifyGatewayReceiverServerLocations(dsIdPort, hostnameForSenders));
-    vm4.invoke(() -> verifyGatewayReceiverServerLocations(dsIdPort, hostnameForSenders));
-    vm5.invoke(() -> verifyGatewayReceiverServerLocations(dsIdPort, hostnameForSenders));
-
-    vm3.invoke(() -> verifyReceiverCreationWithAttributes(true, 10000, 11000, "", 100000, 512000,
-        null, hostnameForSenders));
-    vm4.invoke(() -> verifyReceiverCreationWithAttributes(true, 10000, 11000, "", 100000, 512000,
-        null, hostnameForSenders));
-    vm5.invoke(() -> verifyReceiverCreationWithAttributes(true, 10000, 11000, "", 100000, 512000,
-        null, hostnameForSenders));
+    server1.invoke(() -> verifyGatewayReceiverProfile(hostnameForSenders));
+    server2.invoke(() -> verifyGatewayReceiverProfile(hostnameForSenders));
+    server3.invoke(() -> verifyGatewayReceiverProfile(hostnameForSenders));
+
+    server1.invoke(() -> verifyGatewayReceiverServerLocations(locator1Port, hostnameForSenders));
+    server2.invoke(() -> verifyGatewayReceiverServerLocations(locator1Port, hostnameForSenders));
+    server3.invoke(() -> verifyGatewayReceiverServerLocations(locator1Port, hostnameForSenders));
+
+    server1.invoke(() -> verifyReceiverCreationWithAttributes(true, 10000, 11000, "", 100000,
+        512000, null, hostnameForSenders));
+    server2.invoke(() -> verifyReceiverCreationWithAttributes(true, 10000, 11000, "", 100000,
+        512000, null, hostnameForSenders));
+    server3.invoke(() -> verifyReceiverCreationWithAttributes(true, 10000, 11000, "", 100000,
+        512000, null, hostnameForSenders));
   }
 
   /**
@@ -201,42 +235,44 @@ public class CreateGatewayReceiverCommandDUnitTest extends WANCommandTestBase {
    */
   @Test
   public void testCreateGatewayReceiverWithDefaultAndBindProperty() throws Exception {
-    VM puneLocator = Host.getLocator();
-    int dsIdPort = puneLocator.invoke(this::getLocatorPort);
-    propsSetUp(dsIdPort);
-    vm2.invoke(() -> createFirstRemoteLocator(2, dsIdPort));
 
-    String expectedBindAddress = getBindAddress();
+    Integer locator1Port = locatorSite1.getPort();
 
+    // setup servers in Site #1
+    String expectedBindAddress = getBindAddress();
     String receiverGroup = "receiverGroup";
-    vm3.invoke(() -> createCacheWithBindAddress(dsIdPort, expectedBindAddress, receiverGroup));
-    vm4.invoke(() -> createCacheWithBindAddress(dsIdPort, expectedBindAddress, receiverGroup));
-    vm5.invoke(() -> createCacheWithBindAddress(dsIdPort, expectedBindAddress, receiverGroup));
 
-    String command =
-        CliStrings.CREATE_GATEWAYRECEIVER + " --" + CliStrings.GROUP + "=" + receiverGroup;
+    Properties props = new Properties();
+    props.setProperty(BIND_ADDRESS, expectedBindAddress);
+    props.setProperty(GROUPS, receiverGroup);
+
+    server1 = locatorServerStartupRule.startServerVM(3, props, locator1Port);
+    server2 = locatorServerStartupRule.startServerVM(4, props, locator1Port);
+    server3 = locatorServerStartupRule.startServerVM(5, props, locator1Port);
+
+    String command = CliStrings.CREATE_GATEWAYRECEIVER + " --" + GROUP + "=" + receiverGroup;
     executeCommandAndVerifyStatus(command, 3);
 
     // verify bind-address used when provided as a gemfire property
-    vm3.invoke(() -> verifyGatewayReceiverProfile(expectedBindAddress));
-    vm4.invoke(() -> verifyGatewayReceiverProfile(expectedBindAddress));
-    vm5.invoke(() -> verifyGatewayReceiverProfile(expectedBindAddress));
+    server1.invoke(() -> verifyGatewayReceiverProfile(expectedBindAddress));
+    server2.invoke(() -> verifyGatewayReceiverProfile(expectedBindAddress));
+    server3.invoke(() -> verifyGatewayReceiverProfile(expectedBindAddress));
 
-    vm3.invoke(() -> verifyGatewayReceiverServerLocations(dsIdPort, expectedBindAddress));
-    vm4.invoke(() -> verifyGatewayReceiverServerLocations(dsIdPort, expectedBindAddress));
-    vm5.invoke(() -> verifyGatewayReceiverServerLocations(dsIdPort, expectedBindAddress));
+    server1.invoke(() -> verifyGatewayReceiverServerLocations(locator1Port, expectedBindAddress));
+    server2.invoke(() -> verifyGatewayReceiverServerLocations(locator1Port, expectedBindAddress));
+    server3.invoke(() -> verifyGatewayReceiverServerLocations(locator1Port, expectedBindAddress));
 
-    vm3.invoke(() -> verifyReceiverCreationWithAttributes(!GatewayReceiver.DEFAULT_MANUAL_START,
+    server1.invoke(() -> verifyReceiverCreationWithAttributes(!GatewayReceiver.DEFAULT_MANUAL_START,
         GatewayReceiver.DEFAULT_START_PORT, GatewayReceiver.DEFAULT_END_PORT,
         GatewayReceiver.DEFAULT_BIND_ADDRESS, GatewayReceiver.DEFAULT_MAXIMUM_TIME_BETWEEN_PINGS,
         GatewayReceiver.DEFAULT_SOCKET_BUFFER_SIZE, null,
         GatewayReceiver.DEFAULT_HOSTNAME_FOR_SENDERS));
-    vm4.invoke(() -> verifyReceiverCreationWithAttributes(!GatewayReceiver.DEFAULT_MANUAL_START,
+    server2.invoke(() -> verifyReceiverCreationWithAttributes(!GatewayReceiver.DEFAULT_MANUAL_START,
         GatewayReceiver.DEFAULT_START_PORT, GatewayReceiver.DEFAULT_END_PORT,
         GatewayReceiver.DEFAULT_BIND_ADDRESS, GatewayReceiver.DEFAULT_MAXIMUM_TIME_BETWEEN_PINGS,
         GatewayReceiver.DEFAULT_SOCKET_BUFFER_SIZE, null,
         GatewayReceiver.DEFAULT_HOSTNAME_FOR_SENDERS));
-    vm5.invoke(() -> verifyReceiverCreationWithAttributes(!GatewayReceiver.DEFAULT_MANUAL_START,
+    server3.invoke(() -> verifyReceiverCreationWithAttributes(!GatewayReceiver.DEFAULT_MANUAL_START,
         GatewayReceiver.DEFAULT_START_PORT, GatewayReceiver.DEFAULT_END_PORT,
         GatewayReceiver.DEFAULT_BIND_ADDRESS, GatewayReceiver.DEFAULT_MAXIMUM_TIME_BETWEEN_PINGS,
         GatewayReceiver.DEFAULT_SOCKET_BUFFER_SIZE, null,
@@ -248,45 +284,44 @@ public class CreateGatewayReceiverCommandDUnitTest extends WANCommandTestBase {
    */
   @Test
   public void testCreateGatewayReceiverWithDefaultsAndServerBindAddressProperty() throws Exception {
-    VM puneLocator = Host.getLocator();
-    int dsIdPort = puneLocator.invoke(this::getLocatorPort);
-    propsSetUp(dsIdPort);
-    vm2.invoke(() -> createFirstRemoteLocator(2, dsIdPort));
 
-    String expectedBindAddress = getBindAddress();
+    Integer locator1Port = locatorSite1.getPort();
 
+    // setup servers in Site #1
+    String expectedBindAddress = getBindAddress();
     String receiverGroup = "receiverGroup";
-    vm3.invoke(
-        () -> createCacheWithServerBindAddress(dsIdPort, expectedBindAddress, receiverGroup));
-    vm4.invoke(
-        () -> createCacheWithServerBindAddress(dsIdPort, expectedBindAddress, receiverGroup));
-    vm5.invoke(
-        () -> createCacheWithServerBindAddress(dsIdPort, expectedBindAddress, receiverGroup));
 
-    String command =
-        CliStrings.CREATE_GATEWAYRECEIVER + " --" + CliStrings.GROUP + "=" + receiverGroup;
+    Properties props = new Properties();
+    props.setProperty(SERVER_BIND_ADDRESS, expectedBindAddress);
+    props.setProperty(GROUPS, receiverGroup);
+
+    server1 = locatorServerStartupRule.startServerVM(3, props, locator1Port);
+    server2 = locatorServerStartupRule.startServerVM(4, props, locator1Port);
+    server3 = locatorServerStartupRule.startServerVM(5, props, locator1Port);
+
+    String command = CliStrings.CREATE_GATEWAYRECEIVER + " --" + GROUP + "=" + receiverGroup;
     executeCommandAndVerifyStatus(command, 3);
 
     // verify server-bind-address used if provided as a gemfire property
-    vm3.invoke(() -> verifyGatewayReceiverProfile(expectedBindAddress));
-    vm4.invoke(() -> verifyGatewayReceiverProfile(expectedBindAddress));
-    vm5.invoke(() -> verifyGatewayReceiverProfile(expectedBindAddress));
+    server1.invoke(() -> verifyGatewayReceiverProfile(expectedBindAddress));
+    server2.invoke(() -> verifyGatewayReceiverProfile(expectedBindAddress));
+    server3.invoke(() -> verifyGatewayReceiverProfile(expectedBindAddress));
 
-    vm3.invoke(() -> verifyGatewayReceiverServerLocations(dsIdPort, expectedBindAddress));
-    vm4.invoke(() -> verifyGatewayReceiverServerLocations(dsIdPort, expectedBindAddress));
-    vm5.invoke(() -> verifyGatewayReceiverServerLocations(dsIdPort, expectedBindAddress));
+    server1.invoke(() -> verifyGatewayReceiverServerLocations(locator1Port, expectedBindAddress));
+    server2.invoke(() -> verifyGatewayReceiverServerLocations(locator1Port, expectedBindAddress));
+    server3.invoke(() -> verifyGatewayReceiverServerLocations(locator1Port, expectedBindAddress));
 
-    vm3.invoke(() -> verifyReceiverCreationWithAttributes(!GatewayReceiver.DEFAULT_MANUAL_START,
+    server1.invoke(() -> verifyReceiverCreationWithAttributes(!GatewayReceiver.DEFAULT_MANUAL_START,
         GatewayReceiver.DEFAULT_START_PORT, GatewayReceiver.DEFAULT_END_PORT,
         GatewayReceiver.DEFAULT_BIND_ADDRESS, GatewayReceiver.DEFAULT_MAXIMUM_TIME_BETWEEN_PINGS,
         GatewayReceiver.DEFAULT_SOCKET_BUFFER_SIZE, null,
         GatewayReceiver.DEFAULT_HOSTNAME_FOR_SENDERS));
-    vm4.invoke(() -> verifyReceiverCreationWithAttributes(!GatewayReceiver.DEFAULT_MANUAL_START,
+    server2.invoke(() -> verifyReceiverCreationWithAttributes(!GatewayReceiver.DEFAULT_MANUAL_START,
         GatewayReceiver.DEFAULT_START_PORT, GatewayReceiver.DEFAULT_END_PORT,
         GatewayReceiver.DEFAULT_BIND_ADDRESS, GatewayReceiver.DEFAULT_MAXIMUM_TIME_BETWEEN_PINGS,
         GatewayReceiver.DEFAULT_SOCKET_BUFFER_SIZE, null,
         GatewayReceiver.DEFAULT_HOSTNAME_FOR_SENDERS));
-    vm5.invoke(() -> verifyReceiverCreationWithAttributes(!GatewayReceiver.DEFAULT_MANUAL_START,
+    server3.invoke(() -> verifyReceiverCreationWithAttributes(!GatewayReceiver.DEFAULT_MANUAL_START,
         GatewayReceiver.DEFAULT_START_PORT, GatewayReceiver.DEFAULT_END_PORT,
         GatewayReceiver.DEFAULT_BIND_ADDRESS, GatewayReceiver.DEFAULT_MAXIMUM_TIME_BETWEEN_PINGS,
         GatewayReceiver.DEFAULT_SOCKET_BUFFER_SIZE, null,
@@ -299,46 +334,46 @@ public class CreateGatewayReceiverCommandDUnitTest extends WANCommandTestBase {
   @Test
   public void testCreateGatewayReceiverWithDefaultsAndMultipleBindAddressProperties()
       throws Exception {
-    VM puneLocator = Host.getLocator();
-    int dsIdPort = puneLocator.invoke(this::getLocatorPort);
-    propsSetUp(dsIdPort);
-    vm2.invoke(() -> createFirstRemoteLocator(2, dsIdPort));
 
+    Integer locator1Port = locatorSite1.getPort();
+
+    // setup servers in Site #1
     String extraBindAddress = "localhost";
     String expectedBindAddress = getBindAddress();
     String receiverGroup = "receiverGroup";
 
-    vm3.invoke(() -> createCacheWithMultipleBindAddressProperties(dsIdPort, extraBindAddress,
-        expectedBindAddress, receiverGroup));
-    vm4.invoke(() -> createCacheWithMultipleBindAddressProperties(dsIdPort, extraBindAddress,
-        expectedBindAddress, receiverGroup));
-    vm5.invoke(() -> createCacheWithMultipleBindAddressProperties(dsIdPort, extraBindAddress,
-        expectedBindAddress, receiverGroup));
+    Properties props = new Properties();
+    props.setProperty(BIND_ADDRESS, extraBindAddress);
+    props.setProperty(SERVER_BIND_ADDRESS, expectedBindAddress);
+    props.setProperty(GROUPS, receiverGroup);
 
-    String command =
-        CliStrings.CREATE_GATEWAYRECEIVER + " --" + CliStrings.GROUP + "=" + receiverGroup;
+    server1 = locatorServerStartupRule.startServerVM(3, props, locator1Port);
+    server2 = locatorServerStartupRule.startServerVM(4, props, locator1Port);
+    server3 = locatorServerStartupRule.startServerVM(5, props, locator1Port);
+
+    String command = CliStrings.CREATE_GATEWAYRECEIVER + " --" + GROUP + "=" + receiverGroup;
     executeCommandAndVerifyStatus(command, 3);
 
     // verify server-bind-address used if provided as a gemfire property
-    vm3.invoke(() -> verifyGatewayReceiverProfile(expectedBindAddress));
-    vm4.invoke(() -> verifyGatewayReceiverProfile(expectedBindAddress));
-    vm5.invoke(() -> verifyGatewayReceiverProfile(expectedBindAddress));
+    server1.invoke(() -> verifyGatewayReceiverProfile(expectedBindAddress));
+    server2.invoke(() -> verifyGatewayReceiverProfile(expectedBindAddress));
+    server3.invoke(() -> verifyGatewayReceiverProfile(expectedBindAddress));
 
-    vm3.invoke(() -> verifyGatewayReceiverServerLocations(dsIdPort, expectedBindAddress));
-    vm4.invoke(() -> verifyGatewayReceiverServerLocations(dsIdPort, expectedBindAddress));
-    vm5.invoke(() -> verifyGatewayReceiverServerLocations(dsIdPort, expectedBindAddress));
+    server1.invoke(() -> verifyGatewayReceiverServerLocations(locator1Port, expectedBindAddress));
+    server2.invoke(() -> verifyGatewayReceiverServerLocations(locator1Port, expectedBindAddress));
+    server3.invoke(() -> verifyGatewayReceiverServerLocations(locator1Port, expectedBindAddress));
 
-    vm3.invoke(() -> verifyReceiverCreationWithAttributes(!GatewayReceiver.DEFAULT_MANUAL_START,
+    server1.invoke(() -> verifyReceiverCreationWithAttributes(!GatewayReceiver.DEFAULT_MANUAL_START,
         GatewayReceiver.DEFAULT_START_PORT, GatewayReceiver.DEFAULT_END_PORT,
         GatewayReceiver.DEFAULT_BIND_ADDRESS, GatewayReceiver.DEFAULT_MAXIMUM_TIME_BETWEEN_PINGS,
         GatewayReceiver.DEFAULT_SOCKET_BUFFER_SIZE, null,
         GatewayReceiver.DEFAULT_HOSTNAME_FOR_SENDERS));
-    vm4.invoke(() -> verifyReceiverCreationWithAttributes(!GatewayReceiver.DEFAULT_MANUAL_START,
+    server2.invoke(() -> verifyReceiverCreationWithAttributes(!GatewayReceiver.DEFAULT_MANUAL_START,
         GatewayReceiver.DEFAULT_START_PORT, GatewayReceiver.DEFAULT_END_PORT,
         GatewayReceiver.DEFAULT_BIND_ADDRESS, GatewayReceiver.DEFAULT_MAXIMUM_TIME_BETWEEN_PINGS,
         GatewayReceiver.DEFAULT_SOCKET_BUFFER_SIZE, null,
         GatewayReceiver.DEFAULT_HOSTNAME_FOR_SENDERS));
-    vm5.invoke(() -> verifyReceiverCreationWithAttributes(!GatewayReceiver.DEFAULT_MANUAL_START,
+    server3.invoke(() -> verifyReceiverCreationWithAttributes(!GatewayReceiver.DEFAULT_MANUAL_START,
         GatewayReceiver.DEFAULT_START_PORT, GatewayReceiver.DEFAULT_END_PORT,
         GatewayReceiver.DEFAULT_BIND_ADDRESS, GatewayReceiver.DEFAULT_MAXIMUM_TIME_BETWEEN_PINGS,
         GatewayReceiver.DEFAULT_SOCKET_BUFFER_SIZE, null,
@@ -352,44 +387,46 @@ public class CreateGatewayReceiverCommandDUnitTest extends WANCommandTestBase {
   @Test
   public void testCreateGatewayReceiverWithHostnameForSendersAndServerBindAddressProperty()
       throws Exception {
-    VM puneLocator = Host.getLocator();
-    int dsIdPort = puneLocator.invoke(this::getLocatorPort);
-    propsSetUp(dsIdPort);
-    vm2.invoke(() -> createFirstRemoteLocator(2, dsIdPort));
 
-    String hostnameForSenders = getHostName();
-    String serverBindAddress = getBindAddress();
+    Integer locator1Port = locatorSite1.getPort();
 
+    // setup servers in Site #1
+    Properties props = new Properties();
+    String serverBindAddress = getBindAddress();
     String receiverGroup = "receiverGroup";
-    vm3.invoke(() -> createCacheWithServerBindAddress(dsIdPort, serverBindAddress, receiverGroup));
-    vm4.invoke(() -> createCacheWithServerBindAddress(dsIdPort, serverBindAddress, receiverGroup));
-    vm5.invoke(() -> createCacheWithServerBindAddress(dsIdPort, serverBindAddress, receiverGroup));
+    props.setProperty(SERVER_BIND_ADDRESS, serverBindAddress);
+    props.setProperty(GROUPS, receiverGroup);
 
+    server1 = locatorServerStartupRule.startServerVM(3, props, locator1Port);
+    server2 = locatorServerStartupRule.startServerVM(4, props, locator1Port);
+    server3 = locatorServerStartupRule.startServerVM(5, props, locator1Port);
+
+    String hostnameForSenders = getHostName();
     String command =
         CliStrings.CREATE_GATEWAYRECEIVER + " --" + CliStrings.CREATE_GATEWAYRECEIVER__MANUALSTART
             + "=false" + " --" + CliStrings.CREATE_GATEWAYRECEIVER__HOSTNAMEFORSENDERS + "="
             + hostnameForSenders + " --" + CliStrings.CREATE_GATEWAYRECEIVER__STARTPORT + "=10000"
             + " --" + CliStrings.CREATE_GATEWAYRECEIVER__ENDPORT + "=11000" + " --"
             + CliStrings.CREATE_GATEWAYRECEIVER__MAXTIMEBETWEENPINGS + "=100000" + " --"
-            + CliStrings.CREATE_GATEWAYRECEIVER__SOCKETBUFFERSIZE + "=512000" + " --"
-            + CliStrings.GROUP + "=" + receiverGroup;
+            + CliStrings.CREATE_GATEWAYRECEIVER__SOCKETBUFFERSIZE + "=512000" + " --" + GROUP + "="
+            + receiverGroup;
     executeCommandAndVerifyStatus(command, 3);
 
     // verify server-bind-address takes precedence over hostname-for-senders
-    vm3.invoke(() -> verifyGatewayReceiverProfile(hostnameForSenders));
-    vm4.invoke(() -> verifyGatewayReceiverProfile(hostnameForSenders));
-    vm5.invoke(() -> verifyGatewayReceiverProfile(hostnameForSenders));
-
-    vm3.invoke(() -> verifyGatewayReceiverServerLocations(dsIdPort, hostnameForSenders));
-    vm4.invoke(() -> verifyGatewayReceiverServerLocations(dsIdPort, hostnameForSenders));
-    vm5.invoke(() -> verifyGatewayReceiverServerLocations(dsIdPort, hostnameForSenders));
-
-    vm3.invoke(() -> verifyReceiverCreationWithAttributes(true, 10000, 11000, "", 100000, 512000,
-        null, hostnameForSenders));
-    vm4.invoke(() -> verifyReceiverCreationWithAttributes(true, 10000, 11000, "", 100000, 512000,
-        null, hostnameForSenders));
-    vm5.invoke(() -> verifyReceiverCreationWithAttributes(true, 10000, 11000, "", 100000, 512000,
-        null, hostnameForSenders));
+    server1.invoke(() -> verifyGatewayReceiverProfile(hostnameForSenders));
+    server2.invoke(() -> verifyGatewayReceiverProfile(hostnameForSenders));
+    server3.invoke(() -> verifyGatewayReceiverProfile(hostnameForSenders));
+
+    server1.invoke(() -> verifyGatewayReceiverServerLocations(locator1Port, hostnameForSenders));
+    server2.invoke(() -> verifyGatewayReceiverServerLocations(locator1Port, hostnameForSenders));
+    server3.invoke(() -> verifyGatewayReceiverServerLocations(locator1Port, hostnameForSenders));
+
+    server1.invoke(() -> verifyReceiverCreationWithAttributes(true, 10000, 11000, "", 100000,
+        512000, null, hostnameForSenders));
+    server2.invoke(() -> verifyReceiverCreationWithAttributes(true, 10000, 11000, "", 100000,
+        512000, null, hostnameForSenders));
+    server3.invoke(() -> verifyReceiverCreationWithAttributes(true, 10000, 11000, "", 100000,
+        512000, null, hostnameForSenders));
   }
 
   /**
@@ -398,58 +435,59 @@ public class CreateGatewayReceiverCommandDUnitTest extends WANCommandTestBase {
   @Test
   public void testCreateGatewayReceiverWithHostnameForSendersAndBindAddressProperty()
       throws Exception {
-    VM puneLocator = Host.getLocator();
-    int dsIdPort = puneLocator.invoke(this::getLocatorPort);
-    propsSetUp(dsIdPort);
-    vm2.invoke(() -> createFirstRemoteLocator(2, dsIdPort));
 
-    String hostnameForSenders = getHostName();
-    String expectedBindAddress = getBindAddress();
+    Integer locator1Port = locatorSite1.getPort();
 
+    // setup servers in Site #1
+    Properties props = new Properties();
+    String expectedBindAddress = getBindAddress();
     String receiverGroup = "receiverGroup";
-    vm3.invoke(() -> createCacheWithBindAddress(dsIdPort, expectedBindAddress, receiverGroup));
-    vm4.invoke(() -> createCacheWithBindAddress(dsIdPort, expectedBindAddress, receiverGroup));
-    vm5.invoke(() -> createCacheWithBindAddress(dsIdPort, expectedBindAddress, receiverGroup));
+    props.setProperty(BIND_ADDRESS, expectedBindAddress);
+    props.setProperty(GROUPS, receiverGroup);
+
+    server1 = locatorServerStartupRule.startServerVM(3, props, locator1Port);
+    server2 = locatorServerStartupRule.startServerVM(4, props, locator1Port);
+    server3 = locatorServerStartupRule.startServerVM(5, props, locator1Port);
 
+    String hostnameForSenders = getHostName();
     String command =
         CliStrings.CREATE_GATEWAYRECEIVER + " --" + CliStrings.CREATE_GATEWAYRECEIVER__MANUALSTART
             + "=false" + " --" + CliStrings.CREATE_GATEWAYRECEIVER__HOSTNAMEFORSENDERS + "="
             + hostnameForSenders + " --" + CliStrings.CREATE_GATEWAYRECEIVER__STARTPORT + "=10000"
             + " --" + CliStrings.CREATE_GATEWAYRECEIVER__ENDPORT + "=11000" + " --"
             + CliStrings.CREATE_GATEWAYRECEIVER__MAXTIMEBETWEENPINGS + "=100000" + " --"
-            + CliStrings.CREATE_GATEWAYRECEIVER__SOCKETBUFFERSIZE + "=512000" + " --"
-            + CliStrings.GROUP + "=" + receiverGroup;
+            + CliStrings.CREATE_GATEWAYRECEIVER__SOCKETBUFFERSIZE + "=512000" + " --" + GROUP + "="
+            + receiverGroup;
     executeCommandAndVerifyStatus(command, 3);
 
-    vm3.invoke(() -> verifyGatewayReceiverProfile(hostnameForSenders));
-    vm4.invoke(() -> verifyGatewayReceiverProfile(hostnameForSenders));
-    vm5.invoke(() -> verifyGatewayReceiverProfile(hostnameForSenders));
+    server1.invoke(() -> verifyGatewayReceiverProfile(hostnameForSenders));
+    server2.invoke(() -> verifyGatewayReceiverProfile(hostnameForSenders));
+    server3.invoke(() -> verifyGatewayReceiverProfile(hostnameForSenders));
 
-    vm3.invoke(() -> verifyGatewayReceiverServerLocations(dsIdPort, hostnameForSenders));
-    vm4.invoke(() -> verifyGatewayReceiverServerLocations(dsIdPort, hostnameForSenders));
-    vm5.invoke(() -> verifyGatewayReceiverServerLocations(dsIdPort, hostnameForSenders));
+    server1.invoke(() -> verifyGatewayReceiverServerLocations(locator1Port, hostnameForSenders));
+    server2.invoke(() -> verifyGatewayReceiverServerLocations(locator1Port, hostnameForSenders));
+    server3.invoke(() -> verifyGatewayReceiverServerLocations(locator1Port, hostnameForSenders));
 
-    vm3.invoke(() -> verifyReceiverCreationWithAttributes(true, 10000, 11000, "", 100000, 512000,
-        null, hostnameForSenders));
-    vm4.invoke(() -> verifyReceiverCreationWithAttributes(true, 10000, 11000, "", 100000, 512000,
-        null, hostnameForSenders));
-    vm5.invoke(() -> verifyReceiverCreationWithAttributes(true, 10000, 11000, "", 100000, 512000,
-        null, hostnameForSenders));
+    server1.invoke(() -> verifyReceiverCreationWithAttributes(true, 10000, 11000, "", 100000,
+        512000, null, hostnameForSenders));
+    server2.invoke(() -> verifyReceiverCreationWithAttributes(true, 10000, 11000, "", 100000,
+        512000, null, hostnameForSenders));
+    server3.invoke(() -> verifyReceiverCreationWithAttributes(true, 10000, 11000, "", 100000,
+        512000, null, hostnameForSenders));
   }
 
   /**
    * GatewayReceiver with given attributes and a single GatewayTransportFilter.
    */
   @Test
-  public void testCreateGatewayReceiverWithGatewayTransportFilter() {
-    VM puneLocator = Host.getLocator();
-    int dsIdPort = puneLocator.invoke(this::getLocatorPort);
-    propsSetUp(dsIdPort);
-    vm2.invoke(() -> createFirstRemoteLocator(2, dsIdPort));
+  public void testCreateGatewayReceiverWithGatewayTransportFilter() throws Exception {
 
-    vm3.invoke(() -> createCache(dsIdPort));
-    vm4.invoke(() -> createCache(dsIdPort));
-    vm5.invoke(() -> createCache(dsIdPort));
+    Integer locator1Port = locatorSite1.getPort();
+
+    // setup servers in Site #1
+    server1 = locatorServerStartupRule.startServerVM(3, locator1Port);
+    server2 = locatorServerStartupRule.startServerVM(4, locator1Port);
+    server3 = locatorServerStartupRule.startServerVM(5, locator1Port);
 
     String command =
         CliStrings.CREATE_GATEWAYRECEIVER + " --" + CliStrings.CREATE_GATEWAYRECEIVER__MANUALSTART
@@ -460,31 +498,30 @@ public class CreateGatewayReceiverCommandDUnitTest extends WANCommandTestBase {
             + CliStrings.CREATE_GATEWAYRECEIVER__SOCKETBUFFERSIZE + "=512000" + " --"
             + CliStrings.CREATE_GATEWAYRECEIVER__GATEWAYTRANSPORTFILTER
             + "=org.apache.geode.cache30.MyGatewayTransportFilter1";
-    executeCommandAndVerifyStatus(command, 4);
+    executeCommandAndVerifyStatus(command, 3);
     List<String> transportFilters = new ArrayList<String>();
     transportFilters.add("org.apache.geode.cache30.MyGatewayTransportFilter1");
 
-    vm3.invoke(() -> verifyReceiverCreationWithAttributes(true, 10000, 11000, "localhost", 100000,
-        512000, transportFilters, GatewayReceiver.DEFAULT_HOSTNAME_FOR_SENDERS));
-    vm4.invoke(() -> verifyReceiverCreationWithAttributes(true, 10000, 11000, "localhost", 100000,
-        512000, transportFilters, GatewayReceiver.DEFAULT_HOSTNAME_FOR_SENDERS));
-    vm5.invoke(() -> verifyReceiverCreationWithAttributes(true, 10000, 11000, "localhost", 100000,
-        512000, transportFilters, GatewayReceiver.DEFAULT_HOSTNAME_FOR_SENDERS));
+    server1.invoke(() -> verifyReceiverCreationWithAttributes(true, 10000, 11000, "localhost",
+        100000, 512000, transportFilters, GatewayReceiver.DEFAULT_HOSTNAME_FOR_SENDERS));
+    server2.invoke(() -> verifyReceiverCreationWithAttributes(true, 10000, 11000, "localhost",
+        100000, 512000, transportFilters, GatewayReceiver.DEFAULT_HOSTNAME_FOR_SENDERS));
+    server3.invoke(() -> verifyReceiverCreationWithAttributes(true, 10000, 11000, "localhost",
+        100000, 512000, transportFilters, GatewayReceiver.DEFAULT_HOSTNAME_FOR_SENDERS));
   }
 
   /**
    * GatewayReceiver with given attributes and multiple GatewayTransportFilters.
    */
   @Test
-  public void testCreateGatewayReceiverWithMultipleGatewayTransportFilters() {
-    VM puneLocator = Host.getLocator();
-    int dsIdPort = puneLocator.invoke(this::getLocatorPort);
-    propsSetUp(dsIdPort);
-    vm2.invoke(() -> createFirstRemoteLocator(2, dsIdPort));
+  public void testCreateGatewayReceiverWithMultipleGatewayTransportFilters() throws Exception {
+
+    Integer locator1Port = locatorSite1.getPort();
 
-    vm3.invoke(() -> createCache(dsIdPort));
-    vm4.invoke(() -> createCache(dsIdPort));
-    vm5.invoke(() -> createCache(dsIdPort));
+    // setup servers in Site #1
+    server1 = locatorServerStartupRule.startServerVM(3, locator1Port);
+    server2 = locatorServerStartupRule.startServerVM(4, locator1Port);
+    server3 = locatorServerStartupRule.startServerVM(5, locator1Port);
 
     String command = CliStrings.CREATE_GATEWAYRECEIVER + " --"
         + CliStrings.CREATE_GATEWAYRECEIVER__BINDADDRESS + "=localhost" + " --"
@@ -494,18 +531,18 @@ public class CreateGatewayReceiverCommandDUnitTest extends WANCommandTestBase {
         + CliStrings.CREATE_GATEWAYRECEIVER__SOCKETBUFFERSIZE + "=512000" + " --"
         + CliStrings.CREATE_GATEWAYRECEIVER__GATEWAYTRANSPORTFILTER
         + "=org.apache.geode.cache30.MyGatewayTransportFilter1,org.apache.geode.cache30.MyGatewayTransportFilter2";
-    executeCommandAndVerifyStatus(command, 4);
+    executeCommandAndVerifyStatus(command, 3);
     List<String> transportFilters = new ArrayList<String>();
     transportFilters.add("org.apache.geode.cache30.MyGatewayTransportFilter1");
     transportFilters.add("org.apache.geode.cache30.MyGatewayTransportFilter2");
 
-    vm3.invoke(() -> verifyReceiverCreationWithAttributes(!GatewayReceiver.DEFAULT_MANUAL_START,
+    server1.invoke(() -> verifyReceiverCreationWithAttributes(!GatewayReceiver.DEFAULT_MANUAL_START,
         10000, 11000, "localhost", 100000, 512000, transportFilters,
         GatewayReceiver.DEFAULT_HOSTNAME_FOR_SENDERS));
-    vm4.invoke(() -> verifyReceiverCreationWithAttributes(!GatewayReceiver.DEFAULT_MANUAL_START,
+    server2.invoke(() -> verifyReceiverCreationWithAttributes(!GatewayReceiver.DEFAULT_MANUAL_START,
         10000, 11000, "localhost", 100000, 512000, transportFilters,
         GatewayReceiver.DEFAULT_HOSTNAME_FOR_SENDERS));
-    vm5.invoke(() -> verifyReceiverCreationWithAttributes(!GatewayReceiver.DEFAULT_MANUAL_START,
+    server3.invoke(() -> verifyReceiverCreationWithAttributes(!GatewayReceiver.DEFAULT_MANUAL_START,
         10000, 11000, "localhost", 100000, 512000, transportFilters,
         GatewayReceiver.DEFAULT_HOSTNAME_FOR_SENDERS));
   }
@@ -514,15 +551,14 @@ public class CreateGatewayReceiverCommandDUnitTest extends WANCommandTestBase {
    * GatewayReceiver with given attributes. Error scenario where startPort is greater than endPort.
    */
   @Test
-  public void testCreateGatewayReceiver_Error() {
-    VM puneLocator = Host.getLocator();
-    int dsIdPort = puneLocator.invoke(this::getLocatorPort);
-    propsSetUp(dsIdPort);
-    vm2.invoke(() -> createFirstRemoteLocator(2, dsIdPort));
+  public void testCreateGatewayReceiver_Error() throws Exception {
+
+    Integer locator1Port = locatorSite1.getPort();
 
-    vm3.invoke(() -> createCache(dsIdPort));
-    vm4.invoke(() -> createCache(dsIdPort));
-    vm5.invoke(() -> createCache(dsIdPort));
+    // setup servers in Site #1
+    server1 = locatorServerStartupRule.startServerVM(3, locator1Port);
+    server2 = locatorServerStartupRule.startServerVM(4, locator1Port);
+    server3 = locatorServerStartupRule.startServerVM(5, locator1Port);
 
     String command =
         CliStrings.CREATE_GATEWAYRECEIVER + " --" + CliStrings.CREATE_GATEWAYRECEIVER__BINDADDRESS
@@ -530,16 +566,16 @@ public class CreateGatewayReceiverCommandDUnitTest extends WANCommandTestBase {
             + CliStrings.CREATE_GATEWAYRECEIVER__ENDPORT + "=10000" + " --"
             + CliStrings.CREATE_GATEWAYRECEIVER__MAXTIMEBETWEENPINGS + "=100000" + " --"
             + CliStrings.CREATE_GATEWAYRECEIVER__SOCKETBUFFERSIZE + "=512000";
-    CommandResult cmdResult = executeCommand(command);
+    CommandResult cmdResult = gfsh.executeCommand(command);
     if (cmdResult != null) {
-      String strCmdResult = commandResultToString(cmdResult);
+      String strCmdResult = cmdResult.toString();
       getLogWriter().info("testCreateGatewayReceiver stringResult : " + strCmdResult + ">>>>");
       assertEquals(Result.Status.OK, cmdResult.getStatus());
 
       TabularResultData resultData = (TabularResultData) cmdResult.getResultData();
       List<String> status = resultData.retrieveAllValues("Status");
-      assertEquals(4, status.size());// expected size 4 includes the manager
-                                     // node
+      assertEquals(3, status.size());
+
       // verify there is no error in the status
       for (String stat : status) {
         assertTrue("GatewayReceiver creation should have failed", stat.contains("ERROR:"));
@@ -553,17 +589,17 @@ public class CreateGatewayReceiverCommandDUnitTest extends WANCommandTestBase {
    * GatewayReceiver with given attributes on the given member.
    */
   @Test
-  public void testCreateGatewayReceiver_onMember() {
-    VM puneLocator = Host.getLocator();
-    int dsIdPort = puneLocator.invoke(this::getLocatorPort);
-    propsSetUp(dsIdPort);
-    vm2.invoke(() -> createFirstRemoteLocator(2, dsIdPort));
+  public void testCreateGatewayReceiver_onMember() throws Exception {
+
+    Integer locator1Port = locatorSite1.getPort();
 
-    vm3.invoke(() -> createCache(dsIdPort));
-    vm4.invoke(() -> createCache(dsIdPort));
-    vm5.invoke(() -> createCache(dsIdPort));
+    // setup servers in Site #1
+    server1 = locatorServerStartupRule.startServerVM(3, locator1Port);
+    server2 = locatorServerStartupRule.startServerVM(4, locator1Port);
+    server3 = locatorServerStartupRule.startServerVM(5, locator1Port);
 
-    final DistributedMember vm3Member = vm3.invoke(this::getMember);
+    final DistributedMember server1Member =
+        (DistributedMember) server1.invoke(getMemberIdCallable());
 
     String command =
         CliStrings.CREATE_GATEWAYRECEIVER + " --" + CliStrings.CREATE_GATEWAYRECEIVER__MANUALSTART
@@ -572,10 +608,10 @@ public class CreateGatewayReceiverCommandDUnitTest extends WANCommandTestBase {
             + CliStrings.CREATE_GATEWAYRECEIVER__ENDPORT + "=11000" + " --"
             + CliStrings.CREATE_GATEWAYRECEIVER__MAXTIMEBETWEENPINGS + "=100000" + " --"
             + CliStrings.CREATE_GATEWAYRECEIVER__SOCKETBUFFERSIZE + "=512000" + " --"
-            + CliStrings.MEMBER + "=" + vm3Member.getId();
-    CommandResult cmdResult = executeCommand(command);
+            + CliStrings.MEMBER + "=" + server1Member.getId();
+    CommandResult cmdResult = gfsh.executeCommand(command);
     if (cmdResult != null) {
-      String strCmdResult = commandResultToString(cmdResult);
+      String strCmdResult = cmdResult.toString();
       getLogWriter().info("testCreateGatewayReceiver stringResult : " + strCmdResult + ">>>>");
       assertEquals(Result.Status.OK, cmdResult.getStatus());
 
@@ -592,27 +628,27 @@ public class CreateGatewayReceiverCommandDUnitTest extends WANCommandTestBase {
 
     // cannot verify Profile/ServerLocation when manualStart is true
 
-    vm3.invoke(() -> verifyReceiverCreationWithAttributes(false, 10000, 11000, "localhost", 100000,
-        512000, null, GatewayReceiver.DEFAULT_HOSTNAME_FOR_SENDERS));
+    server1.invoke(() -> verifyReceiverCreationWithAttributes(false, 10000, 11000, "localhost",
+        100000, 512000, null, GatewayReceiver.DEFAULT_HOSTNAME_FOR_SENDERS));
   }
 
   /**
    * GatewayReceiver with given attributes on multiple members.
    */
-  @Category(FlakyTest.class) // GEODE-1355
   @Test
-  public void testCreateGatewayReceiver_onMultipleMembers() {
-    VM puneLocator = Host.getLocator();
-    int dsIdPort = puneLocator.invoke(this::getLocatorPort);
-    propsSetUp(dsIdPort);
-    vm2.invoke(() -> createFirstRemoteLocator(2, dsIdPort));
+  public void testCreateGatewayReceiver_onMultipleMembers() throws Exception {
 
-    vm3.invoke(() -> createCache(dsIdPort));
-    vm4.invoke(() -> createCache(dsIdPort));
-    vm5.invoke(() -> createCache(dsIdPort));
+    Integer locator1Port = locatorSite1.getPort();
 
-    final DistributedMember vm3Member = vm3.invoke(this::getMember);
-    final DistributedMember vm4Member = vm4.invoke(this::getMember);
+    // setup servers in Site #1
+    server1 = locatorServerStartupRule.startServerVM(3, locator1Port);
+    server2 = locatorServerStartupRule.startServerVM(4, locator1Port);
+    server3 = locatorServerStartupRule.startServerVM(5, locator1Port);
+
+    final DistributedMember server1Member =
+        (DistributedMember) server1.invoke(getMemberIdCallable());
+    final DistributedMember server2Member =
+        (DistributedMember) server2.invoke(getMemberIdCallable());
 
     String command =
         CliStrings.CREATE_GATEWAYRECEIVER + " --" + CliStrings.CREATE_GATEWAYRECEIVER__MANUALSTART
@@ -621,10 +657,10 @@ public class CreateGatewayReceiverCommandDUnitTest extends WANCommandTestBase {
             + CliStrings.CREATE_GATEWAYRECEIVER__ENDPORT + "=11000" + " --"
             + CliStrings.CREATE_GATEWAYRECEIVER__MAXTIMEBETWEENPINGS + "=100000" + " --"
             + CliStrings.CREATE_GATEWAYRECEIVER__SOCKETBUFFERSIZE + "=512000" + " --"
-            + CliStrings.MEMBER + "=" + vm3Member.getId() + "," + vm4Member.getId();
-    CommandResult cmdResult = executeCommand(command);
+            + CliStrings.MEMBER + "=" + server1Member.getId() + "," + server2Member.getId();
+    CommandResult cmdResult = gfsh.executeCommand(command);
     if (cmdResult != null) {
-      String strCmdResult = commandResultToString(cmdResult);
+      String strCmdResult = cmdResult.toString();
       getLogWriter().info("testCreateGatewayReceiver stringResult : " + strCmdResult + ">>>>");
       assertEquals(Result.Status.OK, cmdResult.getStatus());
 
@@ -641,25 +677,25 @@ public class CreateGatewayReceiverCommandDUnitTest extends WANCommandTestBase {
 
     // cannot verify Profile/ServerLocation when manualStart is true
 
-    vm3.invoke(() -> verifyReceiverCreationWithAttributes(false, 10000, 11000, "localhost", 100000,
-        512000, null, GatewayReceiver.DEFAULT_HOSTNAME_FOR_SENDERS));
-    vm4.invoke(() -> verifyReceiverCreationWithAttributes(false, 10000, 11000, "localhost", 100000,
-        512000, null, GatewayReceiver.DEFAULT_HOSTNAME_FOR_SENDERS));
+    server1.invoke(() -> verifyReceiverCreationWithAttributes(false, 10000, 11000, "localhost",
+        100000, 512000, null, GatewayReceiver.DEFAULT_HOSTNAME_FOR_SENDERS));
+    server2.invoke(() -> verifyReceiverCreationWithAttributes(false, 10000, 11000, "localhost",
+        100000, 512000, null, GatewayReceiver.DEFAULT_HOSTNAME_FOR_SENDERS));
   }
 
   /**
    * GatewayReceiver with given attributes on the given group.
    */
   @Test
-  public void testCreateGatewayReceiver_onGroup() {
-    VM puneLocator = Host.getLocator();
-    int dsIdPort = puneLocator.invoke(this::getLocatorPort);
-    propsSetUp(dsIdPort);
-    vm2.invoke(() -> createFirstRemoteLocator(2, dsIdPort));
+  public void testCreateGatewayReceiver_onGroup() throws Exception {
+
+    Integer locator1Port = locatorSite1.getPort();
 
-    vm3.invoke(() -> createCacheWithGroups(dsIdPort, "receiverGroup1"));
-    vm4.invoke(() -> createCacheWithGroups(dsIdPort, "receiverGroup1"));
-    vm5.invoke(() -> createCacheWithGroups(dsIdPort, "receiverGroup1"));
+    // setup servers in Site #1
+    String groups = "receiverGroup1";
+    server1 = startServerWithGroups(3, groups, locator1Port);
+    server2 = startServerWithGroups(4, groups, locator1Port);
+    server3 = startServerWithGroups(5, groups, locator1Port);
 
     String command =
         CliStrings.CREATE_GATEWAYRECEIVER + " --" + CliStrings.CREATE_GATEWAYRECEIVER__MANUALSTART
@@ -667,11 +703,11 @@ public class CreateGatewayReceiverCommandDUnitTest extends WANCommandTestBase {
             + " --" + CliStrings.CREATE_GATEWAYRECEIVER__STARTPORT + "=10000" + " --"
             + CliStrings.CREATE_GATEWAYRECEIVER__ENDPORT + "=11000" + " --"
             + CliStrings.CREATE_GATEWAYRECEIVER__MAXTIMEBETWEENPINGS + "=100000" + " --"
-            + CliStrings.CREATE_GATEWAYRECEIVER__SOCKETBUFFERSIZE + "=512000" + " --"
-            + CliStrings.GROUP + "=receiverGroup1";
-    CommandResult cmdResult = executeCommand(command);
+            + CliStrings.CREATE_GATEWAYRECEIVER__SOCKETBUFFERSIZE + "=512000" + " --" + GROUP
+            + "=receiverGroup1";
+    CommandResult cmdResult = gfsh.executeCommand(command);
     if (cmdResult != null) {
-      String strCmdResult = commandResultToString(cmdResult);
+      String strCmdResult = cmdResult.toString();
       getLogWriter().info("testCreateGatewayReceiver stringResult : " + strCmdResult + ">>>>");
       assertEquals(Result.Status.OK, cmdResult.getStatus());
 
@@ -688,12 +724,12 @@ public class CreateGatewayReceiverCommandDUnitTest extends WANCommandTestBase {
 
     // cannot verify Profile/ServerLocation when manualStart is true
 
-    vm3.invoke(() -> verifyReceiverCreationWithAttributes(false, 10000, 11000, "localhost", 100000,
-        512000, null, GatewayReceiver.DEFAULT_HOSTNAME_FOR_SENDERS));
-    vm4.invoke(() -> verifyReceiverCreationWithAttributes(false, 10000, 11000, "localhost", 100000,
-        512000, null, GatewayReceiver.DEFAULT_HOSTNAME_FOR_SENDERS));
-    vm5.invoke(() -> verifyReceiverCreationWithAttributes(false, 10000, 11000, "localhost", 100000,
-        512000, null, GatewayReceiver.DEFAULT_HOSTNAME_FOR_SENDERS));
+    server1.invoke(() -> verifyReceiverCreationWithAttributes(false, 10000, 11000, "localhost",
+        100000, 512000, null, GatewayReceiver.DEFAULT_HOSTNAME_FOR_SENDERS));
+    server2.invoke(() -> verifyReceiverCreationWithAttributes(false, 10000, 11000, "localhost",
+        100000, 512000, null, GatewayReceiver.DEFAULT_HOSTNAME_FOR_SENDERS));
+    server3.invoke(() -> verifyReceiverCreationWithAttributes(false, 10000, 11000, "localhost",
+        100000, 512000, null, GatewayReceiver.DEFAULT_HOSTNAME_FOR_SENDERS));
   }
 
   /**
@@ -701,15 +737,16 @@ public class CreateGatewayReceiverCommandDUnitTest extends WANCommandTestBase {
    * group.
    */
   @Test
-  public void testCreateGatewayReceiver_onGroup_Scenario2() {
-    VM puneLocator = Host.getLocator();
-    int dsIdPort = puneLocator.invoke(this::getLocatorPort);
-    propsSetUp(dsIdPort);
-    vm2.invoke(() -> createFirstRemoteLocator(2, dsIdPort));
+  public void testCreateGatewayReceiver_onGroup_Scenario2() throws Exception {
 
-    vm3.invoke(() -> createCacheWithGroups(dsIdPort, "receiverGroup1"));
-    vm4.invoke(() -> createCacheWithGroups(dsIdPort, "receiverGroup1"));
-    vm5.invoke(() -> createCacheWithGroups(dsIdPort, "receiverGroup2"));
+    Integer locator1Port = locatorSite1.getPort();
+
+    // setup servers in Site #1
+    String group1 = "receiverGroup1";
+    String group2 = "receiverGroup2";
+    server1 = startServerWithGroups(3, group1, locator1Port);
+    server2 = startServerWithGroups(4, group1, locator1Port);
+    server3 = startServerWithGroups(5, group2, locator1Port);
 
     String command =
         CliStrings.CREATE_GATEWAYRECEIVER + " --" + CliStrings.CREATE_GATEWAYRECEIVER__MANUALSTART
@@ -717,11 +754,11 @@ public class CreateGatewayReceiverCommandDUnitTest extends WANCommandTestBase {
             + " --" + CliStrings.CREATE_GATEWAYRECEIVER__STARTPORT + "=10000" + " --"
             + CliStrings.CREATE_GATEWAYRECEIVER__ENDPORT + "=11000" + " --"
             + CliStrings.CREATE_GATEWAYRECEIVER__MAXTIMEBETWEENPINGS + "=100000" + " --"
-            + CliStrings.CREATE_GATEWAYRECEIVER__SOCKETBUFFERSIZE + "=512000" + " --"
-            + CliStrings.GROUP + "=receiverGroup1";
-    CommandResult cmdResult = executeCommand(command);
+            + CliStrings.CREATE_GATEWAYRECEIVER__SOCKETBUFFERSIZE + "=512000" + " --" + GROUP
+            + "=receiverGroup1";
+    CommandResult cmdResult = gfsh.executeCommand(command);
     if (cmdResult != null) {
-      String strCmdResult = commandResultToString(cmdResult);
+      String strCmdResult = cmdResult.toString();
       getLogWriter().info("testCreateGatewayReceiver stringResult : " + strCmdResult + ">>>>");
       assertEquals(Result.Status.OK, cmdResult.getStatus());
 
@@ -738,25 +775,24 @@ public class CreateGatewayReceiverCommandDUnitTest extends WANCommandTestBase {
 
     // cannot verify Profile/ServerLocation when manualStart is true
 
-    vm3.invoke(() -> verifyReceiverCreationWithAttributes(false, 10000, 11000, "localhost", 100000,
-        512000, null, GatewayReceiver.DEFAULT_HOSTNAME_FOR_SENDERS));
-    vm4.invoke(() -> verifyReceiverCreationWithAttributes(false, 10000, 11000, "localhost", 100000,
-        512000, null, GatewayReceiver.DEFAULT_HOSTNAME_FOR_SENDERS));
+    server1.invoke(() -> verifyReceiverCreationWithAttributes(false, 10000, 11000, "localhost",
+        100000, 512000, null, GatewayReceiver.DEFAULT_HOSTNAME_FOR_SENDERS));
+    server2.invoke(() -> verifyReceiverCreationWithAttributes(false, 10000, 11000, "localhost",
+        100000, 512000, null, GatewayReceiver.DEFAULT_HOSTNAME_FOR_SENDERS));
   }
 
   /**
    * GatewayReceiver with given attributes on multiple groups.
    */
   @Test
-  public void testCreateGatewayReceiver_onMultipleGroups() {
-    VM puneLocator = Host.getLocator();
-    int dsIdPort = puneLocator.invoke(this::getLocatorPort);
-    propsSetUp(dsIdPort);
-    vm2.invoke(() -> createFirstRemoteLocator(2, dsIdPort));
+  public void testCreateGatewayReceiver_onMultipleGroups() throws Exception {
+
+    Integer locator1Port = locatorSite1.getPort();
 
-    vm3.invoke(() -> createCacheWithGroups(dsIdPort, "receiverGroup1"));
-    vm4.invoke(() -> createCacheWithGroups(dsIdPort, "receiverGroup1"));
-    vm5.invoke(() -> createCacheWithGroups(dsIdPort, "receiverGroup2"));
+    // setup servers in Site #1
+    server1 = startServerWithGroups(3, "receiverGroup1", locator1Port);
+    server2 = startServerWithGroups(4, "receiverGroup1", locator1Port);
+    server3 = startServerWithGroups(5, "receiverGroup2", locator1Port);
 
     String command =
         CliStrings.CREATE_GATEWAYRECEIVER + " --" + CliStrings.CREATE_GATEWAYRECEIVER__MANUALSTART
@@ -764,11 +800,11 @@ public class CreateGatewayReceiverCommandDUnitTest extends WANCommandTestBase {
             + " --" + CliStrings.CREATE_GATEWAYRECEIVER__STARTPORT + "=10000" + " --"
             + CliStrings.CREATE_GATEWAYRECEIVER__ENDPORT + "=11000" + " --"
             + CliStrings.CREATE_GATEWAYRECEIVER__MAXTIMEBETWEENPINGS + "=100000" + " --"
-            + CliStrings.CREATE_GATEWAYRECEIVER__SOCKETBUFFERSIZE + "=512000" + " --"
-            + CliStrings.GROUP + "=receiverGroup1,receiverGroup2";
-    CommandResult cmdResult = executeCommand(command);
+            + CliStrings.CREATE_GATEWAYRECEIVER__SOCKETBUFFERSIZE + "=512000" + " --" + GROUP
+            + "=receiverGroup1,receiverGroup2";
+    CommandResult cmdResult = gfsh.executeCommand(command);
     if (cmdResult != null) {
-      String strCmdResult = commandResultToString(cmdResult);
+      String strCmdResult = cmdResult.toString();
       getLogWriter().info("testCreateGatewayReceiver stringResult : " + strCmdResult + ">>>>");
       assertEquals(Result.Status.OK, cmdResult.getStatus());
 
@@ -785,11 +821,17 @@ public class CreateGatewayReceiverCommandDUnitTest extends WANCommandTestBase {
 
     // cannot verify Profile/ServerLocation when manualStart is true
 
-    vm3.invoke(() -> verifyReceiverCreationWithAttributes(false, 10000, 11000, "localhost", 100000,
-        512000, null, GatewayReceiver.DEFAULT_HOSTNAME_FOR_SENDERS));
-    vm4.invoke(() -> verifyReceiverCreationWithAttributes(false, 10000, 11000, "localhost", 100000,
-        512000, null, GatewayReceiver.DEFAULT_HOSTNAME_FOR_SENDERS));
-    vm5.invoke(() -> verifyReceiverCreationWithAttributes(false, 10000, 11000, "localhost", 100000,
-        512000, null, GatewayReceiver.DEFAULT_HOSTNAME_FOR_SENDERS));
+    server1.invoke(() -> verifyReceiverCreationWithAttributes(false, 10000, 11000, "localhost",
+        100000, 512000, null, GatewayReceiver.DEFAULT_HOSTNAME_FOR_SENDERS));
+    server2.invoke(() -> verifyReceiverCreationWithAttributes(false, 10000, 11000, "localhost",
+        100000, 512000, null, GatewayReceiver.DEFAULT_HOSTNAME_FOR_SENDERS));
+    server3.invoke(() -> verifyReceiverCreationWithAttributes(false, 10000, 11000, "localhost",
+        100000, 512000, null, GatewayReceiver.DEFAULT_HOSTNAME_FOR_SENDERS));
+  }
+
+  private MemberVM startServerWithGroups(int index, String groups, int locPort) throws Exception {
+    Properties props = new Properties();
+    props.setProperty(GROUPS, groups);
+    return locatorServerStartupRule.startServerVM(index, props, locPort);
   }
 }
diff --git a/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/wancommand/CreateGatewaySenderCommandDUnitTest.java b/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/wancommand/CreateGatewaySenderCommandDUnitTest.java
index 15c7d38..fe630fc 100644
--- a/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/wancommand/CreateGatewaySenderCommandDUnitTest.java
+++ b/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/wancommand/CreateGatewaySenderCommandDUnitTest.java
@@ -15,13 +15,21 @@
 
 package org.apache.geode.internal.cache.wan.wancommand;
 
+import static org.apache.geode.distributed.ConfigurationProperties.DISTRIBUTED_SYSTEM_ID;
+import static org.apache.geode.distributed.ConfigurationProperties.REMOTE_LOCATORS;
 import static org.apache.geode.test.dunit.LogWriterUtils.getLogWriter;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
 import java.util.List;
+import java.util.Properties;
 
+import org.apache.geode.test.dunit.rules.LocatorServerStartupRule;
+import org.apache.geode.test.dunit.rules.MemberVM;
+import org.apache.geode.test.junit.rules.GfshShellConnectionRule;
+import org.junit.Before;
+import org.junit.Rule;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
@@ -35,21 +43,47 @@ import org.apache.geode.test.dunit.IgnoredException;
 import org.apache.geode.test.junit.categories.DistributedTest;
 
 @Category(DistributedTest.class)
-public class CreateGatewaySenderCommandDUnitTest extends WANCommandTestBase {
+public class CreateGatewaySenderCommandDUnitTest {
+
+  @Rule
+  public LocatorServerStartupRule locatorServerStartupRule = new LocatorServerStartupRule();
+
+  @Rule
+  public GfshShellConnectionRule gfsh = new GfshShellConnectionRule();
+
+  private MemberVM locatorSite1;
+  private MemberVM locatorSite2;
+  private MemberVM server1;
+  private MemberVM server2;
+  private MemberVM server3;
+
+  @Before
+  public void before() throws Exception {
+    Properties props = new Properties();
+    props.setProperty(DISTRIBUTED_SYSTEM_ID, "" + 1);
+    locatorSite1 = locatorServerStartupRule.startLocatorVM(1, props);
+
+    props.setProperty(DISTRIBUTED_SYSTEM_ID, "" + 2);
+    props.setProperty(REMOTE_LOCATORS, "localhost[" + locatorSite1.getPort() + "]");
+    locatorSite2 = locatorServerStartupRule.startLocatorVM(2, props);
+
+    // Connect Gfsh to locator.
+    gfsh.connectAndVerify(locatorSite1);
+  }
 
   /**
    * GatewaySender with given attribute values. Error scenario where dispatcher threads is set to
    * more than 1 and no order policy provided.
    */
   @Test
-  public void testCreateGatewaySender_Error() {
-    Integer dsIdPort = vm1.invoke(() -> createFirstLocatorWithDSId(1));
-    propsSetUp(dsIdPort);
+  public void testCreateGatewaySender_Error() throws Exception {
+
+    Integer locator1Port = locatorSite1.getPort();
 
-    vm2.invoke(() -> createFirstRemoteLocator(2, dsIdPort));
-    vm3.invoke(() -> createCache(dsIdPort));
-    vm4.invoke(() -> createCache(dsIdPort));
-    vm5.invoke(() -> createCache(dsIdPort));
+    // setup servers in Site #1
+    server1 = locatorServerStartupRule.startServerVM(3, locator1Port);
+    server2 = locatorServerStartupRule.startServerVM(4, locator1Port);
+    server3 = locatorServerStartupRule.startServerVM(5, locator1Port);
 
     int socketReadTimeout = GatewaySender.MINIMUM_SOCKET_READ_TIMEOUT + 1000;
     String command = CliStrings.CREATE_GATEWAYSENDER + " --" + CliStrings.CREATE_GATEWAYSENDER__ID
@@ -68,13 +102,13 @@ public class CreateGatewaySenderCommandDUnitTest extends WANCommandTestBase {
         + CliStrings.CREATE_GATEWAYSENDER__DISPATCHERTHREADS + "=2";
     CommandResult cmdResult = executeCommandWithIgnoredExceptions(command);
     if (cmdResult != null) {
-      String strCmdResult = commandResultToString(cmdResult);
+      String strCmdResult = cmdResult.toString();
       getLogWriter().info("testCreateDestroyGatewaySender stringResult : " + strCmdResult + ">>>>");
       assertEquals(Result.Status.OK, cmdResult.getStatus());
 
       TabularResultData resultData = (TabularResultData) cmdResult.getResultData();
       List<String> status = resultData.retrieveAllValues("Status");
-      assertEquals(5, status.size());
+      assertEquals(3, status.size());
       for (String stat : status) {
         assertTrue("GatewaySender creation should fail", stat.contains("ERROR:"));
       }
@@ -88,14 +122,13 @@ public class CreateGatewaySenderCommandDUnitTest extends WANCommandTestBase {
    * valid for Parallel sender.
    */
   @Test
-  public void testCreateParallelGatewaySender_Error() {
-    Integer dsIdPort = vm1.invoke(() -> createFirstLocatorWithDSId(1));
-    propsSetUp(dsIdPort);
+  public void testCreateParallelGatewaySender_Error() throws Exception {
+    Integer locator1Port = locatorSite1.getPort();
 
-    vm2.invoke(() -> createFirstRemoteLocator(2, dsIdPort));
-    vm3.invoke(() -> createCache(dsIdPort));
-    vm4.invoke(() -> createCache(dsIdPort));
-    vm5.invoke(() -> createCache(dsIdPort));
+    // setup servers in Site #1
+    server1 = locatorServerStartupRule.startServerVM(3, locator1Port);
+    server2 = locatorServerStartupRule.startServerVM(4, locator1Port);
+    server3 = locatorServerStartupRule.startServerVM(5, locator1Port);
 
     int socketReadTimeout = GatewaySender.MINIMUM_SOCKET_READ_TIMEOUT + 1000;
     String command = CliStrings.CREATE_GATEWAYSENDER + " --" + CliStrings.CREATE_GATEWAYSENDER__ID
@@ -118,14 +151,14 @@ public class CreateGatewaySenderCommandDUnitTest extends WANCommandTestBase {
     try {
       CommandResult cmdResult = executeCommandWithIgnoredExceptions(command);
       if (cmdResult != null) {
-        String strCmdResult = commandResultToString(cmdResult);
+        String strCmdResult = cmdResult.toString();
         getLogWriter()
             .info("testCreateParallelGatewaySender_Error stringResult : " + strCmdResult + ">>>>");
         assertEquals(Result.Status.OK, cmdResult.getStatus());
 
         TabularResultData resultData = (TabularResultData) cmdResult.getResultData();
         List<String> status = resultData.retrieveAllValues("Status");
-        assertEquals(5, status.size());
+        assertEquals(3, status.size());
         for (String stat : status) {
           assertTrue("GatewaySender creation should have failed", stat.contains("ERROR:"));
         }
@@ -140,7 +173,7 @@ public class CreateGatewaySenderCommandDUnitTest extends WANCommandTestBase {
   private CommandResult executeCommandWithIgnoredExceptions(String command) {
     final IgnoredException ignored = IgnoredException.addIgnoredException("Could not connect");
     try {
-      return executeCommand(command);
+      return gfsh.executeCommand(command);
     } finally {
       ignored.remove();
     }
diff --git a/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/wancommand/DestroyGatewaySenderCommandDUnitTest.java b/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/wancommand/DestroyGatewaySenderCommandDUnitTest.java
index 5310be7..a121397 100644
--- a/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/wancommand/DestroyGatewaySenderCommandDUnitTest.java
+++ b/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/wancommand/DestroyGatewaySenderCommandDUnitTest.java
@@ -15,13 +15,21 @@
 
 package org.apache.geode.internal.cache.wan.wancommand;
 
+import static org.apache.geode.distributed.ConfigurationProperties.DISTRIBUTED_SYSTEM_ID;
+import static org.apache.geode.distributed.ConfigurationProperties.REMOTE_LOCATORS;
 import static org.apache.geode.test.dunit.LogWriterUtils.getLogWriter;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
 import java.util.List;
+import java.util.Properties;
 
+import org.apache.geode.test.dunit.rules.LocatorServerStartupRule;
+import org.apache.geode.test.dunit.rules.MemberVM;
+import org.apache.geode.test.junit.rules.GfshShellConnectionRule;
+import org.junit.Before;
+import org.junit.Rule;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
@@ -33,29 +41,55 @@ import org.apache.geode.test.dunit.IgnoredException;
 import org.apache.geode.test.junit.categories.DistributedTest;
 
 @Category(DistributedTest.class)
-public class DestroyGatewaySenderCommandDUnitTest extends WANCommandTestBase {
+public class DestroyGatewaySenderCommandDUnitTest {
+
+  @Rule
+  public LocatorServerStartupRule locatorServerStartupRule = new LocatorServerStartupRule();
+
+  @Rule
+  public GfshShellConnectionRule gfsh = new GfshShellConnectionRule();
+
+  private MemberVM locatorSite1;
+  private MemberVM locatorSite2;
+  private MemberVM server1;
+  private MemberVM server2;
+  private MemberVM server3;
+
+  @Before
+  public void before() throws Exception {
+    Properties props = new Properties();
+    props.setProperty(DISTRIBUTED_SYSTEM_ID, "" + 1);
+    locatorSite1 = locatorServerStartupRule.startLocatorVM(1, props);
+
+    props.setProperty(DISTRIBUTED_SYSTEM_ID, "" + 2);
+    props.setProperty(REMOTE_LOCATORS, "localhost[" + locatorSite1.getPort() + "]");
+    locatorSite2 = locatorServerStartupRule.startLocatorVM(2, props);
+
+    // Connect Gfsh to locator.
+    gfsh.connectAndVerify(locatorSite1);
+  }
+
   @Test
-  public void testDestroyGatewaySender_NotCreatedSender() {
-    Integer dsIdPort = vm1.invoke(() -> createFirstLocatorWithDSId(1));
-    propsSetUp(dsIdPort);
+  public void testDestroyGatewaySender_NotCreatedSender() throws Exception {
+    Integer locator1Port = locatorSite1.getPort();
 
-    vm2.invoke(() -> createFirstRemoteLocator(2, dsIdPort));
-    vm3.invoke(() -> createCache(dsIdPort));
-    vm4.invoke(() -> createCache(dsIdPort));
-    vm5.invoke(() -> createCache(dsIdPort));
+    // setup servers in Site #1
+    server1 = locatorServerStartupRule.startServerVM(3, locator1Port);
+    server2 = locatorServerStartupRule.startServerVM(4, locator1Port);
+    server3 = locatorServerStartupRule.startServerVM(5, locator1Port);
 
     // Test Destroy Command
     String command =
         CliStrings.DESTROY_GATEWAYSENDER + " --" + CliStrings.DESTROY_GATEWAYSENDER__ID + "=ln";
     CommandResult cmdResult = executeCommandWithIgnoredExceptions(command);
     if (cmdResult != null) {
-      String strCmdResult = commandResultToString(cmdResult);
+      String strCmdResult = cmdResult.toString();
       getLogWriter().info(
           "testDestroyGatewaySender_NotCreatedSender stringResult : " + strCmdResult + ">>>>");
       assertEquals(Result.Status.OK, cmdResult.getStatus());
       TabularResultData resultData = (TabularResultData) cmdResult.getResultData();
       List<String> status = resultData.retrieveAllValues("Status");
-      assertEquals(5, status.size());
+      assertEquals(3, status.size());
       for (String stat : status) {
         assertTrue("GatewaySender destroy should fail", stat.contains("ERROR:"));
       }
@@ -67,7 +101,7 @@ public class DestroyGatewaySenderCommandDUnitTest extends WANCommandTestBase {
   private CommandResult executeCommandWithIgnoredExceptions(String command) {
     final IgnoredException ignored = IgnoredException.addIgnoredException("Could not connect");
     try {
-      return executeCommand(command);
+      return gfsh.executeCommand(command);
     } finally {
       ignored.remove();
     }
diff --git a/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/wancommand/PauseGatewaySenderCommandDUnitTest.java b/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/wancommand/PauseGatewaySenderCommandDUnitTest.java
index 246ff97..3e1f2d9 100644
--- a/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/wancommand/PauseGatewaySenderCommandDUnitTest.java
+++ b/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/wancommand/PauseGatewaySenderCommandDUnitTest.java
@@ -14,6 +14,13 @@
  */
 package org.apache.geode.internal.cache.wan.wancommand;
 
+import static org.apache.geode.distributed.ConfigurationProperties.DISTRIBUTED_SYSTEM_ID;
+import static org.apache.geode.distributed.ConfigurationProperties.GROUPS;
+import static org.apache.geode.distributed.ConfigurationProperties.REMOTE_LOCATORS;
+import static org.apache.geode.internal.cache.wan.wancommand.WANCommandUtils.createSender;
+import static org.apache.geode.internal.cache.wan.wancommand.WANCommandUtils.getMemberIdCallable;
+import static org.apache.geode.internal.cache.wan.wancommand.WANCommandUtils.startSender;
+import static org.apache.geode.internal.cache.wan.wancommand.WANCommandUtils.verifySenderState;
 import static org.apache.geode.test.dunit.Assert.assertEquals;
 import static org.apache.geode.test.dunit.Assert.assertFalse;
 import static org.apache.geode.test.dunit.Assert.assertTrue;
@@ -22,7 +29,13 @@ import static org.apache.geode.test.dunit.LogWriterUtils.getLogWriter;
 import static org.apache.geode.test.dunit.Wait.pause;
 
 import java.util.List;
+import java.util.Properties;
 
+import org.apache.geode.test.dunit.rules.LocatorServerStartupRule;
+import org.apache.geode.test.dunit.rules.MemberVM;
+import org.apache.geode.test.junit.rules.GfshShellConnectionRule;
+import org.junit.Before;
+import org.junit.Rule;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
@@ -34,24 +47,55 @@ import org.apache.geode.management.internal.cli.result.TabularResultData;
 import org.apache.geode.test.junit.categories.DistributedTest;
 
 @Category(DistributedTest.class)
-public class PauseGatewaySenderCommandDUnitTest extends WANCommandTestBase {
+public class PauseGatewaySenderCommandDUnitTest {
+
+  @Rule
+  public LocatorServerStartupRule locatorServerStartupRule = new LocatorServerStartupRule();
+
+  @Rule
+  public GfshShellConnectionRule gfsh = new GfshShellConnectionRule();
+
+  private MemberVM locatorSite1;
+  private MemberVM locatorSite2;
+  private MemberVM server1;
+  private MemberVM server2;
+  private MemberVM server3;
+  private MemberVM server4;
+  private MemberVM server5;
+
+  @Before
+  public void before() throws Exception {
+    Properties props = new Properties();
+    props.setProperty(DISTRIBUTED_SYSTEM_ID, "" + 1);
+    locatorSite1 = locatorServerStartupRule.startLocatorVM(1, props);
+
+    props.setProperty(DISTRIBUTED_SYSTEM_ID, "" + 2);
+    props.setProperty(REMOTE_LOCATORS, "localhost[" + locatorSite1.getPort() + "]");
+    locatorSite2 = locatorServerStartupRule.startLocatorVM(2, props);
+
+    // Connect Gfsh to locator.
+    gfsh.connectAndVerify(locatorSite1);
+  }
+
   @Test
-  public void testPauseGatewaySender_ErrorConditions() {
-    Integer dsIdPort = vm1.invoke(() -> createFirstLocatorWithDSId(1));
-    propsSetUp(dsIdPort);
-    vm2.invoke(() -> createFirstRemoteLocator(2, dsIdPort));
+  public void testPauseGatewaySender_ErrorConditions() throws Exception {
+
+    Integer locator1Port = locatorSite1.getPort();
 
-    vm3.invoke(() -> createCache(dsIdPort));
-    vm3.invoke(() -> createSender("ln", 2, false, 100, 400, false, false, null, true));
+    // setup servers in Site #1
+    server1 = locatorServerStartupRule.startServerVM(3, locator1Port);
+    server2 = locatorServerStartupRule.startServerVM(4, locator1Port);
+    server3 = locatorServerStartupRule.startServerVM(5, locator1Port);
+    server3.invoke(() -> createSender("ln", 2, false, 100, 400, false, false, null, true));
 
-    final DistributedMember vm1Member = vm3.invoke(this::getMember);
+    final DistributedMember vm1Member = (DistributedMember) server1.invoke(getMemberIdCallable());
     String command = CliStrings.PAUSE_GATEWAYSENDER + " --" + CliStrings.PAUSE_GATEWAYSENDER__ID
         + "=ln --" + CliStrings.MEMBER + "=" + vm1Member.getId() + " --" + CliStrings.GROUP
         + "=SenderGroup1";
-    CommandResult cmdResult = executeCommand(command);
+    CommandResult cmdResult = gfsh.executeCommand(command);
 
     if (cmdResult != null) {
-      String strCmdResult = commandResultToString(cmdResult);
+      String strCmdResult = cmdResult.toString();
       getLogWriter().info("testPauseGatewaySender stringResult : " + strCmdResult + ">>>>");
       assertEquals(Result.Status.ERROR, cmdResult.getStatus());
       assertTrue(strCmdResult.contains(CliStrings.PROVIDE_EITHER_MEMBER_OR_GROUP_MESSAGE));
@@ -64,103 +108,109 @@ public class PauseGatewaySenderCommandDUnitTest extends WANCommandTestBase {
    * test to validate that the start gateway sender starts the gateway sender on a member
    */
   @Test
-  public void testPauseGatewaySender_onMember() {
-    Integer dsIdPort = vm1.invoke(() -> createFirstLocatorWithDSId(1));
-    propsSetUp(dsIdPort);
-    vm2.invoke(() -> createFirstRemoteLocator(2, dsIdPort));
+  public void testPauseGatewaySender_onMember() throws Exception {
+    Integer locator1Port = locatorSite1.getPort();
+
+    // setup servers in Site #1
+    server1 = locatorServerStartupRule.startServerVM(3, locator1Port);
+    server2 = locatorServerStartupRule.startServerVM(4, locator1Port);
+    server3 = locatorServerStartupRule.startServerVM(5, locator1Port);
 
-    vm3.invoke(() -> createCache(dsIdPort));
-    vm3.invoke(() -> createSender("ln", 2, false, 100, 400, false, false, null, true));
-    vm3.invoke(() -> startSender("ln"));
-    vm3.invoke(() -> verifySenderState("ln", true, false));
+    server1.invoke(() -> createSender("ln", 2, false, 100, 400, false, false, null, true));
+    server1.invoke(() -> startSender("ln"));
+    server1.invoke(() -> verifySenderState("ln", true, false));
 
-    final DistributedMember vm1Member = vm3.invoke(this::getMember);
+    final DistributedMember vm1Member = (DistributedMember) server1.invoke(getMemberIdCallable());
     pause(10000);
     String command = CliStrings.PAUSE_GATEWAYSENDER + " --" + CliStrings.PAUSE_GATEWAYSENDER__ID
         + "=ln --" + CliStrings.MEMBER + "=" + vm1Member.getId();
-    CommandResult cmdResult = executeCommand(command);
+    CommandResult cmdResult = gfsh.executeCommand(command);
 
     if (cmdResult != null) {
-      String strCmdResult = commandResultToString(cmdResult);
+      String strCmdResult = cmdResult.toString();
       getLogWriter().info("testPauseGatewaySender stringResult : " + strCmdResult + ">>>>");
       assertEquals(Result.Status.OK, cmdResult.getStatus());
       assertTrue(strCmdResult.contains("is paused on member"));
     } else {
       fail("testPauseGatewaySender failed as did not get CommandResult");
     }
-    vm3.invoke(() -> verifySenderState("ln", true, true));
+    server1.invoke(() -> verifySenderState("ln", true, true));
   }
 
   @Test
-  public void testPauseGatewaySender() {
-    Integer dsIdPort = vm1.invoke(() -> createFirstLocatorWithDSId(1));
-    propsSetUp(dsIdPort);
-    vm2.invoke(() -> createFirstRemoteLocator(2, dsIdPort));
-
-    vm3.invoke(() -> createCache(dsIdPort));
-    vm3.invoke(() -> createSender("ln", 2, false, 100, 400, false, false, null, true));
-    vm4.invoke(() -> createCache(dsIdPort));
-    vm4.invoke(() -> createSender("ln", 2, false, 100, 400, false, false, null, true));
-    vm5.invoke(() -> createCache(dsIdPort));
-    vm5.invoke(() -> createSender("ln", 2, false, 100, 400, false, false, null, true));
-    vm3.invoke(() -> startSender("ln"));
-    vm4.invoke(() -> startSender("ln"));
-    vm5.invoke(() -> startSender("ln"));
-    vm3.invoke(() -> verifySenderState("ln", true, false));
-    vm4.invoke(() -> verifySenderState("ln", true, false));
-    vm5.invoke(() -> verifySenderState("ln", true, false));
+  public void testPauseGatewaySender() throws Exception {
+    Integer locator1Port = locatorSite1.getPort();
+
+    // setup servers in Site #1
+    server1 = locatorServerStartupRule.startServerVM(3, locator1Port);
+    server2 = locatorServerStartupRule.startServerVM(4, locator1Port);
+    server3 = locatorServerStartupRule.startServerVM(5, locator1Port);
+
+    server1.invoke(() -> createSender("ln", 2, false, 100, 400, false, false, null, true));
+    server2.invoke(() -> createSender("ln", 2, false, 100, 400, false, false, null, true));
+    server3.invoke(() -> createSender("ln", 2, false, 100, 400, false, false, null, true));
+
+    server1.invoke(() -> startSender("ln"));
+    server2.invoke(() -> startSender("ln"));
+    server3.invoke(() -> startSender("ln"));
+
+    server1.invoke(() -> verifySenderState("ln", true, false));
+    server2.invoke(() -> verifySenderState("ln", true, false));
+    server3.invoke(() -> verifySenderState("ln", true, false));
 
     pause(10000);
     String command =
         CliStrings.PAUSE_GATEWAYSENDER + " --" + CliStrings.PAUSE_GATEWAYSENDER__ID + "=ln";
-    CommandResult cmdResult = executeCommand(command);
+    CommandResult cmdResult = gfsh.executeCommand(command);
 
     if (cmdResult != null) {
-      String strCmdResult = commandResultToString(cmdResult);
+      String strCmdResult = cmdResult.toString();
       getLogWriter().info("testPauseGatewaySender stringResult : " + strCmdResult + ">>>>");
       assertEquals(Result.Status.OK, cmdResult.getStatus());
       TabularResultData resultData = (TabularResultData) cmdResult.getResultData();
       List<String> status = resultData.retrieveAllValues("Result");
-      assertEquals(5, status.size());
-      assertTrue(status.contains("Error"));
+      assertEquals(3, status.size());
       assertTrue(status.contains("OK"));
     } else {
       fail("testPauseGatewaySender failed as did not get CommandResult");
     }
-    vm3.invoke(() -> verifySenderState("ln", true, true));
-    vm4.invoke(() -> verifySenderState("ln", true, true));
-    vm5.invoke(() -> verifySenderState("ln", true, true));
+    server1.invoke(() -> verifySenderState("ln", true, true));
+    server2.invoke(() -> verifySenderState("ln", true, true));
+    server3.invoke(() -> verifySenderState("ln", true, true));
   }
 
   /**
    * test to validate that the start gateway sender starts the gateway sender on a group of members
    */
   @Test
-  public void testPauseGatewaySender_Group() {
-    Integer dsIdPort = vm1.invoke(() -> createFirstLocatorWithDSId(1));
-    propsSetUp(dsIdPort);
-    vm2.invoke(() -> createFirstRemoteLocator(2, dsIdPort));
-
-    vm3.invoke(() -> createCacheWithGroups(dsIdPort, "SenderGroup1"));
-    vm3.invoke(() -> createSender("ln", 2, false, 100, 400, false, false, null, true));
-    vm4.invoke(() -> createCacheWithGroups(dsIdPort, "SenderGroup1"));
-    vm4.invoke(() -> createSender("ln", 2, false, 100, 400, false, false, null, true));
-    vm5.invoke(() -> createCacheWithGroups(dsIdPort, "SenderGroup1"));
-    vm5.invoke(() -> createSender("ln", 2, false, 100, 400, false, false, null, true));
-    vm3.invoke(() -> startSender("ln"));
-    vm4.invoke(() -> startSender("ln"));
-    vm5.invoke(() -> startSender("ln"));
-    vm3.invoke(() -> verifySenderState("ln", true, false));
-    vm4.invoke(() -> verifySenderState("ln", true, false));
-    vm5.invoke(() -> verifySenderState("ln", true, false));
+  public void testPauseGatewaySender_Group() throws Exception {
+    Integer locator1Port = locatorSite1.getPort();
+
+    // setup servers in Site #1
+    String groups = "SenderGroup1";
+    server1 = startServerWithGroups(3, groups, locator1Port);
+    server2 = startServerWithGroups(4, groups, locator1Port);
+    server3 = startServerWithGroups(5, groups, locator1Port);
+
+    server1.invoke(() -> createSender("ln", 2, false, 100, 400, false, false, null, true));
+    server2.invoke(() -> createSender("ln", 2, false, 100, 400, false, false, null, true));
+    server3.invoke(() -> createSender("ln", 2, false, 100, 400, false, false, null, true));
+
+    server1.invoke(() -> startSender("ln"));
+    server2.invoke(() -> startSender("ln"));
+    server3.invoke(() -> startSender("ln"));
+
+    server1.invoke(() -> verifySenderState("ln", true, false));
+    server2.invoke(() -> verifySenderState("ln", true, false));
+    server3.invoke(() -> verifySenderState("ln", true, false));
 
     pause(10000);
     String command = CliStrings.PAUSE_GATEWAYSENDER + " --" + CliStrings.PAUSE_GATEWAYSENDER__ID
         + "=ln --" + CliStrings.GROUP + "=SenderGroup1";
-    CommandResult cmdResult = executeCommand(command);
+    CommandResult cmdResult = gfsh.executeCommand(command);
 
     if (cmdResult != null) {
-      String strCmdResult = commandResultToString(cmdResult);
+      String strCmdResult = cmdResult.toString();
       getLogWriter().info("testPauseGatewaySender_Group stringResult : " + strCmdResult + ">>>>");
       assertEquals(Result.Status.OK, cmdResult.getStatus());
       TabularResultData resultData = (TabularResultData) cmdResult.getResultData();
@@ -171,9 +221,9 @@ public class PauseGatewaySenderCommandDUnitTest extends WANCommandTestBase {
     } else {
       fail("testPauseGatewaySender failed as did not get CommandResult");
     }
-    vm3.invoke(() -> verifySenderState("ln", true, true));
-    vm4.invoke(() -> verifySenderState("ln", true, true));
-    vm5.invoke(() -> verifySenderState("ln", true, true));
+    server1.invoke(() -> verifySenderState("ln", true, true));
+    server2.invoke(() -> verifySenderState("ln", true, true));
+    server3.invoke(() -> verifySenderState("ln", true, true));
   }
 
   /**
@@ -181,39 +231,42 @@ public class PauseGatewaySenderCommandDUnitTest extends WANCommandTestBase {
    * to multiple groups
    */
   @Test
-  public void testPauseGatewaySender_MultipleGroup() {
-    Integer dsIdPort = vm1.invoke(() -> createFirstLocatorWithDSId(1));
-    propsSetUp(dsIdPort);
-    vm2.invoke(() -> createFirstRemoteLocator(2, dsIdPort));
-
-    vm3.invoke(() -> createCacheWithGroups(dsIdPort, "SenderGroup1"));
-    vm3.invoke(() -> createSender("ln", 2, false, 100, 400, false, false, null, true));
-    vm4.invoke(() -> createCacheWithGroups(dsIdPort, "SenderGroup1"));
-    vm4.invoke(() -> createSender("ln", 2, false, 100, 400, false, false, null, true));
-    vm5.invoke(() -> createCacheWithGroups(dsIdPort, "SenderGroup1, SenderGroup2"));
-    vm5.invoke(() -> createSender("ln", 2, false, 100, 400, false, false, null, true));
-    vm6.invoke(() -> createCacheWithGroups(dsIdPort, "SenderGroup2"));
-    vm6.invoke(() -> createSender("ln", 2, false, 100, 400, false, false, null, true));
-    vm7.invoke(() -> createCacheWithGroups(dsIdPort, "SenderGroup3"));
-    vm7.invoke(() -> createSender("ln", 2, false, 100, 400, false, false, null, true));
-    vm3.invoke(() -> startSender("ln"));
-    vm4.invoke(() -> startSender("ln"));
-    vm5.invoke(() -> startSender("ln"));
-    vm6.invoke(() -> startSender("ln"));
-    vm7.invoke(() -> startSender("ln"));
-    vm3.invoke(() -> verifySenderState("ln", true, false));
-    vm4.invoke(() -> verifySenderState("ln", true, false));
-    vm5.invoke(() -> verifySenderState("ln", true, false));
-    vm6.invoke(() -> verifySenderState("ln", true, false));
-    vm7.invoke(() -> verifySenderState("ln", true, false));
+  public void testPauseGatewaySender_MultipleGroup() throws Exception {
+
+    Integer locator1Port = locatorSite1.getPort();
+
+    // setup servers in Site #1
+    server1 = startServerWithGroups(3, "SenderGroup1", locator1Port);
+    server2 = startServerWithGroups(4, "SenderGroup1", locator1Port);
+    server3 = startServerWithGroups(5, "SenderGroup1", locator1Port);
+    server4 = startServerWithGroups(6, "SenderGroup2", locator1Port);
+    server5 = startServerWithGroups(7, "SenderGroup3", locator1Port);
+
+    server1.invoke(() -> createSender("ln", 2, false, 100, 400, false, false, null, true));
+    server2.invoke(() -> createSender("ln", 2, false, 100, 400, false, false, null, true));
+    server3.invoke(() -> createSender("ln", 2, false, 100, 400, false, false, null, true));
+    server4.invoke(() -> createSender("ln", 2, false, 100, 400, false, false, null, true));
+    server5.invoke(() -> createSender("ln", 2, false, 100, 400, false, false, null, true));
+
+    server1.invoke(() -> startSender("ln"));
+    server2.invoke(() -> startSender("ln"));
+    server3.invoke(() -> startSender("ln"));
+    server4.invoke(() -> startSender("ln"));
+    server5.invoke(() -> startSender("ln"));
+
+    server1.invoke(() -> verifySenderState("ln", true, false));
+    server2.invoke(() -> verifySenderState("ln", true, false));
+    server3.invoke(() -> verifySenderState("ln", true, false));
+    server4.invoke(() -> verifySenderState("ln", true, false));
+    server5.invoke(() -> verifySenderState("ln", true, false));
 
     pause(10000);
     String command = CliStrings.PAUSE_GATEWAYSENDER + " --" + CliStrings.PAUSE_GATEWAYSENDER__ID
         + "=ln --" + CliStrings.GROUP + "=SenderGroup1,SenderGroup2";
-    CommandResult cmdResult = executeCommand(command);
+    CommandResult cmdResult = gfsh.executeCommand(command);
 
     if (cmdResult != null) {
-      String strCmdResult = commandResultToString(cmdResult);
+      String strCmdResult = cmdResult.toString();
       getLogWriter().info("testPauseGatewaySender_Group stringResult : " + strCmdResult + ">>>>");
       assertEquals(Result.Status.OK, cmdResult.getStatus());
       TabularResultData resultData = (TabularResultData) cmdResult.getResultData();
@@ -224,10 +277,16 @@ public class PauseGatewaySenderCommandDUnitTest extends WANCommandTestBase {
     } else {
       fail("testPauseGatewaySender failed as did not get CommandResult");
     }
-    vm3.invoke(() -> verifySenderState("ln", true, true));
-    vm4.invoke(() -> verifySenderState("ln", true, true));
-    vm5.invoke(() -> verifySenderState("ln", true, true));
-    vm6.invoke(() -> verifySenderState("ln", true, true));
-    vm7.invoke(() -> verifySenderState("ln", true, false));
+    server1.invoke(() -> verifySenderState("ln", true, true));
+    server2.invoke(() -> verifySenderState("ln", true, true));
+    server3.invoke(() -> verifySenderState("ln", true, true));
+    server4.invoke(() -> verifySenderState("ln", true, true));
+    server5.invoke(() -> verifySenderState("ln", true, false));
+  }
+
+  private MemberVM startServerWithGroups(int index, String groups, int locPort) throws Exception {
+    Properties props = new Properties();
+    props.setProperty(GROUPS, groups);
+    return locatorServerStartupRule.startServerVM(index, props, locPort);
   }
 }
diff --git a/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/wancommand/ResumeGatewaySenderCommandDUnitTest.java b/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/wancommand/ResumeGatewaySenderCommandDUnitTest.java
index 09aa627..2bda947 100644
--- a/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/wancommand/ResumeGatewaySenderCommandDUnitTest.java
+++ b/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/wancommand/ResumeGatewaySenderCommandDUnitTest.java
@@ -15,6 +15,14 @@
 
 package org.apache.geode.internal.cache.wan.wancommand;
 
+import static org.apache.geode.distributed.ConfigurationProperties.DISTRIBUTED_SYSTEM_ID;
+import static org.apache.geode.distributed.ConfigurationProperties.GROUPS;
+import static org.apache.geode.distributed.ConfigurationProperties.REMOTE_LOCATORS;
+import static org.apache.geode.internal.cache.wan.wancommand.WANCommandUtils.createSender;
+import static org.apache.geode.internal.cache.wan.wancommand.WANCommandUtils.getMemberIdCallable;
+import static org.apache.geode.internal.cache.wan.wancommand.WANCommandUtils.pauseSender;
+import static org.apache.geode.internal.cache.wan.wancommand.WANCommandUtils.startSender;
+import static org.apache.geode.internal.cache.wan.wancommand.WANCommandUtils.verifySenderState;
 import static org.apache.geode.test.dunit.LogWriterUtils.getLogWriter;
 import static org.apache.geode.test.dunit.Wait.pause;
 import static org.junit.Assert.assertEquals;
@@ -23,7 +31,13 @@ import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
 import java.util.List;
+import java.util.Properties;
 
+import org.apache.geode.test.dunit.rules.LocatorServerStartupRule;
+import org.apache.geode.test.dunit.rules.MemberVM;
+import org.apache.geode.test.junit.rules.GfshShellConnectionRule;
+import org.junit.Before;
+import org.junit.Rule;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
@@ -35,24 +49,54 @@ import org.apache.geode.management.internal.cli.result.TabularResultData;
 import org.apache.geode.test.junit.categories.DistributedTest;
 
 @Category(DistributedTest.class)
-public class ResumeGatewaySenderCommandDUnitTest extends WANCommandTestBase {
+public class ResumeGatewaySenderCommandDUnitTest {
+
+  @Rule
+  public LocatorServerStartupRule locatorServerStartupRule = new LocatorServerStartupRule();
+
+  @Rule
+  public GfshShellConnectionRule gfsh = new GfshShellConnectionRule();
+
+  private MemberVM locatorSite1;
+  private MemberVM locatorSite2;
+  private MemberVM server1;
+  private MemberVM server2;
+  private MemberVM server3;
+  private MemberVM server4;
+  private MemberVM server5;
+
+  @Before
+  public void before() throws Exception {
+    Properties props = new Properties();
+    props.setProperty(DISTRIBUTED_SYSTEM_ID, "" + 1);
+    locatorSite1 = locatorServerStartupRule.startLocatorVM(1, props);
+
+    props.setProperty(DISTRIBUTED_SYSTEM_ID, "" + 2);
+    props.setProperty(REMOTE_LOCATORS, "localhost[" + locatorSite1.getPort() + "]");
+    locatorSite2 = locatorServerStartupRule.startLocatorVM(2, props);
+
+    // Connect Gfsh to locator.
+    gfsh.connectAndVerify(locatorSite1);
+  }
+
   @Test
-  public void testResumeGatewaySender_ErrorConditions() {
-    Integer dsIdPort = vm1.invoke(() -> createFirstLocatorWithDSId(1));
-    propsSetUp(dsIdPort);
-    vm2.invoke(() -> createFirstRemoteLocator(2, dsIdPort));
+  public void testResumeGatewaySender_ErrorConditions() throws Exception {
+
+    Integer locator1Port = locatorSite1.getPort();
+
+    // setup servers in Site #1
+    server1 = locatorServerStartupRule.startServerVM(3, locator1Port);
 
-    vm3.invoke(() -> createCache(dsIdPort));
-    vm3.invoke(() -> createSender("ln", 2, false, 100, 400, false, false, null, true));
+    server1.invoke(() -> createSender("ln", 2, false, 100, 400, false, false, null, true));
 
-    final DistributedMember vm1Member = vm3.invoke(this::getMember);
+    final DistributedMember vm1Member = (DistributedMember) server1.invoke(getMemberIdCallable());
     String command = CliStrings.RESUME_GATEWAYSENDER + " --" + CliStrings.RESUME_GATEWAYSENDER__ID
         + "=ln --" + CliStrings.MEMBER + "=" + vm1Member.getId() + " --" + CliStrings.GROUP
         + "=SenderGroup1";
-    CommandResult cmdResult = executeCommand(command);
+    CommandResult cmdResult = gfsh.executeCommand(command);
 
     if (cmdResult != null) {
-      String strCmdResult = commandResultToString(cmdResult);
+      String strCmdResult = cmdResult.toString();
       getLogWriter()
           .info("testResumeGatewaySender_ErrorConditions stringResult : " + strCmdResult + ">>>>");
       assertEquals(Result.Status.ERROR, cmdResult.getStatus());
@@ -63,123 +107,136 @@ public class ResumeGatewaySenderCommandDUnitTest extends WANCommandTestBase {
   }
 
   @Test
-  public void testResumeGatewaySender() {
-    Integer dsIdPort = vm1.invoke(() -> createFirstLocatorWithDSId(1));
-    propsSetUp(dsIdPort);
-    vm2.invoke(() -> createFirstRemoteLocator(2, dsIdPort));
-
-    vm3.invoke(() -> createCache(dsIdPort));
-    vm3.invoke(() -> createSender("ln", 2, false, 100, 400, false, false, null, true));
-    vm4.invoke(() -> createCache(dsIdPort));
-    vm4.invoke(() -> createSender("ln", 2, false, 100, 400, false, false, null, true));
-    vm5.invoke(() -> createCache(dsIdPort));
-    vm5.invoke(() -> createSender("ln", 2, false, 100, 400, false, false, null, true));
-    vm3.invoke(() -> startSender("ln"));
-    vm4.invoke(() -> startSender("ln"));
-    vm5.invoke(() -> startSender("ln"));
-    vm3.invoke(() -> verifySenderState("ln", true, false));
-    vm4.invoke(() -> verifySenderState("ln", true, false));
-    vm5.invoke(() -> verifySenderState("ln", true, false));
-    vm3.invoke(() -> pauseSender("ln"));
-    vm4.invoke(() -> pauseSender("ln"));
-    vm5.invoke(() -> pauseSender("ln"));
-    vm3.invoke(() -> verifySenderState("ln", true, true));
-    vm4.invoke(() -> verifySenderState("ln", true, true));
-    vm5.invoke(() -> verifySenderState("ln", true, true));
+  public void testResumeGatewaySender() throws Exception {
+
+    Integer locator1Port = locatorSite1.getPort();
+
+    // setup servers in Site #1
+    server1 = locatorServerStartupRule.startServerVM(3, locator1Port);
+    server2 = locatorServerStartupRule.startServerVM(4, locator1Port);
+    server3 = locatorServerStartupRule.startServerVM(5, locator1Port);
+
+    server1.invoke(() -> createSender("ln", 2, false, 100, 400, false, false, null, true));
+    server2.invoke(() -> createSender("ln", 2, false, 100, 400, false, false, null, true));
+    server3.invoke(() -> createSender("ln", 2, false, 100, 400, false, false, null, true));
+
+    server1.invoke(() -> startSender("ln"));
+    server2.invoke(() -> startSender("ln"));
+    server3.invoke(() -> startSender("ln"));
+
+    server1.invoke(() -> verifySenderState("ln", true, false));
+    server2.invoke(() -> verifySenderState("ln", true, false));
+    server3.invoke(() -> verifySenderState("ln", true, false));
+
+    server1.invoke(() -> pauseSender("ln"));
+    server2.invoke(() -> pauseSender("ln"));
+    server3.invoke(() -> pauseSender("ln"));
+
+    server1.invoke(() -> verifySenderState("ln", true, true));
+    server2.invoke(() -> verifySenderState("ln", true, true));
+    server3.invoke(() -> verifySenderState("ln", true, true));
 
     pause(10000);
     String command =
         CliStrings.RESUME_GATEWAYSENDER + " --" + CliStrings.RESUME_GATEWAYSENDER__ID + "=ln";
-    CommandResult cmdResult = executeCommand(command);
+    CommandResult cmdResult = gfsh.executeCommand(command);
 
     if (cmdResult != null) {
-      String strCmdResult = commandResultToString(cmdResult);
+      String strCmdResult = cmdResult.toString();
       getLogWriter().info("testResumeGatewaySender stringResult : " + strCmdResult + ">>>>");
       assertEquals(Result.Status.OK, cmdResult.getStatus());
       TabularResultData resultData = (TabularResultData) cmdResult.getResultData();
       List<String> status = resultData.retrieveAllValues("Result");
-      assertEquals(5, status.size());
-      assertTrue(status.contains("Error"));
+      assertEquals(3, status.size());
       assertTrue(status.contains("OK"));
     } else {
       fail("testResumeGatewaySender failed as did not get CommandResult");
     }
-    vm3.invoke(() -> verifySenderState("ln", true, false));
-    vm4.invoke(() -> verifySenderState("ln", true, false));
-    vm5.invoke(() -> verifySenderState("ln", true, false));
+    server1.invoke(() -> verifySenderState("ln", true, false));
+    server2.invoke(() -> verifySenderState("ln", true, false));
+    server3.invoke(() -> verifySenderState("ln", true, false));
   }
 
   /**
    * test to validate that the start gateway sender starts the gateway sender on a member
    */
   @Test
-  public void testResumeGatewaySender_onMember() {
-    Integer dsIdPort = vm1.invoke(() -> createFirstLocatorWithDSId(1));
-    propsSetUp(dsIdPort);
-    vm2.invoke(() -> createFirstRemoteLocator(2, dsIdPort));
-
-    vm3.invoke(() -> createCache(dsIdPort));
-    vm3.invoke(() -> createSender("ln", 2, false, 100, 400, false, false, null, true));
-    vm3.invoke(() -> startSender("ln"));
-    vm3.invoke(() -> verifySenderState("ln", true, false));
-    vm3.invoke(() -> pauseSender("ln"));
-    vm3.invoke(() -> verifySenderState("ln", true, true));
-
-    final DistributedMember vm1Member = vm3.invoke(this::getMember);
+  public void testResumeGatewaySender_onMember() throws Exception {
+    Integer locator1Port = locatorSite1.getPort();
+
+    // setup servers in Site #1
+    server1 = locatorServerStartupRule.startServerVM(3, locator1Port);
+    server2 = locatorServerStartupRule.startServerVM(4, locator1Port);
+    server3 = locatorServerStartupRule.startServerVM(5, locator1Port);
+
+    server1.invoke(() -> createSender("ln", 2, false, 100, 400, false, false, null, true));
+    server1.invoke(() -> startSender("ln"));
+    server1.invoke(() -> verifySenderState("ln", true, false));
+    server1.invoke(() -> pauseSender("ln"));
+    server1.invoke(() -> verifySenderState("ln", true, true));
+
+    final DistributedMember vm1Member = (DistributedMember) server1.invoke(getMemberIdCallable());
     pause(10000);
     String command = CliStrings.RESUME_GATEWAYSENDER + " --" + CliStrings.RESUME_GATEWAYSENDER__ID
         + "=ln --" + CliStrings.MEMBER + "=" + vm1Member.getId();
-    CommandResult cmdResult = executeCommand(command);
+    CommandResult cmdResult = gfsh.executeCommand(command);
     if (cmdResult != null) {
-      String strCmdResult = commandResultToString(cmdResult);
+      String strCmdResult = cmdResult.toString();
       getLogWriter().info("testResumeGatewaySender stringResult : " + strCmdResult + ">>>>");
       assertEquals(Result.Status.OK, cmdResult.getStatus());
       assertTrue(strCmdResult.contains("is resumed on member"));
     } else {
       fail("testResumeGatewaySender failed as did not get CommandResult");
     }
-    vm3.invoke(() -> verifySenderState("ln", true, false));
+    server1.invoke(() -> verifySenderState("ln", true, false));
   }
 
   /**
    * test to validate that the start gateway sender starts the gateway sender on a group of members
    */
   @Test
-  public void testResumeGatewaySender_Group() {
-    Integer dsIdPort = vm1.invoke(() -> createFirstLocatorWithDSId(1));
-    propsSetUp(dsIdPort);
-    vm2.invoke(() -> createFirstRemoteLocator(2, dsIdPort));
-
-    vm3.invoke(() -> createCacheWithGroups(dsIdPort, "SenderGroup1"));
-    vm3.invoke(() -> createSender("ln", 2, false, 100, 400, false, false, null, true));
-    vm4.invoke(() -> createCacheWithGroups(dsIdPort, "SenderGroup1"));
-    vm4.invoke(() -> createSender("ln", 2, false, 100, 400, false, false, null, true));
-    vm5.invoke(() -> createCacheWithGroups(dsIdPort, "SenderGroup1"));
-    vm5.invoke(() -> createSender("ln", 2, false, 100, 400, false, false, null, true));
-
-    vm3.invoke(() -> startSender("ln"));
-    vm4.invoke(() -> startSender("ln"));
-    vm5.invoke(() -> startSender("ln"));
-
-    vm3.invoke(() -> verifySenderState("ln", true, false));
-    vm4.invoke(() -> verifySenderState("ln", true, false));
-    vm5.invoke(() -> verifySenderState("ln", true, false));
-
-    vm3.invoke(() -> pauseSender("ln"));
-    vm4.invoke(() -> pauseSender("ln"));
-    vm5.invoke(() -> pauseSender("ln"));
-
-    vm3.invoke(() -> verifySenderState("ln", true, true));
-    vm4.invoke(() -> verifySenderState("ln", true, true));
-    vm5.invoke(() -> verifySenderState("ln", true, true));
+  public void testResumeGatewaySender_Group() throws Exception {
+
+    Integer locator1Port = locatorSite1.getPort();
+
+    // setup servers in Site #1
+    /*
+     * String group = "SenderGroup1"; Properties props = new Properties(); props.setProperty(GROUPS,
+     * group); server1 = locatorServerStartupRule.startServerVM(3, props, locator1Port); server2 =
+     * locatorServerStartupRule.startServerVM(4, props, locator1Port); server3 =
+     * locatorServerStartupRule.startServerVM(5, props, locator1Port);
+     */
+    server1 = startServerWithGroups(3, "SenderGroup1", locator1Port);
+    server2 = startServerWithGroups(4, "SenderGroup1", locator1Port);
+    server3 = startServerWithGroups(5, "SenderGroup1", locator1Port);
+
+    server1.invoke(() -> createSender("ln", 2, false, 100, 400, false, false, null, true));
+    server2.invoke(() -> createSender("ln", 2, false, 100, 400, false, false, null, true));
+    server3.invoke(() -> createSender("ln", 2, false, 100, 400, false, false, null, true));
+
+    server1.invoke(() -> startSender("ln"));
+    server2.invoke(() -> startSender("ln"));
+    server3.invoke(() -> startSender("ln"));
+
+    server1.invoke(() -> verifySenderState("ln", true, false));
+    server2.invoke(() -> verifySenderState("ln", true, false));
+    server3.invoke(() -> verifySenderState("ln", true, false));
+
+    server1.invoke(() -> pauseSender("ln"));
+    server2.invoke(() -> pauseSender("ln"));
+    server3.invoke(() -> pauseSender("ln"));
+
+    server1.invoke(() -> verifySenderState("ln", true, true));
+    server2.invoke(() -> verifySenderState("ln", true, true));
+    server3.invoke(() -> verifySenderState("ln", true, true));
 
     pause(10000);
     String command = CliStrings.RESUME_GATEWAYSENDER + " --" + CliStrings.RESUME_GATEWAYSENDER__ID
         + "=ln --" + CliStrings.GROUP + "=SenderGroup1";
-    CommandResult cmdResult = executeCommand(command);
+    CommandResult cmdResult = gfsh.executeCommand(command);
 
     if (cmdResult != null) {
-      String strCmdResult = commandResultToString(cmdResult);
+      String strCmdResult = cmdResult.toString();
       getLogWriter().info("testResumeGatewaySender stringResult : " + strCmdResult + ">>>>");
       assertEquals(Result.Status.OK, cmdResult.getStatus());
 
@@ -191,9 +248,9 @@ public class ResumeGatewaySenderCommandDUnitTest extends WANCommandTestBase {
     } else {
       fail("testResumeGatewaySender failed as did not get CommandResult");
     }
-    vm3.invoke(() -> verifySenderState("ln", true, false));
-    vm4.invoke(() -> verifySenderState("ln", true, false));
-    vm5.invoke(() -> verifySenderState("ln", true, false));
+    server1.invoke(() -> verifySenderState("ln", true, false));
+    server2.invoke(() -> verifySenderState("ln", true, false));
+    server3.invoke(() -> verifySenderState("ln", true, false));
   }
 
   /**
@@ -201,49 +258,68 @@ public class ResumeGatewaySenderCommandDUnitTest extends WANCommandTestBase {
    * to multiple groups
    */
   @Test
-  public void testResumeGatewaySender_MultipleGroup() {
-    Integer dsIdPort = vm1.invoke(() -> createFirstLocatorWithDSId(1));
-    propsSetUp(dsIdPort);
-    vm2.invoke(() -> createFirstRemoteLocator(2, dsIdPort));
-
-    vm3.invoke(() -> createCacheWithGroups(dsIdPort, "SenderGroup1"));
-    vm3.invoke(() -> createSender("ln", 2, false, 100, 400, false, false, null, true));
-    vm4.invoke(() -> createCacheWithGroups(dsIdPort, "SenderGroup1"));
-    vm4.invoke(() -> createSender("ln", 2, false, 100, 400, false, false, null, true));
-    vm5.invoke(() -> createCacheWithGroups(dsIdPort, "SenderGroup1, SenderGroup2"));
-    vm5.invoke(() -> createSender("ln", 2, false, 100, 400, false, false, null, true));
-    vm6.invoke(() -> createCacheWithGroups(dsIdPort, "SenderGroup2"));
-    vm6.invoke(() -> createSender("ln", 2, false, 100, 400, false, false, null, true));
-    vm7.invoke(() -> createCacheWithGroups(dsIdPort, "SenderGroup3"));
-    vm7.invoke(() -> createSender("ln", 2, false, 100, 400, false, false, null, true));
-    vm3.invoke(() -> startSender("ln"));
-    vm4.invoke(() -> startSender("ln"));
-    vm5.invoke(() -> startSender("ln"));
-    vm6.invoke(() -> startSender("ln"));
-    vm7.invoke(() -> startSender("ln"));
-    vm3.invoke(() -> verifySenderState("ln", true, false));
-    vm4.invoke(() -> verifySenderState("ln", true, false));
-    vm5.invoke(() -> verifySenderState("ln", true, false));
-    vm6.invoke(() -> verifySenderState("ln", true, false));
-    vm7.invoke(() -> verifySenderState("ln", true, false));
-    vm3.invoke(() -> pauseSender("ln"));
-    vm4.invoke(() -> pauseSender("ln"));
-    vm5.invoke(() -> pauseSender("ln"));
-    vm6.invoke(() -> pauseSender("ln"));
-    vm7.invoke(() -> pauseSender("ln"));
-    vm3.invoke(() -> verifySenderState("ln", true, true));
-    vm4.invoke(() -> verifySenderState("ln", true, true));
-    vm5.invoke(() -> verifySenderState("ln", true, true));
-    vm6.invoke(() -> verifySenderState("ln", true, true));
-    vm7.invoke(() -> verifySenderState("ln", true, true));
+  public void testResumeGatewaySender_MultipleGroup() throws Exception {
+
+    Integer locator1Port = locatorSite1.getPort();
+
+    // setup servers in Site #1
+    /*
+     * String group = "SenderGroup1"; Properties props = new Properties(); props.setProperty(GROUPS,
+     * group); server1 = locatorServerStartupRule.startServerVM(3, props, locator1Port); server2 =
+     * locatorServerStartupRule.startServerVM(4, props, locator1Port);
+     * 
+     * props.setProperty(GROUPS, "SenderGroup1, SenderGroup2"); server3 =
+     * locatorServerStartupRule.startServerVM(5, props, locator1Port);
+     * 
+     * props.setProperty(GROUPS, "SenderGroup2"); server4 =
+     * locatorServerStartupRule.startServerVM(6, props, locator1Port);
+     * 
+     * props.setProperty(GROUPS, "SenderGroup3"); server5 =
+     * locatorServerStartupRule.startServerVM(7, props, locator1Port);
+     */
+    server1 = startServerWithGroups(3, "SenderGroup1", locator1Port);
+    server2 = startServerWithGroups(4, "SenderGroup1", locator1Port);
+    server3 = startServerWithGroups(5, "SenderGroup1, SenderGroup2", locator1Port);
+    server4 = startServerWithGroups(6, "SenderGroup2", locator1Port);
+    server5 = startServerWithGroups(7, "SenderGroup3", locator1Port);
+
+    server1.invoke(() -> createSender("ln", 2, false, 100, 400, false, false, null, true));
+    server2.invoke(() -> createSender("ln", 2, false, 100, 400, false, false, null, true));
+    server3.invoke(() -> createSender("ln", 2, false, 100, 400, false, false, null, true));
+    server4.invoke(() -> createSender("ln", 2, false, 100, 400, false, false, null, true));
+    server5.invoke(() -> createSender("ln", 2, false, 100, 400, false, false, null, true));
+
+    server1.invoke(() -> startSender("ln"));
+    server2.invoke(() -> startSender("ln"));
+    server3.invoke(() -> startSender("ln"));
+    server4.invoke(() -> startSender("ln"));
+    server5.invoke(() -> startSender("ln"));
+
+    server1.invoke(() -> verifySenderState("ln", true, false));
+    server2.invoke(() -> verifySenderState("ln", true, false));
+    server3.invoke(() -> verifySenderState("ln", true, false));
+    server4.invoke(() -> verifySenderState("ln", true, false));
+    server5.invoke(() -> verifySenderState("ln", true, false));
+
+    server1.invoke(() -> pauseSender("ln"));
+    server2.invoke(() -> pauseSender("ln"));
+    server3.invoke(() -> pauseSender("ln"));
+    server4.invoke(() -> pauseSender("ln"));
+    server5.invoke(() -> pauseSender("ln"));
+
+    server1.invoke(() -> verifySenderState("ln", true, true));
+    server2.invoke(() -> verifySenderState("ln", true, true));
+    server3.invoke(() -> verifySenderState("ln", true, true));
+    server4.invoke(() -> verifySenderState("ln", true, true));
+    server5.invoke(() -> verifySenderState("ln", true, true));
 
     pause(10000);
     String command = CliStrings.RESUME_GATEWAYSENDER + " --" + CliStrings.RESUME_GATEWAYSENDER__ID
         + "=ln --" + CliStrings.GROUP + "=SenderGroup1,SenderGroup2";
-    CommandResult cmdResult = executeCommand(command);
+    CommandResult cmdResult = gfsh.executeCommand(command);
 
     if (cmdResult != null) {
-      String strCmdResult = commandResultToString(cmdResult);
+      String strCmdResult = cmdResult.toString();
       getLogWriter().info("testResumeGatewaySender stringResult : " + strCmdResult + ">>>>");
       assertEquals(Result.Status.OK, cmdResult.getStatus());
       TabularResultData resultData = (TabularResultData) cmdResult.getResultData();
@@ -254,10 +330,16 @@ public class ResumeGatewaySenderCommandDUnitTest extends WANCommandTestBase {
     } else {
       fail("testResumeGatewaySender failed as did not get CommandResult");
     }
-    vm3.invoke(() -> verifySenderState("ln", true, false));
-    vm4.invoke(() -> verifySenderState("ln", true, false));
-    vm5.invoke(() -> verifySenderState("ln", true, false));
-    vm6.invoke(() -> verifySenderState("ln", true, false));
-    vm7.invoke(() -> verifySenderState("ln", true, true));
+    server1.invoke(() -> verifySenderState("ln", true, false));
+    server2.invoke(() -> verifySenderState("ln", true, false));
+    server3.invoke(() -> verifySenderState("ln", true, false));
+    server4.invoke(() -> verifySenderState("ln", true, false));
+    server5.invoke(() -> verifySenderState("ln", true, true));
+  }
+
+  private MemberVM startServerWithGroups(int index, String groups, int locPort) throws Exception {
+    Properties props = new Properties();
+    props.setProperty(GROUPS, groups);
+    return locatorServerStartupRule.startServerVM(index, props, locPort);
   }
 }
diff --git a/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/wancommand/StartGatewayReceiverCommandDUnitTest.java b/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/wancommand/StartGatewayReceiverCommandDUnitTest.java
index 5794d3a..5e5195c 100644
--- a/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/wancommand/StartGatewayReceiverCommandDUnitTest.java
+++ b/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/wancommand/StartGatewayReceiverCommandDUnitTest.java
@@ -14,6 +14,12 @@
  */
 package org.apache.geode.internal.cache.wan.wancommand;
 
+import static org.apache.geode.distributed.ConfigurationProperties.DISTRIBUTED_SYSTEM_ID;
+import static org.apache.geode.distributed.ConfigurationProperties.GROUPS;
+import static org.apache.geode.distributed.ConfigurationProperties.REMOTE_LOCATORS;
+import static org.apache.geode.internal.cache.wan.wancommand.WANCommandUtils.getMemberIdCallable;
+import static org.apache.geode.internal.cache.wan.wancommand.WANCommandUtils.createReceiver;
+import static org.apache.geode.internal.cache.wan.wancommand.WANCommandUtils.verifyReceiverState;
 import static org.apache.geode.test.dunit.Assert.assertEquals;
 import static org.apache.geode.test.dunit.Assert.assertFalse;
 import static org.apache.geode.test.dunit.Assert.assertTrue;
@@ -22,7 +28,13 @@ import static org.apache.geode.test.dunit.LogWriterUtils.getLogWriter;
 import static org.apache.geode.test.dunit.Wait.pause;
 
 import java.util.List;
+import java.util.Properties;
 
+import org.apache.geode.test.dunit.rules.LocatorServerStartupRule;
+import org.apache.geode.test.dunit.rules.MemberVM;
+import org.apache.geode.test.junit.rules.GfshShellConnectionRule;
+import org.junit.Before;
+import org.junit.Rule;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
@@ -31,33 +43,58 @@ import org.apache.geode.management.cli.Result;
 import org.apache.geode.management.internal.cli.i18n.CliStrings;
 import org.apache.geode.management.internal.cli.result.CommandResult;
 import org.apache.geode.management.internal.cli.result.TabularResultData;
-import org.apache.geode.test.dunit.Host;
-import org.apache.geode.test.dunit.VM;
 import org.apache.geode.test.junit.categories.DistributedTest;
-import org.apache.geode.test.junit.categories.FlakyTest;
 
 @Category(DistributedTest.class)
-public class StartGatewayReceiverCommandDUnitTest extends WANCommandTestBase {
+public class StartGatewayReceiverCommandDUnitTest {
+
+  @Rule
+  public LocatorServerStartupRule locatorServerStartupRule = new LocatorServerStartupRule();
+
+  @Rule
+  public GfshShellConnectionRule gfsh = new GfshShellConnectionRule();
+
+  private MemberVM locatorSite1;
+  private MemberVM locatorSite2;
+  private MemberVM server1;
+  private MemberVM server2;
+  private MemberVM server3;
+  private MemberVM server4;
+  private MemberVM server5;
+
+  @Before
+  public void before() throws Exception {
+    Properties props = new Properties();
+    props.setProperty(DISTRIBUTED_SYSTEM_ID, "" + 1);
+    locatorSite1 = locatorServerStartupRule.startLocatorVM(1, props);
+
+    props.setProperty(DISTRIBUTED_SYSTEM_ID, "" + 2);
+    props.setProperty(REMOTE_LOCATORS, "localhost[" + locatorSite1.getPort() + "]");
+    locatorSite2 = locatorServerStartupRule.startLocatorVM(2, props);
+
+    // Connect Gfsh to locator.
+    gfsh.connectAndVerify(locatorSite1);
+  }
+
   /**
    * Test wan commands for error in input 1> start gateway-sender command needs only one of member
    * or group.
    */
   @Test
-  public void testStartGatewayReceiver_ErrorConditions() {
-    VM puneLocator = Host.getLocator();
-    int dsIdPort = puneLocator.invoke(this::getLocatorPort);
-    propsSetUp(dsIdPort);
+  public void testStartGatewayReceiver_ErrorConditions() throws Exception {
 
-    vm2.invoke(() -> createFirstRemoteLocator(2, dsIdPort));
-    vm3.invoke(() -> createReceiver(dsIdPort));
+    Integer locator1Port = locatorSite1.getPort();
 
-    final DistributedMember vm1Member = vm3.invoke(this::getMember);
+    // setup servers in Site #1
+    server1 = locatorServerStartupRule.startServerVM(3, locator1Port);
+
+    final DistributedMember vm1Member = (DistributedMember) server1.invoke(getMemberIdCallable());
     String command = CliStrings.START_GATEWAYRECEIVER + " --" + CliStrings.MEMBER + "="
         + vm1Member.getId() + " --" + CliStrings.GROUP + "=RG1";
-    CommandResult cmdResult = executeCommand(command);
+    CommandResult cmdResult = gfsh.executeCommand(command);
 
     if (cmdResult != null) {
-      String strCmdResult = commandResultToString(cmdResult);
+      String strCmdResult = cmdResult.toString();
       getLogWriter()
           .info("testStartGatewayReceiver_ErrorConditions stringResult : " + strCmdResult + ">>>>");
       assertEquals(Result.Status.ERROR, cmdResult.getStatus());
@@ -67,65 +104,73 @@ public class StartGatewayReceiverCommandDUnitTest extends WANCommandTestBase {
     }
   }
 
-  @Category(FlakyTest.class) // GEODE-1448
   @Test
-  public void testStartGatewayReceiver() {
-    VM puneLocator = Host.getLocator();
-    int dsIdPort = puneLocator.invoke(this::getLocatorPort);
-    propsSetUp(dsIdPort);
-
-    vm2.invoke(() -> createFirstRemoteLocator(2, dsIdPort));
-    vm3.invoke(() -> createReceiver(dsIdPort));
-    vm4.invoke(() -> createReceiver(dsIdPort));
-    vm5.invoke(() -> createReceiver(dsIdPort));
-    vm3.invoke(() -> verifyReceiverState(false));
-    vm4.invoke(() -> verifyReceiverState(false));
-    vm5.invoke(() -> verifyReceiverState(false));
+  public void testStartGatewayReceiver() throws Exception {
+
+    Integer locator1Port = locatorSite1.getPort();
+
+    // setup servers in Site #1
+    server1 = locatorServerStartupRule.startServerVM(3, locator1Port);
+    server2 = locatorServerStartupRule.startServerVM(4, locator1Port);
+    server3 = locatorServerStartupRule.startServerVM(5, locator1Port);
+
+    server1.invoke(() -> createReceiver(locator1Port));
+    server2.invoke(() -> createReceiver(locator1Port));
+    server3.invoke(() -> createReceiver(locator1Port));
+
+    server1.invoke(() -> verifyReceiverState(false));
+    server2.invoke(() -> verifyReceiverState(false));
+    server3.invoke(() -> verifyReceiverState(false));
 
     pause(10000);
     String command = CliStrings.START_GATEWAYRECEIVER;
-    CommandResult cmdResult = executeCommand(command);
+    CommandResult cmdResult = gfsh.executeCommand(command);
 
     if (cmdResult != null) {
-      String strCmdResult = commandResultToString(cmdResult);
+      String strCmdResult = cmdResult.toString();
       getLogWriter().info("testStartGatewayReceiver stringResult : " + strCmdResult + ">>>>");
       TabularResultData resultData = (TabularResultData) cmdResult.getResultData();
       List<String> status = resultData.retrieveAllValues("Result");
-      assertEquals(4, status.size());
-      assertTrue(status.contains("Error"));
+      assertEquals(3, status.size());
+      assertFalse(status.contains("Error"));
+      assertTrue(status.contains("OK"));
     } else {
       fail("testStartGatewayReceiver failed as did not get CommandResult");
     }
-    vm3.invoke(() -> verifyReceiverState(true));
-    vm4.invoke(() -> verifyReceiverState(true));
-    vm5.invoke(() -> verifyReceiverState(true));
+    server1.invoke(() -> verifyReceiverState(true));
+    server2.invoke(() -> verifyReceiverState(true));
+    server3.invoke(() -> verifyReceiverState(true));
   }
 
   /**
    * test to validate that the start gateway sender starts the gateway sender on a member
    */
   @Test
-  public void testStartGatewayReceiver_onMember() {
-    VM puneLocator = Host.getLocator();
-    int dsIdPort = puneLocator.invoke(this::getLocatorPort);
-    propsSetUp(dsIdPort);
-
-    vm2.invoke(() -> createFirstRemoteLocator(2, dsIdPort));
-    vm3.invoke(() -> createReceiver(dsIdPort));
-    vm4.invoke(() -> createReceiver(dsIdPort));
-    vm5.invoke(() -> createReceiver(dsIdPort));
-    vm3.invoke(() -> verifyReceiverState(false));
-    vm4.invoke(() -> verifyReceiverState(false));
-    vm5.invoke(() -> verifyReceiverState(false));
-
-    final DistributedMember vm1Member = vm3.invoke(() -> getMember());
+  public void testStartGatewayReceiver_onMember() throws Exception {
+
+    Integer locator1Port = locatorSite1.getPort();
+
+    // setup servers in Site #1
+    server1 = locatorServerStartupRule.startServerVM(3, locator1Port);
+    server2 = locatorServerStartupRule.startServerVM(4, locator1Port);
+    server3 = locatorServerStartupRule.startServerVM(5, locator1Port);
+
+    server1.invoke(() -> createReceiver(locator1Port));
+    server2.invoke(() -> createReceiver(locator1Port));
+    server3.invoke(() -> createReceiver(locator1Port));
+
+    server1.invoke(() -> verifyReceiverState(false));
+    server2.invoke(() -> verifyReceiverState(false));
+    server3.invoke(() -> verifyReceiverState(false));
+
+    final DistributedMember vm1Member = (DistributedMember) server1.invoke(getMemberIdCallable());
     pause(10000);
     String command =
         CliStrings.START_GATEWAYRECEIVER + " --" + CliStrings.MEMBER + "=" + vm1Member.getId();
-    CommandResult cmdResult = executeCommand(command);
+    CommandResult cmdResult = gfsh.executeCommand(command);
 
     if (cmdResult != null) {
-      String strCmdResult = commandResultToString(cmdResult);
+      String strCmdResult = cmdResult.toString();
       getLogWriter()
           .info("testStartGatewayReceiver_onMember stringResult : " + strCmdResult + ">>>>");
       assertEquals(Result.Status.OK, cmdResult.getStatus());
@@ -133,34 +178,38 @@ public class StartGatewayReceiverCommandDUnitTest extends WANCommandTestBase {
     } else {
       fail("testStartGatewayReceiver failed as did not get CommandResult");
     }
-    vm3.invoke(() -> verifyReceiverState(true));
-    vm4.invoke(() -> verifyReceiverState(false));
-    vm5.invoke(() -> verifyReceiverState(false));
+    server1.invoke(() -> verifyReceiverState(true));
+    server2.invoke(() -> verifyReceiverState(false));
+    server3.invoke(() -> verifyReceiverState(false));
   }
 
   /**
    * test to validate that the start gateway sender starts the gateway sender on a group of members
    */
   @Test
-  public void testStartGatewayReceiver_Group() {
-    VM puneLocator = Host.getLocator();
-    int dsIdPort = puneLocator.invoke(this::getLocatorPort);
-    propsSetUp(dsIdPort);
-
-    vm2.invoke(() -> createFirstRemoteLocator(2, dsIdPort));
-    vm3.invoke(() -> createReceiverWithGroup(dsIdPort, "RG1"));
-    vm4.invoke(() -> createReceiverWithGroup(dsIdPort, "RG1"));
-    vm5.invoke(() -> createReceiverWithGroup(dsIdPort, "RG1"));
-    vm3.invoke(() -> verifyReceiverState(false));
-    vm4.invoke(() -> verifyReceiverState(false));
-    vm5.invoke(() -> verifyReceiverState(false));
+  public void testStartGatewayReceiver_Group() throws Exception {
+
+    Integer locator1Port = locatorSite1.getPort();
+
+    // setup servers in Site #1
+    server1 = startServerWithGroups(3, "RG1", locator1Port);
+    server2 = startServerWithGroups(4, "RG1", locator1Port);
+    server3 = startServerWithGroups(5, "RG1", locator1Port);
+
+    server1.invoke(() -> createReceiver(locator1Port));
+    server2.invoke(() -> createReceiver(locator1Port));
+    server3.invoke(() -> createReceiver(locator1Port));
+
+    server1.invoke(() -> verifyReceiverState(false));
+    server2.invoke(() -> verifyReceiverState(false));
+    server3.invoke(() -> verifyReceiverState(false));
 
     pause(10000);
     String command = CliStrings.START_GATEWAYRECEIVER + " --" + CliStrings.GROUP + "=RG1";
-    CommandResult cmdResult = executeCommand(command);
+    CommandResult cmdResult = gfsh.executeCommand(command);
 
     if (cmdResult != null) {
-      String strCmdResult = commandResultToString(cmdResult);
+      String strCmdResult = cmdResult.toString();
       getLogWriter().info("testStartGatewayReceiver_Group stringResult : " + strCmdResult + ">>>>");
       assertEquals(Result.Status.OK, cmdResult.getStatus());
       TabularResultData resultData = (TabularResultData) cmdResult.getResultData();
@@ -171,9 +220,9 @@ public class StartGatewayReceiverCommandDUnitTest extends WANCommandTestBase {
     } else {
       fail("testStartGatewayReceiver_Group failed as did not get CommandResult");
     }
-    vm3.invoke(() -> verifyReceiverState(true));
-    vm4.invoke(() -> verifyReceiverState(true));
-    vm5.invoke(() -> verifyReceiverState(true));
+    server1.invoke(() -> verifyReceiverState(true));
+    server2.invoke(() -> verifyReceiverState(true));
+    server3.invoke(() -> verifyReceiverState(true));
   }
 
   /**
@@ -182,29 +231,35 @@ public class StartGatewayReceiverCommandDUnitTest extends WANCommandTestBase {
    * 
    */
   @Test
-  public void testStartGatewayReceiver_MultipleGroup() {
-    VM puneLocator = Host.getLocator();
-    int dsIdPort = puneLocator.invoke(this::getLocatorPort);
-    propsSetUp(dsIdPort);
-
-    vm2.invoke(() -> createFirstRemoteLocator(2, dsIdPort));
-    vm3.invoke(() -> createReceiverWithGroup(dsIdPort, "RG1"));
-    vm4.invoke(() -> createReceiverWithGroup(dsIdPort, "RG1"));
-    vm5.invoke(() -> createReceiverWithGroup(dsIdPort, "RG1, RG2"));
-    vm6.invoke(() -> createReceiverWithGroup(dsIdPort, "RG1, RG2"));
-    vm7.invoke(() -> createReceiverWithGroup(dsIdPort, "RG3"));
-    vm3.invoke(() -> verifyReceiverState(false));
-    vm4.invoke(() -> verifyReceiverState(false));
-    vm5.invoke(() -> verifyReceiverState(false));
-    vm6.invoke(() -> verifyReceiverState(false));
-    vm7.invoke(() -> verifyReceiverState(false));
+  public void testStartGatewayReceiver_MultipleGroup() throws Exception {
+
+    Integer locator1Port = locatorSite1.getPort();
+
+    // setup servers in Site #1
+    server1 = startServerWithGroups(3, "RG1", locator1Port);
+    server2 = startServerWithGroups(4, "RG1", locator1Port);
+    server3 = startServerWithGroups(5, "RG1,RG2", locator1Port);
+    server4 = startServerWithGroups(6, "RG1,RG2", locator1Port);
+    server5 = startServerWithGroups(7, "RG3", locator1Port);
+
+    server1.invoke(() -> createReceiver(locator1Port));
+    server2.invoke(() -> createReceiver(locator1Port));
+    server3.invoke(() -> createReceiver(locator1Port));
+    server4.invoke(() -> createReceiver(locator1Port));
+    server5.invoke(() -> createReceiver(locator1Port));
+
+    server1.invoke(() -> verifyReceiverState(false));
+    server2.invoke(() -> verifyReceiverState(false));
+    server3.invoke(() -> verifyReceiverState(false));
+    server4.invoke(() -> verifyReceiverState(false));
+    server5.invoke(() -> verifyReceiverState(false));
 
     pause(10000);
     String command = CliStrings.START_GATEWAYRECEIVER + " --" + CliStrings.GROUP + "=RG1,RG2";
-    CommandResult cmdResult = executeCommand(command);
+    CommandResult cmdResult = gfsh.executeCommand(command);
 
     if (cmdResult != null) {
-      String strCmdResult = commandResultToString(cmdResult);
+      String strCmdResult = cmdResult.toString();
       getLogWriter().info("testStartGatewayReceiver_Group stringResult : " + strCmdResult + ">>>>");
       assertEquals(Result.Status.OK, cmdResult.getStatus());
       TabularResultData resultData = (TabularResultData) cmdResult.getResultData();
@@ -215,10 +270,16 @@ public class StartGatewayReceiverCommandDUnitTest extends WANCommandTestBase {
     } else {
       fail("testStartGatewayReceiver failed as did not get CommandResult");
     }
-    vm3.invoke(() -> verifyReceiverState(true));
-    vm4.invoke(() -> verifyReceiverState(true));
-    vm5.invoke(() -> verifyReceiverState(true));
-    vm6.invoke(() -> verifyReceiverState(true));
-    vm7.invoke(() -> verifyReceiverState(false));
+    server1.invoke(() -> verifyReceiverState(true));
+    server2.invoke(() -> verifyReceiverState(true));
+    server3.invoke(() -> verifyReceiverState(true));
+    server4.invoke(() -> verifyReceiverState(true));
+    server5.invoke(() -> verifyReceiverState(false));
+  }
+
+  private MemberVM startServerWithGroups(int index, String groups, int locPort) throws Exception {
+    Properties props = new Properties();
+    props.setProperty(GROUPS, groups);
+    return locatorServerStartupRule.startServerVM(index, props, locPort);
   }
 }
diff --git a/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/wancommand/StartGatewaySenderCommandDUnitTest.java b/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/wancommand/StartGatewaySenderCommandDUnitTest.java
index 2f8e96b..7c1e0f4 100644
--- a/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/wancommand/StartGatewaySenderCommandDUnitTest.java
+++ b/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/wancommand/StartGatewaySenderCommandDUnitTest.java
@@ -14,6 +14,12 @@
  */
 package org.apache.geode.internal.cache.wan.wancommand;
 
+import static org.apache.geode.distributed.ConfigurationProperties.DISTRIBUTED_SYSTEM_ID;
+import static org.apache.geode.distributed.ConfigurationProperties.GROUPS;
+import static org.apache.geode.distributed.ConfigurationProperties.REMOTE_LOCATORS;
+import static org.apache.geode.internal.cache.wan.wancommand.WANCommandUtils.createSender;
+import static org.apache.geode.internal.cache.wan.wancommand.WANCommandUtils.getMemberIdCallable;
+import static org.apache.geode.internal.cache.wan.wancommand.WANCommandUtils.verifySenderState;
 import static org.apache.geode.test.dunit.Assert.assertEquals;
 import static org.apache.geode.test.dunit.Assert.assertFalse;
 import static org.apache.geode.test.dunit.Assert.assertTrue;
@@ -22,7 +28,13 @@ import static org.apache.geode.test.dunit.LogWriterUtils.getLogWriter;
 import static org.apache.geode.test.dunit.Wait.pause;
 
 import java.util.List;
+import java.util.Properties;
 
+import org.apache.geode.test.dunit.rules.LocatorServerStartupRule;
+import org.apache.geode.test.dunit.rules.MemberVM;
+import org.apache.geode.test.junit.rules.GfshShellConnectionRule;
+import org.junit.Before;
+import org.junit.Rule;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
@@ -35,28 +47,58 @@ import org.apache.geode.test.dunit.IgnoredException;
 import org.apache.geode.test.junit.categories.DistributedTest;
 
 @Category(DistributedTest.class)
-public class StartGatewaySenderCommandDUnitTest extends WANCommandTestBase {
+public class StartGatewaySenderCommandDUnitTest {
+
+  @Rule
+  public LocatorServerStartupRule locatorServerStartupRule = new LocatorServerStartupRule();
+
+  @Rule
+  public GfshShellConnectionRule gfsh = new GfshShellConnectionRule();
+
+  private MemberVM locatorSite1;
+  private MemberVM locatorSite2;
+  private MemberVM server1;
+  private MemberVM server2;
+  private MemberVM server3;
+  private MemberVM server4;
+  private MemberVM server5;
+
+  @Before
+  public void before() throws Exception {
+    Properties props = new Properties();
+    props.setProperty(DISTRIBUTED_SYSTEM_ID, "" + 1);
+    locatorSite1 = locatorServerStartupRule.startLocatorVM(1, props);
+
+    props.setProperty(DISTRIBUTED_SYSTEM_ID, "" + 2);
+    props.setProperty(REMOTE_LOCATORS, "localhost[" + locatorSite1.getPort() + "]");
+    locatorSite2 = locatorServerStartupRule.startLocatorVM(2, props);
+
+    // Connect Gfsh to locator.
+    gfsh.connectAndVerify(locatorSite1);
+  }
+
   /**
    * Test wan commands for error in input 1> start gateway-sender command needs only one of member
    * or group.
    */
   @Test
-  public void testStartGatewaySender_ErrorConditions() {
-    Integer dsIdPort = vm1.invoke(() -> createFirstLocatorWithDSId(1));
-    propsSetUp(dsIdPort);
+  public void testStartGatewaySender_ErrorConditions() throws Exception {
 
-    vm2.invoke(() -> createFirstRemoteLocator(2, dsIdPort));
-    vm3.invoke(() -> createCache(dsIdPort));
-    vm3.invoke(() -> createSender("ln", 2, false, 100, 400, false, false, null, true));
+    Integer locator1Port = locatorSite1.getPort();
 
-    final DistributedMember vm1Member = vm3.invoke(this::getMember);
+    // setup servers in Site #1
+    server1 = locatorServerStartupRule.startServerVM(3, locator1Port);
+
+    server1.invoke(() -> createSender("ln", 2, false, 100, 400, false, false, null, true));
+
+    final DistributedMember vm1Member = (DistributedMember) server1.invoke(getMemberIdCallable());
     String command = CliStrings.START_GATEWAYSENDER + " --" + CliStrings.START_GATEWAYSENDER__ID
         + "=ln --" + CliStrings.MEMBER + "=" + vm1Member.getId() + " --" + CliStrings.GROUP
         + "=SenserGroup1";
     CommandResult cmdResult = executeCommandWithIgnoredExceptions(command);
 
     if (cmdResult != null) {
-      String strCmdResult = commandResultToString(cmdResult);
+      String strCmdResult = cmdResult.toString();
       getLogWriter().info("testStartGatewaySender stringResult : " + strCmdResult + ">>>>");
       assertEquals(Result.Status.ERROR, cmdResult.getStatus());
       assertTrue(strCmdResult.contains(CliStrings.PROVIDE_EITHER_MEMBER_OR_GROUP_MESSAGE));
@@ -66,20 +108,22 @@ public class StartGatewaySenderCommandDUnitTest extends WANCommandTestBase {
   }
 
   @Test
-  public void testStartGatewaySender() {
-    Integer dsIdPort = vm1.invoke(() -> createFirstLocatorWithDSId(1));
-    propsSetUp(dsIdPort);
-
-    vm2.invoke(() -> createFirstRemoteLocator(2, dsIdPort));
-    vm3.invoke(() -> createCache(dsIdPort));
-    vm3.invoke(() -> createSender("ln", 2, false, 100, 400, false, false, null, true));
-    vm4.invoke(() -> createCache(dsIdPort));
-    vm4.invoke(() -> createSender("ln", 2, false, 100, 400, false, false, null, true));
-    vm5.invoke(() -> createCache(dsIdPort));
-    vm5.invoke(() -> createSender("ln", 2, false, 100, 400, false, false, null, true));
-    vm3.invoke(() -> verifySenderState("ln", false, false));
-    vm4.invoke(() -> verifySenderState("ln", false, false));
-    vm5.invoke(() -> verifySenderState("ln", false, false));
+  public void testStartGatewaySender() throws Exception {
+
+    Integer locator1Port = locatorSite1.getPort();
+
+    // setup servers in Site #1
+    server1 = locatorServerStartupRule.startServerVM(3, locator1Port);
+    server2 = locatorServerStartupRule.startServerVM(4, locator1Port);
+    server3 = locatorServerStartupRule.startServerVM(5, locator1Port);
+
+    server1.invoke(() -> createSender("ln", 2, false, 100, 400, false, false, null, true));
+    server2.invoke(() -> createSender("ln", 2, false, 100, 400, false, false, null, true));
+    server3.invoke(() -> createSender("ln", 2, false, 100, 400, false, false, null, true));
+
+    server1.invoke(() -> verifySenderState("ln", false, false));
+    server2.invoke(() -> verifySenderState("ln", false, false));
+    server3.invoke(() -> verifySenderState("ln", false, false));
 
     pause(10000);
     String command =
@@ -87,70 +131,72 @@ public class StartGatewaySenderCommandDUnitTest extends WANCommandTestBase {
     CommandResult cmdResult = executeCommandWithIgnoredExceptions(command);
 
     if (cmdResult != null) {
-      String strCmdResult = commandResultToString(cmdResult);
+      String strCmdResult = cmdResult.toString();
       getLogWriter().info("testStartGatewaySender stringResult : " + strCmdResult + ">>>>");
       assertEquals(Result.Status.OK, cmdResult.getStatus());
       TabularResultData resultData = (TabularResultData) cmdResult.getResultData();
       List<String> status = resultData.retrieveAllValues("Result");
-      assertEquals(5, status.size());
-      assertTrue(status.contains("Error"));
+      assertEquals(3, status.size());
       assertTrue(status.contains("OK"));
     } else {
       fail("testStartGatewaySender failed as did not get CommandResult");
     }
-    vm3.invoke(() -> verifySenderState("ln", true, false));
-    vm4.invoke(() -> verifySenderState("ln", true, false));
-    vm5.invoke(() -> verifySenderState("ln", true, false));
+    server1.invoke(() -> verifySenderState("ln", true, false));
+    server2.invoke(() -> verifySenderState("ln", true, false));
+    server3.invoke(() -> verifySenderState("ln", true, false));
   }
 
   /**
    * test to validate that the start gateway sender starts the gateway sender on a member
    */
   @Test
-  public void testStartGatewaySender_onMember() {
-    Integer dsIdPort = vm1.invoke(() -> createFirstLocatorWithDSId(1));
-    propsSetUp(dsIdPort);
+  public void testStartGatewaySender_onMember() throws Exception {
 
-    vm2.invoke(() -> createFirstRemoteLocator(2, dsIdPort));
-    vm3.invoke(() -> createCache(dsIdPort));
-    vm3.invoke(() -> createSender("ln", 2, false, 100, 400, false, false, null, true));
-    vm3.invoke(() -> verifySenderState("ln", false, false));
+    Integer locator1Port = locatorSite1.getPort();
 
-    final DistributedMember vm1Member = vm3.invoke(this::getMember);
+    // setup servers in Site #1
+    server1 = locatorServerStartupRule.startServerVM(3, locator1Port);
+
+    server1.invoke(() -> createSender("ln", 2, false, 100, 400, false, false, null, true));
+    server1.invoke(() -> verifySenderState("ln", false, false));
+
+    final DistributedMember vm1Member = (DistributedMember) server1.invoke(getMemberIdCallable());
     pause(10000);
     String command = CliStrings.START_GATEWAYSENDER + " --" + CliStrings.START_GATEWAYSENDER__ID
         + "=ln --" + CliStrings.MEMBER + "=" + vm1Member.getId();
     CommandResult cmdResult = executeCommandWithIgnoredExceptions(command);
 
     if (cmdResult != null) {
-      String strCmdResult = commandResultToString(cmdResult);
+      String strCmdResult = cmdResult.toString();
       getLogWriter().info("testStartGatewaySender stringResult : " + strCmdResult + ">>>>");
       assertEquals(Result.Status.OK, cmdResult.getStatus());
       assertTrue(strCmdResult.contains("is started on member"));
     } else {
       fail("testStartGatewaySender failed as did not get CommandResult");
     }
-    vm3.invoke(() -> verifySenderState("ln", true, false));
+    server1.invoke(() -> verifySenderState("ln", true, false));
   }
 
   /**
    * test to validate that the start gateway sender starts the gateway sender on a group of members
    */
   @Test
-  public void testStartGatewaySender_Group() {
-    Integer dsIdPort = vm1.invoke(() -> createFirstLocatorWithDSId(1));
-    propsSetUp(dsIdPort);
-
-    vm2.invoke(() -> createFirstRemoteLocator(2, dsIdPort));
-    vm3.invoke(() -> createCacheWithGroups(dsIdPort, "SenderGroup1"));
-    vm3.invoke(() -> createSender("ln", 2, false, 100, 400, false, false, null, true));
-    vm4.invoke(() -> createCacheWithGroups(dsIdPort, "SenderGroup1"));
-    vm4.invoke(() -> createSender("ln", 2, false, 100, 400, false, false, null, true));
-    vm5.invoke(() -> createCacheWithGroups(dsIdPort, "SenderGroup1"));
-    vm5.invoke(() -> createSender("ln", 2, false, 100, 400, false, false, null, true));
-    vm3.invoke(() -> verifySenderState("ln", false, false));
-    vm4.invoke(() -> verifySenderState("ln", false, false));
-    vm5.invoke(() -> verifySenderState("ln", false, false));
+  public void testStartGatewaySender_Group() throws Exception {
+
+    Integer locator1Port = locatorSite1.getPort();
+
+    // setup servers in Site #1
+    server1 = startServerWithGroups(3, "SenderGroup1", locator1Port);
+    server2 = startServerWithGroups(4, "SenderGroup1", locator1Port);
+    server3 = startServerWithGroups(5, "SenderGroup1", locator1Port);
+
+    server1.invoke(() -> createSender("ln", 2, false, 100, 400, false, false, null, true));
+    server2.invoke(() -> createSender("ln", 2, false, 100, 400, false, false, null, true));
+    server3.invoke(() -> createSender("ln", 2, false, 100, 400, false, false, null, true));
+
+    server1.invoke(() -> verifySenderState("ln", false, false));
+    server2.invoke(() -> verifySenderState("ln", false, false));
+    server3.invoke(() -> verifySenderState("ln", false, false));
 
     pause(10000);
     String command = CliStrings.START_GATEWAYSENDER + " --" + CliStrings.START_GATEWAYSENDER__ID
@@ -158,7 +204,7 @@ public class StartGatewaySenderCommandDUnitTest extends WANCommandTestBase {
     CommandResult cmdResult = executeCommandWithIgnoredExceptions(command);
 
     if (cmdResult != null) {
-      String strCmdResult = commandResultToString(cmdResult);
+      String strCmdResult = cmdResult.toString();
       getLogWriter().info("testStartGatewaySender_Group stringResult : " + strCmdResult + ">>>>");
       assertEquals(Result.Status.OK, cmdResult.getStatus());
       TabularResultData resultData = (TabularResultData) cmdResult.getResultData();
@@ -169,9 +215,9 @@ public class StartGatewaySenderCommandDUnitTest extends WANCommandTestBase {
     } else {
       fail("testStartGatewaySender failed as did not get CommandResult");
     }
-    vm3.invoke(() -> verifySenderState("ln", true, false));
-    vm4.invoke(() -> verifySenderState("ln", true, false));
-    vm5.invoke(() -> verifySenderState("ln", true, false));
+    server1.invoke(() -> verifySenderState("ln", true, false));
+    server2.invoke(() -> verifySenderState("ln", true, false));
+    server3.invoke(() -> verifySenderState("ln", true, false));
   }
 
   /**
@@ -179,26 +225,28 @@ public class StartGatewaySenderCommandDUnitTest extends WANCommandTestBase {
    * to multiple groups
    */
   @Test
-  public void testStartGatewaySender_MultipleGroup() {
-    Integer dsIdPort = vm1.invoke(() -> createFirstLocatorWithDSId(1));
-    propsSetUp(dsIdPort);
-
-    vm2.invoke(() -> createFirstRemoteLocator(2, dsIdPort));
-    vm3.invoke(() -> createCacheWithGroups(dsIdPort, "SenderGroup1"));
-    vm3.invoke(() -> createSender("ln", 2, false, 100, 400, false, false, null, true));
-    vm4.invoke(() -> createCacheWithGroups(dsIdPort, "SenderGroup1"));
-    vm4.invoke(() -> createSender("ln", 2, false, 100, 400, false, false, null, true));
-    vm5.invoke(() -> createCacheWithGroups(dsIdPort, "SenderGroup1, SenderGroup2"));
-    vm5.invoke(() -> createSender("ln", 2, false, 100, 400, false, false, null, true));
-    vm6.invoke(() -> createCacheWithGroups(dsIdPort, "SenderGroup1, SenderGroup2"));
-    vm6.invoke(() -> createSender("ln", 2, false, 100, 400, false, false, null, true));
-    vm7.invoke(() -> createCacheWithGroups(dsIdPort, "SenderGroup3"));
-    vm7.invoke(() -> createSender("ln", 2, false, 100, 400, false, false, null, true));
-    vm3.invoke(() -> verifySenderState("ln", false, false));
-    vm4.invoke(() -> verifySenderState("ln", false, false));
-    vm5.invoke(() -> verifySenderState("ln", false, false));
-    vm6.invoke(() -> verifySenderState("ln", false, false));
-    vm7.invoke(() -> verifySenderState("ln", false, false));
+  public void testStartGatewaySender_MultipleGroup() throws Exception {
+
+    Integer locator1Port = locatorSite1.getPort();
+
+    // setup servers in Site #1
+    server1 = startServerWithGroups(3, "SenderGroup1", locator1Port);
+    server2 = startServerWithGroups(4, "SenderGroup1", locator1Port);
+    server3 = startServerWithGroups(5, "SenderGroup1, SenderGroup2", locator1Port);
+    server4 = startServerWithGroups(6, "SenderGroup1, SenderGroup2", locator1Port);
+    server5 = startServerWithGroups(7, "SenderGroup3", locator1Port);
+
+    server1.invoke(() -> createSender("ln", 2, false, 100, 400, false, false, null, true));
+    server2.invoke(() -> createSender("ln", 2, false, 100, 400, false, false, null, true));
+    server3.invoke(() -> createSender("ln", 2, false, 100, 400, false, false, null, true));
+    server4.invoke(() -> createSender("ln", 2, false, 100, 400, false, false, null, true));
+    server5.invoke(() -> createSender("ln", 2, false, 100, 400, false, false, null, true));
+
+    server1.invoke(() -> verifySenderState("ln", false, false));
+    server2.invoke(() -> verifySenderState("ln", false, false));
+    server3.invoke(() -> verifySenderState("ln", false, false));
+    server4.invoke(() -> verifySenderState("ln", false, false));
+    server5.invoke(() -> verifySenderState("ln", false, false));
 
     pause(10000);
     String command = CliStrings.START_GATEWAYSENDER + " --" + CliStrings.START_GATEWAYSENDER__ID
@@ -206,7 +254,7 @@ public class StartGatewaySenderCommandDUnitTest extends WANCommandTestBase {
     CommandResult cmdResult = executeCommandWithIgnoredExceptions(command);
 
     if (cmdResult != null) {
-      String strCmdResult = commandResultToString(cmdResult);
+      String strCmdResult = cmdResult.toString();
       getLogWriter().info("testStartGatewaySender_Group stringResult : " + strCmdResult + ">>>>");
       assertEquals(Result.Status.OK, cmdResult.getStatus());
       TabularResultData resultData = (TabularResultData) cmdResult.getResultData();
@@ -217,29 +265,31 @@ public class StartGatewaySenderCommandDUnitTest extends WANCommandTestBase {
     } else {
       fail("testStartGatewaySender failed as did not get CommandResult");
     }
-    vm3.invoke(() -> verifySenderState("ln", true, false));
-    vm4.invoke(() -> verifySenderState("ln", true, false));
-    vm5.invoke(() -> verifySenderState("ln", true, false));
-    vm6.invoke(() -> verifySenderState("ln", true, false));
-    vm7.invoke(() -> verifySenderState("ln", false, false));
+    server1.invoke(() -> verifySenderState("ln", true, false));
+    server2.invoke(() -> verifySenderState("ln", true, false));
+    server3.invoke(() -> verifySenderState("ln", true, false));
+    server4.invoke(() -> verifySenderState("ln", true, false));
+    server5.invoke(() -> verifySenderState("ln", false, false));
   }
 
   /**
    * Test to validate the test scenario when one of the member ion group does not have the sender.
    */
   @Test
-  public void testStartGatewaySender_Group_MissingSenderFromGroup() {
-    Integer dsIdPort = vm1.invoke(() -> createFirstLocatorWithDSId(1));
-    propsSetUp(dsIdPort);
-
-    vm2.invoke(() -> createFirstRemoteLocator(2, dsIdPort));
-    vm3.invoke(() -> createCacheWithGroups(dsIdPort, "SenderGroup1"));
-    vm3.invoke(() -> createSender("ln", 2, false, 100, 400, false, false, null, true));
-    vm4.invoke(() -> createCacheWithGroups(dsIdPort, "SenderGroup1"));
-    vm5.invoke(() -> createCacheWithGroups(dsIdPort, "SenderGroup1"));
-    vm5.invoke(() -> createSender("ln", 2, false, 100, 400, false, false, null, true));
-    vm3.invoke(() -> verifySenderState("ln", false, false));
-    vm5.invoke(() -> verifySenderState("ln", false, false));
+  public void testStartGatewaySender_Group_MissingSenderFromGroup() throws Exception {
+
+    Integer locator1Port = locatorSite1.getPort();
+
+    // setup servers in Site #1
+    server1 = startServerWithGroups(3, "SenderGroup1", locator1Port);
+    server2 = startServerWithGroups(4, "SenderGroup1", locator1Port);
+    server3 = startServerWithGroups(5, "SenderGroup1", locator1Port);
+
+    server1.invoke(() -> createSender("ln", 2, false, 100, 400, false, false, null, true));
+    server3.invoke(() -> createSender("ln", 2, false, 100, 400, false, false, null, true));
+
+    server1.invoke(() -> verifySenderState("ln", false, false));
+    server3.invoke(() -> verifySenderState("ln", false, false));
 
     pause(10000);
     String command = CliStrings.START_GATEWAYSENDER + " --" + CliStrings.START_GATEWAYSENDER__ID
@@ -247,7 +297,7 @@ public class StartGatewaySenderCommandDUnitTest extends WANCommandTestBase {
     CommandResult cmdResult = executeCommandWithIgnoredExceptions(command);
 
     if (cmdResult != null) {
-      String strCmdResult = commandResultToString(cmdResult);
+      String strCmdResult = cmdResult.toString();
       assertTrue(strCmdResult.contains("Error"));
       assertTrue(strCmdResult.contains("is not available"));
       getLogWriter().info("testStartGatewaySender_Group stringResult : " + strCmdResult + ">>>>");
@@ -260,16 +310,22 @@ public class StartGatewaySenderCommandDUnitTest extends WANCommandTestBase {
     } else {
       fail("testStartGatewaySender failed as did not get CommandResult");
     }
-    vm3.invoke(() -> verifySenderState("ln", true, false));
-    vm5.invoke(() -> verifySenderState("ln", true, false));
+    server1.invoke(() -> verifySenderState("ln", true, false));
+    server3.invoke(() -> verifySenderState("ln", true, false));
   }
 
   private CommandResult executeCommandWithIgnoredExceptions(String command) {
     final IgnoredException exln = IgnoredException.addIgnoredException("Could not connect");
     try {
-      return executeCommand(command);
+      return gfsh.executeCommand(command);
     } finally {
       exln.remove();
     }
   }
+
+  private MemberVM startServerWithGroups(int index, String groups, int locPort) throws Exception {
+    Properties props = new Properties();
+    props.setProperty(GROUPS, groups);
+    return locatorServerStartupRule.startServerVM(index, props, locPort);
+  }
 }
diff --git a/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/wancommand/StatusGatewayReceiverCommandDUnitTest.java b/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/wancommand/StatusGatewayReceiverCommandDUnitTest.java
index 32206c5..760aece 100644
--- a/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/wancommand/StatusGatewayReceiverCommandDUnitTest.java
+++ b/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/wancommand/StatusGatewayReceiverCommandDUnitTest.java
@@ -15,6 +15,12 @@
 
 package org.apache.geode.internal.cache.wan.wancommand;
 
+import static org.apache.geode.distributed.ConfigurationProperties.DISTRIBUTED_SYSTEM_ID;
+import static org.apache.geode.distributed.ConfigurationProperties.GROUPS;
+import static org.apache.geode.distributed.ConfigurationProperties.REMOTE_LOCATORS;
+import static org.apache.geode.internal.cache.wan.wancommand.WANCommandUtils.createAndStartReceiver;
+import static org.apache.geode.internal.cache.wan.wancommand.WANCommandUtils.getMemberIdCallable;
+import static org.apache.geode.internal.cache.wan.wancommand.WANCommandUtils.stopReceiver;
 import static org.apache.geode.test.dunit.LogWriterUtils.getLogWriter;
 import static org.apache.geode.test.dunit.Wait.pause;
 import static org.junit.Assert.assertEquals;
@@ -22,7 +28,13 @@ import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.fail;
 
 import java.util.List;
+import java.util.Properties;
 
+import org.apache.geode.test.dunit.rules.LocatorServerStartupRule;
+import org.apache.geode.test.dunit.rules.MemberVM;
+import org.apache.geode.test.junit.rules.GfshShellConnectionRule;
+import org.junit.Before;
+import org.junit.Rule;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
@@ -33,27 +45,64 @@ import org.apache.geode.management.internal.cli.result.CommandResult;
 import org.apache.geode.management.internal.cli.result.CompositeResultData;
 import org.apache.geode.management.internal.cli.result.TabularResultData;
 import org.apache.geode.test.junit.categories.DistributedTest;
-import org.apache.geode.test.junit.categories.FlakyTest;
 
 @Category(DistributedTest.class)
-public class StatusGatewayReceiverCommandDUnitTest extends WANCommandTestBase {
+public class StatusGatewayReceiverCommandDUnitTest {
+
+  @Rule
+  public LocatorServerStartupRule locatorServerStartupRule = new LocatorServerStartupRule();
+
+  @Rule
+  public GfshShellConnectionRule gfsh = new GfshShellConnectionRule();
+
+  private MemberVM locatorSite1;
+  private MemberVM locatorSite2;
+  private MemberVM server1;
+  private MemberVM server2;
+  private MemberVM server3;
+  private MemberVM server4;
+  private MemberVM server5;
+
+  @Before
+  public void before() throws Exception {
+    Properties props = new Properties();
+    props.setProperty(DISTRIBUTED_SYSTEM_ID, "" + 1);
+    locatorSite1 = locatorServerStartupRule.startLocatorVM(1, props);
+
+    props.setProperty(DISTRIBUTED_SYSTEM_ID, "" + 2);
+    props.setProperty(REMOTE_LOCATORS, "localhost[" + locatorSite1.getPort() + "]");
+    locatorSite2 = locatorServerStartupRule.startLocatorVM(2, props);
+
+    // Connect Gfsh to locator.
+    gfsh.connectAndVerify(locatorSite1);
+  }
+
   @Test
-  public void testGatewayReceiverStatus() {
-    Integer lnPort = vm1.invoke(() -> createFirstLocatorWithDSId(1));
-    propsSetUp(lnPort);
-    Integer nyPort = vm2.invoke(() -> createFirstRemoteLocator(2, lnPort));
+  public void testGatewayReceiverStatus() throws Exception {
+
+    Integer lnPort = locatorSite1.getPort();
+    Integer nyPort = locatorSite2.getPort();
+
+    // setup servers in Site #1 (London)
+    server1 = locatorServerStartupRule.startServerVM(3, lnPort);
+    server2 = locatorServerStartupRule.startServerVM(4, lnPort);
+    server3 = locatorServerStartupRule.startServerVM(5, lnPort);
 
-    vm6.invoke(() -> createAndStartReceiver(nyPort));
-    vm3.invoke(() -> createAndStartReceiver(lnPort));
-    vm4.invoke(() -> createAndStartReceiver(lnPort));
-    vm5.invoke(() -> createAndStartReceiver(lnPort));
+    // server in Site 2 (New York)
+    server4 = locatorServerStartupRule.startServerVM(6, nyPort);
+
+    server1.invoke(() -> createAndStartReceiver(lnPort));
+    server2.invoke(() -> createAndStartReceiver(lnPort));
+    server3.invoke(() -> createAndStartReceiver(lnPort));
+
+    server4.invoke(() -> createAndStartReceiver(nyPort));
 
     pause(10000);
     String command = CliStrings.STATUS_GATEWAYRECEIVER;
-    CommandResult cmdResult = executeCommand(command);
+    CommandResult cmdResult = gfsh.executeCommand(command);
 
     if (cmdResult != null) {
-      String strCmdResult = commandResultToString(cmdResult);
+      String strCmdResult = cmdResult.toString();
       getLogWriter().info("testGatewayReceiverStatus : " + strCmdResult + ">>>>> ");
       assertEquals(Result.Status.OK, cmdResult.getStatus());
       TabularResultData tableResultData = ((CompositeResultData) cmdResult.getResultData())
@@ -62,23 +111,20 @@ public class StatusGatewayReceiverCommandDUnitTest extends WANCommandTestBase {
       List<String> result_Status = tableResultData.retrieveAllValues(CliStrings.RESULT_STATUS);
       assertEquals(3, result_Status.size());
       assertFalse(result_Status.contains(CliStrings.GATEWAY_NOT_RUNNING));
-      tableResultData = ((CompositeResultData) cmdResult.getResultData())
-          .retrieveSection(CliStrings.SECTION_GATEWAY_RECEIVER_NOT_AVAILABLE)
-          .retrieveTable(CliStrings.TABLE_GATEWAY_RECEIVER);
-      List<String> result_hosts = tableResultData.retrieveAllValues(CliStrings.RESULT_HOST_MEMBER);
-      assertEquals(2, result_hosts.size());
     } else {
       fail("testGatewayReceiverStatus failed as did not get CommandResult");
     }
-    vm3.invoke(this::stopReceiver);
-    vm4.invoke(this::stopReceiver);
-    vm5.invoke(this::stopReceiver);
+
+    server1.invoke(() -> stopReceiver());
+    server2.invoke(() -> stopReceiver());
+    server3.invoke(() -> stopReceiver());
+
     pause(10000);
     command = CliStrings.STATUS_GATEWAYRECEIVER;
-    cmdResult = executeCommand(command);
+    cmdResult = gfsh.executeCommand(command);
 
     if (cmdResult != null) {
-      String strCmdResult = commandResultToString(cmdResult);
+      String strCmdResult = cmdResult.toString();
       getLogWriter().info("testGatewayReceiverStatus : " + strCmdResult + ">>>>> ");
       assertEquals(Result.Status.OK, cmdResult.getStatus());
 
@@ -88,36 +134,39 @@ public class StatusGatewayReceiverCommandDUnitTest extends WANCommandTestBase {
       List<String> result_Status = tableResultData.retrieveAllValues(CliStrings.RESULT_STATUS);
       assertEquals(3, result_Status.size());
       assertFalse(result_Status.contains(CliStrings.GATEWAY_RUNNING));
-      tableResultData = ((CompositeResultData) cmdResult.getResultData())
-          .retrieveSection(CliStrings.SECTION_GATEWAY_RECEIVER_NOT_AVAILABLE)
-          .retrieveTable(CliStrings.TABLE_GATEWAY_RECEIVER);
-      List<String> result_hosts = tableResultData.retrieveAllValues(CliStrings.RESULT_HOST_MEMBER);
-      assertEquals(2, result_hosts.size());
     } else {
       fail("testGatewayReceiverStatus failed as did not get CommandResult");
     }
   }
 
-  @Category(FlakyTest.class) // GEODE-1395
   @Test
-  public void testGatewayReceiverStatus_OnMember() {
-    Integer lnPort = vm1.invoke(() -> createFirstLocatorWithDSId(1));
-    propsSetUp(lnPort);
-    Integer nyPort = vm2.invoke(() -> createFirstRemoteLocator(2, lnPort));
+  public void testGatewayReceiverStatus_OnMember() throws Exception {
+
+    Integer lnPort = locatorSite1.getPort();
+    Integer nyPort = locatorSite2.getPort();
+
+    // setup servers in Site #1 (London)
+    server1 = locatorServerStartupRule.startServerVM(3, lnPort);
+    server2 = locatorServerStartupRule.startServerVM(4, lnPort);
+    server3 = locatorServerStartupRule.startServerVM(5, lnPort);
+
+    // server in Site 2 (New York)
+    server4 = locatorServerStartupRule.startServerVM(6, nyPort);
+
+    server1.invoke(() -> createAndStartReceiver(lnPort));
+    server2.invoke(() -> createAndStartReceiver(lnPort));
+    server3.invoke(() -> createAndStartReceiver(lnPort));
 
-    vm6.invoke(() -> createAndStartReceiver(nyPort));
-    vm3.invoke(() -> createAndStartReceiver(lnPort));
-    vm4.invoke(() -> createAndStartReceiver(lnPort));
-    vm5.invoke(() -> createAndStartReceiver(lnPort));
+    server4.invoke(() -> createAndStartReceiver(nyPort));
 
-    final DistributedMember vm3Member = vm3.invoke(this::getMember);
+    final DistributedMember vm3Member = (DistributedMember) server1.invoke(getMemberIdCallable());
     pause(10000);
     String command =
         CliStrings.STATUS_GATEWAYRECEIVER + " --" + CliStrings.MEMBER + "=" + vm3Member.getId();
-    CommandResult cmdResult = executeCommand(command);
+    CommandResult cmdResult = gfsh.executeCommand(command);
 
     if (cmdResult != null) {
-      String strCmdResult = commandResultToString(cmdResult);
+      String strCmdResult = cmdResult.toString();
       getLogWriter().info("testGatewayReceiverStatus : " + strCmdResult + ">>>>> ");
       assertEquals(Result.Status.OK, cmdResult.getStatus());
       TabularResultData tableResultData = ((CompositeResultData) cmdResult.getResultData())
@@ -129,17 +178,17 @@ public class StatusGatewayReceiverCommandDUnitTest extends WANCommandTestBase {
     } else {
       fail("testGatewayReceiverStatus failed as did not get CommandResult");
     }
-    vm3.invoke(this::stopReceiver);
-    vm4.invoke(this::stopReceiver);
-    vm5.invoke(this::stopReceiver);
+    server1.invoke(() -> stopReceiver());
+    server2.invoke(() -> stopReceiver());
+    server3.invoke(() -> stopReceiver());
 
     pause(10000);
     command =
         CliStrings.STATUS_GATEWAYRECEIVER + " --" + CliStrings.MEMBER + "=" + vm3Member.getId();
-    cmdResult = executeCommand(command);
+    cmdResult = gfsh.executeCommand(command);
 
     if (cmdResult != null) {
-      String strCmdResult = commandResultToString(cmdResult);
+      String strCmdResult = cmdResult.toString();
       getLogWriter().info("testGatewayReceiverStatus : " + strCmdResult + ">>>>> ");
       TabularResultData tableResultData = ((CompositeResultData) cmdResult.getResultData())
           .retrieveSection(CliStrings.SECTION_GATEWAY_RECEIVER_AVAILABLE)
@@ -153,23 +202,33 @@ public class StatusGatewayReceiverCommandDUnitTest extends WANCommandTestBase {
   }
 
   @Test
-  public void testGatewayReceiverStatus_OnGroups() {
-    Integer lnPort = vm1.invoke(() -> createFirstLocatorWithDSId(1));
-    propsSetUp(lnPort);
-    Integer nyPort = vm2.invoke(() -> createFirstRemoteLocator(2, lnPort));
+  public void testGatewayReceiverStatus_OnGroups() throws Exception {
 
-    vm7.invoke(() -> createAndStartReceiver(nyPort));
-    vm3.invoke(() -> createAndStartReceiverWithGroup(lnPort, "RG1, RG2"));
-    vm4.invoke(() -> createAndStartReceiverWithGroup(lnPort, "RG1, RG2"));
-    vm5.invoke(() -> createAndStartReceiverWithGroup(lnPort, "RG1"));
-    vm6.invoke(() -> createAndStartReceiverWithGroup(lnPort, "RG2"));
+    Integer lnPort = locatorSite1.getPort();
+    Integer nyPort = locatorSite2.getPort();
+
+    // setup servers in Site #1 (London)
+    server1 = startServerWithGroups(3, "RG1, RG2", lnPort);
+    server2 = startServerWithGroups(4, "RG1, RG2", lnPort);
+    server3 = startServerWithGroups(5, "RG1", lnPort);
+    server4 = startServerWithGroups(6, "RG2", lnPort);
+
+    // server in Site 2 (New York) - no group
+    server5 = locatorServerStartupRule.startServerVM(7, nyPort);
+
+    server1.invoke(() -> createAndStartReceiver(lnPort));
+    server2.invoke(() -> createAndStartReceiver(lnPort));
+    server3.invoke(() -> createAndStartReceiver(lnPort));
+    server4.invoke(() -> createAndStartReceiver(lnPort));
+
+    server5.invoke(() -> createAndStartReceiver(nyPort));
 
     pause(10000);
     String command = CliStrings.STATUS_GATEWAYRECEIVER + " --" + CliStrings.GROUP + "=RG1";
-    CommandResult cmdResult = executeCommand(command);
+    CommandResult cmdResult = gfsh.executeCommand(command);
 
     if (cmdResult != null) {
-      String strCmdResult = commandResultToString(cmdResult);
+      String strCmdResult = cmdResult.toString();
       getLogWriter().info("testGatewayReceiverStatus : " + strCmdResult + ">>>>> ");
       assertEquals(Result.Status.OK, cmdResult.getStatus());
       TabularResultData tableResultData = ((CompositeResultData) cmdResult.getResultData())
@@ -181,16 +240,16 @@ public class StatusGatewayReceiverCommandDUnitTest extends WANCommandTestBase {
     } else {
       fail("testGatewayReceiverStatus failed as did not get CommandResult");
     }
-    vm3.invoke(this::stopReceiver);
-    vm4.invoke(this::stopReceiver);
-    vm5.invoke(this::stopReceiver);
+    server1.invoke(() -> stopReceiver());
+    server2.invoke(() -> stopReceiver());
+    server3.invoke(() -> stopReceiver());
 
     pause(10000);
     command = CliStrings.STATUS_GATEWAYRECEIVER + " --" + CliStrings.GROUP + "=RG1";
-    cmdResult = executeCommand(command);
+    cmdResult = gfsh.executeCommand(command);
 
     if (cmdResult != null) {
-      String strCmdResult = commandResultToString(cmdResult);
+      String strCmdResult = cmdResult.toString();
       getLogWriter().info("testGatewayReceiverStatus_OnGroups : " + strCmdResult + ">>>>> ");
       assertEquals(Result.Status.OK, cmdResult.getStatus());
       TabularResultData tableResultData = ((CompositeResultData) cmdResult.getResultData())
@@ -203,4 +262,10 @@ public class StatusGatewayReceiverCommandDUnitTest extends WANCommandTestBase {
       fail("testGatewayReceiverStatus failed as did not get CommandResult");
     }
   }
+
+  private MemberVM startServerWithGroups(int index, String groups, int locPort) throws Exception {
+    Properties props = new Properties();
+    props.setProperty(GROUPS, groups);
+    return locatorServerStartupRule.startServerVM(index, props, locPort);
+  }
 }
diff --git a/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/wancommand/StatusGatewaySenderCommandDUnitTest.java b/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/wancommand/StatusGatewaySenderCommandDUnitTest.java
index 064bfe7..c3f0d20 100644
--- a/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/wancommand/StatusGatewaySenderCommandDUnitTest.java
+++ b/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/wancommand/StatusGatewaySenderCommandDUnitTest.java
@@ -14,6 +14,13 @@
  */
 package org.apache.geode.internal.cache.wan.wancommand;
 
+import static org.apache.geode.distributed.ConfigurationProperties.DISTRIBUTED_SYSTEM_ID;
+import static org.apache.geode.distributed.ConfigurationProperties.GROUPS;
+import static org.apache.geode.distributed.ConfigurationProperties.REMOTE_LOCATORS;
+import static org.apache.geode.internal.cache.wan.wancommand.WANCommandUtils.createAndStartReceiver;
+import static org.apache.geode.internal.cache.wan.wancommand.WANCommandUtils.createSender;
+import static org.apache.geode.internal.cache.wan.wancommand.WANCommandUtils.getMemberIdCallable;
+import static org.apache.geode.internal.cache.wan.wancommand.WANCommandUtils.startSender;
 import static org.apache.geode.test.dunit.Assert.assertEquals;
 import static org.apache.geode.test.dunit.Assert.assertFalse;
 import static org.apache.geode.test.dunit.Assert.fail;
@@ -21,7 +28,13 @@ import static org.apache.geode.test.dunit.LogWriterUtils.getLogWriter;
 import static org.apache.geode.test.dunit.Wait.pause;
 
 import java.util.List;
+import java.util.Properties;
 
+import org.apache.geode.test.dunit.rules.LocatorServerStartupRule;
+import org.apache.geode.test.dunit.rules.MemberVM;
+import org.apache.geode.test.junit.rules.GfshShellConnectionRule;
+import org.junit.Before;
+import org.junit.Rule;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
@@ -34,28 +47,65 @@ import org.apache.geode.management.internal.cli.result.TabularResultData;
 import org.apache.geode.test.junit.categories.DistributedTest;
 
 @Category(DistributedTest.class)
-public class StatusGatewaySenderCommandDUnitTest extends WANCommandTestBase {
+public class StatusGatewaySenderCommandDUnitTest {
+
+  @Rule
+  public LocatorServerStartupRule locatorServerStartupRule = new LocatorServerStartupRule();
+
+  @Rule
+  public GfshShellConnectionRule gfsh = new GfshShellConnectionRule();
+
+  private MemberVM locatorSite1;
+  private MemberVM locatorSite2;
+  private MemberVM server1;
+  private MemberVM server2;
+  private MemberVM server3;
+  private MemberVM server4;
+  private MemberVM server5;
+
+  @Before
+  public void before() throws Exception {
+    Properties props = new Properties();
+    props.setProperty(DISTRIBUTED_SYSTEM_ID, "" + 1);
+    locatorSite1 = locatorServerStartupRule.startLocatorVM(1, props);
+
+    props.setProperty(DISTRIBUTED_SYSTEM_ID, "" + 2);
+    props.setProperty(REMOTE_LOCATORS, "localhost[" + locatorSite1.getPort() + "]");
+    locatorSite2 = locatorServerStartupRule.startLocatorVM(2, props);
+
+    // Connect Gfsh to locator.
+    gfsh.connectAndVerify(locatorSite1);
+  }
+
   @Test
-  public void testGatewaySenderStatus() {
-    Integer lnPort = vm1.invoke(() -> createFirstLocatorWithDSId(1));
-    propsSetUp(lnPort);
-    Integer nyPort = vm2.invoke(() -> createFirstRemoteLocator(2, lnPort));
-
-    vm6.invoke(() -> createAndStartReceiver(nyPort));
-    vm3.invoke(() -> createCache(lnPort));
-    vm3.invoke(() -> createSender("ln_Serial", 2, false, 100, 400, false, false, null, true));
-    vm3.invoke(() -> createSender("ln_Parallel", 2, true, 100, 400, false, false, null, true));
-    vm4.invoke(() -> createCache(lnPort));
-    vm4.invoke(() -> createSender("ln_Serial", 2, false, 100, 400, false, false, null, true));
-    vm4.invoke(() -> createSender("ln_Parallel", 2, true, 100, 400, false, false, null, true));
-    vm5.invoke(() -> createCache(lnPort));
-    vm5.invoke(() -> createSender("ln_Serial", 2, false, 100, 400, false, false, null, true));
-    vm5.invoke(() -> createSender("ln_Parallel", 2, true, 100, 400, false, false, null, true));
+  public void testGatewaySenderStatus() throws Exception {
+
+    Integer lnPort = locatorSite1.getPort();
+    Integer nyPort = locatorSite2.getPort();
+
+    // setup servers in Site #1 (London)
+    server1 = locatorServerStartupRule.startServerVM(3, lnPort);
+    server2 = locatorServerStartupRule.startServerVM(4, lnPort);
+    server3 = locatorServerStartupRule.startServerVM(5, lnPort);
+
+    // server in Site 2 (New York)
+    server4 = locatorServerStartupRule.startServerVM(6, nyPort);
+
+    server4.invoke(() -> createAndStartReceiver(nyPort));
+
+    server1.invoke(() -> createSender("ln_Serial", 2, false, 100, 400, false, false, null, true));
+    server1.invoke(() -> createSender("ln_Parallel", 2, true, 100, 400, false, false, null, true));
+
+    server2.invoke(() -> createSender("ln_Serial", 2, false, 100, 400, false, false, null, true));
+    server2.invoke(() -> createSender("ln_Parallel", 2, true, 100, 400, false, false, null, true));
+
+    server3.invoke(() -> createSender("ln_Serial", 2, false, 100, 400, false, false, null, true));
+    server3.invoke(() -> createSender("ln_Parallel", 2, true, 100, 400, false, false, null, true));
 
     pause(10000);
     String command = CliStrings.STATUS_GATEWAYSENDER + " --" + CliStrings.STATUS_GATEWAYSENDER__ID
         + "=ln_Serial";
-    CommandResult cmdResult = executeCommand(command);
+    CommandResult cmdResult = gfsh.executeCommand(command);
 
     if (cmdResult != null) {
       TabularResultData tableResultData = ((CompositeResultData) cmdResult.getResultData())
@@ -64,28 +114,26 @@ public class StatusGatewaySenderCommandDUnitTest extends WANCommandTestBase {
       List<String> result_Status = tableResultData.retrieveAllValues(CliStrings.RESULT_STATUS);
       assertEquals(3, result_Status.size());
       assertFalse(result_Status.contains(CliStrings.GATEWAY_RUNNING));
-      tableResultData = ((CompositeResultData) cmdResult.getResultData())
-          .retrieveSection(CliStrings.SECTION_GATEWAY_SENDER_NOT_AVAILABLE)
-          .retrieveTable(CliStrings.TABLE_GATEWAY_SENDER);
-      List<String> result_hosts = tableResultData.retrieveAllValues(CliStrings.RESULT_HOST_MEMBER);
-      assertEquals(2, result_hosts.size());
-      String strCmdResult = commandResultToString(cmdResult);
+      String strCmdResult = cmdResult.toString();
       getLogWriter().info("testGatewaySenderStatus : " + strCmdResult + ">>>>> ");
       assertEquals(Result.Status.OK, cmdResult.getStatus());
     } else {
       fail("testListGatewaySender failed as did not get CommandResult");
     }
-    vm3.invoke(() -> startSender("ln_Serial"));
-    vm3.invoke(() -> startSender("ln_Parallel"));
-    vm4.invoke(() -> startSender("ln_Serial"));
-    vm4.invoke(() -> startSender("ln_Parallel"));
-    vm5.invoke(() -> startSender("ln_Serial"));
-    vm5.invoke(() -> startSender("ln_Parallel"));
+
+    server1.invoke(() -> startSender("ln_Serial"));
+    server1.invoke(() -> startSender("ln_Parallel"));
+
+    server2.invoke(() -> startSender("ln_Serial"));
+    server2.invoke(() -> startSender("ln_Parallel"));
+
+    server3.invoke(() -> startSender("ln_Serial"));
+    server3.invoke(() -> startSender("ln_Parallel"));
 
     pause(10000);
     command = CliStrings.STATUS_GATEWAYSENDER + " --" + CliStrings.STATUS_GATEWAYSENDER__ID
         + "=ln_Serial";
-    cmdResult = executeCommand(command);
+    cmdResult = gfsh.executeCommand(command);
 
     if (cmdResult != null) {
       TabularResultData tableResultData = ((CompositeResultData) cmdResult.getResultData())
@@ -94,42 +142,53 @@ public class StatusGatewaySenderCommandDUnitTest extends WANCommandTestBase {
       List<String> result_Status = tableResultData.retrieveAllValues(CliStrings.RESULT_STATUS);
       assertEquals(3, result_Status.size());
       assertFalse(result_Status.contains(CliStrings.GATEWAY_NOT_RUNNING));
-      tableResultData = ((CompositeResultData) cmdResult.getResultData())
-          .retrieveSection(CliStrings.SECTION_GATEWAY_SENDER_NOT_AVAILABLE)
-          .retrieveTable(CliStrings.TABLE_GATEWAY_SENDER);
-      List<String> result_hosts = tableResultData.retrieveAllValues(CliStrings.RESULT_HOST_MEMBER);
-      assertEquals(2, result_hosts.size());
-      String strCmdResult = commandResultToString(cmdResult);
-      getLogWriter().info("testGatewaySenderStatus : " + strCmdResult + ">>>>> ");
-      assertEquals(Result.Status.OK, cmdResult.getStatus());
+      /*
+       * tableResultData = ((CompositeResultData) cmdResult.getResultData())
+       * .retrieveSection(CliStrings.SECTION_GATEWAY_SENDER_NOT_AVAILABLE)
+       * .retrieveTable(CliStrings.TABLE_GATEWAY_SENDER); List<String> result_hosts =
+       * tableResultData.retrieveAllValues(CliStrings.RESULT_HOST_MEMBER); assertEquals(2,
+       * result_hosts.size()); String strCmdResult = cmdResult.toString();
+       * getLogWriter().info("testGatewaySenderStatus : " + strCmdResult + ">>>>> ");
+       * assertEquals(Result.Status.OK, cmdResult.getStatus());
+       */
     } else {
       fail("testListGatewaySender failed as did not get CommandResult");
     }
   }
 
   @Test
-  public void testGatewaySenderStatus_OnMember() {
-    Integer lnPort = vm1.invoke(() -> createFirstLocatorWithDSId(1));
-    propsSetUp(lnPort);
-    Integer nyPort = vm2.invoke(() -> createFirstRemoteLocator(2, lnPort));
-
-    vm6.invoke(() -> createAndStartReceiver(nyPort));
-    vm3.invoke(() -> createCache(lnPort));
-    vm3.invoke(() -> createSender("ln_Serial", 2, false, 100, 400, false, false, null, true));
-    vm3.invoke(() -> createSender("ln_Parallel", 2, true, 100, 400, false, false, null, true));
-    vm4.invoke(() -> createCache(lnPort));
-    vm4.invoke(() -> createSender("ln_Serial", 2, false, 100, 400, false, false, null, true));
-    vm4.invoke(() -> createSender("ln_Parallel", 2, true, 100, 400, false, false, null, true));
-    vm5.invoke(() -> createCache(lnPort));
-
-    final DistributedMember vm1Member = vm3.invoke(this::getMember);
+  public void testGatewaySenderStatus_OnMember() throws Exception {
+
+    Integer lnPort = locatorSite1.getPort();
+    Integer nyPort = locatorSite2.getPort();
+
+    // setup servers in Site #1 (London)
+    server1 = locatorServerStartupRule.startServerVM(3, lnPort);
+    server2 = locatorServerStartupRule.startServerVM(4, lnPort);
+    server3 = locatorServerStartupRule.startServerVM(5, lnPort);
+
+    // server in Site 2 (New York)
+    server4 = locatorServerStartupRule.startServerVM(6, nyPort);
+
+    server4.invoke(() -> createAndStartReceiver(nyPort));
+
+    server1.invoke(() -> createSender("ln_Serial", 2, false, 100, 400, false, false, null, true));
+    server1.invoke(() -> createSender("ln_Parallel", 2, true, 100, 400, false, false, null, true));
+
+    server2.invoke(() -> createSender("ln_Serial", 2, false, 100, 400, false, false, null, true));
+    server2.invoke(() -> createSender("ln_Parallel", 2, true, 100, 400, false, false, null, true));
+
+    server3.invoke(() -> createSender("ln_Serial", 2, false, 100, 400, false, false, null, true));
+    server3.invoke(() -> createSender("ln_Parallel", 2, true, 100, 400, false, false, null, true));
+
+    final DistributedMember server1DM = (DistributedMember) server1.invoke(getMemberIdCallable());
     pause(10000);
     String command = CliStrings.STATUS_GATEWAYSENDER + " --" + CliStrings.STATUS_GATEWAYSENDER__ID
-        + "=ln_Serial --" + CliStrings.MEMBER + "=" + vm1Member.getId();
-    CommandResult cmdResult = executeCommand(command);
+        + "=ln_Serial --" + CliStrings.MEMBER + "=" + server1DM.getId();
+    CommandResult cmdResult = gfsh.executeCommand(command);
 
     if (cmdResult != null) {
-      String strCmdResult = commandResultToString(cmdResult);
+      String strCmdResult = cmdResult.toString();
       getLogWriter().info("testGatewaySenderStatus_OnMember : " + strCmdResult + ">>>>> ");
       TabularResultData tableResultData = ((CompositeResultData) cmdResult.getResultData())
           .retrieveSection(CliStrings.SECTION_GATEWAY_SENDER_AVAILABLE)
@@ -141,18 +200,20 @@ public class StatusGatewaySenderCommandDUnitTest extends WANCommandTestBase {
     } else {
       fail("testListGatewaySender failed as did not get CommandResult");
     }
-    vm3.invoke(() -> startSender("ln_Serial"));
-    vm3.invoke(() -> startSender("ln_Parallel"));
-    vm4.invoke(() -> startSender("ln_Serial"));
-    vm4.invoke(() -> startSender("ln_Parallel"));
+
+    server1.invoke(() -> startSender("ln_Serial"));
+    server1.invoke(() -> startSender("ln_Parallel"));
+
+    server2.invoke(() -> startSender("ln_Serial"));
+    server2.invoke(() -> startSender("ln_Parallel"));
 
     pause(10000);
     command = CliStrings.STATUS_GATEWAYSENDER + " --" + CliStrings.STATUS_GATEWAYSENDER__ID
-        + "=ln_Serial --" + CliStrings.MEMBER + "=" + vm1Member.getId();
-    cmdResult = executeCommand(command);
+        + "=ln_Serial --" + CliStrings.MEMBER + "=" + server1DM.getId();
+    cmdResult = gfsh.executeCommand(command);
 
     if (cmdResult != null) {
-      String strCmdResult = commandResultToString(cmdResult);
+      String strCmdResult = cmdResult.toString();
       getLogWriter().info("testGatewaySenderStatus_OnMember : " + strCmdResult + ">>>>> ");
       TabularResultData tableResultData = ((CompositeResultData) cmdResult.getResultData())
           .retrieveSection(CliStrings.SECTION_GATEWAY_SENDER_AVAILABLE)
@@ -164,12 +225,13 @@ public class StatusGatewaySenderCommandDUnitTest extends WANCommandTestBase {
     } else {
       fail("testListGatewaySender failed as did not get CommandResult");
     }
-    final DistributedMember vm5Member = vm5.invoke(this::getMember);
+
+    final DistributedMember server3DM = (DistributedMember) server3.invoke(getMemberIdCallable());
     command = CliStrings.STATUS_GATEWAYSENDER + " --" + CliStrings.STATUS_GATEWAYSENDER__ID
-        + "=ln_Serial --" + CliStrings.MEMBER + "=" + vm5Member.getId();
-    cmdResult = executeCommand(command);
+        + "=ln_Serial --" + CliStrings.MEMBER + "=" + server3DM.getId();
+    cmdResult = gfsh.executeCommand(command);
     if (cmdResult != null) {
-      String strCmdResult = commandResultToString(cmdResult);
+      String strCmdResult = cmdResult.toString();
       getLogWriter().info("testGatewaySenderStatus_OnMember : " + strCmdResult + ">>>>> ");
       assertEquals(Result.Status.OK, cmdResult.getStatus());
     } else {
@@ -178,28 +240,35 @@ public class StatusGatewaySenderCommandDUnitTest extends WANCommandTestBase {
   }
 
   @Test
-  public void testGatewaySenderStatus_OnGroups() {
-    Integer lnPort = vm1.invoke(() -> createFirstLocatorWithDSId(1));
-    propsSetUp(lnPort);
-    Integer nyPort = vm2.invoke(() -> createFirstRemoteLocator(2, lnPort));
-
-    vm7.invoke(() -> createAndStartReceiver(nyPort));
-    vm3.invoke(() -> createCacheWithGroups(lnPort, "Serial_Sender, Parallel_Sender"));
-    vm3.invoke(() -> createSender("ln_Serial", 2, false, 100, 400, false, false, null, true));
-    vm3.invoke(() -> createSender("ln_Parallel", 2, true, 100, 400, false, false, null, true));
-    vm4.invoke(() -> createCacheWithGroups(lnPort, "Serial_Sender, Parallel_Sender"));
-    vm4.invoke(() -> createSender("ln_Serial", 2, false, 100, 400, false, false, null, true));
-    vm4.invoke(() -> createSender("ln_Parallel", 2, true, 100, 400, false, false, null, true));
-    vm5.invoke(() -> createCacheWithGroups(lnPort, "Parallel_Sender"));
-    vm5.invoke(() -> createSender("ln_Serial", 2, false, 100, 400, false, false, null, true));
-    vm5.invoke(() -> createSender("ln_Parallel", 2, true, 100, 400, false, false, null, true));
-    vm6.invoke(() -> createCacheWithGroups(lnPort, "Serial_Sender"));
-
-    final DistributedMember vm1Member = vm3.invoke(this::getMember);
+  public void testGatewaySenderStatus_OnGroups() throws Exception {
+
+    Integer lnPort = locatorSite1.getPort();
+    Integer nyPort = locatorSite2.getPort();
+
+    // setup servers in Site #1 (London)
+    server1 = startServerWithGroups(3, "Serial_Sender, Parallel_Sender", lnPort);
+    server2 = startServerWithGroups(4, "Serial_Sender, Parallel_Sender", lnPort);
+    server3 = startServerWithGroups(5, "Parallel_Sender", lnPort);
+    server4 = startServerWithGroups(6, "Serial_Sender", lnPort);
+
+    // server in Site 2 (New York)
+    server5 = locatorServerStartupRule.startServerVM(7, nyPort);
+
+    server5.invoke(() -> createAndStartReceiver(nyPort));
+
+    server1.invoke(() -> createSender("ln_Serial", 2, false, 100, 400, false, false, null, true));
+    server1.invoke(() -> createSender("ln_Parallel", 2, true, 100, 400, false, false, null, true));
+
+    server2.invoke(() -> createSender("ln_Serial", 2, false, 100, 400, false, false, null, true));
+    server2.invoke(() -> createSender("ln_Parallel", 2, true, 100, 400, false, false, null, true));
+
+    server3.invoke(() -> createSender("ln_Serial", 2, false, 100, 400, false, false, null, true));
+    server3.invoke(() -> createSender("ln_Parallel", 2, true, 100, 400, false, false, null, true));
+
     pause(10000);
     String command = CliStrings.STATUS_GATEWAYSENDER + " --" + CliStrings.STATUS_GATEWAYSENDER__ID
         + "=ln_Serial --" + CliStrings.GROUP + "=Serial_Sender";
-    CommandResult cmdResult = executeCommand(command);
+    CommandResult cmdResult = gfsh.executeCommand(command);
 
     if (cmdResult != null) {
       TabularResultData tableResultData = ((CompositeResultData) cmdResult.getResultData())
@@ -213,21 +282,23 @@ public class StatusGatewaySenderCommandDUnitTest extends WANCommandTestBase {
           .retrieveTable(CliStrings.TABLE_GATEWAY_SENDER);
       List<String> result_hosts = tableResultData.retrieveAllValues(CliStrings.RESULT_HOST_MEMBER);
       assertEquals(1, result_hosts.size());
-      String strCmdResult = commandResultToString(cmdResult);
+      String strCmdResult = cmdResult.toString();
       getLogWriter().info("testGatewaySenderStatus_OnGroups : " + strCmdResult + ">>>>> ");
       assertEquals(Result.Status.OK, cmdResult.getStatus());
     } else {
       fail("testListGatewaySender failed as did not get CommandResult");
     }
-    vm3.invoke(() -> startSender("ln_Serial"));
-    vm3.invoke(() -> startSender("ln_Parallel"));
-    vm4.invoke(() -> startSender("ln_Serial"));
-    vm4.invoke(() -> startSender("ln_Parallel"));
+
+    server1.invoke(() -> startSender("ln_Serial"));
+    server1.invoke(() -> startSender("ln_Parallel"));
+
+    server2.invoke(() -> startSender("ln_Serial"));
+    server2.invoke(() -> startSender("ln_Parallel"));
 
     pause(10000);
     command = CliStrings.STATUS_GATEWAYSENDER + " --" + CliStrings.STATUS_GATEWAYSENDER__ID
         + "=ln_Serial --" + CliStrings.GROUP + "=Serial_Sender";
-    cmdResult = executeCommand(command);
+    cmdResult = gfsh.executeCommand(command);
 
     if (cmdResult != null) {
       TabularResultData tableResultData = ((CompositeResultData) cmdResult.getResultData())
@@ -241,11 +312,17 @@ public class StatusGatewaySenderCommandDUnitTest extends WANCommandTestBase {
           .retrieveTable(CliStrings.TABLE_GATEWAY_SENDER);
       List<String> result_hosts = tableResultData.retrieveAllValues(CliStrings.RESULT_HOST_MEMBER);
       assertEquals(1, result_hosts.size());
-      String strCmdResult = commandResultToString(cmdResult);
+      String strCmdResult = cmdResult.toString();
       getLogWriter().info("testGatewaySenderStatus_OnGroups : " + strCmdResult + ">>>>> ");
       assertEquals(Result.Status.OK, cmdResult.getStatus());
     } else {
       fail("testListGatewaySender failed as did not get CommandResult");
     }
   }
+
+  private MemberVM startServerWithGroups(int index, String groups, int locPort) throws Exception {
+    Properties props = new Properties();
+    props.setProperty(GROUPS, groups);
+    return locatorServerStartupRule.startServerVM(index, props, locPort);
+  }
 }
diff --git a/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/wancommand/StopGatewayReceiverCommandDUnitTest.java b/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/wancommand/StopGatewayReceiverCommandDUnitTest.java
index dd29fb0..23b79bf 100644
--- a/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/wancommand/StopGatewayReceiverCommandDUnitTest.java
+++ b/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/wancommand/StopGatewayReceiverCommandDUnitTest.java
@@ -14,6 +14,13 @@
  */
 package org.apache.geode.internal.cache.wan.wancommand;
 
+import static org.apache.geode.distributed.ConfigurationProperties.DISTRIBUTED_SYSTEM_ID;
+import static org.apache.geode.distributed.ConfigurationProperties.GROUPS;
+import static org.apache.geode.distributed.ConfigurationProperties.REMOTE_LOCATORS;
+import static org.apache.geode.internal.cache.wan.wancommand.WANCommandUtils.createAndStartReceiver;
+import static org.apache.geode.internal.cache.wan.wancommand.WANCommandUtils.createReceiver;
+import static org.apache.geode.internal.cache.wan.wancommand.WANCommandUtils.getMemberIdCallable;
+import static org.apache.geode.internal.cache.wan.wancommand.WANCommandUtils.verifyReceiverState;
 import static org.apache.geode.test.dunit.Assert.assertEquals;
 import static org.apache.geode.test.dunit.Assert.assertFalse;
 import static org.apache.geode.test.dunit.Assert.assertTrue;
@@ -22,7 +29,13 @@ import static org.apache.geode.test.dunit.LogWriterUtils.getLogWriter;
 import static org.apache.geode.test.dunit.Wait.pause;
 
 import java.util.List;
+import java.util.Properties;
 
+import org.apache.geode.test.dunit.rules.LocatorServerStartupRule;
+import org.apache.geode.test.dunit.rules.MemberVM;
+import org.apache.geode.test.junit.rules.GfshShellConnectionRule;
+import org.junit.Before;
+import org.junit.Rule;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
@@ -31,32 +44,59 @@ import org.apache.geode.management.cli.Result;
 import org.apache.geode.management.internal.cli.i18n.CliStrings;
 import org.apache.geode.management.internal.cli.result.CommandResult;
 import org.apache.geode.management.internal.cli.result.TabularResultData;
-import org.apache.geode.test.dunit.Host;
-import org.apache.geode.test.dunit.VM;
 import org.apache.geode.test.junit.categories.DistributedTest;
-import org.apache.geode.test.junit.categories.FlakyTest;
 
 @Category(DistributedTest.class)
-public class StopGatewayReceiverCommandDUnitTest extends WANCommandTestBase {
+public class StopGatewayReceiverCommandDUnitTest {
+
+  @Rule
+  public LocatorServerStartupRule locatorServerStartupRule = new LocatorServerStartupRule();
+
+  @Rule
+  public GfshShellConnectionRule gfsh = new GfshShellConnectionRule();
+
+  private MemberVM locatorSite1;
+  private MemberVM locatorSite2;
+  private MemberVM server1;
+  private MemberVM server2;
+  private MemberVM server3;
+  private MemberVM server4;
+  private MemberVM server5;
+
+  @Before
+  public void before() throws Exception {
+    Properties props = new Properties();
+    props.setProperty(DISTRIBUTED_SYSTEM_ID, "" + 1);
+    locatorSite1 = locatorServerStartupRule.startLocatorVM(1, props);
+
+    props.setProperty(DISTRIBUTED_SYSTEM_ID, "" + 2);
+    props.setProperty(REMOTE_LOCATORS, "localhost[" + locatorSite1.getPort() + "]");
+    locatorSite2 = locatorServerStartupRule.startLocatorVM(2, props);
+
+    // Connect Gfsh to locator.
+    gfsh.connectAndVerify(locatorSite1);
+  }
+
   /**
    * Test wan commands for error in input 1> start gateway-sender command needs only one of member
    * or group.
    */
   @Test
-  public void testStopGatewayReceiver_ErrorConditions() {
-    VM puneLocator = Host.getLocator();
-    int dsIdPort = puneLocator.invoke(this::getLocatorPort);
-    propsSetUp(dsIdPort);
+  public void testStopGatewayReceiver_ErrorConditions() throws Exception {
+
+    Integer locator1Port = locatorSite1.getPort();
 
-    vm2.invoke(() -> createFirstRemoteLocator(2, dsIdPort));
-    vm3.invoke(() -> createReceiver(dsIdPort));
+    // setup servers in Site #1 (London)
+    server1 = locatorServerStartupRule.startServerVM(3, locator1Port);
 
-    final DistributedMember vm1Member = vm3.invoke(this::getMember);
+    server1.invoke(() -> createReceiver(locator1Port));
+
+    final DistributedMember server1DM = (DistributedMember) server1.invoke(getMemberIdCallable());
     String command = CliStrings.STOP_GATEWAYRECEIVER + " --" + CliStrings.MEMBER + "="
-        + vm1Member.getId() + " --" + CliStrings.GROUP + "=RG1";
-    CommandResult cmdResult = executeCommand(command);
+        + server1DM.getId() + " --" + CliStrings.GROUP + "=RG1";
+    CommandResult cmdResult = gfsh.executeCommand(command);
     if (cmdResult != null) {
-      String strCmdResult = commandResultToString(cmdResult);
+      String strCmdResult = cmdResult.toString();
       getLogWriter()
           .info("testStopGatewayReceiver_ErrorConditions stringResult : " + strCmdResult + ">>>>");
       assertEquals(Result.Status.ERROR, cmdResult.getStatus());
@@ -66,64 +106,71 @@ public class StopGatewayReceiverCommandDUnitTest extends WANCommandTestBase {
     }
   }
 
-  @Category(FlakyTest.class) // GEODE-1418
   @Test
-  public void testStopGatewayReceiver() {
-    VM puneLocator = Host.getLocator();
-    int dsIdPort = puneLocator.invoke(this::getLocatorPort);
-    propsSetUp(dsIdPort);
-
-    vm2.invoke(() -> createFirstRemoteLocator(2, dsIdPort));
-    vm3.invoke(() -> createAndStartReceiver(dsIdPort));
-    vm4.invoke(() -> createAndStartReceiver(dsIdPort));
-    vm5.invoke(() -> createAndStartReceiver(dsIdPort));
-    vm3.invoke(() -> verifyReceiverState(true));
-    vm4.invoke(() -> verifyReceiverState(true));
-    vm5.invoke(() -> verifyReceiverState(true));
+  public void testStopGatewayReceiver() throws Exception {
+
+    Integer locator1Port = locatorSite1.getPort();
+
+    // setup servers in Site #1 (London)
+    server1 = locatorServerStartupRule.startServerVM(3, locator1Port);
+    server2 = locatorServerStartupRule.startServerVM(4, locator1Port);
+    server3 = locatorServerStartupRule.startServerVM(5, locator1Port);
+
+    server1.invoke(() -> createAndStartReceiver(locator1Port));
+    server2.invoke(() -> createAndStartReceiver(locator1Port));
+    server3.invoke(() -> createAndStartReceiver(locator1Port));
+
+    server1.invoke(() -> verifyReceiverState(true));
+    server2.invoke(() -> verifyReceiverState(true));
+    server3.invoke(() -> verifyReceiverState(true));
 
     pause(10000);
     String command = CliStrings.STOP_GATEWAYRECEIVER;
-    CommandResult cmdResult = executeCommand(command);
+    CommandResult cmdResult = gfsh.executeCommand(command);
     if (cmdResult != null) {
-      String strCmdResult = commandResultToString(cmdResult);
+      String strCmdResult = cmdResult.toString();
       getLogWriter().info("testStopGatewayReceiver stringResult : " + strCmdResult + ">>>>");
       TabularResultData resultData = (TabularResultData) cmdResult.getResultData();
       List<String> status = resultData.retrieveAllValues("Result");
-      assertEquals(4, status.size());
-      assertTrue(status.contains("Error"));
+      assertEquals(3, status.size());
       assertTrue(status.contains("OK"));
     } else {
       fail("testStopGatewayReceiver failed as did not get CommandResult");
     }
-    vm3.invoke(() -> verifyReceiverState(false));
-    vm4.invoke(() -> verifyReceiverState(false));
-    vm5.invoke(() -> verifyReceiverState(false));
+
+    server1.invoke(() -> verifyReceiverState(false));
+    server2.invoke(() -> verifyReceiverState(false));
+    server3.invoke(() -> verifyReceiverState(false));
   }
 
   /**
    * test to validate that the start gateway sender starts the gateway sender on a member
    */
   @Test
-  public void testStopGatewayReceiver_onMember() {
-    VM puneLocator = Host.getLocator();
-    int dsIdPort = puneLocator.invoke(this::getLocatorPort);
-    propsSetUp(dsIdPort);
-
-    vm2.invoke(() -> createFirstRemoteLocator(2, dsIdPort));
-    vm3.invoke(() -> createAndStartReceiver(dsIdPort));
-    vm4.invoke(() -> createAndStartReceiver(dsIdPort));
-    vm5.invoke(() -> createAndStartReceiver(dsIdPort));
-    vm3.invoke(() -> verifyReceiverState(true));
-    vm4.invoke(() -> verifyReceiverState(true));
-    vm5.invoke(() -> verifyReceiverState(true));
-
-    final DistributedMember vm1Member = vm3.invoke(this::getMember);
+  public void testStopGatewayReceiver_onMember() throws Exception {
+
+    Integer locator1Port = locatorSite1.getPort();
+
+    // setup servers in Site #1 (London)
+    server1 = locatorServerStartupRule.startServerVM(3, locator1Port);
+    server2 = locatorServerStartupRule.startServerVM(4, locator1Port);
+    server3 = locatorServerStartupRule.startServerVM(5, locator1Port);
+
+    server1.invoke(() -> createAndStartReceiver(locator1Port));
+    server2.invoke(() -> createAndStartReceiver(locator1Port));
+    server3.invoke(() -> createAndStartReceiver(locator1Port));
+
+    server1.invoke(() -> verifyReceiverState(true));
+    server2.invoke(() -> verifyReceiverState(true));
+    server3.invoke(() -> verifyReceiverState(true));
+
+    final DistributedMember server1DM = (DistributedMember) server1.invoke(getMemberIdCallable());
     pause(10000);
     String command =
-        CliStrings.STOP_GATEWAYRECEIVER + " --" + CliStrings.MEMBER + "=" + vm1Member.getId();
-    CommandResult cmdResult = executeCommand(command);
+        CliStrings.STOP_GATEWAYRECEIVER + " --" + CliStrings.MEMBER + "=" + server1DM.getId();
+    CommandResult cmdResult = gfsh.executeCommand(command);
     if (cmdResult != null) {
-      String strCmdResult = commandResultToString(cmdResult);
+      String strCmdResult = cmdResult.toString();
       getLogWriter()
           .info("testStopGatewayReceiver_onMember stringResult : " + strCmdResult + ">>>>");
       assertEquals(Result.Status.OK, cmdResult.getStatus());
@@ -131,33 +178,38 @@ public class StopGatewayReceiverCommandDUnitTest extends WANCommandTestBase {
     } else {
       fail("testStopGatewayReceiver failed as did not get CommandResult");
     }
-    vm3.invoke(() -> verifyReceiverState(false));
-    vm4.invoke(() -> verifyReceiverState(true));
-    vm5.invoke(() -> verifyReceiverState(true));
+
+    server1.invoke(() -> verifyReceiverState(false));
+    server2.invoke(() -> verifyReceiverState(true));
+    server3.invoke(() -> verifyReceiverState(true));
   }
 
   /**
    * test to validate that the start gateway sender starts the gateway sender on a group of members
    */
   @Test
-  public void testStopGatewayReceiver_Group() {
-    VM puneLocator = Host.getLocator();
-    int dsIdPort = puneLocator.invoke(this::getLocatorPort);
-    propsSetUp(dsIdPort);
-
-    vm2.invoke(() -> createFirstRemoteLocator(2, dsIdPort));
-    vm3.invoke(() -> createAndStartReceiverWithGroup(dsIdPort, "RG1"));
-    vm4.invoke(() -> createAndStartReceiverWithGroup(dsIdPort, "RG1"));
-    vm5.invoke(() -> createAndStartReceiverWithGroup(dsIdPort, "RG1"));
-    vm3.invoke(() -> verifyReceiverState(true));
-    vm4.invoke(() -> verifyReceiverState(true));
-    vm5.invoke(() -> verifyReceiverState(true));
+  public void testStopGatewayReceiver_Group() throws Exception {
+
+    Integer locator1Port = locatorSite1.getPort();
+
+    // setup servers in Site #1 (London)
+    server1 = startServerWithGroups(3, "RG1", locator1Port);
+    server2 = startServerWithGroups(4, "RG1", locator1Port);
+    server3 = startServerWithGroups(5, "RG1", locator1Port);
+
+    server1.invoke(() -> createAndStartReceiver(locator1Port));
+    server2.invoke(() -> createAndStartReceiver(locator1Port));
+    server3.invoke(() -> createAndStartReceiver(locator1Port));
+
+    server1.invoke(() -> verifyReceiverState(true));
+    server2.invoke(() -> verifyReceiverState(true));
+    server3.invoke(() -> verifyReceiverState(true));
 
     pause(10000);
     String command = CliStrings.STOP_GATEWAYRECEIVER + " --" + CliStrings.GROUP + "=RG1";
-    CommandResult cmdResult = executeCommand(command);
+    CommandResult cmdResult = gfsh.executeCommand(command);
     if (cmdResult != null) {
-      String strCmdResult = commandResultToString(cmdResult);
+      String strCmdResult = cmdResult.toString();
       getLogWriter().info("testStopGatewayReceiver_Group stringResult : " + strCmdResult + ">>>>");
       assertEquals(Result.Status.OK, cmdResult.getStatus());
 
@@ -169,9 +221,10 @@ public class StopGatewayReceiverCommandDUnitTest extends WANCommandTestBase {
     } else {
       fail("testStopGatewayReceiver_Group failed as did not get CommandResult");
     }
-    vm3.invoke(() -> verifyReceiverState(false));
-    vm4.invoke(() -> verifyReceiverState(false));
-    vm5.invoke(() -> verifyReceiverState(false));
+
+    server1.invoke(() -> verifyReceiverState(false));
+    server2.invoke(() -> verifyReceiverState(false));
+    server3.invoke(() -> verifyReceiverState(false));
   }
 
   /**
@@ -180,28 +233,34 @@ public class StopGatewayReceiverCommandDUnitTest extends WANCommandTestBase {
    * 
    */
   @Test
-  public void testStopGatewayReceiver_MultipleGroup() {
-    VM puneLocator = Host.getLocator();
-    int dsIdPort = puneLocator.invoke(this::getLocatorPort);
-    propsSetUp(dsIdPort);
-
-    vm2.invoke(() -> createFirstRemoteLocator(2, dsIdPort));
-    vm3.invoke(() -> createAndStartReceiverWithGroup(dsIdPort, "RG1"));
-    vm4.invoke(() -> createAndStartReceiverWithGroup(dsIdPort, "RG1"));
-    vm5.invoke(() -> createAndStartReceiverWithGroup(dsIdPort, "RG1"));
-    vm6.invoke(() -> createAndStartReceiverWithGroup(dsIdPort, "RG1, RG2"));
-    vm7.invoke(() -> createAndStartReceiverWithGroup(dsIdPort, "RG3"));
-    vm3.invoke(() -> verifyReceiverState(true));
-    vm4.invoke(() -> verifyReceiverState(true));
-    vm5.invoke(() -> verifyReceiverState(true));
-    vm6.invoke(() -> verifyReceiverState(true));
-    vm7.invoke(() -> verifyReceiverState(true));
+  public void testStopGatewayReceiver_MultipleGroup() throws Exception {
+
+    Integer locator1Port = locatorSite1.getPort();
+
+    // setup servers in Site #1 (London)
+    server1 = startServerWithGroups(3, "RG1", locator1Port);
+    server2 = startServerWithGroups(4, "RG1", locator1Port);
+    server3 = startServerWithGroups(5, "RG1", locator1Port);
+    server4 = startServerWithGroups(6, "RG1, RG2", locator1Port);
+    server5 = startServerWithGroups(7, "RG3", locator1Port);
+
+    server1.invoke(() -> createAndStartReceiver(locator1Port));
+    server2.invoke(() -> createAndStartReceiver(locator1Port));
+    server3.invoke(() -> createAndStartReceiver(locator1Port));
+    server4.invoke(() -> createAndStartReceiver(locator1Port));
+    server5.invoke(() -> createAndStartReceiver(locator1Port));
+
+    server1.invoke(() -> verifyReceiverState(true));
+    server2.invoke(() -> verifyReceiverState(true));
+    server3.invoke(() -> verifyReceiverState(true));
+    server4.invoke(() -> verifyReceiverState(true));
+    server5.invoke(() -> verifyReceiverState(true));
 
     pause(10000);
     String command = CliStrings.STOP_GATEWAYRECEIVER + " --" + CliStrings.GROUP + "=RG1,RG2";
-    CommandResult cmdResult = executeCommand(command);
+    CommandResult cmdResult = gfsh.executeCommand(command);
     if (cmdResult != null) {
-      String strCmdResult = commandResultToString(cmdResult);
+      String strCmdResult = cmdResult.toString();
       getLogWriter().info("testStopGatewayReceiver_Group stringResult : " + strCmdResult + ">>>>");
       assertEquals(Result.Status.OK, cmdResult.getStatus());
       TabularResultData resultData = (TabularResultData) cmdResult.getResultData();
@@ -212,10 +271,17 @@ public class StopGatewayReceiverCommandDUnitTest extends WANCommandTestBase {
     } else {
       fail("testStopGatewayReceiver failed as did not get CommandResult");
     }
-    vm3.invoke(() -> verifyReceiverState(false));
-    vm4.invoke(() -> verifyReceiverState(false));
-    vm5.invoke(() -> verifyReceiverState(false));
-    vm6.invoke(() -> verifyReceiverState(false));
-    vm7.invoke(() -> verifyReceiverState(true));
+
+    server1.invoke(() -> verifyReceiverState(false));
+    server2.invoke(() -> verifyReceiverState(false));
+    server3.invoke(() -> verifyReceiverState(false));
+    server4.invoke(() -> verifyReceiverState(false));
+    server5.invoke(() -> verifyReceiverState(true));
+  }
+
+  private MemberVM startServerWithGroups(int index, String groups, int locPort) throws Exception {
+    Properties props = new Properties();
+    props.setProperty(GROUPS, groups);
+    return locatorServerStartupRule.startServerVM(index, props, locPort);
   }
 }
diff --git a/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/wancommand/StopGatewaySenderCommandDUnitTest.java b/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/wancommand/StopGatewaySenderCommandDUnitTest.java
index ac43e1b..5a5b77c 100644
--- a/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/wancommand/StopGatewaySenderCommandDUnitTest.java
+++ b/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/wancommand/StopGatewaySenderCommandDUnitTest.java
@@ -14,6 +14,13 @@
  */
 package org.apache.geode.internal.cache.wan.wancommand;
 
+import static org.apache.geode.distributed.ConfigurationProperties.DISTRIBUTED_SYSTEM_ID;
+import static org.apache.geode.distributed.ConfigurationProperties.GROUPS;
+import static org.apache.geode.distributed.ConfigurationProperties.REMOTE_LOCATORS;
+import static org.apache.geode.internal.cache.wan.wancommand.WANCommandUtils.createSender;
+import static org.apache.geode.internal.cache.wan.wancommand.WANCommandUtils.getMemberIdCallable;
+import static org.apache.geode.internal.cache.wan.wancommand.WANCommandUtils.startSender;
+import static org.apache.geode.internal.cache.wan.wancommand.WANCommandUtils.verifySenderState;
 import static org.apache.geode.test.dunit.Assert.assertEquals;
 import static org.apache.geode.test.dunit.Assert.assertFalse;
 import static org.apache.geode.test.dunit.Assert.assertTrue;
@@ -22,7 +29,13 @@ import static org.apache.geode.test.dunit.LogWriterUtils.getLogWriter;
 import static org.apache.geode.test.dunit.Wait.pause;
 
 import java.util.List;
+import java.util.Properties;
 
+import org.apache.geode.test.dunit.rules.LocatorServerStartupRule;
+import org.apache.geode.test.dunit.rules.MemberVM;
+import org.apache.geode.test.junit.rules.GfshShellConnectionRule;
+import org.junit.Before;
+import org.junit.Rule;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
@@ -35,23 +48,53 @@ import org.apache.geode.test.dunit.IgnoredException;
 import org.apache.geode.test.junit.categories.DistributedTest;
 
 @Category(DistributedTest.class)
-public class StopGatewaySenderCommandDUnitTest extends WANCommandTestBase {
+public class StopGatewaySenderCommandDUnitTest {
+
+  @Rule
+  public LocatorServerStartupRule locatorServerStartupRule = new LocatorServerStartupRule();
+
+  @Rule
+  public GfshShellConnectionRule gfsh = new GfshShellConnectionRule();
+
+  private MemberVM locatorSite1;
+  private MemberVM locatorSite2;
+  private MemberVM server1;
+  private MemberVM server2;
+  private MemberVM server3;
+  private MemberVM server4;
+  private MemberVM server5;
+
+  @Before
+  public void before() throws Exception {
+    Properties props = new Properties();
+    props.setProperty(DISTRIBUTED_SYSTEM_ID, "" + 1);
+    locatorSite1 = locatorServerStartupRule.startLocatorVM(1, props);
+
+    props.setProperty(DISTRIBUTED_SYSTEM_ID, "" + 2);
+    props.setProperty(REMOTE_LOCATORS, "localhost[" + locatorSite1.getPort() + "]");
+    locatorSite2 = locatorServerStartupRule.startLocatorVM(2, props);
+
+    // Connect Gfsh to locator.
+    gfsh.connectAndVerify(locatorSite1);
+  }
+
   @Test
-  public void testStopGatewaySender_ErrorConditions() {
-    Integer dsIdPort = vm1.invoke(() -> createFirstLocatorWithDSId(1));
-    propsSetUp(dsIdPort);
+  public void testStopGatewaySender_ErrorConditions() throws Exception {
 
-    vm2.invoke(() -> createFirstRemoteLocator(2, dsIdPort));
-    vm3.invoke(() -> createCache(dsIdPort));
-    vm3.invoke(() -> createSender("ln", 2, false, 100, 400, false, false, null, true));
+    Integer locator1Port = locatorSite1.getPort();
 
-    final DistributedMember vm1Member = vm3.invoke(this::getMember);
+    // setup servers in Site #1 (London)
+    server1 = locatorServerStartupRule.startServerVM(3, locator1Port);
+
+    server1.invoke(() -> createSender("ln", 2, false, 100, 400, false, false, null, true));
+
+    final DistributedMember server1DM = (DistributedMember) server1.invoke(getMemberIdCallable());
     String command = CliStrings.STOP_GATEWAYSENDER + " --" + CliStrings.STOP_GATEWAYSENDER__ID
-        + "=ln --" + CliStrings.MEMBER + "=" + vm1Member.getId() + " --" + CliStrings.GROUP
+        + "=ln --" + CliStrings.MEMBER + "=" + server1DM.getId() + " --" + CliStrings.GROUP
         + "=SenderGroup1";
     CommandResult cmdResult = executeCommandWithIgnoredExceptions(command);
     if (cmdResult != null) {
-      String strCmdResult = commandResultToString(cmdResult);
+      String strCmdResult = cmdResult.toString();
       getLogWriter().info("testStopGatewaySender stringResult : " + strCmdResult + ">>>>");
       assertEquals(Result.Status.ERROR, cmdResult.getStatus());
       assertTrue(strCmdResult.contains(CliStrings.PROVIDE_EITHER_MEMBER_OR_GROUP_MESSAGE));
@@ -61,103 +104,109 @@ public class StopGatewaySenderCommandDUnitTest extends WANCommandTestBase {
   }
 
   @Test
-  public void testStopGatewaySender() {
-    Integer dsIdPort = vm1.invoke(() -> createFirstLocatorWithDSId(1));
-    propsSetUp(dsIdPort);
-
-    vm2.invoke(() -> createFirstRemoteLocator(2, dsIdPort));
-    vm3.invoke(() -> createCache(dsIdPort));
-    vm3.invoke(() -> createSender("ln", 2, false, 100, 400, false, false, null, true));
-    vm4.invoke(() -> createCache(dsIdPort));
-    vm4.invoke(() -> createSender("ln", 2, false, 100, 400, false, false, null, true));
-    vm5.invoke(() -> createCache(dsIdPort));
-    vm5.invoke(() -> createSender("ln", 2, false, 100, 400, false, false, null, true));
-    vm3.invoke(() -> startSender("ln"));
-    vm4.invoke(() -> startSender("ln"));
-    vm5.invoke(() -> startSender("ln"));
-    vm3.invoke(() -> verifySenderState("ln", true, false));
-    vm4.invoke(() -> verifySenderState("ln", true, false));
-    vm5.invoke(() -> verifySenderState("ln", true, false));
+  public void testStopGatewaySender() throws Exception {
+
+    Integer locator1Port = locatorSite1.getPort();
+
+    // setup servers in Site #1 (London)
+    server1 = locatorServerStartupRule.startServerVM(3, locator1Port);
+    server2 = locatorServerStartupRule.startServerVM(4, locator1Port);
+    server3 = locatorServerStartupRule.startServerVM(5, locator1Port);
+
+    server1.invoke(() -> createSender("ln", 2, false, 100, 400, false, false, null, true));
+    server2.invoke(() -> createSender("ln", 2, false, 100, 400, false, false, null, true));
+    server3.invoke(() -> createSender("ln", 2, false, 100, 400, false, false, null, true));
+
+    server1.invoke(() -> startSender("ln"));
+    server2.invoke(() -> startSender("ln"));
+    server3.invoke(() -> startSender("ln"));
+
+    server1.invoke(() -> verifySenderState("ln", true, false));
+    server2.invoke(() -> verifySenderState("ln", true, false));
+    server3.invoke(() -> verifySenderState("ln", true, false));
 
     pause(10000);
     String command =
         CliStrings.STOP_GATEWAYSENDER + " --" + CliStrings.STOP_GATEWAYSENDER__ID + "=ln";
     CommandResult cmdResult = executeCommandWithIgnoredExceptions(command);
     if (cmdResult != null) {
-      String strCmdResult = commandResultToString(cmdResult);
+      String strCmdResult = cmdResult.toString();
       getLogWriter().info("testStopGatewaySender stringResult : " + strCmdResult + ">>>>");
       assertEquals(Result.Status.OK, cmdResult.getStatus());
       TabularResultData resultData = (TabularResultData) cmdResult.getResultData();
       List<String> status = resultData.retrieveAllValues("Result");
-      assertEquals(5, status.size());
-      assertTrue(status.contains("Error"));
+      assertEquals(3, status.size());
       assertTrue(status.contains("OK"));
     } else {
       fail("testStopGatewaySender failed as did not get CommandResult");
     }
-    vm3.invoke(() -> verifySenderState("ln", false, false));
-    vm4.invoke(() -> verifySenderState("ln", false, false));
-    vm5.invoke(() -> verifySenderState("ln", false, false));
+    server1.invoke(() -> verifySenderState("ln", false, false));
+    server2.invoke(() -> verifySenderState("ln", false, false));
+    server3.invoke(() -> verifySenderState("ln", false, false));
   }
 
   /**
    * test to validate that the start gateway sender starts the gateway sender on a member
    */
   @Test
-  public void testStopGatewaySender_onMember() {
-    Integer dsIdPort = vm1.invoke(() -> createFirstLocatorWithDSId(1));
-    propsSetUp(dsIdPort);
+  public void testStopGatewaySender_onMember() throws Exception {
 
-    vm2.invoke(() -> createFirstRemoteLocator(2, dsIdPort));
-    vm3.invoke(() -> createCache(dsIdPort));
-    vm3.invoke(() -> createSender("ln", 2, false, 100, 400, false, false, null, true));
-    vm3.invoke(() -> startSender("ln"));
-    vm3.invoke(() -> verifySenderState("ln", true, false));
+    Integer locator1Port = locatorSite1.getPort();
 
-    final DistributedMember vm1Member = vm3.invoke(this::getMember);
+    // setup servers in Site #1 (London)
+    server1 = locatorServerStartupRule.startServerVM(3, locator1Port);
+
+    server1.invoke(() -> createSender("ln", 2, false, 100, 400, false, false, null, true));
+    server1.invoke(() -> startSender("ln"));
+    server1.invoke(() -> verifySenderState("ln", true, false));
+
+    final DistributedMember server1DM = (DistributedMember) server1.invoke(getMemberIdCallable());
     pause(10000);
     String command = CliStrings.STOP_GATEWAYSENDER + " --" + CliStrings.STOP_GATEWAYSENDER__ID
-        + "=ln --" + CliStrings.MEMBER + "=" + vm1Member.getId();
+        + "=ln --" + CliStrings.MEMBER + "=" + server1DM.getId();
     CommandResult cmdResult = executeCommandWithIgnoredExceptions(command);
     if (cmdResult != null) {
-      String strCmdResult = commandResultToString(cmdResult);
+      String strCmdResult = cmdResult.toString();
       getLogWriter().info("testStopGatewaySender stringResult : " + strCmdResult + ">>>>");
       assertEquals(Result.Status.OK, cmdResult.getStatus());
       assertTrue(strCmdResult.contains("is stopped on member"));
     } else {
       fail("testStopGatewaySender failed as did not get CommandResult");
     }
-    vm3.invoke(() -> verifySenderState("ln", false, false));
+    server1.invoke(() -> verifySenderState("ln", false, false));
   }
 
   /**
    * test to validate that the start gateway sender starts the gateway sender on a group of members
    */
   @Test
-  public void testStopGatewaySender_Group() {
-    Integer dsIdPort = vm1.invoke(() -> createFirstLocatorWithDSId(1));
-    propsSetUp(dsIdPort);
-
-    vm2.invoke(() -> createFirstRemoteLocator(2, dsIdPort));
-    vm3.invoke(() -> createCacheWithGroups(dsIdPort, "SenderGroup1"));
-    vm3.invoke(() -> createSender("ln", 2, false, 100, 400, false, false, null, true));
-    vm4.invoke(() -> createCacheWithGroups(dsIdPort, "SenderGroup1"));
-    vm4.invoke(() -> createSender("ln", 2, false, 100, 400, false, false, null, true));
-    vm5.invoke(() -> createCacheWithGroups(dsIdPort, "SenderGroup1"));
-    vm5.invoke(() -> createSender("ln", 2, false, 100, 400, false, false, null, true));
-    vm3.invoke(() -> startSender("ln"));
-    vm4.invoke(() -> startSender("ln"));
-    vm5.invoke(() -> startSender("ln"));
-    vm3.invoke(() -> verifySenderState("ln", true, false));
-    vm4.invoke(() -> verifySenderState("ln", true, false));
-    vm5.invoke(() -> verifySenderState("ln", true, false));
+  public void testStopGatewaySender_Group() throws Exception {
+
+    Integer locator1Port = locatorSite1.getPort();
+
+    // setup servers in Site #1 (London)
+    server1 = startServerWithGroups(3, "SenderGroup1", locator1Port);
+    server2 = startServerWithGroups(4, "SenderGroup1", locator1Port);
+    server3 = startServerWithGroups(5, "SenderGroup1", locator1Port);
+
+    server1.invoke(() -> createSender("ln", 2, false, 100, 400, false, false, null, true));
+    server2.invoke(() -> createSender("ln", 2, false, 100, 400, false, false, null, true));
+    server3.invoke(() -> createSender("ln", 2, false, 100, 400, false, false, null, true));
+
+    server1.invoke(() -> startSender("ln"));
+    server2.invoke(() -> startSender("ln"));
+    server3.invoke(() -> startSender("ln"));
+
+    server1.invoke(() -> verifySenderState("ln", true, false));
+    server2.invoke(() -> verifySenderState("ln", true, false));
+    server3.invoke(() -> verifySenderState("ln", true, false));
 
     pause(10000);
     String command = CliStrings.STOP_GATEWAYSENDER + " --" + CliStrings.STOP_GATEWAYSENDER__ID
         + "=ln --" + CliStrings.GROUP + "=SenderGroup1";
     CommandResult cmdResult = executeCommandWithIgnoredExceptions(command);
     if (cmdResult != null) {
-      String strCmdResult = commandResultToString(cmdResult);
+      String strCmdResult = cmdResult.toString();
       getLogWriter().info("testStopGatewaySender_Group stringResult : " + strCmdResult + ">>>>");
       assertEquals(Result.Status.OK, cmdResult.getStatus());
       TabularResultData resultData = (TabularResultData) cmdResult.getResultData();
@@ -168,9 +217,10 @@ public class StopGatewaySenderCommandDUnitTest extends WANCommandTestBase {
     } else {
       fail("testStopGatewaySender failed as did not get CommandResult");
     }
-    vm3.invoke(() -> verifySenderState("ln", false, false));
-    vm4.invoke(() -> verifySenderState("ln", false, false));
-    vm5.invoke(() -> verifySenderState("ln", false, false));
+
+    server1.invoke(() -> verifySenderState("ln", false, false));
+    server2.invoke(() -> verifySenderState("ln", false, false));
+    server3.invoke(() -> verifySenderState("ln", false, false));
   }
 
   /**
@@ -178,38 +228,41 @@ public class StopGatewaySenderCommandDUnitTest extends WANCommandTestBase {
    * to multiple groups
    */
   @Test
-  public void testStopGatewaySender_MultipleGroup() {
-    Integer dsIdPort = vm1.invoke(() -> createFirstLocatorWithDSId(1));
-    propsSetUp(dsIdPort);
-
-    vm2.invoke(() -> createFirstRemoteLocator(2, dsIdPort));
-    vm3.invoke(() -> createCacheWithGroups(dsIdPort, "SenderGroup1"));
-    vm3.invoke(() -> createSender("ln", 2, false, 100, 400, false, false, null, true));
-    vm4.invoke(() -> createCacheWithGroups(dsIdPort, "SenderGroup1"));
-    vm4.invoke(() -> createSender("ln", 2, false, 100, 400, false, false, null, true));
-    vm5.invoke(() -> createCacheWithGroups(dsIdPort, "SenderGroup1, SenderGroup2"));
-    vm5.invoke(() -> createSender("ln", 2, false, 100, 400, false, false, null, true));
-    vm6.invoke(() -> createCacheWithGroups(dsIdPort, "SenderGroup2"));
-    vm6.invoke(() -> createSender("ln", 2, false, 100, 400, false, false, null, true));
-    vm7.invoke(() -> createCacheWithGroups(dsIdPort, "SenderGroup3"));
-    vm7.invoke(() -> createSender("ln", 2, false, 100, 400, false, false, null, true));
-    vm3.invoke(() -> startSender("ln"));
-    vm4.invoke(() -> startSender("ln"));
-    vm5.invoke(() -> startSender("ln"));
-    vm6.invoke(() -> startSender("ln"));
-    vm7.invoke(() -> startSender("ln"));
-    vm3.invoke(() -> verifySenderState("ln", true, false));
-    vm4.invoke(() -> verifySenderState("ln", true, false));
-    vm5.invoke(() -> verifySenderState("ln", true, false));
-    vm6.invoke(() -> verifySenderState("ln", true, false));
-    vm7.invoke(() -> verifySenderState("ln", true, false));
+  public void testStopGatewaySender_MultipleGroup() throws Exception {
+
+    Integer locator1Port = locatorSite1.getPort();
+
+    // setup servers in Site #1 (London)
+    server1 = startServerWithGroups(3, "SenderGroup1", locator1Port);
+    server2 = startServerWithGroups(4, "SenderGroup1", locator1Port);
+    server3 = startServerWithGroups(5, "SenderGroup1, SenderGroup2", locator1Port);
+    server4 = startServerWithGroups(6, "SenderGroup2", locator1Port);
+    server5 = startServerWithGroups(7, "SenderGroup3", locator1Port);
+
+    server1.invoke(() -> createSender("ln", 2, false, 100, 400, false, false, null, true));
+    server2.invoke(() -> createSender("ln", 2, false, 100, 400, false, false, null, true));
+    server3.invoke(() -> createSender("ln", 2, false, 100, 400, false, false, null, true));
+    server4.invoke(() -> createSender("ln", 2, false, 100, 400, false, false, null, true));
+    server5.invoke(() -> createSender("ln", 2, false, 100, 400, false, false, null, true));
+
+    server1.invoke(() -> startSender("ln"));
+    server2.invoke(() -> startSender("ln"));
+    server3.invoke(() -> startSender("ln"));
+    server4.invoke(() -> startSender("ln"));
+    server5.invoke(() -> startSender("ln"));
+
+    server1.invoke(() -> verifySenderState("ln", true, false));
+    server2.invoke(() -> verifySenderState("ln", true, false));
+    server3.invoke(() -> verifySenderState("ln", true, false));
+    server4.invoke(() -> verifySenderState("ln", true, false));
+    server5.invoke(() -> verifySenderState("ln", true, false));
 
     pause(10000);
     String command = CliStrings.STOP_GATEWAYSENDER + " --" + CliStrings.STOP_GATEWAYSENDER__ID
         + "=ln --" + CliStrings.GROUP + "=SenderGroup1,SenderGroup2";
     CommandResult cmdResult = executeCommandWithIgnoredExceptions(command);
     if (cmdResult != null) {
-      String strCmdResult = commandResultToString(cmdResult);
+      String strCmdResult = cmdResult.toString();
       getLogWriter().info("testStopGatewaySender_Group stringResult : " + strCmdResult + ">>>>");
       assertEquals(Result.Status.OK, cmdResult.getStatus());
       TabularResultData resultData = (TabularResultData) cmdResult.getResultData();
@@ -220,17 +273,23 @@ public class StopGatewaySenderCommandDUnitTest extends WANCommandTestBase {
     } else {
       fail("testStopGatewaySender failed as did not get CommandResult");
     }
-    vm3.invoke(() -> verifySenderState("ln", false, false));
-    vm4.invoke(() -> verifySenderState("ln", false, false));
-    vm5.invoke(() -> verifySenderState("ln", false, false));
-    vm6.invoke(() -> verifySenderState("ln", false, false));
-    vm7.invoke(() -> verifySenderState("ln", true, false));
+    server1.invoke(() -> verifySenderState("ln", false, false));
+    server2.invoke(() -> verifySenderState("ln", false, false));
+    server3.invoke(() -> verifySenderState("ln", false, false));
+    server4.invoke(() -> verifySenderState("ln", false, false));
+    server5.invoke(() -> verifySenderState("ln", true, false));
   }
 
   private CommandResult executeCommandWithIgnoredExceptions(String command) {
     final IgnoredException exln = IgnoredException.addIgnoredException("Could not connect");
-    CommandResult commandResult = executeCommand(command);
+    CommandResult commandResult = gfsh.executeCommand(command);
     exln.remove();
     return commandResult;
   }
+
+  private MemberVM startServerWithGroups(int index, String groups, int locPort) throws Exception {
+    Properties props = new Properties();
+    props.setProperty(GROUPS, groups);
+    return locatorServerStartupRule.startServerVM(index, props, locPort);
+  }
 }
diff --git a/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/wancommand/WANCommandTestBase.java b/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/wancommand/WANCommandTestBase.java
deleted file mode 100644
index f944064..0000000
--- a/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/wancommand/WANCommandTestBase.java
+++ /dev/null
@@ -1,559 +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.cache.wan.wancommand;
-
-import static org.apache.geode.distributed.ConfigurationProperties.BIND_ADDRESS;
-import static org.apache.geode.distributed.ConfigurationProperties.DISTRIBUTED_SYSTEM_ID;
-import static org.apache.geode.distributed.ConfigurationProperties.GROUPS;
-import static org.apache.geode.distributed.ConfigurationProperties.LOCATORS;
-import static org.apache.geode.distributed.ConfigurationProperties.MCAST_PORT;
-import static org.apache.geode.distributed.ConfigurationProperties.REMOTE_LOCATORS;
-import static org.apache.geode.distributed.ConfigurationProperties.SERVER_BIND_ADDRESS;
-import static org.apache.geode.distributed.ConfigurationProperties.START_LOCATOR;
-import static org.apache.geode.test.dunit.Assert.assertEquals;
-import static org.apache.geode.test.dunit.Assert.fail;
-import static org.junit.Assert.assertNull;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Properties;
-import java.util.Set;
-
-import javax.management.remote.JMXConnectorServer;
-
-import org.apache.geode.cache.Cache;
-import org.apache.geode.cache.CacheFactory;
-import org.apache.geode.cache.DiskStore;
-import org.apache.geode.cache.DiskStoreFactory;
-import org.apache.geode.cache.client.PoolFactory;
-import org.apache.geode.cache.client.PoolManager;
-import org.apache.geode.cache.client.internal.ConnectionSource;
-import org.apache.geode.cache.client.internal.PoolImpl;
-import org.apache.geode.cache.wan.GatewayEventFilter;
-import org.apache.geode.cache.wan.GatewayReceiver;
-import org.apache.geode.cache.wan.GatewayReceiverFactory;
-import org.apache.geode.cache.wan.GatewaySender;
-import org.apache.geode.cache.wan.GatewaySender.OrderPolicy;
-import org.apache.geode.cache.wan.GatewaySenderFactory;
-import org.apache.geode.cache.wan.GatewayTransportFilter;
-import org.apache.geode.distributed.DistributedMember;
-import org.apache.geode.distributed.Locator;
-import org.apache.geode.distributed.internal.InternalDistributedSystem;
-import org.apache.geode.distributed.internal.ServerLocation;
-import org.apache.geode.internal.AvailablePort;
-import org.apache.geode.internal.AvailablePortHelper;
-import org.apache.geode.internal.cache.CacheServerAdvisor;
-import org.apache.geode.internal.cache.CacheServerImpl;
-import org.apache.geode.internal.cache.GemFireCacheImpl;
-import org.apache.geode.internal.cache.LocalRegion;
-import org.apache.geode.internal.cache.wan.AbstractGatewaySender;
-import org.apache.geode.internal.cache.wan.parallel.ParallelGatewaySenderQueue;
-import org.apache.geode.internal.net.SocketCreator;
-import org.apache.geode.management.ManagementService;
-import org.apache.geode.management.internal.cli.commands.CliCommandTestBase;
-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.SerializableRunnable;
-import org.apache.geode.test.dunit.VM;
-
-public abstract class WANCommandTestBase extends CliCommandTestBase {
-
-  static Cache cache;
-  private JMXConnectorServer jmxConnectorServer;
-  private ManagementService managementService;
-  // public String jmxHost;
-  // public int jmxPort;
-
-  static VM vm0;
-  static VM vm1;
-  static VM vm2;
-  static VM vm3;
-  static VM vm4;
-  static VM vm5;
-  static VM vm6;
-  static VM vm7;
-
-  @Override
-  public final void postSetUpCliCommandTestBase() throws Exception {
-    final Host host = Host.getHost(0);
-    vm0 = host.getVM(0);
-    vm1 = host.getVM(1);
-    vm2 = host.getVM(2);
-    vm3 = host.getVM(3);
-    vm4 = host.getVM(4);
-    vm5 = host.getVM(5);
-    vm6 = host.getVM(6);
-    vm7 = host.getVM(7);
-    enableManagement();
-  }
-
-  public Integer createFirstLocatorWithDSId(int dsId) {
-    int port = AvailablePortHelper.getRandomAvailablePortForDUnitSite();
-    Properties props = getDistributedSystemProperties();
-    props.setProperty(MCAST_PORT, "0");
-    props.setProperty(DISTRIBUTED_SYSTEM_ID, "" + dsId);
-    props.setProperty(LOCATORS, "localhost[" + port + "]");
-    props.setProperty(START_LOCATOR,
-        "localhost[" + port + "],server=true,peer=true,hostname-for-clients=localhost");
-    InternalDistributedSystem ds = getSystem(props);
-    cache = CacheFactory.create(ds);
-    return port;
-  }
-
-  public Integer createFirstRemoteLocator(int dsId, int remoteLocPort) {
-    int port = AvailablePortHelper.getRandomAvailablePortForDUnitSite();
-    Properties props = getDistributedSystemProperties();
-    props.setProperty(MCAST_PORT, "0");
-    props.setProperty(DISTRIBUTED_SYSTEM_ID, "" + dsId);
-    props.setProperty(LOCATORS, "localhost[" + port + "]");
-    props.setProperty(START_LOCATOR,
-        "localhost[" + port + "],server=true,peer=true,hostname-for-clients=localhost");
-    props.setProperty(REMOTE_LOCATORS, "localhost[" + remoteLocPort + "]");
-    getSystem(props);
-    return port;
-  }
-
-  public void createCache(Integer locPort) {
-    Properties props = getDistributedSystemProperties();
-    props.setProperty(MCAST_PORT, "0");
-    props.setProperty(LOCATORS, "localhost[" + locPort + "]");
-    InternalDistributedSystem ds = getSystem(props);
-    cache = CacheFactory.create(ds);
-  }
-
-  public void createCacheWithGroups(Integer locPort, String groups) {
-    Properties props = getDistributedSystemProperties();
-    props.setProperty(MCAST_PORT, "0");
-    props.setProperty(LOCATORS, "localhost[" + locPort + "]");
-    props.setProperty(GROUPS, groups);
-    InternalDistributedSystem ds = getSystem(props);
-    cache = CacheFactory.create(ds);
-  }
-
-  public void createCacheWithBindAddress(Integer locPort, String bindAddress, String groups) {
-    Properties props = getDistributedSystemProperties();
-    props.setProperty(MCAST_PORT, "0");
-    props.setProperty(LOCATORS, "localhost[" + locPort + "]");
-    props.setProperty(BIND_ADDRESS, bindAddress);
-    props.setProperty(GROUPS, groups);
-    InternalDistributedSystem ds = getSystem(props);
-    cache = CacheFactory.create(ds);
-  }
-
-  public void createCacheWithServerBindAddress(Integer locPort, String bindAddress, String groups) {
-    Properties props = getDistributedSystemProperties();
-    props.setProperty(MCAST_PORT, "0");
-    props.setProperty(LOCATORS, "localhost[" + locPort + "]");
-    props.setProperty(SERVER_BIND_ADDRESS, bindAddress);
-    props.setProperty(GROUPS, groups);
-    InternalDistributedSystem ds = getSystem(props);
-    cache = CacheFactory.create(ds);
-  }
-
-  public void createCacheWithMultipleBindAddressProperties(Integer locPort, String bindAddress,
-      String serverBindAddress, String groups) {
-    Properties props = getDistributedSystemProperties();
-    props.setProperty(MCAST_PORT, "0");
-    props.setProperty(LOCATORS, "localhost[" + locPort + "]");
-    props.setProperty(BIND_ADDRESS, bindAddress);
-    props.setProperty(SERVER_BIND_ADDRESS, serverBindAddress);
-    props.setProperty(GROUPS, groups);
-    InternalDistributedSystem ds = getSystem(props);
-    cache = CacheFactory.create(ds);
-  }
-
-  public void createSender(String dsName, int remoteDsId, boolean isParallel, Integer maxMemory,
-      Integer batchSize, boolean isConflation, boolean isPersistent, GatewayEventFilter filter,
-      boolean isManualStart) {
-    File persistentDirectory =
-        new File(dsName + "_disk_" + System.currentTimeMillis() + "_" + VM.getCurrentVMNum());
-    persistentDirectory.mkdir();
-    DiskStoreFactory dsf = cache.createDiskStoreFactory();
-    File[] dirs1 = new File[] {persistentDirectory};
-    if (isParallel) {
-      GatewaySenderFactory gateway = cache.createGatewaySenderFactory();
-      gateway.setParallel(true);
-      gateway.setMaximumQueueMemory(maxMemory);
-      gateway.setBatchSize(batchSize);
-      gateway.setManualStart(isManualStart);
-      if (filter != null) {
-        gateway.addGatewayEventFilter(filter);
-      }
-      if (isPersistent) {
-        gateway.setPersistenceEnabled(true);
-        gateway.setDiskStoreName(dsf.setDiskDirs(dirs1).create(dsName).getName());
-      } else {
-        DiskStore store = dsf.setDiskDirs(dirs1).create(dsName);
-        gateway.setDiskStoreName(store.getName());
-      }
-      gateway.setBatchConflationEnabled(isConflation);
-      gateway.create(dsName, remoteDsId);
-
-    } else {
-      GatewaySenderFactory gateway = cache.createGatewaySenderFactory();
-      gateway.setMaximumQueueMemory(maxMemory);
-      gateway.setBatchSize(batchSize);
-      gateway.setManualStart(isManualStart);
-      if (filter != null) {
-        gateway.addGatewayEventFilter(filter);
-      }
-      gateway.setBatchConflationEnabled(isConflation);
-      if (isPersistent) {
-        gateway.setPersistenceEnabled(true);
-        gateway.setDiskStoreName(dsf.setDiskDirs(dirs1).create(dsName).getName());
-      } else {
-        DiskStore store = dsf.setDiskDirs(dirs1).create(dsName);
-        gateway.setDiskStoreName(store.getName());
-      }
-      gateway.create(dsName, remoteDsId);
-    }
-  }
-
-  public void startSender(String senderId) {
-    final IgnoredException exln = IgnoredException.addIgnoredException("Could not connect");
-    try {
-      Set<GatewaySender> senders = cache.getGatewaySenders();
-      AbstractGatewaySender sender = (AbstractGatewaySender) senders.stream()
-          .filter(s -> s.getId().equalsIgnoreCase(senderId)).findFirst().orElse(null);
-      sender.start();
-    } finally {
-      exln.remove();
-    }
-  }
-
-  public void pauseSender(String senderId) {
-    final IgnoredException exln = IgnoredException.addIgnoredException("Could not connect");
-    try {
-      Set<GatewaySender> senders = cache.getGatewaySenders();
-      AbstractGatewaySender sender = (AbstractGatewaySender) senders.stream()
-          .filter(s -> s.getId().equalsIgnoreCase(senderId)).findFirst().orElse(null);
-      sender.pause();
-    } finally {
-      exln.remove();
-    }
-  }
-
-  public int createAndStartReceiver(int locPort) {
-    Properties props = getDistributedSystemProperties();
-    props.setProperty(MCAST_PORT, "0");
-    props.setProperty(LOCATORS, "localhost[" + locPort + "]");
-
-    InternalDistributedSystem ds = getSystem(props);
-    cache = CacheFactory.create(ds);
-    GatewayReceiverFactory fact = cache.createGatewayReceiverFactory();
-    int port = AvailablePortHelper.getRandomAvailablePortForDUnitSite();
-    fact.setStartPort(port);
-    fact.setEndPort(port);
-    fact.setManualStart(true);
-    GatewayReceiver receiver = fact.create();
-    try {
-      receiver.start();
-    } catch (IOException e) {
-      e.printStackTrace();
-      fail("Test " + getName() + " failed to start GatewayReceiver");
-    }
-    return port;
-  }
-
-  public int createReceiver(int locPort) {
-    Properties props = getDistributedSystemProperties();
-    props.setProperty(MCAST_PORT, "0");
-    props.setProperty(LOCATORS, "localhost[" + locPort + "]");
-
-    InternalDistributedSystem ds = getSystem(props);
-    cache = CacheFactory.create(ds);
-    GatewayReceiverFactory fact = cache.createGatewayReceiverFactory();
-    fact.setStartPort(AvailablePort.AVAILABLE_PORTS_LOWER_BOUND);
-    fact.setEndPort(AvailablePort.AVAILABLE_PORTS_UPPER_BOUND);
-    fact.setManualStart(true);
-    GatewayReceiver receiver = fact.create();
-    return receiver.getPort();
-  }
-
-  public int createReceiverWithGroup(int locPort, String groups) {
-    Properties props = getDistributedSystemProperties();
-    props.setProperty(MCAST_PORT, "0");
-    props.setProperty(LOCATORS, "localhost[" + locPort + "]");
-    props.setProperty(GROUPS, groups);
-
-    InternalDistributedSystem ds = getSystem(props);
-    cache = CacheFactory.create(ds);
-    GatewayReceiverFactory fact = cache.createGatewayReceiverFactory();
-    fact.setStartPort(AvailablePort.AVAILABLE_PORTS_LOWER_BOUND);
-    fact.setEndPort(AvailablePort.AVAILABLE_PORTS_UPPER_BOUND);
-    fact.setManualStart(true);
-    GatewayReceiver receiver = fact.create();
-    return receiver.getPort();
-
-  }
-
-  public void startReceiver() {
-    try {
-      Set<GatewayReceiver> receivers = cache.getGatewayReceivers();
-      for (GatewayReceiver receiver : receivers) {
-        receiver.start();
-      }
-    } catch (IOException e) {
-      e.printStackTrace();
-      fail("Test " + getName() + " failed to start GatewayReceiver");
-    }
-  }
-
-  public void stopReceiver() {
-    Set<GatewayReceiver> receivers = cache.getGatewayReceivers();
-    for (GatewayReceiver receiver : receivers) {
-      receiver.stop();
-    }
-  }
-
-  public int createAndStartReceiverWithGroup(int locPort, String groups) {
-    Properties props = getDistributedSystemProperties();
-    props.setProperty(MCAST_PORT, "0");
-    props.setProperty(LOCATORS, "localhost[" + locPort + "]");
-    props.setProperty(GROUPS, groups);
-
-    InternalDistributedSystem ds = getSystem(props);
-    cache = CacheFactory.create(ds);
-    GatewayReceiverFactory fact = cache.createGatewayReceiverFactory();
-    int port = AvailablePortHelper.getRandomAvailablePortForDUnitSite();
-    fact.setStartPort(port);
-    fact.setEndPort(port);
-    fact.setManualStart(true);
-    GatewayReceiver receiver = fact.create();
-    try {
-      receiver.start();
-    } catch (IOException e) {
-      e.printStackTrace();
-      fail("Test " + getName() + " failed to start GatewayReceiver on port " + port);
-    }
-    return port;
-  }
-
-  public DistributedMember getMember() {
-    return cache.getDistributedSystem().getDistributedMember();
-  }
-
-
-  public int getLocatorPort() {
-    return Locator.getLocators().get(0).getPort();
-  }
-
-  /**
-   * Enable system property gemfire.disableManagement false in each VM.
-   */
-  public void enableManagement() {
-    Invoke.invokeInEveryVM(new SerializableRunnable("Enable Management") {
-      public void run() {
-        System.setProperty(InternalDistributedSystem.DISABLE_MANAGEMENT_PROPERTY, "false");
-      }
-    });
-
-  }
-
-  public void verifySenderState(String senderId, boolean isRunning, boolean isPaused) {
-    final IgnoredException exln = IgnoredException.addIgnoredException("Could not connect");
-    try {
-      Set<GatewaySender> senders = cache.getGatewaySenders();
-      AbstractGatewaySender sender = (AbstractGatewaySender) senders.stream()
-          .filter(s -> s.getId().equalsIgnoreCase(senderId)).findFirst().orElse(null);
-      assertEquals(isRunning, sender.isRunning());
-      assertEquals(isPaused, sender.isPaused());
-    } finally {
-      exln.remove();
-    }
-  }
-
-  public void verifySenderAttributes(String senderId, int remoteDsID, boolean isParallel,
-      boolean manualStart, int socketBufferSize, int socketReadTimeout,
-      boolean enableBatchConflation, int batchSize, int batchTimeInterval,
-      boolean enablePersistence, boolean diskSynchronous, int maxQueueMemory, int alertThreshold,
-      int dispatcherThreads, OrderPolicy orderPolicy, List<String> expectedGatewayEventFilters,
-      List<String> expectedGatewayTransportFilters) {
-
-    Set<GatewaySender> senders = cache.getGatewaySenders();
-    AbstractGatewaySender sender = (AbstractGatewaySender) senders.stream()
-        .filter(s -> s.getId().equalsIgnoreCase(senderId)).findFirst().orElse(null);
-    assertEquals("remoteDistributedSystemId", remoteDsID, sender.getRemoteDSId());
-    assertEquals("isParallel", isParallel, sender.isParallel());
-    assertEquals("manualStart", manualStart, sender.isManualStart());
-    assertEquals("socketBufferSize", socketBufferSize, sender.getSocketBufferSize());
-    assertEquals("socketReadTimeout", socketReadTimeout, sender.getSocketReadTimeout());
-    assertEquals("enableBatchConflation", enableBatchConflation, sender.isBatchConflationEnabled());
-    assertEquals("batchSize", batchSize, sender.getBatchSize());
-    assertEquals("batchTimeInterval", batchTimeInterval, sender.getBatchTimeInterval());
-    assertEquals("enablePersistence", enablePersistence, sender.isPersistenceEnabled());
-    assertEquals("diskSynchronous", diskSynchronous, sender.isDiskSynchronous());
-    assertEquals("maxQueueMemory", maxQueueMemory, sender.getMaximumQueueMemory());
-    assertEquals("alertThreshold", alertThreshold, sender.getAlertThreshold());
-    assertEquals("dispatcherThreads", dispatcherThreads, sender.getDispatcherThreads());
-    assertEquals("orderPolicy", orderPolicy, sender.getOrderPolicy());
-
-    // verify GatewayEventFilters
-    if (expectedGatewayEventFilters != null) {
-      assertEquals("gatewayEventFilters", expectedGatewayEventFilters.size(),
-          sender.getGatewayEventFilters().size());
-
-      List<GatewayEventFilter> actualGatewayEventFilters = sender.getGatewayEventFilters();
-      List<String> actualEventFilterClassNames =
-          new ArrayList<String>(actualGatewayEventFilters.size());
-      for (GatewayEventFilter filter : actualGatewayEventFilters) {
-        actualEventFilterClassNames.add(filter.getClass().getName());
-      }
-
-      for (String expectedGatewayEventFilter : expectedGatewayEventFilters) {
-        if (!actualEventFilterClassNames.contains(expectedGatewayEventFilter)) {
-          fail("GatewayEventFilter " + expectedGatewayEventFilter
-              + " is not added to the GatewaySender");
-        }
-      }
-    }
-
-    // verify GatewayTransportFilters
-    if (expectedGatewayTransportFilters != null) {
-      assertEquals("gatewayTransportFilters", expectedGatewayTransportFilters.size(),
-          sender.getGatewayTransportFilters().size());
-      List<GatewayTransportFilter> actualGatewayTransportFilters =
-          sender.getGatewayTransportFilters();
-      List<String> actualTransportFilterClassNames =
-          new ArrayList<String>(actualGatewayTransportFilters.size());
-      for (GatewayTransportFilter filter : actualGatewayTransportFilters) {
-        actualTransportFilterClassNames.add(filter.getClass().getName());
-      }
-
-      for (String expectedGatewayTransportFilter : expectedGatewayTransportFilters) {
-        if (!actualTransportFilterClassNames.contains(expectedGatewayTransportFilter)) {
-          fail("GatewayTransportFilter " + expectedGatewayTransportFilter
-              + " is not added to the GatewaySender.");
-        }
-      }
-    }
-  }
-
-  public void verifyReceiverState(boolean isRunning) {
-    Set<GatewayReceiver> receivers = cache.getGatewayReceivers();
-    for (GatewayReceiver receiver : receivers) {
-      assertEquals(isRunning, receiver.isRunning());
-    }
-  }
-
-  protected void verifyGatewayReceiverServerLocations(int locatorPort, String expected) {
-    PoolFactory pf = PoolManager.createFactory();
-    pf.setServerGroup(GatewayReceiver.RECEIVER_GROUP);
-    pf.addLocator("localhost", locatorPort);
-    PoolImpl pool = (PoolImpl) pf.create("gateway-receiver-pool");
-    ConnectionSource connectionSource = pool.getConnectionSource();
-    List<ServerLocation> serverLocations = connectionSource.getAllServers();
-    for (ServerLocation serverLocation : serverLocations) {
-      assertEquals(expected, serverLocation.getHostName());
-    }
-  }
-
-  protected void verifyGatewayReceiverProfile(String expected) {
-    Set<GatewayReceiver> receivers = ((Cache) this.cache).getGatewayReceivers();
-    for (GatewayReceiver receiver : receivers) {
-      CacheServerImpl server = (CacheServerImpl) receiver.getServer();
-      CacheServerAdvisor.CacheServerProfile profile =
-          (CacheServerAdvisor.CacheServerProfile) server.getProfile();
-      assertEquals(expected, profile.getHost());
-    }
-  }
-
-  public void verifyReceiverCreationWithAttributes(boolean isRunning, int startPort, int endPort,
-      String bindAddress, int maxTimeBetweenPings, int socketBufferSize,
-      List<String> expectedGatewayTransportFilters, String hostnameForSenders) {
-
-    Set<GatewayReceiver> receivers = cache.getGatewayReceivers();
-    assertEquals("Number of receivers is incorrect", 1, receivers.size());
-    for (GatewayReceiver receiver : receivers) {
-      assertEquals("isRunning", isRunning, receiver.isRunning());
-      assertEquals("startPort", startPort, receiver.getStartPort());
-      assertEquals("endPort", endPort, receiver.getEndPort());
-      assertEquals("bindAddress", bindAddress, receiver.getBindAddress());
-      assertEquals("maximumTimeBetweenPings", maxTimeBetweenPings,
-          receiver.getMaximumTimeBetweenPings());
-      assertEquals("socketBufferSize", socketBufferSize, receiver.getSocketBufferSize());
-      assertEquals("hostnameForSenders", hostnameForSenders, receiver.getHostnameForSenders());
-
-      // verify GatewayTransportFilters
-      if (expectedGatewayTransportFilters != null) {
-        assertEquals("gatewayTransportFilters", expectedGatewayTransportFilters.size(),
-            receiver.getGatewayTransportFilters().size());
-        List<GatewayTransportFilter> actualGatewayTransportFilters =
-            receiver.getGatewayTransportFilters();
-        List<String> actualTransportFilterClassNames =
-            new ArrayList<String>(actualGatewayTransportFilters.size());
-        for (GatewayTransportFilter filter : actualGatewayTransportFilters) {
-          actualTransportFilterClassNames.add(filter.getClass().getName());
-        }
-
-        for (String expectedGatewayTransportFilter : expectedGatewayTransportFilters) {
-          if (!actualTransportFilterClassNames.contains(expectedGatewayTransportFilter)) {
-            fail("GatewayTransportFilter " + expectedGatewayTransportFilter
-                + " is not added to the GatewayReceiver.");
-          }
-        }
-      }
-    }
-  }
-
-  public static void verifySenderDestroyed(String senderId, boolean isParallel) {
-    Set<GatewaySender> senders = cache.getGatewaySenders();
-    AbstractGatewaySender sender = (AbstractGatewaySender) senders.stream()
-        .filter(s -> s.getId().equalsIgnoreCase(senderId)).findFirst().orElse(null);
-    assertNull(sender);
-    String queueRegionNameSuffix = null;
-    if (isParallel) {
-      queueRegionNameSuffix = ParallelGatewaySenderQueue.QSTRING;
-    } else {
-      queueRegionNameSuffix = "_SERIAL_GATEWAY_SENDER_QUEUE";
-    }
-    Set<LocalRegion> allRegions = ((GemFireCacheImpl) cache).getAllRegions();
-    for (LocalRegion region : allRegions) {
-      if (region.getName().contains(senderId + queueRegionNameSuffix)) {
-        fail("Region underlying the sender is not destroyed.");
-      }
-    }
-  }
-
-  public void propsSetUp(Integer lnPort) {
-    Properties props = getDistributedSystemProperties();
-    props.setProperty(MCAST_PORT, "0");
-    props.setProperty(LOCATORS, "localhost[" + lnPort + "]");
-    setUpJmxManagerOnVm0ThenConnect(props);
-  }
-
-  @Override
-  public final void postTearDownCacheTestCase() throws Exception {
-    closeCacheAndDisconnect();
-    vm0.invoke(WANCommandTestBase::closeCacheAndDisconnect);
-    vm1.invoke(WANCommandTestBase::closeCacheAndDisconnect);
-    vm2.invoke(WANCommandTestBase::closeCacheAndDisconnect);
-    vm3.invoke(WANCommandTestBase::closeCacheAndDisconnect);
-    vm4.invoke(WANCommandTestBase::closeCacheAndDisconnect);
-    vm5.invoke(WANCommandTestBase::closeCacheAndDisconnect);
-    vm6.invoke(WANCommandTestBase::closeCacheAndDisconnect);
-    vm7.invoke(WANCommandTestBase::closeCacheAndDisconnect);
-  }
-
-  public static void closeCacheAndDisconnect() {
-    if (cache != null && !cache.isClosed()) {
-      cache.close();
-      cache.getDistributedSystem().disconnect();
-    }
-  }
-}
diff --git a/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/wancommand/WANCommandUtils.java b/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/wancommand/WANCommandUtils.java
new file mode 100644
index 0000000..a69c123
--- /dev/null
+++ b/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/wancommand/WANCommandUtils.java
@@ -0,0 +1,344 @@
+/*
+ * 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.cache.wan.wancommand;
+
+import static org.apache.geode.test.dunit.Assert.assertEquals;
+import static org.apache.geode.test.dunit.Assert.fail;
+import static org.junit.Assert.assertNull;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Set;
+
+import org.apache.geode.cache.Cache;
+import org.apache.geode.cache.DiskStore;
+import org.apache.geode.cache.DiskStoreFactory;
+import org.apache.geode.cache.client.PoolFactory;
+import org.apache.geode.cache.client.PoolManager;
+import org.apache.geode.cache.client.internal.ConnectionSource;
+import org.apache.geode.cache.client.internal.PoolImpl;
+import org.apache.geode.cache.wan.GatewayEventFilter;
+import org.apache.geode.cache.wan.GatewayReceiver;
+import org.apache.geode.cache.wan.GatewayReceiverFactory;
+import org.apache.geode.cache.wan.GatewaySenderFactory;
+import org.apache.geode.cache.wan.GatewayTransportFilter;
+import org.apache.geode.distributed.DistributedMember;
+import org.apache.geode.distributed.internal.ServerLocation;
+import org.apache.geode.internal.AvailablePort;
+import org.apache.geode.internal.cache.CacheServerAdvisor;
+import org.apache.geode.internal.cache.CacheServerImpl;
+import org.apache.geode.internal.cache.GemFireCacheImpl;
+import org.apache.geode.internal.cache.LocalRegion;
+import org.apache.geode.internal.cache.wan.AbstractGatewaySender;
+import org.apache.geode.internal.cache.wan.parallel.ParallelGatewaySenderQueue;
+import org.apache.geode.test.dunit.SerializableCallableIF;
+import org.apache.geode.test.dunit.VM;
+import org.apache.geode.test.dunit.rules.LocatorServerStartupRule;
+
+import org.apache.geode.cache.wan.GatewaySender;
+import org.apache.geode.test.dunit.IgnoredException;
+
+public class WANCommandUtils implements Serializable {
+
+  public static void createSender(String dsName, int remoteDsId, boolean isParallel,
+      Integer maxMemory, Integer batchSize, boolean isConflation, boolean isPersistent,
+      GatewayEventFilter filter, boolean isManualStart) {
+    File persistentDirectory =
+        new File(dsName + "_disk_" + System.currentTimeMillis() + "_" + VM.getCurrentVMNum());
+    persistentDirectory.mkdir();
+    Cache cache = LocatorServerStartupRule.serverStarter.getCache();
+    DiskStoreFactory dsf = cache.createDiskStoreFactory();
+    File[] dirs1 = new File[] {persistentDirectory};
+    if (isParallel) {
+      GatewaySenderFactory gateway = cache.createGatewaySenderFactory();
+      gateway.setParallel(true);
+      gateway.setMaximumQueueMemory(maxMemory);
+      gateway.setBatchSize(batchSize);
+      gateway.setManualStart(isManualStart);
+      if (filter != null) {
+        gateway.addGatewayEventFilter(filter);
+      }
+      if (isPersistent) {
+        gateway.setPersistenceEnabled(true);
+        gateway.setDiskStoreName(dsf.setDiskDirs(dirs1).create(dsName).getName());
+      } else {
+        DiskStore store = dsf.setDiskDirs(dirs1).create(dsName);
+        gateway.setDiskStoreName(store.getName());
+      }
+      gateway.setBatchConflationEnabled(isConflation);
+      gateway.create(dsName, remoteDsId);
+
+    } else {
+      GatewaySenderFactory gateway = cache.createGatewaySenderFactory();
+      gateway.setMaximumQueueMemory(maxMemory);
+      gateway.setBatchSize(batchSize);
+      gateway.setManualStart(isManualStart);
+      if (filter != null) {
+        gateway.addGatewayEventFilter(filter);
+      }
+      gateway.setBatchConflationEnabled(isConflation);
+      if (isPersistent) {
+        gateway.setPersistenceEnabled(true);
+        gateway.setDiskStoreName(dsf.setDiskDirs(dirs1).create(dsName).getName());
+      } else {
+        DiskStore store = dsf.setDiskDirs(dirs1).create(dsName);
+        gateway.setDiskStoreName(store.getName());
+      }
+      gateway.create(dsName, remoteDsId);
+    }
+  }
+
+  public static void startSender(String senderId) {
+    final IgnoredException exln = IgnoredException.addIgnoredException("Could not connect");
+    try {
+      Cache cache = LocatorServerStartupRule.serverStarter.getCache();
+      Set<GatewaySender> senders = cache.getGatewaySenders();
+      AbstractGatewaySender sender = (AbstractGatewaySender) senders.stream()
+          .filter(s -> s.getId().equalsIgnoreCase(senderId)).findFirst().orElse(null);
+      sender.start();
+    } finally {
+      exln.remove();
+    }
+  }
+
+  public static void pauseSender(String senderId) {
+    final IgnoredException exln = IgnoredException.addIgnoredException("Could not connect");
+    try {
+      Cache cache = LocatorServerStartupRule.serverStarter.getCache();
+      Set<GatewaySender> senders = cache.getGatewaySenders();
+      AbstractGatewaySender sender = (AbstractGatewaySender) senders.stream()
+          .filter(s -> s.getId().equalsIgnoreCase(senderId)).findFirst().orElse(null);
+      sender.pause();
+    } finally {
+      exln.remove();
+    }
+  }
+
+  public static void verifySenderState(String senderId, boolean isRunning, boolean isPaused) {
+    final IgnoredException exln = IgnoredException.addIgnoredException("Could not connect");
+    try {
+      Set<GatewaySender> senders =
+          LocatorServerStartupRule.serverStarter.getCache().getGatewaySenders();
+      for (GatewaySender sender : senders) {
+        assertEquals(isRunning, sender.isRunning());
+        assertEquals(isPaused, sender.isPaused());
+      }
+    } finally {
+      exln.remove();
+    }
+  }
+
+  public static void verifySenderAttributes(String senderId, int remoteDsID, boolean isParallel,
+      boolean manualStart, int socketBufferSize, int socketReadTimeout,
+      boolean enableBatchConflation, int batchSize, int batchTimeInterval,
+      boolean enablePersistence, boolean diskSynchronous, int maxQueueMemory, int alertThreshold,
+      int dispatcherThreads, GatewaySender.OrderPolicy orderPolicy,
+      List<String> expectedGatewayEventFilters, List<String> expectedGatewayTransportFilters) {
+
+    Set<GatewaySender> senders =
+        LocatorServerStartupRule.serverStarter.getCache().getGatewaySenders();
+    for (GatewaySender sender : senders) {
+      assertEquals("remoteDistributedSystemId", remoteDsID, sender.getRemoteDSId());
+      assertEquals("isParallel", isParallel, sender.isParallel());
+      assertEquals("manualStart", manualStart, sender.isManualStart());
+      assertEquals("socketBufferSize", socketBufferSize, sender.getSocketBufferSize());
+      assertEquals("socketReadTimeout", socketReadTimeout, sender.getSocketReadTimeout());
+      assertEquals("enableBatchConflation", enableBatchConflation,
+          sender.isBatchConflationEnabled());
+      assertEquals("batchSize", batchSize, sender.getBatchSize());
+      assertEquals("batchTimeInterval", batchTimeInterval, sender.getBatchTimeInterval());
+      assertEquals("enablePersistence", enablePersistence, sender.isPersistenceEnabled());
+      assertEquals("diskSynchronous", diskSynchronous, sender.isDiskSynchronous());
+      assertEquals("maxQueueMemory", maxQueueMemory, sender.getMaximumQueueMemory());
+      assertEquals("alertThreshold", alertThreshold, sender.getAlertThreshold());
+      assertEquals("dispatcherThreads", dispatcherThreads, sender.getDispatcherThreads());
+      assertEquals("orderPolicy", orderPolicy, sender.getOrderPolicy());
+
+      // verify GatewayEventFilters
+      if (expectedGatewayEventFilters != null) {
+        assertEquals("gatewayEventFilters", expectedGatewayEventFilters.size(),
+            sender.getGatewayEventFilters().size());
+
+        List<GatewayEventFilter> actualGatewayEventFilters = sender.getGatewayEventFilters();
+        List<String> actualEventFilterClassNames =
+            new ArrayList<String>(actualGatewayEventFilters.size());
+        for (GatewayEventFilter filter : actualGatewayEventFilters) {
+          actualEventFilterClassNames.add(filter.getClass().getName());
+        }
+
+        for (String expectedGatewayEventFilter : expectedGatewayEventFilters) {
+          if (!actualEventFilterClassNames.contains(expectedGatewayEventFilter)) {
+            fail("GatewayEventFilter " + expectedGatewayEventFilter
+                + " is not added to the GatewaySender");
+          }
+        }
+      }
+
+      // verify GatewayTransportFilters
+      if (expectedGatewayTransportFilters != null) {
+        assertEquals("gatewayTransportFilters", expectedGatewayTransportFilters.size(),
+            sender.getGatewayTransportFilters().size());
+        List<GatewayTransportFilter> actualGatewayTransportFilters =
+            sender.getGatewayTransportFilters();
+        List<String> actualTransportFilterClassNames =
+            new ArrayList<String>(actualGatewayTransportFilters.size());
+        for (GatewayTransportFilter filter : actualGatewayTransportFilters) {
+          actualTransportFilterClassNames.add(filter.getClass().getName());
+        }
+
+        for (String expectedGatewayTransportFilter : expectedGatewayTransportFilters) {
+          if (!actualTransportFilterClassNames.contains(expectedGatewayTransportFilter)) {
+            fail("GatewayTransportFilter " + expectedGatewayTransportFilter
+                + " is not added to the GatewaySender.");
+          }
+        }
+      }
+    }
+  }
+
+  public static void verifySenderDestroyed(String senderId, boolean isParallel) {
+    Cache cache = LocatorServerStartupRule.serverStarter.getCache();
+    Set<GatewaySender> senders = cache.getGatewaySenders();
+    AbstractGatewaySender sender = (AbstractGatewaySender) senders.stream()
+        .filter(s -> s.getId().equalsIgnoreCase(senderId)).findFirst().orElse(null);
+    assertNull(sender);
+    String queueRegionNameSuffix = null;
+    if (isParallel) {
+      queueRegionNameSuffix = ParallelGatewaySenderQueue.QSTRING;
+    } else {
+      queueRegionNameSuffix = "_SERIAL_GATEWAY_SENDER_QUEUE";
+    }
+    Set<LocalRegion> allRegions = ((GemFireCacheImpl) cache).getAllRegions();
+    for (LocalRegion region : allRegions) {
+      if (region.getName().contains(senderId + queueRegionNameSuffix)) {
+        fail("Region underlying the sender is not destroyed.");
+      }
+    }
+  }
+
+  public static void startReceiver() {
+    try {
+      Cache cache = LocatorServerStartupRule.serverStarter.getCache();
+      Set<GatewayReceiver> receivers = cache.getGatewayReceivers();
+      for (GatewayReceiver receiver : receivers) {
+        receiver.start();
+      }
+    } catch (IOException e) {
+      e.printStackTrace();
+      // fail("Test " + getName() + " failed to start GatewayReceiver");
+      fail("Failed to start GatewayReceiver");
+    }
+  }
+
+  public static void stopReceiver() {
+    Cache cache = LocatorServerStartupRule.serverStarter.getCache();
+    Set<GatewayReceiver> receivers = cache.getGatewayReceivers();
+    for (GatewayReceiver receiver : receivers) {
+      receiver.stop();
+    }
+  }
+
+  public static void createAndStartReceiver(int locPort) {
+    createReceiver(locPort);
+    startReceiver();
+  }
+
+  public static void createReceiver(int locPort) {
+    Cache cache = LocatorServerStartupRule.serverStarter.getCache();
+    GatewayReceiverFactory fact = cache.createGatewayReceiverFactory();
+    fact.setStartPort(AvailablePort.AVAILABLE_PORTS_LOWER_BOUND);
+    fact.setEndPort(AvailablePort.AVAILABLE_PORTS_UPPER_BOUND);
+    fact.setManualStart(true);
+    GatewayReceiver receiver = fact.create();
+  }
+
+  public static void verifyReceiverState(boolean isRunning) {
+    Set<GatewayReceiver> receivers =
+        LocatorServerStartupRule.serverStarter.getCache().getGatewayReceivers();
+    for (GatewayReceiver receiver : receivers) {
+      assertEquals(isRunning, receiver.isRunning());
+    }
+  }
+
+  public static void verifyGatewayReceiverServerLocations(int locatorPort, String expected) {
+    PoolFactory pf = PoolManager.createFactory();
+    pf.setServerGroup(GatewayReceiver.RECEIVER_GROUP);
+    pf.addLocator("localhost", locatorPort);
+    PoolImpl pool = (PoolImpl) pf.create("gateway-receiver-pool");
+    ConnectionSource connectionSource = pool.getConnectionSource();
+    List<ServerLocation> serverLocations = connectionSource.getAllServers();
+    for (ServerLocation serverLocation : serverLocations) {
+      assertEquals(expected, serverLocation.getHostName());
+    }
+  }
+
+  public static void verifyGatewayReceiverProfile(String expected) {
+    Set<GatewayReceiver> receivers =
+        ((Cache) LocatorServerStartupRule.serverStarter.getCache()).getGatewayReceivers();
+    for (GatewayReceiver receiver : receivers) {
+      CacheServerImpl server = (CacheServerImpl) receiver.getServer();
+      CacheServerAdvisor.CacheServerProfile profile =
+          (CacheServerAdvisor.CacheServerProfile) server.getProfile();
+      assertEquals(expected, profile.getHost());
+    }
+  }
+
+  public static void verifyReceiverCreationWithAttributes(boolean isRunning, int startPort,
+      int endPort, String bindAddress, int maxTimeBetweenPings, int socketBufferSize,
+      List<String> expectedGatewayTransportFilters, String hostnameForSenders) {
+
+    Set<GatewayReceiver> receivers =
+        ((Cache) LocatorServerStartupRule.serverStarter.getCache()).getGatewayReceivers();
+    assertEquals("Number of receivers is incorrect", 1, receivers.size());
+    for (GatewayReceiver receiver : receivers) {
+      assertEquals("isRunning", isRunning, receiver.isRunning());
+      assertEquals("startPort", startPort, receiver.getStartPort());
+      assertEquals("endPort", endPort, receiver.getEndPort());
+      assertEquals("bindAddress", bindAddress, receiver.getBindAddress());
+      assertEquals("maximumTimeBetweenPings", maxTimeBetweenPings,
+          receiver.getMaximumTimeBetweenPings());
+      assertEquals("socketBufferSize", socketBufferSize, receiver.getSocketBufferSize());
+      assertEquals("hostnameForSenders", hostnameForSenders, receiver.getHostnameForSenders());
+
+      // verify GatewayTransportFilters
+      if (expectedGatewayTransportFilters != null) {
+        assertEquals("gatewayTransportFilters", expectedGatewayTransportFilters.size(),
+            receiver.getGatewayTransportFilters().size());
+        List<GatewayTransportFilter> actualGatewayTransportFilters =
+            receiver.getGatewayTransportFilters();
+        List<String> actualTransportFilterClassNames =
+            new ArrayList<String>(actualGatewayTransportFilters.size());
+        for (GatewayTransportFilter filter : actualGatewayTransportFilters) {
+          actualTransportFilterClassNames.add(filter.getClass().getName());
+        }
+
+        for (String expectedGatewayTransportFilter : expectedGatewayTransportFilters) {
+          if (!actualTransportFilterClassNames.contains(expectedGatewayTransportFilter)) {
+            fail("GatewayTransportFilter " + expectedGatewayTransportFilter
+                + " is not added to the GatewayReceiver.");
+          }
+        }
+      }
+    }
+  }
+
+  public static SerializableCallableIF<DistributedMember> getMemberIdCallable() {
+    return () -> LocatorServerStartupRule.serverStarter.getCache().getDistributedSystem()
+        .getDistributedMember();
+  }
+}
diff --git a/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/wancommand/WanCommandListDUnitTest.java b/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/wancommand/WanCommandListDUnitTest.java
index 3f4f5ed..144a88d 100644
--- a/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/wancommand/WanCommandListDUnitTest.java
+++ b/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/wancommand/WanCommandListDUnitTest.java
@@ -15,8 +15,10 @@
 package org.apache.geode.internal.cache.wan.wancommand;
 
 import static org.apache.geode.distributed.ConfigurationProperties.DISTRIBUTED_SYSTEM_ID;
-import static org.apache.geode.distributed.ConfigurationProperties.LOCATORS;
-import static org.apache.geode.distributed.ConfigurationProperties.MCAST_PORT;
+import static org.apache.geode.distributed.ConfigurationProperties.GROUPS;
+import static org.apache.geode.distributed.ConfigurationProperties.REMOTE_LOCATORS;
+import static org.apache.geode.internal.cache.wan.wancommand.WANCommandUtils.createAndStartReceiver;
+import static org.apache.geode.internal.cache.wan.wancommand.WANCommandUtils.createSender;
 import static org.apache.geode.test.dunit.Assert.assertEquals;
 import static org.apache.geode.test.dunit.Assert.assertTrue;
 import static org.apache.geode.test.dunit.Assert.fail;
@@ -26,44 +28,69 @@ import static org.apache.geode.test.dunit.Wait.pause;
 import java.util.List;
 import java.util.Properties;
 
+import org.apache.geode.test.dunit.rules.LocatorServerStartupRule;
+import org.apache.geode.test.dunit.rules.MemberVM;
+import org.apache.geode.test.junit.rules.GfshShellConnectionRule;
+import org.junit.Before;
+import org.junit.Rule;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
 import org.apache.geode.management.cli.Result;
 import org.apache.geode.management.internal.cli.i18n.CliStrings;
-import org.apache.geode.management.internal.cli.json.GfJsonException;
 import org.apache.geode.management.internal.cli.result.CommandResult;
 import org.apache.geode.management.internal.cli.result.CompositeResultData;
 import org.apache.geode.management.internal.cli.result.TabularResultData;
 import org.apache.geode.test.junit.categories.DistributedTest;
 
 @Category(DistributedTest.class)
-public class WanCommandListDUnitTest extends WANCommandTestBase {
+public class WanCommandListDUnitTest {
 
   private static final long serialVersionUID = 1L;
 
-  @Test
-  public void testListGatewayWithNoSenderReceiver() {
+  @Rule
+  public LocatorServerStartupRule locatorServerStartupRule = new LocatorServerStartupRule();
+
+  @Rule
+  public GfshShellConnectionRule gfsh = new GfshShellConnectionRule();
+
+  private MemberVM locatorSite1;
+  private MemberVM locatorSite2;
+  private MemberVM server1;
+  private MemberVM server2;
+  private MemberVM server3;
+  private MemberVM server4;
+  private MemberVM server5;
+
+  @Before
+  public void before() throws Exception {
+    Properties props = new Properties();
 
-    Integer dsIdPort = vm1.invoke(() -> createFirstLocatorWithDSId(1));
+    props.setProperty(DISTRIBUTED_SYSTEM_ID, "" + 1);
+    locatorSite1 = locatorServerStartupRule.startLocatorVM(1, props);
 
-    Properties props = getDistributedSystemProperties();
-    props.setProperty(MCAST_PORT, "0");
-    props.setProperty(DISTRIBUTED_SYSTEM_ID, "1");
-    props.setProperty(LOCATORS, "localhost[" + dsIdPort + "]");
-    setUpJmxManagerOnVm0ThenConnect(props);
+    props.setProperty(DISTRIBUTED_SYSTEM_ID, "" + 2);
+    props.setProperty(REMOTE_LOCATORS, "localhost[" + locatorSite1.getPort() + "]");
+    locatorSite2 = locatorServerStartupRule.startLocatorVM(2, props);
 
-    Integer nyPort = vm2.invoke(() -> createFirstRemoteLocator(2, dsIdPort));
+    gfsh.connectAndVerify(locatorSite1);
+
+  }
+
+  @Test
+  public void testListGatewayWithNoSenderReceiver() throws Exception {
+    Integer lnPort = locatorSite1.getPort();
 
-    vm3.invoke(() -> createCache(dsIdPort));
-    vm4.invoke(() -> createCache(dsIdPort));
-    vm5.invoke(() -> createCache(dsIdPort));
+    // setup servers in Site #1 (London)
+    server1 = locatorServerStartupRule.startServerVM(3, lnPort);
+    server2 = locatorServerStartupRule.startServerVM(4, lnPort);
+    server3 = locatorServerStartupRule.startServerVM(5, lnPort);
 
     pause(10000);
     String command = CliStrings.LIST_GATEWAY;
-    CommandResult cmdResult = executeCommand(command);
+    CommandResult cmdResult = gfsh.executeCommand(command);
     if (cmdResult != null) {
-      String strCmdResult = commandResultToString(cmdResult);
+      String strCmdResult = cmdResult.toString();
       getLogWriter().info("testListGatewaySender : : " + strCmdResult);
       assertEquals(Result.Status.ERROR, cmdResult.getStatus());
     } else {
@@ -72,37 +99,37 @@ public class WanCommandListDUnitTest extends WANCommandTestBase {
   }
 
   @Test
-  public void testListGatewaySender() {
+  public void testListGatewaySender() throws Exception {
+    Integer lnPort = locatorSite1.getPort();
+    Integer nyPort = locatorSite2.getPort();
 
-    Integer dsIdPort = vm1.invoke(() -> createFirstLocatorWithDSId(1));
+    // setup servers in Site #1 (London)
+    server1 = locatorServerStartupRule.startServerVM(3, lnPort);
+    server2 = locatorServerStartupRule.startServerVM(4, lnPort);
+    server3 = locatorServerStartupRule.startServerVM(5, lnPort);
 
-    Properties props = getDistributedSystemProperties();
-    props.setProperty(MCAST_PORT, "0");
-    props.setProperty(DISTRIBUTED_SYSTEM_ID, "1");
-    props.setProperty(LOCATORS, "localhost[" + dsIdPort + "]");
-    setUpJmxManagerOnVm0ThenConnect(props);
+    // servers in Site 2 (New York)
+    server4 = locatorServerStartupRule.startServerVM(6, nyPort);
+    server5 = locatorServerStartupRule.startServerVM(7, nyPort);
 
-    Integer nyPort = vm2.invoke(() -> createFirstRemoteLocator(2, dsIdPort));
+    // Site 2 Receivers
+    server4.invoke(() -> createAndStartReceiver(nyPort));
+    server5.invoke(() -> createAndStartReceiver(nyPort));
 
-    vm6.invoke(() -> createAndStartReceiver(nyPort));
-    vm7.invoke(() -> createAndStartReceiver(nyPort));
+    // Site 1 Senders
+    server1.invoke(() -> createSender("ln_Serial", 2, false, 100, 400, false, false, null, false));
+    server1.invoke(() -> createSender("ln_Parallel", 2, true, 100, 400, false, false, null, false));
 
-    vm3.invoke(() -> createCache(dsIdPort));
-    vm3.invoke(() -> createSender("ln_Serial", 2, false, 100, 400, false, false, null, false));
-    vm3.invoke(() -> createSender("ln_Parallel", 2, true, 100, 400, false, false, null, false));
+    server2.invoke(() -> createSender("ln_Parallel", 2, true, 100, 400, false, false, null, false));
+    server2.invoke(() -> createSender("ln_Serial", 2, false, 100, 400, false, false, null, false));
 
-    vm4.invoke(() -> createCache(dsIdPort));
-    vm4.invoke(() -> createSender("ln_Parallel", 2, true, 100, 400, false, false, null, false));
-    vm4.invoke(() -> createSender("ln_Serial", 2, false, 100, 400, false, false, null, false));
-
-    vm5.invoke(() -> createCache(dsIdPort));
-    vm5.invoke(() -> createSender("ln_Serial", 2, false, 100, 400, false, false, null, false));
+    server3.invoke(() -> createSender("ln_Serial", 2, false, 100, 400, false, false, null, false));
 
     pause(10000);
     String command = CliStrings.LIST_GATEWAY;
-    CommandResult cmdResult = executeCommand(command);
+    CommandResult cmdResult = gfsh.executeCommand(command);
     if (cmdResult != null) {
-      String strCmdResult = commandResultToString(cmdResult);
+      String strCmdResult = cmdResult.toString();
       getLogWriter().info("testListGatewaySender" + strCmdResult);
       assertEquals(Result.Status.OK, cmdResult.getStatus());
 
@@ -123,32 +150,30 @@ public class WanCommandListDUnitTest extends WANCommandTestBase {
   }
 
   @Test
-  public void testListGatewayReceiver() {
-
-    Integer lnPort = vm1.invoke(() -> createFirstLocatorWithDSId(1));
+  public void testListGatewayReceiver() throws Exception {
+    Integer lnPort = locatorSite1.getPort();
+    Integer nyPort = locatorSite2.getPort();
 
-    Properties props = getDistributedSystemProperties();
-    props.setProperty(MCAST_PORT, "0");
-    props.setProperty(DISTRIBUTED_SYSTEM_ID, "1");
-    props.setProperty(LOCATORS, "localhost[" + lnPort + "]");
-    setUpJmxManagerOnVm0ThenConnect(props);
+    // setup servers in Site #1 (London)
+    server1 = locatorServerStartupRule.startServerVM(3, lnPort);
+    server2 = locatorServerStartupRule.startServerVM(4, lnPort);
 
-    Integer nyPort = vm2.invoke(() -> createFirstRemoteLocator(2, lnPort));
+    // servers in Site 2 (New York)
+    server3 = locatorServerStartupRule.startServerVM(5, nyPort);
+    server4 = locatorServerStartupRule.startServerVM(6, nyPort);
 
-    vm3.invoke(() -> createAndStartReceiver(lnPort));
-    vm4.invoke(() -> createAndStartReceiver(lnPort));
+    server1.invoke(() -> createAndStartReceiver(lnPort));
+    server2.invoke(() -> createAndStartReceiver(lnPort));
 
-    vm5.invoke(() -> createCache(nyPort));
-    vm5.invoke(() -> createSender("ln_Serial", 1, false, 100, 400, false, false, null, false));
-    vm6.invoke(() -> createCache(nyPort));
-    vm6.invoke(() -> createSender("ln_Serial", 1, false, 100, 400, false, false, null, false));
-    vm6.invoke(() -> createSender("ln_Parallel", 1, true, 100, 400, false, false, null, false));
+    server3.invoke(() -> createSender("ln_Serial", 1, false, 100, 400, false, false, null, false));
+    server4.invoke(() -> createSender("ln_Serial", 1, false, 100, 400, false, false, null, false));
+    server4.invoke(() -> createSender("ln_Parallel", 1, true, 100, 400, false, false, null, false));
 
     pause(10000);
     String command = CliStrings.LIST_GATEWAY;
-    CommandResult cmdResult = executeCommand(command);
+    CommandResult cmdResult = gfsh.executeCommand(command);
     if (cmdResult != null) {
-      String strCmdResult = commandResultToString(cmdResult);
+      String strCmdResult = cmdResult.toString();
       getLogWriter().info("testListGatewayReceiver" + strCmdResult);
       assertEquals(Result.Status.OK, cmdResult.getStatus());
 
@@ -162,48 +187,44 @@ public class WanCommandListDUnitTest extends WANCommandTestBase {
 
       assertEquals(null, ((CompositeResultData) cmdResult.getResultData())
           .retrieveSection(CliStrings.SECTION_GATEWAY_SENDER));
-
-
     } else {
       fail("testListGatewayReceiver failed as did not get CommandResult");
     }
   }
 
   @Test
-  public void testListGatewaySenderGatewayReceiver() throws GfJsonException {
+  public void testListGatewaySenderGatewayReceiver() throws Exception {
+    Integer lnPort = locatorSite1.getPort();
+    Integer nyPort = locatorSite2.getPort();
 
-    Integer lnPort = vm1.invoke(() -> createFirstLocatorWithDSId(1));
+    // setup servers in Site #1 (London)
+    server1 = locatorServerStartupRule.startServerVM(3, lnPort);
+    server2 = locatorServerStartupRule.startServerVM(4, lnPort);
+    server3 = locatorServerStartupRule.startServerVM(5, lnPort);
 
-    Properties props = getDistributedSystemProperties();
-    props.setProperty(MCAST_PORT, "0");
-    props.setProperty(DISTRIBUTED_SYSTEM_ID, "1");
-    props.setProperty(LOCATORS, "localhost[" + lnPort + "]");
-    setUpJmxManagerOnVm0ThenConnect(props);
+    // servers in Site 2 (New York)
+    server4 = locatorServerStartupRule.startServerVM(6, nyPort);
+    server5 = locatorServerStartupRule.startServerVM(7, nyPort);
 
-    Integer nyPort = vm2.invoke(() -> createFirstRemoteLocator(2, lnPort));
+    server4.invoke(() -> createAndStartReceiver(nyPort));
 
-    vm6.invoke(() -> createAndStartReceiver(nyPort));
+    server1.invoke(() -> createSender("ln_Serial", 2, false, 100, 400, false, false, null, false));
+    server1.invoke(() -> createSender("ln_Parallel", 2, true, 100, 400, false, false, null, false));
 
-    vm3.invoke(() -> createCache(lnPort));
-    vm3.invoke(() -> createSender("ln_Serial", 2, false, 100, 400, false, false, null, false));
-    vm3.invoke(() -> createSender("ln_Parallel", 2, true, 100, 400, false, false, null, false));
+    server2.invoke(() -> createSender("ln_Parallel", 2, true, 100, 400, false, false, null, false));
+    server2.invoke(() -> createSender("ln_Serial", 2, false, 100, 400, false, false, null, false));
 
-    vm4.invoke(() -> createCache(lnPort));
-    vm4.invoke(() -> createSender("ln_Parallel", 2, true, 100, 400, false, false, null, false));
-    vm4.invoke(() -> createSender("ln_Serial", 2, false, 100, 400, false, false, null, false));
+    server3.invoke(() -> createAndStartReceiver(lnPort));
 
-    vm5.invoke(() -> createAndStartReceiver(lnPort));
-
-    vm7.invoke(() -> createCache(nyPort));
-    vm7.invoke(() -> createSender("ln_Serial", 1, false, 100, 400, false, false, null, false));
-    vm7.invoke(() -> createSender("ln_Parallel", 1, true, 100, 400, false, false, null, false));
+    server5.invoke(() -> createSender("ln_Serial", 1, false, 100, 400, false, false, null, false));
+    server5.invoke(() -> createSender("ln_Parallel", 1, true, 100, 400, false, false, null, false));
 
     pause(10000);
     String command = CliStrings.LIST_GATEWAY;
-    CommandResult cmdResult = executeCommand(command);
+    CommandResult cmdResult = gfsh.executeCommand(command);
 
     if (cmdResult != null) {
-      String strCmdResult = commandResultToString(cmdResult);
+      String strCmdResult = cmdResult.toString();
       getLogWriter().info("testListGatewaySenderGatewayReceiver : " + strCmdResult);
       assertEquals(Result.Status.OK, cmdResult.getStatus());
 
@@ -230,41 +251,39 @@ public class WanCommandListDUnitTest extends WANCommandTestBase {
   }
 
   @Test
-  public void testListGatewaySenderGatewayReceiver_group() {
-
-    Integer lnPort = vm1.invoke(() -> createFirstLocatorWithDSId(1));
+  public void testListGatewaySenderGatewayReceiver_group() throws Exception {
 
-    Properties props = getDistributedSystemProperties();
-    props.setProperty(MCAST_PORT, "0");
-    props.setProperty(DISTRIBUTED_SYSTEM_ID, "1");
-    props.setProperty(LOCATORS, "localhost[" + lnPort + "]");
-    setUpJmxManagerOnVm0ThenConnect(props);
+    Integer lnPort = locatorSite1.getPort();
+    Integer nyPort = locatorSite2.getPort();
 
-    Integer nyPort = vm2.invoke(() -> createFirstRemoteLocator(2, lnPort));
+    // setup servers in Site #1 (London)
+    server1 = startServerWithGroups(3, "Serial_Sender, Parallel_Sender", lnPort);
+    server2 = startServerWithGroups(4, "Serial_Sender, Parallel_Sender", lnPort);
+    server3 = startServerWithGroups(5, "Parallel_Sender, Receiver_Group", lnPort);
 
-    vm6.invoke(() -> createAndStartReceiver(nyPort));
+    // server in Site 2 (New York)
+    server4 = locatorServerStartupRule.startServerVM(6, nyPort);
+    server5 = locatorServerStartupRule.startServerVM(7, nyPort);
 
-    vm3.invoke(() -> createCacheWithGroups(lnPort, "Serial_Sender, Parallel_Sender"));
-    vm3.invoke(() -> createSender("ln_Serial", 2, false, 100, 400, false, false, null, false));
-    vm3.invoke(() -> createSender("ln_Parallel", 2, true, 100, 400, false, false, null, false));
+    server4.invoke(() -> createAndStartReceiver(nyPort));
 
-    vm4.invoke(() -> createCacheWithGroups(lnPort, "Serial_Sender, Parallel_Sender"));
-    vm4.invoke(() -> createSender("ln_Parallel", 2, true, 100, 400, false, false, null, false));
-    vm4.invoke(() -> createSender("ln_Serial", 2, false, 100, 400, false, false, null, false));
+    server1.invoke(() -> createSender("ln_Serial", 2, false, 100, 400, false, false, null, false));
+    server1.invoke(() -> createSender("ln_Parallel", 2, true, 100, 400, false, false, null, false));
 
-    vm5.invoke(() -> createAndStartReceiverWithGroup(lnPort, "Parallel_Sender,Receiver_Group"));
-    vm5.invoke(() -> createSender("ln_Parallel", 2, true, 100, 400, false, false, null, false));
+    server2.invoke(() -> createSender("ln_Parallel", 2, true, 100, 400, false, false, null, false));
+    server2.invoke(() -> createSender("ln_Serial", 2, false, 100, 400, false, false, null, false));
 
+    server3.invoke(() -> createAndStartReceiver(lnPort));
+    server3.invoke(() -> createSender("ln_Parallel", 2, true, 100, 400, false, false, null, false));
 
-    vm7.invoke(() -> createCache(nyPort));
-    vm7.invoke(() -> createSender("ln_Serial", 1, false, 100, 400, false, false, null, false));
-    vm7.invoke(() -> createSender("ln_Parallel", 1, true, 100, 400, false, false, null, false));
+    server5.invoke(() -> createSender("ln_Serial", 1, false, 100, 400, false, false, null, false));
+    server5.invoke(() -> createSender("ln_Parallel", 1, true, 100, 400, false, false, null, false));
 
     pause(10000);
     String command = CliStrings.LIST_GATEWAY + " --" + CliStrings.GROUP + "=Serial_Sender";
-    CommandResult cmdResult = executeCommand(command);
+    CommandResult cmdResult = gfsh.executeCommand(command);
     if (cmdResult != null) {
-      String strCmdResult = commandResultToString(cmdResult);
+      String strCmdResult = cmdResult.toString();
       getLogWriter().info("testListGatewaySenderGatewayReceiver_group : " + strCmdResult);
       assertEquals(Result.Status.OK, cmdResult.getStatus());
 
@@ -282,7 +301,7 @@ public class WanCommandListDUnitTest extends WANCommandTestBase {
     }
 
     command = CliStrings.LIST_GATEWAY + " --" + CliStrings.GROUP + "=Parallel_Sender";
-    cmdResult = executeCommand(command);
+    cmdResult = gfsh.executeCommand(command);
     if (cmdResult != null) {
       TabularResultData tableSenderResultData = ((CompositeResultData) cmdResult.getResultData())
           .retrieveSection(CliStrings.SECTION_GATEWAY_SENDER)
@@ -297,7 +316,7 @@ public class WanCommandListDUnitTest extends WANCommandTestBase {
       List<String> ports = tableReceiverResultData.retrieveAllValues(CliStrings.RESULT_PORT);
       assertEquals(1, ports.size());
 
-      String strCmdResult = commandResultToString(cmdResult);
+      String strCmdResult = cmdResult.toString();
       getLogWriter().info("testListGatewaySenderGatewayReceiver_group : " + strCmdResult);
       assertEquals(Result.Status.OK, cmdResult.getStatus());
     } else {
@@ -305,9 +324,9 @@ public class WanCommandListDUnitTest extends WANCommandTestBase {
     }
 
     command = CliStrings.LIST_GATEWAY + " --" + CliStrings.GROUP + "=Receiver_Group";
-    cmdResult = executeCommand(command);
+    cmdResult = gfsh.executeCommand(command);
     if (cmdResult != null) {
-      String strCmdResult = commandResultToString(cmdResult);
+      String strCmdResult = cmdResult.toString();
       getLogWriter().info("testListGatewaySenderGatewayReceiver_group : " + strCmdResult);
       assertEquals(Result.Status.OK, cmdResult.getStatus());
 
@@ -329,9 +348,9 @@ public class WanCommandListDUnitTest extends WANCommandTestBase {
     }
 
     command = CliStrings.LIST_GATEWAY + " --" + CliStrings.GROUP + "=Serial_Sender,Parallel_Sender";
-    cmdResult = executeCommand(command);
+    cmdResult = gfsh.executeCommand(command);
     if (cmdResult != null) {
-      String strCmdResult = commandResultToString(cmdResult);
+      String strCmdResult = cmdResult.toString();
       getLogWriter().info("testListGatewaySenderGatewayReceiver_group : " + strCmdResult);
       assertEquals(Result.Status.OK, cmdResult.getStatus());
 
@@ -353,9 +372,9 @@ public class WanCommandListDUnitTest extends WANCommandTestBase {
 
     command = CliStrings.LIST_GATEWAY + " --" + CliStrings.GROUP
         + "=Serial_Sender,Parallel_Sender,Receiver_Group";
-    cmdResult = executeCommand(command);
+    cmdResult = gfsh.executeCommand(command);
     if (cmdResult != null) {
-      String strCmdResult = commandResultToString(cmdResult);
+      String strCmdResult = cmdResult.toString();
       getLogWriter().info("testListGatewaySenderGatewayReceiver_group : " + strCmdResult);
       assertEquals(Result.Status.OK, cmdResult.getStatus());
 
@@ -375,6 +394,11 @@ public class WanCommandListDUnitTest extends WANCommandTestBase {
     } else {
       fail("testListGatewaySenderGatewayReceiver_group failed as did not get CommandResult");
     }
+  }
 
+  private MemberVM startServerWithGroups(int index, String groups, int locPort) throws Exception {
+    Properties props = new Properties();
+    props.setProperty(GROUPS, groups);
+    return locatorServerStartupRule.startServerVM(index, props, locPort);
   }
 }

-- 
To stop receiving notification emails like this one, please contact
['"commits@geode.apache.org" <commits@geode.apache.org>'].

Mime
View raw message