geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From upthewatersp...@apache.org
Subject [46/56] [abbrv] incubator-geode git commit: Automatically converting calls of vm.invoke to lambdas
Date Tue, 16 Feb 2016 22:12:06 GMT
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/69024aa9/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/HABug36773DUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/HABug36773DUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/HABug36773DUnitTest.java
index a590aef..3268b68 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/HABug36773DUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/HABug36773DUnitTest.java
@@ -108,16 +108,12 @@ public class HABug36773DUnitTest extends DistributedTestCase
     // client 2 VM
     client2 = host.getVM(3);
 
-    PORT1 = ((Integer)server1.invoke(HABug36773DUnitTest.class,
-        "createServerCache")).intValue();
-    PORT2 = ((Integer)server2.invoke(HABug36773DUnitTest.class,
-        "createServerCache")).intValue();
-    client1.invoke(HABug36773DUnitTest.class, "disableShufflingOfEndpoints");
-    client2.invoke(HABug36773DUnitTest.class, "disableShufflingOfEndpoints");
-    client1.invoke(HABug36773DUnitTest.class, "createClientCache",
-        new Object[] { new Integer(PORT1), new Integer(PORT2) });
-    client2.invoke(HABug36773DUnitTest.class, "createClientCache",
-        new Object[] { new Integer(PORT1), new Integer(PORT2) });
+    PORT1 = ((Integer)server1.invoke(() -> HABug36773DUnitTest.createServerCache())).intValue();
+    PORT2 = ((Integer)server2.invoke(() -> HABug36773DUnitTest.createServerCache())).intValue();
+    client1.invoke(() -> HABug36773DUnitTest.disableShufflingOfEndpoints());
+    client2.invoke(() -> HABug36773DUnitTest.disableShufflingOfEndpoints());
+    client1.invoke(() -> HABug36773DUnitTest.createClientCache( new Integer(PORT1), new Integer(PORT2) ));
+    client2.invoke(() -> HABug36773DUnitTest.createClientCache( new Integer(PORT1), new Integer(PORT2) ));
 
   }
 
@@ -136,24 +132,22 @@ public class HABug36773DUnitTest extends DistributedTestCase
   public void _testBug36773() throws Exception
   {
     //First create entries on both servers via the two client
-    client1.invoke(HABug36773DUnitTest.class, "createEntriesK1andK2");
-    client2.invoke(HABug36773DUnitTest.class, "createEntriesK1andK2");
-    client1.invoke(HABug36773DUnitTest.class, "registerKeysK1andK2");
-    client2.invoke(HABug36773DUnitTest.class, "registerKeysK1andK2");
+    client1.invoke(() -> HABug36773DUnitTest.createEntriesK1andK2());
+    client2.invoke(() -> HABug36773DUnitTest.createEntriesK1andK2());
+    client1.invoke(() -> HABug36773DUnitTest.registerKeysK1andK2());
+    client2.invoke(() -> HABug36773DUnitTest.registerKeysK1andK2());
 
     server1.invoke(checkSizeRegion(2));
     server2.invoke(checkSizeRegion(2));
     client1.invoke(checkSizeRegion(2));
     client2.invoke(checkSizeRegion(2));
 
-    server1.invoke(HABug36773DUnitTest.class, "waitOnTheKeyEntry");
-    client1.invoke(HABug36773DUnitTest.class,
-        "acquireConnectionsAndPut", new Object[] {new Integer(PORT2)});
-    client1.invoke(HABug36773DUnitTest.class,
-        "acquireConnectionsAndPut", new Object[] {new Integer(PORT1)});
-      client2.invoke(HABug36773DUnitTest.class, "verifyEntries", new Object[] {new String(KEY2), new String (VALUE2)});
-    server1.invoke(HABug36773DUnitTest.class, "notfiyThread");
-    client2.invoke(HABug36773DUnitTest.class, "verifyEntries", new Object[] {new String(KEY1), new String (VALUE1)});
+    server1.invoke(() -> HABug36773DUnitTest.waitOnTheKeyEntry());
+    client1.invoke(() -> HABug36773DUnitTest.acquireConnectionsAndPut(new Integer(PORT2)));
+    client1.invoke(() -> HABug36773DUnitTest.acquireConnectionsAndPut(new Integer(PORT1)));
+      client2.invoke(() -> HABug36773DUnitTest.verifyEntries(new String(KEY2), new String (VALUE2)));
+    server1.invoke(() -> HABug36773DUnitTest.notfiyThread());
+    client2.invoke(() -> HABug36773DUnitTest.verifyEntries(new String(KEY1), new String (VALUE1)));
   
   }
 
@@ -360,11 +354,11 @@ public class HABug36773DUnitTest extends DistributedTestCase
   @Override
   protected final void preTearDown() throws Exception {
     //close client
-    client1.invoke(HABug36773DUnitTest.class, "closeCache");
-    client2.invoke(HABug36773DUnitTest.class, "closeCache");
+    client1.invoke(() -> HABug36773DUnitTest.closeCache());
+    client2.invoke(() -> HABug36773DUnitTest.closeCache());
     //close server
-    server1.invoke(HABug36773DUnitTest.class, "closeCache");
-    server2.invoke(HABug36773DUnitTest.class, "closeCache");
+    server1.invoke(() -> HABug36773DUnitTest.closeCache());
+    server2.invoke(() -> HABug36773DUnitTest.closeCache());
   }
 }
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/69024aa9/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/HAOverflowMemObjectSizerDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/HAOverflowMemObjectSizerDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/HAOverflowMemObjectSizerDUnitTest.java
index 371d8f9..e98df03 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/HAOverflowMemObjectSizerDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/HAOverflowMemObjectSizerDUnitTest.java
@@ -96,9 +96,9 @@ public class HAOverflowMemObjectSizerDUnitTest extends DistributedTestCase {
 
   @Override
   protected final void preTearDown() throws Exception {
-    serverVM.invoke(ConflationDUnitTest.class, "unsetIsSlowStart");
-    client.invoke(HAOverflowMemObjectSizerDUnitTest.class, "closeCache");
-    serverVM.invoke(HAOverflowMemObjectSizerDUnitTest.class, "closeCache");
+    serverVM.invoke(() -> ConflationDUnitTest.unsetIsSlowStart());
+    client.invoke(() -> HAOverflowMemObjectSizerDUnitTest.closeCache());
+    serverVM.invoke(() -> HAOverflowMemObjectSizerDUnitTest.closeCache());
   }
 
   public static void cleanUp(Long limit) {
@@ -181,22 +181,15 @@ public class HAOverflowMemObjectSizerDUnitTest extends DistributedTestCase {
    */
   public void testSizerImplementationofMemCapacityControllerWhenNotificationBySubscriptionIsTrue() {
 
-    Integer port1 = (Integer)serverVM.invoke(
-        HAOverflowMemObjectSizerDUnitTest.class, "createCacheServer",
-        new Object[] { new Boolean(true) });
+    Integer port1 = (Integer)serverVM.invoke(() -> HAOverflowMemObjectSizerDUnitTest.createCacheServer( new Boolean(true) ));
     serverPort1 = port1;
-    serverVM.invoke(ConflationDUnitTest.class, "setIsSlowStart",
-        new Object[] { "15000" });
-
-    client.invoke(HAOverflowMemObjectSizerDUnitTest.class,
-                  "createCacheClient",
-                  new Object[] { port1, 
-                  NetworkUtils.getServerHostName(client.getHost()) });
-
-    serverVM.invoke(HAOverflowMemObjectSizerDUnitTest.class, "performPut",
-        new Object[] { new Long(0L), new Long(100L) });
-    serverVM.invoke(HAOverflowMemObjectSizerDUnitTest.class,
-        "sizerTestForMemCapacityController", new Object[] { serverPort1 });
+    serverVM.invoke(() -> ConflationDUnitTest.setIsSlowStart( "15000" ));
+
+    client.invoke(() -> HAOverflowMemObjectSizerDUnitTest.createCacheClient( port1, 
+                  NetworkUtils.getServerHostName(client.getHost()) ));
+
+    serverVM.invoke(() -> HAOverflowMemObjectSizerDUnitTest.performPut( new Long(0L), new Long(100L) ));
+    serverVM.invoke(() -> HAOverflowMemObjectSizerDUnitTest.sizerTestForMemCapacityController( serverPort1 ));
   }
 
   /**
@@ -206,23 +199,16 @@ public class HAOverflowMemObjectSizerDUnitTest extends DistributedTestCase {
    * equal to the size calculated by memCapacity controller <br>
    */
   public void testSizerImplementationofMemCapacityControllerWhenNotificationBySubscriptionIsFalse() {
-    Integer port2 = (Integer)serverVM.invoke(
-        HAOverflowMemObjectSizerDUnitTest.class, "createCacheServer",
-        new Object[] { new Boolean(false) });
+    Integer port2 = (Integer)serverVM.invoke(() -> HAOverflowMemObjectSizerDUnitTest.createCacheServer( new Boolean(false) ));
     serverPort2 = port2;
 
-    serverVM.invoke(ConflationDUnitTest.class, "setIsSlowStart",
-        new Object[] { "15000" });
+    serverVM.invoke(() -> ConflationDUnitTest.setIsSlowStart( "15000" ));
 
-    client.invoke(HAOverflowMemObjectSizerDUnitTest.class,
-                  "createCacheClient", 
-                  new Object[] { port2,
-                  NetworkUtils.getServerHostName(client.getHost()) });
+    client.invoke(() -> HAOverflowMemObjectSizerDUnitTest.createCacheClient( port2,
+                  NetworkUtils.getServerHostName(client.getHost()) ));
 
-    serverVM.invoke(HAOverflowMemObjectSizerDUnitTest.class, "performPut",
-        new Object[] { new Long(101L), new Long(200L) });
-    serverVM.invoke(HAOverflowMemObjectSizerDUnitTest.class,
-        "sizerTestForMemCapacityController", new Object[] { serverPort2 });
+    serverVM.invoke(() -> HAOverflowMemObjectSizerDUnitTest.performPut( new Long(101L), new Long(200L) ));
+    serverVM.invoke(() -> HAOverflowMemObjectSizerDUnitTest.sizerTestForMemCapacityController( serverPort2 ));
   }
 
   /**

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/69024aa9/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/MapClearGIIDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/MapClearGIIDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/MapClearGIIDUnitTest.java
index 3aeceec..9343e60 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/MapClearGIIDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/MapClearGIIDUnitTest.java
@@ -61,8 +61,8 @@ public class MapClearGIIDUnitTest extends CacheTestCase {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
     VM vm1 = host.getVM(1);
-    vm0.invoke(MapClearGIIDUnitTest.class, "createCacheVM0");
-    vm1.invoke(MapClearGIIDUnitTest.class, "createCacheVM1");
+    vm0.invoke(() -> MapClearGIIDUnitTest.createCacheVM0());
+    vm1.invoke(() -> MapClearGIIDUnitTest.createCacheVM1());
     System.out.println("Cache created in successfully");
   }*/
 /*
@@ -70,8 +70,8 @@ public class MapClearGIIDUnitTest extends CacheTestCase {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
     VM vm1 = host.getVM(1);
-    vm0.invoke(MapClearGIIDUnitTest.class, "closeCache");
-    vm1.invoke(MapClearGIIDUnitTest.class, "closeCache");
+    vm0.invoke(() -> MapClearGIIDUnitTest.closeCache());
+    vm1.invoke(() -> MapClearGIIDUnitTest.closeCache());
   }*/
 
 /*  public static void createCacheVM0() throws Exception {
@@ -180,7 +180,7 @@ public class MapClearGIIDUnitTest extends CacheTestCase {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
     VM vm1 = host.getVM(1);
-    //vm0.invoke(MapClearGIIDUnitTest.class, "createCacheVM0");
+    //vm0.invoke(() -> MapClearGIIDUnitTest.createCacheVM0());
     
     vm0.invoke(new CacheSerializableRunnable("createCacheVM0") {
       public void run2() throws CacheException
@@ -220,8 +220,7 @@ public class MapClearGIIDUnitTest extends CacheTestCase {
     });
     LogWriterUtils.getLogWriter().info("Cache created in VM1 successfully");
     try {
-      AsyncInvocation asyncGII = vm0.invokeAsync(MapClearGIIDUnitTest.class, 
-          "createRegionInVm0");
+      AsyncInvocation asyncGII = vm0.invokeAsync(() -> MapClearGIIDUnitTest.createRegionInVm0());
       // wait until vm0's gii has done 20 slow image sleeps (10ms*20 = 200ms)
       // before starting the clear
       vm0.invoke(new CacheSerializableRunnable("wait for sleeps") {
@@ -238,7 +237,7 @@ public class MapClearGIIDUnitTest extends CacheTestCase {
           }
         });
       // now that the gii has received some entries do the clear
-      vm1.invoke(MapClearGIIDUnitTest.class, "clearRegionInVm1");
+      vm1.invoke(() -> MapClearGIIDUnitTest.clearRegionInVm1());
       // wait for GII to complete
       ThreadUtils.join(asyncGII, 30 * 1000);
       if (asyncGII.exceptionOccurred()) {
@@ -246,7 +245,7 @@ public class MapClearGIIDUnitTest extends CacheTestCase {
         Assert.fail("createRegionInVM0 failed", t);
       }
       assertTrue(vm0
-          .invokeBoolean(MapClearGIIDUnitTest.class, "checkImageStateFlag"));
+          .invoke(() -> MapClearGIIDUnitTest.checkImageStateFlag()));
 
       if (asyncGII.exceptionOccurred()) {
         Assert.fail("asyncGII failed", asyncGII.getException());

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/69024aa9/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/P2PDeltaPropagationDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/P2PDeltaPropagationDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/P2PDeltaPropagationDUnitTest.java
index 3f814d4..4889f0f 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/P2PDeltaPropagationDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/P2PDeltaPropagationDUnitTest.java
@@ -98,10 +98,10 @@ public class P2PDeltaPropagationDUnitTest extends DistributedTestCase
     server2.invoke(P2PDeltaPropagationDUnitTest.class, "createServerCache",args);
     server3.invoke(P2PDeltaPropagationDUnitTest.class, "createServerCache",args);
     //only delta should get send to server2 and server3
-    server1.invoke(P2PDeltaPropagationDUnitTest.class, "put");
+    server1.invoke(() -> P2PDeltaPropagationDUnitTest.put());
     Thread.sleep(5000);
-    server2.invoke(P2PDeltaPropagationDUnitTest.class, "getOnDeltaEnabledServer");
-    server3.invoke(P2PDeltaPropagationDUnitTest.class, "getOnDeltaEnabledServer");
+    server2.invoke(() -> P2PDeltaPropagationDUnitTest.getOnDeltaEnabledServer());
+    server3.invoke(() -> P2PDeltaPropagationDUnitTest.getOnDeltaEnabledServer());
     
   }
 
@@ -116,10 +116,10 @@ public class P2PDeltaPropagationDUnitTest extends DistributedTestCase
     server1.invoke(P2PDeltaPropagationDUnitTest.class, "createServerCache",args);
     server2.invoke(P2PDeltaPropagationDUnitTest.class, "createServerCache",args);
     server3.invoke(P2PDeltaPropagationDUnitTest.class, "createServerCache",args); 
-    server1.invoke(P2PDeltaPropagationDUnitTest.class, "put");
+    server1.invoke(() -> P2PDeltaPropagationDUnitTest.put());
     Thread.sleep(5000);
-    server2.invoke(P2PDeltaPropagationDUnitTest.class, "getOnDeltaEnabledServer");
-    server3.invoke(P2PDeltaPropagationDUnitTest.class, "getOnDeltaEnabledServer");
+    server2.invoke(() -> P2PDeltaPropagationDUnitTest.getOnDeltaEnabledServer());
+    server3.invoke(() -> P2PDeltaPropagationDUnitTest.getOnDeltaEnabledServer());
   }
   
   /*
@@ -127,20 +127,17 @@ public class P2PDeltaPropagationDUnitTest extends DistributedTestCase
    */
   public void testP2PDACKInvalidDeltaException() throws Exception
   {
-    server1.invoke(P2PDeltaPropagationDUnitTest.class,
-    "createServerCache", new Object[] {Boolean.TRUE});
-    server2.invoke(P2PDeltaPropagationDUnitTest.class,
-    "createServerCache",new Object[] {Boolean.TRUE});
-    server3.invoke(P2PDeltaPropagationDUnitTest.class,
-    "createServerCache",new Object[] {Boolean.TRUE});     
+    server1.invoke(() -> P2PDeltaPropagationDUnitTest.createServerCache(Boolean.TRUE));
+    server2.invoke(() -> P2PDeltaPropagationDUnitTest.createServerCache(Boolean.TRUE));
+    server3.invoke(() -> P2PDeltaPropagationDUnitTest.createServerCache(Boolean.TRUE));     
    
     //Delta apply should fail on server2 and server3 as values are not there
-    server2.invoke(P2PDeltaPropagationDUnitTest.class, "invalidate");
-    server3.invoke(P2PDeltaPropagationDUnitTest.class, "destroy");
-    server1.invoke(P2PDeltaPropagationDUnitTest.class, "putDelta");
+    server2.invoke(() -> P2PDeltaPropagationDUnitTest.invalidate());
+    server3.invoke(() -> P2PDeltaPropagationDUnitTest.destroy());
+    server1.invoke(() -> P2PDeltaPropagationDUnitTest.putDelta());
     Thread.sleep(5000);
-    server2.invoke(P2PDeltaPropagationDUnitTest.class, "getOnDeltaEnabledWithInvalidate");//Full object
-    server3.invoke(P2PDeltaPropagationDUnitTest.class, "getOnDeltaEnabledWithDestroy");
+    server2.invoke(() -> P2PDeltaPropagationDUnitTest.getOnDeltaEnabledWithInvalidate());//Full object
+    server3.invoke(() -> P2PDeltaPropagationDUnitTest.getOnDeltaEnabledWithDestroy());
   }
   
   /*
@@ -156,7 +153,7 @@ public class P2PDeltaPropagationDUnitTest extends DistributedTestCase
     server1.invoke(P2PDeltaPropagationDUnitTest.class, "createServerCache",args);      
     put();
     Thread.sleep(5000);
-    server1.invoke(P2PDeltaPropagationDUnitTest.class, "getOnDeltaEnabledServer");
+    server1.invoke(() -> P2PDeltaPropagationDUnitTest.getOnDeltaEnabledServer());
     
     ConnectionTable.threadWantsSharedResources();
   }
@@ -170,9 +167,9 @@ public class P2PDeltaPropagationDUnitTest extends DistributedTestCase
         Scope.DISTRIBUTED_NO_ACK, Boolean.FALSE };
     server1.invoke(P2PDeltaPropagationDUnitTest.class, "createServerCache",args);
     server2.invoke(P2PDeltaPropagationDUnitTest.class, "createServerCache",args);
-    server1.invoke(P2PDeltaPropagationDUnitTest.class, "put");
+    server1.invoke(() -> P2PDeltaPropagationDUnitTest.put());
     Thread.sleep(5000);
-    server2.invoke(P2PDeltaPropagationDUnitTest.class, "getOnDeltaDisabledServer");
+    server2.invoke(() -> P2PDeltaPropagationDUnitTest.getOnDeltaDisabledServer());
   }
   
   
@@ -181,12 +178,10 @@ public class P2PDeltaPropagationDUnitTest extends DistributedTestCase
    */
   public void testP2PDeltaPropagationDisable() throws Exception
   {
-    server1.invoke(P2PDeltaPropagationDUnitTest.class,
-    "createServerCache", new Object[] {Boolean.FALSE});
-    server2.invoke(P2PDeltaPropagationDUnitTest.class,
-    "createServerCache",new Object[] {Boolean.FALSE}); 
-    server1.invoke(P2PDeltaPropagationDUnitTest.class, "put");
-    server2.invoke(P2PDeltaPropagationDUnitTest.class, "getOnDeltaDisabledServer");
+    server1.invoke(() -> P2PDeltaPropagationDUnitTest.createServerCache(Boolean.FALSE));
+    server2.invoke(() -> P2PDeltaPropagationDUnitTest.createServerCache(Boolean.FALSE)); 
+    server1.invoke(() -> P2PDeltaPropagationDUnitTest.put());
+    server2.invoke(() -> P2PDeltaPropagationDUnitTest.getOnDeltaDisabledServer());
   }
 
   /*
@@ -205,12 +200,10 @@ public class P2PDeltaPropagationDUnitTest extends DistributedTestCase
     server3.invoke(P2PDeltaPropagationDUnitTest.class, "createServerCache",
         args);
     // only delta should get send to server2 and server3
-    server1.invoke(P2PDeltaPropagationDUnitTest.class, "put");
+    server1.invoke(() -> P2PDeltaPropagationDUnitTest.put());
     Thread.sleep(5000);
-    server2.invoke(P2PDeltaPropagationDUnitTest.class,
-        "getOnDeltaEnabledServer");
-    server3.invoke(P2PDeltaPropagationDUnitTest.class,
-        "getOnDeltaEnabledServer");
+    server2.invoke(() -> P2PDeltaPropagationDUnitTest.getOnDeltaEnabledServer());
+    server3.invoke(() -> P2PDeltaPropagationDUnitTest.getOnDeltaEnabledServer());
   } 
   
   /*
@@ -229,17 +222,15 @@ public class P2PDeltaPropagationDUnitTest extends DistributedTestCase
     server3.invoke(P2PDeltaPropagationDUnitTest.class, "createServerCache",
         args);
     /* clean flags */
-    server1.invoke(P2PDeltaPropagationDUnitTest.class,"resetFlags");
-    server2.invoke(P2PDeltaPropagationDUnitTest.class,"resetFlags");    
-    server3.invoke(P2PDeltaPropagationDUnitTest.class,"resetFlags");
+    server1.invoke(() -> P2PDeltaPropagationDUnitTest.resetFlags());
+    server2.invoke(() -> P2PDeltaPropagationDUnitTest.resetFlags());    
+    server3.invoke(() -> P2PDeltaPropagationDUnitTest.resetFlags());
     
     // only delta should get send to server2 and server3
-    server1.invoke(P2PDeltaPropagationDUnitTest.class, "create");
+    server1.invoke(() -> P2PDeltaPropagationDUnitTest.create());
     
-    server2.invoke(P2PDeltaPropagationDUnitTest.class,
-        "verifyNoFailurePeer");
-    server3.invoke(P2PDeltaPropagationDUnitTest.class,
-        "verifyNoFailurePeer");
+    server2.invoke(() -> P2PDeltaPropagationDUnitTest.verifyNoFailurePeer());
+    server3.invoke(() -> P2PDeltaPropagationDUnitTest.verifyNoFailurePeer());
   }
 
   public void testPeerWithEmptyRegionIterestPolicyALLReceivesNoDelta() throws Exception {
@@ -260,12 +251,10 @@ public class P2PDeltaPropagationDUnitTest extends DistributedTestCase
     server3.invoke(P2PDeltaPropagationDUnitTest.class, "createServerCache",
         empty);
 
-    server1.invoke(P2PDeltaPropagationDUnitTest.class, "put");
+    server1.invoke(() -> P2PDeltaPropagationDUnitTest.put());
 
-    server2.invoke(P2PDeltaPropagationDUnitTest.class, "verifyDeltaReceived",
-        new Object[] { Integer.valueOf(3) });
-    server3.invoke(P2PDeltaPropagationDUnitTest.class, "verifyNoDeltaReceived",
-        new Object[] { Integer.valueOf(3) });
+    server2.invoke(() -> P2PDeltaPropagationDUnitTest.verifyDeltaReceived( Integer.valueOf(3) ));
+    server3.invoke(() -> P2PDeltaPropagationDUnitTest.verifyNoDeltaReceived( Integer.valueOf(3) ));
   }
 
   public void testPeerWithEmptyRegionDefaultIterestPolicyReceivesNoEvents() throws Exception {
@@ -286,12 +275,10 @@ public class P2PDeltaPropagationDUnitTest extends DistributedTestCase
     server3.invoke(P2PDeltaPropagationDUnitTest.class, "createServerCache",
         empty);
 
-    server1.invoke(P2PDeltaPropagationDUnitTest.class, "put");
+    server1.invoke(() -> P2PDeltaPropagationDUnitTest.put());
 
-    server2.invoke(P2PDeltaPropagationDUnitTest.class, "verifyDeltaReceived",
-        new Object[] { Integer.valueOf(3) });
-    server3.invoke(P2PDeltaPropagationDUnitTest.class, "verifyNoDeltaReceived",
-        new Object[] { Integer.valueOf(0/* no events */) });
+    server2.invoke(() -> P2PDeltaPropagationDUnitTest.verifyDeltaReceived( Integer.valueOf(3) ));
+    server3.invoke(() -> P2PDeltaPropagationDUnitTest.verifyNoDeltaReceived( Integer.valueOf(0/* no events */) ));
   }
 
   public void testPeerWithEmptyRegionAndNoCacheServerReceivesOnlyFullValue() throws Exception {
@@ -319,12 +306,10 @@ public class P2PDeltaPropagationDUnitTest extends DistributedTestCase
     server3.invoke(P2PDeltaPropagationDUnitTest.class, "createServerCache",
         emptyWithoutServer);
 
-    server1.invoke(P2PDeltaPropagationDUnitTest.class, "put");
+    server1.invoke(() -> P2PDeltaPropagationDUnitTest.put());
 
-    server2.invoke(P2PDeltaPropagationDUnitTest.class, "verifyDeltaBytesReceived",
-        new Object[] { Integer.valueOf(2) });
-    server3.invoke(P2PDeltaPropagationDUnitTest.class, "verifyDeltaBytesReceived",
-        new Object[] { Integer.valueOf(0) });
+    server2.invoke(() -> P2PDeltaPropagationDUnitTest.verifyDeltaBytesReceived( Integer.valueOf(2) ));
+    server3.invoke(() -> P2PDeltaPropagationDUnitTest.verifyDeltaBytesReceived( Integer.valueOf(0) ));
   }
 
   public static void put() throws Exception
@@ -423,9 +408,9 @@ public class P2PDeltaPropagationDUnitTest extends DistributedTestCase
     server2 = host.getVM(1);
     server3 = host.getVM(2);
     resetFlags();
-    server1.invoke(P2PDeltaPropagationDUnitTest.class, "resetFlags");
-    server2.invoke(P2PDeltaPropagationDUnitTest.class, "resetFlags");
-    server3.invoke(P2PDeltaPropagationDUnitTest.class, "resetFlags");
+    server1.invoke(() -> P2PDeltaPropagationDUnitTest.resetFlags());
+    server2.invoke(() -> P2PDeltaPropagationDUnitTest.resetFlags());
+    server3.invoke(() -> P2PDeltaPropagationDUnitTest.resetFlags());
   }
 
   private Cache createCache(Properties props) throws Exception
@@ -513,9 +498,9 @@ public class P2PDeltaPropagationDUnitTest extends DistributedTestCase
   @Override
   protected final void preTearDown() throws Exception {
     closeCache();
-    server1.invoke(P2PDeltaPropagationDUnitTest.class, "closeCache");
-    server2.invoke(P2PDeltaPropagationDUnitTest.class, "closeCache");
-    server3.invoke(P2PDeltaPropagationDUnitTest.class, "closeCache");
+    server1.invoke(() -> P2PDeltaPropagationDUnitTest.closeCache());
+    server2.invoke(() -> P2PDeltaPropagationDUnitTest.closeCache());
+    server3.invoke(() -> P2PDeltaPropagationDUnitTest.closeCache());
   }
 
   public static void closeCache()

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/69024aa9/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionSingleHopDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionSingleHopDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionSingleHopDUnitTest.java
index 55fed01..558dd0b 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionSingleHopDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionSingleHopDUnitTest.java
@@ -252,65 +252,41 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase {
 
   // 2 peers 2 servers 1 accessor.No client.Should work without any exceptions.
   public void test_NoClient() {
-    member0.invoke(
-        PartitionedRegionSingleHopDUnitTest.class, "createServer",
-        new Object[] { 1, 4 });
-    member1.invoke(
-        PartitionedRegionSingleHopDUnitTest.class, "createServer",
-        new Object[] { 1, 4 });
+    member0.invoke(() -> PartitionedRegionSingleHopDUnitTest.createServer( 1, 4 ));
+    member1.invoke(() -> PartitionedRegionSingleHopDUnitTest.createServer( 1, 4 ));
 
-    member2.invoke(PartitionedRegionSingleHopDUnitTest.class, "createPeer");
-    member3.invoke(PartitionedRegionSingleHopDUnitTest.class, "createPeer");
+    member2.invoke(() -> PartitionedRegionSingleHopDUnitTest.createPeer());
+    member3.invoke(() -> PartitionedRegionSingleHopDUnitTest.createPeer());
 
     createAccessorServer();
-    member0.invoke(PartitionedRegionSingleHopDUnitTest.class,
-        "clearMetadata");
-    member1.invoke(PartitionedRegionSingleHopDUnitTest.class,
-        "clearMetadata");
-    member2.invoke(PartitionedRegionSingleHopDUnitTest.class,
-        "clearMetadata");
-    member3.invoke(PartitionedRegionSingleHopDUnitTest.class,
-        "clearMetadata");
+    member0.invoke(() -> PartitionedRegionSingleHopDUnitTest.clearMetadata());
+    member1.invoke(() -> PartitionedRegionSingleHopDUnitTest.clearMetadata());
+    member2.invoke(() -> PartitionedRegionSingleHopDUnitTest.clearMetadata());
+    member3.invoke(() -> PartitionedRegionSingleHopDUnitTest.clearMetadata());
     clearMetadata();
 
-    member0.invoke(PartitionedRegionSingleHopDUnitTest.class,
-        "putIntoPartitionedRegions");
-    member1.invoke(PartitionedRegionSingleHopDUnitTest.class,
-        "putIntoPartitionedRegions");
-    member2.invoke(PartitionedRegionSingleHopDUnitTest.class,
-        "putIntoPartitionedRegions");
-    member3.invoke(PartitionedRegionSingleHopDUnitTest.class,
-        "putIntoPartitionedRegions");
+    member0.invoke(() -> PartitionedRegionSingleHopDUnitTest.putIntoPartitionedRegions());
+    member1.invoke(() -> PartitionedRegionSingleHopDUnitTest.putIntoPartitionedRegions());
+    member2.invoke(() -> PartitionedRegionSingleHopDUnitTest.putIntoPartitionedRegions());
+    member3.invoke(() -> PartitionedRegionSingleHopDUnitTest.putIntoPartitionedRegions());
     putIntoPartitionedRegions();
 
-    member0.invoke(PartitionedRegionSingleHopDUnitTest.class,
-        "getFromPartitionedRegions");
-    member1.invoke(PartitionedRegionSingleHopDUnitTest.class,
-        "getFromPartitionedRegions");
-    member2.invoke(PartitionedRegionSingleHopDUnitTest.class,
-        "getFromPartitionedRegions");
-    member3.invoke(PartitionedRegionSingleHopDUnitTest.class,
-        "getFromPartitionedRegions");
+    member0.invoke(() -> PartitionedRegionSingleHopDUnitTest.getFromPartitionedRegions());
+    member1.invoke(() -> PartitionedRegionSingleHopDUnitTest.getFromPartitionedRegions());
+    member2.invoke(() -> PartitionedRegionSingleHopDUnitTest.getFromPartitionedRegions());
+    member3.invoke(() -> PartitionedRegionSingleHopDUnitTest.getFromPartitionedRegions());
     getFromPartitionedRegions();
 
-    member0.invoke(PartitionedRegionSingleHopDUnitTest.class,
-        "verifyEmptyMetadata");
-    member1.invoke(PartitionedRegionSingleHopDUnitTest.class,
-        "verifyEmptyMetadata");
-    member2.invoke(PartitionedRegionSingleHopDUnitTest.class,
-        "verifyEmptyMetadata");
-    member3.invoke(PartitionedRegionSingleHopDUnitTest.class,
-        "verifyEmptyMetadata");
+    member0.invoke(() -> PartitionedRegionSingleHopDUnitTest.verifyEmptyMetadata());
+    member1.invoke(() -> PartitionedRegionSingleHopDUnitTest.verifyEmptyMetadata());
+    member2.invoke(() -> PartitionedRegionSingleHopDUnitTest.verifyEmptyMetadata());
+    member3.invoke(() -> PartitionedRegionSingleHopDUnitTest.verifyEmptyMetadata());
     verifyEmptyMetadata();
 
-    member0.invoke(PartitionedRegionSingleHopDUnitTest.class,
-        "verifyEmptyStaticData");
-    member1.invoke(PartitionedRegionSingleHopDUnitTest.class,
-        "verifyEmptyStaticData");
-    member2.invoke(PartitionedRegionSingleHopDUnitTest.class,
-        "verifyEmptyStaticData");
-    member3.invoke(PartitionedRegionSingleHopDUnitTest.class,
-        "verifyEmptyStaticData");
+    member0.invoke(() -> PartitionedRegionSingleHopDUnitTest.verifyEmptyStaticData());
+    member1.invoke(() -> PartitionedRegionSingleHopDUnitTest.verifyEmptyStaticData());
+    member2.invoke(() -> PartitionedRegionSingleHopDUnitTest.verifyEmptyStaticData());
+    member3.invoke(() -> PartitionedRegionSingleHopDUnitTest.verifyEmptyStaticData());
     verifyEmptyStaticData();
   }
 
@@ -318,14 +294,12 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase {
   // 1 Client connected to 2 AccessorServers. Hence metadata should not be
   // fetched.
   public void test_ClientConnectedToAccessors() {
-    Integer port0 = (Integer)member0.invoke(
-        PartitionedRegionSingleHopDUnitTest.class, "createAccessorServer");
-    Integer port1 = (Integer)member1.invoke(
-        PartitionedRegionSingleHopDUnitTest.class, "createAccessorServer");
+    Integer port0 = (Integer)member0.invoke(() -> PartitionedRegionSingleHopDUnitTest.createAccessorServer());
+    Integer port1 = (Integer)member1.invoke(() -> PartitionedRegionSingleHopDUnitTest.createAccessorServer());
 
-    member2.invoke(PartitionedRegionSingleHopDUnitTest.class, "createPeer");
+    member2.invoke(() -> PartitionedRegionSingleHopDUnitTest.createPeer());
 
-    member3.invoke(PartitionedRegionSingleHopDUnitTest.class, "createPeer");
+    member3.invoke(() -> PartitionedRegionSingleHopDUnitTest.createPeer());
 
     createClient(port0, port1);
 
@@ -341,15 +315,12 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase {
   // 1 server 2 accesorservers 2 peers.i client connected to the server
   // Since only 1 server hence Metadata should not be fetched.
   public void test_ClientConnectedTo1Server() {
-    Integer port0 = (Integer)member0.invoke(
-        PartitionedRegionSingleHopDUnitTest.class, "createServer",
-        new Object[] { 1, 4 });
+    Integer port0 = (Integer)member0.invoke(() -> PartitionedRegionSingleHopDUnitTest.createServer( 1, 4 ));
 
-    member1.invoke(PartitionedRegionSingleHopDUnitTest.class, "createPeer");
-    member2.invoke(PartitionedRegionSingleHopDUnitTest.class, "createPeer");
+    member1.invoke(() -> PartitionedRegionSingleHopDUnitTest.createPeer());
+    member2.invoke(() -> PartitionedRegionSingleHopDUnitTest.createPeer());
 
-    member3.invoke(PartitionedRegionSingleHopDUnitTest.class,
-        "createAccessorServer");
+    member3.invoke(() -> PartitionedRegionSingleHopDUnitTest.createAccessorServer());
 
     createClient(port0);
 
@@ -367,28 +338,20 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase {
   // Now verify that metadata has all 8 buckets info.
   // Now update and ensure the fetch service is never called.
   public void test_MetadataContents() {
-    Integer port0 = (Integer)member0.invoke(
-        PartitionedRegionSingleHopDUnitTest.class, "createServer",
-        new Object[] { 1, 4 });
-    Integer port1 = (Integer)member1.invoke(
-        PartitionedRegionSingleHopDUnitTest.class, "createServer",
-        new Object[] { 1, 4 });
-    Integer port2 = (Integer)member2.invoke(
-        PartitionedRegionSingleHopDUnitTest.class, "createServer",
-        new Object[] { 1, 4 });
-    Integer port3 = (Integer)member3.invoke(
-        PartitionedRegionSingleHopDUnitTest.class, "createServer",
-        new Object[] { 1, 4 });
+    Integer port0 = (Integer)member0.invoke(() -> PartitionedRegionSingleHopDUnitTest.createServer( 1, 4 ));
+    Integer port1 = (Integer)member1.invoke(() -> PartitionedRegionSingleHopDUnitTest.createServer( 1, 4 ));
+    Integer port2 = (Integer)member2.invoke(() -> PartitionedRegionSingleHopDUnitTest.createServer( 1, 4 ));
+    Integer port3 = (Integer)member3.invoke(() -> PartitionedRegionSingleHopDUnitTest.createServer( 1, 4 ));
     createClient(port0, port1, port2, port3);
 
     putIntoPartitionedRegions();
 
     getFromPartitionedRegions();
 
-    member0.invoke(PartitionedRegionSingleHopDUnitTest.class, "printView");
-    member1.invoke(PartitionedRegionSingleHopDUnitTest.class, "printView");
-    member2.invoke(PartitionedRegionSingleHopDUnitTest.class, "printView");
-    member3.invoke(PartitionedRegionSingleHopDUnitTest.class, "printView");
+    member0.invoke(() -> PartitionedRegionSingleHopDUnitTest.printView());
+    member1.invoke(() -> PartitionedRegionSingleHopDUnitTest.printView());
+    member2.invoke(() -> PartitionedRegionSingleHopDUnitTest.printView());
+    member3.invoke(() -> PartitionedRegionSingleHopDUnitTest.printView());
 
     verifyMetadata();
     updateIntoSinglePR();
@@ -400,22 +363,17 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase {
   // fetchservice has to be triggered.
   // Now put again from c2.There should be no hop at all.
   public void test_MetadataServiceCallAccuracy() {
-    Integer port0 = (Integer)member0.invoke(
-        PartitionedRegionSingleHopDUnitTest.class, "createServer",
-        new Object[] { 1, 4 });
-    Integer port1 = (Integer)member1.invoke(
-        PartitionedRegionSingleHopDUnitTest.class, "createServer",
-        new Object[] { 1, 4 });
-
-    member2.invoke(PartitionedRegionSingleHopDUnitTest.class, "createClient",
-        new Object[] { port0 });
+    Integer port0 = (Integer)member0.invoke(() -> PartitionedRegionSingleHopDUnitTest.createServer( 1, 4 ));
+    Integer port1 = (Integer)member1.invoke(() -> PartitionedRegionSingleHopDUnitTest.createServer( 1, 4 ));
+
+    member2.invoke(() -> PartitionedRegionSingleHopDUnitTest.createClient( port0 ));
     createClient(port1);
 
     member2
-        .invoke(PartitionedRegionSingleHopDUnitTest.class, "putIntoSinglePR");
+        .invoke(() -> PartitionedRegionSingleHopDUnitTest.putIntoSinglePR());
 
-    member0.invoke(PartitionedRegionSingleHopDUnitTest.class, "printView");
-    member1.invoke(PartitionedRegionSingleHopDUnitTest.class, "printView");
+    member0.invoke(() -> PartitionedRegionSingleHopDUnitTest.printView());
+    member1.invoke(() -> PartitionedRegionSingleHopDUnitTest.printView());
     final ClientMetadataService cms = ((GemFireCacheImpl)cache).getClientMetadataService();
     cms.satisfyRefreshMetadata_TEST_ONLY(false);
     
@@ -459,22 +417,17 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase {
   }
 
   public void test_MetadataServiceCallAccuracy_FromDestroyOp() {
-    Integer port0 = (Integer)member0.invoke(
-        PartitionedRegionSingleHopDUnitTest.class, "createServer",
-        new Object[] { 0, 4 });
-    Integer port1 = (Integer)member1.invoke(
-        PartitionedRegionSingleHopDUnitTest.class, "createServer",
-        new Object[] { 0, 4 });
-
-    member2.invoke(PartitionedRegionSingleHopDUnitTest.class, "createClient",
-        new Object[] { port0 });
+    Integer port0 = (Integer)member0.invoke(() -> PartitionedRegionSingleHopDUnitTest.createServer( 0, 4 ));
+    Integer port1 = (Integer)member1.invoke(() -> PartitionedRegionSingleHopDUnitTest.createServer( 0, 4 ));
+
+    member2.invoke(() -> PartitionedRegionSingleHopDUnitTest.createClient( port0 ));
     createClient(port1);
 
     member2
-        .invoke(PartitionedRegionSingleHopDUnitTest.class, "putIntoSinglePR");
+        .invoke(() -> PartitionedRegionSingleHopDUnitTest.putIntoSinglePR());
 
-    member0.invoke(PartitionedRegionSingleHopDUnitTest.class, "printView");
-    member1.invoke(PartitionedRegionSingleHopDUnitTest.class, "printView");
+    member0.invoke(() -> PartitionedRegionSingleHopDUnitTest.printView());
+    member1.invoke(() -> PartitionedRegionSingleHopDUnitTest.printView());
     final ClientMetadataService cms = ((GemFireCacheImpl)cache).getClientMetadataService();
     cms.satisfyRefreshMetadata_TEST_ONLY(false);
     
@@ -500,22 +453,16 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase {
   }
 
   public void test_MetadataServiceCallAccuracy_FromGetOp() {
-    Integer port0 = (Integer)member0.invoke(
-        PartitionedRegionSingleHopDUnitTest.class, "createServer",
-        new Object[] { 0, 4 });
-    Integer port1 = (Integer)member1.invoke(
-        PartitionedRegionSingleHopDUnitTest.class, "createServer",
-        new Object[] { 0, 4 });
-
-    member2.invoke(PartitionedRegionSingleHopDUnitTest.class, "createClient",
-        new Object[] { port0 });
+    Integer port0 = (Integer)member0.invoke(() -> PartitionedRegionSingleHopDUnitTest.createServer( 0, 4 ));
+    Integer port1 = (Integer)member1.invoke(() -> PartitionedRegionSingleHopDUnitTest.createServer( 0, 4 ));
+
+    member2.invoke(() -> PartitionedRegionSingleHopDUnitTest.createClient( port0 ));
     createClient(port1);
 
-    member2.invoke(PartitionedRegionSingleHopDUnitTest.class,
-        "putIntoSinglePR");
+    member2.invoke(() -> PartitionedRegionSingleHopDUnitTest.putIntoSinglePR());
 
-    member0.invoke(PartitionedRegionSingleHopDUnitTest.class, "printView");
-    member1.invoke(PartitionedRegionSingleHopDUnitTest.class, "printView");
+    member0.invoke(() -> PartitionedRegionSingleHopDUnitTest.printView());
+    member1.invoke(() -> PartitionedRegionSingleHopDUnitTest.printView());
     final ClientMetadataService cms = ((GemFireCacheImpl)cache).getClientMetadataService();
     cms.satisfyRefreshMetadata_TEST_ONLY(false);
 
@@ -552,18 +499,10 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase {
   }
 
   public void test_SingleHopWithHA() {
-    Integer port0 = (Integer)member0.invoke(
-        PartitionedRegionSingleHopDUnitTest.class, "createServer",
-        new Object[] { 0, 8 });
-    Integer port1 = (Integer)member1.invoke(
-        PartitionedRegionSingleHopDUnitTest.class, "createServer",
-        new Object[] { 0, 8 });
-    Integer port2 = (Integer)member2.invoke(
-        PartitionedRegionSingleHopDUnitTest.class, "createServer",
-        new Object[] { 0, 8 });
-    Integer port3 = (Integer)member3.invoke(
-        PartitionedRegionSingleHopDUnitTest.class, "createServer",
-        new Object[] { 0, 8 });
+    Integer port0 = (Integer)member0.invoke(() -> PartitionedRegionSingleHopDUnitTest.createServer( 0, 8 ));
+    Integer port1 = (Integer)member1.invoke(() -> PartitionedRegionSingleHopDUnitTest.createServer( 0, 8 ));
+    Integer port2 = (Integer)member2.invoke(() -> PartitionedRegionSingleHopDUnitTest.createServer( 0, 8 ));
+    Integer port3 = (Integer)member3.invoke(() -> PartitionedRegionSingleHopDUnitTest.createServer( 0, 8 ));
     createClient(port0, port1, port2, port3);
     final ClientMetadataService cms = ((GemFireCacheImpl)cache).getClientMetadataService();
     cms.satisfyRefreshMetadata_TEST_ONLY(false);
@@ -593,7 +532,7 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase {
     Wait.waitForCriterion(wc, 60000, 1000, true);
 
     // kill server
-    member0.invoke(PartitionedRegionSingleHopDUnitTest.class, "stopServer");
+    member0.invoke(() -> PartitionedRegionSingleHopDUnitTest.stopServer());
 
     // again update
     for (int i = 1; i <= 16; i++) {
@@ -605,19 +544,12 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase {
     int port3 = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
     final String host0 = NetworkUtils.getServerHostName(member3.getHost());
     final String locator = host0 + "[" + port3 + "]";
-    member3.invoke(PartitionedRegionSingleHopDUnitTest.class,
-        "startLocatorInVM", new Object[] { port3 });
+    member3.invoke(() -> PartitionedRegionSingleHopDUnitTest.startLocatorInVM( port3 ));
     try {
 
-    Integer port0 = (Integer)member0.invoke(
-        PartitionedRegionSingleHopDUnitTest.class, "createServerWithLocator",
-        new Object[] { locator, 0, 8 });
-    Integer port1 = (Integer)member1.invoke(
-        PartitionedRegionSingleHopDUnitTest.class, "createServerWithLocator",
-        new Object[] { locator, 0, 8 });
-    Integer port2 = (Integer)member2.invoke(
-        PartitionedRegionSingleHopDUnitTest.class, "createServerWithLocator",
-        new Object[] { locator, 0, 8 });
+    Integer port0 = (Integer)member0.invoke(() -> PartitionedRegionSingleHopDUnitTest.createServerWithLocator( locator, 0, 8 ));
+    Integer port1 = (Integer)member1.invoke(() -> PartitionedRegionSingleHopDUnitTest.createServerWithLocator( locator, 0, 8 ));
+    Integer port2 = (Integer)member2.invoke(() -> PartitionedRegionSingleHopDUnitTest.createServerWithLocator( locator, 0, 8 ));
 
     createClientWithLocator(host0, port3);
 
@@ -632,7 +564,7 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase {
     }
 
     // kill server
-    member0.invoke(PartitionedRegionSingleHopDUnitTest.class, "stopServer");
+    member0.invoke(() -> PartitionedRegionSingleHopDUnitTest.stopServer());
 
     // again update
     for (int i = 1; i <= 16; i++) {
@@ -640,29 +572,23 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase {
     }
 
     } finally {
-    member3.invoke(PartitionedRegionSingleHopDUnitTest.class, "stopLocator");
+    member3.invoke(() -> PartitionedRegionSingleHopDUnitTest.stopLocator());
     }
   }
 
   
   public void test_NoMetadataServiceCall_ForGetOp() {
-    Integer port0 = (Integer)member0.invoke(
-        PartitionedRegionSingleHopDUnitTest.class, "createServer",
-        new Object[] { 0, 4 });
-    Integer port1 = (Integer)member1.invoke(
-        PartitionedRegionSingleHopDUnitTest.class, "createServer",
-        new Object[] { 0, 4 });
-
-    member2.invoke(PartitionedRegionSingleHopDUnitTest.class, "createClientWithoutPRSingleHopEnabled",
-        new Object[] { port0 });
+    Integer port0 = (Integer)member0.invoke(() -> PartitionedRegionSingleHopDUnitTest.createServer( 0, 4 ));
+    Integer port1 = (Integer)member1.invoke(() -> PartitionedRegionSingleHopDUnitTest.createServer( 0, 4 ));
+
+    member2.invoke(() -> PartitionedRegionSingleHopDUnitTest.createClientWithoutPRSingleHopEnabled( port0 ));
     createClientWithoutPRSingleHopEnabled(port1);
     ClientMetadataService cms = ((GemFireCacheImpl)cache).getClientMetadataService();
     cms.satisfyRefreshMetadata_TEST_ONLY(false);
-    member2.invoke(PartitionedRegionSingleHopDUnitTest.class,
-        "putIntoSinglePR");
+    member2.invoke(() -> PartitionedRegionSingleHopDUnitTest.putIntoSinglePR());
 
-    member0.invoke(PartitionedRegionSingleHopDUnitTest.class, "printView");
-    member1.invoke(PartitionedRegionSingleHopDUnitTest.class, "printView");
+    member0.invoke(() -> PartitionedRegionSingleHopDUnitTest.printView());
+    member1.invoke(() -> PartitionedRegionSingleHopDUnitTest.printView());
 
     region.get(new Integer(0));
     region.get(new Integer(1));
@@ -683,24 +609,19 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase {
 
 
  public void test_NoMetadataServiceCall() {
-    Integer port0 = (Integer)member0.invoke(
-        PartitionedRegionSingleHopDUnitTest.class, "createServer",
-        new Object[] { 1, 4 });
-    Integer port1 = (Integer)member1.invoke(
-        PartitionedRegionSingleHopDUnitTest.class, "createServer",
-        new Object[] { 1, 4 });
-
-    member2.invoke(PartitionedRegionSingleHopDUnitTest.class, "createClientWithoutPRSingleHopEnabled",
-        new Object[] { port0 });
+    Integer port0 = (Integer)member0.invoke(() -> PartitionedRegionSingleHopDUnitTest.createServer( 1, 4 ));
+    Integer port1 = (Integer)member1.invoke(() -> PartitionedRegionSingleHopDUnitTest.createServer( 1, 4 ));
+
+    member2.invoke(() -> PartitionedRegionSingleHopDUnitTest.createClientWithoutPRSingleHopEnabled( port0 ));
     createClientWithoutPRSingleHopEnabled(port1);
 
     member2
-        .invoke(PartitionedRegionSingleHopDUnitTest.class, "putIntoSinglePR");
+        .invoke(() -> PartitionedRegionSingleHopDUnitTest.putIntoSinglePR());
     ClientMetadataService cms = ((GemFireCacheImpl)cache).getClientMetadataService();
     cms.satisfyRefreshMetadata_TEST_ONLY(false);
     
-    member0.invoke(PartitionedRegionSingleHopDUnitTest.class, "printView");
-    member1.invoke(PartitionedRegionSingleHopDUnitTest.class, "printView");
+    member0.invoke(() -> PartitionedRegionSingleHopDUnitTest.printView());
+    member1.invoke(() -> PartitionedRegionSingleHopDUnitTest.printView());
 
  
     region.put(new Integer(0), "create0");
@@ -737,22 +658,17 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase {
   }
 
   public void test_NoMetadataServiceCall_ForDestroyOp() {
-    Integer port0 = (Integer)member0.invoke(
-        PartitionedRegionSingleHopDUnitTest.class, "createServer",
-        new Object[] { 0, 4 });
-    Integer port1 = (Integer)member1.invoke(
-        PartitionedRegionSingleHopDUnitTest.class, "createServer",
-        new Object[] { 0, 4 });
-
-    member2.invoke(PartitionedRegionSingleHopDUnitTest.class, "createClientWithoutPRSingleHopEnabled",
-        new Object[] { port0 });
+    Integer port0 = (Integer)member0.invoke(() -> PartitionedRegionSingleHopDUnitTest.createServer( 0, 4 ));
+    Integer port1 = (Integer)member1.invoke(() -> PartitionedRegionSingleHopDUnitTest.createServer( 0, 4 ));
+
+    member2.invoke(() -> PartitionedRegionSingleHopDUnitTest.createClientWithoutPRSingleHopEnabled( port0 ));
     createClientWithoutPRSingleHopEnabled(port1);
 
     member2
-        .invoke(PartitionedRegionSingleHopDUnitTest.class, "putIntoSinglePR");
+        .invoke(() -> PartitionedRegionSingleHopDUnitTest.putIntoSinglePR());
 
-    member0.invoke(PartitionedRegionSingleHopDUnitTest.class, "printView");
-    member1.invoke(PartitionedRegionSingleHopDUnitTest.class, "printView");
+    member0.invoke(() -> PartitionedRegionSingleHopDUnitTest.printView());
+    member1.invoke(() -> PartitionedRegionSingleHopDUnitTest.printView());
     ClientMetadataService cms = ((GemFireCacheImpl)cache).getClientMetadataService();
     cms.satisfyRefreshMetadata_TEST_ONLY(false);
     region.destroy(new Integer(0));
@@ -764,18 +680,10 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase {
   }
 
   public void testServerLocationRemovalThroughPing() {
-    Integer port0 = (Integer)member0.invoke(
-        PartitionedRegionSingleHopDUnitTest.class, "createServer",
-        new Object[] { 3, 4 });
-    Integer port1 = (Integer)member1.invoke(
-        PartitionedRegionSingleHopDUnitTest.class, "createServer",
-        new Object[] { 3, 4 });
-    Integer port2 = (Integer)member2.invoke(
-        PartitionedRegionSingleHopDUnitTest.class, "createServer",
-        new Object[] { 3, 4 });
-    Integer port3 = (Integer)member3.invoke(
-        PartitionedRegionSingleHopDUnitTest.class, "createServer",
-        new Object[] { 3, 4 });
+    Integer port0 = (Integer)member0.invoke(() -> PartitionedRegionSingleHopDUnitTest.createServer( 3, 4 ));
+    Integer port1 = (Integer)member1.invoke(() -> PartitionedRegionSingleHopDUnitTest.createServer( 3, 4 ));
+    Integer port2 = (Integer)member2.invoke(() -> PartitionedRegionSingleHopDUnitTest.createServer( 3, 4 ));
+    Integer port3 = (Integer)member3.invoke(() -> PartitionedRegionSingleHopDUnitTest.createServer( 3, 4 ));
     createClient(port0, port1, port2, port3);
     putIntoPartitionedRegions();    
     getFromPartitionedRegions();
@@ -794,8 +702,8 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase {
     for (Entry entry : prMetaData.getBucketServerLocationsMap_TEST_ONLY().entrySet()) {
       assertEquals(4, ((List)entry.getValue()).size());
     }
-    member0.invoke(PartitionedRegionSingleHopDUnitTest.class, "stopServer");
-    member1.invoke(PartitionedRegionSingleHopDUnitTest.class, "stopServer");
+    member0.invoke(() -> PartitionedRegionSingleHopDUnitTest.stopServer());
+    member1.invoke(() -> PartitionedRegionSingleHopDUnitTest.stopServer());
     Wait.pause(5000);//make sure that ping detects the dead servers
     getFromPartitionedRegions();
     verifyDeadServer(regionMetaData, customerRegion, port0, port1);
@@ -805,18 +713,10 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase {
   public void testMetadataFetchOnlyThroughFunctions() {
     //Workaround for 52004
     IgnoredException.addIgnoredException("InternalFunctionInvocationTargetException");
-    Integer port0 = (Integer)member0.invoke(
-        PartitionedRegionSingleHopDUnitTest.class, "createServer",
-        new Object[] { 3, 4 });
-    Integer port1 = (Integer)member1.invoke(
-        PartitionedRegionSingleHopDUnitTest.class, "createServer",
-        new Object[] { 3, 4 });
-    Integer port2 = (Integer)member2.invoke(
-        PartitionedRegionSingleHopDUnitTest.class, "createServer",
-        new Object[] { 3, 4 });
-    Integer port3 = (Integer)member3.invoke(
-        PartitionedRegionSingleHopDUnitTest.class, "createServer",
-        new Object[] { 3, 4 });
+    Integer port0 = (Integer)member0.invoke(() -> PartitionedRegionSingleHopDUnitTest.createServer( 3, 4 ));
+    Integer port1 = (Integer)member1.invoke(() -> PartitionedRegionSingleHopDUnitTest.createServer( 3, 4 ));
+    Integer port2 = (Integer)member2.invoke(() -> PartitionedRegionSingleHopDUnitTest.createServer( 3, 4 ));
+    Integer port3 = (Integer)member3.invoke(() -> PartitionedRegionSingleHopDUnitTest.createServer( 3, 4 ));
     createClient(port0, port1, port2, port3);
     executeFunctions();
     ClientMetadataService cms = ((GemFireCacheImpl)cache).getClientMetadataService();
@@ -870,18 +770,10 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase {
   }
 
   public void testMetadataFetchOnlyThroughputAll() {
-    Integer port0 = (Integer)member0.invoke(
-        PartitionedRegionSingleHopDUnitTest.class, "createServer",
-        new Object[] { 3, 4 });
-    Integer port1 = (Integer)member1.invoke(
-        PartitionedRegionSingleHopDUnitTest.class, "createServer",
-        new Object[] { 3, 4 });
-    Integer port2 = (Integer)member2.invoke(
-        PartitionedRegionSingleHopDUnitTest.class, "createServer",
-        new Object[] { 3, 4 });
-    Integer port3 = (Integer)member3.invoke(
-        PartitionedRegionSingleHopDUnitTest.class, "createServer",
-        new Object[] { 3, 4 });
+    Integer port0 = (Integer)member0.invoke(() -> PartitionedRegionSingleHopDUnitTest.createServer( 3, 4 ));
+    Integer port1 = (Integer)member1.invoke(() -> PartitionedRegionSingleHopDUnitTest.createServer( 3, 4 ));
+    Integer port2 = (Integer)member2.invoke(() -> PartitionedRegionSingleHopDUnitTest.createServer( 3, 4 ));
+    Integer port3 = (Integer)member3.invoke(() -> PartitionedRegionSingleHopDUnitTest.createServer( 3, 4 ));
     createClient(port0, port1, port2, port3);
     putAll();
     ClientMetadataService cms = ((GemFireCacheImpl)cache).getClientMetadataService();
@@ -916,24 +808,16 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase {
   
   @Ignore("Bug 47950")
   public void DISABLED_testMetadataIsSameOnAllServersAndClients() {
-    Integer port0 = (Integer)member0.invoke(
-        PartitionedRegionSingleHopDUnitTest.class, "createServer",
-        new Object[] { 3, 4 });
-    Integer port1 = (Integer)member1.invoke(
-        PartitionedRegionSingleHopDUnitTest.class, "createServer",
-        new Object[] { 3, 4 });
-    Integer port2 = (Integer)member2.invoke(
-        PartitionedRegionSingleHopDUnitTest.class, "createServer",
-        new Object[] { 3, 4 });
-    Integer port3 = (Integer)member3.invoke(
-        PartitionedRegionSingleHopDUnitTest.class, "createServer",
-        new Object[] { 3, 4 });
+    Integer port0 = (Integer)member0.invoke(() -> PartitionedRegionSingleHopDUnitTest.createServer( 3, 4 ));
+    Integer port1 = (Integer)member1.invoke(() -> PartitionedRegionSingleHopDUnitTest.createServer( 3, 4 ));
+    Integer port2 = (Integer)member2.invoke(() -> PartitionedRegionSingleHopDUnitTest.createServer( 3, 4 ));
+    Integer port3 = (Integer)member3.invoke(() -> PartitionedRegionSingleHopDUnitTest.createServer( 3, 4 ));
     createClient(port0, port1, port2, port3);
     put();
-    member0.invoke(PartitionedRegionSingleHopDUnitTest.class, "waitForLocalBucketsCreation", new Object[]{4});
-    member1.invoke(PartitionedRegionSingleHopDUnitTest.class, "waitForLocalBucketsCreation", new Object[]{4});
-    member2.invoke(PartitionedRegionSingleHopDUnitTest.class, "waitForLocalBucketsCreation", new Object[]{4});
-    member3.invoke(PartitionedRegionSingleHopDUnitTest.class, "waitForLocalBucketsCreation", new Object[]{4});
+    member0.invoke(() -> PartitionedRegionSingleHopDUnitTest.waitForLocalBucketsCreation(4));
+    member1.invoke(() -> PartitionedRegionSingleHopDUnitTest.waitForLocalBucketsCreation(4));
+    member2.invoke(() -> PartitionedRegionSingleHopDUnitTest.waitForLocalBucketsCreation(4));
+    member3.invoke(() -> PartitionedRegionSingleHopDUnitTest.waitForLocalBucketsCreation(4));
     
     
     ClientMetadataService cms = ((GemFireCacheImpl)cache).getClientMetadataService();
@@ -958,21 +842,21 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase {
     for (Entry entry : clientMap.entrySet()) {
       assertEquals(4, ((List)entry.getValue()).size());
     }
-    member0.invoke(PartitionedRegionSingleHopDUnitTest.class, "verifyMetadata", new Object[]{clientMap});
-    member1.invoke(PartitionedRegionSingleHopDUnitTest.class, "verifyMetadata", new Object[]{clientMap});
-    member2.invoke(PartitionedRegionSingleHopDUnitTest.class, "verifyMetadata", new Object[]{clientMap});
-    member3.invoke(PartitionedRegionSingleHopDUnitTest.class, "verifyMetadata", new Object[]{clientMap});
+    member0.invoke(() -> PartitionedRegionSingleHopDUnitTest.verifyMetadata(clientMap));
+    member1.invoke(() -> PartitionedRegionSingleHopDUnitTest.verifyMetadata(clientMap));
+    member2.invoke(() -> PartitionedRegionSingleHopDUnitTest.verifyMetadata(clientMap));
+    member3.invoke(() -> PartitionedRegionSingleHopDUnitTest.verifyMetadata(clientMap));
     
-    member0.invoke(PartitionedRegionSingleHopDUnitTest.class, "stopServer");
-    member1.invoke(PartitionedRegionSingleHopDUnitTest.class, "stopServer");
+    member0.invoke(() -> PartitionedRegionSingleHopDUnitTest.stopServer());
+    member1.invoke(() -> PartitionedRegionSingleHopDUnitTest.stopServer());
     
-    member0.invoke(PartitionedRegionSingleHopDUnitTest.class, "startServerOnPort",  new Object[] { port0 });
-    member1.invoke(PartitionedRegionSingleHopDUnitTest.class, "startServerOnPort",  new Object[] { port1 });
+    member0.invoke(() -> PartitionedRegionSingleHopDUnitTest.startServerOnPort( port0 ));
+    member1.invoke(() -> PartitionedRegionSingleHopDUnitTest.startServerOnPort( port1 ));
     put();
-    member0.invoke(PartitionedRegionSingleHopDUnitTest.class, "waitForLocalBucketsCreation", new Object[]{4});
-    member1.invoke(PartitionedRegionSingleHopDUnitTest.class, "waitForLocalBucketsCreation", new Object[]{4});
-    member2.invoke(PartitionedRegionSingleHopDUnitTest.class, "waitForLocalBucketsCreation", new Object[]{4});
-    member3.invoke(PartitionedRegionSingleHopDUnitTest.class, "waitForLocalBucketsCreation", new Object[]{4});
+    member0.invoke(() -> PartitionedRegionSingleHopDUnitTest.waitForLocalBucketsCreation(4));
+    member1.invoke(() -> PartitionedRegionSingleHopDUnitTest.waitForLocalBucketsCreation(4));
+    member2.invoke(() -> PartitionedRegionSingleHopDUnitTest.waitForLocalBucketsCreation(4));
+    member3.invoke(() -> PartitionedRegionSingleHopDUnitTest.waitForLocalBucketsCreation(4));
     
     cms = ((GemFireCacheImpl)cache).getClientMetadataService();
     
@@ -1024,16 +908,16 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase {
       assertEquals(4, ((List)entry.getValue()).size());
     }
     
-    member0.invoke(PartitionedRegionSingleHopDUnitTest.class, "verifyMetadata", new Object[]{clientMap});
-    member1.invoke(PartitionedRegionSingleHopDUnitTest.class, "verifyMetadata", new Object[]{clientMap});
-    member2.invoke(PartitionedRegionSingleHopDUnitTest.class, "verifyMetadata", new Object[]{clientMap});
-    member3.invoke(PartitionedRegionSingleHopDUnitTest.class, "verifyMetadata", new Object[]{clientMap});
+    member0.invoke(() -> PartitionedRegionSingleHopDUnitTest.verifyMetadata(clientMap));
+    member1.invoke(() -> PartitionedRegionSingleHopDUnitTest.verifyMetadata(clientMap));
+    member2.invoke(() -> PartitionedRegionSingleHopDUnitTest.verifyMetadata(clientMap));
+    member3.invoke(() -> PartitionedRegionSingleHopDUnitTest.verifyMetadata(clientMap));
     
-    member0.invoke(PartitionedRegionSingleHopDUnitTest.class, "closeCache");
-    member1.invoke(PartitionedRegionSingleHopDUnitTest.class, "closeCache");
+    member0.invoke(() -> PartitionedRegionSingleHopDUnitTest.closeCache());
+    member1.invoke(() -> PartitionedRegionSingleHopDUnitTest.closeCache());
     
-//    member0.invoke(PartitionedRegionSingleHopDUnitTest.class, "createServerOnPort",  new Object[] {3,4,port0 });
-//    member1.invoke(PartitionedRegionSingleHopDUnitTest.class, "createServerOnPort",  new Object[] {3,4,port1 });
+//    member0.invoke(() -> PartitionedRegionSingleHopDUnitTest.createServerOnPort(3,4,port0 ));
+//    member1.invoke(() -> PartitionedRegionSingleHopDUnitTest.createServerOnPort(3,4,port1 ));
     put();
     member2.invoke(new CacheSerializableRunnable("aba") {
       @Override
@@ -1053,10 +937,10 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase {
       }
     });
     
-//    member0.invoke(PartitionedRegionSingleHopDUnitTest.class, "waitForLocalBucketsCreation", new Object[]{4});
-//    member1.invoke(PartitionedRegionSingleHopDUnitTest.class, "waitForLocalBucketsCreation", new Object[]{4});
-    member2.invoke(PartitionedRegionSingleHopDUnitTest.class, "waitForLocalBucketsCreation", new Object[]{4});
-    member3.invoke(PartitionedRegionSingleHopDUnitTest.class, "waitForLocalBucketsCreation", new Object[]{4});
+//    member0.invoke(() -> PartitionedRegionSingleHopDUnitTest.waitForLocalBucketsCreation(4));
+//    member1.invoke(() -> PartitionedRegionSingleHopDUnitTest.waitForLocalBucketsCreation(4));
+    member2.invoke(() -> PartitionedRegionSingleHopDUnitTest.waitForLocalBucketsCreation(4));
+    member3.invoke(() -> PartitionedRegionSingleHopDUnitTest.waitForLocalBucketsCreation(4));
     
     cms = ((GemFireCacheImpl)cache).getClientMetadataService();
     cms.getClientPRMetadata((LocalRegion)region);
@@ -1085,10 +969,10 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase {
 
       public boolean done() {
         try {
-          //member0.invoke(PartitionedRegionSingleHopDUnitTest.class, "verifyMetadata", new Object[]{fclientMap});
-          //member1.invoke(PartitionedRegionSingleHopDUnitTest.class, "verifyMetadata", new Object[]{fclientMap});
-          member2.invoke(PartitionedRegionSingleHopDUnitTest.class, "verifyMetadata", new Object[]{fclientMap});
-          member3.invoke(PartitionedRegionSingleHopDUnitTest.class, "verifyMetadata", new Object[]{fclientMap});
+          //member0.invoke(() -> PartitionedRegionSingleHopDUnitTest.verifyMetadata(fclientMap));
+          //member1.invoke(() -> PartitionedRegionSingleHopDUnitTest.verifyMetadata(fclientMap));
+          member2.invoke(() -> PartitionedRegionSingleHopDUnitTest.verifyMetadata(fclientMap));
+          member3.invoke(() -> PartitionedRegionSingleHopDUnitTest.verifyMetadata(fclientMap));
         } catch (Exception e) {
           LogWriterUtils.getLogWriter().info("verification failed", e);
           return false;
@@ -1104,12 +988,8 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase {
   }
   
   public void testMetadataIsSameOnAllServersAndClientsHA() {
-    Integer port0 = (Integer)member0.invoke(
-        PartitionedRegionSingleHopDUnitTest.class, "createServer",
-        new Object[] { 2, 4 });
-    Integer port1 = (Integer)member1.invoke(
-        PartitionedRegionSingleHopDUnitTest.class, "createServer",
-        new Object[] { 2, 4 });
+    Integer port0 = (Integer)member0.invoke(() -> PartitionedRegionSingleHopDUnitTest.createServer( 2, 4 ));
+    Integer port1 = (Integer)member1.invoke(() -> PartitionedRegionSingleHopDUnitTest.createServer( 2, 4 ));
     
     createClient(port0, port1, port0, port1);
     put();
@@ -1166,17 +1046,17 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase {
     for (Entry entry : clientMap.entrySet()) {
       assertEquals(2, ((List)entry.getValue()).size());
     }
-    member0.invoke(PartitionedRegionSingleHopDUnitTest.class, "verifyMetadata", new Object[]{clientMap});
-    member1.invoke(PartitionedRegionSingleHopDUnitTest.class, "verifyMetadata", new Object[]{clientMap});
+    member0.invoke(() -> PartitionedRegionSingleHopDUnitTest.verifyMetadata(clientMap));
+    member1.invoke(() -> PartitionedRegionSingleHopDUnitTest.verifyMetadata(clientMap));
     
-    member0.invoke(PartitionedRegionSingleHopDUnitTest.class, "stopServer");
+    member0.invoke(() -> PartitionedRegionSingleHopDUnitTest.stopServer());
     
     put();
     
     cms = ((GemFireCacheImpl)cache).getClientMetadataService();
     cms.getClientPRMetadata((LocalRegion)region);
     
-    //member1.invoke(PartitionedRegionSingleHopDUnitTest.class, "verifyMetadata", new Object[]{clientMap});
+    //member1.invoke(() -> PartitionedRegionSingleHopDUnitTest.verifyMetadata(clientMap));
     
     assertEquals(4/*numBuckets*/, clientMap.size());
     for (Entry entry : clientMap.entrySet()) {
@@ -1220,37 +1100,29 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase {
   // This test is disabled due to intermittent failures in unit test runs
   // Please see ticket #52203
   public void disabledtestClientMetadataForPersistentPrs() throws Exception {
-    Integer port0 = (Integer)member0.invoke(
-        PartitionedRegionSingleHopDUnitTest.class, "createPersistentPrsAndServer",
-        new Object[] { 3, 4 });
-    Integer port1 = (Integer)member1.invoke(
-        PartitionedRegionSingleHopDUnitTest.class, "createPersistentPrsAndServer",
-        new Object[] { 3, 4 });
-    Integer port2 = (Integer)member2.invoke(
-        PartitionedRegionSingleHopDUnitTest.class, "createPersistentPrsAndServer",
-        new Object[] { 3, 4 });
-    Integer port3 = (Integer)member3.invoke(
-        PartitionedRegionSingleHopDUnitTest.class, "createPersistentPrsAndServer",
-        new Object[] { 3, 4 });
+    Integer port0 = (Integer)member0.invoke(() -> PartitionedRegionSingleHopDUnitTest.createPersistentPrsAndServer( 3, 4 ));
+    Integer port1 = (Integer)member1.invoke(() -> PartitionedRegionSingleHopDUnitTest.createPersistentPrsAndServer( 3, 4 ));
+    Integer port2 = (Integer)member2.invoke(() -> PartitionedRegionSingleHopDUnitTest.createPersistentPrsAndServer( 3, 4 ));
+    Integer port3 = (Integer)member3.invoke(() -> PartitionedRegionSingleHopDUnitTest.createPersistentPrsAndServer( 3, 4 ));
     
-    member3.invoke(PartitionedRegionSingleHopDUnitTest.class, "putIntoPartitionedRegions");
+    member3.invoke(() -> PartitionedRegionSingleHopDUnitTest.putIntoPartitionedRegions());
     
-    member0.invoke(PartitionedRegionSingleHopDUnitTest.class, "waitForLocalBucketsCreation", new Object[]{4});
-    member1.invoke(PartitionedRegionSingleHopDUnitTest.class, "waitForLocalBucketsCreation", new Object[]{4});
-    member2.invoke(PartitionedRegionSingleHopDUnitTest.class, "waitForLocalBucketsCreation", new Object[]{4});
-    member3.invoke(PartitionedRegionSingleHopDUnitTest.class, "waitForLocalBucketsCreation", new Object[]{4});
+    member0.invoke(() -> PartitionedRegionSingleHopDUnitTest.waitForLocalBucketsCreation(4));
+    member1.invoke(() -> PartitionedRegionSingleHopDUnitTest.waitForLocalBucketsCreation(4));
+    member2.invoke(() -> PartitionedRegionSingleHopDUnitTest.waitForLocalBucketsCreation(4));
+    member3.invoke(() -> PartitionedRegionSingleHopDUnitTest.waitForLocalBucketsCreation(4));
     
     createClient(port0, port1, port2, port3);
     fetchAndValidateMetadata();
-    member0.invoke(PartitionedRegionSingleHopDUnitTest.class, "closeCache");
-    member1.invoke(PartitionedRegionSingleHopDUnitTest.class, "closeCache");
-    member2.invoke(PartitionedRegionSingleHopDUnitTest.class, "closeCache");
-    member3.invoke(PartitionedRegionSingleHopDUnitTest.class, "closeCache");
+    member0.invoke(() -> PartitionedRegionSingleHopDUnitTest.closeCache());
+    member1.invoke(() -> PartitionedRegionSingleHopDUnitTest.closeCache());
+    member2.invoke(() -> PartitionedRegionSingleHopDUnitTest.closeCache());
+    member3.invoke(() -> PartitionedRegionSingleHopDUnitTest.closeCache());
     Wait.pause(1000); //let client detect that servers are dead through ping
-    AsyncInvocation m3 = member3.invokeAsync(PartitionedRegionSingleHopDUnitTest.class, "createPersistentPrsAndServerOnPort",new Object[] { 3, 4,port3 });
-    AsyncInvocation m2 = member2.invokeAsync(PartitionedRegionSingleHopDUnitTest.class, "createPersistentPrsAndServerOnPort",new Object[] { 3, 4,port2 });
-    AsyncInvocation m1 = member1.invokeAsync(PartitionedRegionSingleHopDUnitTest.class, "createPersistentPrsAndServerOnPort",new Object[] { 3, 4,port1 });
-    AsyncInvocation m0 = member0.invokeAsync(PartitionedRegionSingleHopDUnitTest.class, "createPersistentPrsAndServerOnPort",new Object[] { 3, 4,port0 });
+    AsyncInvocation m3 = member3.invokeAsync(() -> PartitionedRegionSingleHopDUnitTest.createPersistentPrsAndServerOnPort( 3, 4,port3 ));
+    AsyncInvocation m2 = member2.invokeAsync(() -> PartitionedRegionSingleHopDUnitTest.createPersistentPrsAndServerOnPort( 3, 4,port2 ));
+    AsyncInvocation m1 = member1.invokeAsync(() -> PartitionedRegionSingleHopDUnitTest.createPersistentPrsAndServerOnPort( 3, 4,port1 ));
+    AsyncInvocation m0 = member0.invokeAsync(() -> PartitionedRegionSingleHopDUnitTest.createPersistentPrsAndServerOnPort( 3, 4,port0 ));
     m3.join();
     m2.join();
     m1.join();


Mime
View raw message