geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From upthewatersp...@apache.org
Subject [03/63] [abbrv] incubator-geode git commit: Automatically converting calls of vm.invoke to lambdas
Date Fri, 19 Feb 2016 18:36:40 GMT
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/69024aa9/gemfire-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/wancommand/WanCommandCreateGatewaySenderDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/wancommand/WanCommandCreateGatewaySenderDUnitTest.java b/gemfire-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/wancommand/WanCommandCreateGatewaySenderDUnitTest.java
index 9ebf4e4..2106257 100644
--- a/gemfire-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/wancommand/WanCommandCreateGatewaySenderDUnitTest.java
+++ b/gemfire-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/wancommand/WanCommandCreateGatewaySenderDUnitTest.java
@@ -61,8 +61,7 @@ public class WanCommandCreateGatewaySenderDUnitTest extends WANCommandTestBase {
    */
   public void testCreateGatewaySenderWithDefault() {
 
-    Integer punePort = (Integer) vm1.invoke(WANCommandTestBase.class,
-        "createFirstLocatorWithDSId", new Object[] { 1 });
+    Integer punePort = (Integer) vm1.invoke(() -> WANCommandTestBase.createFirstLocatorWithDSId( 1 ));
 
     Properties props = new Properties();
     props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
@@ -70,15 +69,11 @@ public class WanCommandCreateGatewaySenderDUnitTest extends WANCommandTestBase {
     props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + punePort + "]");
     createDefaultSetup(props);
 
-    Integer nyPort = (Integer) vm2.invoke(WANCommandTestBase.class,
-        "createFirstRemoteLocator", new Object[] { 2, punePort });
+    Integer nyPort = (Integer) vm2.invoke(() -> WANCommandTestBase.createFirstRemoteLocator( 2, punePort ));
 
-    vm3.invoke(WANCommandTestBase.class, "createCache",
-        new Object[] { punePort });
-    vm4.invoke(WANCommandTestBase.class, "createCache",
-        new Object[] { punePort });
-    vm5.invoke(WANCommandTestBase.class, "createCache",
-        new Object[] { punePort });
+    vm3.invoke(() -> WANCommandTestBase.createCache( punePort ));
+    vm4.invoke(() -> WANCommandTestBase.createCache( punePort ));
+    vm5.invoke(() -> WANCommandTestBase.createCache( punePort ));
 
     String command = CliStrings.CREATE_GATEWAYSENDER + " --"
         + CliStrings.CREATE_GATEWAYSENDER__ID + "=ln" 
@@ -101,12 +96,12 @@ public class WanCommandCreateGatewaySenderDUnitTest extends WANCommandTestBase {
       fail("testCreateGatewaySender failed as did not get CommandResult");
     }
 
-    vm3.invoke(WANCommandTestBase.class, "verifySenderState", new Object[] {
-        "ln", true, false });
-    vm4.invoke(WANCommandTestBase.class, "verifySenderState", new Object[] {
-        "ln", true, false });
-    vm5.invoke(WANCommandTestBase.class, "verifySenderState", new Object[] {
-        "ln", true, false });
+    vm3.invoke(() -> WANCommandTestBase.verifySenderState(
+        "ln", true, false ));
+    vm4.invoke(() -> WANCommandTestBase.verifySenderState(
+        "ln", true, false ));
+    vm5.invoke(() -> WANCommandTestBase.verifySenderState(
+        "ln", true, false ));
   }
   
   /**
@@ -114,8 +109,7 @@ public class WanCommandCreateGatewaySenderDUnitTest extends WANCommandTestBase {
    */
   public void testCreateGatewaySender() {
 
-    Integer punePort = (Integer) vm1.invoke(WANCommandTestBase.class,
-        "createFirstLocatorWithDSId", new Object[] { 1 });
+    Integer punePort = (Integer) vm1.invoke(() -> WANCommandTestBase.createFirstLocatorWithDSId( 1 ));
 
     Properties props = new Properties();
     props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
@@ -123,15 +117,11 @@ public class WanCommandCreateGatewaySenderDUnitTest extends WANCommandTestBase {
     props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + punePort + "]");
     createDefaultSetup(props);
 
-    Integer nyPort = (Integer) vm2.invoke(WANCommandTestBase.class,
-        "createFirstRemoteLocator", new Object[] { 2, punePort });
+    Integer nyPort = (Integer) vm2.invoke(() -> WANCommandTestBase.createFirstRemoteLocator( 2, punePort ));
 
-    vm3.invoke(WANCommandTestBase.class, "createCache",
-        new Object[] { punePort });
-    vm4.invoke(WANCommandTestBase.class, "createCache",
-        new Object[] { punePort });
-    vm5.invoke(WANCommandTestBase.class, "createCache",
-        new Object[] { punePort });
+    vm3.invoke(() -> WANCommandTestBase.createCache( punePort ));
+    vm4.invoke(() -> WANCommandTestBase.createCache( punePort ));
+    vm5.invoke(() -> WANCommandTestBase.createCache( punePort ));
 
     int socketReadTimeout = GatewaySender.MINIMUM_SOCKET_READ_TIMEOUT+1000;
     String command = CliStrings.CREATE_GATEWAYSENDER + " --"
@@ -168,22 +158,19 @@ public class WanCommandCreateGatewaySenderDUnitTest extends WANCommandTestBase {
       fail("testCreateGatewaySender failed as did not get CommandResult");
     }
 
-    vm3.invoke(WANCommandTestBase.class, "verifySenderState", new Object[] {
-        "ln", false, false });
-    vm4.invoke(WANCommandTestBase.class, "verifySenderState", new Object[] {
-        "ln", false, false });
-    vm5.invoke(WANCommandTestBase.class, "verifySenderState", new Object[] {
-        "ln", false, false });
+    vm3.invoke(() -> WANCommandTestBase.verifySenderState(
+        "ln", false, false ));
+    vm4.invoke(() -> WANCommandTestBase.verifySenderState(
+        "ln", false, false ));
+    vm5.invoke(() -> WANCommandTestBase.verifySenderState(
+        "ln", false, false ));
     
-    vm3.invoke(WANCommandTestBase.class, "verifySenderAttributes",
-        new Object[] { "ln", 2, false, true, 1000, socketReadTimeout, true, 1000, 5000,
-            true, false, 1000, 100, 2, OrderPolicy.THREAD, null, null });
-    vm4.invoke(WANCommandTestBase.class, "verifySenderAttributes",
-        new Object[] { "ln", 2, false, true, 1000, socketReadTimeout, true, 1000, 5000,
-            true, false, 1000, 100, 2, OrderPolicy.THREAD, null, null });
-    vm5.invoke(WANCommandTestBase.class, "verifySenderAttributes",
-        new Object[] { "ln", 2, false, true, 1000, socketReadTimeout, true, 1000, 5000,
-            true, false, 1000, 100, 2, OrderPolicy.THREAD, null, null });
+    vm3.invoke(() -> WANCommandTestBase.verifySenderAttributes( "ln", 2, false, true, 1000, socketReadTimeout, true, 1000, 5000,
+            true, false, 1000, 100, 2, OrderPolicy.THREAD, null, null ));
+    vm4.invoke(() -> WANCommandTestBase.verifySenderAttributes( "ln", 2, false, true, 1000, socketReadTimeout, true, 1000, 5000,
+            true, false, 1000, 100, 2, OrderPolicy.THREAD, null, null ));
+    vm5.invoke(() -> WANCommandTestBase.verifySenderAttributes( "ln", 2, false, true, 1000, socketReadTimeout, true, 1000, 5000,
+            true, false, 1000, 100, 2, OrderPolicy.THREAD, null, null ));
   }
 
   /**
@@ -193,8 +180,7 @@ public class WanCommandCreateGatewaySenderDUnitTest extends WANCommandTestBase {
    */
   public void testCreateGatewaySender_Error() {
 
-    Integer punePort = (Integer) vm1.invoke(WANCommandTestBase.class,
-        "createFirstLocatorWithDSId", new Object[] { 1 });
+    Integer punePort = (Integer) vm1.invoke(() -> WANCommandTestBase.createFirstLocatorWithDSId( 1 ));
 
     Properties props = new Properties();
     props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
@@ -202,15 +188,11 @@ public class WanCommandCreateGatewaySenderDUnitTest extends WANCommandTestBase {
     props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + punePort + "]");
     createDefaultSetup(props);
 
-    Integer nyPort = (Integer) vm2.invoke(WANCommandTestBase.class,
-        "createFirstRemoteLocator", new Object[] { 2, punePort });
+    Integer nyPort = (Integer) vm2.invoke(() -> WANCommandTestBase.createFirstRemoteLocator( 2, punePort ));
 
-    vm3.invoke(WANCommandTestBase.class, "createCache",
-        new Object[] { punePort });
-    vm4.invoke(WANCommandTestBase.class, "createCache",
-        new Object[] { punePort });
-    vm5.invoke(WANCommandTestBase.class, "createCache",
-        new Object[] { punePort });
+    vm3.invoke(() -> WANCommandTestBase.createCache( punePort ));
+    vm4.invoke(() -> WANCommandTestBase.createCache( punePort ));
+    vm5.invoke(() -> WANCommandTestBase.createCache( punePort ));
 
     int socketReadTimeout = GatewaySender.MINIMUM_SOCKET_READ_TIMEOUT+1000;
     String command = CliStrings.CREATE_GATEWAYSENDER + " --"
@@ -254,8 +236,7 @@ public class WanCommandCreateGatewaySenderDUnitTest extends WANCommandTestBase {
    */
   public void testCreateGatewaySenderWithGatewayEventFilters() {
 
-    Integer punePort = (Integer) vm1.invoke(WANCommandTestBase.class,
-        "createFirstLocatorWithDSId", new Object[] { 1 });
+    Integer punePort = (Integer) vm1.invoke(() -> WANCommandTestBase.createFirstLocatorWithDSId( 1 ));
 
     Properties props = new Properties();
     props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
@@ -263,15 +244,11 @@ public class WanCommandCreateGatewaySenderDUnitTest extends WANCommandTestBase {
     props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + punePort + "]");
     createDefaultSetup(props);
 
-    Integer nyPort = (Integer) vm2.invoke(WANCommandTestBase.class,
-        "createFirstRemoteLocator", new Object[] { 2, punePort });
+    Integer nyPort = (Integer) vm2.invoke(() -> WANCommandTestBase.createFirstRemoteLocator( 2, punePort ));
 
-    vm3.invoke(WANCommandTestBase.class, "createCache",
-        new Object[] { punePort });
-    vm4.invoke(WANCommandTestBase.class, "createCache",
-        new Object[] { punePort });
-    vm5.invoke(WANCommandTestBase.class, "createCache",
-        new Object[] { punePort });
+    vm3.invoke(() -> WANCommandTestBase.createCache( punePort ));
+    vm4.invoke(() -> WANCommandTestBase.createCache( punePort ));
+    vm5.invoke(() -> WANCommandTestBase.createCache( punePort ));
 
     int socketReadTimeout = GatewaySender.MINIMUM_SOCKET_READ_TIMEOUT+1000;
     String command = CliStrings.CREATE_GATEWAYSENDER + " --"
@@ -310,25 +287,22 @@ public class WanCommandCreateGatewaySenderDUnitTest extends WANCommandTestBase {
       fail("testCreateGatewaySender failed as did not get CommandResult");
     }
 
-    vm3.invoke(WANCommandTestBase.class, "verifySenderState", new Object[] {
-        "ln", false, false });
-    vm4.invoke(WANCommandTestBase.class, "verifySenderState", new Object[] {
-        "ln", false, false });
-    vm5.invoke(WANCommandTestBase.class, "verifySenderState", new Object[] {
-        "ln", false, false });
+    vm3.invoke(() -> WANCommandTestBase.verifySenderState(
+        "ln", false, false ));
+    vm4.invoke(() -> WANCommandTestBase.verifySenderState(
+        "ln", false, false ));
+    vm5.invoke(() -> WANCommandTestBase.verifySenderState(
+        "ln", false, false ));
     
     List<String> eventFilters = new ArrayList<String>();
     eventFilters.add("com.gemstone.gemfire.cache30.MyGatewayEventFilter1");
     eventFilters.add("com.gemstone.gemfire.cache30.MyGatewayEventFilter2");
-    vm3.invoke(WANCommandTestBase.class, "verifySenderAttributes",
-        new Object[] { "ln", 2, false, true, 1000, socketReadTimeout, true, 1000, 5000,
-            true, false, 1000, 100, 2, OrderPolicy.THREAD, eventFilters, null });
-    vm4.invoke(WANCommandTestBase.class, "verifySenderAttributes",
-        new Object[] { "ln", 2, false, true, 1000, socketReadTimeout, true, 1000, 5000,
-            true, false, 1000, 100, 2, OrderPolicy.THREAD, eventFilters, null });
-    vm5.invoke(WANCommandTestBase.class, "verifySenderAttributes",
-        new Object[] { "ln", 2, false, true, 1000, socketReadTimeout, true, 1000, 5000,
-            true, false, 1000, 100, 2, OrderPolicy.THREAD, eventFilters, null });
+    vm3.invoke(() -> WANCommandTestBase.verifySenderAttributes( "ln", 2, false, true, 1000, socketReadTimeout, true, 1000, 5000,
+            true, false, 1000, 100, 2, OrderPolicy.THREAD, eventFilters, null ));
+    vm4.invoke(() -> WANCommandTestBase.verifySenderAttributes( "ln", 2, false, true, 1000, socketReadTimeout, true, 1000, 5000,
+            true, false, 1000, 100, 2, OrderPolicy.THREAD, eventFilters, null ));
+    vm5.invoke(() -> WANCommandTestBase.verifySenderAttributes( "ln", 2, false, true, 1000, socketReadTimeout, true, 1000, 5000,
+            true, false, 1000, 100, 2, OrderPolicy.THREAD, eventFilters, null ));
   }
 
   /**
@@ -336,8 +310,7 @@ public class WanCommandCreateGatewaySenderDUnitTest extends WANCommandTestBase {
    */
   public void testCreateGatewaySenderWithGatewayTransportFilters() {
 
-    Integer punePort = (Integer) vm1.invoke(WANCommandTestBase.class,
-        "createFirstLocatorWithDSId", new Object[] { 1 });
+    Integer punePort = (Integer) vm1.invoke(() -> WANCommandTestBase.createFirstLocatorWithDSId( 1 ));
 
     Properties props = new Properties();
     props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
@@ -345,15 +318,11 @@ public class WanCommandCreateGatewaySenderDUnitTest extends WANCommandTestBase {
     props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + punePort + "]");
     createDefaultSetup(props);
 
-    Integer nyPort = (Integer) vm2.invoke(WANCommandTestBase.class,
-        "createFirstRemoteLocator", new Object[] { 2, punePort });
+    Integer nyPort = (Integer) vm2.invoke(() -> WANCommandTestBase.createFirstRemoteLocator( 2, punePort ));
 
-    vm3.invoke(WANCommandTestBase.class, "createCache",
-        new Object[] { punePort });
-    vm4.invoke(WANCommandTestBase.class, "createCache",
-        new Object[] { punePort });
-    vm5.invoke(WANCommandTestBase.class, "createCache",
-        new Object[] { punePort });
+    vm3.invoke(() -> WANCommandTestBase.createCache( punePort ));
+    vm4.invoke(() -> WANCommandTestBase.createCache( punePort ));
+    vm5.invoke(() -> WANCommandTestBase.createCache( punePort ));
 
     int socketReadTimeout = GatewaySender.MINIMUM_SOCKET_READ_TIMEOUT+1000;
     String command = CliStrings.CREATE_GATEWAYSENDER + " --"
@@ -391,24 +360,21 @@ public class WanCommandCreateGatewaySenderDUnitTest extends WANCommandTestBase {
       fail("testCreateGatewaySender failed as did not get CommandResult");
     }
 
-    vm3.invoke(WANCommandTestBase.class, "verifySenderState", new Object[] {
-        "ln", false, false });
-    vm4.invoke(WANCommandTestBase.class, "verifySenderState", new Object[] {
-        "ln", false, false });
-    vm5.invoke(WANCommandTestBase.class, "verifySenderState", new Object[] {
-        "ln", false, false });
+    vm3.invoke(() -> WANCommandTestBase.verifySenderState(
+        "ln", false, false ));
+    vm4.invoke(() -> WANCommandTestBase.verifySenderState(
+        "ln", false, false ));
+    vm5.invoke(() -> WANCommandTestBase.verifySenderState(
+        "ln", false, false ));
     
     List<String> transportFilters = new ArrayList<String>();
     transportFilters.add("com.gemstone.gemfire.cache30.MyGatewayTransportFilter1");
-    vm3.invoke(WANCommandTestBase.class, "verifySenderAttributes",
-        new Object[] { "ln", 2, false, true, 1000, socketReadTimeout, true, 1000, 5000,
-            true, false, 1000, 100, 2, OrderPolicy.THREAD, null, transportFilters });
-    vm4.invoke(WANCommandTestBase.class, "verifySenderAttributes",
-        new Object[] { "ln", 2, false, true, 1000, socketReadTimeout, true, 1000, 5000,
-            true, false, 1000, 100, 2, OrderPolicy.THREAD, null, transportFilters });
-    vm5.invoke(WANCommandTestBase.class, "verifySenderAttributes",
-        new Object[] { "ln", 2, false, true, 1000, socketReadTimeout, true, 1000, 5000,
-            true, false, 1000, 100, 2, OrderPolicy.THREAD, null, transportFilters });
+    vm3.invoke(() -> WANCommandTestBase.verifySenderAttributes( "ln", 2, false, true, 1000, socketReadTimeout, true, 1000, 5000,
+            true, false, 1000, 100, 2, OrderPolicy.THREAD, null, transportFilters ));
+    vm4.invoke(() -> WANCommandTestBase.verifySenderAttributes( "ln", 2, false, true, 1000, socketReadTimeout, true, 1000, 5000,
+            true, false, 1000, 100, 2, OrderPolicy.THREAD, null, transportFilters ));
+    vm5.invoke(() -> WANCommandTestBase.verifySenderAttributes( "ln", 2, false, true, 1000, socketReadTimeout, true, 1000, 5000,
+            true, false, 1000, 100, 2, OrderPolicy.THREAD, null, transportFilters ));
   }
 
   /**
@@ -416,8 +382,7 @@ public class WanCommandCreateGatewaySenderDUnitTest extends WANCommandTestBase {
    */
   public void testCreateGatewaySender_OnMember() {
 
-    Integer punePort = (Integer) vm1.invoke(WANCommandTestBase.class,
-        "createFirstLocatorWithDSId", new Object[] { 1 });
+    Integer punePort = (Integer) vm1.invoke(() -> WANCommandTestBase.createFirstLocatorWithDSId( 1 ));
 
     Properties props = new Properties();
     props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
@@ -425,18 +390,13 @@ public class WanCommandCreateGatewaySenderDUnitTest extends WANCommandTestBase {
     props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + punePort + "]");
     createDefaultSetup(props);
 
-    Integer nyPort = (Integer) vm2.invoke(WANCommandTestBase.class,
-        "createFirstRemoteLocator", new Object[] { 2, punePort });
+    Integer nyPort = (Integer) vm2.invoke(() -> WANCommandTestBase.createFirstRemoteLocator( 2, punePort ));
 
-    vm3.invoke(WANCommandTestBase.class, "createCache",
-        new Object[] { punePort });
-    vm4.invoke(WANCommandTestBase.class, "createCache",
-        new Object[] { punePort });
-    vm5.invoke(WANCommandTestBase.class, "createCache",
-        new Object[] { punePort });
+    vm3.invoke(() -> WANCommandTestBase.createCache( punePort ));
+    vm4.invoke(() -> WANCommandTestBase.createCache( punePort ));
+    vm5.invoke(() -> WANCommandTestBase.createCache( punePort ));
     
-    final DistributedMember vm3Member = (DistributedMember) vm3.invoke(
-        WANCommandTestBase.class, "getMember");
+    final DistributedMember vm3Member = (DistributedMember) vm3.invoke(() -> WANCommandTestBase.getMember());
 
     int socketReadTimeout = GatewaySender.MINIMUM_SOCKET_READ_TIMEOUT+1000;
     String command = CliStrings.CREATE_GATEWAYSENDER + " --"
@@ -474,12 +434,11 @@ public class WanCommandCreateGatewaySenderDUnitTest extends WANCommandTestBase {
       fail("testCreateGatewaySender failed as did not get CommandResult");
     }
 
-    vm3.invoke(WANCommandTestBase.class, "verifySenderState", new Object[] {
-        "ln", false, false });
+    vm3.invoke(() -> WANCommandTestBase.verifySenderState(
+        "ln", false, false ));
     
-    vm3.invoke(WANCommandTestBase.class, "verifySenderAttributes",
-        new Object[] { "ln", 2, false, true, 1000, socketReadTimeout, true, 1000, 5000,
-            true, false, 1000, 100, 2, OrderPolicy.THREAD, null, null });
+    vm3.invoke(() -> WANCommandTestBase.verifySenderAttributes( "ln", 2, false, true, 1000, socketReadTimeout, true, 1000, 5000,
+            true, false, 1000, 100, 2, OrderPolicy.THREAD, null, null ));
   }
 
   /**
@@ -487,8 +446,7 @@ public class WanCommandCreateGatewaySenderDUnitTest extends WANCommandTestBase {
    */
   public void testCreateGatewaySender_Group() {
 
-    Integer punePort = (Integer) vm1.invoke(WANCommandTestBase.class,
-        "createFirstLocatorWithDSId", new Object[] { 1 });
+    Integer punePort = (Integer) vm1.invoke(() -> WANCommandTestBase.createFirstLocatorWithDSId( 1 ));
 
     Properties props = new Properties();
     props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
@@ -496,15 +454,11 @@ public class WanCommandCreateGatewaySenderDUnitTest extends WANCommandTestBase {
     props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + punePort + "]");
     createDefaultSetup(props);
 
-    Integer nyPort = (Integer) vm2.invoke(WANCommandTestBase.class,
-        "createFirstRemoteLocator", new Object[] { 2, punePort });
+    Integer nyPort = (Integer) vm2.invoke(() -> WANCommandTestBase.createFirstRemoteLocator( 2, punePort ));
 
-    vm3.invoke(WANCommandTestBase.class, "createCacheWithGroups",
-        new Object[] { punePort, "SenderGroup1" });
-    vm4.invoke(WANCommandTestBase.class, "createCacheWithGroups",
-        new Object[] { punePort, "SenderGroup1" });
-    vm5.invoke(WANCommandTestBase.class, "createCacheWithGroups",
-        new Object[] { punePort, "SenderGroup1" });
+    vm3.invoke(() -> WANCommandTestBase.createCacheWithGroups( punePort, "SenderGroup1" ));
+    vm4.invoke(() -> WANCommandTestBase.createCacheWithGroups( punePort, "SenderGroup1" ));
+    vm5.invoke(() -> WANCommandTestBase.createCacheWithGroups( punePort, "SenderGroup1" ));
 
     int socketReadTimeout = GatewaySender.MINIMUM_SOCKET_READ_TIMEOUT+1000;
     String command = CliStrings.CREATE_GATEWAYSENDER + " --"
@@ -542,12 +496,12 @@ public class WanCommandCreateGatewaySenderDUnitTest extends WANCommandTestBase {
       fail("testCreateGatewaySender failed as did not get CommandResult");
     }
 
-    vm3.invoke(WANCommandTestBase.class, "verifySenderState", new Object[] {
-        "ln", true, false });
-    vm4.invoke(WANCommandTestBase.class, "verifySenderState", new Object[] {
-        "ln", true, false });
-    vm5.invoke(WANCommandTestBase.class, "verifySenderState", new Object[] {
-        "ln", true, false });
+    vm3.invoke(() -> WANCommandTestBase.verifySenderState(
+        "ln", true, false ));
+    vm4.invoke(() -> WANCommandTestBase.verifySenderState(
+        "ln", true, false ));
+    vm5.invoke(() -> WANCommandTestBase.verifySenderState(
+        "ln", true, false ));
   }
   
   /**
@@ -556,8 +510,7 @@ public class WanCommandCreateGatewaySenderDUnitTest extends WANCommandTestBase {
    */
   public void testCreateGatewaySender_Group_Scenario2() {
 
-    Integer punePort = (Integer) vm1.invoke(WANCommandTestBase.class,
-        "createFirstLocatorWithDSId", new Object[] { 1 });
+    Integer punePort = (Integer) vm1.invoke(() -> WANCommandTestBase.createFirstLocatorWithDSId( 1 ));
 
     Properties props = new Properties();
     props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
@@ -565,15 +518,11 @@ public class WanCommandCreateGatewaySenderDUnitTest extends WANCommandTestBase {
     props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + punePort + "]");
     createDefaultSetup(props);
 
-    Integer nyPort = (Integer) vm2.invoke(WANCommandTestBase.class,
-        "createFirstRemoteLocator", new Object[] { 2, punePort });
+    Integer nyPort = (Integer) vm2.invoke(() -> WANCommandTestBase.createFirstRemoteLocator( 2, punePort ));
 
-    vm3.invoke(WANCommandTestBase.class, "createCacheWithGroups",
-        new Object[] { punePort, "SenderGroup1" });
-    vm4.invoke(WANCommandTestBase.class, "createCacheWithGroups",
-        new Object[] { punePort, "SenderGroup1" });
-    vm5.invoke(WANCommandTestBase.class, "createCacheWithGroups",
-        new Object[] { punePort, "SenderGroup2" });
+    vm3.invoke(() -> WANCommandTestBase.createCacheWithGroups( punePort, "SenderGroup1" ));
+    vm4.invoke(() -> WANCommandTestBase.createCacheWithGroups( punePort, "SenderGroup1" ));
+    vm5.invoke(() -> WANCommandTestBase.createCacheWithGroups( punePort, "SenderGroup2" ));
 
     int socketReadTimeout = GatewaySender.MINIMUM_SOCKET_READ_TIMEOUT+1000;
     String command = CliStrings.CREATE_GATEWAYSENDER + " --"
@@ -611,10 +560,10 @@ public class WanCommandCreateGatewaySenderDUnitTest extends WANCommandTestBase {
       fail("testCreateGatewaySender failed as did not get CommandResult");
     }
 
-    vm3.invoke(WANCommandTestBase.class, "verifySenderState", new Object[] {
-        "ln", true, false });
-    vm4.invoke(WANCommandTestBase.class, "verifySenderState", new Object[] {
-        "ln", true, false });
+    vm3.invoke(() -> WANCommandTestBase.verifySenderState(
+        "ln", true, false ));
+    vm4.invoke(() -> WANCommandTestBase.verifySenderState(
+        "ln", true, false ));
   }
   
   /**
@@ -622,8 +571,7 @@ public class WanCommandCreateGatewaySenderDUnitTest extends WANCommandTestBase {
    */
   public void testCreateParallelGatewaySender() {
 
-    Integer punePort = (Integer) vm1.invoke(WANCommandTestBase.class,
-        "createFirstLocatorWithDSId", new Object[] { 1 });
+    Integer punePort = (Integer) vm1.invoke(() -> WANCommandTestBase.createFirstLocatorWithDSId( 1 ));
 
     Properties props = new Properties();
     props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
@@ -631,15 +579,11 @@ public class WanCommandCreateGatewaySenderDUnitTest extends WANCommandTestBase {
     props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + punePort + "]");
     createDefaultSetup(props);
 
-    Integer nyPort = (Integer) vm2.invoke(WANCommandTestBase.class,
-        "createFirstRemoteLocator", new Object[] { 2, punePort });
+    Integer nyPort = (Integer) vm2.invoke(() -> WANCommandTestBase.createFirstRemoteLocator( 2, punePort ));
 
-    vm3.invoke(WANCommandTestBase.class, "createCache",
-        new Object[] { punePort });
-    vm4.invoke(WANCommandTestBase.class, "createCache",
-        new Object[] { punePort });
-    vm5.invoke(WANCommandTestBase.class, "createCache",
-        new Object[] { punePort });
+    vm3.invoke(() -> WANCommandTestBase.createCache( punePort ));
+    vm4.invoke(() -> WANCommandTestBase.createCache( punePort ));
+    vm5.invoke(() -> WANCommandTestBase.createCache( punePort ));
 
     int socketReadTimeout = GatewaySender.MINIMUM_SOCKET_READ_TIMEOUT+1000;
     String command = CliStrings.CREATE_GATEWAYSENDER + " --"
@@ -674,22 +618,19 @@ public class WanCommandCreateGatewaySenderDUnitTest extends WANCommandTestBase {
       fail("testCreateGatewaySender failed as did not get CommandResult");
     }
 
-    vm3.invoke(WANCommandTestBase.class, "verifySenderState", new Object[] {
-        "ln", false, false });
-    vm4.invoke(WANCommandTestBase.class, "verifySenderState", new Object[] {
-        "ln", false, false });
-    vm5.invoke(WANCommandTestBase.class, "verifySenderState", new Object[] {
-        "ln", false, false });
+    vm3.invoke(() -> WANCommandTestBase.verifySenderState(
+        "ln", false, false ));
+    vm4.invoke(() -> WANCommandTestBase.verifySenderState(
+        "ln", false, false ));
+    vm5.invoke(() -> WANCommandTestBase.verifySenderState(
+        "ln", false, false ));
     
-    vm3.invoke(WANCommandTestBase.class, "verifySenderAttributes",
-        new Object[] { "ln", 2, true, true, 1000, socketReadTimeout, true, 1000, 5000,
-            true, false, 1000, 100, GatewaySender.DEFAULT_DISPATCHER_THREADS, null, null, null });
-    vm4.invoke(WANCommandTestBase.class, "verifySenderAttributes",
-        new Object[] { "ln", 2, true, true, 1000, socketReadTimeout, true, 1000, 5000,
-            true, false, 1000, 100, GatewaySender.DEFAULT_DISPATCHER_THREADS, null, null, null });
-    vm5.invoke(WANCommandTestBase.class, "verifySenderAttributes",
-        new Object[] { "ln", 2, true, true, 1000, socketReadTimeout, true, 1000, 5000,
-            true, false, 1000, 100, GatewaySender.DEFAULT_DISPATCHER_THREADS, null, null, null });
+    vm3.invoke(() -> WANCommandTestBase.verifySenderAttributes( "ln", 2, true, true, 1000, socketReadTimeout, true, 1000, 5000,
+            true, false, 1000, 100, GatewaySender.DEFAULT_DISPATCHER_THREADS, null, null, null ));
+    vm4.invoke(() -> WANCommandTestBase.verifySenderAttributes( "ln", 2, true, true, 1000, socketReadTimeout, true, 1000, 5000,
+            true, false, 1000, 100, GatewaySender.DEFAULT_DISPATCHER_THREADS, null, null, null ));
+    vm5.invoke(() -> WANCommandTestBase.verifySenderAttributes( "ln", 2, true, true, 1000, socketReadTimeout, true, 1000, 5000,
+            true, false, 1000, 100, GatewaySender.DEFAULT_DISPATCHER_THREADS, null, null, null ));
   }
   
   /**
@@ -698,8 +639,7 @@ public class WanCommandCreateGatewaySenderDUnitTest extends WANCommandTestBase {
    */
   public void testCreateParallelGatewaySender_Error() {
 
-    Integer punePort = (Integer) vm1.invoke(WANCommandTestBase.class,
-        "createFirstLocatorWithDSId", new Object[] { 1 });
+    Integer punePort = (Integer) vm1.invoke(() -> WANCommandTestBase.createFirstLocatorWithDSId( 1 ));
 
     Properties props = new Properties();
     props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
@@ -708,15 +648,11 @@ public class WanCommandCreateGatewaySenderDUnitTest extends WANCommandTestBase {
         + "]");
     createDefaultSetup(props);
 
-    Integer nyPort = (Integer) vm2.invoke(WANCommandTestBase.class,
-        "createFirstRemoteLocator", new Object[] { 2, punePort });
+    Integer nyPort = (Integer) vm2.invoke(() -> WANCommandTestBase.createFirstRemoteLocator( 2, punePort ));
 
-    vm3.invoke(WANCommandTestBase.class, "createCache",
-        new Object[] { punePort });
-    vm4.invoke(WANCommandTestBase.class, "createCache",
-        new Object[] { punePort });
-    vm5.invoke(WANCommandTestBase.class, "createCache",
-        new Object[] { punePort });
+    vm3.invoke(() -> WANCommandTestBase.createCache( punePort ));
+    vm4.invoke(() -> WANCommandTestBase.createCache( punePort ));
+    vm5.invoke(() -> WANCommandTestBase.createCache( punePort ));
 
     int socketReadTimeout = GatewaySender.MINIMUM_SOCKET_READ_TIMEOUT+1000;
     String command = CliStrings.CREATE_GATEWAYSENDER + " --"

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/69024aa9/gemfire-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/wancommand/WanCommandGatewayReceiverStartDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/wancommand/WanCommandGatewayReceiverStartDUnitTest.java b/gemfire-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/wancommand/WanCommandGatewayReceiverStartDUnitTest.java
index 927d63b..1ef7f11 100644
--- a/gemfire-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/wancommand/WanCommandGatewayReceiverStartDUnitTest.java
+++ b/gemfire-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/wancommand/WanCommandGatewayReceiverStartDUnitTest.java
@@ -50,22 +50,18 @@ public class WanCommandGatewayReceiverStartDUnitTest extends WANCommandTestBase{
   public void testStartGatewayReceiver_ErrorConditions() {
 
     VM puneLocator = Host.getLocator();
-    int punePort = (Integer) puneLocator.invoke(WANCommandTestBase.class,
-        "getLocatorPort");
+    int punePort = (Integer) puneLocator.invoke(() -> WANCommandTestBase.getLocatorPort());
 
     Properties props = new Properties();
     props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
     props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + punePort + "]");
     createDefaultSetup(props);
 
-    Integer nyPort = (Integer) vm2.invoke(WANCommandTestBase.class,
-        "createFirstRemoteLocator", new Object[] { 2, punePort });
+    Integer nyPort = (Integer) vm2.invoke(() -> WANCommandTestBase.createFirstRemoteLocator( 2, punePort ));
 
-    vm3.invoke(WANCommandTestBase.class, "createReceiver",
-        new Object[] { punePort });
+    vm3.invoke(() -> WANCommandTestBase.createReceiver( punePort ));
 
-    final DistributedMember vm1Member = (DistributedMember) vm3.invoke(
-        WANCommandTestBase.class, "getMember");
+    final DistributedMember vm1Member = (DistributedMember) vm3.invoke(() -> WANCommandTestBase.getMember());
 
     String command = CliStrings.START_GATEWAYRECEIVER + " --"
         + CliStrings.START_GATEWAYRECEIVER__MEMBER + "=" + vm1Member.getId() + " --"
@@ -86,30 +82,22 @@ public class WanCommandGatewayReceiverStartDUnitTest extends WANCommandTestBase{
   public void testStartGatewayReceiver() {
     
     VM puneLocator = Host.getLocator();
-    int punePort = (Integer) puneLocator.invoke(WANCommandTestBase.class,
-        "getLocatorPort");
+    int punePort = (Integer) puneLocator.invoke(() -> WANCommandTestBase.getLocatorPort());
 
     Properties props = new Properties();
     props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
     props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + punePort + "]");
     createDefaultSetup(props);
 
-    Integer nyPort = (Integer) vm2.invoke(WANCommandTestBase.class,
-        "createFirstRemoteLocator", new Object[] { 2, punePort });
+    Integer nyPort = (Integer) vm2.invoke(() -> WANCommandTestBase.createFirstRemoteLocator( 2, punePort ));
 
-    vm3.invoke(WANCommandTestBase.class, "createReceiver",
-        new Object[] { punePort });
-    vm4.invoke(WANCommandTestBase.class, "createReceiver",
-        new Object[] { punePort });
-    vm5.invoke(WANCommandTestBase.class, "createReceiver",
-        new Object[] { punePort });
+    vm3.invoke(() -> WANCommandTestBase.createReceiver( punePort ));
+    vm4.invoke(() -> WANCommandTestBase.createReceiver( punePort ));
+    vm5.invoke(() -> WANCommandTestBase.createReceiver( punePort ));
     
-    vm3.invoke(WANCommandTestBase.class, "verifyReceiverState",
-        new Object[] { false });
-    vm4.invoke(WANCommandTestBase.class, "verifyReceiverState",
-        new Object[] { false });
-    vm5.invoke(WANCommandTestBase.class, "verifyReceiverState",
-        new Object[] { false });
+    vm3.invoke(() -> WANCommandTestBase.verifyReceiverState( false ));
+    vm4.invoke(() -> WANCommandTestBase.verifyReceiverState( false ));
+    vm5.invoke(() -> WANCommandTestBase.verifyReceiverState( false ));
     
     Wait.pause(10000);
     String command = CliStrings.START_GATEWAYRECEIVER;
@@ -127,12 +115,9 @@ public class WanCommandGatewayReceiverStartDUnitTest extends WANCommandTestBase{
       fail("testStartGatewayReceiver failed as did not get CommandResult");
     }
 
-    vm3.invoke(WANCommandTestBase.class, "verifyReceiverState",
-        new Object[] { true });
-    vm4.invoke(WANCommandTestBase.class, "verifyReceiverState",
-        new Object[] { true });
-    vm5.invoke(WANCommandTestBase.class, "verifyReceiverState",
-        new Object[] { true });
+    vm3.invoke(() -> WANCommandTestBase.verifyReceiverState( true ));
+    vm4.invoke(() -> WANCommandTestBase.verifyReceiverState( true ));
+    vm5.invoke(() -> WANCommandTestBase.verifyReceiverState( true ));
   }
 
   /**
@@ -142,33 +127,24 @@ public class WanCommandGatewayReceiverStartDUnitTest extends WANCommandTestBase{
   public void testStartGatewayReceiver_onMember() {
 
     VM puneLocator = Host.getLocator();
-    int punePort = (Integer) puneLocator.invoke(WANCommandTestBase.class,
-        "getLocatorPort");
+    int punePort = (Integer) puneLocator.invoke(() -> WANCommandTestBase.getLocatorPort());
 
     Properties props = new Properties();
     props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
     props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + punePort + "]");
     createDefaultSetup(props);
 
-    Integer nyPort = (Integer) vm2.invoke(WANCommandTestBase.class,
-        "createFirstRemoteLocator", new Object[] { 2, punePort });
+    Integer nyPort = (Integer) vm2.invoke(() -> WANCommandTestBase.createFirstRemoteLocator( 2, punePort ));
     
-    vm3.invoke(WANCommandTestBase.class, "createReceiver",
-        new Object[] { punePort });
-    vm4.invoke(WANCommandTestBase.class, "createReceiver",
-        new Object[] { punePort });
-    vm5.invoke(WANCommandTestBase.class, "createReceiver",
-        new Object[] { punePort });
-
-    vm3.invoke(WANCommandTestBase.class, "verifyReceiverState",
-        new Object[] { false });
-    vm4.invoke(WANCommandTestBase.class, "verifyReceiverState",
-        new Object[] { false });
-    vm5.invoke(WANCommandTestBase.class, "verifyReceiverState",
-        new Object[] { false });
+    vm3.invoke(() -> WANCommandTestBase.createReceiver( punePort ));
+    vm4.invoke(() -> WANCommandTestBase.createReceiver( punePort ));
+    vm5.invoke(() -> WANCommandTestBase.createReceiver( punePort ));
+
+    vm3.invoke(() -> WANCommandTestBase.verifyReceiverState( false ));
+    vm4.invoke(() -> WANCommandTestBase.verifyReceiverState( false ));
+    vm5.invoke(() -> WANCommandTestBase.verifyReceiverState( false ));
     
-    final DistributedMember vm1Member = (DistributedMember) vm3.invoke(
-        WANCommandTestBase.class, "getMember");
+    final DistributedMember vm1Member = (DistributedMember) vm3.invoke(() -> WANCommandTestBase.getMember());
     Wait.pause(10000);
     String command = CliStrings.START_GATEWAYRECEIVER + " --"
         + CliStrings.START_GATEWAYRECEIVER__MEMBER+ "=" + vm1Member.getId();
@@ -184,12 +160,9 @@ public class WanCommandGatewayReceiverStartDUnitTest extends WANCommandTestBase{
       fail("testStartGatewayReceiver failed as did not get CommandResult");
     }
 
-    vm3.invoke(WANCommandTestBase.class, "verifyReceiverState",
-        new Object[] { true });
-    vm4.invoke(WANCommandTestBase.class, "verifyReceiverState",
-        new Object[] { false });
-    vm5.invoke(WANCommandTestBase.class, "verifyReceiverState",
-        new Object[] { false });
+    vm3.invoke(() -> WANCommandTestBase.verifyReceiverState( true ));
+    vm4.invoke(() -> WANCommandTestBase.verifyReceiverState( false ));
+    vm5.invoke(() -> WANCommandTestBase.verifyReceiverState( false ));
   }
 
   /**
@@ -199,30 +172,22 @@ public class WanCommandGatewayReceiverStartDUnitTest extends WANCommandTestBase{
   public void testStartGatewayReceiver_Group() {
 
     VM puneLocator = Host.getLocator();
-    int punePort = (Integer) puneLocator.invoke(WANCommandTestBase.class,
-        "getLocatorPort");
+    int punePort = (Integer) puneLocator.invoke(() -> WANCommandTestBase.getLocatorPort());
 
     Properties props = new Properties();
     props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
     props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + punePort + "]");
     createDefaultSetup(props);
 
-    Integer nyPort = (Integer) vm2.invoke(WANCommandTestBase.class,
-        "createFirstRemoteLocator", new Object[] { 2, punePort });
-
-    vm3.invoke(WANCommandTestBase.class, "createReceiverWithGroup",
-        new Object[] { punePort, "RG1" });
-    vm4.invoke(WANCommandTestBase.class, "createReceiverWithGroup",
-        new Object[] { punePort, "RG1" });
-    vm5.invoke(WANCommandTestBase.class, "createReceiverWithGroup",
-        new Object[] { punePort, "RG1" });
-
-    vm3.invoke(WANCommandTestBase.class, "verifyReceiverState",
-        new Object[] { false });
-    vm4.invoke(WANCommandTestBase.class, "verifyReceiverState",
-        new Object[] { false });
-    vm5.invoke(WANCommandTestBase.class, "verifyReceiverState",
-        new Object[] { false });
+    Integer nyPort = (Integer) vm2.invoke(() -> WANCommandTestBase.createFirstRemoteLocator( 2, punePort ));
+
+    vm3.invoke(() -> WANCommandTestBase.createReceiverWithGroup( punePort, "RG1" ));
+    vm4.invoke(() -> WANCommandTestBase.createReceiverWithGroup( punePort, "RG1" ));
+    vm5.invoke(() -> WANCommandTestBase.createReceiverWithGroup( punePort, "RG1" ));
+
+    vm3.invoke(() -> WANCommandTestBase.verifyReceiverState( false ));
+    vm4.invoke(() -> WANCommandTestBase.verifyReceiverState( false ));
+    vm5.invoke(() -> WANCommandTestBase.verifyReceiverState( false ));
     
     Wait.pause(10000);
     String command = CliStrings.START_GATEWAYRECEIVER + " --"
@@ -244,12 +209,9 @@ public class WanCommandGatewayReceiverStartDUnitTest extends WANCommandTestBase{
       fail("testStartGatewayReceiver_Group failed as did not get CommandResult");
     }
 
-    vm3.invoke(WANCommandTestBase.class, "verifyReceiverState",
-        new Object[] { true });
-    vm4.invoke(WANCommandTestBase.class, "verifyReceiverState",
-        new Object[] { true });
-    vm5.invoke(WANCommandTestBase.class, "verifyReceiverState",
-        new Object[] { true });
+    vm3.invoke(() -> WANCommandTestBase.verifyReceiverState( true ));
+    vm4.invoke(() -> WANCommandTestBase.verifyReceiverState( true ));
+    vm5.invoke(() -> WANCommandTestBase.verifyReceiverState( true ));
   }
 
   /**
@@ -260,38 +222,26 @@ public class WanCommandGatewayReceiverStartDUnitTest extends WANCommandTestBase{
   public void testStartGatewayReceiver_MultipleGroup() {
     
     VM puneLocator = Host.getLocator();
-    int punePort = (Integer) puneLocator.invoke(WANCommandTestBase.class,
-        "getLocatorPort");
+    int punePort = (Integer) puneLocator.invoke(() -> WANCommandTestBase.getLocatorPort());
 
     Properties props = new Properties();
     props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
     props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + punePort + "]");
     createDefaultSetup(props);
 
-    Integer nyPort = (Integer) vm2.invoke(WANCommandTestBase.class,
-        "createFirstRemoteLocator", new Object[] { 2, punePort });
+    Integer nyPort = (Integer) vm2.invoke(() -> WANCommandTestBase.createFirstRemoteLocator( 2, punePort ));
     
-    vm3.invoke(WANCommandTestBase.class, "createReceiverWithGroup",
-        new Object[] { punePort, "RG1" });
-    vm4.invoke(WANCommandTestBase.class, "createReceiverWithGroup",
-        new Object[] { punePort, "RG1" });
-    vm5.invoke(WANCommandTestBase.class, "createReceiverWithGroup",
-        new Object[] { punePort, "RG1, RG2" });
-    vm6.invoke(WANCommandTestBase.class, "createReceiverWithGroup",
-        new Object[] { punePort, "RG1, RG2" });
-    vm7.invoke(WANCommandTestBase.class, "createReceiverWithGroup",
-        new Object[] { punePort, "RG3" });
+    vm3.invoke(() -> WANCommandTestBase.createReceiverWithGroup( punePort, "RG1" ));
+    vm4.invoke(() -> WANCommandTestBase.createReceiverWithGroup( punePort, "RG1" ));
+    vm5.invoke(() -> WANCommandTestBase.createReceiverWithGroup( punePort, "RG1, RG2" ));
+    vm6.invoke(() -> WANCommandTestBase.createReceiverWithGroup( punePort, "RG1, RG2" ));
+    vm7.invoke(() -> WANCommandTestBase.createReceiverWithGroup( punePort, "RG3" ));
     
-    vm3.invoke(WANCommandTestBase.class, "verifyReceiverState",
-        new Object[] { false });
-    vm4.invoke(WANCommandTestBase.class, "verifyReceiverState",
-        new Object[] { false });
-    vm5.invoke(WANCommandTestBase.class, "verifyReceiverState",
-        new Object[] { false });
-    vm6.invoke(WANCommandTestBase.class, "verifyReceiverState",
-        new Object[] { false });
-    vm7.invoke(WANCommandTestBase.class, "verifyReceiverState",
-        new Object[] { false });
+    vm3.invoke(() -> WANCommandTestBase.verifyReceiverState( false ));
+    vm4.invoke(() -> WANCommandTestBase.verifyReceiverState( false ));
+    vm5.invoke(() -> WANCommandTestBase.verifyReceiverState( false ));
+    vm6.invoke(() -> WANCommandTestBase.verifyReceiverState( false ));
+    vm7.invoke(() -> WANCommandTestBase.verifyReceiverState( false ));
 
     Wait.pause(10000);
     String command = CliStrings.START_GATEWAYRECEIVER + " --"
@@ -313,16 +263,11 @@ public class WanCommandGatewayReceiverStartDUnitTest extends WANCommandTestBase{
       fail("testStartGatewayReceiver failed as did not get CommandResult");
     }
 
-    vm3.invoke(WANCommandTestBase.class, "verifyReceiverState",
-        new Object[] { true });
-    vm4.invoke(WANCommandTestBase.class, "verifyReceiverState",
-        new Object[] { true});
-    vm5.invoke(WANCommandTestBase.class, "verifyReceiverState",
-        new Object[] { true });
-    vm6.invoke(WANCommandTestBase.class, "verifyReceiverState",
-        new Object[] { true });
-    vm7.invoke(WANCommandTestBase.class, "verifyReceiverState",
-        new Object[] { false });
+    vm3.invoke(() -> WANCommandTestBase.verifyReceiverState( true ));
+    vm4.invoke(() -> WANCommandTestBase.verifyReceiverState( true));
+    vm5.invoke(() -> WANCommandTestBase.verifyReceiverState( true ));
+    vm6.invoke(() -> WANCommandTestBase.verifyReceiverState( true ));
+    vm7.invoke(() -> WANCommandTestBase.verifyReceiverState( false ));
   }
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/69024aa9/gemfire-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/wancommand/WanCommandGatewayReceiverStopDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/wancommand/WanCommandGatewayReceiverStopDUnitTest.java b/gemfire-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/wancommand/WanCommandGatewayReceiverStopDUnitTest.java
index 574c5d9..08bd07d 100644
--- a/gemfire-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/wancommand/WanCommandGatewayReceiverStopDUnitTest.java
+++ b/gemfire-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/wancommand/WanCommandGatewayReceiverStopDUnitTest.java
@@ -50,22 +50,18 @@ public class WanCommandGatewayReceiverStopDUnitTest extends WANCommandTestBase {
   public void testStopGatewayReceiver_ErrorConditions() {
 
     VM puneLocator = Host.getLocator();
-    int punePort = (Integer) puneLocator.invoke(WANCommandTestBase.class,
-        "getLocatorPort");
+    int punePort = (Integer) puneLocator.invoke(() -> WANCommandTestBase.getLocatorPort());
 
     Properties props = new Properties();
     props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
     props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + punePort + "]");
     createDefaultSetup(props);
 
-    Integer nyPort = (Integer) vm2.invoke(WANCommandTestBase.class,
-        "createFirstRemoteLocator", new Object[] { 2, punePort });
+    Integer nyPort = (Integer) vm2.invoke(() -> WANCommandTestBase.createFirstRemoteLocator( 2, punePort ));
 
-    vm3.invoke(WANCommandTestBase.class, "createReceiver",
-        new Object[] { punePort });
+    vm3.invoke(() -> WANCommandTestBase.createReceiver( punePort ));
 
-    final DistributedMember vm1Member = (DistributedMember) vm3.invoke(
-        WANCommandTestBase.class, "getMember");
+    final DistributedMember vm1Member = (DistributedMember) vm3.invoke(() -> WANCommandTestBase.getMember());
 
     String command = CliStrings.STOP_GATEWAYRECEIVER + " --"
         + CliStrings.STOP_GATEWAYRECEIVER__MEMBER + "=" + vm1Member.getId()
@@ -87,30 +83,22 @@ public class WanCommandGatewayReceiverStopDUnitTest extends WANCommandTestBase {
   public void testStopGatewayReceiver() {
 
     VM puneLocator = Host.getLocator();
-    int punePort = (Integer) puneLocator.invoke(WANCommandTestBase.class,
-        "getLocatorPort");
+    int punePort = (Integer) puneLocator.invoke(() -> WANCommandTestBase.getLocatorPort());
 
     Properties props = new Properties();
     props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
     props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + punePort + "]");
     createDefaultSetup(props);
 
-    Integer nyPort = (Integer) vm2.invoke(WANCommandTestBase.class,
-        "createFirstRemoteLocator", new Object[] { 2, punePort });
+    Integer nyPort = (Integer) vm2.invoke(() -> WANCommandTestBase.createFirstRemoteLocator( 2, punePort ));
 
-    vm3.invoke(WANCommandTestBase.class, "createAndStartReceiver",
-        new Object[] { punePort });
-    vm4.invoke(WANCommandTestBase.class, "createAndStartReceiver",
-        new Object[] { punePort });
-    vm5.invoke(WANCommandTestBase.class, "createAndStartReceiver",
-        new Object[] { punePort });
+    vm3.invoke(() -> WANCommandTestBase.createAndStartReceiver( punePort ));
+    vm4.invoke(() -> WANCommandTestBase.createAndStartReceiver( punePort ));
+    vm5.invoke(() -> WANCommandTestBase.createAndStartReceiver( punePort ));
 
-    vm3.invoke(WANCommandTestBase.class, "verifyReceiverState",
-        new Object[] { true });
-    vm4.invoke(WANCommandTestBase.class, "verifyReceiverState",
-        new Object[] { true });
-    vm5.invoke(WANCommandTestBase.class, "verifyReceiverState",
-        new Object[] { true });
+    vm3.invoke(() -> WANCommandTestBase.verifyReceiverState( true ));
+    vm4.invoke(() -> WANCommandTestBase.verifyReceiverState( true ));
+    vm5.invoke(() -> WANCommandTestBase.verifyReceiverState( true ));
 
     Wait.pause(10000);
     String command = CliStrings.STOP_GATEWAYRECEIVER;
@@ -130,12 +118,9 @@ public class WanCommandGatewayReceiverStopDUnitTest extends WANCommandTestBase {
       fail("testStopGatewayReceiver failed as did not get CommandResult");
     }
 
-    vm3.invoke(WANCommandTestBase.class, "verifyReceiverState",
-        new Object[] { false });
-    vm4.invoke(WANCommandTestBase.class, "verifyReceiverState",
-        new Object[] { false });
-    vm5.invoke(WANCommandTestBase.class, "verifyReceiverState",
-        new Object[] { false });
+    vm3.invoke(() -> WANCommandTestBase.verifyReceiverState( false ));
+    vm4.invoke(() -> WANCommandTestBase.verifyReceiverState( false ));
+    vm5.invoke(() -> WANCommandTestBase.verifyReceiverState( false ));
   }
 
   /**
@@ -145,33 +130,24 @@ public class WanCommandGatewayReceiverStopDUnitTest extends WANCommandTestBase {
   public void testStopGatewayReceiver_onMember() {
 
     VM puneLocator = Host.getLocator();
-    int punePort = (Integer) puneLocator.invoke(WANCommandTestBase.class,
-        "getLocatorPort");
+    int punePort = (Integer) puneLocator.invoke(() -> WANCommandTestBase.getLocatorPort());
 
     Properties props = new Properties();
     props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
     props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + punePort + "]");
     createDefaultSetup(props);
 
-    Integer nyPort = (Integer) vm2.invoke(WANCommandTestBase.class,
-        "createFirstRemoteLocator", new Object[] { 2, punePort });
-
-    vm3.invoke(WANCommandTestBase.class, "createAndStartReceiver",
-        new Object[] { punePort });
-    vm4.invoke(WANCommandTestBase.class, "createAndStartReceiver",
-        new Object[] { punePort });
-    vm5.invoke(WANCommandTestBase.class, "createAndStartReceiver",
-        new Object[] { punePort });
-
-    vm3.invoke(WANCommandTestBase.class, "verifyReceiverState",
-        new Object[] { true });
-    vm4.invoke(WANCommandTestBase.class, "verifyReceiverState",
-        new Object[] { true });
-    vm5.invoke(WANCommandTestBase.class, "verifyReceiverState",
-        new Object[] { true });
-
-    final DistributedMember vm1Member = (DistributedMember) vm3.invoke(
-        WANCommandTestBase.class, "getMember");
+    Integer nyPort = (Integer) vm2.invoke(() -> WANCommandTestBase.createFirstRemoteLocator( 2, punePort ));
+
+    vm3.invoke(() -> WANCommandTestBase.createAndStartReceiver( punePort ));
+    vm4.invoke(() -> WANCommandTestBase.createAndStartReceiver( punePort ));
+    vm5.invoke(() -> WANCommandTestBase.createAndStartReceiver( punePort ));
+
+    vm3.invoke(() -> WANCommandTestBase.verifyReceiverState( true ));
+    vm4.invoke(() -> WANCommandTestBase.verifyReceiverState( true ));
+    vm5.invoke(() -> WANCommandTestBase.verifyReceiverState( true ));
+
+    final DistributedMember vm1Member = (DistributedMember) vm3.invoke(() -> WANCommandTestBase.getMember());
     Wait.pause(10000);
     String command = CliStrings.STOP_GATEWAYRECEIVER + " --"
         + CliStrings.STOP_GATEWAYRECEIVER__MEMBER + "=" + vm1Member.getId();
@@ -188,12 +164,9 @@ public class WanCommandGatewayReceiverStopDUnitTest extends WANCommandTestBase {
       fail("testStopGatewayReceiver failed as did not get CommandResult");
     }
 
-    vm3.invoke(WANCommandTestBase.class, "verifyReceiverState",
-        new Object[] { false });
-    vm4.invoke(WANCommandTestBase.class, "verifyReceiverState",
-        new Object[] { true });
-    vm5.invoke(WANCommandTestBase.class, "verifyReceiverState",
-        new Object[] { true });
+    vm3.invoke(() -> WANCommandTestBase.verifyReceiverState( false ));
+    vm4.invoke(() -> WANCommandTestBase.verifyReceiverState( true ));
+    vm5.invoke(() -> WANCommandTestBase.verifyReceiverState( true ));
   }
 
   /**
@@ -203,30 +176,22 @@ public class WanCommandGatewayReceiverStopDUnitTest extends WANCommandTestBase {
   public void testStopGatewayReceiver_Group() {
 
     VM puneLocator = Host.getLocator();
-    int punePort = (Integer) puneLocator.invoke(WANCommandTestBase.class,
-        "getLocatorPort");
+    int punePort = (Integer) puneLocator.invoke(() -> WANCommandTestBase.getLocatorPort());
 
     Properties props = new Properties();
     props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
     props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + punePort + "]");
     createDefaultSetup(props);
 
-    Integer nyPort = (Integer) vm2.invoke(WANCommandTestBase.class,
-        "createFirstRemoteLocator", new Object[] { 2, punePort });
+    Integer nyPort = (Integer) vm2.invoke(() -> WANCommandTestBase.createFirstRemoteLocator( 2, punePort ));
 
-    vm3.invoke(WANCommandTestBase.class, "createAndStartReceiverWithGroup",
-        new Object[] { punePort, "RG1" });
-    vm4.invoke(WANCommandTestBase.class, "createAndStartReceiverWithGroup",
-        new Object[] { punePort, "RG1" });
-    vm5.invoke(WANCommandTestBase.class, "createAndStartReceiverWithGroup",
-        new Object[] { punePort, "RG1" });
+    vm3.invoke(() -> WANCommandTestBase.createAndStartReceiverWithGroup( punePort, "RG1" ));
+    vm4.invoke(() -> WANCommandTestBase.createAndStartReceiverWithGroup( punePort, "RG1" ));
+    vm5.invoke(() -> WANCommandTestBase.createAndStartReceiverWithGroup( punePort, "RG1" ));
 
-    vm3.invoke(WANCommandTestBase.class, "verifyReceiverState",
-        new Object[] { true });
-    vm4.invoke(WANCommandTestBase.class, "verifyReceiverState",
-        new Object[] { true });
-    vm5.invoke(WANCommandTestBase.class, "verifyReceiverState",
-        new Object[] { true });
+    vm3.invoke(() -> WANCommandTestBase.verifyReceiverState( true ));
+    vm4.invoke(() -> WANCommandTestBase.verifyReceiverState( true ));
+    vm5.invoke(() -> WANCommandTestBase.verifyReceiverState( true ));
 
     Wait.pause(10000);
     String command = CliStrings.STOP_GATEWAYRECEIVER + " --"
@@ -249,12 +214,9 @@ public class WanCommandGatewayReceiverStopDUnitTest extends WANCommandTestBase {
       fail("testStopGatewayReceiver_Group failed as did not get CommandResult");
     }
 
-    vm3.invoke(WANCommandTestBase.class, "verifyReceiverState",
-        new Object[] { false });
-    vm4.invoke(WANCommandTestBase.class, "verifyReceiverState",
-        new Object[] { false });
-    vm5.invoke(WANCommandTestBase.class, "verifyReceiverState",
-        new Object[] { false });
+    vm3.invoke(() -> WANCommandTestBase.verifyReceiverState( false ));
+    vm4.invoke(() -> WANCommandTestBase.verifyReceiverState( false ));
+    vm5.invoke(() -> WANCommandTestBase.verifyReceiverState( false ));
   }
 
   /**
@@ -265,38 +227,26 @@ public class WanCommandGatewayReceiverStopDUnitTest extends WANCommandTestBase {
   public void testStopGatewayReceiver_MultipleGroup() {
 
     VM puneLocator = Host.getLocator();
-    int punePort = (Integer) puneLocator.invoke(WANCommandTestBase.class,
-        "getLocatorPort");
+    int punePort = (Integer) puneLocator.invoke(() -> WANCommandTestBase.getLocatorPort());
 
     Properties props = new Properties();
     props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
     props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + punePort + "]");
     createDefaultSetup(props);
 
-    Integer nyPort = (Integer) vm2.invoke(WANCommandTestBase.class,
-        "createFirstRemoteLocator", new Object[] { 2, punePort });
-
-    vm3.invoke(WANCommandTestBase.class, "createAndStartReceiverWithGroup",
-        new Object[] { punePort, "RG1" });
-    vm4.invoke(WANCommandTestBase.class, "createAndStartReceiverWithGroup",
-        new Object[] { punePort, "RG1" });
-    vm5.invoke(WANCommandTestBase.class, "createAndStartReceiverWithGroup",
-        new Object[] { punePort, "RG1" });
-    vm6.invoke(WANCommandTestBase.class, "createAndStartReceiverWithGroup",
-        new Object[] { punePort, "RG1, RG2" });
-    vm7.invoke(WANCommandTestBase.class, "createAndStartReceiverWithGroup",
-        new Object[] { punePort, "RG3" });
-
-    vm3.invoke(WANCommandTestBase.class, "verifyReceiverState",
-        new Object[] { true });
-    vm4.invoke(WANCommandTestBase.class, "verifyReceiverState",
-        new Object[] { true });
-    vm5.invoke(WANCommandTestBase.class, "verifyReceiverState",
-        new Object[] { true });
-    vm6.invoke(WANCommandTestBase.class, "verifyReceiverState",
-        new Object[] { true });
-    vm7.invoke(WANCommandTestBase.class, "verifyReceiverState",
-        new Object[] { true });
+    Integer nyPort = (Integer) vm2.invoke(() -> WANCommandTestBase.createFirstRemoteLocator( 2, punePort ));
+
+    vm3.invoke(() -> WANCommandTestBase.createAndStartReceiverWithGroup( punePort, "RG1" ));
+    vm4.invoke(() -> WANCommandTestBase.createAndStartReceiverWithGroup( punePort, "RG1" ));
+    vm5.invoke(() -> WANCommandTestBase.createAndStartReceiverWithGroup( punePort, "RG1" ));
+    vm6.invoke(() -> WANCommandTestBase.createAndStartReceiverWithGroup( punePort, "RG1, RG2" ));
+    vm7.invoke(() -> WANCommandTestBase.createAndStartReceiverWithGroup( punePort, "RG3" ));
+
+    vm3.invoke(() -> WANCommandTestBase.verifyReceiverState( true ));
+    vm4.invoke(() -> WANCommandTestBase.verifyReceiverState( true ));
+    vm5.invoke(() -> WANCommandTestBase.verifyReceiverState( true ));
+    vm6.invoke(() -> WANCommandTestBase.verifyReceiverState( true ));
+    vm7.invoke(() -> WANCommandTestBase.verifyReceiverState( true ));
 
     Wait.pause(10000);
     String command = CliStrings.STOP_GATEWAYRECEIVER + " --"
@@ -319,15 +269,10 @@ public class WanCommandGatewayReceiverStopDUnitTest extends WANCommandTestBase {
       fail("testStopGatewayReceiver failed as did not get CommandResult");
     }
 
-    vm3.invoke(WANCommandTestBase.class, "verifyReceiverState",
-        new Object[] { false });
-    vm4.invoke(WANCommandTestBase.class, "verifyReceiverState",
-        new Object[] { false });
-    vm5.invoke(WANCommandTestBase.class, "verifyReceiverState",
-        new Object[] { false });
-    vm6.invoke(WANCommandTestBase.class, "verifyReceiverState",
-        new Object[] { false });
-    vm7.invoke(WANCommandTestBase.class, "verifyReceiverState",
-        new Object[] { true });
+    vm3.invoke(() -> WANCommandTestBase.verifyReceiverState( false ));
+    vm4.invoke(() -> WANCommandTestBase.verifyReceiverState( false ));
+    vm5.invoke(() -> WANCommandTestBase.verifyReceiverState( false ));
+    vm6.invoke(() -> WANCommandTestBase.verifyReceiverState( false ));
+    vm7.invoke(() -> WANCommandTestBase.verifyReceiverState( true ));
   }
 }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/69024aa9/gemfire-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/wancommand/WanCommandGatewaySenderStartDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/wancommand/WanCommandGatewaySenderStartDUnitTest.java b/gemfire-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/wancommand/WanCommandGatewaySenderStartDUnitTest.java
index d4211e8..7e6a06d 100644
--- a/gemfire-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/wancommand/WanCommandGatewaySenderStartDUnitTest.java
+++ b/gemfire-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/wancommand/WanCommandGatewaySenderStartDUnitTest.java
@@ -48,8 +48,7 @@ public class WanCommandGatewaySenderStartDUnitTest extends WANCommandTestBase {
    */
   public void testStartGatewaySender_ErrorConditions() {
 
-    Integer punePort = (Integer) vm1.invoke(WANCommandTestBase.class,
-        "createFirstLocatorWithDSId", new Object[] { 1 });
+    Integer punePort = (Integer) vm1.invoke(() -> WANCommandTestBase.createFirstLocatorWithDSId( 1 ));
 
     Properties props = new Properties();
     props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
@@ -57,16 +56,13 @@ public class WanCommandGatewaySenderStartDUnitTest extends WANCommandTestBase {
     props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + punePort + "]");
     createDefaultSetup(props);
     
-    Integer nyPort = (Integer) vm2.invoke(WANCommandTestBase.class,
-        "createFirstRemoteLocator", new Object[] { 2, punePort });
+    Integer nyPort = (Integer) vm2.invoke(() -> WANCommandTestBase.createFirstRemoteLocator( 2, punePort ));
 
-    vm3.invoke(WANCommandTestBase.class, "createCache",
-        new Object[] { punePort });
-    vm3.invoke(WANCommandTestBase.class, "createSender", new Object[] { "ln",
-        2, false, 100, 400, false, false, null, true });
+    vm3.invoke(() -> WANCommandTestBase.createCache( punePort ));
+    vm3.invoke(() -> WANCommandTestBase.createSender( "ln",
+        2, false, 100, 400, false, false, null, true ));
 
-    final DistributedMember vm1Member = (DistributedMember) vm3.invoke(
-        WANCommandTestBase.class, "getMember");
+    final DistributedMember vm1Member = (DistributedMember) vm3.invoke(() -> WANCommandTestBase.getMember());
 
     String command = CliStrings.START_GATEWAYSENDER + " --"
         + CliStrings.START_GATEWAYSENDER__ID + "=ln --"
@@ -96,8 +92,7 @@ public class WanCommandGatewaySenderStartDUnitTest extends WANCommandTestBase {
 
   public void testStartGatewaySender() {
 
-    Integer punePort = (Integer) vm1.invoke(WANCommandTestBase.class,
-        "createFirstLocatorWithDSId", new Object[] { 1 });
+    Integer punePort = (Integer) vm1.invoke(() -> WANCommandTestBase.createFirstLocatorWithDSId( 1 ));
 
     Properties props = new Properties();
     props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
@@ -105,28 +100,24 @@ public class WanCommandGatewaySenderStartDUnitTest extends WANCommandTestBase {
     props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + punePort + "]");
     createDefaultSetup(props);
 
-    Integer nyPort = (Integer) vm2.invoke(WANCommandTestBase.class,
-        "createFirstRemoteLocator", new Object[] { 2, punePort });
-
-    vm3.invoke(WANCommandTestBase.class, "createCache",
-        new Object[] { punePort });
-    vm3.invoke(WANCommandTestBase.class, "createSender", new Object[] { "ln",
-        2, false, 100, 400, false, false, null, true });
-    vm4.invoke(WANCommandTestBase.class, "createCache",
-        new Object[] { punePort });
-    vm4.invoke(WANCommandTestBase.class, "createSender", new Object[] { "ln",
-        2, false, 100, 400, false, false, null, true });
-    vm5.invoke(WANCommandTestBase.class, "createCache",
-        new Object[] { punePort });
-    vm5.invoke(WANCommandTestBase.class, "createSender", new Object[] { "ln",
-        2, false, 100, 400, false, false, null, true });
-
-    vm3.invoke(WANCommandTestBase.class, "verifySenderState", new Object[] {
-        "ln", false, false });
-    vm4.invoke(WANCommandTestBase.class, "verifySenderState", new Object[] {
-        "ln", false, false });
-    vm5.invoke(WANCommandTestBase.class, "verifySenderState", new Object[] {
-        "ln", false, false });
+    Integer nyPort = (Integer) vm2.invoke(() -> WANCommandTestBase.createFirstRemoteLocator( 2, punePort ));
+
+    vm3.invoke(() -> WANCommandTestBase.createCache( punePort ));
+    vm3.invoke(() -> WANCommandTestBase.createSender( "ln",
+        2, false, 100, 400, false, false, null, true ));
+    vm4.invoke(() -> WANCommandTestBase.createCache( punePort ));
+    vm4.invoke(() -> WANCommandTestBase.createSender( "ln",
+        2, false, 100, 400, false, false, null, true ));
+    vm5.invoke(() -> WANCommandTestBase.createCache( punePort ));
+    vm5.invoke(() -> WANCommandTestBase.createSender( "ln",
+        2, false, 100, 400, false, false, null, true ));
+
+    vm3.invoke(() -> WANCommandTestBase.verifySenderState(
+        "ln", false, false ));
+    vm4.invoke(() -> WANCommandTestBase.verifySenderState(
+        "ln", false, false ));
+    vm5.invoke(() -> WANCommandTestBase.verifySenderState(
+        "ln", false, false ));
 
     Wait.pause(10000);
     String command = CliStrings.START_GATEWAYSENDER + " --"
@@ -147,12 +138,12 @@ public class WanCommandGatewaySenderStartDUnitTest extends WANCommandTestBase {
       fail("testStartGatewaySender failed as did not get CommandResult");
     }
 
-    vm3.invoke(WANCommandTestBase.class, "verifySenderState", new Object[] {
-        "ln", true, false });
-    vm4.invoke(WANCommandTestBase.class, "verifySenderState", new Object[] {
-        "ln", true, false });
-    vm5.invoke(WANCommandTestBase.class, "verifySenderState", new Object[] {
-        "ln", true, false });
+    vm3.invoke(() -> WANCommandTestBase.verifySenderState(
+        "ln", true, false ));
+    vm4.invoke(() -> WANCommandTestBase.verifySenderState(
+        "ln", true, false ));
+    vm5.invoke(() -> WANCommandTestBase.verifySenderState(
+        "ln", true, false ));
   }
 
   /**
@@ -161,8 +152,7 @@ public class WanCommandGatewaySenderStartDUnitTest extends WANCommandTestBase {
    */
   public void testStartGatewaySender_onMember() {
 
-    Integer punePort = (Integer) vm1.invoke(WANCommandTestBase.class,
-        "createFirstLocatorWithDSId", new Object[] { 1 });
+    Integer punePort = (Integer) vm1.invoke(() -> WANCommandTestBase.createFirstLocatorWithDSId( 1 ));
 
     Properties props = new Properties();
     props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
@@ -170,19 +160,16 @@ public class WanCommandGatewaySenderStartDUnitTest extends WANCommandTestBase {
     props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + punePort + "]");
     createDefaultSetup(props);
 
-    Integer nyPort = (Integer) vm2.invoke(WANCommandTestBase.class,
-        "createFirstRemoteLocator", new Object[] { 2, punePort });
+    Integer nyPort = (Integer) vm2.invoke(() -> WANCommandTestBase.createFirstRemoteLocator( 2, punePort ));
 
-    vm3.invoke(WANCommandTestBase.class, "createCache",
-        new Object[] { punePort });
-    vm3.invoke(WANCommandTestBase.class, "createSender", new Object[] { "ln",
-        2, false, 100, 400, false, false, null, true });
+    vm3.invoke(() -> WANCommandTestBase.createCache( punePort ));
+    vm3.invoke(() -> WANCommandTestBase.createSender( "ln",
+        2, false, 100, 400, false, false, null, true ));
 
-    vm3.invoke(WANCommandTestBase.class, "verifySenderState", new Object[] {
-        "ln", false, false });
+    vm3.invoke(() -> WANCommandTestBase.verifySenderState(
+        "ln", false, false ));
 
-    final DistributedMember vm1Member = (DistributedMember) vm3.invoke(
-        WANCommandTestBase.class, "getMember");
+    final DistributedMember vm1Member = (DistributedMember) vm3.invoke(() -> WANCommandTestBase.getMember());
     Wait.pause(10000);
     String command = CliStrings.START_GATEWAYSENDER + " --"
         + CliStrings.START_GATEWAYSENDER__ID + "=ln --"
@@ -198,8 +185,8 @@ public class WanCommandGatewaySenderStartDUnitTest extends WANCommandTestBase {
       fail("testStartGatewaySender failed as did not get CommandResult");
     }
 
-    vm3.invoke(WANCommandTestBase.class, "verifySenderState", new Object[] {
-        "ln", true, false });
+    vm3.invoke(() -> WANCommandTestBase.verifySenderState(
+        "ln", true, false ));
   }
 
   /**
@@ -208,8 +195,7 @@ public class WanCommandGatewaySenderStartDUnitTest extends WANCommandTestBase {
    */
   public void testStartGatewaySender_Group() {
 
-    Integer punePort = (Integer) vm1.invoke(WANCommandTestBase.class,
-        "createFirstLocatorWithDSId", new Object[] { 1 });
+    Integer punePort = (Integer) vm1.invoke(() -> WANCommandTestBase.createFirstLocatorWithDSId( 1 ));
 
     Properties props = new Properties();
     props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
@@ -217,28 +203,27 @@ public class WanCommandGatewaySenderStartDUnitTest extends WANCommandTestBase {
     props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + punePort + "]");
     createDefaultSetup(props);
     
-    Integer nyPort = (Integer) vm2.invoke(WANCommandTestBase.class,
-        "createFirstRemoteLocator", new Object[] { 2, punePort });
-
-    vm3.invoke(WANCommandTestBase.class, "createCacheWithGroups", new Object[] {
-        punePort, "SenderGroup1" });
-    vm3.invoke(WANCommandTestBase.class, "createSender", new Object[] { "ln",
-        2, false, 100, 400, false, false, null, true });
-    vm4.invoke(WANCommandTestBase.class, "createCacheWithGroups", new Object[] {
-        punePort, "SenderGroup1" });
-    vm4.invoke(WANCommandTestBase.class, "createSender", new Object[] { "ln",
-        2, false, 100, 400, false, false, null, true });
-    vm5.invoke(WANCommandTestBase.class, "createCacheWithGroups", new Object[] {
-        punePort, "SenderGroup1" });
-    vm5.invoke(WANCommandTestBase.class, "createSender", new Object[] { "ln",
-        2, false, 100, 400, false, false, null, true });
-
-    vm3.invoke(WANCommandTestBase.class, "verifySenderState", new Object[] {
-        "ln", false, false });
-    vm4.invoke(WANCommandTestBase.class, "verifySenderState", new Object[] {
-        "ln", false, false });
-    vm5.invoke(WANCommandTestBase.class, "verifySenderState", new Object[] {
-        "ln", false, false });
+    Integer nyPort = (Integer) vm2.invoke(() -> WANCommandTestBase.createFirstRemoteLocator( 2, punePort ));
+
+    vm3.invoke(() -> WANCommandTestBase.createCacheWithGroups(
+        punePort, "SenderGroup1" ));
+    vm3.invoke(() -> WANCommandTestBase.createSender( "ln",
+        2, false, 100, 400, false, false, null, true ));
+    vm4.invoke(() -> WANCommandTestBase.createCacheWithGroups(
+        punePort, "SenderGroup1" ));
+    vm4.invoke(() -> WANCommandTestBase.createSender( "ln",
+        2, false, 100, 400, false, false, null, true ));
+    vm5.invoke(() -> WANCommandTestBase.createCacheWithGroups(
+        punePort, "SenderGroup1" ));
+    vm5.invoke(() -> WANCommandTestBase.createSender( "ln",
+        2, false, 100, 400, false, false, null, true ));
+
+    vm3.invoke(() -> WANCommandTestBase.verifySenderState(
+        "ln", false, false ));
+    vm4.invoke(() -> WANCommandTestBase.verifySenderState(
+        "ln", false, false ));
+    vm5.invoke(() -> WANCommandTestBase.verifySenderState(
+        "ln", false, false ));
 
     Wait.pause(10000);
     String command = CliStrings.START_GATEWAYSENDER + " --"
@@ -261,12 +246,12 @@ public class WanCommandGatewaySenderStartDUnitTest extends WANCommandTestBase {
       fail("testStartGatewaySender failed as did not get CommandResult");
     }
 
-    vm3.invoke(WANCommandTestBase.class, "verifySenderState", new Object[] {
-        "ln", true, false });
-    vm4.invoke(WANCommandTestBase.class, "verifySenderState", new Object[] {
-        "ln", true, false });
-    vm5.invoke(WANCommandTestBase.class, "verifySenderState", new Object[] {
-        "ln", true, false });
+    vm3.invoke(() -> WANCommandTestBase.verifySenderState(
+        "ln", true, false ));
+    vm4.invoke(() -> WANCommandTestBase.verifySenderState(
+        "ln", true, false ));
+    vm5.invoke(() -> WANCommandTestBase.verifySenderState(
+        "ln", true, false ));
   }
 
   /**
@@ -276,8 +261,7 @@ public class WanCommandGatewaySenderStartDUnitTest extends WANCommandTestBase {
    */
   public void testStartGatewaySender_MultipleGroup() {
 
-    Integer punePort = (Integer) vm1.invoke(WANCommandTestBase.class,
-        "createFirstLocatorWithDSId", new Object[] { 1 });
+    Integer punePort = (Integer) vm1.invoke(() -> WANCommandTestBase.createFirstLocatorWithDSId( 1 ));
 
     Properties props = new Properties();
     props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
@@ -285,40 +269,39 @@ public class WanCommandGatewaySenderStartDUnitTest extends WANCommandTestBase {
     props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + punePort + "]");
     createDefaultSetup(props);
 
-    Integer nyPort = (Integer) vm2.invoke(WANCommandTestBase.class,
-        "createFirstRemoteLocator", new Object[] { 2, punePort });
-
-    vm3.invoke(WANCommandTestBase.class, "createCacheWithGroups", new Object[] {
-        punePort, "SenderGroup1" });
-    vm3.invoke(WANCommandTestBase.class, "createSender", new Object[] { "ln",
-        2, false, 100, 400, false, false, null, true });
-    vm4.invoke(WANCommandTestBase.class, "createCacheWithGroups", new Object[] {
-        punePort, "SenderGroup1" });
-    vm4.invoke(WANCommandTestBase.class, "createSender", new Object[] { "ln",
-        2, false, 100, 400, false, false, null, true });
-    vm5.invoke(WANCommandTestBase.class, "createCacheWithGroups", new Object[] {
-        punePort, "SenderGroup1, SenderGroup2" });
-    vm5.invoke(WANCommandTestBase.class, "createSender", new Object[] { "ln",
-        2, false, 100, 400, false, false, null, true });
-    vm6.invoke(WANCommandTestBase.class, "createCacheWithGroups", new Object[] {
-        punePort, "SenderGroup1, SenderGroup2" });
-    vm6.invoke(WANCommandTestBase.class, "createSender", new Object[] { "ln",
-        2, false, 100, 400, false, false, null, true });
-    vm7.invoke(WANCommandTestBase.class, "createCacheWithGroups", new Object[] {
-        punePort, "SenderGroup3" });
-    vm7.invoke(WANCommandTestBase.class, "createSender", new Object[] { "ln",
-        2, false, 100, 400, false, false, null, true });
-
-    vm3.invoke(WANCommandTestBase.class, "verifySenderState", new Object[] {
-        "ln", false, false });
-    vm4.invoke(WANCommandTestBase.class, "verifySenderState", new Object[] {
-        "ln", false, false });
-    vm5.invoke(WANCommandTestBase.class, "verifySenderState", new Object[] {
-        "ln", false, false });
-    vm6.invoke(WANCommandTestBase.class, "verifySenderState", new Object[] {
-        "ln", false, false });
-    vm7.invoke(WANCommandTestBase.class, "verifySenderState", new Object[] {
-        "ln", false, false });
+    Integer nyPort = (Integer) vm2.invoke(() -> WANCommandTestBase.createFirstRemoteLocator( 2, punePort ));
+
+    vm3.invoke(() -> WANCommandTestBase.createCacheWithGroups(
+        punePort, "SenderGroup1" ));
+    vm3.invoke(() -> WANCommandTestBase.createSender( "ln",
+        2, false, 100, 400, false, false, null, true ));
+    vm4.invoke(() -> WANCommandTestBase.createCacheWithGroups(
+        punePort, "SenderGroup1" ));
+    vm4.invoke(() -> WANCommandTestBase.createSender( "ln",
+        2, false, 100, 400, false, false, null, true ));
+    vm5.invoke(() -> WANCommandTestBase.createCacheWithGroups(
+        punePort, "SenderGroup1, SenderGroup2" ));
+    vm5.invoke(() -> WANCommandTestBase.createSender( "ln",
+        2, false, 100, 400, false, false, null, true ));
+    vm6.invoke(() -> WANCommandTestBase.createCacheWithGroups(
+        punePort, "SenderGroup1, SenderGroup2" ));
+    vm6.invoke(() -> WANCommandTestBase.createSender( "ln",
+        2, false, 100, 400, false, false, null, true ));
+    vm7.invoke(() -> WANCommandTestBase.createCacheWithGroups(
+        punePort, "SenderGroup3" ));
+    vm7.invoke(() -> WANCommandTestBase.createSender( "ln",
+        2, false, 100, 400, false, false, null, true ));
+
+    vm3.invoke(() -> WANCommandTestBase.verifySenderState(
+        "ln", false, false ));
+    vm4.invoke(() -> WANCommandTestBase.verifySenderState(
+        "ln", false, false ));
+    vm5.invoke(() -> WANCommandTestBase.verifySenderState(
+        "ln", false, false ));
+    vm6.invoke(() -> WANCommandTestBase.verifySenderState(
+        "ln", false, false ));
+    vm7.invoke(() -> WANCommandTestBase.verifySenderState(
+        "ln", false, false ));
 
     Wait.pause(10000);
     String command = CliStrings.START_GATEWAYSENDER + " --"
@@ -340,16 +323,16 @@ public class WanCommandGatewaySenderStartDUnitTest extends WANCommandTestBase {
       fail("testStartGatewaySender failed as did not get CommandResult");
     }
 
-    vm3.invoke(WANCommandTestBase.class, "verifySenderState", new Object[] {
-        "ln", true, false });
-    vm4.invoke(WANCommandTestBase.class, "verifySenderState", new Object[] {
-        "ln", true, false });
-    vm5.invoke(WANCommandTestBase.class, "verifySenderState", new Object[] {
-        "ln", true, false });
-    vm6.invoke(WANCommandTestBase.class, "verifySenderState", new Object[] {
-        "ln", true, false });
-    vm7.invoke(WANCommandTestBase.class, "verifySenderState", new Object[] {
-        "ln", false, false });
+    vm3.invoke(() -> WANCommandTestBase.verifySenderState(
+        "ln", true, false ));
+    vm4.invoke(() -> WANCommandTestBase.verifySenderState(
+        "ln", true, false ));
+    vm5.invoke(() -> WANCommandTestBase.verifySenderState(
+        "ln", true, false ));
+    vm6.invoke(() -> WANCommandTestBase.verifySenderState(
+        "ln", true, false ));
+    vm7.invoke(() -> WANCommandTestBase.verifySenderState(
+        "ln", false, false ));
   }
 
   /**
@@ -359,8 +342,7 @@ public class WanCommandGatewaySenderStartDUnitTest extends WANCommandTestBase {
    */
   public void testStartGatewaySender_Group_MissingSenderFromGroup() {
 
-    Integer punePort = (Integer) vm1.invoke(WANCommandTestBase.class,
-        "createFirstLocatorWithDSId", new Object[] { 1 });
+    Integer punePort = (Integer) vm1.invoke(() -> WANCommandTestBase.createFirstLocatorWithDSId( 1 ));
 
     Properties props = new Properties();
     props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
@@ -368,24 +350,23 @@ public class WanCommandGatewaySenderStartDUnitTest extends WANCommandTestBase {
     props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + punePort + "]");
     createDefaultSetup(props);
 
-    Integer nyPort = (Integer) vm2.invoke(WANCommandTestBase.class,
-        "createFirstRemoteLocator", new Object[] { 2, punePort });
-
-    vm3.invoke(WANCommandTestBase.class, "createCacheWithGroups", new Object[] {
-        punePort, "SenderGroup1" });
-    vm3.invoke(WANCommandTestBase.class, "createSender", new Object[] { "ln",
-        2, false, 100, 400, false, false, null, true });
-    vm4.invoke(WANCommandTestBase.class, "createCacheWithGroups", new Object[] {
-        punePort, "SenderGroup1" });
-    vm5.invoke(WANCommandTestBase.class, "createCacheWithGroups", new Object[] {
-        punePort, "SenderGroup1" });
-    vm5.invoke(WANCommandTestBase.class, "createSender", new Object[] { "ln",
-        2, false, 100, 400, false, false, null, true });
-
-    vm3.invoke(WANCommandTestBase.class, "verifySenderState", new Object[] {
-        "ln", false, false });
-    vm5.invoke(WANCommandTestBase.class, "verifySenderState", new Object[] {
-        "ln", false, false });
+    Integer nyPort = (Integer) vm2.invoke(() -> WANCommandTestBase.createFirstRemoteLocator( 2, punePort ));
+
+    vm3.invoke(() -> WANCommandTestBase.createCacheWithGroups(
+        punePort, "SenderGroup1" ));
+    vm3.invoke(() -> WANCommandTestBase.createSender( "ln",
+        2, false, 100, 400, false, false, null, true ));
+    vm4.invoke(() -> WANCommandTestBase.createCacheWithGroups(
+        punePort, "SenderGroup1" ));
+    vm5.invoke(() -> WANCommandTestBase.createCacheWithGroups(
+        punePort, "SenderGroup1" ));
+    vm5.invoke(() -> WANCommandTestBase.createSender( "ln",
+        2, false, 100, 400, false, false, null, true ));
+
+    vm3.invoke(() -> WANCommandTestBase.verifySenderState(
+        "ln", false, false ));
+    vm5.invoke(() -> WANCommandTestBase.verifySenderState(
+        "ln", false, false ));
 
     Wait.pause(10000);
     String command = CliStrings.START_GATEWAYSENDER + " --"
@@ -409,10 +390,10 @@ public class WanCommandGatewaySenderStartDUnitTest extends WANCommandTestBase {
       fail("testStartGatewaySender failed as did not get CommandResult");
     }
 
-    vm3.invoke(WANCommandTestBase.class, "verifySenderState", new Object[] {
-        "ln", true, false });
-    vm5.invoke(WANCommandTestBase.class, "verifySenderState", new Object[] {
-        "ln", true, false });
+    vm3.invoke(() -> WANCommandTestBase.verifySenderState(
+        "ln", true, false ));
+    vm5.invoke(() -> WANCommandTestBase.verifySenderState(
+        "ln", true, false ));
   }
 
 }


Mime
View raw message