geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From upthewatersp...@apache.org
Subject [35/56] [abbrv] incubator-geode git commit: Automatically converting calls of vm.invoke to lambdas
Date Tue, 16 Feb 2016 22:11:55 GMT
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/69024aa9/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DataSerializerPropogationDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DataSerializerPropogationDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DataSerializerPropogationDUnitTest.java
index 06abd14..b0a2e14 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DataSerializerPropogationDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DataSerializerPropogationDUnitTest.java
@@ -159,12 +159,12 @@ public class DataSerializerPropogationDUnitTest extends DistributedTestCase {
   protected final void preTearDown() throws Exception {
     try {
       // close the clients first
-      client1.invoke(DataSerializerPropogationDUnitTest.class, "closeCache");
-      client2.invoke(DataSerializerPropogationDUnitTest.class, "closeCache");
+      client1.invoke(() -> DataSerializerPropogationDUnitTest.closeCache());
+      client2.invoke(() -> DataSerializerPropogationDUnitTest.closeCache());
       closeCache();
 
-      server1.invoke(DataSerializerPropogationDUnitTest.class, "closeCache");
-      server2.invoke(DataSerializerPropogationDUnitTest.class, "closeCache");
+      server1.invoke(() -> DataSerializerPropogationDUnitTest.closeCache());
+      server2.invoke(() -> DataSerializerPropogationDUnitTest.closeCache());
 
       client1 = null;
       client2 = null;
@@ -404,23 +404,18 @@ public class DataSerializerPropogationDUnitTest extends DistributedTestCase {
 
     Wait.pause(3000);
 
-    server1.invoke(DataSerializerPropogationDUnitTest.class,
-        "registerDSObject1");
-    server1.invoke(DataSerializerPropogationDUnitTest.class,
-        "registerDSObject2");
+    server1.invoke(() -> DataSerializerPropogationDUnitTest.registerDSObject1());
+    server1.invoke(() -> DataSerializerPropogationDUnitTest.registerDSObject2());
 
-    server1.invoke(DataSerializerPropogationDUnitTest.class,
-        "verifyDataSerializers", new Object[] { new Integer(2) });
+    server1.invoke(() -> DataSerializerPropogationDUnitTest.verifyDataSerializers( new Integer(2) ));
 
-    client1.invoke(DataSerializerPropogationDUnitTest.class,
-        "createClientCache", new Object[] {
-            NetworkUtils.getServerHostName(server1.getHost()), new Integer(PORT1) });
+    client1.invoke(() -> DataSerializerPropogationDUnitTest.createClientCache(
+            NetworkUtils.getServerHostName(server1.getHost()), new Integer(PORT1) ));
 
     // wait for client2 to come online
     Wait.pause(3000);
 
-    client1.invoke(DataSerializerPropogationDUnitTest.class,
-        "verifyDataSerializers", new Object[] { new Integer(2) });
+    client1.invoke(() -> DataSerializerPropogationDUnitTest.verifyDataSerializers( new Integer(2) ));
 
     // Put some entries from the client
     client1.invoke(new CacheSerializableRunnable("Put entries from client") {
@@ -470,31 +465,24 @@ public class DataSerializerPropogationDUnitTest extends DistributedTestCase {
     PORT1 = initServerCache(server1);
     PORT2 = initServerCache(server2);
 
-    client1.invoke(DataSerializerPropogationDUnitTest.class,
-        "createClientCache", new Object[] {
-            NetworkUtils.getServerHostName(server1.getHost()), new Integer(PORT1) });
-    client2.invoke(DataSerializerPropogationDUnitTest.class,
-        "createClientCache", new Object[] {
-            NetworkUtils.getServerHostName(server2.getHost()), new Integer(PORT2) });
+    client1.invoke(() -> DataSerializerPropogationDUnitTest.createClientCache(
+            NetworkUtils.getServerHostName(server1.getHost()), new Integer(PORT1) ));
+    client2.invoke(() -> DataSerializerPropogationDUnitTest.createClientCache(
+            NetworkUtils.getServerHostName(server2.getHost()), new Integer(PORT2) ));
 
     // wait for client2 to come online
     Wait.pause(2000);
 
-    client1.invoke(DataSerializerPropogationDUnitTest.class,
-        "registerDSObject3");
+    client1.invoke(() -> DataSerializerPropogationDUnitTest.registerDSObject3());
     Wait.pause(4000);
 
-    client1.invoke(DataSerializerPropogationDUnitTest.class,
-        "verifyDataSerializers", new Object[] { new Integer(1) });
+    client1.invoke(() -> DataSerializerPropogationDUnitTest.verifyDataSerializers( new Integer(1) ));
 
-    server1.invoke(DataSerializerPropogationDUnitTest.class,
-        "verifyDataSerializers", new Object[] { new Integer(1) });
+    server1.invoke(() -> DataSerializerPropogationDUnitTest.verifyDataSerializers( new Integer(1) ));
 
-    server2.invoke(DataSerializerPropogationDUnitTest.class,
-        "verifyDataSerializers", new Object[] { new Integer(1) });
+    server2.invoke(() -> DataSerializerPropogationDUnitTest.verifyDataSerializers( new Integer(1) ));
 
-    client2.invoke(DataSerializerPropogationDUnitTest.class,
-        "verifyDataSerializers", new Object[] { new Integer(1) });
+    client2.invoke(() -> DataSerializerPropogationDUnitTest.verifyDataSerializers( new Integer(1) ));
   }
 
   // this test is for bug 44112
@@ -502,61 +490,48 @@ public class DataSerializerPropogationDUnitTest extends DistributedTestCase {
     PORT1 = initServerCache(server1);
     PORT2 = initServerCache(server2);
 
-    client1.invoke(DataSerializerPropogationDUnitTest.class,
-        "createClientCache", new Object[] {
-            NetworkUtils.getServerHostName(server1.getHost()), new Integer(PORT1) });
-    client2.invoke(DataSerializerPropogationDUnitTest.class,
-        "createClientCache", new Object[] {
-            NetworkUtils.getServerHostName(server2.getHost()), new Integer(PORT2) });
+    client1.invoke(() -> DataSerializerPropogationDUnitTest.createClientCache(
+            NetworkUtils.getServerHostName(server1.getHost()), new Integer(PORT1) ));
+    client2.invoke(() -> DataSerializerPropogationDUnitTest.createClientCache(
+            NetworkUtils.getServerHostName(server2.getHost()), new Integer(PORT2) ));
 
     // wait for client2 to come online
     Wait.pause(2000);
 
-    server1.invoke(DataSerializerPropogationDUnitTest.class,
-        "registerDSObjectLocalOnly", new Object[] { });
+    server1.invoke(() -> DataSerializerPropogationDUnitTest.registerDSObjectLocalOnly( ));
 
     Wait.pause(4000);
 
-    server1.invoke(DataSerializerPropogationDUnitTest.class,
-        "verifyDataSerializers", new Object[] { new Integer(1) });
+    server1.invoke(() -> DataSerializerPropogationDUnitTest.verifyDataSerializers( new Integer(1) ));
 
-    server2.invoke(DataSerializerPropogationDUnitTest.class,
-        "verifyDataSerializers", new Object[] { new Integer(0) });
+    server2.invoke(() -> DataSerializerPropogationDUnitTest.verifyDataSerializers( new Integer(0) ));
 
-    client1.invoke(DataSerializerPropogationDUnitTest.class,
-        "verifyDataSerializers", new Object[] { new Integer(1), Boolean.TRUE });
+    client1.invoke(() -> DataSerializerPropogationDUnitTest.verifyDataSerializers( new Integer(1), Boolean.TRUE ));
 
-    client2.invoke(DataSerializerPropogationDUnitTest.class,
-        "verifyDataSerializers", new Object[] { new Integer(0) });
+    client2.invoke(() -> DataSerializerPropogationDUnitTest.verifyDataSerializers( new Integer(0) ));
   }
 
   public void testDataSerializersWithServerKill() throws Exception {
     PORT1 = initServerCache(server1);
     PORT2 = initServerCache(server2);
 
-    client1.invoke(DataSerializerPropogationDUnitTest.class,
-        "createClientCache", new Object[] {
-            NetworkUtils.getServerHostName(server1.getHost()), new Integer(PORT1) });
-    client2.invoke(DataSerializerPropogationDUnitTest.class,
-        "createClientCache", new Object[] {
-            NetworkUtils.getServerHostName(server2.getHost()), new Integer(PORT2) });
+    client1.invoke(() -> DataSerializerPropogationDUnitTest.createClientCache(
+            NetworkUtils.getServerHostName(server1.getHost()), new Integer(PORT1) ));
+    client2.invoke(() -> DataSerializerPropogationDUnitTest.createClientCache(
+            NetworkUtils.getServerHostName(server2.getHost()), new Integer(PORT2) ));
 
     // wait for client2 to come online
     Wait.pause(2000);
 
-    client1.invoke(DataSerializerPropogationDUnitTest.class,
-        "registerDSObject4");
+    client1.invoke(() -> DataSerializerPropogationDUnitTest.registerDSObject4());
 
     // wait for successful registration
 
-    server1.invoke(DataSerializerPropogationDUnitTest.class,
-        "verifyDataSerializers", new Object[] { Integer.valueOf(1) });
+    server1.invoke(() -> DataSerializerPropogationDUnitTest.verifyDataSerializers( Integer.valueOf(1) ));
 
-    server2.invoke(DataSerializerPropogationDUnitTest.class,
-        "verifyDataSerializers", new Object[] { Integer.valueOf(1) });
+    server2.invoke(() -> DataSerializerPropogationDUnitTest.verifyDataSerializers( Integer.valueOf(1) ));
 
-    client2.invoke(DataSerializerPropogationDUnitTest.class,
-        "verifyDataSerializers", new Object[] { Integer.valueOf(1) });
+    client2.invoke(() -> DataSerializerPropogationDUnitTest.verifyDataSerializers( Integer.valueOf(1) ));
 
     // can get server connectivity exception
     final IgnoredException expectedEx = IgnoredException.addIgnoredException(
@@ -564,25 +539,19 @@ public class DataSerializerPropogationDUnitTest extends DistributedTestCase {
 
     // stop the cache server
 
-    server1.invoke(DataSerializerPropogationDUnitTest.class, "stopServer");
+    server1.invoke(() -> DataSerializerPropogationDUnitTest.stopServer());
 
-    server1.invoke(DataSerializerPropogationDUnitTest.class,
-        "registerDSObject5");
-    server1.invoke(DataSerializerPropogationDUnitTest.class,
-        "registerDSObject6");
+    server1.invoke(() -> DataSerializerPropogationDUnitTest.registerDSObject5());
+    server1.invoke(() -> DataSerializerPropogationDUnitTest.registerDSObject6());
 
-    server2.invoke(DataSerializerPropogationDUnitTest.class,
-        "verifyDataSerializers", new Object[] { new Integer(3) });
+    server2.invoke(() -> DataSerializerPropogationDUnitTest.verifyDataSerializers( new Integer(3) ));
 
-    server1.invoke(DataSerializerPropogationDUnitTest.class,
-        "verifyDataSerializers", new Object[] { new Integer(3) });
+    server1.invoke(() -> DataSerializerPropogationDUnitTest.verifyDataSerializers( new Integer(3) ));
 
-    client1.invoke(DataSerializerPropogationDUnitTest.class,
-        "verifyDataSerializers", new Object[] { new Integer(
-            instanceCountWithOnePut) });
+    client1.invoke(() -> DataSerializerPropogationDUnitTest.verifyDataSerializers( new Integer(
+            instanceCountWithOnePut) ));
 
-    client2.invoke(DataSerializerPropogationDUnitTest.class,
-        "verifyDataSerializers", new Object[] { new Integer(3) });
+    client2.invoke(() -> DataSerializerPropogationDUnitTest.verifyDataSerializers( new Integer(3) ));
 
     expectedEx.remove();
   }
@@ -591,101 +560,80 @@ public class DataSerializerPropogationDUnitTest extends DistributedTestCase {
     PORT1 = initServerCache(server1);
     PORT2 = initServerCache(server2);
 
-    client1.invoke(DataSerializerPropogationDUnitTest.class,
-        "createClientCache", new Object[] {
-            NetworkUtils.getServerHostName(server1.getHost()), new Integer(PORT1) });
-    client2.invoke(DataSerializerPropogationDUnitTest.class,
-        "createClientCache", new Object[] {
-            NetworkUtils.getServerHostName(server2.getHost()), new Integer(PORT2) });
+    client1.invoke(() -> DataSerializerPropogationDUnitTest.createClientCache(
+            NetworkUtils.getServerHostName(server1.getHost()), new Integer(PORT1) ));
+    client2.invoke(() -> DataSerializerPropogationDUnitTest.createClientCache(
+            NetworkUtils.getServerHostName(server2.getHost()), new Integer(PORT2) ));
 
     // wait for client2 to come online
     Wait.pause(2000);
 
-    client1.invoke(DataSerializerPropogationDUnitTest.class,
-        "registerDSObject10");
+    client1.invoke(() -> DataSerializerPropogationDUnitTest.registerDSObject10());
 
-    server1.invoke(DataSerializerPropogationDUnitTest.class,
-        "registerDSObject11");
+    server1.invoke(() -> DataSerializerPropogationDUnitTest.registerDSObject11());
     Wait.pause(4000);
 
-    server2.invoke(DataSerializerPropogationDUnitTest.class,
-        "verifyDataSerializers", new Object[] { new Integer(2) });
+    server2.invoke(() -> DataSerializerPropogationDUnitTest.verifyDataSerializers( new Integer(2) ));
 
-    server1.invoke(DataSerializerPropogationDUnitTest.class,
-        "verifyDataSerializers", new Object[] { new Integer(2) });
+    server1.invoke(() -> DataSerializerPropogationDUnitTest.verifyDataSerializers( new Integer(2) ));
 
-    client1.invoke(DataSerializerPropogationDUnitTest.class,
-        "verifyDataSerializers", new Object[] { new Integer(2) });
+    client1.invoke(() -> DataSerializerPropogationDUnitTest.verifyDataSerializers( new Integer(2) ));
 
-    client2.invoke(DataSerializerPropogationDUnitTest.class,
-        "verifyDataSerializers", new Object[] { new Integer(2) });
+    client2.invoke(() -> DataSerializerPropogationDUnitTest.verifyDataSerializers( new Integer(2) ));
   }
 
   public void testDataSerializersWithServerKillAndReInvoked() throws Exception {
     PORT1 = initServerCache(server1);
     PORT2 = initServerCache(server2);
-    client1.invoke(DataSerializerPropogationDUnitTest.class,
-        "createClientCache", new Object[] {
-            NetworkUtils.getServerHostName(server1.getHost()), new Integer(PORT1) });
-    client2.invoke(DataSerializerPropogationDUnitTest.class,
-        "createClientCache", new Object[] {
-            NetworkUtils.getServerHostName(server2.getHost()), new Integer(PORT2) });
-
-    client1.invoke(DataSerializerPropogationDUnitTest.class,
-        "registerDSObject7");
-    client1.invoke(DataSerializerPropogationDUnitTest.class,
-        "verifyDataSerializers", new Object[] { new Integer(
-            instanceCountWithOnePut) });
-
-    server1.invoke(DataSerializerPropogationDUnitTest.class,
-        "verifyDataSerializers", new Object[] { new Integer(
-            instanceCountWithOnePut) });
-
-    server2.invoke(DataSerializerPropogationDUnitTest.class,
-        "verifyDataSerializers", new Object[] { new Integer(
-            instanceCountWithOnePut) });
-
-    client2.invoke(DataSerializerPropogationDUnitTest.class,
-        "verifyDataSerializers", new Object[] { new Integer(
-            instanceCountWithOnePut) });
+    client1.invoke(() -> DataSerializerPropogationDUnitTest.createClientCache(
+            NetworkUtils.getServerHostName(server1.getHost()), new Integer(PORT1) ));
+    client2.invoke(() -> DataSerializerPropogationDUnitTest.createClientCache(
+            NetworkUtils.getServerHostName(server2.getHost()), new Integer(PORT2) ));
+
+    client1.invoke(() -> DataSerializerPropogationDUnitTest.registerDSObject7());
+    client1.invoke(() -> DataSerializerPropogationDUnitTest.verifyDataSerializers( new Integer(
+            instanceCountWithOnePut) ));
+
+    server1.invoke(() -> DataSerializerPropogationDUnitTest.verifyDataSerializers( new Integer(
+            instanceCountWithOnePut) ));
+
+    server2.invoke(() -> DataSerializerPropogationDUnitTest.verifyDataSerializers( new Integer(
+            instanceCountWithOnePut) ));
+
+    client2.invoke(() -> DataSerializerPropogationDUnitTest.verifyDataSerializers( new Integer(
+            instanceCountWithOnePut) ));
 
     // can get server connectivity exception
     final IgnoredException expectedEx = IgnoredException.addIgnoredException(
         "Server unreachable", client1);
 
-    server1.invoke(DataSerializerPropogationDUnitTest.class, "stopServer");
+    server1.invoke(() -> DataSerializerPropogationDUnitTest.stopServer());
 
     try {
-      client1.invoke(DataSerializerPropogationDUnitTest.class,
-          "registerDSObject8");
+      client1.invoke(() -> DataSerializerPropogationDUnitTest.registerDSObject8());
     }
     catch (Exception e) {// we are putting in a client whose server is dead
 
     }
     try {
-      client1.invoke(DataSerializerPropogationDUnitTest.class,
-          "registerDSObject9");
+      client1.invoke(() -> DataSerializerPropogationDUnitTest.registerDSObject9());
     }
     catch (Exception e) {// we are putting in a client whose server is
       // dead
     }
-    server1.invoke(DataSerializerPropogationDUnitTest.class, "startServer");
+    server1.invoke(() -> DataSerializerPropogationDUnitTest.startServer());
 
-    client1.invoke(DataSerializerPropogationDUnitTest.class,
-        "verifyDataSerializers", new Object[] { new Integer(
-            instanceCountWithAllPuts) });
+    client1.invoke(() -> DataSerializerPropogationDUnitTest.verifyDataSerializers( new Integer(
+            instanceCountWithAllPuts) ));
 
-    server1.invoke(DataSerializerPropogationDUnitTest.class,
-        "verifyDataSerializers", new Object[] { new Integer(
-            instanceCountWithAllPuts) });
+    server1.invoke(() -> DataSerializerPropogationDUnitTest.verifyDataSerializers( new Integer(
+            instanceCountWithAllPuts) ));
 
-    server2.invoke(DataSerializerPropogationDUnitTest.class,
-        "verifyDataSerializers", new Object[] { new Integer(
-            instanceCountWithAllPuts) });
+    server2.invoke(() -> DataSerializerPropogationDUnitTest.verifyDataSerializers( new Integer(
+            instanceCountWithAllPuts) ));
 
-    client1.invoke(DataSerializerPropogationDUnitTest.class,
-        "verifyDataSerializers", new Object[] { new Integer(
-            instanceCountWithAllPuts) });
+    client1.invoke(() -> DataSerializerPropogationDUnitTest.verifyDataSerializers( new Integer(
+            instanceCountWithAllPuts) ));
 
     expectedEx.remove();
   }
@@ -694,32 +642,25 @@ public class DataSerializerPropogationDUnitTest extends DistributedTestCase {
     PORT1 = initServerCache(server1);
     PORT2 = initServerCache(server2);
 
-    client1.invoke(DataSerializerPropogationDUnitTest.class,
-        "createClientCache", new Object[] {
-            NetworkUtils.getServerHostName(server1.getHost()), new Integer(PORT1) });
-    client2.invoke(DataSerializerPropogationDUnitTest.class,
-        "createClientCache", new Object[] {
-            NetworkUtils.getServerHostName(server1.getHost()), new Integer(PORT1) });
+    client1.invoke(() -> DataSerializerPropogationDUnitTest.createClientCache(
+            NetworkUtils.getServerHostName(server1.getHost()), new Integer(PORT1) ));
+    client2.invoke(() -> DataSerializerPropogationDUnitTest.createClientCache(
+            NetworkUtils.getServerHostName(server1.getHost()), new Integer(PORT1) ));
     createClientCache(NetworkUtils.getServerHostName(server2.getHost()), new Integer(PORT2));
 
     // wait for client2 to come online
     Wait.pause(2000);
 
-    client1.invoke(DataSerializerPropogationDUnitTest.class,
-        "registerDSObject12");
+    client1.invoke(() -> DataSerializerPropogationDUnitTest.registerDSObject12());
     Wait.pause(4000);
 
-    client1.invoke(DataSerializerPropogationDUnitTest.class,
-        "verifyDataSerializers", new Object[] { new Integer(1) });
+    client1.invoke(() -> DataSerializerPropogationDUnitTest.verifyDataSerializers( new Integer(1) ));
 
-    server1.invoke(DataSerializerPropogationDUnitTest.class,
-        "verifyDataSerializers", new Object[] { new Integer(1) });
+    server1.invoke(() -> DataSerializerPropogationDUnitTest.verifyDataSerializers( new Integer(1) ));
 
-    server2.invoke(DataSerializerPropogationDUnitTest.class,
-        "verifyDataSerializers", new Object[] { new Integer(1) });
+    server2.invoke(() -> DataSerializerPropogationDUnitTest.verifyDataSerializers( new Integer(1) ));
 
-    client2.invoke(DataSerializerPropogationDUnitTest.class,
-        "verifyDataSerializers", new Object[] { new Integer(1) });
+    client2.invoke(() -> DataSerializerPropogationDUnitTest.verifyDataSerializers( new Integer(1) ));
 
     verifyDataSerializers(1);
   }
@@ -737,19 +678,17 @@ public class DataSerializerPropogationDUnitTest extends DistributedTestCase {
     createClientCache(NetworkUtils.getServerHostName(server1.getHost()),
         new Integer(PORT1));
 
-    client2.invoke(DataSerializerPropogationDUnitTest.class,
-        "createClientCache", new Object[] {
-            NetworkUtils.getServerHostName(server2.getHost()), new Integer(PORT2) });
+    client2.invoke(() -> DataSerializerPropogationDUnitTest.createClientCache(
+            NetworkUtils.getServerHostName(server2.getHost()), new Integer(PORT2) ));
     setClientServerObserver1();
     client2
-        .invoke(DataSerializerPropogationDUnitTest.class, "setClientServerObserver2");
+        .invoke(() -> DataSerializerPropogationDUnitTest.setClientServerObserver2());
 
     registerDSObject13();
 
     Wait.pause(10000);
 
-    Boolean pass = (Boolean)client2.invoke(
-        DataSerializerPropogationDUnitTest.class, "verifyResult");
+    Boolean pass = (Boolean)client2.invoke(() -> DataSerializerPropogationDUnitTest.verifyResult());
     assertTrue("EventId found Different", pass.booleanValue());
 
     PoolImpl.IS_INSTANTIATOR_CALLBACK = false;
@@ -760,67 +699,60 @@ public class DataSerializerPropogationDUnitTest extends DistributedTestCase {
     PORT1 = initServerCache(server1);
     PORT2 = initServerCache(server2);
 
-    client1.invoke(DataSerializerPropogationDUnitTest.class,
-        "createClientCache", new Object[] {
-            NetworkUtils.getServerHostName(server1.getHost()), new Integer(PORT1) });
-    client2.invoke(DataSerializerPropogationDUnitTest.class,
-        "createClientCache", new Object[] {
-            NetworkUtils.getServerHostName(server1.getHost()), new Integer(PORT2) });
+    client1.invoke(() -> DataSerializerPropogationDUnitTest.createClientCache(
+            NetworkUtils.getServerHostName(server1.getHost()), new Integer(PORT1) ));
+    client2.invoke(() -> DataSerializerPropogationDUnitTest.createClientCache(
+            NetworkUtils.getServerHostName(server1.getHost()), new Integer(PORT2) ));
 
     // wait for client2 to come online
     Wait.pause(2000);
 
-    client1.invoke(DataSerializerPropogationDUnitTest.class,
-        "registerTestDataSerializer");
+    client1.invoke(() -> DataSerializerPropogationDUnitTest.registerTestDataSerializer());
     Wait.pause(4000);
 
-    client1.invoke(DataSerializerPropogationDUnitTest.class,
-        "verifyDataSerializers", new Object[] { new Integer(1) });
+    client1.invoke(() -> DataSerializerPropogationDUnitTest.verifyDataSerializers( new Integer(1) ));
 
     // Verify through InternalDataSerializer's map entries
-    client1.invoke(DataSerializerPropogationDUnitTest.class, "verifyLoadedDataSerializers", new Object[] { new Integer(1) });
-    client1.invoke(DataSerializerPropogationDUnitTest.class, "verifyDataSerializerClassNamesMap", new Object[] { new Integer(0) });
-    client1.invoke(DataSerializerPropogationDUnitTest.class, "verifyDataSerializerIDMap", new Object[] { new Integer(0) });
-    client1.invoke(DataSerializerPropogationDUnitTest.class, "verifyDataSerializerSupportedClassNamesMap", new Object[] { new Integer(0) });
+    client1.invoke(() -> DataSerializerPropogationDUnitTest.verifyLoadedDataSerializers( new Integer(1) ));
+    client1.invoke(() -> DataSerializerPropogationDUnitTest.verifyDataSerializerClassNamesMap( new Integer(0) ));
+    client1.invoke(() -> DataSerializerPropogationDUnitTest.verifyDataSerializerIDMap( new Integer(0) ));
+    client1.invoke(() -> DataSerializerPropogationDUnitTest.verifyDataSerializerSupportedClassNamesMap( new Integer(0) ));
 
-    server1.invoke(DataSerializerPropogationDUnitTest.class, "verifyLoadedDataSerializers", new Object[] { new Integer(1) });
-    server1.invoke(DataSerializerPropogationDUnitTest.class, "verifyDataSerializerClassNamesMap", new Object[] { new Integer(0) });
-    server1.invoke(DataSerializerPropogationDUnitTest.class, "verifyDataSerializerIDMap", new Object[] { new Integer(0) });
-    server1.invoke(DataSerializerPropogationDUnitTest.class, "verifyDataSerializerSupportedClassNamesMap", new Object[] { new Integer(0) });
+    server1.invoke(() -> DataSerializerPropogationDUnitTest.verifyLoadedDataSerializers( new Integer(1) ));
+    server1.invoke(() -> DataSerializerPropogationDUnitTest.verifyDataSerializerClassNamesMap( new Integer(0) ));
+    server1.invoke(() -> DataSerializerPropogationDUnitTest.verifyDataSerializerIDMap( new Integer(0) ));
+    server1.invoke(() -> DataSerializerPropogationDUnitTest.verifyDataSerializerSupportedClassNamesMap( new Integer(0) ));
 
-    server2.invoke(DataSerializerPropogationDUnitTest.class, "verifyLoadedDataSerializers", new Object[] { new Integer(1) });
-    server2.invoke(DataSerializerPropogationDUnitTest.class, "verifyDataSerializerClassNamesMap", new Object[] { new Integer(0) });
-    server2.invoke(DataSerializerPropogationDUnitTest.class, "verifyDataSerializerIDMap", new Object[] { new Integer(0) });
-    server2.invoke(DataSerializerPropogationDUnitTest.class, "verifyDataSerializerSupportedClassNamesMap", new Object[] { new Integer(0) });
+    server2.invoke(() -> DataSerializerPropogationDUnitTest.verifyLoadedDataSerializers( new Integer(1) ));
+    server2.invoke(() -> DataSerializerPropogationDUnitTest.verifyDataSerializerClassNamesMap( new Integer(0) ));
+    server2.invoke(() -> DataSerializerPropogationDUnitTest.verifyDataSerializerIDMap( new Integer(0) ));
+    server2.invoke(() -> DataSerializerPropogationDUnitTest.verifyDataSerializerSupportedClassNamesMap( new Integer(0) ));
 
     // Verify by boolean flag in static initializer.
-    server1.invoke(DataSerializerPropogationDUnitTest.class, "verifyTestDataSerializerLoaded");
-    server2.invoke(DataSerializerPropogationDUnitTest.class, "verifyTestDataSerializerLoaded");
-    client2.invoke(DataSerializerPropogationDUnitTest.class, "verifyTestDataSerializerNotLoaded");
+    server1.invoke(() -> DataSerializerPropogationDUnitTest.verifyTestDataSerializerLoaded());
+    server2.invoke(() -> DataSerializerPropogationDUnitTest.verifyTestDataSerializerLoaded());
+    client2.invoke(() -> DataSerializerPropogationDUnitTest.verifyTestDataSerializerNotLoaded());
 
     // Verify through InternalDataSerializer.getSerializers()
-    server1.invoke(DataSerializerPropogationDUnitTest.class,
-        "verifyDataSerializers", new Object[] { new Integer(1) });
-    server2.invoke(DataSerializerPropogationDUnitTest.class,
-        "verifyDataSerializers", new Object[] { new Integer(1) });
+    server1.invoke(() -> DataSerializerPropogationDUnitTest.verifyDataSerializers( new Integer(1) ));
+    server2.invoke(() -> DataSerializerPropogationDUnitTest.verifyDataSerializers( new Integer(1) ));
 
     // Verify through InternalDataSerializer's map entries
-    client2.invoke(DataSerializerPropogationDUnitTest.class, "verifyLoadedDataSerializers", new Object[] { new Integer(0) });
-    client2.invoke(DataSerializerPropogationDUnitTest.class, "verifyDataSerializerClassNamesMap", new Object[] { new Integer(1) });
-    client2.invoke(DataSerializerPropogationDUnitTest.class, "verifyDataSerializerIDMap", new Object[] { new Integer(1) });
-    client2.invoke(DataSerializerPropogationDUnitTest.class, "verifyDataSerializerSupportedClassNamesMap", new Object[] { new Integer(3) });
+    client2.invoke(() -> DataSerializerPropogationDUnitTest.verifyLoadedDataSerializers( new Integer(0) ));
+    client2.invoke(() -> DataSerializerPropogationDUnitTest.verifyDataSerializerClassNamesMap( new Integer(1) ));
+    client2.invoke(() -> DataSerializerPropogationDUnitTest.verifyDataSerializerIDMap( new Integer(1) ));
+    client2.invoke(() -> DataSerializerPropogationDUnitTest.verifyDataSerializerSupportedClassNamesMap( new Integer(3) ));
 
     // Force TestDataSerializer to be loaded into vm by invoking InternalDataSerialier.getSerializers()
-    client2.invoke(DataSerializerPropogationDUnitTest.class,
-        "verifyDataSerializers", new Object[] { new Integer(1) });
+    client2.invoke(() -> DataSerializerPropogationDUnitTest.verifyDataSerializers( new Integer(1) ));
 
     // Verify by boolean flag in static initializer.
-    client2.invoke(DataSerializerPropogationDUnitTest.class, "verifyTestDataSerializerLoaded");
+    client2.invoke(() -> DataSerializerPropogationDUnitTest.verifyTestDataSerializerLoaded());
     // Verify through InternalDataSerializer's map entries
-    client2.invoke(DataSerializerPropogationDUnitTest.class, "verifyLoadedDataSerializers", new Object[] { new Integer(1) });
-    client2.invoke(DataSerializerPropogationDUnitTest.class, "verifyDataSerializerClassNamesMap", new Object[] { new Integer(0) });
-    client2.invoke(DataSerializerPropogationDUnitTest.class, "verifyDataSerializerIDMap", new Object[] { new Integer(0) });
-    client2.invoke(DataSerializerPropogationDUnitTest.class, "verifyDataSerializerSupportedClassNamesMap", new Object[] { new Integer(0) });
+    client2.invoke(() -> DataSerializerPropogationDUnitTest.verifyLoadedDataSerializers( new Integer(1) ));
+    client2.invoke(() -> DataSerializerPropogationDUnitTest.verifyDataSerializerClassNamesMap( new Integer(0) ));
+    client2.invoke(() -> DataSerializerPropogationDUnitTest.verifyDataSerializerIDMap( new Integer(0) ));
+    client2.invoke(() -> DataSerializerPropogationDUnitTest.verifyDataSerializerSupportedClassNamesMap( new Integer(0) ));
   }
 
   public static void verifyTestDataSerializerNotLoaded() {
@@ -925,8 +857,7 @@ public class DataSerializerPropogationDUnitTest extends DistributedTestCase {
       @Override
       public void beforeSendingToServer(EventID eventID) {
         eventId = eventID;
-        client2.invoke(DataSerializerPropogationDUnitTest.class, "setEventId",
-            new Object[] { eventId });
+        client2.invoke(() -> DataSerializerPropogationDUnitTest.setEventId( eventId ));
 
       }
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/69024aa9/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DestroyEntryPropagationDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DestroyEntryPropagationDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DestroyEntryPropagationDUnitTest.java
index 5ba03bd..a70284e 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DestroyEntryPropagationDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DestroyEntryPropagationDUnitTest.java
@@ -101,13 +101,11 @@ public class DestroyEntryPropagationDUnitTest extends DistributedTestCase
     //client 2 VM
     vm3 = host.getVM(3);
 
-    PORT1 =  ((Integer)vm0.invoke(DestroyEntryPropagationDUnitTest.class, "createServerCache" )).intValue();
-    PORT2 =  ((Integer)vm1.invoke(DestroyEntryPropagationDUnitTest.class, "createServerCache" )).intValue();
+    PORT1 =  ((Integer)vm0.invoke(() -> DestroyEntryPropagationDUnitTest.createServerCache())).intValue();
+    PORT2 =  ((Integer)vm1.invoke(() -> DestroyEntryPropagationDUnitTest.createServerCache())).intValue();
 
-    vm2.invoke(DestroyEntryPropagationDUnitTest.class, "createClientCache",
-        new Object[] { NetworkUtils.getServerHostName(Host.getHost(0)), new Integer(PORT1),new Integer(PORT2)});
-    vm3.invoke(DestroyEntryPropagationDUnitTest.class, "createClientCache",
-        new Object[] { NetworkUtils.getServerHostName(Host.getHost(0)), new Integer(PORT1),new Integer(PORT2)});
+    vm2.invoke(() -> DestroyEntryPropagationDUnitTest.createClientCache( NetworkUtils.getServerHostName(Host.getHost(0)), new Integer(PORT1),new Integer(PORT2)));
+    vm3.invoke(() -> DestroyEntryPropagationDUnitTest.createClientCache( NetworkUtils.getServerHostName(Host.getHost(0)), new Integer(PORT1),new Integer(PORT2)));
 
   }
 
@@ -125,28 +123,24 @@ public class DestroyEntryPropagationDUnitTest extends DistributedTestCase
   public void testDestroyPropagation()
   {
     //First create entries on both servers via the two clients
-    vm2.invoke(DestroyEntryPropagationDUnitTest.class, "createEntriesK1andK2");
-    vm3.invoke(DestroyEntryPropagationDUnitTest.class, "createEntriesK1andK2");
+    vm2.invoke(() -> DestroyEntryPropagationDUnitTest.createEntriesK1andK2());
+    vm3.invoke(() -> DestroyEntryPropagationDUnitTest.createEntriesK1andK2());
 
     // register interest for key-1
-    vm2.invoke(DestroyEntryPropagationDUnitTest.class, "registerKey1");
+    vm2.invoke(() -> DestroyEntryPropagationDUnitTest.registerKey1());
     // register interest for key-1
-    vm3.invoke(DestroyEntryPropagationDUnitTest.class, "registerKey1");
+    vm3.invoke(() -> DestroyEntryPropagationDUnitTest.registerKey1());
 
     //destroy entry key-1 , key-2
-    vm2.invoke(DestroyEntryPropagationDUnitTest.class, "destroyEntriesK1andK2");
+    vm2.invoke(() -> DestroyEntryPropagationDUnitTest.destroyEntriesK1andK2());
     // verify destroy entry on first server
-    vm0.invoke(DestroyEntryPropagationDUnitTest.class,
-        "verifyEntriesAreDestroyed");
+    vm0.invoke(() -> DestroyEntryPropagationDUnitTest.verifyEntriesAreDestroyed());
     // verify destroy entry on second server
-    vm1.invoke(DestroyEntryPropagationDUnitTest.class,
-        "verifyEntriesAreDestroyed");
+    vm1.invoke(() -> DestroyEntryPropagationDUnitTest.verifyEntriesAreDestroyed());
     //  verify destroy entry in originator vm
-    vm2.invoke(DestroyEntryPropagationDUnitTest.class,
-        "verifyEntriesAreDestroyed");
+    vm2.invoke(() -> DestroyEntryPropagationDUnitTest.verifyEntriesAreDestroyed());
     // verify only key-1 is destroyed
-    vm3.invoke(DestroyEntryPropagationDUnitTest.class,
-        "verifyOnlyRegisteredEntriesAreDestroyed");
+    vm3.invoke(() -> DestroyEntryPropagationDUnitTest.verifyOnlyRegisteredEntriesAreDestroyed());
 
   }
 
@@ -158,26 +152,22 @@ public class DestroyEntryPropagationDUnitTest extends DistributedTestCase
   public void testDestroyOnServerPropagation()
   {
     //First create entries on both servers via the two client
-    vm2.invoke(DestroyEntryPropagationDUnitTest.class, "createEntriesK1andK2");
-    vm3.invoke(DestroyEntryPropagationDUnitTest.class, "createEntriesK1andK2");
+    vm2.invoke(() -> DestroyEntryPropagationDUnitTest.createEntriesK1andK2());
+    vm3.invoke(() -> DestroyEntryPropagationDUnitTest.createEntriesK1andK2());
 
-    vm2.invoke(DestroyEntryPropagationDUnitTest.class, "registerKey1");
-    vm3.invoke(DestroyEntryPropagationDUnitTest.class, "registerKey1");
+    vm2.invoke(() -> DestroyEntryPropagationDUnitTest.registerKey1());
+    vm3.invoke(() -> DestroyEntryPropagationDUnitTest.registerKey1());
 
     //destroy entry on server directly
-    vm0.invoke(DestroyEntryPropagationDUnitTest.class, "destroyEntriesK1andK2");
+    vm0.invoke(() -> DestroyEntryPropagationDUnitTest.destroyEntriesK1andK2());
     // verify destroy entry on server 1
-    vm0.invoke(DestroyEntryPropagationDUnitTest.class,
-        "verifyEntriesAreDestroyed");
+    vm0.invoke(() -> DestroyEntryPropagationDUnitTest.verifyEntriesAreDestroyed());
     //  verify destroy entry on second server
-    vm1.invoke(DestroyEntryPropagationDUnitTest.class,
-        "verifyEntriesAreDestroyed");
+    vm1.invoke(() -> DestroyEntryPropagationDUnitTest.verifyEntriesAreDestroyed());
     //  verify destroy entry only for registered keys in client1
-    vm2.invoke(DestroyEntryPropagationDUnitTest.class,
-        "verifyOnlyRegisteredEntriesAreDestroyed");
+    vm2.invoke(() -> DestroyEntryPropagationDUnitTest.verifyOnlyRegisteredEntriesAreDestroyed());
     //  verify destroy entry only for registered keys in client 2
-    vm3.invoke(DestroyEntryPropagationDUnitTest.class,
-        "verifyOnlyRegisteredEntriesAreDestroyed");
+    vm3.invoke(() -> DestroyEntryPropagationDUnitTest.verifyOnlyRegisteredEntriesAreDestroyed());
 
   }
 
@@ -194,12 +184,12 @@ public class DestroyEntryPropagationDUnitTest extends DistributedTestCase
   {
     final int maxWaitTime = Integer.getInteger(WAIT_PROPERTY, WAIT_DEFAULT).intValue();
     //First create entries on both servers via the two client
-    vm2.invoke(DestroyEntryPropagationDUnitTest.class, "createEntriesK1andK2");
-    vm3.invoke(DestroyEntryPropagationDUnitTest.class, "createEntriesK1andK2");
-    vm2.invoke(DestroyEntryPropagationDUnitTest.class, "registerKey1");
-    vm3.invoke(DestroyEntryPropagationDUnitTest.class, "registerKey1");
+    vm2.invoke(() -> DestroyEntryPropagationDUnitTest.createEntriesK1andK2());
+    vm3.invoke(() -> DestroyEntryPropagationDUnitTest.createEntriesK1andK2());
+    vm2.invoke(() -> DestroyEntryPropagationDUnitTest.registerKey1());
+    vm3.invoke(() -> DestroyEntryPropagationDUnitTest.registerKey1());
     //Induce fail over of InterestList Endpoint to Server 2 by killing server1
-    vm0.invoke(DestroyEntryPropagationDUnitTest.class, "killServer", new Object[]{new Integer(PORT1) });
+    vm0.invoke(() -> DestroyEntryPropagationDUnitTest.killServer(new Integer(PORT1) ));
     //Wait for 10 seconds to allow fail over. This would mean that Interest
     // has failed over to Server2.
     vm2.invoke(new CacheSerializableRunnable("Wait for server on port1 to be dead") {
@@ -232,7 +222,7 @@ public class DestroyEntryPropagationDUnitTest extends DistributedTestCase
 
     //Start Server1 again so that both clients1 & Client 2 will establish
     // connection to server1 too.
-    vm0.invoke(DestroyEntryPropagationDUnitTest.class, "startServer", new Object[]{new Integer(PORT1) });
+    vm0.invoke(() -> DestroyEntryPropagationDUnitTest.startServer(new Integer(PORT1) ));
 
     vm2.invoke(new CacheSerializableRunnable("Wait for server on port1 to spring to life") {
       public void run2() throws CacheException
@@ -256,17 +246,13 @@ public class DestroyEntryPropagationDUnitTest extends DistributedTestCase
 
     //Do a destroy on Server1 via Connection object from client1.
     // Client1 should not receive updated value while client2 should receive
-    vm2.invoke(DestroyEntryPropagationDUnitTest.class,
-        "acquireConnectionsAndDestroyEntriesK1andK2");
+    vm2.invoke(() -> DestroyEntryPropagationDUnitTest.acquireConnectionsAndDestroyEntriesK1andK2());
    // pause(10000);
     //  Check if both the puts ( on key1 & key2 ) have reached the servers
-    vm0.invoke(DestroyEntryPropagationDUnitTest.class,
-        "verifyEntriesAreDestroyed");
-    vm1.invoke(DestroyEntryPropagationDUnitTest.class,
-        "verifyEntriesAreDestroyed");
+    vm0.invoke(() -> DestroyEntryPropagationDUnitTest.verifyEntriesAreDestroyed());
+    vm1.invoke(() -> DestroyEntryPropagationDUnitTest.verifyEntriesAreDestroyed());
 
-    vm2.invoke(DestroyEntryPropagationDUnitTest.class,
-        "verifyNoDestroyEntryInSender");
+    vm2.invoke(() -> DestroyEntryPropagationDUnitTest.verifyNoDestroyEntryInSender());
 
   }
 
@@ -502,10 +488,10 @@ public class DestroyEntryPropagationDUnitTest extends DistributedTestCase
   @Override
   protected final void preTearDown() throws Exception {
     //close client
-    vm2.invoke(DestroyEntryPropagationDUnitTest.class, "closeCache");
-    vm3.invoke(DestroyEntryPropagationDUnitTest.class, "closeCache");
+    vm2.invoke(() -> DestroyEntryPropagationDUnitTest.closeCache());
+    vm3.invoke(() -> DestroyEntryPropagationDUnitTest.closeCache());
     //close server
-    vm0.invoke(DestroyEntryPropagationDUnitTest.class, "closeCache");
-    vm1.invoke(DestroyEntryPropagationDUnitTest.class, "closeCache");
+    vm0.invoke(() -> DestroyEntryPropagationDUnitTest.closeCache());
+    vm1.invoke(() -> DestroyEntryPropagationDUnitTest.closeCache());
   }
 }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/69024aa9/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientQueueSizeDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientQueueSizeDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientQueueSizeDUnitTest.java
index dbe2355..648718f 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientQueueSizeDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientQueueSizeDUnitTest.java
@@ -83,10 +83,8 @@ public class DurableClientQueueSizeDUnitTest extends DistributedTestCase {
     vm2 = Host.getHost(0).getVM(2);
     vm3 = Host.getHost(0).getVM(3);
 
-    port0 = (Integer) vm0.invoke(DurableClientQueueSizeDUnitTest.class,
-        "createCacheServer", new Object[] { });
-    port1 = (Integer) vm1.invoke(DurableClientQueueSizeDUnitTest.class,
-        "createCacheServer", new Object[] { });
+    port0 = (Integer) vm0.invoke(() -> DurableClientQueueSizeDUnitTest.createCacheServer( ));
+    port1 = (Integer) vm1.invoke(() -> DurableClientQueueSizeDUnitTest.createCacheServer( ));
     IgnoredException.addIgnoredException("java.net.SocketException");
     IgnoredException.addIgnoredException("Unexpected IOException");
   }
@@ -95,19 +93,18 @@ public class DurableClientQueueSizeDUnitTest extends DistributedTestCase {
   protected final void preTearDown() throws Exception {
     closeCache();
 
-    vm2.invoke(DurableClientQueueSizeDUnitTest.class, "closeCache");
-    vm3.invoke(DurableClientQueueSizeDUnitTest.class, "closeCache");
+    vm2.invoke(() -> DurableClientQueueSizeDUnitTest.closeCache());
+    vm3.invoke(() -> DurableClientQueueSizeDUnitTest.closeCache());
 
-    vm0.invoke(DurableClientQueueSizeDUnitTest.class, "closeCache");
-    vm1.invoke(DurableClientQueueSizeDUnitTest.class, "closeCache");
+    vm0.invoke(() -> DurableClientQueueSizeDUnitTest.closeCache());
+    vm1.invoke(() -> DurableClientQueueSizeDUnitTest.closeCache());
   }
 
   public void testNonDurableClientFails() throws Exception {
     vm2.invoke(DurableClientQueueSizeDUnitTest.class, "createClientCache",
         new Object[] { vm2.getHost(), new Integer[] { port0, port1 }, false });
 
-    vm2.invoke(DurableClientQueueSizeDUnitTest.class, "verifyQueueSize",
-        new Object[] { EXCEPTION });
+    vm2.invoke(() -> DurableClientQueueSizeDUnitTest.verifyQueueSize( EXCEPTION ));
   }
 
   // this test is disabled due to a high rate of failure.  It fails with
@@ -117,23 +114,20 @@ public class DurableClientQueueSizeDUnitTest extends DistributedTestCase {
     int num = 10;
     vm2.invoke(DurableClientQueueSizeDUnitTest.class, "createClientCache",
         new Object[] { vm2.getHost(), new Integer[] { port0, port1 }});
-    vm2.invoke(DurableClientQueueSizeDUnitTest.class, "verifyQueueSize",
-        new Object[] { PoolImpl.PRIMARY_QUEUE_NOT_AVAILABLE });
-    vm2.invoke(DurableClientQueueSizeDUnitTest.class, "doRI");
-    vm2.invoke(DurableClientQueueSizeDUnitTest.class, "readyForEvents");
+    vm2.invoke(() -> DurableClientQueueSizeDUnitTest.verifyQueueSize( PoolImpl.PRIMARY_QUEUE_NOT_AVAILABLE ));
+    vm2.invoke(() -> DurableClientQueueSizeDUnitTest.doRI());
+    vm2.invoke(() -> DurableClientQueueSizeDUnitTest.readyForEvents());
 
-    vm2.invoke(DurableClientQueueSizeDUnitTest.class, "closeCache", new Object[] {Boolean.TRUE});
+    vm2.invoke(() -> DurableClientQueueSizeDUnitTest.closeCache(Boolean.TRUE));
 
-    vm0.invoke(DurableClientQueueSizeDUnitTest.class, "doPuts", new Object[] {num});
+    vm0.invoke(() -> DurableClientQueueSizeDUnitTest.doPuts(num));
     
     vm2.invoke(DurableClientQueueSizeDUnitTest.class, "createClientCache",
         new Object[] { vm2.getHost(), new Integer[] { port0, port1 }});
 
-    vm2.invoke(DurableClientQueueSizeDUnitTest.class, "verifyQueueSize",
-        new Object[] { num + 1 /* +1 for marker */});
-    vm2.invoke(DurableClientQueueSizeDUnitTest.class, "readyForEvents");
-    vm2.invoke(DurableClientQueueSizeDUnitTest.class, "verifyQueueSize",
-        new Object[] { EXCEPTION });
+    vm2.invoke(() -> DurableClientQueueSizeDUnitTest.verifyQueueSize( num + 1 /* +1 for marker */));
+    vm2.invoke(() -> DurableClientQueueSizeDUnitTest.readyForEvents());
+    vm2.invoke(() -> DurableClientQueueSizeDUnitTest.verifyQueueSize( EXCEPTION ));
 
   }
 
@@ -145,55 +139,48 @@ public class DurableClientQueueSizeDUnitTest extends DistributedTestCase {
         "createClientCache",
         new Object[] { vm2.getHost(), new Integer[] { port0, port1 },
             String.valueOf(timeoutSeconds), true });
-    vm2.invoke(DurableClientQueueSizeDUnitTest.class, "doRI");
-    vm2.invoke(DurableClientQueueSizeDUnitTest.class, "readyForEvents");
+    vm2.invoke(() -> DurableClientQueueSizeDUnitTest.doRI());
+    vm2.invoke(() -> DurableClientQueueSizeDUnitTest.readyForEvents());
 
-    vm2.invoke(DurableClientQueueSizeDUnitTest.class, "closeCache", new Object[] {Boolean.TRUE});
+    vm2.invoke(() -> DurableClientQueueSizeDUnitTest.closeCache(Boolean.TRUE));
 
-    vm0.invoke(DurableClientQueueSizeDUnitTest.class, "doPuts", new Object[] {num});
+    vm0.invoke(() -> DurableClientQueueSizeDUnitTest.doPuts(num));
     Thread.sleep(timeoutSeconds * 1000); // TODO use a waitCriterion
 
     vm2.invoke(DurableClientQueueSizeDUnitTest.class, "createClientCache",
         new Object[] { vm2.getHost(), new Integer[] { port0, port1 }});
 
-    vm2.invoke(DurableClientQueueSizeDUnitTest.class, "verifyQueueSize",
-        new Object[] { PoolImpl.PRIMARY_QUEUE_TIMED_OUT });
+    vm2.invoke(() -> DurableClientQueueSizeDUnitTest.verifyQueueSize( PoolImpl.PRIMARY_QUEUE_TIMED_OUT ));
   }
 
   public void testPrimaryServerRebootReturnsCorrectResponse() throws Exception {
     int num = 10;
     vm2.invoke(DurableClientQueueSizeDUnitTest.class, "createClientCache",
         new Object[] { vm2.getHost(), new Integer[] { port0, port1 } });
-    vm2.invoke(DurableClientQueueSizeDUnitTest.class, "doRI");
-    vm2.invoke(DurableClientQueueSizeDUnitTest.class, "readyForEvents");
+    vm2.invoke(() -> DurableClientQueueSizeDUnitTest.doRI());
+    vm2.invoke(() -> DurableClientQueueSizeDUnitTest.readyForEvents());
 
-    vm2.invoke(DurableClientQueueSizeDUnitTest.class, "closeCache",
-        new Object[] { Boolean.TRUE });
+    vm2.invoke(() -> DurableClientQueueSizeDUnitTest.closeCache( Boolean.TRUE ));
 
-    vm0.invoke(DurableClientQueueSizeDUnitTest.class, "doPuts",
-        new Object[] { num });
+    vm0.invoke(() -> DurableClientQueueSizeDUnitTest.doPuts( num ));
 
     // Identify primary and restart it
-    boolean isVM0Primary = (Boolean) vm0.invoke(
-        DurableClientQueueSizeDUnitTest.class, "isPrimary");
+    boolean isVM0Primary = (Boolean) vm0.invoke(() -> DurableClientQueueSizeDUnitTest.isPrimary());
     int port = 0;
     if (isVM0Primary) {
-      vm0.invoke(DurableClientQueueSizeDUnitTest.class, "closeCache");
-      vm0.invoke(DurableClientQueueSizeDUnitTest.class, "createCacheServer",
-          new Object[] { port0 });
+      vm0.invoke(() -> DurableClientQueueSizeDUnitTest.closeCache());
+      vm0.invoke(() -> DurableClientQueueSizeDUnitTest.createCacheServer( port0 ));
       port = port0;
     } else { // vm1 is primary
-      vm1.invoke(DurableClientQueueSizeDUnitTest.class, "closeCache");
-      vm1.invoke(DurableClientQueueSizeDUnitTest.class, "createCacheServer",
-          new Object[] { port1 });
+      vm1.invoke(() -> DurableClientQueueSizeDUnitTest.closeCache());
+      vm1.invoke(() -> DurableClientQueueSizeDUnitTest.createCacheServer( port1 ));
       port = port1;
     }
 
     vm2.invoke(DurableClientQueueSizeDUnitTest.class, "createClientCache",
         new Object[] { vm2.getHost(), new Integer[] { port } });
 
-    vm2.invoke(DurableClientQueueSizeDUnitTest.class, "verifyQueueSize",
-        new Object[] { PoolImpl.PRIMARY_QUEUE_NOT_AVAILABLE });
+    vm2.invoke(() -> DurableClientQueueSizeDUnitTest.verifyQueueSize( PoolImpl.PRIMARY_QUEUE_NOT_AVAILABLE ));
   }
 
   public void bug51854_testMultiPoolClientReconnectsBeforeTimeOut() throws Exception {
@@ -201,24 +188,21 @@ public class DurableClientQueueSizeDUnitTest extends DistributedTestCase {
     vm2.invoke(DurableClientQueueSizeDUnitTest.class, "createClientCache",
         new Object[] { vm2.getHost(), new Integer[] { port0, port1 }, "300",
             true/* durable */, true /* multiPool */});
-    vm2.invoke(DurableClientQueueSizeDUnitTest.class, "verifyQueueSize",
-        new Object[] { PoolImpl.PRIMARY_QUEUE_NOT_AVAILABLE, PoolImpl.PRIMARY_QUEUE_NOT_AVAILABLE });
-    vm2.invoke(DurableClientQueueSizeDUnitTest.class, "doRI");
-    vm2.invoke(DurableClientQueueSizeDUnitTest.class, "readyForEvents");
+    vm2.invoke(() -> DurableClientQueueSizeDUnitTest.verifyQueueSize( PoolImpl.PRIMARY_QUEUE_NOT_AVAILABLE, PoolImpl.PRIMARY_QUEUE_NOT_AVAILABLE ));
+    vm2.invoke(() -> DurableClientQueueSizeDUnitTest.doRI());
+    vm2.invoke(() -> DurableClientQueueSizeDUnitTest.readyForEvents());
 
-    vm2.invoke(DurableClientQueueSizeDUnitTest.class, "closeCache", new Object[] {Boolean.TRUE});
+    vm2.invoke(() -> DurableClientQueueSizeDUnitTest.closeCache(Boolean.TRUE));
 
-    vm0.invoke(DurableClientQueueSizeDUnitTest.class, "doPuts", new Object[] {num});
+    vm0.invoke(() -> DurableClientQueueSizeDUnitTest.doPuts(num));
     
     vm2.invoke(DurableClientQueueSizeDUnitTest.class, "createClientCache",
         new Object[] { vm2.getHost(), new Integer[] { port0, port1 }, "300",
             true/* durable */, true /* multiPool */});
 
-    vm2.invoke(DurableClientQueueSizeDUnitTest.class, "verifyQueueSize",
-        new Object[] { num + 1 /* +1 for marker */, (num * 2) + 1});
-    vm2.invoke(DurableClientQueueSizeDUnitTest.class, "readyForEvents");
-    vm2.invoke(DurableClientQueueSizeDUnitTest.class, "verifyQueueSize",
-        new Object[] { EXCEPTION, EXCEPTION });
+    vm2.invoke(() -> DurableClientQueueSizeDUnitTest.verifyQueueSize( num + 1 /* +1 for marker */, (num * 2) + 1));
+    vm2.invoke(() -> DurableClientQueueSizeDUnitTest.readyForEvents());
+    vm2.invoke(() -> DurableClientQueueSizeDUnitTest.verifyQueueSize( EXCEPTION, EXCEPTION ));
   }
 
   public void bug51854_testMultiPoolClientReconnectsAfterTimeOut() throws Exception {
@@ -229,14 +213,13 @@ public class DurableClientQueueSizeDUnitTest extends DistributedTestCase {
         "createClientCache",
         new Object[] { vm2.getHost(), new Integer[] { port0, port1 },
             String.valueOf(timeout), true/* durable */, true /* multiPool */});
-    vm2.invoke(DurableClientQueueSizeDUnitTest.class, "verifyQueueSize",
-        new Object[] { PoolImpl.PRIMARY_QUEUE_NOT_AVAILABLE, PoolImpl.PRIMARY_QUEUE_NOT_AVAILABLE });
-    vm2.invoke(DurableClientQueueSizeDUnitTest.class, "doRI");
-    vm2.invoke(DurableClientQueueSizeDUnitTest.class, "readyForEvents");
+    vm2.invoke(() -> DurableClientQueueSizeDUnitTest.verifyQueueSize( PoolImpl.PRIMARY_QUEUE_NOT_AVAILABLE, PoolImpl.PRIMARY_QUEUE_NOT_AVAILABLE ));
+    vm2.invoke(() -> DurableClientQueueSizeDUnitTest.doRI());
+    vm2.invoke(() -> DurableClientQueueSizeDUnitTest.readyForEvents());
 
-    vm2.invoke(DurableClientQueueSizeDUnitTest.class, "closeCache", new Object[] {Boolean.TRUE});
+    vm2.invoke(() -> DurableClientQueueSizeDUnitTest.closeCache(Boolean.TRUE));
 
-    vm0.invoke(DurableClientQueueSizeDUnitTest.class, "doPuts", new Object[] {num});
+    vm0.invoke(() -> DurableClientQueueSizeDUnitTest.doPuts(num));
 //    vm0.invoke(DurableClientQueueSizeDUnitTest.class,
 //        "verifyQueueSizeAtServer", new Object[] { DEFAULT_POOL_NAME, num + 1 });
 //    vm0.invoke(DurableClientQueueSizeDUnitTest.class,
@@ -247,8 +230,7 @@ public class DurableClientQueueSizeDUnitTest extends DistributedTestCase {
         new Object[] { vm2.getHost(), new Integer[] { port0, port1 }, "300",
             true/* durable */, true /* multiPool */});
 
-    vm2.invoke(DurableClientQueueSizeDUnitTest.class, "verifyQueueSize",
-        new Object[] { PoolImpl.PRIMARY_QUEUE_TIMED_OUT, PoolImpl.PRIMARY_QUEUE_TIMED_OUT});
+    vm2.invoke(() -> DurableClientQueueSizeDUnitTest.verifyQueueSize( PoolImpl.PRIMARY_QUEUE_TIMED_OUT, PoolImpl.PRIMARY_QUEUE_TIMED_OUT));
   }
 
   public void _testMultiPoolClientFailsOver() throws Exception {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/69024aa9/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientReconnectDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientReconnectDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientReconnectDUnitTest.java
index 6ade4bd..5f25c3a 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientReconnectDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientReconnectDUnitTest.java
@@ -106,10 +106,10 @@ public class DurableClientReconnectDUnitTest extends DistributedTestCase
     server4 = host.getVM(3);
 
     // start servers first
-    PORT1 =  ((Integer) server1.invoke(DurableClientReconnectDUnitTest.class, "createServerCache"));
-    PORT2 =  ((Integer) server2.invoke(DurableClientReconnectDUnitTest.class, "createServerCache"));
-    PORT3 =  ((Integer) server3.invoke(DurableClientReconnectDUnitTest.class, "createServerCache"));
-    PORT4 =  ((Integer) server4.invoke(DurableClientReconnectDUnitTest.class, "createServerCache"));
+    PORT1 =  ((Integer) server1.invoke(() -> DurableClientReconnectDUnitTest.createServerCache()));
+    PORT2 =  ((Integer) server2.invoke(() -> DurableClientReconnectDUnitTest.createServerCache()));
+    PORT3 =  ((Integer) server3.invoke(() -> DurableClientReconnectDUnitTest.createServerCache()));
+    PORT4 =  ((Integer) server4.invoke(() -> DurableClientReconnectDUnitTest.createServerCache()));
     SERVER1 = NetworkUtils.getServerHostName(host)+PORT1;
     SERVER2 = NetworkUtils.getServerHostName(host)+PORT2;
     SERVER3 = NetworkUtils.getServerHostName(host)+PORT3;
@@ -488,46 +488,46 @@ public class DurableClientReconnectDUnitTest extends DistributedTestCase
   
   private void determineAndVerfiyRedundantServers(Collection redundantServers) {
     if(redundantServers.contains(SERVER1)){
-      server1.invoke(DurableClientReconnectDUnitTest.class, "verifyDurableClientOnServer");
+      server1.invoke(() -> DurableClientReconnectDUnitTest.verifyDurableClientOnServer());
     }
     if(redundantServers.contains(SERVER2)){
-      server2.invoke(DurableClientReconnectDUnitTest.class, "verifyDurableClientOnServer");  
+      server2.invoke(() -> DurableClientReconnectDUnitTest.verifyDurableClientOnServer());  
     }
     if (redundantServers.contains(SERVER3)){
-      server3.invoke(DurableClientReconnectDUnitTest.class, "verifyDurableClientOnServer");
+      server3.invoke(() -> DurableClientReconnectDUnitTest.verifyDurableClientOnServer());
     }
     if(redundantServers.contains(SERVER4)){
-      server4.invoke(DurableClientReconnectDUnitTest.class, "verifyDurableClientOnServer");
+      server4.invoke(() -> DurableClientReconnectDUnitTest.verifyDurableClientOnServer());
     }
   }
   
   private void determineAndVerfiyNonRedundantServers(Collection redundantServers) {
     if(!redundantServers.contains(SERVER1)){
-      server1.invoke(DurableClientReconnectDUnitTest.class, "verifyNoDurableClientOnServer");
+      server1.invoke(() -> DurableClientReconnectDUnitTest.verifyNoDurableClientOnServer());
     }
     if(!redundantServers.contains(SERVER2)){
-      server2.invoke(DurableClientReconnectDUnitTest.class, "verifyNoDurableClientOnServer");  
+      server2.invoke(() -> DurableClientReconnectDUnitTest.verifyNoDurableClientOnServer());  
     }
     if (!redundantServers.contains(SERVER3)){
-      server3.invoke(DurableClientReconnectDUnitTest.class, "verifyNoDurableClientOnServer");
+      server3.invoke(() -> DurableClientReconnectDUnitTest.verifyNoDurableClientOnServer());
     }
     if(!redundantServers.contains(SERVER4)){
-      server4.invoke(DurableClientReconnectDUnitTest.class, "verifyNoDurableClientOnServer");
+      server4.invoke(() -> DurableClientReconnectDUnitTest.verifyNoDurableClientOnServer());
     }
   }
   
   private void closeServer(String server) {
     if(server.equals(SERVER1)){
-      server1.invoke(DurableClientReconnectDUnitTest.class, "closeCache");
+      server1.invoke(() -> DurableClientReconnectDUnitTest.closeCache());
     }
     if(server.equals(SERVER2)){
-      server2.invoke(DurableClientReconnectDUnitTest.class, "closeCache");  
+      server2.invoke(() -> DurableClientReconnectDUnitTest.closeCache());  
     }
     if (server.equals(SERVER3)){
-      server3.invoke(DurableClientReconnectDUnitTest.class, "closeCache");
+      server3.invoke(() -> DurableClientReconnectDUnitTest.closeCache());
     }
     if(server.equals(SERVER4)){
-      server4.invoke(DurableClientReconnectDUnitTest.class, "closeCache");
+      server4.invoke(() -> DurableClientReconnectDUnitTest.closeCache());
     }
   }
 
@@ -737,10 +737,10 @@ public class DurableClientReconnectDUnitTest extends DistributedTestCase
     closeCache();
 
     // then close the servers
-    server1.invoke(DurableClientReconnectDUnitTest.class, "closeCache");
-    server2.invoke(DurableClientReconnectDUnitTest.class, "closeCache");
-    server3.invoke(DurableClientReconnectDUnitTest.class, "closeCache");
-    server4.invoke(DurableClientReconnectDUnitTest.class, "closeCache");
+    server1.invoke(() -> DurableClientReconnectDUnitTest.closeCache());
+    server2.invoke(() -> DurableClientReconnectDUnitTest.closeCache());
+    server3.invoke(() -> DurableClientReconnectDUnitTest.closeCache());
+    server4.invoke(() -> DurableClientReconnectDUnitTest.closeCache());
   }
 
  public void closeCache(boolean keepAlive)

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/69024aa9/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientStatsDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientStatsDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientStatsDUnitTest.java
index 97cb31c..e3e38a4 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientStatsDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientStatsDUnitTest.java
@@ -82,7 +82,7 @@ public class DurableClientStatsDUnitTest extends DistributedTestCase {
   @Override
   protected final void preTearDown() throws Exception {
     // Stop server 1
-    this.server1VM.invoke(CacheServerTestUtil.class, "closeCache");
+    this.server1VM.invoke(() -> CacheServerTestUtil.closeCache());
     CacheServerTestUtil.resetDisableShufflingOfEndpointsFlag();
   }
   
@@ -90,10 +90,9 @@ public class DurableClientStatsDUnitTest extends DistributedTestCase {
 
 
     // Step 1: Starting the servers
-    PORT1 = ((Integer)this.server1VM.invoke(CacheServerTestUtil.class,
-        "createCacheServer", new Object[] { regionName, new Boolean(true)
-             })).intValue();
-    this.server1VM.invoke(DurableClientStatsDUnitTest.class, "checkStatistics");
+    PORT1 = ((Integer)this.server1VM.invoke(() -> CacheServerTestUtil.createCacheServer( regionName, new Boolean(true)
+             ))).intValue();
+    this.server1VM.invoke(() -> DurableClientStatsDUnitTest.checkStatistics());
     // Step 2: Bring Up the Client
     // Start a durable client that is not kept alive on the server when it
     // stops normally
@@ -109,8 +108,7 @@ public class DurableClientStatsDUnitTest extends DistributedTestCase {
     startRegisterAndCloseNonDurableClientCache( durableClientTimeout);
     Wait.pause(500);
 
-    this.server1VM.invoke(DurableClientStatsDUnitTest.class, "putValue",
-        new Object[] { K1, "Value1" });         //////// -> Enqueue Message1
+    this.server1VM.invoke(() -> DurableClientStatsDUnitTest.putValue( K1, "Value1" ));         //////// -> Enqueue Message1
 
     Wait.pause(500);
     startAndCloseNonDurableClientCache(1);      //////// -> Reconnection2
@@ -120,24 +118,21 @@ public class DurableClientStatsDUnitTest extends DistributedTestCase {
     startRegisterAndCloseNonDurableClientCache( durableClientTimeout);
     Wait.pause(500);
 
-    this.server1VM.invoke(DurableClientStatsDUnitTest.class, "putValue",
-        new Object[] { K1, "NewValue1" });      //////// -> Enqueue Message2
+    this.server1VM.invoke(() -> DurableClientStatsDUnitTest.putValue( K1, "NewValue1" ));      //////// -> Enqueue Message2
 
     startAndCloseNonDurableClientCache(durableClientTimeout);   //////// -> Reconnection3
 
-    this.server1VM.invoke(DurableClientStatsDUnitTest.class,
-        "checkStatisticsWithExpectedValues", new Object[] { new Integer(0),
-            new Integer(0), new Integer(0) });
+    this.server1VM.invoke(() -> DurableClientStatsDUnitTest.checkStatisticsWithExpectedValues( new Integer(0),
+            new Integer(0), new Integer(0) ));
   
     
   }
   public void testDurableClientStatistics() {
 
     // Step 1: Starting the servers
-    PORT1 = ((Integer)this.server1VM.invoke(CacheServerTestUtil.class,
-        "createCacheServer", new Object[] { regionName, new Boolean(true)
-      })).intValue();
-    this.server1VM.invoke(DurableClientStatsDUnitTest.class, "checkStatistics");
+    PORT1 = ((Integer)this.server1VM.invoke(() -> CacheServerTestUtil.createCacheServer( regionName, new Boolean(true)
+      ))).intValue();
+    this.server1VM.invoke(() -> DurableClientStatsDUnitTest.checkStatistics());
     // Step 2: Bring Up the Client
     // Start a durable client that is not kept alive on the server when it
     // stops normally
@@ -153,8 +148,7 @@ public class DurableClientStatsDUnitTest extends DistributedTestCase {
     startRegisterAndCloseDurableClientCache( durableClientTimeout);
     Wait.pause(500);
 
-    this.server1VM.invoke(DurableClientStatsDUnitTest.class, "putValue",
-        new Object[] { K1, "Value1" });         //////// -> Enqueue Message1
+    this.server1VM.invoke(() -> DurableClientStatsDUnitTest.putValue( K1, "Value1" ));         //////// -> Enqueue Message1
 
     Wait.pause(500);
     startAndCloseDurableClientCache(1);      //////// -> Reconnection2
@@ -164,14 +158,12 @@ public class DurableClientStatsDUnitTest extends DistributedTestCase {
     startRegisterAndCloseDurableClientCache( durableClientTimeout);
     Wait.pause(500);
 
-    this.server1VM.invoke(DurableClientStatsDUnitTest.class, "putValue",
-        new Object[] { K1, "NewValue1" });      //////// -> Enqueue Message2
+    this.server1VM.invoke(() -> DurableClientStatsDUnitTest.putValue( K1, "NewValue1" ));      //////// -> Enqueue Message2
 
     startAndCloseDurableClientCache(durableClientTimeout);   //////// -> Reconnection3
 
-    this.server1VM.invoke(DurableClientStatsDUnitTest.class,
-        "checkStatisticsWithExpectedValues", new Object[] { new Integer(3),
-            new Integer(4), new Integer(2) });
+    this.server1VM.invoke(() -> DurableClientStatsDUnitTest.checkStatisticsWithExpectedValues( new Integer(3),
+            new Integer(4), new Integer(2) ));
   }
   
   
@@ -179,12 +171,11 @@ public class DurableClientStatsDUnitTest extends DistributedTestCase {
   public void startRegisterAndCloseDurableClientCache(int durableClientTimeout) {
     final String durableClientId = getName() + "_client";
 
-    this.durableClientVM.invoke(CacheServerTestUtil.class, "createCacheClient",
-        new Object[] {
+    this.durableClientVM.invoke(() -> CacheServerTestUtil.createCacheClient(
             getClientPool(NetworkUtils.getServerHostName(durableClientVM.getHost()), PORT1, true, 0),
             regionName,
             getDurableClientDistributedSystemProperties(durableClientId,
-                durableClientTimeout), Boolean.TRUE });
+                durableClientTimeout), Boolean.TRUE ));
 
     // Send clientReady message
     this.durableClientVM.invoke(new CacheSerializableRunnable(
@@ -195,21 +186,19 @@ public class DurableClientStatsDUnitTest extends DistributedTestCase {
       }
     });
 
-    this.durableClientVM.invoke(DurableClientStatsDUnitTest.class,
-        "registerKey", new Object[] { K1, new Boolean(true) });
+    this.durableClientVM.invoke(() -> DurableClientStatsDUnitTest.registerKey( K1, new Boolean(true) ));
 
-    this.durableClientVM.invoke(DurableClientStatsDUnitTest.class, "closeCache");
+    this.durableClientVM.invoke(() -> DurableClientStatsDUnitTest.closeCache());
   }
 
   public void startRegisterAndCloseNonDurableClientCache(int durableClientTimeout) {
     final String durableClientId = getName() + "_client";
 
-    this.durableClientVM.invoke(CacheServerTestUtil.class, "createCacheClient",
-        new Object[] {
+    this.durableClientVM.invoke(() -> CacheServerTestUtil.createCacheClient(
             getClientPool(NetworkUtils.getServerHostName(durableClientVM.getHost()), PORT1, true, 0),
             regionName,
             getNonDurableClientDistributedSystemProperties(durableClientId,
-                durableClientTimeout), Boolean.TRUE });
+                durableClientTimeout), Boolean.TRUE ));
 
     // Send clientReady message
 //    this.durableClientVM.invoke(new CacheSerializableRunnable(
@@ -219,22 +208,20 @@ public class DurableClientStatsDUnitTest extends DistributedTestCase {
 //      }
 //    });
 
-    this.durableClientVM.invoke(DurableClientStatsDUnitTest.class,
-        "registerKey", new Object[] { K1, new Boolean(false) });
+    this.durableClientVM.invoke(() -> DurableClientStatsDUnitTest.registerKey( K1, new Boolean(false) ));
 
-    this.durableClientVM.invoke(DurableClientStatsDUnitTest.class, "closeCache");
+    this.durableClientVM.invoke(() -> DurableClientStatsDUnitTest.closeCache());
   }
   
   public void startAndCloseDurableClientCache(int durableClientTimeout) {
 
     final String durableClientId = getName() + "_client";
 
-    this.durableClientVM.invoke(CacheServerTestUtil.class, "createCacheClient",
-        new Object[] {
+    this.durableClientVM.invoke(() -> CacheServerTestUtil.createCacheClient(
             getClientPool(NetworkUtils.getServerHostName(durableClientVM.getHost()), PORT1, true, 0),
             regionName,
             getDurableClientDistributedSystemProperties(durableClientId,
-                durableClientTimeout), Boolean.TRUE });
+                durableClientTimeout), Boolean.TRUE ));
 
     // Send clientReady message
     this.durableClientVM.invoke(new CacheSerializableRunnable(
@@ -245,7 +232,7 @@ public class DurableClientStatsDUnitTest extends DistributedTestCase {
       }
     });
 
-    this.durableClientVM.invoke(DurableClientStatsDUnitTest.class, "closeCache");
+    this.durableClientVM.invoke(() -> DurableClientStatsDUnitTest.closeCache());
 
   }
 
@@ -253,12 +240,11 @@ public class DurableClientStatsDUnitTest extends DistributedTestCase {
 
     final String durableClientId = getName() + "_client";
 
-    this.durableClientVM.invoke(CacheServerTestUtil.class, "createCacheClient",
-        new Object[] {
+    this.durableClientVM.invoke(() -> CacheServerTestUtil.createCacheClient(
             getClientPool(NetworkUtils.getServerHostName(durableClientVM.getHost()), PORT1, true, 0),
             regionName,
             getNonDurableClientDistributedSystemProperties(durableClientId,
-                durableClientTimeout), Boolean.TRUE });
+                durableClientTimeout), Boolean.TRUE ));
 
     // Send clientReady message
 //    this.durableClientVM.invoke(new CacheSerializableRunnable(
@@ -268,7 +254,7 @@ public class DurableClientStatsDUnitTest extends DistributedTestCase {
 //      }
 //    });
 
-    this.durableClientVM.invoke(DurableClientStatsDUnitTest.class, "closeCache");
+    this.durableClientVM.invoke(() -> DurableClientStatsDUnitTest.closeCache());
 
   }
   


Mime
View raw message