geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From upthewatersp...@apache.org
Subject [25/63] [abbrv] incubator-geode git commit: Automatically converting calls of vm.invoke to lambdas
Date Fri, 19 Feb 2016 18:37:02 GMT
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/69024aa9/gemfire-cq/src/test/java/com/gemstone/gemfire/internal/cache/PRDeltaPropagationDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-cq/src/test/java/com/gemstone/gemfire/internal/cache/PRDeltaPropagationDUnitTest.java b/gemfire-cq/src/test/java/com/gemstone/gemfire/internal/cache/PRDeltaPropagationDUnitTest.java
index 8a4eeaa..12fd791 100755
--- a/gemfire-cq/src/test/java/com/gemstone/gemfire/internal/cache/PRDeltaPropagationDUnitTest.java
+++ b/gemfire-cq/src/test/java/com/gemstone/gemfire/internal/cache/PRDeltaPropagationDUnitTest.java
@@ -135,12 +135,9 @@ public class PRDeltaPropagationDUnitTest extends DistributedTestCase {
     dataStore3 = host.getVM(3);
     
     DeltaTestImpl.resetDeltaInvokationCounters();
-    dataStore1.invoke(PRDeltaPropagationDUnitTest.class,
-        "resetAll");
-    dataStore2.invoke(PRDeltaPropagationDUnitTest.class,
-        "resetAll");
-    dataStore3.invoke(PRDeltaPropagationDUnitTest.class,
-    "resetAll");
+    dataStore1.invoke(() -> PRDeltaPropagationDUnitTest.resetAll());
+    dataStore2.invoke(() -> PRDeltaPropagationDUnitTest.resetAll());
+    dataStore3.invoke(() -> PRDeltaPropagationDUnitTest.resetAll());
   }
 
   /**
@@ -153,10 +150,8 @@ public class PRDeltaPropagationDUnitTest extends DistributedTestCase {
     createCacheInAllPRVms();
     createDeltaPR(Boolean.FALSE);
     put();
-    Boolean deltaUsed1 = (Boolean)dataStore1.invoke(
-        PRDeltaPropagationDUnitTest.class, "checkForDelta");
-    Boolean deltaUsed2 = (Boolean)dataStore2.invoke(
-        PRDeltaPropagationDUnitTest.class, "checkForDelta");
+    Boolean deltaUsed1 = (Boolean)dataStore1.invoke(() -> PRDeltaPropagationDUnitTest.checkForDelta());
+    Boolean deltaUsed2 = (Boolean)dataStore2.invoke(() -> PRDeltaPropagationDUnitTest.checkForDelta());
     assertTrue("Delta Propagation Not Used in PR", (deltaUsed1 && deltaUsed2));
   }
 
@@ -172,12 +167,10 @@ public class PRDeltaPropagationDUnitTest extends DistributedTestCase {
     Integer port2 = (Integer)dataStore2.invoke(
         PRDeltaPropagationDUnitTest.class, "createCacheServerWithPR", args);
     // Do puts after slowing the dispatcher.
-    dataStore1.invoke(ConflationDUnitTest.class, "setIsSlowStart",
-        new Object[] { "60000" });
-    dataStore2.invoke(ConflationDUnitTest.class, "setIsSlowStart",
-        new Object[] { "60000" });
+    dataStore1.invoke(() -> ConflationDUnitTest.setIsSlowStart( "60000" ));
+    dataStore2.invoke(() -> ConflationDUnitTest.setIsSlowStart( "60000" ));
     createClientCache(port1,port2);
-    client1.invoke(PRDeltaPropagationDUnitTest.class,"createClientCache", new Object[] {port1,port2});
+    client1.invoke(() -> PRDeltaPropagationDUnitTest.createClientCache(port1,port2));
     
     int deltaSent = putsWhichReturnsDeltaSent();
     
@@ -192,12 +185,12 @@ public class PRDeltaPropagationDUnitTest extends DistributedTestCase {
       secondary = dataStore1;
     }
     
-    primary.invoke(PRDeltaPropagationDUnitTest.class, "closeCache");
+    primary.invoke(() -> PRDeltaPropagationDUnitTest.closeCache());
     Thread.sleep(5000);    
-    secondary.invoke(ConflationDUnitTest.class, "unsetIsSlowStart");
+    secondary.invoke(() -> ConflationDUnitTest.unsetIsSlowStart());
     
-    client1.invoke(PRDeltaPropagationDUnitTest.class, "waitForLastKey");    
-    client1.invoke(PRDeltaPropagationDUnitTest.class, "checkDeltaInvoked", new Object[]{new Integer(deltaSent)});    
+    client1.invoke(() -> PRDeltaPropagationDUnitTest.waitForLastKey());    
+    client1.invoke(() -> PRDeltaPropagationDUnitTest.checkDeltaInvoked(new Integer(deltaSent)));    
   }
 
   public void testDeltaPropagationForPRFailoverWithCompression() throws Throwable {
@@ -213,12 +206,10 @@ public class PRDeltaPropagationDUnitTest extends DistributedTestCase {
       });
 
     // Do puts after slowing the dispatcher.    
-    dataStore1.invoke(ConflationDUnitTest.class, "setIsSlowStart",
-        new Object[] { "60000" });
-    dataStore2.invoke(ConflationDUnitTest.class, "setIsSlowStart",
-        new Object[] { "60000" });
+    dataStore1.invoke(() -> ConflationDUnitTest.setIsSlowStart( "60000" ));
+    dataStore2.invoke(() -> ConflationDUnitTest.setIsSlowStart( "60000" ));
     createClientCache(port1,port2);
-    client1.invoke(PRDeltaPropagationDUnitTest.class,"createClientCache", new Object[] {port1,port2});
+    client1.invoke(() -> PRDeltaPropagationDUnitTest.createClientCache(port1,port2));
     
     int deltaSent = putsWhichReturnsDeltaSent();
     
@@ -233,12 +224,12 @@ public class PRDeltaPropagationDUnitTest extends DistributedTestCase {
       secondary = dataStore1;
     }
     
-    primary.invoke(PRDeltaPropagationDUnitTest.class, "closeCache");
+    primary.invoke(() -> PRDeltaPropagationDUnitTest.closeCache());
     Thread.sleep(5000);    
-    secondary.invoke(ConflationDUnitTest.class, "unsetIsSlowStart");
+    secondary.invoke(() -> ConflationDUnitTest.unsetIsSlowStart());
     
-    client1.invoke(PRDeltaPropagationDUnitTest.class, "waitForLastKey");    
-    client1.invoke(PRDeltaPropagationDUnitTest.class, "checkDeltaInvoked", new Object[]{new Integer(deltaSent)});    
+    client1.invoke(() -> PRDeltaPropagationDUnitTest.waitForLastKey());    
+    client1.invoke(() -> PRDeltaPropagationDUnitTest.checkDeltaInvoked(new Integer(deltaSent)));    
   }
   
   /**
@@ -249,8 +240,8 @@ public class PRDeltaPropagationDUnitTest extends DistributedTestCase {
     createCacheInAllPRVms();
     createDeltaPR(Boolean.TRUE);
     putWithExpiry();
-    dataStore1.invoke(PRDeltaPropagationDUnitTest.class, "checkForFullObject");
-    dataStore2.invoke(PRDeltaPropagationDUnitTest.class, "checkForFullObject");
+    dataStore1.invoke(() -> PRDeltaPropagationDUnitTest.checkForFullObject());
+    dataStore2.invoke(() -> PRDeltaPropagationDUnitTest.checkForFullObject());
   }
 
   /**
@@ -269,12 +260,11 @@ public class PRDeltaPropagationDUnitTest extends DistributedTestCase {
     Integer port1 = (Integer)dataStore1.invoke(
         PRDeltaPropagationDUnitTest.class, "createCacheServerWithPR", args1);
     createClientCache(port1, new Boolean(true), new Boolean(false), new Boolean(false));
-    client1.invoke(PRDeltaPropagationDUnitTest.class, "createClientCache",
-        new Object[] { port2, new Boolean(true), new Boolean(false), new Boolean(false)});    
+    client1.invoke(() -> PRDeltaPropagationDUnitTest.createClientCache( port2, new Boolean(true), new Boolean(false), new Boolean(false)));    
     int deltaSent = putsWhichReturnsDeltaSent();
     
-    client1.invoke(PRDeltaPropagationDUnitTest.class, "waitForLastKey");    
-    client1.invoke(PRDeltaPropagationDUnitTest.class, "checkDeltaInvoked", new Object[]{new Integer(deltaSent)});    
+    client1.invoke(() -> PRDeltaPropagationDUnitTest.waitForLastKey());    
+    client1.invoke(() -> PRDeltaPropagationDUnitTest.checkDeltaInvoked(new Integer(deltaSent)));    
   }
   
   /**
@@ -297,8 +287,7 @@ public class PRDeltaPropagationDUnitTest extends DistributedTestCase {
     Integer port1 = (Integer)dataStore1.invoke(
         PRDeltaPropagationDUnitTest.class, "createCacheServerWithPR", args1);
     createClientCache(port1, new Boolean(false), new Boolean(false),  new Boolean(false));
-    client1.invoke(PRDeltaPropagationDUnitTest.class, "createClientCache",
-        new Object[] { port2, new Boolean(true) , new Boolean(false), new Boolean(false)});    
+    client1.invoke(() -> PRDeltaPropagationDUnitTest.createClientCache( port2, new Boolean(true) , new Boolean(false), new Boolean(false)));    
 
     // feed delta
     DeltaTestImpl test = new DeltaTestImpl();
@@ -308,7 +297,7 @@ public class PRDeltaPropagationDUnitTest extends DistributedTestCase {
     deltaPR.put(DELTA_KEY, test);
 
     // perform invalidate on accessor
-    dataStore2.invoke(PRDeltaPropagationDUnitTest.class, "invalidateDeltaKey");
+    dataStore2.invoke(() -> PRDeltaPropagationDUnitTest.invalidateDeltaKey());
     
     /*Thread.sleep(2000);*/
 
@@ -318,8 +307,8 @@ public class PRDeltaPropagationDUnitTest extends DistributedTestCase {
 
 /*    putWithExpiry();*/    
     deltaPR.put(LAST_KEY, "");    
-    client1.invoke(PRDeltaPropagationDUnitTest.class, "waitForLastKey");    
-    client1.invoke(PRDeltaPropagationDUnitTest.class, "checkForFullObject");    
+    client1.invoke(() -> PRDeltaPropagationDUnitTest.waitForLastKey());    
+    client1.invoke(() -> PRDeltaPropagationDUnitTest.checkForFullObject());    
   }
   
   /**
@@ -343,8 +332,7 @@ public class PRDeltaPropagationDUnitTest extends DistributedTestCase {
     Integer port1 = (Integer)dataStore1.invoke(
         PRDeltaPropagationDUnitTest.class, "createCacheServerWithPR", args1);
     createClientCache(port1, new Boolean(false), new Boolean(true),  new Boolean(false));
-    client1.invoke(PRDeltaPropagationDUnitTest.class, "createClientCache",
-        new Object[] { port2, new Boolean(true), new Boolean(false), new Boolean(false)});
+    client1.invoke(() -> PRDeltaPropagationDUnitTest.createClientCache( port2, new Boolean(true), new Boolean(false), new Boolean(false)));
     
     // feed delta
     DeltaTestImpl test = new DeltaTestImpl();
@@ -354,7 +342,7 @@ public class PRDeltaPropagationDUnitTest extends DistributedTestCase {
     deltaPR.put(DELTA_KEY, test);
 
     // perform invalidate on accessor
-    dataStore2.invoke(PRDeltaPropagationDUnitTest.class, "invalidateDeltaKey");
+    dataStore2.invoke(() -> PRDeltaPropagationDUnitTest.invalidateDeltaKey());
 
     test = new DeltaTestImpl();
     test.setStr("DELTA");
@@ -364,8 +352,8 @@ public class PRDeltaPropagationDUnitTest extends DistributedTestCase {
     
     checkToDeltaCounter(new Integer(2));
     
-    client1.invoke(PRDeltaPropagationDUnitTest.class, "waitForLastKey");
-    client1.invoke(PRDeltaPropagationDUnitTest.class, "checkForFullObject");
+    client1.invoke(() -> PRDeltaPropagationDUnitTest.waitForLastKey());
+    client1.invoke(() -> PRDeltaPropagationDUnitTest.checkForFullObject());
     
   }
   
@@ -400,7 +388,7 @@ public class PRDeltaPropagationDUnitTest extends DistributedTestCase {
     deltaPR.put(DELTA_KEY, test);
 
     // perform invalidate on accessor
-    dataStore2.invoke(PRDeltaPropagationDUnitTest.class, "invalidateDeltaKey");
+    dataStore2.invoke(() -> PRDeltaPropagationDUnitTest.invalidateDeltaKey());
 
     test = new DeltaTestImpl();
     test.setStr("DELTA");
@@ -408,12 +396,11 @@ public class PRDeltaPropagationDUnitTest extends DistributedTestCase {
 
     deltaPR.put(LAST_KEY, "");
     
-    dataStore2.invoke(PRDeltaPropagationDUnitTest.class, "waitForLastKey");
+    dataStore2.invoke(() -> PRDeltaPropagationDUnitTest.waitForLastKey());
     // check and reset isFailed flag
-    dataStore2.invoke(PRDeltaPropagationDUnitTest.class, "checkIsFailed");
+    dataStore2.invoke(() -> PRDeltaPropagationDUnitTest.checkIsFailed());
     
-    dataStore2.invoke(PRDeltaPropagationDUnitTest.class, "fromDeltaCounter",
-        new Object[] { new Integer(1) });
+    dataStore2.invoke(() -> PRDeltaPropagationDUnitTest.fromDeltaCounter( new Integer(1) ));
   }
   
   /**
@@ -437,18 +424,16 @@ public class PRDeltaPropagationDUnitTest extends DistributedTestCase {
         new Boolean(false));
     
     // enable CQ listner validation for this test for this client
-    client1.invoke(PRDeltaPropagationDUnitTest.class,
-        "setForOldNewCQVarification", new Object[] { new Boolean(true) });
+    client1.invoke(() -> PRDeltaPropagationDUnitTest.setForOldNewCQVarification( new Boolean(true) ));
     
     // Not registering any interest but register cq server2
-    client1.invoke(PRDeltaPropagationDUnitTest.class, "createClientCache",
-        new Object[] { port2, new Boolean(false), new Boolean(false),
-            new Boolean(true) });
+    client1.invoke(() -> PRDeltaPropagationDUnitTest.createClientCache( port2, new Boolean(false), new Boolean(false),
+            new Boolean(true) ));
     
     // check cloning is disabled
-    dataStore1.invoke(PRDeltaPropagationDUnitTest.class, "checkCloning");
-    dataStore2.invoke(PRDeltaPropagationDUnitTest.class, "checkCloning");
-    client1.invoke(PRDeltaPropagationDUnitTest.class, "checkCloning");
+    dataStore1.invoke(() -> PRDeltaPropagationDUnitTest.checkCloning());
+    dataStore2.invoke(() -> PRDeltaPropagationDUnitTest.checkCloning());
+    client1.invoke(() -> PRDeltaPropagationDUnitTest.checkCloning());
     checkCloning();
     
     // feed delta
@@ -461,18 +446,15 @@ public class PRDeltaPropagationDUnitTest extends DistributedTestCase {
     deltaPR.put(LAST_KEY, new DeltaTestImpl(5, ""));
     
     // wait for last key
-    client1.invoke(PRDeltaPropagationDUnitTest.class, "waitForLastKey");
+    client1.invoke(() -> PRDeltaPropagationDUnitTest.waitForLastKey());
     // full object, server will send full object as only CQ are registered
-    client1.invoke(PRDeltaPropagationDUnitTest.class, "fromDeltaCounter",
-        new Object[] { new Integer(0) });
-    boolean failed = ((Boolean)client1.invoke(
-        PRDeltaPropagationDUnitTest.class, "isFailed")).booleanValue();
+    client1.invoke(() -> PRDeltaPropagationDUnitTest.fromDeltaCounter( new Integer(0) ));
+    boolean failed = ((Boolean)client1.invoke(() -> PRDeltaPropagationDUnitTest.isFailed())).booleanValue();
     // no cq events should get miss
     assertTrue("EVENT Missed", failed == true);
     
     // region size should be zero in second client as no registration happens
-    client1.invoke(PRDeltaPropagationDUnitTest.class, "checkRegionSize",
-        new Object[] { new Integer(0)});
+    client1.invoke(() -> PRDeltaPropagationDUnitTest.checkRegionSize( new Integer(0)));
   }
   
   /**
@@ -497,9 +479,8 @@ public class PRDeltaPropagationDUnitTest extends DistributedTestCase {
     createClientCache(port1, new Boolean(false), new Boolean(true),
         new Boolean(false));
     // no register interest but register cq
-    client1.invoke(PRDeltaPropagationDUnitTest.class, "createClientCache",
-        new Object[] { port1, new Boolean(false), new Boolean(false),
-            new Boolean(true) });
+    client1.invoke(() -> PRDeltaPropagationDUnitTest.createClientCache( port1, new Boolean(false), new Boolean(false),
+            new Boolean(true) ));
 
     // feed delta
     // This delta obj satisfies CQ
@@ -512,12 +493,10 @@ public class PRDeltaPropagationDUnitTest extends DistributedTestCase {
 
     deltaPR.put(LAST_KEY, new DeltaTestImpl(8,""));
 
-    client1.invoke(PRDeltaPropagationDUnitTest.class, "waitForLastKey");
-    boolean flag = ((Boolean)client1.invoke(PRDeltaPropagationDUnitTest.class,
-        "verifyQueryUpdateExecuted")).booleanValue();
+    client1.invoke(() -> PRDeltaPropagationDUnitTest.waitForLastKey());
+    boolean flag = ((Boolean)client1.invoke(() -> PRDeltaPropagationDUnitTest.verifyQueryUpdateExecuted())).booleanValue();
     assertTrue("client update cq not executed properly", flag);
-    flag = ((Boolean)client1.invoke(PRDeltaPropagationDUnitTest.class,
-        "verifyQueryDestroyExecuted")).booleanValue();
+    flag = ((Boolean)client1.invoke(() -> PRDeltaPropagationDUnitTest.verifyQueryDestroyExecuted())).booleanValue();
     assertTrue("client destroy cq not executed properly", flag);        
   }
 
@@ -557,9 +536,8 @@ public class PRDeltaPropagationDUnitTest extends DistributedTestCase {
         new Boolean(false));
     // client1 is attached to BridgeServer dataStore3
     // client1 does not registerInterest but registers cq
-    client1.invoke(PRDeltaPropagationDUnitTest.class, "createClientCache",
-        new Object[] { port3, new Boolean(false), new Boolean(false),
-            new Boolean(true) });
+    client1.invoke(() -> PRDeltaPropagationDUnitTest.createClientCache( port3, new Boolean(false), new Boolean(false),
+            new Boolean(true) ));
 
     // create delta keys (1 primary 1 redundant bucket on each dataStore)
     DeltaTestImpl test = new DeltaTestImpl(8, "");
@@ -570,15 +548,12 @@ public class PRDeltaPropagationDUnitTest extends DistributedTestCase {
 
     deltaPR.put(LAST_KEY, new DeltaTestImpl(8, ""));
   
-    client1.invoke(PRDeltaPropagationDUnitTest.class, "waitForLastKey");
+    client1.invoke(() -> PRDeltaPropagationDUnitTest.waitForLastKey());
     // verify no delta is sent by server to client1
-    dataStore3.invoke(PRDeltaPropagationDUnitTest.class, "verifyDeltaSent",
-        new Object[] { Integer.valueOf(1) });
-    boolean flag = ((Boolean)client1.invoke(PRDeltaPropagationDUnitTest.class,
-        "verifyQueryUpdateExecuted")).booleanValue();
+    dataStore3.invoke(() -> PRDeltaPropagationDUnitTest.verifyDeltaSent( Integer.valueOf(1) ));
+    boolean flag = ((Boolean)client1.invoke(() -> PRDeltaPropagationDUnitTest.verifyQueryUpdateExecuted())).booleanValue();
     assertTrue("client update cq not executed properly", flag);
-    flag = ((Boolean)client1.invoke(PRDeltaPropagationDUnitTest.class,
-        "verifyQueryDestroyExecuted")).booleanValue();
+    flag = ((Boolean)client1.invoke(() -> PRDeltaPropagationDUnitTest.verifyQueryDestroyExecuted())).booleanValue();
     assertTrue("client destroy cq not executed properly", flag);        
   }
 
@@ -619,9 +594,8 @@ public class PRDeltaPropagationDUnitTest extends DistributedTestCase {
         new Boolean(false));
     // client1 is attached to BridgeServer dataStore3
     // client1 registers Interest as well as cq
-    client1.invoke(PRDeltaPropagationDUnitTest.class, "createClientCache",
-        new Object[] { port3, new Boolean(true), new Boolean(false),
-            new Boolean(true) });
+    client1.invoke(() -> PRDeltaPropagationDUnitTest.createClientCache( port3, new Boolean(true), new Boolean(false),
+            new Boolean(true) ));
 
     // create delta keys (1 primary 1 redundant bucket on each dataStore)
     DeltaTestImpl test = new DeltaTestImpl(8, "");
@@ -632,14 +606,11 @@ public class PRDeltaPropagationDUnitTest extends DistributedTestCase {
   
     deltaPR.put(LAST_KEY, new DeltaTestImpl(8, ""));
   
-    client1.invoke(PRDeltaPropagationDUnitTest.class, "waitForLastKey");
-    client1.invoke(PRDeltaPropagationDUnitTest.class, "fromDeltaCounter",
-        new Object[] { new Integer(1) });
-    boolean flag = ((Boolean)client1.invoke(PRDeltaPropagationDUnitTest.class,
-        "verifyQueryUpdateExecuted")).booleanValue();
+    client1.invoke(() -> PRDeltaPropagationDUnitTest.waitForLastKey());
+    client1.invoke(() -> PRDeltaPropagationDUnitTest.fromDeltaCounter( new Integer(1) ));
+    boolean flag = ((Boolean)client1.invoke(() -> PRDeltaPropagationDUnitTest.verifyQueryUpdateExecuted())).booleanValue();
     assertTrue("client update cq not executed properly", flag);
-    flag = ((Boolean)client1.invoke(PRDeltaPropagationDUnitTest.class,
-        "verifyQueryDestroyExecuted")).booleanValue();
+    flag = ((Boolean)client1.invoke(() -> PRDeltaPropagationDUnitTest.verifyQueryDestroyExecuted())).booleanValue();
     assertTrue("client destroy cq not executed properly", flag);        
   }
 
@@ -660,12 +631,11 @@ public class PRDeltaPropagationDUnitTest extends DistributedTestCase {
     Integer port1 = (Integer)dataStore1.invoke(
         PRDeltaPropagationDUnitTest.class, "createCacheServerWithPR", args1);
     createClientCache(port1, new Boolean(true), new Boolean(false), new Boolean(false));
-    client1.invoke(PRDeltaPropagationDUnitTest.class, "createClientCache",
-        new Object[] { port1, new Boolean(true), new Boolean(false), new Boolean(false)});    
+    client1.invoke(() -> PRDeltaPropagationDUnitTest.createClientCache( port1, new Boolean(true), new Boolean(false), new Boolean(false)));    
     int deltaSent = putsWhichReturnsDeltaSent();
     
-    client1.invoke(PRDeltaPropagationDUnitTest.class, "waitForLastKey");    
-    client1.invoke(PRDeltaPropagationDUnitTest.class, "checkDeltaInvoked", new Object[]{new Integer(deltaSent)});    
+    client1.invoke(() -> PRDeltaPropagationDUnitTest.waitForLastKey());    
+    client1.invoke(() -> PRDeltaPropagationDUnitTest.checkDeltaInvoked(new Integer(deltaSent)));    
   }
   
   /**
@@ -687,17 +657,15 @@ public class PRDeltaPropagationDUnitTest extends DistributedTestCase {
     //Empty data policy on client
     createClientCache(port1, new Boolean(true), new Boolean(true), new Boolean(false));
     
-    client1.invoke(PRDeltaPropagationDUnitTest.class, "createClientCache",
-        new Object[] { port1, new Boolean(true), new Boolean(false), new Boolean(false)});    
+    client1.invoke(() -> PRDeltaPropagationDUnitTest.createClientCache( port1, new Boolean(true), new Boolean(false), new Boolean(false)));    
     
     //Feed on an accessor
-    int deltaSent =  (Integer)dataStore1.invoke(
-        PRDeltaPropagationDUnitTest.class,"putsWhichReturnsDeltaSent");
+    int deltaSent =  (Integer)dataStore1.invoke(() -> PRDeltaPropagationDUnitTest.putsWhichReturnsDeltaSent());
     
     waitForLastKey();
     checkDeltaInvoked(new Integer(0));
-    client1.invoke(PRDeltaPropagationDUnitTest.class, "waitForLastKey");    
-    client1.invoke(PRDeltaPropagationDUnitTest.class, "checkDeltaInvoked", new Object[]{new Integer(deltaSent)});    
+    client1.invoke(() -> PRDeltaPropagationDUnitTest.waitForLastKey());    
+    client1.invoke(() -> PRDeltaPropagationDUnitTest.checkDeltaInvoked(new Integer(deltaSent)));    
   }
   
   /**
@@ -721,18 +689,18 @@ public class PRDeltaPropagationDUnitTest extends DistributedTestCase {
 
     PRDeltaTestImpl val1 = new PRDeltaTestImpl();
     val1.setIntVar(11);
-    dataStore2.invoke(PRDeltaPropagationDUnitTest.class, "put", new Object[]{val1});
+    dataStore2.invoke(() -> PRDeltaPropagationDUnitTest.put(val1));
 
-    dataStore2.invoke(PRDeltaPropagationDUnitTest.class, "setBadToDelta", new Object[]{true});
+    dataStore2.invoke(() -> PRDeltaPropagationDUnitTest.setBadToDelta(true));
     try {
       PRDeltaTestImpl val2 = new PRDeltaTestImpl();
       val2.setIntVar(22);
-      dataStore2.invoke(PRDeltaPropagationDUnitTest.class, "put", new Object[]{val2});
+      dataStore2.invoke(() -> PRDeltaPropagationDUnitTest.put(val2));
       fail("Did not expect successful delta put.");
     } catch (Exception e) {
       // expected
     }
-    dataStore2.invoke(PRDeltaPropagationDUnitTest.class, "checkVal", new Object[]{val1});
+    dataStore2.invoke(() -> PRDeltaPropagationDUnitTest.checkVal(val1));
   }
   
   public static void checkToDeltaCounter(Integer count) {
@@ -1023,8 +991,8 @@ public class PRDeltaPropagationDUnitTest extends DistributedTestCase {
 
   public static void createCacheInAllPRVms() {
     createCacheInVm();
-    dataStore1.invoke(PRDeltaPropagationDUnitTest.class, "createCacheInVm");
-    dataStore2.invoke(PRDeltaPropagationDUnitTest.class, "createCacheInVm");
+    dataStore1.invoke(() -> PRDeltaPropagationDUnitTest.createCacheInVm());
+    dataStore2.invoke(() -> PRDeltaPropagationDUnitTest.createCacheInVm());
   }
 
   public static void put() throws Exception {
@@ -1145,10 +1113,10 @@ public class PRDeltaPropagationDUnitTest extends DistributedTestCase {
   @Override
   protected final void preTearDown() throws Exception {
     closeCache();
-    client1.invoke(PRDeltaPropagationDUnitTest.class, "closeCache");
-    dataStore1.invoke(PRDeltaPropagationDUnitTest.class, "closeCache");
-    dataStore2.invoke(PRDeltaPropagationDUnitTest.class, "closeCache");
-    dataStore3.invoke(PRDeltaPropagationDUnitTest.class, "closeCache");
+    client1.invoke(() -> PRDeltaPropagationDUnitTest.closeCache());
+    dataStore1.invoke(() -> PRDeltaPropagationDUnitTest.closeCache());
+    dataStore2.invoke(() -> PRDeltaPropagationDUnitTest.closeCache());
+    dataStore3.invoke(() -> PRDeltaPropagationDUnitTest.closeCache());
   }
 
   public static void closeCache() {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/69024aa9/gemfire-cq/src/test/java/com/gemstone/gemfire/internal/cache/ha/CQListGIIDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-cq/src/test/java/com/gemstone/gemfire/internal/cache/ha/CQListGIIDUnitTest.java b/gemfire-cq/src/test/java/com/gemstone/gemfire/internal/cache/ha/CQListGIIDUnitTest.java
index 9b8f28f..0ddb70d 100755
--- a/gemfire-cq/src/test/java/com/gemstone/gemfire/internal/cache/ha/CQListGIIDUnitTest.java
+++ b/gemfire-cq/src/test/java/com/gemstone/gemfire/internal/cache/ha/CQListGIIDUnitTest.java
@@ -164,12 +164,8 @@ public class CQListGIIDUnitTest extends DistributedTestCase {
     clientVM1 = host.getVM(2);
     clientVM2 = host.getVM(3);
 
-    PORT1 = ((Integer)serverVM0.invoke(CQListGIIDUnitTest.class,
-        "createServerCache",
-        new Object[] { HARegionQueue.HA_EVICTION_POLICY_MEMORY })).intValue();
-    PORT2 = ((Integer)serverVM1.invoke(CQListGIIDUnitTest.class,
-        "createServerCache",
-        new Object[] { HARegionQueue.HA_EVICTION_POLICY_ENTRY })).intValue();
+    PORT1 = ((Integer)serverVM0.invoke(() -> CQListGIIDUnitTest.createServerCache( HARegionQueue.HA_EVICTION_POLICY_MEMORY ))).intValue();
+    PORT2 = ((Integer)serverVM1.invoke(() -> CQListGIIDUnitTest.createServerCache( HARegionQueue.HA_EVICTION_POLICY_ENTRY ))).intValue();
   }
 
   /**
@@ -177,14 +173,14 @@ public class CQListGIIDUnitTest extends DistributedTestCase {
    */
   @Override
   protected final void preTearDown() throws Exception {
-    serverVM0.invoke(ConflationDUnitTest.class, "unsetIsSlowStart");
-    serverVM1.invoke(ConflationDUnitTest.class, "unsetIsSlowStart");
+    serverVM0.invoke(() -> ConflationDUnitTest.unsetIsSlowStart());
+    serverVM1.invoke(() -> ConflationDUnitTest.unsetIsSlowStart());
     closeCache();
-    clientVM1.invoke(CQListGIIDUnitTest.class, "closeCache");
-    clientVM2.invoke(CQListGIIDUnitTest.class, "closeCache");
+    clientVM1.invoke(() -> CQListGIIDUnitTest.closeCache());
+    clientVM2.invoke(() -> CQListGIIDUnitTest.closeCache());
     // then close the servers
-    serverVM0.invoke(CQListGIIDUnitTest.class, "closeCache");
-    serverVM1.invoke(CQListGIIDUnitTest.class, "closeCache");
+    serverVM0.invoke(() -> CQListGIIDUnitTest.closeCache());
+    serverVM1.invoke(() -> CQListGIIDUnitTest.closeCache());
     disconnectAllFromDS();
   }
 
@@ -610,40 +606,36 @@ public class CQListGIIDUnitTest extends DistributedTestCase {
   public void _testSpecificClientCQIsGIIedPart1() throws Exception {
     Integer size = Integer.valueOf(10);
     // slow start for dispatcher
-    serverVM0.invoke(ConflationDUnitTest.class, "setIsSlowStart",
-        new Object[] { "30000" });
-    serverVM1.invoke(ConflationDUnitTest.class, "setIsSlowStart",
-        new Object[] { "30000" });
+    serverVM0.invoke(() -> ConflationDUnitTest.setIsSlowStart( "30000" ));
+    serverVM1.invoke(() -> ConflationDUnitTest.setIsSlowStart( "30000" ));
 
     // createClientCache(Integer.valueOf(PORT1), Integer.valueOf(PORT2), "1");
-    clientVM1.invoke(CQListGIIDUnitTest.class, "createClientCache",
-        new Object[] { Integer.valueOf(PORT1), Integer.valueOf(PORT2), "1" });
-    clientVM2.invoke(CQListGIIDUnitTest.class, "createClientCache",
-        new Object[] { Integer.valueOf(PORT1), Integer.valueOf(PORT2), "0" });
-
-    clientVM1.invoke(CQListGIIDUnitTest.class, "createCQ", new Object[] {
-        "testSpecificClientCQIsGIIed_0", cqs[0] });
-    clientVM1.invoke(CQListGIIDUnitTest.class, "executeCQ", new Object[] {
-        "testSpecificClientCQIsGIIed_0", Boolean.FALSE });
-    clientVM2.invoke(CQListGIIDUnitTest.class, "createCQ", new Object[] {
-        "testSpecificClientCQIsGIIed_0", cqs[0] });
-    clientVM2.invoke(CQListGIIDUnitTest.class, "executeCQ", new Object[] {
-        "testSpecificClientCQIsGIIed_0", Boolean.FALSE });
-
-    serverVM1.invoke(CQListGIIDUnitTest.class, "stopServer");
-
-    serverVM0.invoke(CQListGIIDUnitTest.class, "putEntries", new Object[] {
-        regions[0], size });
-
-    serverVM1.invoke(CQListGIIDUnitTest.class, "startServer");
+    clientVM1.invoke(() -> CQListGIIDUnitTest.createClientCache( Integer.valueOf(PORT1), Integer.valueOf(PORT2), "1" ));
+    clientVM2.invoke(() -> CQListGIIDUnitTest.createClientCache( Integer.valueOf(PORT1), Integer.valueOf(PORT2), "0" ));
+
+    clientVM1.invoke(() -> CQListGIIDUnitTest.createCQ(
+        "testSpecificClientCQIsGIIed_0", cqs[0] ));
+    clientVM1.invoke(() -> CQListGIIDUnitTest.executeCQ(
+        "testSpecificClientCQIsGIIed_0", Boolean.FALSE ));
+    clientVM2.invoke(() -> CQListGIIDUnitTest.createCQ(
+        "testSpecificClientCQIsGIIed_0", cqs[0] ));
+    clientVM2.invoke(() -> CQListGIIDUnitTest.executeCQ(
+        "testSpecificClientCQIsGIIed_0", Boolean.FALSE ));
+
+    serverVM1.invoke(() -> CQListGIIDUnitTest.stopServer());
+
+    serverVM0.invoke(() -> CQListGIIDUnitTest.putEntries(
+        regions[0], size ));
+
+    serverVM1.invoke(() -> CQListGIIDUnitTest.startServer());
     Thread.sleep(3000); // TODO: Find a better 'n reliable alternative
 
-    serverVM0.invoke(CQListGIIDUnitTest.class, "VerifyCUMCQList", new Object[] {
-        size, Integer.valueOf(2) });
-    serverVM1.invoke(CQListGIIDUnitTest.class, "VerifyCUMCQList", new Object[] {
-        size, Integer.valueOf(1) });
-    serverVM0.invoke(ConflationDUnitTest.class, "unsetIsSlowStart");
-    serverVM1.invoke(ConflationDUnitTest.class, "unsetIsSlowStart");
+    serverVM0.invoke(() -> CQListGIIDUnitTest.VerifyCUMCQList(
+        size, Integer.valueOf(2) ));
+    serverVM1.invoke(() -> CQListGIIDUnitTest.VerifyCUMCQList(
+        size, Integer.valueOf(1) ));
+    serverVM0.invoke(() -> ConflationDUnitTest.unsetIsSlowStart());
+    serverVM1.invoke(() -> ConflationDUnitTest.unsetIsSlowStart());
   }
 
   /**
@@ -657,44 +649,40 @@ public class CQListGIIDUnitTest extends DistributedTestCase {
     Integer size = Integer.valueOf(10);
     VM serverVM2 = clientVM2;
 
-    int port3 = ((Integer)serverVM2.invoke(CQListGIIDUnitTest.class,
-        "createServerCache",
-        new Object[] { HARegionQueue.HA_EVICTION_POLICY_MEMORY })).intValue();
+    int port3 = ((Integer)serverVM2.invoke(() -> CQListGIIDUnitTest.createServerCache( HARegionQueue.HA_EVICTION_POLICY_MEMORY ))).intValue();
 
     // slow start for dispatcher
-    serverVM0.invoke(ConflationDUnitTest.class, "setIsSlowStart",
-        new Object[] { "45000" });
+    serverVM0.invoke(() -> ConflationDUnitTest.setIsSlowStart( "45000" ));
 
     // createClientCache(Integer.valueOf(PORT1), Integer.valueOf(PORT2), "1");
     createClientCache(Integer.valueOf(PORT1), Integer.valueOf(PORT2),
         Integer.valueOf(port3), "1");
     try {
-    clientVM1.invoke(CQListGIIDUnitTest.class, "createClientCache",
-        new Object[] { Integer.valueOf(PORT1), Integer.valueOf(port3),
-            Integer.valueOf(PORT2), "1" });
+    clientVM1.invoke(() -> CQListGIIDUnitTest.createClientCache( Integer.valueOf(PORT1), Integer.valueOf(port3),
+            Integer.valueOf(PORT2), "1" ));
     try {
     createCQ("testSpecificClientCQIsGIIed_0", cqs[0]);
     executeCQ("testSpecificClientCQIsGIIed_0", Boolean.FALSE);
-    clientVM1.invoke(CQListGIIDUnitTest.class, "createCQ", new Object[] {
-        "testSpecificClientCQIsGIIed_0", cqs[0] });
-    clientVM1.invoke(CQListGIIDUnitTest.class, "executeCQ", new Object[] {
-        "testSpecificClientCQIsGIIed_0", Boolean.FALSE });
+    clientVM1.invoke(() -> CQListGIIDUnitTest.createCQ(
+        "testSpecificClientCQIsGIIed_0", cqs[0] ));
+    clientVM1.invoke(() -> CQListGIIDUnitTest.executeCQ(
+        "testSpecificClientCQIsGIIed_0", Boolean.FALSE ));
 
-    serverVM0.invoke(CQListGIIDUnitTest.class, "putEntries", new Object[] {
-        regions[0], size });
+    serverVM0.invoke(() -> CQListGIIDUnitTest.putEntries(
+        regions[0], size ));
 
-    serverVM1.invoke(CQListGIIDUnitTest.class, "VerifyCUMCQList", new Object[] {
-        size, Integer.valueOf(1) });
+    serverVM1.invoke(() -> CQListGIIDUnitTest.VerifyCUMCQList(
+        size, Integer.valueOf(1) ));
 
-    serverVM2.invoke(CQListGIIDUnitTest.class, "stopServer");
+    serverVM2.invoke(() -> CQListGIIDUnitTest.stopServer());
     Thread.sleep(3000); // TODO: Find a better 'n reliable alternative
 
-    serverVM0.invoke(CQListGIIDUnitTest.class, "VerifyCUMCQList", new Object[] {
-      size, Integer.valueOf(2) });
-    serverVM1.invoke(CQListGIIDUnitTest.class, "VerifyCUMCQList", new Object[] {
-        size, Integer.valueOf(2) });
+    serverVM0.invoke(() -> CQListGIIDUnitTest.VerifyCUMCQList(
+      size, Integer.valueOf(2) ));
+    serverVM1.invoke(() -> CQListGIIDUnitTest.VerifyCUMCQList(
+        size, Integer.valueOf(2) ));
     } finally {
-      clientVM1.invoke(CQListGIIDUnitTest.class, "destroyClientPool");
+      clientVM1.invoke(() -> CQListGIIDUnitTest.destroyClientPool());
     }
 
     } finally {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/69024aa9/gemfire-cq/src/test/java/com/gemstone/gemfire/internal/cache/ha/HADispatcherDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-cq/src/test/java/com/gemstone/gemfire/internal/cache/ha/HADispatcherDUnitTest.java b/gemfire-cq/src/test/java/com/gemstone/gemfire/internal/cache/ha/HADispatcherDUnitTest.java
index 8920afb..5b10d3d 100755
--- a/gemfire-cq/src/test/java/com/gemstone/gemfire/internal/cache/ha/HADispatcherDUnitTest.java
+++ b/gemfire-cq/src/test/java/com/gemstone/gemfire/internal/cache/ha/HADispatcherDUnitTest.java
@@ -135,38 +135,34 @@ public class HADispatcherDUnitTest extends DistributedTestCase
     // client 2 VM
     client2 = host.getVM(3);
 
-    PORT1 = ((Integer)server1.invoke(HADispatcherDUnitTest.class,
-        "createServerCache", new Object[] { new Boolean(false) })).intValue();
-    server1.invoke(ConflationDUnitTest.class, "setIsSlowStart");
-    server1.invoke(HADispatcherDUnitTest.class, "makeDispatcherSlow");
-    server1.invoke(HADispatcherDUnitTest.class, "setQRMslow");
-    PORT2 = ((Integer)server2.invoke(HADispatcherDUnitTest.class,
-        "createServerCache", new Object[] { new Boolean(true) })).intValue();
-
-    client1.invoke( CacheServerTestUtil.class, "disableShufflingOfEndpoints");
-    client2.invoke( CacheServerTestUtil.class, "disableShufflingOfEndpoints");
-    client1.invoke(HADispatcherDUnitTest.class, "createClientCache",
-        new Object[] {
+    PORT1 = ((Integer)server1.invoke(() -> HADispatcherDUnitTest.createServerCache( new Boolean(false) ))).intValue();
+    server1.invoke(() -> ConflationDUnitTest.setIsSlowStart());
+    server1.invoke(() -> HADispatcherDUnitTest.makeDispatcherSlow());
+    server1.invoke(() -> HADispatcherDUnitTest.setQRMslow());
+    PORT2 = ((Integer)server2.invoke(() -> HADispatcherDUnitTest.createServerCache( new Boolean(true) ))).intValue();
+
+    client1.invoke(() -> CacheServerTestUtil.disableShufflingOfEndpoints());
+    client2.invoke(() -> CacheServerTestUtil.disableShufflingOfEndpoints());
+    client1.invoke(() -> HADispatcherDUnitTest.createClientCache(
             NetworkUtils.getServerHostName(Host.getHost(0)),
             new Integer(PORT1), new Integer(PORT2),
-            new Boolean(false) });
-    client2.invoke(HADispatcherDUnitTest.class, "createClientCache",
-        new Object[] {
+            new Boolean(false) ));
+    client2.invoke(() -> HADispatcherDUnitTest.createClientCache(
             NetworkUtils.getServerHostName(Host.getHost(0)),
             new Integer(PORT1), new Integer(PORT2),
-            new Boolean(true) });
+            new Boolean(true) ));
     //createClientCache(new Integer(PORT1), new Integer(PORT2), new Boolean(true) );
 
   }
 
   @Override
   protected final void preTearDown() throws Exception {
-    client1.invoke(HADispatcherDUnitTest.class, "closeCache");
-    client2.invoke(HADispatcherDUnitTest.class, "closeCache");
+    client1.invoke(() -> HADispatcherDUnitTest.closeCache());
+    client2.invoke(() -> HADispatcherDUnitTest.closeCache());
     // close server
-    server1.invoke(HADispatcherDUnitTest.class, "resetQRMslow");
-    server1.invoke(HADispatcherDUnitTest.class, "closeCache");
-    server2.invoke(HADispatcherDUnitTest.class, "closeCache");
+    server1.invoke(() -> HADispatcherDUnitTest.resetQRMslow());
+    server1.invoke(() -> HADispatcherDUnitTest.closeCache());
+    server2.invoke(() -> HADispatcherDUnitTest.closeCache());
   }
 
   public static void closeCache()

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/69024aa9/gemfire-cq/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ClientToServerDeltaDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-cq/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ClientToServerDeltaDUnitTest.java b/gemfire-cq/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ClientToServerDeltaDUnitTest.java
index 0449a78..0e589e4 100755
--- a/gemfire-cq/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ClientToServerDeltaDUnitTest.java
+++ b/gemfire-cq/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ClientToServerDeltaDUnitTest.java
@@ -137,16 +137,16 @@ public class ClientToServerDeltaDUnitTest extends DistributedTestCase {
   protected final void preTearDown() throws Exception {
     // reset all flags
     DeltaTestImpl.resetDeltaInvokationCounters();
-    server.invoke(DeltaTestImpl.class, "resetDeltaInvokationCounters");
-    server2.invoke(DeltaTestImpl.class, "resetDeltaInvokationCounters");
-    client.invoke(DeltaTestImpl.class, "resetDeltaInvokationCounters");
-    client2.invoke(DeltaTestImpl.class, "resetDeltaInvokationCounters");
+    server.invoke(() -> DeltaTestImpl.resetDeltaInvokationCounters());
+    server2.invoke(() -> DeltaTestImpl.resetDeltaInvokationCounters());
+    client.invoke(() -> DeltaTestImpl.resetDeltaInvokationCounters());
+    client2.invoke(() -> DeltaTestImpl.resetDeltaInvokationCounters());
     // close the clients first
-    client.invoke(ClientToServerDeltaDUnitTest.class, "closeCache");
-    client2.invoke(ClientToServerDeltaDUnitTest.class, "closeCache");
+    client.invoke(() -> ClientToServerDeltaDUnitTest.closeCache());
+    client2.invoke(() -> ClientToServerDeltaDUnitTest.closeCache());
     // then close the servers
-    server.invoke(ClientToServerDeltaDUnitTest.class, "closeCache");
-    server2.invoke(ClientToServerDeltaDUnitTest.class, "closeCache");
+    server.invoke(() -> ClientToServerDeltaDUnitTest.closeCache());
+    server2.invoke(() -> ClientToServerDeltaDUnitTest.closeCache());
   }
   
   public void initialise(Boolean cq) {
@@ -155,40 +155,30 @@ public class ClientToServerDeltaDUnitTest extends DistributedTestCase {
   }
 
   public void initialise(Boolean clone, String[] queries, Boolean cq, Boolean RI, Boolean enableDelta) {
-    Integer PORT1 = ((Integer)server.invoke(ClientToServerDeltaDUnitTest.class,
-        "createServerCache",
-        new Object[] { Boolean.TRUE, Boolean.FALSE, clone, enableDelta })).intValue();
+    Integer PORT1 = ((Integer)server.invoke(() -> ClientToServerDeltaDUnitTest.createServerCache( Boolean.TRUE, Boolean.FALSE, clone, enableDelta ))).intValue();
 
-    Integer PORT2 = ((Integer)server2.invoke(
-        ClientToServerDeltaDUnitTest.class, "createServerCache", new Object[] {
-            Boolean.TRUE, Boolean.FALSE, clone, enableDelta })).intValue();
+    Integer PORT2 = ((Integer)server2.invoke(() -> ClientToServerDeltaDUnitTest.createServerCache(
+            Boolean.TRUE, Boolean.FALSE, clone, enableDelta ))).intValue();
 
-    client.invoke(ClientToServerDeltaDUnitTest.class, "createClientCache",
-        new Object[] { NetworkUtils.getServerHostName(server.getHost()), new Integer(PORT1),
-            Boolean.FALSE, Boolean.FALSE, Boolean.FALSE });
+    client.invoke(() -> ClientToServerDeltaDUnitTest.createClientCache( NetworkUtils.getServerHostName(server.getHost()), new Integer(PORT1),
+            Boolean.FALSE, Boolean.FALSE, Boolean.FALSE ));
 
-    client2.invoke(ClientToServerDeltaDUnitTest.class, "createClientCache",
-        new Object[] { NetworkUtils.getServerHostName(server2.getHost()),
-            new Integer(PORT2), Boolean.TRUE, Boolean.FALSE, cq, queries, RI });
+    client2.invoke(() -> ClientToServerDeltaDUnitTest.createClientCache( NetworkUtils.getServerHostName(server2.getHost()),
+            new Integer(PORT2), Boolean.TRUE, Boolean.FALSE, cq, queries, RI ));
   }
 
   // Same as initialise() except listener flag is false.
   public void initialise2(Boolean clone, String[] queries, Boolean cq, Boolean RI, Boolean enableDelta) {
-    Integer PORT1 = ((Integer)server.invoke(ClientToServerDeltaDUnitTest.class,
-        "createServerCache",
-        new Object[] { Boolean.FALSE, Boolean.FALSE, clone, enableDelta })).intValue();
+    Integer PORT1 = ((Integer)server.invoke(() -> ClientToServerDeltaDUnitTest.createServerCache( Boolean.FALSE, Boolean.FALSE, clone, enableDelta ))).intValue();
 
-    Integer PORT2 = ((Integer)server2.invoke(
-        ClientToServerDeltaDUnitTest.class, "createServerCache", new Object[] {
-            Boolean.FALSE, Boolean.FALSE, clone, enableDelta })).intValue();
+    Integer PORT2 = ((Integer)server2.invoke(() -> ClientToServerDeltaDUnitTest.createServerCache(
+            Boolean.FALSE, Boolean.FALSE, clone, enableDelta ))).intValue();
 
-    client.invoke(ClientToServerDeltaDUnitTest.class, "createClientCache",
-        new Object[] { NetworkUtils.getServerHostName(server.getHost()), new Integer(PORT1),
-            Boolean.FALSE, Boolean.FALSE, Boolean.FALSE });
+    client.invoke(() -> ClientToServerDeltaDUnitTest.createClientCache( NetworkUtils.getServerHostName(server.getHost()), new Integer(PORT1),
+            Boolean.FALSE, Boolean.FALSE, Boolean.FALSE ));
 
-    client2.invoke(ClientToServerDeltaDUnitTest.class, "createClientCache",
-        new Object[] { NetworkUtils.getServerHostName(server2.getHost()),
-            new Integer(PORT2), Boolean.TRUE, Boolean.FALSE, cq, queries, RI });
+    client2.invoke(() -> ClientToServerDeltaDUnitTest.createClientCache( NetworkUtils.getServerHostName(server2.getHost()),
+            new Integer(PORT2), Boolean.TRUE, Boolean.FALSE, cq, queries, RI ));
   }
 
   /**
@@ -199,23 +189,19 @@ public class ClientToServerDeltaDUnitTest extends DistributedTestCase {
   public void testSendingofFullDeltaObjectsWhenFromDeltaFails() {
     initialise(false);
     // set expected value on server
-    server.invoke(ClientToServerDeltaDUnitTest.class, "setFirstSecondUpdate",
-        new Object[] { putDelta[1], (Integer)putDelta[2] });
-    client.invoke(ClientToServerDeltaDUnitTest.class, "putWithFromDeltaERR",
-        new Object[] { KEY1 });
+    server.invoke(() -> ClientToServerDeltaDUnitTest.setFirstSecondUpdate( putDelta[1], (Integer)putDelta[2] ));
+    client.invoke(() -> ClientToServerDeltaDUnitTest.putWithFromDeltaERR( KEY1 ));
 
     assertTrue("to Delta Propagation feature NOT used.", ((Boolean)client
-        .invoke(DeltaTestImpl.class, "toDeltaFeatureUsed")).booleanValue());
+        .invoke(() -> DeltaTestImpl.toDeltaFeatureUsed())).booleanValue());
     assertTrue("from Delta Propagation feature NOT used.", ((Boolean)server
-        .invoke(DeltaTestImpl.class, "fromDeltaFeatureUsed")).booleanValue());
+        .invoke(() -> DeltaTestImpl.fromDeltaFeatureUsed())).booleanValue());
 
-    assertFalse("Delta Propagation toDeltaFailed", ((Boolean)client.invoke(
-        DeltaTestImpl.class, "isToDeltaFailure")).booleanValue());
+    assertFalse("Delta Propagation toDeltaFailed", ((Boolean)client.invoke(() -> DeltaTestImpl.isToDeltaFailure())).booleanValue());
     assertTrue("Delta Propagation fromDelta not Failed", ((Boolean)server
-        .invoke(DeltaTestImpl.class, "isFromDeltaFailure")).booleanValue());
+        .invoke(() -> DeltaTestImpl.isFromDeltaFailure())).booleanValue());
 
-    boolean err = ((Boolean)server.invoke(ClientToServerDeltaDUnitTest.class,
-        "getError")).booleanValue();
+    boolean err = ((Boolean)server.invoke(() -> ClientToServerDeltaDUnitTest.getError())).booleanValue();
     assertFalse("validation fails", err);
   }
 
@@ -226,22 +212,17 @@ public class ClientToServerDeltaDUnitTest extends DistributedTestCase {
   public void testPutForDeltaObjects() {
     initialise(false);
     // set expected value on server
-    server.invoke(ClientToServerDeltaDUnitTest.class, "setFirstSecondUpdate",
-        new Object[] { putDelta[0], (Integer)putDelta[2] });
+    server.invoke(() -> ClientToServerDeltaDUnitTest.setFirstSecondUpdate( putDelta[0], (Integer)putDelta[2] ));
 
-    client.invoke(ClientToServerDeltaDUnitTest.class, "put",
-        new Object[] { KEY1 });
+    client.invoke(() -> ClientToServerDeltaDUnitTest.put( KEY1 ));
 
     assertTrue("to Delta Propagation feature NOT used.", ((Boolean)client
-        .invoke(DeltaTestImpl.class, "toDeltaFeatureUsed")).booleanValue());
+        .invoke(() -> DeltaTestImpl.toDeltaFeatureUsed())).booleanValue());
     assertTrue("from Delta Propagation feature NOT used.", ((Boolean)server
-        .invoke(DeltaTestImpl.class, "fromDeltaFeatureUsed")).booleanValue());
-    assertFalse("Delta Propagation toDeltaFailed", ((Boolean)client.invoke(
-        DeltaTestImpl.class, "isToDeltaFailure")).booleanValue());
-    assertFalse("Delta Propagation fromDeltaFailed", ((Boolean)server.invoke(
-        DeltaTestImpl.class, "isFromDeltaFailure")).booleanValue());
-    boolean err = ((Boolean)server.invoke(ClientToServerDeltaDUnitTest.class,
-        "getError")).booleanValue();
+        .invoke(() -> DeltaTestImpl.fromDeltaFeatureUsed())).booleanValue());
+    assertFalse("Delta Propagation toDeltaFailed", ((Boolean)client.invoke(() -> DeltaTestImpl.isToDeltaFailure())).booleanValue());
+    assertFalse("Delta Propagation fromDeltaFailed", ((Boolean)server.invoke(() -> DeltaTestImpl.isFromDeltaFailure())).booleanValue());
+    boolean err = ((Boolean)server.invoke(() -> ClientToServerDeltaDUnitTest.getError())).booleanValue();
     assertFalse("validation fails", err);
   }
 
@@ -252,39 +233,32 @@ public class ClientToServerDeltaDUnitTest extends DistributedTestCase {
   public void testClientToClientDeltaPropagation() throws Exception {
     initialise(false);
     // set expected value on s1,s1 and c2
-    server.invoke(ClientToServerDeltaDUnitTest.class, "setFirstSecondUpdate",
-        new Object[] { putDelta[0], (Integer)putDelta[2] });
-    server2.invoke(ClientToServerDeltaDUnitTest.class, "setFirstSecondUpdate",
-        new Object[] { putDelta[0], (Integer)putDelta[2] });
-    client2.invoke(ClientToServerDeltaDUnitTest.class, "setFirstSecondUpdate",
-        new Object[] { putDelta[0], (Integer)putDelta[2] });
+    server.invoke(() -> ClientToServerDeltaDUnitTest.setFirstSecondUpdate( putDelta[0], (Integer)putDelta[2] ));
+    server2.invoke(() -> ClientToServerDeltaDUnitTest.setFirstSecondUpdate( putDelta[0], (Integer)putDelta[2] ));
+    client2.invoke(() -> ClientToServerDeltaDUnitTest.setFirstSecondUpdate( putDelta[0], (Integer)putDelta[2] ));
 
-    client.invoke(ClientToServerDeltaDUnitTest.class, "putDelta",
-        new Object[] { KEY1 });
+    client.invoke(() -> ClientToServerDeltaDUnitTest.putDelta( KEY1 ));
 
     Thread.sleep(5000);
 
     assertTrue("To Delta Propagation feature NOT used.", ((Boolean)client
-        .invoke(DeltaTestImpl.class, "toDeltaFeatureUsed")).booleanValue());
+        .invoke(() -> DeltaTestImpl.toDeltaFeatureUsed())).booleanValue());
     assertTrue("From Delta Propagation feature NOT used.", ((Boolean)server
-        .invoke(DeltaTestImpl.class, "fromDeltaFeatureUsed")).booleanValue());
+        .invoke(() -> DeltaTestImpl.fromDeltaFeatureUsed())).booleanValue());
     // toDelta() should not be invoked
     assertFalse("To Delta Propagation feature used.", ((Boolean)server
-        .invoke(DeltaTestImpl.class, "toDeltaFeatureUsed")).booleanValue());
+        .invoke(() -> DeltaTestImpl.toDeltaFeatureUsed())).booleanValue());
     assertTrue("From Delta Propagation feature NOT used.", ((Boolean)server2
-        .invoke(DeltaTestImpl.class, "fromDeltaFeatureUsed")).booleanValue());
+        .invoke(() -> DeltaTestImpl.fromDeltaFeatureUsed())).booleanValue());
     // toDelta() should not be invoked
     assertFalse("To Delta Propagation feature used.", ((Boolean)server2
-        .invoke(DeltaTestImpl.class, "toDeltaFeatureUsed")).booleanValue());
+        .invoke(() -> DeltaTestImpl.toDeltaFeatureUsed())).booleanValue());
     assertTrue("from Delta Propagation feature NOT used.", ((Boolean)client2
-        .invoke(DeltaTestImpl.class, "fromDeltaFeatureUsed")).booleanValue());
-
-    boolean err = ((Boolean)server.invoke(ClientToServerDeltaDUnitTest.class,
-        "getError")).booleanValue();
-    err = ((Boolean)server2.invoke(ClientToServerDeltaDUnitTest.class,
-        "getError")).booleanValue();
-    err = ((Boolean)client2.invoke(ClientToServerDeltaDUnitTest.class,
-        "getError")).booleanValue();
+        .invoke(() -> DeltaTestImpl.fromDeltaFeatureUsed())).booleanValue());
+
+    boolean err = ((Boolean)server.invoke(() -> ClientToServerDeltaDUnitTest.getError())).booleanValue();
+    err = ((Boolean)server2.invoke(() -> ClientToServerDeltaDUnitTest.getError())).booleanValue();
+    err = ((Boolean)client2.invoke(() -> ClientToServerDeltaDUnitTest.getError())).booleanValue();
     assertFalse("validation fails", err);
   }
 
@@ -708,31 +682,23 @@ public class ClientToServerDeltaDUnitTest extends DistributedTestCase {
    * 1)Verifies that cacheless client calls toDelta <br>
    */
   public void testEmptyClientAsFeederToServer() {
-    Integer PORT1 = ((Integer)server.invoke(ClientToServerDeltaDUnitTest.class,
-        "createServerCache", new Object[] { Boolean.FALSE,
-            Boolean.FALSE })).intValue();
-
-    server2.invoke(ClientToServerDeltaDUnitTest.class, "createServerCache",
-        new Object[] { Boolean.FALSE, Boolean.FALSE });
-
-    client.invoke(ClientToServerDeltaDUnitTest.class, "createClientCache",
-        new Object[] { NetworkUtils.getServerHostName(server.getHost()), new Integer(PORT1),
-            Boolean.FALSE, Boolean.TRUE, Boolean.FALSE });
-
-/*    server2.invoke(ClientToServerDeltaDUnitTest.class, "setFirstSecondUpdate",
-        new Object[] { putDelta[0], (Integer)putDelta[2] });*/
-
-    client.invoke(ClientToServerDeltaDUnitTest.class, "putDelta",
-        new Object[] { KEY1 });
-
-    client.invoke(ClientToServerDeltaDUnitTest.class, "checkTodeltaCounter",
-        new Object[] { new Integer(2)});
-    server.invoke(ClientToServerDeltaDUnitTest.class, "checkFromdeltaCounter");
-    server.invoke(ClientToServerDeltaDUnitTest.class, "checkTodeltaCounter",
-        new Object[] { new Integer(0)});
-    server2.invoke(ClientToServerDeltaDUnitTest.class, "checkFromdeltaCounter");
-    server2.invoke(ClientToServerDeltaDUnitTest.class, "checkTodeltaCounter",
-        new Object[] { new Integer(0)});
+    Integer PORT1 = ((Integer)server.invoke(() -> ClientToServerDeltaDUnitTest.createServerCache( Boolean.FALSE,
+            Boolean.FALSE ))).intValue();
+
+    server2.invoke(() -> ClientToServerDeltaDUnitTest.createServerCache( Boolean.FALSE, Boolean.FALSE ));
+
+    client.invoke(() -> ClientToServerDeltaDUnitTest.createClientCache( NetworkUtils.getServerHostName(server.getHost()), new Integer(PORT1),
+            Boolean.FALSE, Boolean.TRUE, Boolean.FALSE ));
+
+/*    server2.invoke(() -> ClientToServerDeltaDUnitTest.setFirstSecondUpdate( putDelta[0], (Integer)putDelta[2] ));*/
+
+    client.invoke(() -> ClientToServerDeltaDUnitTest.putDelta( KEY1 ));
+
+    client.invoke(() -> ClientToServerDeltaDUnitTest.checkTodeltaCounter( new Integer(2)));
+    server.invoke(() -> ClientToServerDeltaDUnitTest.checkFromdeltaCounter());
+    server.invoke(() -> ClientToServerDeltaDUnitTest.checkTodeltaCounter( new Integer(0)));
+    server2.invoke(() -> ClientToServerDeltaDUnitTest.checkFromdeltaCounter());
+    server2.invoke(() -> ClientToServerDeltaDUnitTest.checkTodeltaCounter( new Integer(0)));
   }
 
   /**
@@ -741,28 +707,22 @@ public class ClientToServerDeltaDUnitTest extends DistributedTestCase {
    * policy just by passed delta to data store<br>
    */
   public void testEmptyServerAsFeederToPeer() {
-    Integer PORT1 = ((Integer)server.invoke(ClientToServerDeltaDUnitTest.class,
-        "createServerCache", new Object[] { Boolean.FALSE,
-            Boolean.TRUE })).intValue();
+    Integer PORT1 = ((Integer)server.invoke(() -> ClientToServerDeltaDUnitTest.createServerCache( Boolean.FALSE,
+            Boolean.TRUE ))).intValue();
 
-    server2.invoke(ClientToServerDeltaDUnitTest.class, "createServerCache",
-        new Object[] { Boolean.FALSE, Boolean.FALSE });
+    server2.invoke(() -> ClientToServerDeltaDUnitTest.createServerCache( Boolean.FALSE, Boolean.FALSE ));
 
-    client.invoke(ClientToServerDeltaDUnitTest.class, "createClientCache",
-        new Object[] { NetworkUtils.getServerHostName(server.getHost()), new Integer(PORT1),
-            Boolean.FALSE, Boolean.TRUE, Boolean.FALSE });
+    client.invoke(() -> ClientToServerDeltaDUnitTest.createClientCache( NetworkUtils.getServerHostName(server.getHost()), new Integer(PORT1),
+            Boolean.FALSE, Boolean.TRUE, Boolean.FALSE ));
 
-    client.invoke(ClientToServerDeltaDUnitTest.class, "putDelta",
-        new Object[] { KEY1 });
+    client.invoke(() -> ClientToServerDeltaDUnitTest.putDelta( KEY1 ));
 
-    client.invoke(ClientToServerDeltaDUnitTest.class, "checkTodeltaCounter",
-        new Object[] { new Integer(2)});
+    client.invoke(() -> ClientToServerDeltaDUnitTest.checkTodeltaCounter( new Integer(2)));
     
-    server.invoke(ClientToServerDeltaDUnitTest.class, "checkDeltaFeatureNotUsed");
+    server.invoke(() -> ClientToServerDeltaDUnitTest.checkDeltaFeatureNotUsed());
     
-    server2.invoke(ClientToServerDeltaDUnitTest.class, "checkTodeltaCounter",
-        new Object[] { new Integer(0)});
-    server2.invoke(ClientToServerDeltaDUnitTest.class, "checkFromdeltaCounter");
+    server2.invoke(() -> ClientToServerDeltaDUnitTest.checkTodeltaCounter( new Integer(0)));
+    server2.invoke(() -> ClientToServerDeltaDUnitTest.checkFromdeltaCounter());
     
   }
   
@@ -773,29 +733,24 @@ public class ClientToServerDeltaDUnitTest extends DistributedTestCase {
    * 
    */
   public void testClientsConnectedToEmptyServer() {
-    Integer PORT1 = ((Integer)server.invoke(ClientToServerDeltaDUnitTest.class,
-        "createServerCache", new Object[] { Boolean.FALSE,
-            Boolean.TRUE })).intValue();
+    Integer PORT1 = ((Integer)server.invoke(() -> ClientToServerDeltaDUnitTest.createServerCache( Boolean.FALSE,
+            Boolean.TRUE ))).intValue();
 
-    server2.invoke(ClientToServerDeltaDUnitTest.class, "createServerCache",
-        new Object[] { Boolean.FALSE, Boolean.FALSE });
+    server2.invoke(() -> ClientToServerDeltaDUnitTest.createServerCache( Boolean.FALSE, Boolean.FALSE ));
 
-    client.invoke(ClientToServerDeltaDUnitTest.class, "createClientCache",
-        new Object[] { NetworkUtils.getServerHostName(server.getHost()), new Integer(PORT1),
-            Boolean.TRUE, Boolean.TRUE, Boolean.FALSE });
+    client.invoke(() -> ClientToServerDeltaDUnitTest.createClientCache( NetworkUtils.getServerHostName(server.getHost()), new Integer(PORT1),
+            Boolean.TRUE, Boolean.TRUE, Boolean.FALSE ));
 
-    client2.invoke(ClientToServerDeltaDUnitTest.class, "createClientCache",
-        new Object[] { NetworkUtils.getServerHostName(server.getHost()), new Integer(PORT1),
-            Boolean.TRUE, Boolean.FALSE, Boolean.FALSE });
+    client2.invoke(() -> ClientToServerDeltaDUnitTest.createClientCache( NetworkUtils.getServerHostName(server.getHost()), new Integer(PORT1),
+            Boolean.TRUE, Boolean.FALSE, Boolean.FALSE ));
     
-    int deltaSent =  (Integer)server2.invoke(
-        ClientToServerDeltaDUnitTest.class,"putsWhichReturnsDeltaSent");
+    int deltaSent =  (Integer)server2.invoke(() -> ClientToServerDeltaDUnitTest.putsWhichReturnsDeltaSent());
     
-    client.invoke(ClientToServerDeltaDUnitTest.class, "waitForLastKey");    
-    client.invoke(ClientToServerDeltaDUnitTest.class, "checkForDelta");
+    client.invoke(() -> ClientToServerDeltaDUnitTest.waitForLastKey());    
+    client.invoke(() -> ClientToServerDeltaDUnitTest.checkForDelta());
     
-    client2.invoke(ClientToServerDeltaDUnitTest.class, "waitForLastKey");    
-    client2.invoke(ClientToServerDeltaDUnitTest.class, "checkDeltaInvoked", new Object[]{new Integer(deltaSent)});
+    client2.invoke(() -> ClientToServerDeltaDUnitTest.waitForLastKey());    
+    client2.invoke(() -> ClientToServerDeltaDUnitTest.checkDeltaInvoked(new Integer(deltaSent)));
     
   }
   
@@ -804,28 +759,22 @@ public class ClientToServerDeltaDUnitTest extends DistributedTestCase {
    * 1)Verifies that To delta called on client should be equal to fromDeltaCounter on datastore <br>
    */
   public void testClientNonEmptyEmptyServerAsFeederToPeer() {
-    Integer PORT1 = ((Integer)server.invoke(ClientToServerDeltaDUnitTest.class,
-        "createServerCache", new Object[] { Boolean.FALSE,
-            Boolean.TRUE })).intValue();
+    Integer PORT1 = ((Integer)server.invoke(() -> ClientToServerDeltaDUnitTest.createServerCache( Boolean.FALSE,
+            Boolean.TRUE ))).intValue();
 
-    server2.invoke(ClientToServerDeltaDUnitTest.class, "createServerCache",
-        new Object[] { Boolean.FALSE, Boolean.FALSE });
+    server2.invoke(() -> ClientToServerDeltaDUnitTest.createServerCache( Boolean.FALSE, Boolean.FALSE ));
 
-    client.invoke(ClientToServerDeltaDUnitTest.class, "createClientCache",
-        new Object[] { NetworkUtils.getServerHostName(server.getHost()), new Integer(PORT1),
-            Boolean.FALSE, Boolean.FALSE, Boolean.FALSE});
+    client.invoke(() -> ClientToServerDeltaDUnitTest.createClientCache( NetworkUtils.getServerHostName(server.getHost()), new Integer(PORT1),
+            Boolean.FALSE, Boolean.FALSE, Boolean.FALSE));
 
-    client.invoke(ClientToServerDeltaDUnitTest.class, "putDelta",
-        new Object[] { KEY1 });
+    client.invoke(() -> ClientToServerDeltaDUnitTest.putDelta( KEY1 ));
 
-    client.invoke(ClientToServerDeltaDUnitTest.class, "checkTodeltaCounter",
-        new Object[] { new Integer(2)});
+    client.invoke(() -> ClientToServerDeltaDUnitTest.checkTodeltaCounter( new Integer(2)));
     
-    server.invoke(ClientToServerDeltaDUnitTest.class, "checkDeltaFeatureNotUsed");
+    server.invoke(() -> ClientToServerDeltaDUnitTest.checkDeltaFeatureNotUsed());
     
-    server2.invoke(ClientToServerDeltaDUnitTest.class, "checkTodeltaCounter",
-        new Object[] { new Integer(0)});
-    server2.invoke(ClientToServerDeltaDUnitTest.class, "checkFromdeltaCounter");
+    server2.invoke(() -> ClientToServerDeltaDUnitTest.checkTodeltaCounter( new Integer(0)));
+    server2.invoke(() -> ClientToServerDeltaDUnitTest.checkFromdeltaCounter());
     
   }
 
@@ -849,10 +798,10 @@ public class ClientToServerDeltaDUnitTest extends DistributedTestCase {
         new Object[] { KEY1, new Integer(1), new Integer[] { 1 },
             new Boolean[] { false, true, false, false } });
     
-    client.invoke(ClientToServerDeltaDUnitTest.class, "putLastKeyWithDelta");
+    client.invoke(() -> ClientToServerDeltaDUnitTest.putLastKeyWithDelta());
     
-    client2.invoke(ClientToServerDeltaDUnitTest.class, "waitForLastKey");
-    client2.invoke(ClientToServerDeltaDUnitTest.class, "verifyDeltaReceived");    
+    client2.invoke(() -> ClientToServerDeltaDUnitTest.waitForLastKey());
+    client2.invoke(() -> ClientToServerDeltaDUnitTest.verifyDeltaReceived());    
   }
 
   /**
@@ -873,49 +822,44 @@ public class ClientToServerDeltaDUnitTest extends DistributedTestCase {
         new Object[] { KEY1, new Integer(1), new Integer[] { 1 },
             new Boolean[] { false, true, false, false } });
     
-    client.invoke(ClientToServerDeltaDUnitTest.class, "putLastKeyWithDelta");
+    client.invoke(() -> ClientToServerDeltaDUnitTest.putLastKeyWithDelta());
     
-    client2.invoke(ClientToServerDeltaDUnitTest.class, "waitForLastKey");
-    server2.invoke(ClientToServerDeltaDUnitTest.class, "verifyDeltaSent",
-        new Object[] { Integer.valueOf(1) });
+    client2.invoke(() -> ClientToServerDeltaDUnitTest.waitForLastKey());
+    server2.invoke(() -> ClientToServerDeltaDUnitTest.verifyDeltaSent( Integer.valueOf(1) ));
   }
 
   public void testClientSendsFullValueToServerWhenDeltaOffAtServer() {
     initialise2(false/* clone */, new String[] { CQs[1] }, false/* CQ */,
         true/* RI */, false/* enable delta */);
     // set expected value on server
-    server.invoke(ClientToServerDeltaDUnitTest.class, "setFirstSecondUpdate",
-        new Object[] { putDelta[0], (Integer)putDelta[2] });
+    server.invoke(() -> ClientToServerDeltaDUnitTest.setFirstSecondUpdate( putDelta[0], (Integer)putDelta[2] ));
 
-    client.invoke(ClientToServerDeltaDUnitTest.class, "putDelta",
-        new Object[] { DELTA_KEY });
+    client.invoke(() -> ClientToServerDeltaDUnitTest.putDelta( DELTA_KEY ));
 
     assertFalse("Delta Propagation feature used at client.", (Boolean)client
-        .invoke(DeltaTestImpl.class, "toDeltaFeatureUsed"));
+        .invoke(() -> DeltaTestImpl.toDeltaFeatureUsed()));
     assertFalse("Delta Propagation feature used at server.", (Boolean)server
-        .invoke(DeltaTestImpl.class, "fromDeltaFeatureUsed"));
+        .invoke(() -> DeltaTestImpl.fromDeltaFeatureUsed()));
     assertFalse(
         "Failures at client while calculating delta. But delta-propagation is false at server.",
-        ((Boolean)client.invoke(DeltaTestImpl.class, "isToDeltaFailure"))
+        ((Boolean)client.invoke(() -> DeltaTestImpl.isToDeltaFailure()))
             .booleanValue());
     assertFalse(
         "Failures at server while applying delta. But delta-propagation is false at server.",
-        (Boolean)server.invoke(DeltaTestImpl.class, "isFromDeltaFailure"));
+        (Boolean)server.invoke(() -> DeltaTestImpl.isFromDeltaFailure()));
   }
 
   public void testC2SDeltaPropagationWithOldValueInvalidatedAtServer()
       throws Exception {
     String key = "DELTA_KEY";
-    Integer port1 = (Integer)server.invoke(ClientToServerDeltaDUnitTest.class,
-        "createServerCache", new Object[] {false, false, false, true});
+    Integer port1 = (Integer)server.invoke(() -> ClientToServerDeltaDUnitTest.createServerCache(false, false, false, true));
     createClientCache("localhost", port1, false, false, false, null, false,
         false);
 
     LocalRegion region = (LocalRegion)cache.getRegion(REGION_NAME);
     region.put(key, new DeltaTestImpl());
 
-    server.invoke(ClientToServerDeltaDUnitTest.class, "doInvalidate",
-        new Object[] {key});
+    server.invoke(() -> ClientToServerDeltaDUnitTest.doInvalidate(key));
     DeltaTestImpl value = new DeltaTestImpl();
     value.setStr("UPDATED_VALUE");
     region.put(key, value);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/69024aa9/gemfire-cq/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DeltaPropagationWithCQDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-cq/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DeltaPropagationWithCQDUnitTest.java b/gemfire-cq/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DeltaPropagationWithCQDUnitTest.java
index 8095079..7316e0c 100644
--- a/gemfire-cq/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DeltaPropagationWithCQDUnitTest.java
+++ b/gemfire-cq/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DeltaPropagationWithCQDUnitTest.java
@@ -106,10 +106,10 @@ public class DeltaPropagationWithCQDUnitTest extends DistributedTestCase {
 
   @Override
   protected final void preTearDown() throws Exception {
-    server1.invoke(DeltaPropagationWithCQDUnitTest.class, "close");
-    server2.invoke(DeltaPropagationWithCQDUnitTest.class, "close");
-    client1.invoke(DeltaPropagationWithCQDUnitTest.class, "close");
-    client2.invoke(DeltaPropagationWithCQDUnitTest.class, "close");
+    server1.invoke(() -> DeltaPropagationWithCQDUnitTest.close());
+    server2.invoke(() -> DeltaPropagationWithCQDUnitTest.close());
+    client1.invoke(() -> DeltaPropagationWithCQDUnitTest.close());
+    client2.invoke(() -> DeltaPropagationWithCQDUnitTest.close());
     close();
   }
   
@@ -124,22 +124,20 @@ public class DeltaPropagationWithCQDUnitTest extends DistributedTestCase {
 
   public void testCqWithRI() throws Exception {
     // 1. setup a cache server
-    int port = (Integer)server1.invoke(DeltaPropagationWithCQDUnitTest.class,
-        "createCacheServer");
+    int port = (Integer)server1.invoke(() -> DeltaPropagationWithCQDUnitTest.createCacheServer());
     // 2. setup a client
     client1
-        .invoke(DeltaPropagationWithCQDUnitTest.class, "createClientCache",
-            new Object[] {NetworkUtils.getServerHostName(server1.getHost()), port,
-                Boolean.TRUE});
+        .invoke(() -> DeltaPropagationWithCQDUnitTest.createClientCache(NetworkUtils.getServerHostName(server1.getHost()), port,
+                Boolean.TRUE));
     // 3. setup another client with cqs and interest in all keys.
     createClientCache(NetworkUtils.getServerHostName(server1.getHost()), port, true);
     registerCQs(1, "CQWithInterestDUnitTest_cq");
     // 4. put a key on client1
-    client1.invoke(DeltaPropagationWithCQDUnitTest.class, "doPut", new Object[] {
-        "SAMPLE_KEY", "SAMPLE_VALUE"});
+    client1.invoke(() -> DeltaPropagationWithCQDUnitTest.doPut(
+        "SAMPLE_KEY", "SAMPLE_VALUE"));
     // 5. update the key with new value, on client1
-    client1.invoke(DeltaPropagationWithCQDUnitTest.class, "doPut", new Object[] {
-        "SAMPLE_KEY", "NEW_VALUE"});
+    client1.invoke(() -> DeltaPropagationWithCQDUnitTest.doPut(
+        "SAMPLE_KEY", "NEW_VALUE"));
     // 6. Wait for some time
     WaitCriterion wc = new WaitCriterion() {
       public boolean done() {
@@ -162,13 +160,11 @@ public class DeltaPropagationWithCQDUnitTest extends DistributedTestCase {
     int numOfKeys = 10;
     int numOfCQs = 3;
     // 1. setup a cache server
-    int port = (Integer)server1.invoke(DeltaPropagationWithCQDUnitTest.class,
-        "createCacheServer");
+    int port = (Integer)server1.invoke(() -> DeltaPropagationWithCQDUnitTest.createCacheServer());
     // 2. setup a client with register interest
     client1
-        .invoke(DeltaPropagationWithCQDUnitTest.class, "createClientCache",
-            new Object[] {NetworkUtils.getServerHostName(server1.getHost()), port,
-                Boolean.TRUE});
+        .invoke(() -> DeltaPropagationWithCQDUnitTest.createClientCache(NetworkUtils.getServerHostName(server1.getHost()), port,
+                Boolean.TRUE));
     // 3. setup another client with cqs but without interest.
     createClientCache(NetworkUtils.getServerHostName(server1.getHost()), port, false/*RI*/);
     for (int i = 0; i < numOfCQs; i++) {
@@ -179,17 +175,14 @@ public class DeltaPropagationWithCQDUnitTest extends DistributedTestCase {
     // verify client2's CQ listeners see above puts
     verifyCqListeners(numOfListeners * numOfKeys * numOfCQs);
     // verify full value requests at server are zero
-    server1.invoke(DeltaPropagationWithCQDUnitTest.class,
-        "verifyFullValueRequestsFromClients", new Object[] {0L});
+    server1.invoke(() -> DeltaPropagationWithCQDUnitTest.verifyFullValueRequestsFromClients(0L));
 
     // 4. do delta updates on client1
-    client1.invoke(DeltaPropagationWithCQDUnitTest.class, "doPuts",
-        new Object[] {numOfKeys, true});
+    client1.invoke(() -> DeltaPropagationWithCQDUnitTest.doPuts(numOfKeys, true));
     // verify client2's CQ listeners see above puts
     verifyCqListeners(numOfListeners * numOfKeys * numOfCQs * 2);
     // verify full value requests at server 
-    server1.invoke(DeltaPropagationWithCQDUnitTest.class,
-        "verifyFullValueRequestsFromClients", new Object[] {10L});
+    server1.invoke(() -> DeltaPropagationWithCQDUnitTest.verifyFullValueRequestsFromClients(10L));
   }
 
   public static void verifyCqListeners(final Integer events) throws Exception {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/69024aa9/gemfire-cq/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DeltaToRegionRelationCQRegistrationDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-cq/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DeltaToRegionRelationCQRegistrationDUnitTest.java b/gemfire-cq/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DeltaToRegionRelationCQRegistrationDUnitTest.java
index 886e671..8f0db70 100755
--- a/gemfire-cq/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DeltaToRegionRelationCQRegistrationDUnitTest.java
+++ b/gemfire-cq/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DeltaToRegionRelationCQRegistrationDUnitTest.java
@@ -138,30 +138,26 @@ public class DeltaToRegionRelationCQRegistrationDUnitTest extends DistributedTes
     
     // Register CQ on region with data policy as EMPTY
     // CQ registration
-    client.invoke(DeltaToRegionRelationCQRegistrationDUnitTest.class, "registerCq",
-        new Object[] {cqName1, CQ1, new Boolean(false)});
+    client.invoke(() -> DeltaToRegionRelationCQRegistrationDUnitTest.registerCq(cqName1, CQ1, new Boolean(false)));
     
     // Register CQ on region with data policy other then EMPTY
     // CQ registration
-    client.invoke(DeltaToRegionRelationCQRegistrationDUnitTest.class, "registerCq",
-        new Object[] {cqName2, CQ2, new Boolean(false)});
+    client.invoke(() -> DeltaToRegionRelationCQRegistrationDUnitTest.registerCq(cqName2, CQ2, new Boolean(false)));
     
     // validation on server side
-    server.invoke(DeltaToRegionRelationCQRegistrationDUnitTest.class, "validationOnServer");
+    server.invoke(() -> DeltaToRegionRelationCQRegistrationDUnitTest.validationOnServer());
    
     //  check for multiple time cq registration 
     //  Register CQ on region with data policy as EMPTY
     //  CQ registration
-    client.invoke(DeltaToRegionRelationCQRegistrationDUnitTest.class, "registerCq",
-        new Object[] {cqName3, CQ3, new Boolean(false)});
+    client.invoke(() -> DeltaToRegionRelationCQRegistrationDUnitTest.registerCq(cqName3, CQ3, new Boolean(false)));
     
     // Register CQ on region with data policy as EMPTY
     // CQ registration
-    client.invoke(DeltaToRegionRelationCQRegistrationDUnitTest.class, "registerCq",
-        new Object[] {cqName4, CQ4, new Boolean(true)});
+    client.invoke(() -> DeltaToRegionRelationCQRegistrationDUnitTest.registerCq(cqName4, CQ4, new Boolean(true)));
     
     // validation on server side
-    server.invoke(DeltaToRegionRelationCQRegistrationDUnitTest.class, "validationOnServer");
+    server.invoke(() -> DeltaToRegionRelationCQRegistrationDUnitTest.validationOnServer());
     
     tearDownforSimpleCase();
   }
@@ -178,31 +174,27 @@ public class DeltaToRegionRelationCQRegistrationDUnitTest extends DistributedTes
     
     // Register CQ on region with data policy as EMPTY
     // CQ registration
-    client.invoke(DeltaToRegionRelationCQRegistrationDUnitTest.class, "registerCq",
-        new Object[] {cqName1, CQ1, new Boolean(true)});
+    client.invoke(() -> DeltaToRegionRelationCQRegistrationDUnitTest.registerCq(cqName1, CQ1, new Boolean(true)));
     
     // Register CQ on region with data policy other then EMPTY
     // CQ registration
-    client.invoke(DeltaToRegionRelationCQRegistrationDUnitTest.class, "registerCq",
-        new Object[] {cqName2, CQ2, new Boolean(true)});
+    client.invoke(() -> DeltaToRegionRelationCQRegistrationDUnitTest.registerCq(cqName2, CQ2, new Boolean(true)));
     
     // validation on server side
-    server.invoke(DeltaToRegionRelationCQRegistrationDUnitTest.class, "validationOnServer");
+    server.invoke(() -> DeltaToRegionRelationCQRegistrationDUnitTest.validationOnServer());
    
     //  check for multiple time registration Interest
     
     //  Register CQ on region with data policy as EMPTY
     //  CQ registration
-    client.invoke(DeltaToRegionRelationCQRegistrationDUnitTest.class, "registerCq",
-        new Object[] {cqName3, CQ3, new Boolean(true) });
+    client.invoke(() -> DeltaToRegionRelationCQRegistrationDUnitTest.registerCq(cqName3, CQ3, new Boolean(true) ));
     
     // Register CQ on region with data policy as EMPTY
     // CQ registration
-    client.invoke(DeltaToRegionRelationCQRegistrationDUnitTest.class, "registerCq",
-        new Object[] {cqName4, CQ4, new Boolean(false)});
+    client.invoke(() -> DeltaToRegionRelationCQRegistrationDUnitTest.registerCq(cqName4, CQ4, new Boolean(false)));
     
     // validation on server side
-    server.invoke(DeltaToRegionRelationCQRegistrationDUnitTest.class, "validationOnServer");
+    server.invoke(() -> DeltaToRegionRelationCQRegistrationDUnitTest.validationOnServer());
     
     tearDownforSimpleCase();
   }
@@ -218,31 +210,27 @@ public class DeltaToRegionRelationCQRegistrationDUnitTest extends DistributedTes
     
     // Register CQ on region
     // CQ registration
-    client.invoke(DeltaToRegionRelationCQRegistrationDUnitTest.class, "registerCqThroughPool",
-        new Object[] {cqName1, CQ1, new Boolean(true)});
+    client.invoke(() -> DeltaToRegionRelationCQRegistrationDUnitTest.registerCqThroughPool(cqName1, CQ1, new Boolean(true)));
     
     // Register CQ on region 
     // CQ registration
-    client.invoke(DeltaToRegionRelationCQRegistrationDUnitTest.class, "registerCqThroughPool",
-        new Object[] {cqName2, CQ2, new Boolean(true)});
+    client.invoke(() -> DeltaToRegionRelationCQRegistrationDUnitTest.registerCqThroughPool(cqName2, CQ2, new Boolean(true)));
     
     // validation on server side
-    server.invoke(DeltaToRegionRelationCQRegistrationDUnitTest.class, "validationOnServerForCqRegistrationFromPool");
+    server.invoke(() -> DeltaToRegionRelationCQRegistrationDUnitTest.validationOnServerForCqRegistrationFromPool());
    
     //  check for multiple time registration cq
     
     //  Register CQ on region 
     //  CQ registration
-    client.invoke(DeltaToRegionRelationCQRegistrationDUnitTest.class, "registerCqThroughPool",
-        new Object[] {cqName3, CQ3, new Boolean(true) });
+    client.invoke(() -> DeltaToRegionRelationCQRegistrationDUnitTest.registerCqThroughPool(cqName3, CQ3, new Boolean(true) ));
     
     // Register CQ on region
     // CQ registration
-    client.invoke(DeltaToRegionRelationCQRegistrationDUnitTest.class, "registerCqThroughPool",
-        new Object[] {cqName4, CQ4, new Boolean(false)});
+    client.invoke(() -> DeltaToRegionRelationCQRegistrationDUnitTest.registerCqThroughPool(cqName4, CQ4, new Boolean(false)));
     
     // validation on server side
-    server.invoke(DeltaToRegionRelationCQRegistrationDUnitTest.class, "validationOnServerForCqRegistrationFromPool");
+    server.invoke(() -> DeltaToRegionRelationCQRegistrationDUnitTest.validationOnServerForCqRegistrationFromPool());
     
     tearDownforSimpleCase();
   }
@@ -258,11 +246,9 @@ public class DeltaToRegionRelationCQRegistrationDUnitTest extends DistributedTes
     
     intialSetUpForFailOver();
     // Register CQ on region with data policy as EMPTY
-    client2.invoke(DeltaToRegionRelationCQRegistrationDUnitTest.class, "registerCq",
-        new Object[] {cqName1, CQ1, new Boolean(false)});
+    client2.invoke(() -> DeltaToRegionRelationCQRegistrationDUnitTest.registerCq(cqName1, CQ1, new Boolean(false)));
     // Register CQ on region with data policy other then EMPTY
-    client2.invoke(DeltaToRegionRelationCQRegistrationDUnitTest.class, "registerCq",
-        new Object[] {cqName2, CQ2, new Boolean(false)});
+    client2.invoke(() -> DeltaToRegionRelationCQRegistrationDUnitTest.registerCq(cqName2, CQ2, new Boolean(false)));
         
     validationForFailOver();
     tearDownForFailOver();
@@ -277,12 +263,10 @@ public class DeltaToRegionRelationCQRegistrationDUnitTest extends DistributedTes
   public void testDeltaToRegionForRegisterCQIRFaliover() {
     intialSetUpForFailOver();
     // Register CQ on region with data policy as EMPTY
-    client2.invoke(DeltaToRegionRelationCQRegistrationDUnitTest.class, "registerCq",
-        new Object[] {cqName1, CQ1, new Boolean(true)});
+    client2.invoke(() -> DeltaToRegionRelationCQRegistrationDUnitTest.registerCq(cqName1, CQ1, new Boolean(true)));
 
     // Register CQ on region with data policy other then EMPTY
-    client2.invoke(DeltaToRegionRelationCQRegistrationDUnitTest.class, "registerCq",
-        new Object[] {cqName2, CQ2, new Boolean(true)});
+    client2.invoke(() -> DeltaToRegionRelationCQRegistrationDUnitTest.registerCq(cqName2, CQ2, new Boolean(true)));
 
     validationForFailOver();
     tearDownForFailOver();
@@ -296,12 +280,10 @@ public class DeltaToRegionRelationCQRegistrationDUnitTest extends DistributedTes
   public void testDeltaToRegionForRegisterCQIRFromPoolFaliover() {
     intialSetUpNoRegiononClientForFailOver();
     // Register CQ on region
-    client2.invoke(DeltaToRegionRelationCQRegistrationDUnitTest.class, "registerCqThroughPool",
-        new Object[] {cqName1, CQ1, new Boolean(true)});
+    client2.invoke(() -> DeltaToRegionRelationCQRegistrationDUnitTest.registerCqThroughPool(cqName1, CQ1, new Boolean(true)));
     
     //  Register CQ on region 
-    client2.invoke(DeltaToRegionRelationCQRegistrationDUnitTest.class, "registerCqThroughPool",
-        new Object[] {cqName2, CQ2, new Boolean(true)});
+    client2.invoke(() -> DeltaToRegionRelationCQRegistrationDUnitTest.registerCqThroughPool(cqName2, CQ2, new Boolean(true)));
     
     validationForCQFiredFromPoolFailOver();
     tearDownForFailOver();
@@ -661,64 +643,52 @@ public class DeltaToRegionRelationCQRegistrationDUnitTest extends DistributedTes
    * initial setup required for testcase with out failover
    */
   public void intialSetUp() {
-    PORT1 = ((Integer)server.invoke(DeltaToRegionRelationCQRegistrationDUnitTest.class,
-        "createServerCache")).intValue();
+    PORT1 = ((Integer)server.invoke(() -> DeltaToRegionRelationCQRegistrationDUnitTest.createServerCache())).intValue();
     client
-        .invoke(DeltaToRegionRelationCQRegistrationDUnitTest.class, "createClientCache",
-            new Object[] { NetworkUtils.getServerHostName(server.getHost()),
-                new Integer(PORT1) });
+        .invoke(() -> DeltaToRegionRelationCQRegistrationDUnitTest.createClientCache( NetworkUtils.getServerHostName(server.getHost()),
+                new Integer(PORT1) ));
   }
   
   /*
    * initial setup required for testcase with out failover
    */
   public void intialSetUpClientWithNoRegion() {
-    PORT1 = ((Integer)server.invoke(DeltaToRegionRelationCQRegistrationDUnitTest.class,
-        "createServerCache")).intValue();
+    PORT1 = ((Integer)server.invoke(() -> DeltaToRegionRelationCQRegistrationDUnitTest.createServerCache())).intValue();
     client
-        .invoke(DeltaToRegionRelationCQRegistrationDUnitTest.class, "createClientCacheWithNoRegion",
-            new Object[] { NetworkUtils.getServerHostName(server.getHost()),
-                new Integer(PORT1) });
+        .invoke(() -> DeltaToRegionRelationCQRegistrationDUnitTest.createClientCacheWithNoRegion( NetworkUtils.getServerHostName(server.getHost()),
+                new Integer(PORT1) ));
   }
   /*
    * kind of teardown for testcase without failover
    */
   public void tearDownforSimpleCase() {
     //  close the clients first
-    client.invoke(DeltaToRegionRelationCQRegistrationDUnitTest.class, "closeCache");
+    client.invoke(() -> DeltaToRegionRelationCQRegistrationDUnitTest.closeCache());
     // then close the servers
-    server.invoke(DeltaToRegionRelationCQRegistrationDUnitTest.class, "closeCache");
+    server.invoke(() -> DeltaToRegionRelationCQRegistrationDUnitTest.closeCache());
   }  
   /*
    * initial setup required for testcase with failover
    */
   public void intialSetUpForFailOver() {
-    PORT1 = ((Integer)server.invoke(DeltaToRegionRelationCQRegistrationDUnitTest.class,
-        "createServerCache")).intValue();
+    PORT1 = ((Integer)server.invoke(() -> DeltaToRegionRelationCQRegistrationDUnitTest.createServerCache())).intValue();
     // used only in failover tests
-    PORT2 = ((Integer)server2.invoke(DeltaToRegionRelationCQRegistrationDUnitTest.class,
-        "createServerCache")).intValue();
-    primary = (Integer)client2.invoke(
-        DeltaToRegionRelationCQRegistrationDUnitTest.class, "createClientCache2",
-        new Object[] { NetworkUtils.getServerHostName(server.getHost()),
+    PORT2 = ((Integer)server2.invoke(() -> DeltaToRegionRelationCQRegistrationDUnitTest.createServerCache())).intValue();
+    primary = (Integer)client2.invoke(() -> DeltaToRegionRelationCQRegistrationDUnitTest.createClientCache2( NetworkUtils.getServerHostName(server.getHost()),
             NetworkUtils.getServerHostName(server2.getHost()), new Integer(PORT1),
-            new Integer(PORT2) });
+            new Integer(PORT2) ));
   }
   
   /*
    * initial setup required for testcase with failover where we don't need region on client
    */
   public void intialSetUpNoRegiononClientForFailOver() {
-    PORT1 = ((Integer)server.invoke(DeltaToRegionRelationCQRegistrationDUnitTest.class,
-        "createServerCache")).intValue();
+    PORT1 = ((Integer)server.invoke(() -> DeltaToRegionRelationCQRegistrationDUnitTest.createServerCache())).intValue();
     // used only in failover tests
-    PORT2 = ((Integer)server2.invoke(DeltaToRegionRelationCQRegistrationDUnitTest.class,
-        "createServerCache")).intValue();
-    primary = (Integer)client2.invoke(
-        DeltaToRegionRelationCQRegistrationDUnitTest.class, "createClientCache3",
-        new Object[] { NetworkUtils.getServerHostName(server.getHost()),
+    PORT2 = ((Integer)server2.invoke(() -> DeltaToRegionRelationCQRegistrationDUnitTest.createServerCache())).intValue();
+    primary = (Integer)client2.invoke(() -> DeltaToRegionRelationCQRegistrationDUnitTest.createClientCache3( NetworkUtils.getServerHostName(server.getHost()),
             NetworkUtils.getServerHostName(server2.getHost()), new Integer(PORT1),
-            new Integer(PORT2) });
+            new Integer(PORT2) ));
   }
   
   /*
@@ -728,16 +698,16 @@ public class DeltaToRegionRelationCQRegistrationDUnitTest extends DistributedTes
   public void validationForFailOver(){
     assertTrue(" primary server is not detected ",primary.intValue() != -1);
     if (primary.intValue() == PORT1) {
-      server.invoke(DeltaToRegionRelationCQRegistrationDUnitTest.class, "validationOnServer");
-      server.invoke(DeltaToRegionRelationCQRegistrationDUnitTest.class, "stopCacheServer");
+      server.invoke(() -> DeltaToRegionRelationCQRegistrationDUnitTest.validationOnServer());
+      server.invoke(() -> DeltaToRegionRelationCQRegistrationDUnitTest.stopCacheServer());
       server2
-          .invoke(DeltaToRegionRelationCQRegistrationDUnitTest.class, "validationOnServer");
+          .invoke(() -> DeltaToRegionRelationCQRegistrationDUnitTest.validationOnServer());
     }
     else {
       server2
-          .invoke(DeltaToRegionRelationCQRegistrationDUnitTest.class, "validationOnServer");
-      server2.invoke(DeltaToRegionRelationCQRegistrationDUnitTest.class, "stopCacheServer");
-      server.invoke(DeltaToRegionRelationCQRegistrationDUnitTest.class, "validationOnServer");
+          .invoke(() -> DeltaToRegionRelationCQRegistrationDUnitTest.validationOnServer());
+      server2.invoke(() -> DeltaToRegionRelationCQRegistrationDUnitTest.stopCacheServer());
+      server.invoke(() -> DeltaToRegionRelationCQRegistrationDUnitTest.validationOnServer());
     }
   }
   
@@ -748,16 +718,16 @@ public class DeltaToRegionRelationCQRegistrationDUnitTest extends DistributedTes
   public void validationForCQFiredFromPoolFailOver(){
     assertTrue(" primary server is not detected ",primary.intValue() != -1);
     if (primary.intValue() == PORT1) {
-      server.invoke(DeltaToRegionRelationCQRegistrationDUnitTest.class, "validationOnServerForCqRegistrationFromPool");
-      server.invoke(DeltaToRegionRelationCQRegistrationDUnitTest.class, "stopCacheServer");
+      server.invoke(() -> DeltaToRegionRelationCQRegistrationDUnitTest.validationOnServerForCqRegistrationFromPool());
+      server.invoke(() -> DeltaToRegionRelationCQRegistrationDUnitTest.stopCacheServer());
       server2
-          .invoke(DeltaToRegionRelationCQRegistrationDUnitTest.class, "validationOnServerForCqRegistrationFromPool");
+          .invoke(() -> DeltaToRegionRelationCQRegistrationDUnitTest.validationOnServerForCqRegistrationFromPool());
     }
     else {
       server2
-          .invoke(DeltaToRegionRelationCQRegistrationDUnitTest.class, "validationOnServerForCqRegistrationFromPool");
-      server2.invoke(DeltaToRegionRelationCQRegistrationDUnitTest.class, "stopCacheServer");
-      server.invoke(DeltaToRegionRelationCQRegistrationDUnitTest.class, "validationOnServerForCqRegistrationFromPool");
+          .invoke(() -> DeltaToRegionRelationCQRegistrationDUnitTest.validationOnServerForCqRegistrationFromPool());
+      server2.invoke(() -> DeltaToRegionRelationCQRegistrationDUnitTest.stopCacheServer());
+      server.invoke(() -> DeltaToRegionRelationCQRegistrationDUnitTest.validationOnServerForCqRegistrationFromPool());
     }
   }
   /*
@@ -765,10 +735,10 @@ public class DeltaToRegionRelationCQRegistrationDUnitTest extends DistributedTes
    */
   public void tearDownForFailOver() {
     // close the clients first
-    client2.invoke(DeltaToRegionRelationCQRegistrationDUnitTest.class, "closeCache");
+    client2.invoke(() -> DeltaToRegionRelationCQRegistrationDUnitTest.closeCache());
     // then close the servers
-    server.invoke(DeltaToRegionRelationCQRegistrationDUnitTest.class, "closeCache");
-    server2.invoke(DeltaToRegionRelationCQRegistrationDUnitTest.class, "closeCache");
+    server.invoke(() -> DeltaToRegionRelationCQRegistrationDUnitTest.closeCache());
+    server2.invoke(() -> DeltaToRegionRelationCQRegistrationDUnitTest.closeCache());
   }
   /*
    * create cache with properties

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/69024aa9/gemfire-cq/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientCrashDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-cq/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientCrashDUnitTest.java b/gemfire-cq/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientCrashDUnitTest.java
index 753fe67..dce35bf 100755
--- a/gemfire-cq/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientCrashDUnitTest.java
+++ b/gemfire-cq/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientCrashDUnitTest.java
@@ -40,7 +40,7 @@ public class DurableClientCrashDUnitTest extends DurableClientTestCase {
   
   public void configureClientStop1()
   {
-    this.durableClientVM.invoke(CacheServerTestUtil.class, "setClientCrash", new Object[] {new Boolean(true)});    
+    this.durableClientVM.invoke(() -> CacheServerTestUtil.setClientCrash(new Boolean(true)));    
   }
   
   @Override
@@ -50,7 +50,7 @@ public class DurableClientCrashDUnitTest extends DurableClientTestCase {
   
   public void configureClientStop2()
   {
-    this.durableClientVM.invoke(CacheServerTestUtil.class, "setClientCrash", new Object[] {new Boolean(false)});    
+    this.durableClientVM.invoke(() -> CacheServerTestUtil.setClientCrash(new Boolean(false)));    
   }
   
   public void verifySimpleDurableClient() {



Mime
View raw message