geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From upthewatersp...@apache.org
Subject [04/56] [abbrv] incubator-geode git commit: Automatically converting calls of vm.invoke to lambdas
Date Tue, 16 Feb 2016 22:11:24 GMT
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/69024aa9/gemfire-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/serial/SerialWANStatsDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/serial/SerialWANStatsDUnitTest.java b/gemfire-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/serial/SerialWANStatsDUnitTest.java
index 3705610..85aae7f 100644
--- a/gemfire-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/serial/SerialWANStatsDUnitTest.java
+++ b/gemfire-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/serial/SerialWANStatsDUnitTest.java
@@ -46,228 +46,219 @@ public class SerialWANStatsDUnitTest extends WANTestBase {
   }
   
   public void testReplicatedSerialPropagation() throws Exception {
-    Integer lnPort = (Integer)vm0.invoke(WANTestBase.class,
-        "createFirstLocatorWithDSId", new Object[] { 1 });
-    Integer nyPort = (Integer)vm1.invoke(WANTestBase.class,
-        "createFirstRemoteLocator", new Object[] { 2, lnPort });
-
-    vm2.invoke(WANTestBase.class, "createReceiver", new Object[] { nyPort });
-
-    vm4.invoke(WANTestBase.class, "createCache", new Object[] { lnPort });
-    vm5.invoke(WANTestBase.class, "createCache", new Object[] { lnPort });
-    vm6.invoke(WANTestBase.class, "createCache", new Object[] { lnPort });
-    vm7.invoke(WANTestBase.class, "createCache", new Object[] { lnPort });
-
-    vm4.invoke(WANTestBase.class, "createSender", new Object[] { "ln", 2,
-        false, 100, 10, false, false, null, true });
-    vm5.invoke(WANTestBase.class, "createSender", new Object[] { "ln", 2,
-        false, 100, 10, false, false, null, true });
-
-    vm2.invoke(WANTestBase.class, "createReplicatedRegion", new Object[] {
-        testName + "_RR", null, isOffHeap()  });
-
-    vm4.invoke(WANTestBase.class, "startSender", new Object[] { "ln" });
-    vm5.invoke(WANTestBase.class, "startSender", new Object[] { "ln" });
-
-    vm4.invoke(WANTestBase.class, "createReplicatedRegion", new Object[] {
-        testName + "_RR", "ln", isOffHeap()  });
-    vm5.invoke(WANTestBase.class, "createReplicatedRegion", new Object[] {
-        testName + "_RR", "ln", isOffHeap()  });
-    vm6.invoke(WANTestBase.class, "createReplicatedRegion", new Object[] {
-        testName + "_RR", "ln", isOffHeap()  });
-    vm7.invoke(WANTestBase.class, "createReplicatedRegion", new Object[] {
-        testName + "_RR", "ln", isOffHeap()  });
-
-    vm5.invoke(WANTestBase.class, "doPuts", new Object[] { testName + "_RR",
-        1000 });
-
-    vm2.invoke(WANTestBase.class, "validateRegionSize", new Object[] {
-        testName + "_RR", 1000 });
+    Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 ));
+    Integer nyPort = (Integer)vm1.invoke(() -> WANTestBase.createFirstRemoteLocator( 2, lnPort ));
+
+    vm2.invoke(() -> WANTestBase.createReceiver( nyPort ));
+
+    vm4.invoke(() -> WANTestBase.createCache( lnPort ));
+    vm5.invoke(() -> WANTestBase.createCache( lnPort ));
+    vm6.invoke(() -> WANTestBase.createCache( lnPort ));
+    vm7.invoke(() -> WANTestBase.createCache( lnPort ));
+
+    vm4.invoke(() -> WANTestBase.createSender( "ln", 2,
+        false, 100, 10, false, false, null, true ));
+    vm5.invoke(() -> WANTestBase.createSender( "ln", 2,
+        false, 100, 10, false, false, null, true ));
+
+    vm2.invoke(() -> WANTestBase.createReplicatedRegion(
+        testName + "_RR", null, isOffHeap()  ));
+
+    vm4.invoke(() -> WANTestBase.startSender( "ln" ));
+    vm5.invoke(() -> WANTestBase.startSender( "ln" ));
+
+    vm4.invoke(() -> WANTestBase.createReplicatedRegion(
+        testName + "_RR", "ln", isOffHeap()  ));
+    vm5.invoke(() -> WANTestBase.createReplicatedRegion(
+        testName + "_RR", "ln", isOffHeap()  ));
+    vm6.invoke(() -> WANTestBase.createReplicatedRegion(
+        testName + "_RR", "ln", isOffHeap()  ));
+    vm7.invoke(() -> WANTestBase.createReplicatedRegion(
+        testName + "_RR", "ln", isOffHeap()  ));
+
+    vm5.invoke(() -> WANTestBase.doPuts( testName + "_RR",
+        1000 ));
+
+    vm2.invoke(() -> WANTestBase.validateRegionSize(
+        testName + "_RR", 1000 ));
     
     pause(2000);
-    vm2.invoke(WANTestBase.class, "checkGatewayReceiverStats", new Object[] {100, 1000, 1000 });
+    vm2.invoke(() -> WANTestBase.checkGatewayReceiverStats(100, 1000, 1000 ));
     
-    vm4.invoke(WANTestBase.class, "checkQueueStats", new Object[] {"ln",
-      0, 1000, 1000, 1000});
-    vm4.invoke(WANTestBase.class, "checkBatchStats", new Object[] {"ln",
-      100});
+    vm4.invoke(() -> WANTestBase.checkQueueStats("ln",
+      0, 1000, 1000, 1000));
+    vm4.invoke(() -> WANTestBase.checkBatchStats("ln",
+      100));
     
-    vm5.invoke(WANTestBase.class, "checkQueueStats", new Object[] {"ln",
-      0, 1000, 0, 0});
-    vm5.invoke(WANTestBase.class, "checkBatchStats", new Object[] {"ln",
-      0});
+    vm5.invoke(() -> WANTestBase.checkQueueStats("ln",
+      0, 1000, 0, 0));
+    vm5.invoke(() -> WANTestBase.checkBatchStats("ln",
+      0));
     
   }
   
   public void testReplicatedSerialPropagationWithMultipleDispatchers() throws Exception {
-	Integer lnPort = (Integer)vm0.invoke(WANTestBase.class,
-		"createFirstLocatorWithDSId", new Object[] { 1 });
-	Integer nyPort = (Integer)vm1.invoke(WANTestBase.class,
-		"createFirstRemoteLocator", new Object[] { 2, lnPort });
-
-	vm2.invoke(WANTestBase.class, "createReceiver", new Object[] { nyPort });
-
-	vm4.invoke(WANTestBase.class, "createCache", new Object[] { lnPort });
-	vm5.invoke(WANTestBase.class, "createCache", new Object[] { lnPort });
-	vm6.invoke(WANTestBase.class, "createCache", new Object[] { lnPort });
-	vm7.invoke(WANTestBase.class, "createCache", new Object[] { lnPort });
-
-	vm4.invoke(WANTestBase.class, "createSenderWithMultipleDispatchers", new Object[] { "ln", 2,
-		false, 100, 10, false, false, null, true, 2, OrderPolicy.KEY });
-	vm5.invoke(WANTestBase.class, "createSenderWithMultipleDispatchers", new Object[] { "ln", 2,
-		false, 100, 10, false, false, null, true, 2, OrderPolicy.KEY });
-
-	vm2.invoke(WANTestBase.class, "createReplicatedRegion", new Object[] {
-		testName + "_RR", null, isOffHeap()  });
-
-	vm4.invoke(WANTestBase.class, "startSender", new Object[] { "ln" });
-	vm5.invoke(WANTestBase.class, "startSender", new Object[] { "ln" });
-
-	vm4.invoke(WANTestBase.class, "createReplicatedRegion", new Object[] {
-		testName + "_RR", "ln", isOffHeap()  });
-	vm5.invoke(WANTestBase.class, "createReplicatedRegion", new Object[] {
-		testName + "_RR", "ln", isOffHeap()  });
-	vm6.invoke(WANTestBase.class, "createReplicatedRegion", new Object[] {
-		testName + "_RR", "ln", isOffHeap()  });
-	vm7.invoke(WANTestBase.class, "createReplicatedRegion", new Object[] {
-		testName + "_RR", "ln", isOffHeap()  });
-
-	vm5.invoke(WANTestBase.class, "doPuts", new Object[] { testName + "_RR",
-		1000 });
-
-	vm2.invoke(WANTestBase.class, "validateRegionSize", new Object[] {
-		testName + "_RR", 1000 });
+	Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 ));
+	Integer nyPort = (Integer)vm1.invoke(() -> WANTestBase.createFirstRemoteLocator( 2, lnPort ));
+
+	vm2.invoke(() -> WANTestBase.createReceiver( nyPort ));
+
+	vm4.invoke(() -> WANTestBase.createCache( lnPort ));
+	vm5.invoke(() -> WANTestBase.createCache( lnPort ));
+	vm6.invoke(() -> WANTestBase.createCache( lnPort ));
+	vm7.invoke(() -> WANTestBase.createCache( lnPort ));
+
+	vm4.invoke(() -> WANTestBase.createSenderWithMultipleDispatchers( "ln", 2,
+		false, 100, 10, false, false, null, true, 2, OrderPolicy.KEY ));
+	vm5.invoke(() -> WANTestBase.createSenderWithMultipleDispatchers( "ln", 2,
+		false, 100, 10, false, false, null, true, 2, OrderPolicy.KEY ));
+
+	vm2.invoke(() -> WANTestBase.createReplicatedRegion(
+		testName + "_RR", null, isOffHeap()  ));
+
+	vm4.invoke(() -> WANTestBase.startSender( "ln" ));
+	vm5.invoke(() -> WANTestBase.startSender( "ln" ));
+
+	vm4.invoke(() -> WANTestBase.createReplicatedRegion(
+		testName + "_RR", "ln", isOffHeap()  ));
+	vm5.invoke(() -> WANTestBase.createReplicatedRegion(
+		testName + "_RR", "ln", isOffHeap()  ));
+	vm6.invoke(() -> WANTestBase.createReplicatedRegion(
+		testName + "_RR", "ln", isOffHeap()  ));
+	vm7.invoke(() -> WANTestBase.createReplicatedRegion(
+		testName + "_RR", "ln", isOffHeap()  ));
+
+	vm5.invoke(() -> WANTestBase.doPuts( testName + "_RR",
+		1000 ));
+
+	vm2.invoke(() -> WANTestBase.validateRegionSize(
+		testName + "_RR", 1000 ));
 	    
 	pause(2000);
-	vm2.invoke(WANTestBase.class, "checkGatewayReceiverStats", new Object[] {100, 1000, 1000 });
+	vm2.invoke(() -> WANTestBase.checkGatewayReceiverStats(100, 1000, 1000 ));
 	    
-	vm4.invoke(WANTestBase.class, "checkQueueStats", new Object[] {"ln",
-		0, 1000, 1000, 1000});
-	vm4.invoke(WANTestBase.class, "checkBatchStats", new Object[] {"ln",
-		100});
+	vm4.invoke(() -> WANTestBase.checkQueueStats("ln",
+		0, 1000, 1000, 1000));
+	vm4.invoke(() -> WANTestBase.checkBatchStats("ln",
+		100));
 	    
-	vm5.invoke(WANTestBase.class, "checkQueueStats", new Object[] {"ln",
-		0, 1000, 0, 0});
-	vm5.invoke(WANTestBase.class, "checkBatchStats", new Object[] {"ln",
-		0});
+	vm5.invoke(() -> WANTestBase.checkQueueStats("ln",
+		0, 1000, 0, 0));
+	vm5.invoke(() -> WANTestBase.checkBatchStats("ln",
+		0));
 	    
 	  }
   
   public void testWANStatsTwoWanSites() throws Exception {
 
     Integer lnPort = createFirstLocatorWithDSId(1);
-    Integer nyPort = (Integer)vm0.invoke(WANTestBase.class,
-        "createFirstRemoteLocator", new Object[] { 2, lnPort });
-    Integer tkPort = (Integer)vm1.invoke(WANTestBase.class,
-        "createFirstRemoteLocator", new Object[] { 3, lnPort });
-
-    vm2.invoke(WANTestBase.class, "createReceiver", new Object[] { nyPort });
-    vm3.invoke(WANTestBase.class, "createReceiver", new Object[] { tkPort });
-
-    vm4.invoke(WANTestBase.class, "createCache", new Object[] {lnPort });
-    vm5.invoke(WANTestBase.class, "createCache", new Object[] {lnPort });
-    vm6.invoke(WANTestBase.class, "createCache", new Object[] {lnPort });
-    vm7.invoke(WANTestBase.class, "createCache", new Object[] {lnPort });
-
-    vm4.invoke(WANTestBase.class, "createSender", new Object[] { "lnSerial1",
-        2, false, 100, 10, false, false, null, true });
-    vm5.invoke(WANTestBase.class, "createSender", new Object[] { "lnSerial1",
-        2, false, 100, 10, false, false, null, true });
-
-    vm4.invoke(WANTestBase.class, "createSender", new Object[] { "lnSerial2",
-        3, false, 100, 10, false, false, null, true });
-    vm5.invoke(WANTestBase.class, "createSender", new Object[] { "lnSerial2",
-        3, false, 100, 10, false, false, null, true });
-
-    vm2.invoke(WANTestBase.class, "createReplicatedRegion", new Object[] {
-        testName + "_RR", null, isOffHeap()  });
-    vm3.invoke(WANTestBase.class, "createReplicatedRegion", new Object[] {
-        testName + "_RR", null, isOffHeap()  });
-
-    vm4.invoke(WANTestBase.class, "startSender", new Object[] { "lnSerial1" });
-    vm5.invoke(WANTestBase.class, "startSender", new Object[] { "lnSerial1" });
-
-    vm4.invoke(WANTestBase.class, "startSender", new Object[] { "lnSerial2" });
-    vm5.invoke(WANTestBase.class, "startSender", new Object[] { "lnSerial2" });
-
-    vm4.invoke(WANTestBase.class, "createReplicatedRegion", new Object[] {
-        testName + "_RR", "lnSerial1,lnSerial2", isOffHeap()  });
-    vm5.invoke(WANTestBase.class, "createReplicatedRegion", new Object[] {
-        testName + "_RR", "lnSerial1,lnSerial2", isOffHeap()  });
-    vm6.invoke(WANTestBase.class, "createReplicatedRegion", new Object[] {
-        testName + "_RR", "lnSerial1,lnSerial2", isOffHeap()  });
-    vm7.invoke(WANTestBase.class, "createReplicatedRegion", new Object[] {
-        testName + "_RR", "lnSerial1,lnSerial2", isOffHeap()  });
-
-    vm4.invoke(WANTestBase.class, "doPuts", new Object[] { testName + "_RR",
-        1000 });
-
-    vm2.invoke(WANTestBase.class, "validateRegionSize", new Object[] {
-        testName + "_RR", 1000 });
-    vm3.invoke(WANTestBase.class, "validateRegionSize", new Object[] {
-        testName + "_RR", 1000 });
+    Integer nyPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstRemoteLocator( 2, lnPort ));
+    Integer tkPort = (Integer)vm1.invoke(() -> WANTestBase.createFirstRemoteLocator( 3, lnPort ));
+
+    vm2.invoke(() -> WANTestBase.createReceiver( nyPort ));
+    vm3.invoke(() -> WANTestBase.createReceiver( tkPort ));
+
+    vm4.invoke(() -> WANTestBase.createCache(lnPort ));
+    vm5.invoke(() -> WANTestBase.createCache(lnPort ));
+    vm6.invoke(() -> WANTestBase.createCache(lnPort ));
+    vm7.invoke(() -> WANTestBase.createCache(lnPort ));
+
+    vm4.invoke(() -> WANTestBase.createSender( "lnSerial1",
+        2, false, 100, 10, false, false, null, true ));
+    vm5.invoke(() -> WANTestBase.createSender( "lnSerial1",
+        2, false, 100, 10, false, false, null, true ));
+
+    vm4.invoke(() -> WANTestBase.createSender( "lnSerial2",
+        3, false, 100, 10, false, false, null, true ));
+    vm5.invoke(() -> WANTestBase.createSender( "lnSerial2",
+        3, false, 100, 10, false, false, null, true ));
+
+    vm2.invoke(() -> WANTestBase.createReplicatedRegion(
+        testName + "_RR", null, isOffHeap()  ));
+    vm3.invoke(() -> WANTestBase.createReplicatedRegion(
+        testName + "_RR", null, isOffHeap()  ));
+
+    vm4.invoke(() -> WANTestBase.startSender( "lnSerial1" ));
+    vm5.invoke(() -> WANTestBase.startSender( "lnSerial1" ));
+
+    vm4.invoke(() -> WANTestBase.startSender( "lnSerial2" ));
+    vm5.invoke(() -> WANTestBase.startSender( "lnSerial2" ));
+
+    vm4.invoke(() -> WANTestBase.createReplicatedRegion(
+        testName + "_RR", "lnSerial1,lnSerial2", isOffHeap()  ));
+    vm5.invoke(() -> WANTestBase.createReplicatedRegion(
+        testName + "_RR", "lnSerial1,lnSerial2", isOffHeap()  ));
+    vm6.invoke(() -> WANTestBase.createReplicatedRegion(
+        testName + "_RR", "lnSerial1,lnSerial2", isOffHeap()  ));
+    vm7.invoke(() -> WANTestBase.createReplicatedRegion(
+        testName + "_RR", "lnSerial1,lnSerial2", isOffHeap()  ));
+
+    vm4.invoke(() -> WANTestBase.doPuts( testName + "_RR",
+        1000 ));
+
+    vm2.invoke(() -> WANTestBase.validateRegionSize(
+        testName + "_RR", 1000 ));
+    vm3.invoke(() -> WANTestBase.validateRegionSize(
+        testName + "_RR", 1000 ));
     
     pause(2000);
-    vm2.invoke(WANTestBase.class, "checkGatewayReceiverStats", new Object[] {100, 1000, 1000 });
-    vm3.invoke(WANTestBase.class, "checkGatewayReceiverStats", new Object[] {100, 1000, 1000 });
+    vm2.invoke(() -> WANTestBase.checkGatewayReceiverStats(100, 1000, 1000 ));
+    vm3.invoke(() -> WANTestBase.checkGatewayReceiverStats(100, 1000, 1000 ));
     
-    vm4.invoke(WANTestBase.class, "checkQueueStats", new Object[] {"lnSerial1",
-      0, 1000, 1000, 1000});
-    vm4.invoke(WANTestBase.class, "checkBatchStats", new Object[] {"lnSerial1",
-      100});
-    vm4.invoke(WANTestBase.class, "checkQueueStats", new Object[] {"lnSerial2",
-      0, 1000, 1000, 1000});
-    vm4.invoke(WANTestBase.class, "checkBatchStats", new Object[] {"lnSerial2",
-      100});
-    vm5.invoke(WANTestBase.class, "checkQueueStats", new Object[] {"lnSerial1",
-      0, 1000, 0, 0});
-    vm5.invoke(WANTestBase.class, "checkBatchStats", new Object[] {"lnSerial1",
-      0});
-    vm5.invoke(WANTestBase.class, "checkQueueStats", new Object[] {"lnSerial2",
-      0, 1000, 0, 0});
-    vm5.invoke(WANTestBase.class, "checkBatchStats", new Object[] {"lnSerial2",
-      0});
+    vm4.invoke(() -> WANTestBase.checkQueueStats("lnSerial1",
+      0, 1000, 1000, 1000));
+    vm4.invoke(() -> WANTestBase.checkBatchStats("lnSerial1",
+      100));
+    vm4.invoke(() -> WANTestBase.checkQueueStats("lnSerial2",
+      0, 1000, 1000, 1000));
+    vm4.invoke(() -> WANTestBase.checkBatchStats("lnSerial2",
+      100));
+    vm5.invoke(() -> WANTestBase.checkQueueStats("lnSerial1",
+      0, 1000, 0, 0));
+    vm5.invoke(() -> WANTestBase.checkBatchStats("lnSerial1",
+      0));
+    vm5.invoke(() -> WANTestBase.checkQueueStats("lnSerial2",
+      0, 1000, 0, 0));
+    vm5.invoke(() -> WANTestBase.checkBatchStats("lnSerial2",
+      0));
     
   }
 
   public void testReplicatedSerialPropagationHA() throws Exception {
 
-    Integer lnPort = (Integer)vm0.invoke(WANTestBase.class,
-        "createFirstLocatorWithDSId", new Object[] { 1 });
-    Integer nyPort = (Integer)vm1.invoke(WANTestBase.class,
-        "createFirstRemoteLocator", new Object[] { 2, lnPort });
+    Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 ));
+    Integer nyPort = (Integer)vm1.invoke(() -> WANTestBase.createFirstRemoteLocator( 2, lnPort ));
 
-    vm2.invoke(WANTestBase.class, "createReceiver", new Object[] { nyPort });
+    vm2.invoke(() -> WANTestBase.createReceiver( nyPort ));
 
-    vm4.invoke(WANTestBase.class, "createCache", new Object[] {lnPort });
-    vm5.invoke(WANTestBase.class, "createCache", new Object[] {lnPort });
-    vm6.invoke(WANTestBase.class, "createCache", new Object[] {lnPort });
-    vm7.invoke(WANTestBase.class, "createCache", new Object[] {lnPort });
+    vm4.invoke(() -> WANTestBase.createCache(lnPort ));
+    vm5.invoke(() -> WANTestBase.createCache(lnPort ));
+    vm6.invoke(() -> WANTestBase.createCache(lnPort ));
+    vm7.invoke(() -> WANTestBase.createCache(lnPort ));
 
-    vm4.invoke(WANTestBase.class, "createSender", new Object[] { "ln", 2,
-        false, 100, 10, false, false, null, true });
-    vm5.invoke(WANTestBase.class, "createSender", new Object[] { "ln", 2,
-        false, 100, 10, false, false, null, true });
+    vm4.invoke(() -> WANTestBase.createSender( "ln", 2,
+        false, 100, 10, false, false, null, true ));
+    vm5.invoke(() -> WANTestBase.createSender( "ln", 2,
+        false, 100, 10, false, false, null, true ));
     
-    vm2.invoke(WANTestBase.class, "createReplicatedRegion", new Object[] {
-        testName + "_RR", null, isOffHeap()  });
-
-    vm4.invoke(WANTestBase.class, "startSender", new Object[] { "ln" });
-    vm5.invoke(WANTestBase.class, "startSender", new Object[] { "ln" });
-
-    vm4.invoke(WANTestBase.class, "createReplicatedRegion", new Object[] {
-        testName + "_RR", "ln", isOffHeap()  });
-    vm5.invoke(WANTestBase.class, "createReplicatedRegion", new Object[] {
-        testName + "_RR", "ln", isOffHeap()  });
-    vm6.invoke(WANTestBase.class, "createReplicatedRegion", new Object[] {
-        testName + "_RR", "ln", isOffHeap()  });
-    vm7.invoke(WANTestBase.class, "createReplicatedRegion", new Object[] {
-        testName + "_RR", "ln", isOffHeap()  });
+    vm2.invoke(() -> WANTestBase.createReplicatedRegion(
+        testName + "_RR", null, isOffHeap()  ));
+
+    vm4.invoke(() -> WANTestBase.startSender( "ln" ));
+    vm5.invoke(() -> WANTestBase.startSender( "ln" ));
+
+    vm4.invoke(() -> WANTestBase.createReplicatedRegion(
+        testName + "_RR", "ln", isOffHeap()  ));
+    vm5.invoke(() -> WANTestBase.createReplicatedRegion(
+        testName + "_RR", "ln", isOffHeap()  ));
+    vm6.invoke(() -> WANTestBase.createReplicatedRegion(
+        testName + "_RR", "ln", isOffHeap()  ));
+    vm7.invoke(() -> WANTestBase.createReplicatedRegion(
+        testName + "_RR", "ln", isOffHeap()  ));
     
-    AsyncInvocation inv1 = vm5.invokeAsync(WANTestBase.class, "doPuts",
-        new Object[] { testName + "_RR", 10000 });
+    AsyncInvocation inv1 = vm5.invokeAsync(() -> WANTestBase.doPuts( testName + "_RR", 10000 ));
     pause(2000);
-    AsyncInvocation inv2 = vm4.invokeAsync(WANTestBase.class, "killSender", new Object[] { "ln" });
+    AsyncInvocation inv2 = vm4.invokeAsync(() -> WANTestBase.killSender( "ln" ));
     Boolean isKilled = Boolean.FALSE;
     try {
       isKilled = (Boolean)inv2.getResult();
@@ -277,103 +268,101 @@ public class SerialWANStatsDUnitTest extends WANTestBase {
     }
     AsyncInvocation inv3 = null; 
     if(!isKilled){
-      inv3 = vm5.invokeAsync(WANTestBase.class, "killSender", new Object[] { "ln" });
+      inv3 = vm5.invokeAsync(() -> WANTestBase.killSender( "ln" ));
       inv3.join();
     }
     inv1.join();
     inv2.join();
     
-    vm2.invoke(WANTestBase.class, "validateRegionSize", new Object[] {
-        testName + "_RR", 10000 });
+    vm2.invoke(() -> WANTestBase.validateRegionSize(
+        testName + "_RR", 10000 ));
   
-    vm2.invoke(WANTestBase.class, "checkGatewayReceiverStatsHA", new Object[] {1000, 10000, 10000 });
+    vm2.invoke(() -> WANTestBase.checkGatewayReceiverStatsHA(1000, 10000, 10000 ));
     
-    vm5.invoke(WANTestBase.class, "checkStats_Failover", new Object[] {"ln", 10000});
+    vm5.invoke(() -> WANTestBase.checkStats_Failover("ln", 10000));
   }
   
   public void testReplicatedSerialPropagationUNPorcessedEvents() throws Exception {
-    Integer lnPort = (Integer)vm0.invoke(WANTestBase.class,
-        "createFirstLocatorWithDSId", new Object[] { 1 });
-    Integer nyPort = (Integer)vm1.invoke(WANTestBase.class,
-        "createFirstRemoteLocator", new Object[] { 2, lnPort });
+    Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 ));
+    Integer nyPort = (Integer)vm1.invoke(() -> WANTestBase.createFirstRemoteLocator( 2, lnPort ));
 
     //these are part of remote site
-    vm2.invoke(WANTestBase.class, "createReceiver", new Object[] { nyPort });
-    vm3.invoke(WANTestBase.class, "createReceiver", new Object[] { nyPort });
+    vm2.invoke(() -> WANTestBase.createReceiver( nyPort ));
+    vm3.invoke(() -> WANTestBase.createReceiver( nyPort ));
 
     //these are part of local site
-    vm4.invoke(WANTestBase.class, "createCache", new Object[] { lnPort });
-    vm5.invoke(WANTestBase.class, "createCache", new Object[] { lnPort });
-    vm6.invoke(WANTestBase.class, "createCache", new Object[] { lnPort });
-    vm7.invoke(WANTestBase.class, "createCache", new Object[] { lnPort });
+    vm4.invoke(() -> WANTestBase.createCache( lnPort ));
+    vm5.invoke(() -> WANTestBase.createCache( lnPort ));
+    vm6.invoke(() -> WANTestBase.createCache( lnPort ));
+    vm7.invoke(() -> WANTestBase.createCache( lnPort ));
 
     //senders are created on local site
-    vm4.invoke(WANTestBase.class, "createSender", new Object[] { "ln", 2,
-        false, 100, 20, false, false, null, true });
-    vm5.invoke(WANTestBase.class, "createSender", new Object[] { "ln", 2,
-        false, 100, 20, false, false, null, true });
+    vm4.invoke(() -> WANTestBase.createSender( "ln", 2,
+        false, 100, 20, false, false, null, true ));
+    vm5.invoke(() -> WANTestBase.createSender( "ln", 2,
+        false, 100, 20, false, false, null, true ));
 
     //create one RR (RR_1) on remote site
-    vm2.invoke(WANTestBase.class, "createReplicatedRegion", new Object[] {
-        testName + "_RR_1", null, isOffHeap()  });
-    vm3.invoke(WANTestBase.class, "createReplicatedRegion", new Object[] {
-        testName + "_RR_1", null, isOffHeap()  });
+    vm2.invoke(() -> WANTestBase.createReplicatedRegion(
+        testName + "_RR_1", null, isOffHeap()  ));
+    vm3.invoke(() -> WANTestBase.createReplicatedRegion(
+        testName + "_RR_1", null, isOffHeap()  ));
 
     //create another RR (RR_2) on remote site
-    vm2.invoke(WANTestBase.class, "createReplicatedRegion", new Object[] {
-        testName + "_RR_2", null, isOffHeap()  });
-    vm3.invoke(WANTestBase.class, "createReplicatedRegion", new Object[] {
-        testName + "_RR_2", null, isOffHeap()  });
+    vm2.invoke(() -> WANTestBase.createReplicatedRegion(
+        testName + "_RR_2", null, isOffHeap()  ));
+    vm3.invoke(() -> WANTestBase.createReplicatedRegion(
+        testName + "_RR_2", null, isOffHeap()  ));
     
     //start the senders on local site
-    vm4.invoke(WANTestBase.class, "startSender", new Object[] { "ln" });
-    vm5.invoke(WANTestBase.class, "startSender", new Object[] { "ln" });
+    vm4.invoke(() -> WANTestBase.startSender( "ln" ));
+    vm5.invoke(() -> WANTestBase.startSender( "ln" ));
 
     //create one RR (RR_1) on local site
-    vm4.invoke(WANTestBase.class, "createReplicatedRegion", new Object[] {
-        testName + "_RR_1", "ln", isOffHeap()  });
-    vm5.invoke(WANTestBase.class, "createReplicatedRegion", new Object[] {
-        testName + "_RR_1", "ln", isOffHeap()  });
-    vm6.invoke(WANTestBase.class, "createReplicatedRegion", new Object[] {
-        testName + "_RR_1", "ln", isOffHeap()  });
-    vm7.invoke(WANTestBase.class, "createReplicatedRegion", new Object[] {
-        testName + "_RR_1", "ln", isOffHeap()  });
+    vm4.invoke(() -> WANTestBase.createReplicatedRegion(
+        testName + "_RR_1", "ln", isOffHeap()  ));
+    vm5.invoke(() -> WANTestBase.createReplicatedRegion(
+        testName + "_RR_1", "ln", isOffHeap()  ));
+    vm6.invoke(() -> WANTestBase.createReplicatedRegion(
+        testName + "_RR_1", "ln", isOffHeap()  ));
+    vm7.invoke(() -> WANTestBase.createReplicatedRegion(
+        testName + "_RR_1", "ln", isOffHeap()  ));
 
     //create another RR (RR_2) on local site
-    vm4.invoke(WANTestBase.class, "createReplicatedRegion", new Object[] {
-        testName + "_RR_2", "ln", isOffHeap()  });
-    vm5.invoke(WANTestBase.class, "createReplicatedRegion", new Object[] {
-        testName + "_RR_2", "ln", isOffHeap()  });
-    vm6.invoke(WANTestBase.class, "createReplicatedRegion", new Object[] {
-        testName + "_RR_2", "ln", isOffHeap()  });
-    vm7.invoke(WANTestBase.class, "createReplicatedRegion", new Object[] {
-        testName + "_RR_2", "ln", isOffHeap()  });
+    vm4.invoke(() -> WANTestBase.createReplicatedRegion(
+        testName + "_RR_2", "ln", isOffHeap()  ));
+    vm5.invoke(() -> WANTestBase.createReplicatedRegion(
+        testName + "_RR_2", "ln", isOffHeap()  ));
+    vm6.invoke(() -> WANTestBase.createReplicatedRegion(
+        testName + "_RR_2", "ln", isOffHeap()  ));
+    vm7.invoke(() -> WANTestBase.createReplicatedRegion(
+        testName + "_RR_2", "ln", isOffHeap()  ));
     
     //start puts in RR_1 in another thread
-    vm4.invoke(WANTestBase.class, "doPuts", new Object[] { testName + "_RR_1", 1000 });
+    vm4.invoke(() -> WANTestBase.doPuts( testName + "_RR_1", 1000 ));
     //do puts in RR_2 in main thread
-    vm4.invoke(WANTestBase.class, "doPuts", new Object[] { testName + "_RR_2", 500 });
+    vm4.invoke(() -> WANTestBase.doPuts( testName + "_RR_2", 500 ));
     //sleep for some time to let all the events propagate to remote site
     Thread.sleep(20);
-    //vm4.invoke(WANTestBase.class, "verifyQueueSize", new Object[] { "ln", 0 });
-    vm2.invoke(WANTestBase.class, "validateRegionSize", new Object[] {
-        testName + "_RR_1", 1000 });
-    vm3.invoke(WANTestBase.class, "validateRegionSize", new Object[] {
-        testName + "_RR_2", 500 });
+    //vm4.invoke(() -> WANTestBase.verifyQueueSize( "ln", 0 ));
+    vm2.invoke(() -> WANTestBase.validateRegionSize(
+        testName + "_RR_1", 1000 ));
+    vm3.invoke(() -> WANTestBase.validateRegionSize(
+        testName + "_RR_2", 500 ));
     
     pause(2000);
-    vm4.invoke(WANTestBase.class, "checkQueueStats", new Object[] {"ln",
-      0, 1500, 1500, 1500});
-    vm4.invoke(WANTestBase.class, "checkBatchStats", new Object[] {"ln",
-      75});
-    vm4.invoke(WANTestBase.class, "checkUnProcessedStats", new Object[] {"ln", 0});
+    vm4.invoke(() -> WANTestBase.checkQueueStats("ln",
+      0, 1500, 1500, 1500));
+    vm4.invoke(() -> WANTestBase.checkBatchStats("ln",
+      75));
+    vm4.invoke(() -> WANTestBase.checkUnProcessedStats("ln", 0));
     
     
-    vm5.invoke(WANTestBase.class, "checkQueueStats", new Object[] {"ln",
-      0, 1500, 0, 0});
-    vm5.invoke(WANTestBase.class, "checkBatchStats", new Object[] {"ln",
-      0});
-    vm5.invoke(WANTestBase.class, "checkUnProcessedStats", new Object[] {"ln", 1500});
+    vm5.invoke(() -> WANTestBase.checkQueueStats("ln",
+      0, 1500, 0, 0));
+    vm5.invoke(() -> WANTestBase.checkBatchStats("ln",
+      0));
+    vm5.invoke(() -> WANTestBase.checkUnProcessedStats("ln", 1500));
   }
   
   /**
@@ -387,48 +376,46 @@ public class SerialWANStatsDUnitTest extends WANTestBase {
    * @throws Exception
    */
   public void testReplicatedSerialPropagationWithRemoteRegionDestroy() throws Exception {
-    Integer lnPort = (Integer)vm0.invoke(WANTestBase.class,
-        "createFirstLocatorWithDSId", new Object[] { 1 });
-    Integer nyPort = (Integer)vm1.invoke(WANTestBase.class,
-        "createFirstRemoteLocator", new Object[] { 2, lnPort });
+    Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 ));
+    Integer nyPort = (Integer)vm1.invoke(() -> WANTestBase.createFirstRemoteLocator( 2, lnPort ));
 
     //these are part of remote site
-    vm2.invoke(WANTestBase.class, "createReceiver", new Object[] { nyPort });
+    vm2.invoke(() -> WANTestBase.createReceiver( nyPort ));
 
     //these are part of local site
-    vm4.invoke(WANTestBase.class, "createCache", new Object[] { lnPort });
-    vm5.invoke(WANTestBase.class, "createCache", new Object[] { lnPort });
-    vm6.invoke(WANTestBase.class, "createCache", new Object[] { lnPort });
-    vm7.invoke(WANTestBase.class, "createCache", new Object[] { lnPort });
+    vm4.invoke(() -> WANTestBase.createCache( lnPort ));
+    vm5.invoke(() -> WANTestBase.createCache( lnPort ));
+    vm6.invoke(() -> WANTestBase.createCache( lnPort ));
+    vm7.invoke(() -> WANTestBase.createCache( lnPort ));
 
     //senders are created on local site
-    vm4.invoke(WANTestBase.class, "createSender", new Object[] { "ln", 2,
-        false, 100, 100, false, false, null, true });
-    vm5.invoke(WANTestBase.class, "createSender", new Object[] { "ln", 2,
-        false, 100, 100, false, false, null, true });
+    vm4.invoke(() -> WANTestBase.createSender( "ln", 2,
+        false, 100, 100, false, false, null, true ));
+    vm5.invoke(() -> WANTestBase.createSender( "ln", 2,
+        false, 100, 100, false, false, null, true ));
 
     //create one RR (RR_1) on remote site
-    vm2.invoke(WANTestBase.class, "createReplicatedRegion", new Object[] {
-        testName + "_RR_1", null, isOffHeap()  });
+    vm2.invoke(() -> WANTestBase.createReplicatedRegion(
+        testName + "_RR_1", null, isOffHeap()  ));
 
     //start the senders on local site
-    vm4.invoke(WANTestBase.class, "startSender", new Object[] { "ln" });
-    vm5.invoke(WANTestBase.class, "startSender", new Object[] { "ln" });
+    vm4.invoke(() -> WANTestBase.startSender( "ln" ));
+    vm5.invoke(() -> WANTestBase.startSender( "ln" ));
 
     //create one RR (RR_1) on local site
-    vm4.invoke(WANTestBase.class, "createReplicatedRegion", new Object[] {
-        testName + "_RR_1", "ln", isOffHeap()  });
-    vm5.invoke(WANTestBase.class, "createReplicatedRegion", new Object[] {
-        testName + "_RR_1", "ln", isOffHeap()  });
-    vm6.invoke(WANTestBase.class, "createReplicatedRegion", new Object[] {
-        testName + "_RR_1", "ln", isOffHeap()  });
-    vm7.invoke(WANTestBase.class, "createReplicatedRegion", new Object[] {
-        testName + "_RR_1", "ln", isOffHeap()  });
+    vm4.invoke(() -> WANTestBase.createReplicatedRegion(
+        testName + "_RR_1", "ln", isOffHeap()  ));
+    vm5.invoke(() -> WANTestBase.createReplicatedRegion(
+        testName + "_RR_1", "ln", isOffHeap()  ));
+    vm6.invoke(() -> WANTestBase.createReplicatedRegion(
+        testName + "_RR_1", "ln", isOffHeap()  ));
+    vm7.invoke(() -> WANTestBase.createReplicatedRegion(
+        testName + "_RR_1", "ln", isOffHeap()  ));
 
     //start puts in RR_1 in another thread
-    AsyncInvocation inv1 = vm4.invokeAsync(WANTestBase.class, "doPuts", new Object[] { testName + "_RR_1", 20000 });
+    AsyncInvocation inv1 = vm4.invokeAsync(() -> WANTestBase.doPuts( testName + "_RR_1", 20000 ));
     //destroy RR_1 in remote site
-    vm2.invoke(WANTestBase.class, "destroyRegion", new Object[] { testName + "_RR_1", 500});
+    vm2.invoke(() -> WANTestBase.destroyRegion( testName + "_RR_1", 500));
     
     try {
       inv1.join();
@@ -438,117 +425,113 @@ public class SerialWANStatsDUnitTest extends WANTestBase {
     }
 
     //verify that all is well in local site. All the events should be present in local region
-    vm4.invoke(WANTestBase.class, "validateRegionSize", new Object[] {
-        testName + "_RR_1", 20000 });
+    vm4.invoke(() -> WANTestBase.validateRegionSize(
+        testName + "_RR_1", 20000 ));
     //assuming some events might have been dispatched before the remote region was destroyed,
     //sender's region queue will have events less than 1000 but the queue will not be empty.
     //NOTE: this much verification might be sufficient in DUnit. Hydra will take care of 
     //more in depth validations.
-    vm4.invoke(WANTestBase.class, "verifyRegionQueueNotEmpty", new Object[] {"ln" });
+    vm4.invoke(() -> WANTestBase.verifyRegionQueueNotEmpty("ln" ));
     
-    vm4.invoke(WANTestBase.class, "checkBatchStats", new Object[] {"ln", true, true});
+    vm4.invoke(() -> WANTestBase.checkBatchStats("ln", true, true));
     
-    vm5.invoke(WANTestBase.class, "checkUnProcessedStats", new Object[] {"ln", 20000});
+    vm5.invoke(() -> WANTestBase.checkUnProcessedStats("ln", 20000));
     
-    vm2.invoke(WANTestBase.class, "checkExcepitonStats", new Object[] {1});
+    vm2.invoke(() -> WANTestBase.checkExcepitonStats(1));
     
   }
   
   public void testSerialPropogationWithFilter() throws Exception {
 
-    Integer lnPort = (Integer)vm0.invoke(WANTestBase.class, "createFirstLocatorWithDSId",
-        new Object[] {1});
-    Integer nyPort = (Integer)vm1.invoke(WANTestBase.class,
-        "createFirstRemoteLocator", new Object[] {2,lnPort });
+    Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId(1));
+    Integer nyPort = (Integer)vm1.invoke(() -> WANTestBase.createFirstRemoteLocator(2,lnPort ));
 
-    vm2.invoke(WANTestBase.class, "createReceiver", new Object[] { nyPort });
-    vm3.invoke(WANTestBase.class, "createReceiver", new Object[] { nyPort });
+    vm2.invoke(() -> WANTestBase.createReceiver( nyPort ));
+    vm3.invoke(() -> WANTestBase.createReceiver( nyPort ));
 
-    vm4.invoke(WANTestBase.class, "createCache", new Object[] {lnPort });
-    vm5.invoke(WANTestBase.class, "createCache", new Object[] {lnPort });
-    vm6.invoke(WANTestBase.class, "createCache", new Object[] {lnPort });
-    vm7.invoke(WANTestBase.class, "createCache", new Object[] {lnPort });
+    vm4.invoke(() -> WANTestBase.createCache(lnPort ));
+    vm5.invoke(() -> WANTestBase.createCache(lnPort ));
+    vm6.invoke(() -> WANTestBase.createCache(lnPort ));
+    vm7.invoke(() -> WANTestBase.createCache(lnPort ));
 
-    vm4.invoke(WANTestBase.class, "createSender", new Object[] { "ln", 2,
+    vm4.invoke(() -> WANTestBase.createSender( "ln", 2,
         false, 100, 10, false, false,
-        new MyGatewayEventFilter(), true });
-    vm5.invoke(WANTestBase.class, "createSender", new Object[] { "ln", 2,
+        new MyGatewayEventFilter(), true ));
+    vm5.invoke(() -> WANTestBase.createSender( "ln", 2,
         false, 100, 10, false, false,
-        new MyGatewayEventFilter(), true });
+        new MyGatewayEventFilter(), true ));
 
-    vm4.invoke(WANTestBase.class, "createPartitionedRegion", new Object[] {
-        testName, "ln", 1, 100, isOffHeap()  });
-    vm5.invoke(WANTestBase.class, "createPartitionedRegion", new Object[] {
-        testName, "ln", 1, 100, isOffHeap()  });
-    vm6.invoke(WANTestBase.class, "createPartitionedRegion", new Object[] {
-        testName, "ln", 1, 100, isOffHeap()  });
-    vm7.invoke(WANTestBase.class, "createPartitionedRegion", new Object[] {
-        testName, "ln", 1, 100, isOffHeap()  });
+    vm4.invoke(() -> WANTestBase.createPartitionedRegion(
+        testName, "ln", 1, 100, isOffHeap()  ));
+    vm5.invoke(() -> WANTestBase.createPartitionedRegion(
+        testName, "ln", 1, 100, isOffHeap()  ));
+    vm6.invoke(() -> WANTestBase.createPartitionedRegion(
+        testName, "ln", 1, 100, isOffHeap()  ));
+    vm7.invoke(() -> WANTestBase.createPartitionedRegion(
+        testName, "ln", 1, 100, isOffHeap()  ));
 
-    vm4.invoke(WANTestBase.class, "startSender", new Object[] { "ln" });
-    vm5.invoke(WANTestBase.class, "startSender", new Object[] { "ln" });
+    vm4.invoke(() -> WANTestBase.startSender( "ln" ));
+    vm5.invoke(() -> WANTestBase.startSender( "ln" ));
 
-    vm2.invoke(WANTestBase.class, "createPartitionedRegion", new Object[] {
-        testName, null, 1, 100, isOffHeap()  });
-    vm3.invoke(WANTestBase.class, "createPartitionedRegion", new Object[] {
-        testName, null, 1, 100, isOffHeap()  });
+    vm2.invoke(() -> WANTestBase.createPartitionedRegion(
+        testName, null, 1, 100, isOffHeap()  ));
+    vm3.invoke(() -> WANTestBase.createPartitionedRegion(
+        testName, null, 1, 100, isOffHeap()  ));
 
-    vm4.invoke(WANTestBase.class, "doPuts", new Object[] { testName, 1000 });
+    vm4.invoke(() -> WANTestBase.doPuts( testName, 1000 ));
 
-    vm2.invoke(WANTestBase.class, "validateRegionSize", new Object[] {
-        testName, 800 });
+    vm2.invoke(() -> WANTestBase.validateRegionSize(
+        testName, 800 ));
     
     pause(2000);
-    vm4.invoke(WANTestBase.class, "checkQueueStats", new Object[] {"ln",
-      0, 1000, 900, 800});
-    vm4.invoke(WANTestBase.class, "checkEventFilteredStats", new Object[] {"ln",
-      200});
-    vm4.invoke(WANTestBase.class, "checkBatchStats", new Object[] {"ln",
-      80});
-    vm4.invoke(WANTestBase.class, "checkUnProcessedStats", new Object[] {"ln", 0});
+    vm4.invoke(() -> WANTestBase.checkQueueStats("ln",
+      0, 1000, 900, 800));
+    vm4.invoke(() -> WANTestBase.checkEventFilteredStats("ln",
+      200));
+    vm4.invoke(() -> WANTestBase.checkBatchStats("ln",
+      80));
+    vm4.invoke(() -> WANTestBase.checkUnProcessedStats("ln", 0));
     
     
-    vm5.invoke(WANTestBase.class, "checkQueueStats", new Object[] {"ln",
-      0, 1000, 0, 0});
-    vm5.invoke(WANTestBase.class, "checkBatchStats", new Object[] {"ln",
-      0});
-    vm5.invoke(WANTestBase.class, "checkUnProcessedStats", new Object[] {"ln",900});
+    vm5.invoke(() -> WANTestBase.checkQueueStats("ln",
+      0, 1000, 0, 0));
+    vm5.invoke(() -> WANTestBase.checkBatchStats("ln",
+      0));
+    vm5.invoke(() -> WANTestBase.checkUnProcessedStats("ln",900));
   }
   
   public void testSerialPropagationConflation() throws Exception {
-    Integer lnPort = (Integer)vm0.invoke(WANTestBase.class,
-        "createFirstLocatorWithDSId", new Object[] { 1 });
-    Integer nyPort = (Integer)vm1.invoke(WANTestBase.class,
-        "createFirstRemoteLocator", new Object[] { 2, lnPort });
+    Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 ));
+    Integer nyPort = (Integer)vm1.invoke(() -> WANTestBase.createFirstRemoteLocator( 2, lnPort ));
 
-    vm2.invoke(WANTestBase.class, "createReceiver", new Object[] { nyPort });
-    vm3.invoke(WANTestBase.class, "createReceiver", new Object[] { nyPort });
+    vm2.invoke(() -> WANTestBase.createReceiver( nyPort ));
+    vm3.invoke(() -> WANTestBase.createReceiver( nyPort ));
 
-    vm4.invoke(WANTestBase.class, "createCache", new Object[] {lnPort });
-    vm5.invoke(WANTestBase.class, "createCache", new Object[] {lnPort });
-    vm6.invoke(WANTestBase.class, "createCache", new Object[] {lnPort });
-    vm7.invoke(WANTestBase.class, "createCache", new Object[] {lnPort });
+    vm4.invoke(() -> WANTestBase.createCache(lnPort ));
+    vm5.invoke(() -> WANTestBase.createCache(lnPort ));
+    vm6.invoke(() -> WANTestBase.createCache(lnPort ));
+    vm7.invoke(() -> WANTestBase.createCache(lnPort ));
 
-    vm4.invoke(WANTestBase.class, "createSender", new Object[] { "ln", 2,
-        false, 100, 10, true, false, null, true });
+    vm4.invoke(() -> WANTestBase.createSender( "ln", 2,
+        false, 100, 10, true, false, null, true ));
 
-    vm4.invoke(WANTestBase.class, "createPartitionedRegion", new Object[] {
-        testName, "ln", 0, 100, isOffHeap()  });
-    vm5.invoke(WANTestBase.class, "createPartitionedRegion", new Object[] {
-        testName, "ln", 0, 100, isOffHeap()  });
-    vm6.invoke(WANTestBase.class, "createPartitionedRegion", new Object[] {
-        testName, "ln", 0, 100, isOffHeap()  });
-    vm7.invoke(WANTestBase.class, "createPartitionedRegion", new Object[] {
-        testName, "ln", 0, 100, isOffHeap()  });
+    vm4.invoke(() -> WANTestBase.createPartitionedRegion(
+        testName, "ln", 0, 100, isOffHeap()  ));
+    vm5.invoke(() -> WANTestBase.createPartitionedRegion(
+        testName, "ln", 0, 100, isOffHeap()  ));
+    vm6.invoke(() -> WANTestBase.createPartitionedRegion(
+        testName, "ln", 0, 100, isOffHeap()  ));
+    vm7.invoke(() -> WANTestBase.createPartitionedRegion(
+        testName, "ln", 0, 100, isOffHeap()  ));
 
-    vm4.invoke(WANTestBase.class, "startSender", new Object[] { "ln" });
+    vm4.invoke(() -> WANTestBase.startSender( "ln" ));
 
-    vm4.invoke(WANTestBase.class, "pauseSender", new Object[] { "ln" });
+    vm4.invoke(() -> WANTestBase.pauseSender( "ln" ));
 
-    vm2.invoke(WANTestBase.class, "createPartitionedRegion", new Object[] {
-        testName, null,1, 100, isOffHeap()  });
-    vm3.invoke(WANTestBase.class, "createPartitionedRegion", new Object[] {
-        testName, null,1, 100, isOffHeap()  });
+    vm2.invoke(() -> WANTestBase.createPartitionedRegion(
+        testName, null,1, 100, isOffHeap()  ));
+    vm3.invoke(() -> WANTestBase.createPartitionedRegion(
+        testName, null,1, 100, isOffHeap()  ));
 
     final Map keyValues = new HashMap();
     final Map updateKeyValues = new HashMap();
@@ -556,42 +539,42 @@ public class SerialWANStatsDUnitTest extends WANTestBase {
       keyValues.put(i, i);
     }
     
-    vm4.invoke(WANTestBase.class, "putGivenKeyValue", new Object[] { testName, keyValues });
+    vm4.invoke(() -> WANTestBase.putGivenKeyValue( testName, keyValues ));
 
-    vm4.invoke(WANTestBase.class, "checkQueueSize", new Object[] { "ln", keyValues.size() });
+    vm4.invoke(() -> WANTestBase.checkQueueSize( "ln", keyValues.size() ));
     for(int i=0;i<500;i++) {
       updateKeyValues.put(i, i+"_updated");
     }
     
-    vm4.invoke(WANTestBase.class, "putGivenKeyValue", new Object[] { testName, updateKeyValues });
+    vm4.invoke(() -> WANTestBase.putGivenKeyValue( testName, updateKeyValues ));
 
-    vm4.invoke(WANTestBase.class, "checkQueueSize", new Object[] { "ln", keyValues.size()  + updateKeyValues.size() });
+    vm4.invoke(() -> WANTestBase.checkQueueSize( "ln", keyValues.size()  + updateKeyValues.size() ));
 
-    vm2.invoke(WANTestBase.class, "validateRegionSize", new Object[] {
-        testName, 0 });
+    vm2.invoke(() -> WANTestBase.validateRegionSize(
+        testName, 0 ));
     
-    vm4.invoke(WANTestBase.class, "putGivenKeyValue", new Object[] { testName, updateKeyValues });
+    vm4.invoke(() -> WANTestBase.putGivenKeyValue( testName, updateKeyValues ));
 
-    vm4.invoke(WANTestBase.class, "checkQueueSize", new Object[] { "ln", keyValues.size()  + updateKeyValues.size() });
+    vm4.invoke(() -> WANTestBase.checkQueueSize( "ln", keyValues.size()  + updateKeyValues.size() ));
 
-    vm4.invoke(WANTestBase.class, "resumeSender", new Object[] { "ln" });
+    vm4.invoke(() -> WANTestBase.resumeSender( "ln" ));
 
     keyValues.putAll(updateKeyValues);
-    vm2.invoke(WANTestBase.class, "validateRegionSize", new Object[] {
-        testName, keyValues.size() });
-    vm3.invoke(WANTestBase.class, "validateRegionSize", new Object[] {
-      testName, keyValues.size() });
+    vm2.invoke(() -> WANTestBase.validateRegionSize(
+        testName, keyValues.size() ));
+    vm3.invoke(() -> WANTestBase.validateRegionSize(
+      testName, keyValues.size() ));
     
-    vm2.invoke(WANTestBase.class, "validateRegionContents", new Object[] {
-        testName, keyValues });
-    vm3.invoke(WANTestBase.class, "validateRegionContents", new Object[] {
-        testName, keyValues });
+    vm2.invoke(() -> WANTestBase.validateRegionContents(
+        testName, keyValues ));
+    vm3.invoke(() -> WANTestBase.validateRegionContents(
+        testName, keyValues ));
     
     pause(2000);
-    vm4.invoke(WANTestBase.class, "checkQueueStats", new Object[] {"ln",
-      0, 2000, 2000, 1500});
-    vm4.invoke(WANTestBase.class, "checkConflatedStats", new Object[] {"ln",
-      500});
+    vm4.invoke(() -> WANTestBase.checkQueueStats("ln",
+      0, 2000, 2000, 1500));
+    vm4.invoke(() -> WANTestBase.checkConflatedStats("ln",
+      500));
   }
     
 }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/69024aa9/gemfire-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/wancommand/WANCommandTestBase.java
----------------------------------------------------------------------
diff --git a/gemfire-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/wancommand/WANCommandTestBase.java b/gemfire-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/wancommand/WANCommandTestBase.java
index 38d8827..f7d1987 100644
--- a/gemfire-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/wancommand/WANCommandTestBase.java
+++ b/gemfire-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/wancommand/WANCommandTestBase.java
@@ -494,14 +494,14 @@ public class WANCommandTestBase extends CliCommandTestBase{
   @Override
   protected final void postTearDownCacheTestCase() throws Exception {
     closeCache();
-    vm0.invoke(WANCommandTestBase.class, "closeCache");
-    vm1.invoke(WANCommandTestBase.class, "closeCache");
-    vm2.invoke(WANCommandTestBase.class, "closeCache");
-    vm3.invoke(WANCommandTestBase.class, "closeCache");
-    vm4.invoke(WANCommandTestBase.class, "closeCache");
-    vm5.invoke(WANCommandTestBase.class, "closeCache");
-    vm6.invoke(WANCommandTestBase.class, "closeCache");
-    vm7.invoke(WANCommandTestBase.class, "closeCache");
+    vm0.invoke(() -> WANCommandTestBase.closeCache());
+    vm1.invoke(() -> WANCommandTestBase.closeCache());
+    vm2.invoke(() -> WANCommandTestBase.closeCache());
+    vm3.invoke(() -> WANCommandTestBase.closeCache());
+    vm4.invoke(() -> WANCommandTestBase.closeCache());
+    vm5.invoke(() -> WANCommandTestBase.closeCache());
+    vm6.invoke(() -> WANCommandTestBase.closeCache());
+    vm7.invoke(() -> WANCommandTestBase.closeCache());
   }
 
   public static void closeCache() {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/69024aa9/gemfire-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/wancommand/WanCommandCreateGatewayReceiverDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/wancommand/WanCommandCreateGatewayReceiverDUnitTest.java b/gemfire-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/wancommand/WanCommandCreateGatewayReceiverDUnitTest.java
index a06b32e..b885071 100644
--- a/gemfire-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/wancommand/WanCommandCreateGatewayReceiverDUnitTest.java
+++ b/gemfire-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/wancommand/WanCommandCreateGatewayReceiverDUnitTest.java
@@ -54,8 +54,7 @@ public class WanCommandCreateGatewayReceiverDUnitTest extends
   public void testCreateGatewayReceiverWithDefault() {
 
     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");
@@ -63,15 +62,11 @@ public class WanCommandCreateGatewayReceiverDUnitTest extends
         + "]");
     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_GATEWAYRECEIVER;
     CommandResult cmdResult = executeCommand(command);
@@ -95,27 +90,24 @@ public class WanCommandCreateGatewayReceiverDUnitTest extends
       fail("testCreateGatewayReceiver failed as did not get CommandResult");
     }
 
-    vm3.invoke(WANCommandTestBase.class,
-        "verifyReceiverCreationWithAttributes", new Object[] { !GatewayReceiver.DEFAULT_MANUAL_START,
+    vm3.invoke(() -> WANCommandTestBase.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 });
-    vm4.invoke(WANCommandTestBase.class,
-        "verifyReceiverCreationWithAttributes", new Object[] { !GatewayReceiver.DEFAULT_MANUAL_START,
+            GatewayReceiver.DEFAULT_SOCKET_BUFFER_SIZE, null ));
+    vm4.invoke(() -> WANCommandTestBase.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 });
-    vm5.invoke(WANCommandTestBase.class,
-        "verifyReceiverCreationWithAttributes", new Object[] { !GatewayReceiver.DEFAULT_MANUAL_START,
+            GatewayReceiver.DEFAULT_SOCKET_BUFFER_SIZE, null ));
+    vm5.invoke(() -> WANCommandTestBase.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_SOCKET_BUFFER_SIZE, null ));
   }
 
   /**
@@ -124,8 +116,7 @@ public class WanCommandCreateGatewayReceiverDUnitTest extends
   public void testCreateGatewayReceiver() {
 
     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");
@@ -133,15 +124,11 @@ public class WanCommandCreateGatewayReceiverDUnitTest extends
         + "]");
     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_GATEWAYRECEIVER 
         + " --" + CliStrings.CREATE_GATEWAYRECEIVER__MANUALSTART+ "=true"
@@ -171,15 +158,12 @@ public class WanCommandCreateGatewayReceiverDUnitTest extends
       fail("testCreateGatewayReceiver failed as did not get CommandResult");
     }
 
-    vm3.invoke(WANCommandTestBase.class,
-        "verifyReceiverCreationWithAttributes", new Object[] { false, 10000,
-            11000, "localhost", 100000, 512000, null });
-    vm4.invoke(WANCommandTestBase.class,
-        "verifyReceiverCreationWithAttributes", new Object[] { false, 10000,
-            11000, "localhost", 100000, 512000, null });
-    vm5.invoke(WANCommandTestBase.class,
-        "verifyReceiverCreationWithAttributes", new Object[] { false, 10000,
-            11000, "localhost", 100000, 512000, null });
+    vm3.invoke(() -> WANCommandTestBase.verifyReceiverCreationWithAttributes( false, 10000,
+            11000, "localhost", 100000, 512000, null ));
+    vm4.invoke(() -> WANCommandTestBase.verifyReceiverCreationWithAttributes( false, 10000,
+            11000, "localhost", 100000, 512000, null ));
+    vm5.invoke(() -> WANCommandTestBase.verifyReceiverCreationWithAttributes( false, 10000,
+            11000, "localhost", 100000, 512000, null ));
   }
   
   /**
@@ -188,8 +172,7 @@ public class WanCommandCreateGatewayReceiverDUnitTest extends
   public void testCreateGatewayReceiverWithGatewayTransportFilter() {
 
     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");
@@ -197,15 +180,11 @@ public class WanCommandCreateGatewayReceiverDUnitTest extends
         + "]");
     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_GATEWAYRECEIVER 
         + " --" + CliStrings.CREATE_GATEWAYRECEIVER__MANUALSTART+ "=false"
@@ -239,15 +218,12 @@ public class WanCommandCreateGatewayReceiverDUnitTest extends
     List<String> transportFilters = new ArrayList<String>();
     transportFilters.add("com.gemstone.gemfire.cache30.MyGatewayTransportFilter1");
     
-    vm3.invoke(WANCommandTestBase.class,
-        "verifyReceiverCreationWithAttributes", new Object[] { true, 10000,
-            11000, "localhost", 100000, 512000, transportFilters });
-    vm4.invoke(WANCommandTestBase.class,
-        "verifyReceiverCreationWithAttributes", new Object[] { true, 10000,
-            11000, "localhost", 100000, 512000, transportFilters });
-    vm5.invoke(WANCommandTestBase.class,
-        "verifyReceiverCreationWithAttributes", new Object[] { true, 10000,
-            11000, "localhost", 100000, 512000, transportFilters });
+    vm3.invoke(() -> WANCommandTestBase.verifyReceiverCreationWithAttributes( true, 10000,
+            11000, "localhost", 100000, 512000, transportFilters ));
+    vm4.invoke(() -> WANCommandTestBase.verifyReceiverCreationWithAttributes( true, 10000,
+            11000, "localhost", 100000, 512000, transportFilters ));
+    vm5.invoke(() -> WANCommandTestBase.verifyReceiverCreationWithAttributes( true, 10000,
+            11000, "localhost", 100000, 512000, transportFilters ));
   }
   
   /**
@@ -256,8 +232,7 @@ public class WanCommandCreateGatewayReceiverDUnitTest extends
   public void testCreateGatewayReceiverWithMultipleGatewayTransportFilters() {
 
     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");
@@ -265,15 +240,11 @@ public class WanCommandCreateGatewayReceiverDUnitTest extends
         + "]");
     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_GATEWAYRECEIVER + " --"
         + CliStrings.CREATE_GATEWAYRECEIVER__BINDADDRESS + "=localhost" + " --"
@@ -309,15 +280,12 @@ public class WanCommandCreateGatewayReceiverDUnitTest extends
     transportFilters.add("com.gemstone.gemfire.cache30.MyGatewayTransportFilter1");
     transportFilters.add("com.gemstone.gemfire.cache30.MyGatewayTransportFilter2");
     
-    vm3.invoke(WANCommandTestBase.class,
-        "verifyReceiverCreationWithAttributes", new Object[] { !GatewayReceiver.DEFAULT_MANUAL_START, 10000,
-            11000, "localhost", 100000, 512000, transportFilters });
-    vm4.invoke(WANCommandTestBase.class,
-        "verifyReceiverCreationWithAttributes", new Object[] { !GatewayReceiver.DEFAULT_MANUAL_START, 10000,
-            11000, "localhost", 100000, 512000, transportFilters });
-    vm5.invoke(WANCommandTestBase.class,
-        "verifyReceiverCreationWithAttributes", new Object[] { !GatewayReceiver.DEFAULT_MANUAL_START, 10000,
-            11000, "localhost", 100000, 512000, transportFilters });
+    vm3.invoke(() -> WANCommandTestBase.verifyReceiverCreationWithAttributes( !GatewayReceiver.DEFAULT_MANUAL_START, 10000,
+            11000, "localhost", 100000, 512000, transportFilters ));
+    vm4.invoke(() -> WANCommandTestBase.verifyReceiverCreationWithAttributes( !GatewayReceiver.DEFAULT_MANUAL_START, 10000,
+            11000, "localhost", 100000, 512000, transportFilters ));
+    vm5.invoke(() -> WANCommandTestBase.verifyReceiverCreationWithAttributes( !GatewayReceiver.DEFAULT_MANUAL_START, 10000,
+            11000, "localhost", 100000, 512000, transportFilters ));
   }
 
   /**
@@ -327,8 +295,7 @@ public class WanCommandCreateGatewayReceiverDUnitTest extends
   public void testCreateGatewayReceiver_Error() {
 
     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");
@@ -336,15 +303,11 @@ public class WanCommandCreateGatewayReceiverDUnitTest extends
         + "]");
     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_GATEWAYRECEIVER 
         + " --" + CliStrings.CREATE_GATEWAYRECEIVER__BINDADDRESS + "=localhost"
@@ -380,8 +343,7 @@ public class WanCommandCreateGatewayReceiverDUnitTest extends
   public void testCreateGatewayReceiver_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");
@@ -389,18 +351,13 @@ public class WanCommandCreateGatewayReceiverDUnitTest extends
         + "]");
     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());
 
     String command = CliStrings.CREATE_GATEWAYRECEIVER 
         + " --" + CliStrings.CREATE_GATEWAYRECEIVER__MANUALSTART + "=true"
@@ -431,9 +388,8 @@ public class WanCommandCreateGatewayReceiverDUnitTest extends
       fail("testCreateGatewayReceiver failed as did not get CommandResult");
     }
 
-    vm3.invoke(WANCommandTestBase.class,
-        "verifyReceiverCreationWithAttributes", new Object[] { false, 10000,
-            11000, "localhost", 100000, 512000, null });
+    vm3.invoke(() -> WANCommandTestBase.verifyReceiverCreationWithAttributes( false, 10000,
+            11000, "localhost", 100000, 512000, null ));
   }
 
   /**
@@ -442,8 +398,7 @@ public class WanCommandCreateGatewayReceiverDUnitTest extends
   public void testCreateGatewayReceiver_onMultipleMembers() {
 
     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");
@@ -451,20 +406,14 @@ public class WanCommandCreateGatewayReceiverDUnitTest extends
         + "]");
     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 vm4Member = (DistributedMember) vm4.invoke(
-        WANCommandTestBase.class, "getMember");
+    final DistributedMember vm3Member = (DistributedMember) vm3.invoke(() -> WANCommandTestBase.getMember());
+    final DistributedMember vm4Member = (DistributedMember) vm4.invoke(() -> WANCommandTestBase.getMember());
 
     String command = CliStrings.CREATE_GATEWAYRECEIVER 
         + " --" + CliStrings.CREATE_GATEWAYRECEIVER__MANUALSTART + "=true"
@@ -495,12 +444,10 @@ public class WanCommandCreateGatewayReceiverDUnitTest extends
       fail("testCreateGatewayReceiver failed as did not get CommandResult");
     }
 
-    vm3.invoke(WANCommandTestBase.class,
-        "verifyReceiverCreationWithAttributes", new Object[] { false, 10000,
-            11000, "localhost", 100000, 512000, null });
-    vm4.invoke(WANCommandTestBase.class,
-        "verifyReceiverCreationWithAttributes", new Object[] { false, 10000,
-            11000, "localhost", 100000, 512000, null });
+    vm3.invoke(() -> WANCommandTestBase.verifyReceiverCreationWithAttributes( false, 10000,
+            11000, "localhost", 100000, 512000, null ));
+    vm4.invoke(() -> WANCommandTestBase.verifyReceiverCreationWithAttributes( false, 10000,
+            11000, "localhost", 100000, 512000, null ));
   }
   
   /**
@@ -509,8 +456,7 @@ public class WanCommandCreateGatewayReceiverDUnitTest extends
   public void testCreateGatewayReceiver_onGroup() {
 
     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");
@@ -518,15 +464,11 @@ public class WanCommandCreateGatewayReceiverDUnitTest extends
         + "]");
     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, "receiverGroup1" });
-    vm4.invoke(WANCommandTestBase.class, "createCacheWithGroups",
-        new Object[] { punePort, "receiverGroup1" });
-    vm5.invoke(WANCommandTestBase.class, "createCacheWithGroups",
-        new Object[] { punePort, "receiverGroup1" });
+    vm3.invoke(() -> WANCommandTestBase.createCacheWithGroups( punePort, "receiverGroup1" ));
+    vm4.invoke(() -> WANCommandTestBase.createCacheWithGroups( punePort, "receiverGroup1" ));
+    vm5.invoke(() -> WANCommandTestBase.createCacheWithGroups( punePort, "receiverGroup1" ));
 
     String command = CliStrings.CREATE_GATEWAYRECEIVER 
         + " --" + CliStrings.CREATE_GATEWAYRECEIVER__MANUALSTART + "=true"
@@ -557,15 +499,12 @@ public class WanCommandCreateGatewayReceiverDUnitTest extends
       fail("testCreateGatewayReceiver failed as did not get CommandResult");
     }
 
-    vm3.invoke(WANCommandTestBase.class,
-        "verifyReceiverCreationWithAttributes", new Object[] { false, 10000,
-            11000, "localhost", 100000, 512000, null });
-    vm4.invoke(WANCommandTestBase.class,
-        "verifyReceiverCreationWithAttributes", new Object[] { false, 10000,
-            11000, "localhost", 100000, 512000, null });
-    vm5.invoke(WANCommandTestBase.class,
-        "verifyReceiverCreationWithAttributes", new Object[] { false, 10000,
-            11000, "localhost", 100000, 512000, null });
+    vm3.invoke(() -> WANCommandTestBase.verifyReceiverCreationWithAttributes( false, 10000,
+            11000, "localhost", 100000, 512000, null ));
+    vm4.invoke(() -> WANCommandTestBase.verifyReceiverCreationWithAttributes( false, 10000,
+            11000, "localhost", 100000, 512000, null ));
+    vm5.invoke(() -> WANCommandTestBase.verifyReceiverCreationWithAttributes( false, 10000,
+            11000, "localhost", 100000, 512000, null ));
   }
 
   /**
@@ -575,8 +514,7 @@ public class WanCommandCreateGatewayReceiverDUnitTest extends
   public void testCreateGatewayReceiver_onGroup_Scenario2() {
 
     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");
@@ -584,15 +522,11 @@ public class WanCommandCreateGatewayReceiverDUnitTest extends
         + "]");
     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, "receiverGroup1" });
-    vm4.invoke(WANCommandTestBase.class, "createCacheWithGroups",
-        new Object[] { punePort, "receiverGroup1" });
-    vm5.invoke(WANCommandTestBase.class, "createCacheWithGroups",
-        new Object[] { punePort, "receiverGroup2" });
+    vm3.invoke(() -> WANCommandTestBase.createCacheWithGroups( punePort, "receiverGroup1" ));
+    vm4.invoke(() -> WANCommandTestBase.createCacheWithGroups( punePort, "receiverGroup1" ));
+    vm5.invoke(() -> WANCommandTestBase.createCacheWithGroups( punePort, "receiverGroup2" ));
 
     String command = CliStrings.CREATE_GATEWAYRECEIVER 
         + " --" + CliStrings.CREATE_GATEWAYRECEIVER__MANUALSTART + "=true"
@@ -623,12 +557,10 @@ public class WanCommandCreateGatewayReceiverDUnitTest extends
       fail("testCreateGatewayReceiver failed as did not get CommandResult");
     }
 
-    vm3.invoke(WANCommandTestBase.class,
-        "verifyReceiverCreationWithAttributes", new Object[] { false, 10000,
-            11000, "localhost", 100000, 512000, null });
-    vm4.invoke(WANCommandTestBase.class,
-        "verifyReceiverCreationWithAttributes", new Object[] { false, 10000,
-            11000, "localhost", 100000, 512000, null });
+    vm3.invoke(() -> WANCommandTestBase.verifyReceiverCreationWithAttributes( false, 10000,
+            11000, "localhost", 100000, 512000, null ));
+    vm4.invoke(() -> WANCommandTestBase.verifyReceiverCreationWithAttributes( false, 10000,
+            11000, "localhost", 100000, 512000, null ));
   }
 
   /**
@@ -637,8 +569,7 @@ public class WanCommandCreateGatewayReceiverDUnitTest extends
   public void testCreateGatewayReceiver_onMultipleGroups() {
 
     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");
@@ -646,15 +577,11 @@ public class WanCommandCreateGatewayReceiverDUnitTest extends
         + "]");
     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, "receiverGroup1" });
-    vm4.invoke(WANCommandTestBase.class, "createCacheWithGroups",
-        new Object[] { punePort, "receiverGroup1" });
-    vm5.invoke(WANCommandTestBase.class, "createCacheWithGroups",
-        new Object[] { punePort, "receiverGroup2" });
+    vm3.invoke(() -> WANCommandTestBase.createCacheWithGroups( punePort, "receiverGroup1" ));
+    vm4.invoke(() -> WANCommandTestBase.createCacheWithGroups( punePort, "receiverGroup1" ));
+    vm5.invoke(() -> WANCommandTestBase.createCacheWithGroups( punePort, "receiverGroup2" ));
 
     String command = CliStrings.CREATE_GATEWAYRECEIVER 
         + " --" + CliStrings.CREATE_GATEWAYRECEIVER__MANUALSTART + "=true"
@@ -685,15 +612,12 @@ public class WanCommandCreateGatewayReceiverDUnitTest extends
       fail("testCreateGatewayReceiver failed as did not get CommandResult");
     }
 
-    vm3.invoke(WANCommandTestBase.class,
-        "verifyReceiverCreationWithAttributes", new Object[] { false, 10000,
-            11000, "localhost", 100000, 512000, null });
-    vm4.invoke(WANCommandTestBase.class,
-        "verifyReceiverCreationWithAttributes", new Object[] { false, 10000,
-            11000, "localhost", 100000, 512000, null });
-    vm5.invoke(WANCommandTestBase.class,
-        "verifyReceiverCreationWithAttributes", new Object[] { false, 10000,
-            11000, "localhost", 100000, 512000, null });
+    vm3.invoke(() -> WANCommandTestBase.verifyReceiverCreationWithAttributes( false, 10000,
+            11000, "localhost", 100000, 512000, null ));
+    vm4.invoke(() -> WANCommandTestBase.verifyReceiverCreationWithAttributes( false, 10000,
+            11000, "localhost", 100000, 512000, null ));
+    vm5.invoke(() -> WANCommandTestBase.verifyReceiverCreationWithAttributes( false, 10000,
+            11000, "localhost", 100000, 512000, null ));
   }
 
 }


Mime
View raw message