geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From upthewatersp...@apache.org
Subject [29/56] [abbrv] incubator-geode git commit: Automatically converting calls of vm.invoke to lambdas
Date Tue, 16 Feb 2016 22:11:49 GMT
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/69024aa9/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/asyncqueue/AsyncEventQueueStatsDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/asyncqueue/AsyncEventQueueStatsDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/asyncqueue/AsyncEventQueueStatsDUnitTest.java
index 55f9112..71a3227 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/asyncqueue/AsyncEventQueueStatsDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/asyncqueue/AsyncEventQueueStatsDUnitTest.java
@@ -39,47 +39,39 @@ public class AsyncEventQueueStatsDUnitTest extends AsyncEventQueueTestBase {
    * Normal replication scenario
    */
   public void testReplicatedSerialPropagation() {
-    Integer lnPort = (Integer)vm0.invoke(AsyncEventQueueTestBase.class,
-        "createFirstLocatorWithDSId", new Object[] { 1 });
+    Integer lnPort = (Integer)vm0.invoke(() -> AsyncEventQueueTestBase.createFirstLocatorWithDSId( 1 ));
 
-    vm4.invoke(AsyncEventQueueTestBase.class, "createCache", new Object[] { lnPort });
-    vm5.invoke(AsyncEventQueueTestBase.class, "createCache", new Object[] { lnPort });
-    vm6.invoke(AsyncEventQueueTestBase.class, "createCache", new Object[] { lnPort });
-    vm7.invoke(AsyncEventQueueTestBase.class, "createCache", new Object[] { lnPort });
+    vm4.invoke(() -> AsyncEventQueueTestBase.createCache( lnPort ));
+    vm5.invoke(() -> AsyncEventQueueTestBase.createCache( lnPort ));
+    vm6.invoke(() -> AsyncEventQueueTestBase.createCache( lnPort ));
+    vm7.invoke(() -> AsyncEventQueueTestBase.createCache( lnPort ));
 
-    vm4.invoke(AsyncEventQueueTestBase.class, "createAsyncEventQueue", new Object[] { "ln",
-        false, 100, 100, false, false, null, false });
-    vm5.invoke(AsyncEventQueueTestBase.class, "createAsyncEventQueue", new Object[] { "ln",
-        false, 100, 100, false, false, null, false });
-    vm6.invoke(AsyncEventQueueTestBase.class, "createAsyncEventQueue", new Object[] { "ln",
-        false, 100, 100, false, false, null, false });
-    vm7.invoke(AsyncEventQueueTestBase.class, "createAsyncEventQueue", new Object[] { "ln",
-        false, 100, 100, false, false, null, false });
+    vm4.invoke(() -> AsyncEventQueueTestBase.createAsyncEventQueue( "ln",
+        false, 100, 100, false, false, null, false ));
+    vm5.invoke(() -> AsyncEventQueueTestBase.createAsyncEventQueue( "ln",
+        false, 100, 100, false, false, null, false ));
+    vm6.invoke(() -> AsyncEventQueueTestBase.createAsyncEventQueue( "ln",
+        false, 100, 100, false, false, null, false ));
+    vm7.invoke(() -> AsyncEventQueueTestBase.createAsyncEventQueue( "ln",
+        false, 100, 100, false, false, null, false ));
 
-    vm4.invoke(AsyncEventQueueTestBase.class, "createReplicatedRegionWithAsyncEventQueue",
-        new Object[] { getTestMethodName() + "_RR", "ln", isOffHeap() });
-    vm5.invoke(AsyncEventQueueTestBase.class, "createReplicatedRegionWithAsyncEventQueue",
-        new Object[] { getTestMethodName() + "_RR", "ln", isOffHeap() });
-    vm6.invoke(AsyncEventQueueTestBase.class, "createReplicatedRegionWithAsyncEventQueue",
-        new Object[] { getTestMethodName() + "_RR", "ln", isOffHeap() });
-    vm7.invoke(AsyncEventQueueTestBase.class, "createReplicatedRegionWithAsyncEventQueue",
-        new Object[] { getTestMethodName() + "_RR", "ln", isOffHeap() });
+    vm4.invoke(() -> AsyncEventQueueTestBase.createReplicatedRegionWithAsyncEventQueue( getTestMethodName() + "_RR", "ln", isOffHeap() ));
+    vm5.invoke(() -> AsyncEventQueueTestBase.createReplicatedRegionWithAsyncEventQueue( getTestMethodName() + "_RR", "ln", isOffHeap() ));
+    vm6.invoke(() -> AsyncEventQueueTestBase.createReplicatedRegionWithAsyncEventQueue( getTestMethodName() + "_RR", "ln", isOffHeap() ));
+    vm7.invoke(() -> AsyncEventQueueTestBase.createReplicatedRegionWithAsyncEventQueue( getTestMethodName() + "_RR", "ln", isOffHeap() ));
 
-    vm4.invoke(AsyncEventQueueTestBase.class, "doPuts", new Object[] { getTestMethodName() + "_RR",
-        1000 });
+    vm4.invoke(() -> AsyncEventQueueTestBase.doPuts( getTestMethodName() + "_RR",
+        1000 ));
 
-    vm4.invoke(AsyncEventQueueTestBase.class, "validateAsyncEventListener",
-        new Object[] { "ln", 1000 });// primary sender
+    vm4.invoke(() -> AsyncEventQueueTestBase.validateAsyncEventListener( "ln", 1000 ));// primary sender
     Wait.pause(2000);//give some time for system to become stable
     
-    vm4.invoke(AsyncEventQueueTestBase.class, "checkAsyncEventQueueStats", new Object[] {
-        "ln", 0, 1000, 1000, 1000 });
-    vm4.invoke(AsyncEventQueueTestBase.class, "checkAsyncEventQueueBatchStats",
-        new Object[] { "ln", 10 });
-    vm5.invoke(AsyncEventQueueTestBase.class, "checkAsyncEventQueueStats", new Object[] {
-        "ln", 0, 1000, 0, 0 });
-    vm5.invoke(AsyncEventQueueTestBase.class, "checkAsyncEventQueueBatchStats",
-        new Object[] { "ln", 0 });
+    vm4.invoke(() -> AsyncEventQueueTestBase.checkAsyncEventQueueStats(
+        "ln", 0, 1000, 1000, 1000 ));
+    vm4.invoke(() -> AsyncEventQueueTestBase.checkAsyncEventQueueBatchStats( "ln", 10 ));
+    vm5.invoke(() -> AsyncEventQueueTestBase.checkAsyncEventQueueStats(
+        "ln", 0, 1000, 0, 0 ));
+    vm5.invoke(() -> AsyncEventQueueTestBase.checkAsyncEventQueueBatchStats( "ln", 0 ));
   }
   
   /**
@@ -88,95 +80,83 @@ public class AsyncEventQueueStatsDUnitTest extends AsyncEventQueueTestBase {
   public void testAsyncStatsTwoListeners() throws Exception {
     Integer lnPort = createFirstLocatorWithDSId(1);
 
-    vm4.invoke(AsyncEventQueueTestBase.class, "createCache", new Object[] {lnPort });
-    vm5.invoke(AsyncEventQueueTestBase.class, "createCache", new Object[] {lnPort });
-    vm6.invoke(AsyncEventQueueTestBase.class, "createCache", new Object[] {lnPort });
-    vm7.invoke(AsyncEventQueueTestBase.class, "createCache", new Object[] {lnPort });
+    vm4.invoke(() -> AsyncEventQueueTestBase.createCache(lnPort ));
+    vm5.invoke(() -> AsyncEventQueueTestBase.createCache(lnPort ));
+    vm6.invoke(() -> AsyncEventQueueTestBase.createCache(lnPort ));
+    vm7.invoke(() -> AsyncEventQueueTestBase.createCache(lnPort ));
 
-    vm4.invoke(AsyncEventQueueTestBase.class, "createAsyncEventQueue", new Object[] { "ln1",
-      false, 100, 100, false, false, null, false });
-    vm5.invoke(AsyncEventQueueTestBase.class, "createAsyncEventQueue", new Object[] { "ln1",
-      false, 100, 100, false, false, null, false });
-    vm6.invoke(AsyncEventQueueTestBase.class, "createAsyncEventQueue", new Object[] { "ln1",
-      false, 100, 100, false, false, null, false });
-    vm7.invoke(AsyncEventQueueTestBase.class, "createAsyncEventQueue", new Object[] { "ln1",
-      false, 100, 100, false, false, null, false });
+    vm4.invoke(() -> AsyncEventQueueTestBase.createAsyncEventQueue( "ln1",
+      false, 100, 100, false, false, null, false ));
+    vm5.invoke(() -> AsyncEventQueueTestBase.createAsyncEventQueue( "ln1",
+      false, 100, 100, false, false, null, false ));
+    vm6.invoke(() -> AsyncEventQueueTestBase.createAsyncEventQueue( "ln1",
+      false, 100, 100, false, false, null, false ));
+    vm7.invoke(() -> AsyncEventQueueTestBase.createAsyncEventQueue( "ln1",
+      false, 100, 100, false, false, null, false ));
 
-    vm4.invoke(AsyncEventQueueTestBase.class, "createAsyncEventQueue", new Object[] { "ln2",
-      false, 100, 100, false, false, null, false });
-    vm5.invoke(AsyncEventQueueTestBase.class, "createAsyncEventQueue", new Object[] { "ln2",
-      false, 100, 100, false, false, null, false });
-    vm6.invoke(AsyncEventQueueTestBase.class, "createAsyncEventQueue", new Object[] { "ln2",
-      false, 100, 100, false, false, null, false });
-    vm7.invoke(AsyncEventQueueTestBase.class, "createAsyncEventQueue", new Object[] { "ln2",
-      false, 100, 100, false, false, null, false });
+    vm4.invoke(() -> AsyncEventQueueTestBase.createAsyncEventQueue( "ln2",
+      false, 100, 100, false, false, null, false ));
+    vm5.invoke(() -> AsyncEventQueueTestBase.createAsyncEventQueue( "ln2",
+      false, 100, 100, false, false, null, false ));
+    vm6.invoke(() -> AsyncEventQueueTestBase.createAsyncEventQueue( "ln2",
+      false, 100, 100, false, false, null, false ));
+    vm7.invoke(() -> AsyncEventQueueTestBase.createAsyncEventQueue( "ln2",
+      false, 100, 100, false, false, null, false ));
 
-    vm4.invoke(AsyncEventQueueTestBase.class, "createReplicatedRegionWithAsyncEventQueue",
-        new Object[] { getTestMethodName() + "_RR", "ln1,ln2", isOffHeap() });
-    vm5.invoke(AsyncEventQueueTestBase.class, "createReplicatedRegionWithAsyncEventQueue",
-        new Object[] { getTestMethodName() + "_RR", "ln1,ln2", isOffHeap() });
-    vm6.invoke(AsyncEventQueueTestBase.class, "createReplicatedRegionWithAsyncEventQueue",
-        new Object[] { getTestMethodName() + "_RR", "ln1,ln2", isOffHeap() });
-    vm7.invoke(AsyncEventQueueTestBase.class, "createReplicatedRegionWithAsyncEventQueue",
-        new Object[] { getTestMethodName() + "_RR", "ln1,ln2", isOffHeap() });
+    vm4.invoke(() -> AsyncEventQueueTestBase.createReplicatedRegionWithAsyncEventQueue( getTestMethodName() + "_RR", "ln1,ln2", isOffHeap() ));
+    vm5.invoke(() -> AsyncEventQueueTestBase.createReplicatedRegionWithAsyncEventQueue( getTestMethodName() + "_RR", "ln1,ln2", isOffHeap() ));
+    vm6.invoke(() -> AsyncEventQueueTestBase.createReplicatedRegionWithAsyncEventQueue( getTestMethodName() + "_RR", "ln1,ln2", isOffHeap() ));
+    vm7.invoke(() -> AsyncEventQueueTestBase.createReplicatedRegionWithAsyncEventQueue( getTestMethodName() + "_RR", "ln1,ln2", isOffHeap() ));
 
-    vm4.invoke(AsyncEventQueueTestBase.class, "doPuts", new Object[] { getTestMethodName() + "_RR",
-        1000 });
+    vm4.invoke(() -> AsyncEventQueueTestBase.doPuts( getTestMethodName() + "_RR",
+        1000 ));
     
-    vm4.invoke(AsyncEventQueueTestBase.class, "validateAsyncEventListener",
-        new Object[] { "ln1", 1000 });
-    vm4.invoke(AsyncEventQueueTestBase.class, "validateAsyncEventListener",
-        new Object[] { "ln2", 1000 });
+    vm4.invoke(() -> AsyncEventQueueTestBase.validateAsyncEventListener( "ln1", 1000 ));
+    vm4.invoke(() -> AsyncEventQueueTestBase.validateAsyncEventListener( "ln2", 1000 ));
     Wait.pause(2000);//give some time for system to become stable
 
-    vm4.invoke(AsyncEventQueueTestBase.class, "checkAsyncEventQueueStats", new Object[] {
-        "ln1", 0, 1000, 1000, 1000 });
-    vm4.invoke(AsyncEventQueueTestBase.class, "checkAsyncEventQueueBatchStats",
-        new Object[] { "ln1", 10 });
-    vm4.invoke(AsyncEventQueueTestBase.class, "checkAsyncEventQueueStats", new Object[] {
-        "ln2", 0, 1000, 1000, 1000 });
-    vm4.invoke(AsyncEventQueueTestBase.class, "checkAsyncEventQueueBatchStats",
-        new Object[] { "ln2", 10 });
-    vm5.invoke(AsyncEventQueueTestBase.class, "checkAsyncEventQueueStats", new Object[] {
-        "ln1", 0, 1000, 0, 0 });
-    vm5.invoke(AsyncEventQueueTestBase.class, "checkAsyncEventQueueBatchStats",
-        new Object[] { "ln1", 0 });
-    vm5.invoke(AsyncEventQueueTestBase.class, "checkAsyncEventQueueStats", new Object[] {
-        "ln2", 0, 1000, 0, 0 });
-    vm5.invoke(AsyncEventQueueTestBase.class, "checkAsyncEventQueueBatchStats",
-        new Object[] { "ln2", 0 });
+    vm4.invoke(() -> AsyncEventQueueTestBase.checkAsyncEventQueueStats(
+        "ln1", 0, 1000, 1000, 1000 ));
+    vm4.invoke(() -> AsyncEventQueueTestBase.checkAsyncEventQueueBatchStats( "ln1", 10 ));
+    vm4.invoke(() -> AsyncEventQueueTestBase.checkAsyncEventQueueStats(
+        "ln2", 0, 1000, 1000, 1000 ));
+    vm4.invoke(() -> AsyncEventQueueTestBase.checkAsyncEventQueueBatchStats( "ln2", 10 ));
+    vm5.invoke(() -> AsyncEventQueueTestBase.checkAsyncEventQueueStats(
+        "ln1", 0, 1000, 0, 0 ));
+    vm5.invoke(() -> AsyncEventQueueTestBase.checkAsyncEventQueueBatchStats( "ln1", 0 ));
+    vm5.invoke(() -> AsyncEventQueueTestBase.checkAsyncEventQueueStats(
+        "ln2", 0, 1000, 0, 0 ));
+    vm5.invoke(() -> AsyncEventQueueTestBase.checkAsyncEventQueueBatchStats( "ln2", 0 ));
   }
   
   /**
    * HA scenario: kill one vm when puts are in progress on the other vm.
    */
   public void testReplicatedSerialPropagationHA() throws Exception {
-    Integer lnPort = (Integer)vm0.invoke(AsyncEventQueueTestBase.class,
-        "createFirstLocatorWithDSId", new Object[] { 1 });
+    Integer lnPort = (Integer)vm0.invoke(() -> AsyncEventQueueTestBase.createFirstLocatorWithDSId( 1 ));
 
-    vm4.invoke(AsyncEventQueueTestBase.class, "createCache", new Object[] {lnPort });
-    vm5.invoke(AsyncEventQueueTestBase.class, "createCache", new Object[] {lnPort });
-    vm6.invoke(AsyncEventQueueTestBase.class, "createCache", new Object[] {lnPort });
-    vm7.invoke(AsyncEventQueueTestBase.class, "createCache", new Object[] {lnPort });
+    vm4.invoke(() -> AsyncEventQueueTestBase.createCache(lnPort ));
+    vm5.invoke(() -> AsyncEventQueueTestBase.createCache(lnPort ));
+    vm6.invoke(() -> AsyncEventQueueTestBase.createCache(lnPort ));
+    vm7.invoke(() -> AsyncEventQueueTestBase.createCache(lnPort ));
 
-    vm4.invoke(AsyncEventQueueTestBase.class, "createAsyncEventQueue", new Object[] { "ln",
-      false, 100, 100, false, false, null, false });
-    vm5.invoke(AsyncEventQueueTestBase.class, "createAsyncEventQueue", new Object[] { "ln",
-      false, 100, 100, false, false, null, false });
+    vm4.invoke(() -> AsyncEventQueueTestBase.createAsyncEventQueue( "ln",
+      false, 100, 100, false, false, null, false ));
+    vm5.invoke(() -> AsyncEventQueueTestBase.createAsyncEventQueue( "ln",
+      false, 100, 100, false, false, null, false ));
     
-    vm4.invoke(AsyncEventQueueTestBase.class, "createReplicatedRegionWithAsyncEventQueue", new Object[] {
-        getTestMethodName() + "_RR", "ln", isOffHeap() });
-    vm5.invoke(AsyncEventQueueTestBase.class, "createReplicatedRegionWithAsyncEventQueue", new Object[] {
-        getTestMethodName() + "_RR", "ln", isOffHeap() });
-    vm6.invoke(AsyncEventQueueTestBase.class, "createReplicatedRegionWithAsyncEventQueue", new Object[] {
-        getTestMethodName() + "_RR", "ln", isOffHeap() });
-    vm7.invoke(AsyncEventQueueTestBase.class, "createReplicatedRegionWithAsyncEventQueue", new Object[] {
-        getTestMethodName() + "_RR", "ln", isOffHeap() });
+    vm4.invoke(() -> AsyncEventQueueTestBase.createReplicatedRegionWithAsyncEventQueue(
+        getTestMethodName() + "_RR", "ln", isOffHeap() ));
+    vm5.invoke(() -> AsyncEventQueueTestBase.createReplicatedRegionWithAsyncEventQueue(
+        getTestMethodName() + "_RR", "ln", isOffHeap() ));
+    vm6.invoke(() -> AsyncEventQueueTestBase.createReplicatedRegionWithAsyncEventQueue(
+        getTestMethodName() + "_RR", "ln", isOffHeap() ));
+    vm7.invoke(() -> AsyncEventQueueTestBase.createReplicatedRegionWithAsyncEventQueue(
+        getTestMethodName() + "_RR", "ln", isOffHeap() ));
     
-    AsyncInvocation inv1 = vm5.invokeAsync(AsyncEventQueueTestBase.class, "doPuts",
-        new Object[] { getTestMethodName() + "_RR", 10000 });
+    AsyncInvocation inv1 = vm5.invokeAsync(() -> AsyncEventQueueTestBase.doPuts( getTestMethodName() + "_RR", 10000 ));
     Wait.pause(2000);
-    AsyncInvocation inv2 = vm4.invokeAsync(AsyncEventQueueTestBase.class, "killAsyncEventQueue", new Object[] { "ln" });
+    AsyncInvocation inv2 = vm4.invokeAsync(() -> AsyncEventQueueTestBase.killAsyncEventQueue( "ln" ));
     Boolean isKilled = Boolean.FALSE;
     try {
       isKilled = (Boolean)inv2.getResult();
@@ -186,98 +166,90 @@ public class AsyncEventQueueStatsDUnitTest extends AsyncEventQueueTestBase {
     }
     AsyncInvocation inv3 = null; 
     if(!isKilled){
-      inv3 = vm5.invokeAsync(AsyncEventQueueTestBase.class, "killSender", new Object[] { "ln" });
+      inv3 = vm5.invokeAsync(() -> AsyncEventQueueTestBase.killSender( "ln" ));
       inv3.join();
     }
     inv1.join();
     inv2.join();
     Wait.pause(2000);//give some time for system to become stable
-    vm5.invoke(AsyncEventQueueTestBase.class, "checkAsyncEventQueueStats_Failover", new Object[] {"ln", 10000});
+    vm5.invoke(() -> AsyncEventQueueTestBase.checkAsyncEventQueueStats_Failover("ln", 10000));
   }
 
   /**
    * Two regions attached to same AsyncEventQueue
    */
   public void testReplicatedSerialPropagationUNPorcessedEvents() throws Exception {
-    Integer lnPort = (Integer)vm0.invoke(AsyncEventQueueTestBase.class,
-        "createFirstLocatorWithDSId", new Object[] { 1 });
+    Integer lnPort = (Integer)vm0.invoke(() -> AsyncEventQueueTestBase.createFirstLocatorWithDSId( 1 ));
 
-    vm4.invoke(AsyncEventQueueTestBase.class, "createCache", new Object[] { lnPort });
-    vm5.invoke(AsyncEventQueueTestBase.class, "createCache", new Object[] { lnPort });
-    vm6.invoke(AsyncEventQueueTestBase.class, "createCache", new Object[] { lnPort });
-    vm7.invoke(AsyncEventQueueTestBase.class, "createCache", new Object[] { lnPort });
+    vm4.invoke(() -> AsyncEventQueueTestBase.createCache( lnPort ));
+    vm5.invoke(() -> AsyncEventQueueTestBase.createCache( lnPort ));
+    vm6.invoke(() -> AsyncEventQueueTestBase.createCache( lnPort ));
+    vm7.invoke(() -> AsyncEventQueueTestBase.createCache( lnPort ));
 
-    vm4.invoke(AsyncEventQueueTestBase.class, "createAsyncEventQueue", new Object[] { "ln",
-      false, 100, 100, false, false, null, false });
-    vm5.invoke(AsyncEventQueueTestBase.class, "createAsyncEventQueue", new Object[] { "ln",
-      false, 100, 100, false, false, null, false });
+    vm4.invoke(() -> AsyncEventQueueTestBase.createAsyncEventQueue( "ln",
+      false, 100, 100, false, false, null, false ));
+    vm5.invoke(() -> AsyncEventQueueTestBase.createAsyncEventQueue( "ln",
+      false, 100, 100, false, false, null, false ));
 
     //create one RR (RR_1) on local site
-    vm4.invoke(AsyncEventQueueTestBase.class, "createReplicatedRegionWithAsyncEventQueue", new Object[] {
-        getTestMethodName() + "_RR_1", "ln", isOffHeap() });
-    vm5.invoke(AsyncEventQueueTestBase.class, "createReplicatedRegionWithAsyncEventQueue", new Object[] {
-        getTestMethodName() + "_RR_1", "ln", isOffHeap() });
-    vm6.invoke(AsyncEventQueueTestBase.class, "createReplicatedRegionWithAsyncEventQueue", new Object[] {
-        getTestMethodName() + "_RR_1", "ln", isOffHeap() });
-    vm7.invoke(AsyncEventQueueTestBase.class, "createReplicatedRegionWithAsyncEventQueue", new Object[] {
-        getTestMethodName() + "_RR_1", "ln", isOffHeap() });
+    vm4.invoke(() -> AsyncEventQueueTestBase.createReplicatedRegionWithAsyncEventQueue(
+        getTestMethodName() + "_RR_1", "ln", isOffHeap() ));
+    vm5.invoke(() -> AsyncEventQueueTestBase.createReplicatedRegionWithAsyncEventQueue(
+        getTestMethodName() + "_RR_1", "ln", isOffHeap() ));
+    vm6.invoke(() -> AsyncEventQueueTestBase.createReplicatedRegionWithAsyncEventQueue(
+        getTestMethodName() + "_RR_1", "ln", isOffHeap() ));
+    vm7.invoke(() -> AsyncEventQueueTestBase.createReplicatedRegionWithAsyncEventQueue(
+        getTestMethodName() + "_RR_1", "ln", isOffHeap() ));
 
     //create another RR (RR_2) on local site
-    vm4.invoke(AsyncEventQueueTestBase.class, "createReplicatedRegionWithAsyncEventQueue", new Object[] {
-        getTestMethodName() + "_RR_2", "ln", isOffHeap() });
-    vm5.invoke(AsyncEventQueueTestBase.class, "createReplicatedRegionWithAsyncEventQueue", new Object[] {
-        getTestMethodName() + "_RR_2", "ln", isOffHeap() });
-    vm6.invoke(AsyncEventQueueTestBase.class, "createReplicatedRegionWithAsyncEventQueue", new Object[] {
-        getTestMethodName() + "_RR_2", "ln", isOffHeap() });
-    vm7.invoke(AsyncEventQueueTestBase.class, "createReplicatedRegionWithAsyncEventQueue", new Object[] {
-        getTestMethodName() + "_RR_2", "ln", isOffHeap() });
+    vm4.invoke(() -> AsyncEventQueueTestBase.createReplicatedRegionWithAsyncEventQueue(
+        getTestMethodName() + "_RR_2", "ln", isOffHeap() ));
+    vm5.invoke(() -> AsyncEventQueueTestBase.createReplicatedRegionWithAsyncEventQueue(
+        getTestMethodName() + "_RR_2", "ln", isOffHeap() ));
+    vm6.invoke(() -> AsyncEventQueueTestBase.createReplicatedRegionWithAsyncEventQueue(
+        getTestMethodName() + "_RR_2", "ln", isOffHeap() ));
+    vm7.invoke(() -> AsyncEventQueueTestBase.createReplicatedRegionWithAsyncEventQueue(
+        getTestMethodName() + "_RR_2", "ln", isOffHeap() ));
     
     //start puts in RR_1 in another thread
-    vm4.invoke(AsyncEventQueueTestBase.class, "doPuts", new Object[] { getTestMethodName() + "_RR_1", 1000 });
+    vm4.invoke(() -> AsyncEventQueueTestBase.doPuts( getTestMethodName() + "_RR_1", 1000 ));
     //do puts in RR_2 in main thread
-    vm4.invoke(AsyncEventQueueTestBase.class, "doPutsFrom", new Object[] { getTestMethodName() + "_RR_2", 1000, 1500 });
+    vm4.invoke(() -> AsyncEventQueueTestBase.doPutsFrom( getTestMethodName() + "_RR_2", 1000, 1500 ));
     
-    vm4.invoke(AsyncEventQueueTestBase.class, "validateAsyncEventListener",
-        new Object[] { "ln", 1500 });
+    vm4.invoke(() -> AsyncEventQueueTestBase.validateAsyncEventListener( "ln", 1500 ));
         
     Wait.pause(2000);//give some time for system to become stable
-    vm4.invoke(AsyncEventQueueTestBase.class, "checkAsyncEventQueueStats", new Object[] {"ln",
-      0, 1500, 1500, 1500});
-    vm4.invoke(AsyncEventQueueTestBase.class, "checkAsyncEventQueueUnprocessedStats", new Object[] {"ln", 0});
+    vm4.invoke(() -> AsyncEventQueueTestBase.checkAsyncEventQueueStats("ln",
+      0, 1500, 1500, 1500));
+    vm4.invoke(() -> AsyncEventQueueTestBase.checkAsyncEventQueueUnprocessedStats("ln", 0));
     
     
-    vm5.invoke(AsyncEventQueueTestBase.class, "checkAsyncEventQueueStats", new Object[] {"ln",
-      0, 1500, 0, 0});
-    vm5.invoke(AsyncEventQueueTestBase.class, "checkAsyncEventQueueUnprocessedStats", new Object[] {"ln", 1500});
+    vm5.invoke(() -> AsyncEventQueueTestBase.checkAsyncEventQueueStats("ln",
+      0, 1500, 0, 0));
+    vm5.invoke(() -> AsyncEventQueueTestBase.checkAsyncEventQueueUnprocessedStats("ln", 1500));
   }
   
   /**
    * Test with conflation enabled
    */
   public void testSerialPropagationConflation() {
-    Integer lnPort = (Integer)vm0.invoke(AsyncEventQueueTestBase.class,
-        "createFirstLocatorWithDSId", new Object[] { 1 });
+    Integer lnPort = (Integer)vm0.invoke(() -> AsyncEventQueueTestBase.createFirstLocatorWithDSId( 1 ));
 
-    vm4.invoke(AsyncEventQueueTestBase.class, "createCache", new Object[] { lnPort });
-    vm5.invoke(AsyncEventQueueTestBase.class, "createCache", new Object[] { lnPort });
-    vm6.invoke(AsyncEventQueueTestBase.class, "createCache", new Object[] { lnPort });
-    vm7.invoke(AsyncEventQueueTestBase.class, "createCache", new Object[] { lnPort });
+    vm4.invoke(() -> AsyncEventQueueTestBase.createCache( lnPort ));
+    vm5.invoke(() -> AsyncEventQueueTestBase.createCache( lnPort ));
+    vm6.invoke(() -> AsyncEventQueueTestBase.createCache( lnPort ));
+    vm7.invoke(() -> AsyncEventQueueTestBase.createCache( lnPort ));
 
-    vm4.invoke(AsyncEventQueueTestBase.class, "createAsyncEventQueue", new Object[] { "ln",
-        false, 100, 100, true, false, null, false });
+    vm4.invoke(() -> AsyncEventQueueTestBase.createAsyncEventQueue( "ln",
+        false, 100, 100, true, false, null, false ));
 
-    vm4.invoke(AsyncEventQueueTestBase.class, "createReplicatedRegionWithAsyncEventQueue",
-        new Object[] { getTestMethodName() + "_RR", "ln", isOffHeap() });
-    vm5.invoke(AsyncEventQueueTestBase.class, "createReplicatedRegionWithAsyncEventQueue",
-        new Object[] { getTestMethodName() + "_RR", "ln", isOffHeap() });
-    vm6.invoke(AsyncEventQueueTestBase.class, "createReplicatedRegionWithAsyncEventQueue",
-        new Object[] { getTestMethodName() + "_RR", "ln", isOffHeap() });
-    vm7.invoke(AsyncEventQueueTestBase.class, "createReplicatedRegionWithAsyncEventQueue",
-        new Object[] { getTestMethodName() + "_RR", "ln", isOffHeap() });
+    vm4.invoke(() -> AsyncEventQueueTestBase.createReplicatedRegionWithAsyncEventQueue( getTestMethodName() + "_RR", "ln", isOffHeap() ));
+    vm5.invoke(() -> AsyncEventQueueTestBase.createReplicatedRegionWithAsyncEventQueue( getTestMethodName() + "_RR", "ln", isOffHeap() ));
+    vm6.invoke(() -> AsyncEventQueueTestBase.createReplicatedRegionWithAsyncEventQueue( getTestMethodName() + "_RR", "ln", isOffHeap() ));
+    vm7.invoke(() -> AsyncEventQueueTestBase.createReplicatedRegionWithAsyncEventQueue( getTestMethodName() + "_RR", "ln", isOffHeap() ));
     
     vm4
-        .invoke(AsyncEventQueueTestBase.class, "pauseAsyncEventQueue",
-            new Object[] { "ln" });
+        .invoke(() -> AsyncEventQueueTestBase.pauseAsyncEventQueue( "ln" ));
     //pause at least for the batchTimeInterval to make sure that the AsyncEventQueue is actually paused
     Wait.pause(2000);
 
@@ -287,8 +259,8 @@ public class AsyncEventQueueStatsDUnitTest extends AsyncEventQueueTestBase {
       keyValues.put(i, i);
     }
     
-    vm4.invoke(AsyncEventQueueTestBase.class, "putGivenKeyValue", new Object[] { getTestMethodName() + "_RR", keyValues });
-    vm4.invoke(AsyncEventQueueTestBase.class, "checkAsyncEventQueueSize", new Object[] { "ln", keyValues.size() });
+    vm4.invoke(() -> AsyncEventQueueTestBase.putGivenKeyValue( getTestMethodName() + "_RR", keyValues ));
+    vm4.invoke(() -> AsyncEventQueueTestBase.checkAsyncEventQueueSize( "ln", keyValues.size() ));
     
     for(int i=0;i<500;i++) {
       updateKeyValues.put(i, i+"_updated");
@@ -296,25 +268,22 @@ public class AsyncEventQueueStatsDUnitTest extends AsyncEventQueueTestBase {
     
     // Put the update events and check the queue size.
     // There should be no conflation with the previous create events.
-    vm4.invoke(AsyncEventQueueTestBase.class, "putGivenKeyValue", new Object[] { getTestMethodName() + "_RR", updateKeyValues });    
-    vm4.invoke(AsyncEventQueueTestBase.class, "checkAsyncEventQueueSize", new Object[] { "ln", keyValues.size() + updateKeyValues.size() });
+    vm4.invoke(() -> AsyncEventQueueTestBase.putGivenKeyValue( getTestMethodName() + "_RR", updateKeyValues ));    
+    vm4.invoke(() -> AsyncEventQueueTestBase.checkAsyncEventQueueSize( "ln", keyValues.size() + updateKeyValues.size() ));
     
     // Put the update events again and check the queue size.
     // There should be conflation with the previous update events.
-    vm4.invoke(AsyncEventQueueTestBase.class, "putGivenKeyValue", new Object[] { getTestMethodName() + "_RR", updateKeyValues });    
-    vm4.invoke(AsyncEventQueueTestBase.class, "checkAsyncEventQueueSize", new Object[] { "ln", keyValues.size() + updateKeyValues.size() });
+    vm4.invoke(() -> AsyncEventQueueTestBase.putGivenKeyValue( getTestMethodName() + "_RR", updateKeyValues ));    
+    vm4.invoke(() -> AsyncEventQueueTestBase.checkAsyncEventQueueSize( "ln", keyValues.size() + updateKeyValues.size() ));
     
-    vm4.invoke(AsyncEventQueueTestBase.class, "validateAsyncEventListener",
-        new Object[] { "ln", 0 });
+    vm4.invoke(() -> AsyncEventQueueTestBase.validateAsyncEventListener( "ln", 0 ));
   
-    vm4.invoke(AsyncEventQueueTestBase.class, "resumeAsyncEventQueue", new Object[] { "ln" });
-    vm4.invoke(AsyncEventQueueTestBase.class, "validateAsyncEventListener",
-        new Object[] { "ln", 1000 });
+    vm4.invoke(() -> AsyncEventQueueTestBase.resumeAsyncEventQueue( "ln" ));
+    vm4.invoke(() -> AsyncEventQueueTestBase.validateAsyncEventListener( "ln", 1000 ));
     
     Wait.pause(2000);// give some time for system to become stable
-    vm4.invoke(AsyncEventQueueTestBase.class, "checkAsyncEventQueueStats", new Object[] {
-        "ln", 0, 2000, 2000, 1000 });
-    vm4.invoke(AsyncEventQueueTestBase.class, "checkAsyncEventQueueConflatedStats",
-        new Object[] { "ln", 500 });
+    vm4.invoke(() -> AsyncEventQueueTestBase.checkAsyncEventQueueStats(
+        "ln", 0, 2000, 2000, 1000 ));
+    vm4.invoke(() -> AsyncEventQueueTestBase.checkAsyncEventQueueConflatedStats( "ln", 500 ));
   }
 }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/69024aa9/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/concurrent/ConcurrentAsyncEventQueueDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/concurrent/ConcurrentAsyncEventQueueDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/concurrent/ConcurrentAsyncEventQueueDUnitTest.java
index 9398628..41accac 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/concurrent/ConcurrentAsyncEventQueueDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/concurrent/ConcurrentAsyncEventQueueDUnitTest.java
@@ -39,43 +39,37 @@ public class ConcurrentAsyncEventQueueDUnitTest extends AsyncEventQueueTestBase
   }
   
   public void testConcurrentSerialAsyncEventQueueAttributes() {
-    Integer lnPort = (Integer)vm0.invoke(AsyncEventQueueTestBase.class,
-        "createFirstLocatorWithDSId", new Object[] { 1 });
+    Integer lnPort = (Integer)vm0.invoke(() -> AsyncEventQueueTestBase.createFirstLocatorWithDSId( 1 ));
 
-    vm4.invoke(AsyncEventQueueTestBase.class, "createCache", new Object[] { lnPort });
+    vm4.invoke(() -> AsyncEventQueueTestBase.createCache( lnPort ));
 
-    vm4.invoke(AsyncEventQueueTestBase.class, "createConcurrentAsyncEventQueue", new Object[] { "ln",
-        false, 100, 150, true, true, "testDS", true, 5, OrderPolicy.THREAD });
+    vm4.invoke(() -> AsyncEventQueueTestBase.createConcurrentAsyncEventQueue( "ln",
+        false, 100, 150, true, true, "testDS", true, 5, OrderPolicy.THREAD ));
 
-    vm4.invoke(AsyncEventQueueTestBase.class, "validateConcurrentAsyncEventQueueAttributes",
-        new Object[] { "ln", 100, 150, AsyncEventQueueFactoryImpl.DEFAULT_BATCH_TIME_INTERVAL, true, "testDS", true, true, 5, OrderPolicy.THREAD });
+    vm4.invoke(() -> AsyncEventQueueTestBase.validateConcurrentAsyncEventQueueAttributes( "ln", 100, 150, AsyncEventQueueFactoryImpl.DEFAULT_BATCH_TIME_INTERVAL, true, "testDS", true, true, 5, OrderPolicy.THREAD ));
   }
   
  
   public void testConcurrentParallelAsyncEventQueueAttributesOrderPolicyKey() {
-    Integer lnPort = (Integer)vm0.invoke(AsyncEventQueueTestBase.class,
-        "createFirstLocatorWithDSId", new Object[] { 1 });
+    Integer lnPort = (Integer)vm0.invoke(() -> AsyncEventQueueTestBase.createFirstLocatorWithDSId( 1 ));
 
-    vm4.invoke(AsyncEventQueueTestBase.class, "createCache", new Object[] { lnPort });
+    vm4.invoke(() -> AsyncEventQueueTestBase.createCache( lnPort ));
 
-    vm4.invoke(AsyncEventQueueTestBase.class, "createConcurrentAsyncEventQueue", new Object[] { "ln",
-        true, 100, 150, true, true, "testDS", true, 5, OrderPolicy.KEY });
+    vm4.invoke(() -> AsyncEventQueueTestBase.createConcurrentAsyncEventQueue( "ln",
+        true, 100, 150, true, true, "testDS", true, 5, OrderPolicy.KEY ));
 
-    vm4.invoke(AsyncEventQueueTestBase.class, "validateConcurrentAsyncEventQueueAttributes",
-        new Object[] { "ln", 100, 150, AsyncEventQueueFactoryImpl.DEFAULT_BATCH_TIME_INTERVAL, true, "testDS", true, true, 5, OrderPolicy.KEY });
+    vm4.invoke(() -> AsyncEventQueueTestBase.validateConcurrentAsyncEventQueueAttributes( "ln", 100, 150, AsyncEventQueueFactoryImpl.DEFAULT_BATCH_TIME_INTERVAL, true, "testDS", true, true, 5, OrderPolicy.KEY ));
   }
 
   public void testConcurrentParallelAsyncEventQueueAttributesOrderPolicyPartition() {
-    Integer lnPort = (Integer)vm0.invoke(AsyncEventQueueTestBase.class,
-        "createFirstLocatorWithDSId", new Object[] { 1 });
+    Integer lnPort = (Integer)vm0.invoke(() -> AsyncEventQueueTestBase.createFirstLocatorWithDSId( 1 ));
 
-    vm4.invoke(AsyncEventQueueTestBase.class, "createCache", new Object[] { lnPort });
+    vm4.invoke(() -> AsyncEventQueueTestBase.createCache( lnPort ));
 
-    vm4.invoke(AsyncEventQueueTestBase.class, "createConcurrentAsyncEventQueue", new Object[] { "ln",
-        true, 100, 150, true, true, "testDS", true, 5, OrderPolicy.PARTITION });
+    vm4.invoke(() -> AsyncEventQueueTestBase.createConcurrentAsyncEventQueue( "ln",
+        true, 100, 150, true, true, "testDS", true, 5, OrderPolicy.PARTITION ));
 
-    vm4.invoke(AsyncEventQueueTestBase.class, "validateConcurrentAsyncEventQueueAttributes",
-        new Object[] { "ln", 100, 150, AsyncEventQueueFactoryImpl.DEFAULT_BATCH_TIME_INTERVAL, true, "testDS", true, true, 5, OrderPolicy.PARTITION });
+    vm4.invoke(() -> AsyncEventQueueTestBase.validateConcurrentAsyncEventQueueAttributes( "ln", 100, 150, AsyncEventQueueFactoryImpl.DEFAULT_BATCH_TIME_INTERVAL, true, "testDS", true, true, 5, OrderPolicy.PARTITION ));
   }
   
   /**
@@ -88,52 +82,39 @@ public class ConcurrentAsyncEventQueueDUnitTest extends AsyncEventQueueTestBase
    */
 
   public void testReplicatedSerialAsyncEventQueueWithMultipleDispatcherThreadsOrderPolicyKey() {
-    Integer lnPort = (Integer)vm0.invoke(AsyncEventQueueTestBase.class,
-        "createFirstLocatorWithDSId", new Object[] { 1 });
-
-    vm4.invoke(AsyncEventQueueTestBase.class, "createCache", new Object[] { lnPort });
-    vm5.invoke(AsyncEventQueueTestBase.class, "createCache", new Object[] { lnPort });
-    vm6.invoke(AsyncEventQueueTestBase.class, "createCache", new Object[] { lnPort });
-    vm7.invoke(AsyncEventQueueTestBase.class, "createCache", new Object[] { lnPort });
-
-    vm4.invoke(AsyncEventQueueTestBase.class, "createConcurrentAsyncEventQueue", new Object[] { "ln",
-        false, 100, 10, true, false, null, false, 3, OrderPolicy.KEY });
-    vm5.invoke(AsyncEventQueueTestBase.class, "createConcurrentAsyncEventQueue", new Object[] { "ln",
-        false, 100, 10, true, false, null, false, 3, OrderPolicy.KEY });
-    vm6.invoke(AsyncEventQueueTestBase.class, "createConcurrentAsyncEventQueue", new Object[] { "ln",
-        false, 100, 10, true, false, null, false, 3, OrderPolicy.KEY });
-    vm7.invoke(AsyncEventQueueTestBase.class, "createConcurrentAsyncEventQueue", new Object[] { "ln",
-        false, 100, 10, true, false, null, false, 3, OrderPolicy.KEY });
-
-    vm4.invoke(AsyncEventQueueTestBase.class, "createReplicatedRegionWithAsyncEventQueue",
-        new Object[] { getTestMethodName() + "_RR", "ln", isOffHeap() });
-    vm5.invoke(AsyncEventQueueTestBase.class, "createReplicatedRegionWithAsyncEventQueue",
-        new Object[] { getTestMethodName() + "_RR", "ln", isOffHeap() });
-    vm6.invoke(AsyncEventQueueTestBase.class, "createReplicatedRegionWithAsyncEventQueue",
-        new Object[] { getTestMethodName() + "_RR", "ln", isOffHeap() });
-    vm7.invoke(AsyncEventQueueTestBase.class, "createReplicatedRegionWithAsyncEventQueue",
-        new Object[] { getTestMethodName() + "_RR", "ln", isOffHeap() });
-
-    vm4.invoke(AsyncEventQueueTestBase.class, "doPuts", new Object[] { getTestMethodName() + "_RR",
-        100 });
+    Integer lnPort = (Integer)vm0.invoke(() -> AsyncEventQueueTestBase.createFirstLocatorWithDSId( 1 ));
+
+    vm4.invoke(() -> AsyncEventQueueTestBase.createCache( lnPort ));
+    vm5.invoke(() -> AsyncEventQueueTestBase.createCache( lnPort ));
+    vm6.invoke(() -> AsyncEventQueueTestBase.createCache( lnPort ));
+    vm7.invoke(() -> AsyncEventQueueTestBase.createCache( lnPort ));
+
+    vm4.invoke(() -> AsyncEventQueueTestBase.createConcurrentAsyncEventQueue( "ln",
+        false, 100, 10, true, false, null, false, 3, OrderPolicy.KEY ));
+    vm5.invoke(() -> AsyncEventQueueTestBase.createConcurrentAsyncEventQueue( "ln",
+        false, 100, 10, true, false, null, false, 3, OrderPolicy.KEY ));
+    vm6.invoke(() -> AsyncEventQueueTestBase.createConcurrentAsyncEventQueue( "ln",
+        false, 100, 10, true, false, null, false, 3, OrderPolicy.KEY ));
+    vm7.invoke(() -> AsyncEventQueueTestBase.createConcurrentAsyncEventQueue( "ln",
+        false, 100, 10, true, false, null, false, 3, OrderPolicy.KEY ));
+
+    vm4.invoke(() -> AsyncEventQueueTestBase.createReplicatedRegionWithAsyncEventQueue( getTestMethodName() + "_RR", "ln", isOffHeap() ));
+    vm5.invoke(() -> AsyncEventQueueTestBase.createReplicatedRegionWithAsyncEventQueue( getTestMethodName() + "_RR", "ln", isOffHeap() ));
+    vm6.invoke(() -> AsyncEventQueueTestBase.createReplicatedRegionWithAsyncEventQueue( getTestMethodName() + "_RR", "ln", isOffHeap() ));
+    vm7.invoke(() -> AsyncEventQueueTestBase.createReplicatedRegionWithAsyncEventQueue( getTestMethodName() + "_RR", "ln", isOffHeap() ));
+
+    vm4.invoke(() -> AsyncEventQueueTestBase.doPuts( getTestMethodName() + "_RR",
+        100 ));
     
-    vm4.invoke(AsyncEventQueueTestBase.class, "waitForAsyncQueueToGetEmpty",
-        new Object[] { "ln" });
-    vm5.invoke(AsyncEventQueueTestBase.class, "waitForAsyncQueueToGetEmpty",
-        new Object[] { "ln" });
-    vm6.invoke(AsyncEventQueueTestBase.class, "waitForAsyncQueueToGetEmpty",
-        new Object[] { "ln" });
-    vm7.invoke(AsyncEventQueueTestBase.class, "waitForAsyncQueueToGetEmpty",
-        new Object[] { "ln" });
+    vm4.invoke(() -> AsyncEventQueueTestBase.waitForAsyncQueueToGetEmpty( "ln" ));
+    vm5.invoke(() -> AsyncEventQueueTestBase.waitForAsyncQueueToGetEmpty( "ln" ));
+    vm6.invoke(() -> AsyncEventQueueTestBase.waitForAsyncQueueToGetEmpty( "ln" ));
+    vm7.invoke(() -> AsyncEventQueueTestBase.waitForAsyncQueueToGetEmpty( "ln" ));
     
-    vm4.invoke(AsyncEventQueueTestBase.class, "validateAsyncEventListener",
-        new Object[] { "ln", 100 });// primary sender
-    vm5.invoke(AsyncEventQueueTestBase.class, "validateAsyncEventListener",
-        new Object[] { "ln", 0 });// secondary
-    vm6.invoke(AsyncEventQueueTestBase.class, "validateAsyncEventListener",
-        new Object[] { "ln", 0 });// secondary
-    vm7.invoke(AsyncEventQueueTestBase.class, "validateAsyncEventListener",
-        new Object[] { "ln", 0 });// secondary
+    vm4.invoke(() -> AsyncEventQueueTestBase.validateAsyncEventListener( "ln", 100 ));// primary sender
+    vm5.invoke(() -> AsyncEventQueueTestBase.validateAsyncEventListener( "ln", 0 ));// secondary
+    vm6.invoke(() -> AsyncEventQueueTestBase.validateAsyncEventListener( "ln", 0 ));// secondary
+    vm7.invoke(() -> AsyncEventQueueTestBase.validateAsyncEventListener( "ln", 0 ));// secondary
   }
   
   /**
@@ -146,38 +127,33 @@ public class ConcurrentAsyncEventQueueDUnitTest extends AsyncEventQueueTestBase
    */
 
   public void testReplicatedSerialAsyncEventQueueWithMultipleDispatcherThreadsOrderPolicyThread() {
-    Integer lnPort = (Integer)vm0.invoke(AsyncEventQueueTestBase.class,
-        "createFirstLocatorWithDSId", new Object[] { 1 });
-
-    vm4.invoke(AsyncEventQueueTestBase.class, "createCache", new Object[] { lnPort });
-    vm5.invoke(AsyncEventQueueTestBase.class, "createCache", new Object[] { lnPort });
-    vm6.invoke(AsyncEventQueueTestBase.class, "createCache", new Object[] { lnPort });
-    vm7.invoke(AsyncEventQueueTestBase.class, "createCache", new Object[] { lnPort });
-
-    vm4.invoke(AsyncEventQueueTestBase.class, "createConcurrentAsyncEventQueue", new Object[] { "ln",
-        false, 100, 10, true, false, null, false, 3, OrderPolicy.THREAD });
-    vm5.invoke(AsyncEventQueueTestBase.class, "createConcurrentAsyncEventQueue", new Object[] { "ln",
-        false, 100, 10, true, false, null, false, 3, OrderPolicy.THREAD });
-    vm6.invoke(AsyncEventQueueTestBase.class, "createConcurrentAsyncEventQueue", new Object[] { "ln",
-        false, 100, 10, true, false, null, false, 3, OrderPolicy.THREAD });
-    vm7.invoke(AsyncEventQueueTestBase.class, "createConcurrentAsyncEventQueue", new Object[] { "ln",
-        false, 100, 10, true, false, null, false, 3, OrderPolicy.THREAD });
-
-    vm4.invoke(AsyncEventQueueTestBase.class, "createReplicatedRegionWithAsyncEventQueue",
-        new Object[] { getTestMethodName() + "_RR", "ln", isOffHeap() });
-    vm5.invoke(AsyncEventQueueTestBase.class, "createReplicatedRegionWithAsyncEventQueue",
-        new Object[] { getTestMethodName() + "_RR", "ln", isOffHeap() });
-    vm6.invoke(AsyncEventQueueTestBase.class, "createReplicatedRegionWithAsyncEventQueue",
-        new Object[] { getTestMethodName() + "_RR", "ln", isOffHeap() });
-    vm7.invoke(AsyncEventQueueTestBase.class, "createReplicatedRegionWithAsyncEventQueue",
-        new Object[] { getTestMethodName() + "_RR", "ln", isOffHeap() });
-
-    AsyncInvocation inv1 = vm4.invokeAsync(AsyncEventQueueTestBase.class, "doPuts", new Object[] { getTestMethodName() + "_RR",
-        50 });
-    AsyncInvocation inv2 = vm4.invokeAsync(AsyncEventQueueTestBase.class, "doNextPuts", new Object[] { getTestMethodName() + "_RR",
-      50, 100 });
-    AsyncInvocation inv3 = vm4.invokeAsync(AsyncEventQueueTestBase.class, "doNextPuts", new Object[] { getTestMethodName() + "_RR",
-      100, 150 });
+    Integer lnPort = (Integer)vm0.invoke(() -> AsyncEventQueueTestBase.createFirstLocatorWithDSId( 1 ));
+
+    vm4.invoke(() -> AsyncEventQueueTestBase.createCache( lnPort ));
+    vm5.invoke(() -> AsyncEventQueueTestBase.createCache( lnPort ));
+    vm6.invoke(() -> AsyncEventQueueTestBase.createCache( lnPort ));
+    vm7.invoke(() -> AsyncEventQueueTestBase.createCache( lnPort ));
+
+    vm4.invoke(() -> AsyncEventQueueTestBase.createConcurrentAsyncEventQueue( "ln",
+        false, 100, 10, true, false, null, false, 3, OrderPolicy.THREAD ));
+    vm5.invoke(() -> AsyncEventQueueTestBase.createConcurrentAsyncEventQueue( "ln",
+        false, 100, 10, true, false, null, false, 3, OrderPolicy.THREAD ));
+    vm6.invoke(() -> AsyncEventQueueTestBase.createConcurrentAsyncEventQueue( "ln",
+        false, 100, 10, true, false, null, false, 3, OrderPolicy.THREAD ));
+    vm7.invoke(() -> AsyncEventQueueTestBase.createConcurrentAsyncEventQueue( "ln",
+        false, 100, 10, true, false, null, false, 3, OrderPolicy.THREAD ));
+
+    vm4.invoke(() -> AsyncEventQueueTestBase.createReplicatedRegionWithAsyncEventQueue( getTestMethodName() + "_RR", "ln", isOffHeap() ));
+    vm5.invoke(() -> AsyncEventQueueTestBase.createReplicatedRegionWithAsyncEventQueue( getTestMethodName() + "_RR", "ln", isOffHeap() ));
+    vm6.invoke(() -> AsyncEventQueueTestBase.createReplicatedRegionWithAsyncEventQueue( getTestMethodName() + "_RR", "ln", isOffHeap() ));
+    vm7.invoke(() -> AsyncEventQueueTestBase.createReplicatedRegionWithAsyncEventQueue( getTestMethodName() + "_RR", "ln", isOffHeap() ));
+
+    AsyncInvocation inv1 = vm4.invokeAsync(() -> AsyncEventQueueTestBase.doPuts( getTestMethodName() + "_RR",
+        50 ));
+    AsyncInvocation inv2 = vm4.invokeAsync(() -> AsyncEventQueueTestBase.doNextPuts( getTestMethodName() + "_RR",
+      50, 100 ));
+    AsyncInvocation inv3 = vm4.invokeAsync(() -> AsyncEventQueueTestBase.doNextPuts( getTestMethodName() + "_RR",
+      100, 150 ));
     
     try {
       inv1.join();
@@ -189,23 +165,15 @@ public class ConcurrentAsyncEventQueueDUnitTest extends AsyncEventQueueTestBase
           ie);
     }
     
-    vm4.invoke(AsyncEventQueueTestBase.class, "waitForAsyncQueueToGetEmpty",
-        new Object[] { "ln" });
-    vm5.invoke(AsyncEventQueueTestBase.class, "waitForAsyncQueueToGetEmpty",
-        new Object[] { "ln" });
-    vm6.invoke(AsyncEventQueueTestBase.class, "waitForAsyncQueueToGetEmpty",
-        new Object[] { "ln" });
-    vm7.invoke(AsyncEventQueueTestBase.class, "waitForAsyncQueueToGetEmpty",
-        new Object[] { "ln" });
-
-    vm4.invoke(AsyncEventQueueTestBase.class, "validateAsyncEventListener",
-        new Object[] { "ln", 150 });// primary sender
-    vm5.invoke(AsyncEventQueueTestBase.class, "validateAsyncEventListener",
-        new Object[] { "ln", 0 });// secondary
-    vm6.invoke(AsyncEventQueueTestBase.class, "validateAsyncEventListener",
-        new Object[] { "ln", 0 });// secondary
-    vm7.invoke(AsyncEventQueueTestBase.class, "validateAsyncEventListener",
-        new Object[] { "ln", 0 });// secondary
+    vm4.invoke(() -> AsyncEventQueueTestBase.waitForAsyncQueueToGetEmpty( "ln" ));
+    vm5.invoke(() -> AsyncEventQueueTestBase.waitForAsyncQueueToGetEmpty( "ln" ));
+    vm6.invoke(() -> AsyncEventQueueTestBase.waitForAsyncQueueToGetEmpty( "ln" ));
+    vm7.invoke(() -> AsyncEventQueueTestBase.waitForAsyncQueueToGetEmpty( "ln" ));
+
+    vm4.invoke(() -> AsyncEventQueueTestBase.validateAsyncEventListener( "ln", 150 ));// primary sender
+    vm5.invoke(() -> AsyncEventQueueTestBase.validateAsyncEventListener( "ln", 0 ));// secondary
+    vm6.invoke(() -> AsyncEventQueueTestBase.validateAsyncEventListener( "ln", 0 ));// secondary
+    vm7.invoke(() -> AsyncEventQueueTestBase.validateAsyncEventListener( "ln", 0 ));// secondary
   }
   
   /**
@@ -218,52 +186,39 @@ public class ConcurrentAsyncEventQueueDUnitTest extends AsyncEventQueueTestBase
    */
   // Disabling test for bug #48323
   public void testPartitionedParallelAsyncEventQueueWithMultipleDispatcherThreadsOrderPolicyKey() {
-    Integer lnPort = (Integer)vm0.invoke(AsyncEventQueueTestBase.class,
-        "createFirstLocatorWithDSId", new Object[] { 1 });
-
-    vm4.invoke(AsyncEventQueueTestBase.class, "createCache", new Object[] { lnPort });
-    vm5.invoke(AsyncEventQueueTestBase.class, "createCache", new Object[] { lnPort });
-    vm6.invoke(AsyncEventQueueTestBase.class, "createCache", new Object[] { lnPort });
-    vm7.invoke(AsyncEventQueueTestBase.class, "createCache", new Object[] { lnPort });
-
-    vm4.invoke(AsyncEventQueueTestBase.class, "createConcurrentAsyncEventQueue", new Object[] { "ln",
-        true, 100, 10, true, false, null, false, 3, OrderPolicy.KEY });
-    vm5.invoke(AsyncEventQueueTestBase.class, "createConcurrentAsyncEventQueue", new Object[] { "ln",
-        true, 100, 10, true, false, null, false, 3, OrderPolicy.KEY });
-    vm6.invoke(AsyncEventQueueTestBase.class, "createConcurrentAsyncEventQueue", new Object[] { "ln",
-        true, 100, 10, true, false, null, false, 3, OrderPolicy.KEY });
-    vm7.invoke(AsyncEventQueueTestBase.class, "createConcurrentAsyncEventQueue", new Object[] { "ln",
-        true, 100, 10, true, false, null, false, 3, OrderPolicy.KEY });
-
-    vm4.invoke(AsyncEventQueueTestBase.class, "createPartitionedRegionWithAsyncEventQueue",
-        new Object[] { getTestMethodName() + "_PR", "ln", isOffHeap() });
-    vm5.invoke(AsyncEventQueueTestBase.class, "createPartitionedRegionWithAsyncEventQueue",
-        new Object[] { getTestMethodName() + "_PR", "ln", isOffHeap() });
-    vm6.invoke(AsyncEventQueueTestBase.class, "createPartitionedRegionWithAsyncEventQueue",
-        new Object[] { getTestMethodName() + "_PR", "ln", isOffHeap() });
-    vm7.invoke(AsyncEventQueueTestBase.class, "createPartitionedRegionWithAsyncEventQueue",
-        new Object[] { getTestMethodName() + "_PR", "ln", isOffHeap() });
-
-    vm4.invoke(AsyncEventQueueTestBase.class, "doPuts", new Object[] { getTestMethodName() + "_PR",
-        100 });
+    Integer lnPort = (Integer)vm0.invoke(() -> AsyncEventQueueTestBase.createFirstLocatorWithDSId( 1 ));
+
+    vm4.invoke(() -> AsyncEventQueueTestBase.createCache( lnPort ));
+    vm5.invoke(() -> AsyncEventQueueTestBase.createCache( lnPort ));
+    vm6.invoke(() -> AsyncEventQueueTestBase.createCache( lnPort ));
+    vm7.invoke(() -> AsyncEventQueueTestBase.createCache( lnPort ));
+
+    vm4.invoke(() -> AsyncEventQueueTestBase.createConcurrentAsyncEventQueue( "ln",
+        true, 100, 10, true, false, null, false, 3, OrderPolicy.KEY ));
+    vm5.invoke(() -> AsyncEventQueueTestBase.createConcurrentAsyncEventQueue( "ln",
+        true, 100, 10, true, false, null, false, 3, OrderPolicy.KEY ));
+    vm6.invoke(() -> AsyncEventQueueTestBase.createConcurrentAsyncEventQueue( "ln",
+        true, 100, 10, true, false, null, false, 3, OrderPolicy.KEY ));
+    vm7.invoke(() -> AsyncEventQueueTestBase.createConcurrentAsyncEventQueue( "ln",
+        true, 100, 10, true, false, null, false, 3, OrderPolicy.KEY ));
+
+    vm4.invoke(() -> AsyncEventQueueTestBase.createPartitionedRegionWithAsyncEventQueue( getTestMethodName() + "_PR", "ln", isOffHeap() ));
+    vm5.invoke(() -> AsyncEventQueueTestBase.createPartitionedRegionWithAsyncEventQueue( getTestMethodName() + "_PR", "ln", isOffHeap() ));
+    vm6.invoke(() -> AsyncEventQueueTestBase.createPartitionedRegionWithAsyncEventQueue( getTestMethodName() + "_PR", "ln", isOffHeap() ));
+    vm7.invoke(() -> AsyncEventQueueTestBase.createPartitionedRegionWithAsyncEventQueue( getTestMethodName() + "_PR", "ln", isOffHeap() ));
+
+    vm4.invoke(() -> AsyncEventQueueTestBase.doPuts( getTestMethodName() + "_PR",
+        100 ));
     
-    vm4.invoke(AsyncEventQueueTestBase.class, "waitForAsyncQueueToGetEmpty",
-      new Object[] { "ln" });
-    vm5.invoke(AsyncEventQueueTestBase.class, "waitForAsyncQueueToGetEmpty",
-      new Object[] { "ln" });
-    vm6.invoke(AsyncEventQueueTestBase.class, "waitForAsyncQueueToGetEmpty",
-      new Object[] { "ln" });
-    vm7.invoke(AsyncEventQueueTestBase.class, "waitForAsyncQueueToGetEmpty",
-      new Object[] { "ln" });
+    vm4.invoke(() -> AsyncEventQueueTestBase.waitForAsyncQueueToGetEmpty( "ln" ));
+    vm5.invoke(() -> AsyncEventQueueTestBase.waitForAsyncQueueToGetEmpty( "ln" ));
+    vm6.invoke(() -> AsyncEventQueueTestBase.waitForAsyncQueueToGetEmpty( "ln" ));
+    vm7.invoke(() -> AsyncEventQueueTestBase.waitForAsyncQueueToGetEmpty( "ln" ));
   
-    int vm4size = (Integer)vm4.invoke(AsyncEventQueueTestBase.class, "getAsyncEventListenerMapSize",
-      new Object[] { "ln"});
-    int vm5size = (Integer)vm5.invoke(AsyncEventQueueTestBase.class, "getAsyncEventListenerMapSize",
-      new Object[] { "ln"});
-    int vm6size = (Integer)vm6.invoke(AsyncEventQueueTestBase.class, "getAsyncEventListenerMapSize",
-      new Object[] { "ln"});
-    int vm7size = (Integer)vm7.invoke(AsyncEventQueueTestBase.class, "getAsyncEventListenerMapSize",
-      new Object[] { "ln"});
+    int vm4size = (Integer)vm4.invoke(() -> AsyncEventQueueTestBase.getAsyncEventListenerMapSize( "ln"));
+    int vm5size = (Integer)vm5.invoke(() -> AsyncEventQueueTestBase.getAsyncEventListenerMapSize( "ln"));
+    int vm6size = (Integer)vm6.invoke(() -> AsyncEventQueueTestBase.getAsyncEventListenerMapSize( "ln"));
+    int vm7size = (Integer)vm7.invoke(() -> AsyncEventQueueTestBase.getAsyncEventListenerMapSize( "ln"));
   
     assertEquals(vm4size + vm5size + vm6size + vm7size, 100);
   
@@ -280,56 +235,39 @@ public class ConcurrentAsyncEventQueueDUnitTest extends AsyncEventQueueTestBase
    */
   // Disabled test for bug #48323
   public void testPartitionedParallelAsyncEventQueueWithMultipleDispatcherThreadsOrderPolicyPartition() {
-    Integer lnPort = (Integer)vm0.invoke(AsyncEventQueueTestBase.class,
-        "createFirstLocatorWithDSId", new Object[] { 1 });
-
-    vm4.invoke(AsyncEventQueueTestBase.class, "createCache", new Object[] { lnPort });
-    vm5.invoke(AsyncEventQueueTestBase.class, "createCache", new Object[] { lnPort });
-    vm6.invoke(AsyncEventQueueTestBase.class, "createCache", new Object[] { lnPort });
-    vm7.invoke(AsyncEventQueueTestBase.class, "createCache", new Object[] { lnPort });
-
-    vm4.invoke(AsyncEventQueueTestBase.class, "createConcurrentAsyncEventQueue",
-        new Object[] { "ln", true, 100, 10, true, false, null, false, 3,
-            OrderPolicy.PARTITION });
-    vm5.invoke(AsyncEventQueueTestBase.class, "createConcurrentAsyncEventQueue",
-        new Object[] { "ln", true, 100, 10, true, false, null, false, 3,
-            OrderPolicy.PARTITION });
-    vm6.invoke(AsyncEventQueueTestBase.class, "createConcurrentAsyncEventQueue",
-        new Object[] { "ln", true, 100, 10, true, false, null, false, 3,
-            OrderPolicy.PARTITION });
-    vm7.invoke(AsyncEventQueueTestBase.class, "createConcurrentAsyncEventQueue",
-        new Object[] { "ln", true, 100, 10, true, false, null, false, 3,
-            OrderPolicy.PARTITION });
-
-    vm4.invoke(AsyncEventQueueTestBase.class, "createPartitionedRegionWithAsyncEventQueue",
-        new Object[] { getTestMethodName() + "_PR", "ln", isOffHeap() });
-    vm5.invoke(AsyncEventQueueTestBase.class, "createPartitionedRegionWithAsyncEventQueue",
-        new Object[] { getTestMethodName() + "_PR", "ln", isOffHeap() });
-    vm6.invoke(AsyncEventQueueTestBase.class, "createPartitionedRegionWithAsyncEventQueue",
-        new Object[] { getTestMethodName() + "_PR", "ln", isOffHeap() });
-    vm7.invoke(AsyncEventQueueTestBase.class, "createPartitionedRegionWithAsyncEventQueue",
-        new Object[] { getTestMethodName() + "_PR", "ln", isOffHeap() });
-
-    vm4.invoke(AsyncEventQueueTestBase.class, "doPuts", new Object[] { getTestMethodName() + "_PR",
-        100 });
-
-    vm4.invoke(AsyncEventQueueTestBase.class, "waitForAsyncQueueToGetEmpty",
-        new Object[] { "ln" });
-    vm5.invoke(AsyncEventQueueTestBase.class, "waitForAsyncQueueToGetEmpty",
-        new Object[] { "ln" });
-    vm6.invoke(AsyncEventQueueTestBase.class, "waitForAsyncQueueToGetEmpty",
-        new Object[] { "ln" });
-    vm7.invoke(AsyncEventQueueTestBase.class, "waitForAsyncQueueToGetEmpty",
-        new Object[] { "ln" });
-
-    int vm4size = (Integer)vm4.invoke(AsyncEventQueueTestBase.class,
-        "getAsyncEventListenerMapSize", new Object[] { "ln" });
-    int vm5size = (Integer)vm5.invoke(AsyncEventQueueTestBase.class,
-        "getAsyncEventListenerMapSize", new Object[] { "ln" });
-    int vm6size = (Integer)vm6.invoke(AsyncEventQueueTestBase.class,
-        "getAsyncEventListenerMapSize", new Object[] { "ln" });
-    int vm7size = (Integer)vm7.invoke(AsyncEventQueueTestBase.class,
-        "getAsyncEventListenerMapSize", new Object[] { "ln" });
+    Integer lnPort = (Integer)vm0.invoke(() -> AsyncEventQueueTestBase.createFirstLocatorWithDSId( 1 ));
+
+    vm4.invoke(() -> AsyncEventQueueTestBase.createCache( lnPort ));
+    vm5.invoke(() -> AsyncEventQueueTestBase.createCache( lnPort ));
+    vm6.invoke(() -> AsyncEventQueueTestBase.createCache( lnPort ));
+    vm7.invoke(() -> AsyncEventQueueTestBase.createCache( lnPort ));
+
+    vm4.invoke(() -> AsyncEventQueueTestBase.createConcurrentAsyncEventQueue( "ln", true, 100, 10, true, false, null, false, 3,
+            OrderPolicy.PARTITION ));
+    vm5.invoke(() -> AsyncEventQueueTestBase.createConcurrentAsyncEventQueue( "ln", true, 100, 10, true, false, null, false, 3,
+            OrderPolicy.PARTITION ));
+    vm6.invoke(() -> AsyncEventQueueTestBase.createConcurrentAsyncEventQueue( "ln", true, 100, 10, true, false, null, false, 3,
+            OrderPolicy.PARTITION ));
+    vm7.invoke(() -> AsyncEventQueueTestBase.createConcurrentAsyncEventQueue( "ln", true, 100, 10, true, false, null, false, 3,
+            OrderPolicy.PARTITION ));
+
+    vm4.invoke(() -> AsyncEventQueueTestBase.createPartitionedRegionWithAsyncEventQueue( getTestMethodName() + "_PR", "ln", isOffHeap() ));
+    vm5.invoke(() -> AsyncEventQueueTestBase.createPartitionedRegionWithAsyncEventQueue( getTestMethodName() + "_PR", "ln", isOffHeap() ));
+    vm6.invoke(() -> AsyncEventQueueTestBase.createPartitionedRegionWithAsyncEventQueue( getTestMethodName() + "_PR", "ln", isOffHeap() ));
+    vm7.invoke(() -> AsyncEventQueueTestBase.createPartitionedRegionWithAsyncEventQueue( getTestMethodName() + "_PR", "ln", isOffHeap() ));
+
+    vm4.invoke(() -> AsyncEventQueueTestBase.doPuts( getTestMethodName() + "_PR",
+        100 ));
+
+    vm4.invoke(() -> AsyncEventQueueTestBase.waitForAsyncQueueToGetEmpty( "ln" ));
+    vm5.invoke(() -> AsyncEventQueueTestBase.waitForAsyncQueueToGetEmpty( "ln" ));
+    vm6.invoke(() -> AsyncEventQueueTestBase.waitForAsyncQueueToGetEmpty( "ln" ));
+    vm7.invoke(() -> AsyncEventQueueTestBase.waitForAsyncQueueToGetEmpty( "ln" ));
+
+    int vm4size = (Integer)vm4.invoke(() -> AsyncEventQueueTestBase.getAsyncEventListenerMapSize( "ln" ));
+    int vm5size = (Integer)vm5.invoke(() -> AsyncEventQueueTestBase.getAsyncEventListenerMapSize( "ln" ));
+    int vm6size = (Integer)vm6.invoke(() -> AsyncEventQueueTestBase.getAsyncEventListenerMapSize( "ln" ));
+    int vm7size = (Integer)vm7.invoke(() -> AsyncEventQueueTestBase.getAsyncEventListenerMapSize( "ln" ));
 
     assertEquals(100, vm4size + vm5size + vm6size + vm7size);
   }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/69024aa9/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/CommonParallelAsyncEventQueueDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/CommonParallelAsyncEventQueueDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/CommonParallelAsyncEventQueueDUnitTest.java
index 0035d16..a21e2ab 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/CommonParallelAsyncEventQueueDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/CommonParallelAsyncEventQueueDUnitTest.java
@@ -38,16 +38,13 @@ public class CommonParallelAsyncEventQueueDUnitTest extends AsyncEventQueueTestB
     
   public void testSameSenderWithNonColocatedRegions() throws Exception {
     IgnoredException.addIgnoredException("cannot have the same parallel async");
-    Integer lnPort = (Integer)vm0.invoke(AsyncEventQueueTestBase.class,
-        "createFirstLocatorWithDSId", new Object[] { 1 });
-    vm4.invoke(AsyncEventQueueTestBase.class, "createCache", new Object[] { lnPort });
-    vm4.invoke(AsyncEventQueueTestBase.class, "createAsyncEventQueue", new Object[] { "ln",
-      true, 100, 100, false, false, null, false });
-    vm4.invoke(AsyncEventQueueTestBase.class, "createPartitionedRegionWithAsyncEventQueue",
-        new Object[] { getTestMethodName() + "_PR1", "ln", isOffHeap()  });
+    Integer lnPort = (Integer)vm0.invoke(() -> AsyncEventQueueTestBase.createFirstLocatorWithDSId( 1 ));
+    vm4.invoke(() -> AsyncEventQueueTestBase.createCache( lnPort ));
+    vm4.invoke(() -> AsyncEventQueueTestBase.createAsyncEventQueue( "ln",
+      true, 100, 100, false, false, null, false ));
+    vm4.invoke(() -> AsyncEventQueueTestBase.createPartitionedRegionWithAsyncEventQueue( getTestMethodName() + "_PR1", "ln", isOffHeap()  ));
     try {
-      vm4.invoke(AsyncEventQueueTestBase.class, "createPartitionedRegionWithAsyncEventQueue",
-          new Object[] { getTestMethodName() + "_PR2", "ln", isOffHeap()  });
+      vm4.invoke(() -> AsyncEventQueueTestBase.createPartitionedRegionWithAsyncEventQueue( getTestMethodName() + "_PR2", "ln", isOffHeap()  ));
       fail("Expected IllegateStateException : cannot have the same parallel gateway sender");
     }
     catch (Exception e) {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/69024aa9/gemfire-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/ExceptionsDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/ExceptionsDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/ExceptionsDUnitTest.java
index 492ec61..e9c725d 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/ExceptionsDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/ExceptionsDUnitTest.java
@@ -182,32 +182,32 @@ public class ExceptionsDUnitTest extends DistributedTestCase {
     super.setUp();
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
-    vm0.invoke(ExceptionsDUnitTest.class, "init");
+    vm0.invoke(() -> ExceptionsDUnitTest.init());
   }
 
   @Override
   protected final void preTearDown() throws Exception {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
-    vm0.invoke(ExceptionsDUnitTest.class, "closeCache");
+    vm0.invoke(() -> ExceptionsDUnitTest.closeCache());
   }
 
   public static void testBlockingTimeOut() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
-    vm0.invoke(ExceptionsDUnitTest.class, "runTest1");
+    vm0.invoke(() -> ExceptionsDUnitTest.runTest1());
   }
 
   public static void testLoginTimeOut() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
-    vm0.invoke(ExceptionsDUnitTest.class, "runTest2");
+    vm0.invoke(() -> ExceptionsDUnitTest.runTest2());
   }
 
   public static void testTransactionTimeOut() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
-    vm0.invoke(ExceptionsDUnitTest.class, "runTest3");
+    vm0.invoke(() -> ExceptionsDUnitTest.runTest3());
   }
 
   public static void runTest1() throws Exception {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/69024aa9/gemfire-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/IdleTimeOutDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/IdleTimeOutDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/IdleTimeOutDUnitTest.java
index 96e5a8d..68153eb 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/IdleTimeOutDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/IdleTimeOutDUnitTest.java
@@ -256,15 +256,14 @@ public class IdleTimeOutDUnitTest extends DistributedTestCase {
   @Override
   protected final void preTearDown() throws Exception {
     VM vm0 = Host.getHost(0).getVM(0);
-    vm0.invoke(IdleTimeOutDUnitTest.class, "closeCache");
+    vm0.invoke(() -> IdleTimeOutDUnitTest.closeCache());
   }
 
   public void testIdleTimeOut() throws Throwable {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
-    vm0.invoke(IdleTimeOutDUnitTest.class, "runTest1");
-    AsyncInvocation asyncObj = vm0.invokeAsync(IdleTimeOutDUnitTest.class,
-        "runTest2");
+    vm0.invoke(() -> IdleTimeOutDUnitTest.runTest1());
+    AsyncInvocation asyncObj = vm0.invokeAsync(() -> IdleTimeOutDUnitTest.runTest2());
     ThreadUtils.join(asyncObj, 30 * 1000);
     if(asyncObj.exceptionOccurred()){
       Assert.fail("asyncObj failed", asyncObj.getException());

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/69024aa9/gemfire-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/LoginTimeOutDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/LoginTimeOutDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/LoginTimeOutDUnitTest.java
index c5a4e02..fb617d9 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/LoginTimeOutDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/LoginTimeOutDUnitTest.java
@@ -231,12 +231,12 @@ public class LoginTimeOutDUnitTest extends DistributedTestCase {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
     try {
-      vm0.invoke(LoginTimeOutDUnitTest.class, "destroyTable");
+      vm0.invoke(() -> LoginTimeOutDUnitTest.destroyTable());
     } catch (Exception e) {
       if ( (e instanceof RMIException) || (e instanceof SQLException)) {
         // sometimes we have lock timeout problems destroying the table in
         // this test
-        vm0.invoke(DistributedTestCase.class, "disconnectFromDS");
+        vm0.invoke(() -> DistributedTestCase.disconnectFromDS());
       }
     }
   }
@@ -250,8 +250,8 @@ public class LoginTimeOutDUnitTest extends DistributedTestCase {
   public void disabledtestLoginTimeOut() throws Exception {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
-    AsyncInvocation test1 = vm0.invokeAsync(LoginTimeOutDUnitTest.class, "runTest1");
-    AsyncInvocation test2 = vm0.invokeAsync(LoginTimeOutDUnitTest.class, "runTest2");
+    AsyncInvocation test1 = vm0.invokeAsync(() -> LoginTimeOutDUnitTest.runTest1());
+    AsyncInvocation test2 = vm0.invokeAsync(() -> LoginTimeOutDUnitTest.runTest2());
     ThreadUtils.join(test2, 120 * 1000);
     if(test2.exceptionOccurred()){
       Assert.fail("asyncObj failed", test2.getException());

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/69024aa9/gemfire-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/MaxPoolSizeDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/MaxPoolSizeDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/MaxPoolSizeDUnitTest.java
index 1ab5b2c..9ee5922 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/MaxPoolSizeDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/MaxPoolSizeDUnitTest.java
@@ -260,7 +260,7 @@ public class MaxPoolSizeDUnitTest extends DistributedTestCase {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
     try {
-      vm0.invoke(MaxPoolSizeDUnitTest.class, "destroyTable");
+      vm0.invoke(() -> MaxPoolSizeDUnitTest.destroyTable());
     } finally {
       disconnectAllFromDS();
     }
@@ -269,8 +269,7 @@ public class MaxPoolSizeDUnitTest extends DistributedTestCase {
   public static void testMaxPoolSize()  throws Throwable{
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
-    AsyncInvocation asyncObj = vm0.invokeAsync(MaxPoolSizeDUnitTest.class,
-        "runTest1");
+    AsyncInvocation asyncObj = vm0.invokeAsync(() -> MaxPoolSizeDUnitTest.runTest1());
     ThreadUtils.join(asyncObj, 30 * 1000);
     if(asyncObj.exceptionOccurred()){
       Assert.fail("asyncObj failed", asyncObj.getException());

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/69024aa9/gemfire-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/TransactionTimeOutDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/TransactionTimeOutDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/TransactionTimeOutDUnitTest.java
index fead02e..1a19b0b 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/TransactionTimeOutDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/TransactionTimeOutDUnitTest.java
@@ -123,21 +123,21 @@ public class TransactionTimeOutDUnitTest extends DistributedTestCase {
     super.setUp();
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
-    vm0.invoke(TransactionTimeOutDUnitTest.class, "init");
+    vm0.invoke(() -> TransactionTimeOutDUnitTest.init());
   }
 
   @Override
   protected final void preTearDown() throws Exception {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
-    vm0.invoke(TransactionTimeOutDUnitTest.class, "closeCache");
+    vm0.invoke(() -> TransactionTimeOutDUnitTest.closeCache());
   }
 
   public static void testTimeOut() throws Throwable{
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
-    AsyncInvocation async1 = vm0.invokeAsync(TransactionTimeOutDUnitTest.class, "runTest1");
-    AsyncInvocation async2 =vm0.invokeAsync(TransactionTimeOutDUnitTest.class, "runTest2");
+    AsyncInvocation async1 = vm0.invokeAsync(() -> TransactionTimeOutDUnitTest.runTest1());
+    AsyncInvocation async2 =vm0.invokeAsync(() -> TransactionTimeOutDUnitTest.runTest2());
     
     ThreadUtils.join(async1, 30 * 1000);
     ThreadUtils.join(async2, 30 * 1000);
@@ -152,49 +152,49 @@ public class TransactionTimeOutDUnitTest extends DistributedTestCase {
   public static void test1() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
-    vm0.invoke(TransactionTimeOutDUnitTest.class, "runTest3");
+    vm0.invoke(() -> TransactionTimeOutDUnitTest.runTest3());
   }
 
   public static void test2() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
-    vm0.invoke(TransactionTimeOutDUnitTest.class, "runTest4");
+    vm0.invoke(() -> TransactionTimeOutDUnitTest.runTest4());
   }
 
   public static void test3() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
-    vm0.invoke(TransactionTimeOutDUnitTest.class, "runTest5");
+    vm0.invoke(() -> TransactionTimeOutDUnitTest.runTest5());
   }
 
   public static void test4() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
-    vm0.invoke(TransactionTimeOutDUnitTest.class, "runTest6");
+    vm0.invoke(() -> TransactionTimeOutDUnitTest.runTest6());
   }
 
   public static void test5() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
-    vm0.invoke(TransactionTimeOutDUnitTest.class, "runTest7");
+    vm0.invoke(() -> TransactionTimeOutDUnitTest.runTest7());
   }
 
   public static void test6() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
-    vm0.invoke(TransactionTimeOutDUnitTest.class, "runTest8");
+    vm0.invoke(() -> TransactionTimeOutDUnitTest.runTest8());
   }
 
   public static void test7() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
-    vm0.invoke(TransactionTimeOutDUnitTest.class, "runTest9");
+    vm0.invoke(() -> TransactionTimeOutDUnitTest.runTest9());
   }
 
   public static void test8() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
-    vm0.invoke(TransactionTimeOutDUnitTest.class, "runTest10");
+    vm0.invoke(() -> TransactionTimeOutDUnitTest.runTest10());
   }
 
   public static void runTest1() throws Exception {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/69024aa9/gemfire-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/TxnManagerMultiThreadDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/TxnManagerMultiThreadDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/TxnManagerMultiThreadDUnitTest.java
index fab159d..8096dc0 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/TxnManagerMultiThreadDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/TxnManagerMultiThreadDUnitTest.java
@@ -331,7 +331,7 @@ public class TxnManagerMultiThreadDUnitTest extends DistributedTestCase {
     vm0.invoke(CacheUtils.class, "setTableName", o);
     //delete the rows which are inseted in CacheUtils.init by calling delRows
     // method
-    vm0.invoke(TxnManagerMultiThreadDUnitTest.class, "delRows");
+    vm0.invoke(() -> TxnManagerMultiThreadDUnitTest.delRows());
   }
 
   public static void delRows() {
@@ -424,13 +424,12 @@ public class TxnManagerMultiThreadDUnitTest extends DistributedTestCase {
    */
   public static void test1AllCommit() throws Throwable {
     VM vm0 = Host.getHost(0).getVM(0);
-    AsyncInvocation asyncObj1 = vm0.invokeAsync(
-        TxnManagerMultiThreadDUnitTest.class, "callCommitThreads");
+    AsyncInvocation asyncObj1 = vm0.invokeAsync(() -> TxnManagerMultiThreadDUnitTest.callCommitThreads());
     ThreadUtils.join(asyncObj1, 30 * 1000);
     if(asyncObj1.exceptionOccurred()){
       Assert.fail("asyncObj1 failed", asyncObj1.getException());
     }
-    vm0.invoke(TxnManagerMultiThreadDUnitTest.class, "getNumberOfRows");
+    vm0.invoke(() -> TxnManagerMultiThreadDUnitTest.getNumberOfRows());
   }//end of testAllCommit
 
   /*
@@ -457,13 +456,12 @@ public class TxnManagerMultiThreadDUnitTest extends DistributedTestCase {
    */
   public static void _test3Commit2Rollback() throws Throwable {
     VM vm0 = Host.getHost(0).getVM(0);
-    AsyncInvocation asyncObj1 = vm0.invokeAsync(
-        TxnManagerMultiThreadDUnitTest.class, "callCommitandRollbackThreads");
+    AsyncInvocation asyncObj1 = vm0.invokeAsync(() -> TxnManagerMultiThreadDUnitTest.callCommitandRollbackThreads());
     ThreadUtils.join(asyncObj1, 30 * 1000);
     if(asyncObj1.exceptionOccurred()){
       Assert.fail("asyncObj1 failed", asyncObj1.getException());
     }
-    vm0.invoke(TxnManagerMultiThreadDUnitTest.class, "getNumberOfRows");
+    vm0.invoke(() -> TxnManagerMultiThreadDUnitTest.getNumberOfRows());
   }//end of test3Commit2Rollback
 
   public static void callCommitandRollbackThreads() {
@@ -493,7 +491,7 @@ public class TxnManagerMultiThreadDUnitTest extends DistributedTestCase {
    * (InterruptedException e) { fail ("Current thread experienced Interrupted
    * Exception !"); }
    * 
-   * //vm0.invoke(TxnManagerMultiThreadDUnitTest.class, "getNumberOfRows");
+   * //vm0.invoke(() -> TxnManagerMultiThreadDUnitTest.getNumberOfRows());
    * 
    * }//end of test3Commit2Rollback
    *  

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/69024aa9/gemfire-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/TxnTimeOutDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/TxnTimeOutDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/TxnTimeOutDUnitTest.java
index a9f41ac..746972a 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/TxnTimeOutDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/TxnTimeOutDUnitTest.java
@@ -119,14 +119,14 @@ public class TxnTimeOutDUnitTest extends DistributedTestCase {
     super.setUp();
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
-    vm0.invoke(TxnTimeOutDUnitTest.class, "init");
+    vm0.invoke(() -> TxnTimeOutDUnitTest.init());
   }
 
   @Override
   protected final void preTearDown() throws Exception {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
-    vm0.invoke(TxnTimeOutDUnitTest.class, "closeCache");
+    vm0.invoke(() -> TxnTimeOutDUnitTest.closeCache());
   }
 
   public void testMultiThreaded() throws NamingException, SQLException,Throwable {
@@ -193,9 +193,8 @@ public class TxnTimeOutDUnitTest extends DistributedTestCase {
   public static void testLoginTimeOut() throws Throwable {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
-    AsyncInvocation asyncObj1 =  vm0.invokeAsync(TxnTimeOutDUnitTest.class,
-        "runTest2");
-    AsyncInvocation asyncObj2 =    vm0.invokeAsync(TxnTimeOutDUnitTest.class, "runTest1");
+    AsyncInvocation asyncObj1 =  vm0.invokeAsync(() -> TxnTimeOutDUnitTest.runTest2());
+    AsyncInvocation asyncObj2 =    vm0.invokeAsync(() -> TxnTimeOutDUnitTest.runTest1());
 
     ThreadUtils.join(asyncObj1, 5 * 60 * 1000);
     if(asyncObj1.exceptionOccurred()){

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/69024aa9/gemfire-core/src/test/java/com/gemstone/gemfire/internal/statistics/StatisticsDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/statistics/StatisticsDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/statistics/StatisticsDUnitTest.java
index 7126c46..c038215 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/statistics/StatisticsDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/statistics/StatisticsDUnitTest.java
@@ -375,7 +375,7 @@ public class StatisticsDUnitTest extends CacheTestCase {
     });
     
     // validate pub values against sub values
-    final int totalUpdateEvents = sub.invokeInt(getClass(), "getUpdateEvents");
+    final int totalUpdateEvents = sub.invoke(() -> getUpdateEvents());
     
     // validate pub values against pub statistics against pub archive
     for (int i = 0; i < NUM_PUBS; i++) {
@@ -462,7 +462,7 @@ public class StatisticsDUnitTest extends CacheTestCase {
     int totalCombinedPuts = 0;
     for (int i = 0; i < NUM_PUBS; i++) {
       final int pubIdx = i;
-      final int totalPuts = pubs[pubIdx].invokeInt(getClass(), "getPuts");
+      final int totalPuts = pubs[pubIdx].invoke(() -> getPuts());
       assertEquals(MAX_PUTS * NUM_PUB_THREADS, totalPuts);
       totalCombinedPuts += totalPuts;
     }
@@ -537,15 +537,13 @@ public class StatisticsDUnitTest extends CacheTestCase {
       }
     });
     
-    final int updateEvents = sub.invokeInt(getClass(), "readIntStat", 
-        new Object[] {new File(subArchive), "PubSubStats", "updateEvents"});
+    final int updateEvents = sub.invoke(() -> readIntStat(new File(subArchive), "PubSubStats", "updateEvents"));
     assertTrue(updateEvents > 0);
     assertEquals(MAX_PUTS * NUM_PUB_THREADS * NUM_PUBS, updateEvents);
     
     int puts = 0;
     for (int pubVM = 0; pubVM < NUM_PUBS; pubVM++) {
-      int vmPuts = (int)pubs[pubVM].invokeInt(getClass(), "readIntStat", 
-          new Object[] {new File(pubArchives[pubVM]), "PubSubStats", "puts"});
+      int vmPuts = (int)pubs[pubVM].invoke(() -> readIntStat(new File(pubArchives[pubVM]), "PubSubStats", "puts"));
       assertTrue(vmPuts > 0);
       assertEquals(MAX_PUTS * NUM_PUB_THREADS, vmPuts);
       puts += vmPuts;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/69024aa9/gemfire-core/src/test/java/com/gemstone/gemfire/management/CacheManagementDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/management/CacheManagementDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/management/CacheManagementDUnitTest.java
index 320e20a..6ef2180 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/management/CacheManagementDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/management/CacheManagementDUnitTest.java
@@ -135,8 +135,7 @@ public class CacheManagementDUnitTest extends ManagementTestBase {
 
 
 
-      String log = (String) vm.invoke(CacheManagementDUnitTest.class,
-          "fetchLog");
+      String log = (String) vm.invoke(() -> CacheManagementDUnitTest.fetchLog());
       assertNotNull(log);
       LogWriterUtils.getLogWriter().info(
           "<ExpectedString> Log Of Member is " + log.toString()
@@ -144,11 +143,11 @@ public class CacheManagementDUnitTest extends ManagementTestBase {
 
      
 
-      vm.invoke(CacheManagementDUnitTest.class, "fetchJVMMetrics");
+      vm.invoke(() -> CacheManagementDUnitTest.fetchJVMMetrics());
 
-      vm.invoke(CacheManagementDUnitTest.class, "fetchOSMetrics");
+      vm.invoke(() -> CacheManagementDUnitTest.fetchOSMetrics());
 
-      vm.invoke(CacheManagementDUnitTest.class, "shutDownMember");
+      vm.invoke(() -> CacheManagementDUnitTest.shutDownMember());
 
     }
     
@@ -166,8 +165,7 @@ public class CacheManagementDUnitTest extends ManagementTestBase {
    */
   public void testMemberMBeanOpsRemote() throws Exception {
     initManagement(false);
-    getManagingNode().invoke(
-        CacheManagementDUnitTest.class, "invokeRemoteOps");
+    getManagingNode().invoke(() -> CacheManagementDUnitTest.invokeRemoteOps());
    }
 
   /**
@@ -191,7 +189,7 @@ public class CacheManagementDUnitTest extends ManagementTestBase {
     // Does not start the manager
     createManagementCache(managingNode);
     
-    node3.invoke(CacheManagementDUnitTest.class, "startManager");
+    node3.invoke(() -> CacheManagementDUnitTest.startManager());
 
     // Now start Managing node manager. System will have two Managers now which
     // should be OK
@@ -245,7 +243,7 @@ public class CacheManagementDUnitTest extends ManagementTestBase {
     // Does not start the manager
     createManagementCache(managingNode);
     
-    node3.invoke(CacheManagementDUnitTest.class, "startManager");
+    node3.invoke(() -> CacheManagementDUnitTest.startManager());
     
     closeCache(node3);
     validateServiceResource(node3);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/69024aa9/gemfire-core/src/test/java/com/gemstone/gemfire/management/ClientHealthStatsDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/management/ClientHealthStatsDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/management/ClientHealthStatsDUnitTest.java
index 9d42589..868073e 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/management/ClientHealthStatsDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/management/ClientHealthStatsDUnitTest.java
@@ -132,18 +132,18 @@ public class ClientHealthStatsDUnitTest extends DistributedTestCase {
     helper.createManagementCache(managingNode);
     helper.startManagingNode(managingNode);
 
-    int port = (Integer) server.invoke(ClientHealthStatsDUnitTest.class, "createServerCache");
+    int port = (Integer) server.invoke(() -> ClientHealthStatsDUnitTest.createServerCache());
 
     DistributedMember serverMember = helper.getMember(server);
 
-    client.invoke(ClientHealthStatsDUnitTest.class, "createClientCache", new Object[] {server.getHost(), port, 1, true, false});
+    client.invoke(() -> ClientHealthStatsDUnitTest.createClientCache(server.getHost(), port, 1, true, false));
     
-    client2.invoke(ClientHealthStatsDUnitTest.class, "createClientCache", new Object[] {server.getHost(), port, 2, true, false});
+    client2.invoke(() -> ClientHealthStatsDUnitTest.createClientCache(server.getHost(), port, 2, true, false));
 
-    client.invoke(ClientHealthStatsDUnitTest.class, "put");
-    client2.invoke(ClientHealthStatsDUnitTest.class, "put");
+    client.invoke(() -> ClientHealthStatsDUnitTest.put());
+    client2.invoke(() -> ClientHealthStatsDUnitTest.put());
     
-    managingNode.invoke(ClientHealthStatsDUnitTest.class, "verifyClientStats", new Object[] {serverMember, port, 2});
+    managingNode.invoke(() -> ClientHealthStatsDUnitTest.verifyClientStats(serverMember, port, 2));
     helper.stopManagingNode(managingNode);
   }
   
@@ -152,18 +152,18 @@ public class ClientHealthStatsDUnitTest extends DistributedTestCase {
     helper.createManagementCache(managingNode);
     helper.startManagingNode(managingNode);
 
-    int port = (Integer) server.invoke(ClientHealthStatsDUnitTest.class, "createServerCache");
+    int port = (Integer) server.invoke(() -> ClientHealthStatsDUnitTest.createServerCache());
 
     DistributedMember serverMember = helper.getMember(server);
 
-    client.invoke(ClientHealthStatsDUnitTest.class, "createClientCache", new Object[] {server.getHost(), port, 1, false, false});
+    client.invoke(() -> ClientHealthStatsDUnitTest.createClientCache(server.getHost(), port, 1, false, false));
     
-    client2.invoke(ClientHealthStatsDUnitTest.class, "createClientCache", new Object[] {server.getHost(), port, 2, false, false});
+    client2.invoke(() -> ClientHealthStatsDUnitTest.createClientCache(server.getHost(), port, 2, false, false));
 
-    client.invoke(ClientHealthStatsDUnitTest.class, "put");
-    client2.invoke(ClientHealthStatsDUnitTest.class, "put");
+    client.invoke(() -> ClientHealthStatsDUnitTest.put());
+    client2.invoke(() -> ClientHealthStatsDUnitTest.put());
     
-    managingNode.invoke(ClientHealthStatsDUnitTest.class, "verifyClientStats", new Object[] {serverMember, port, 0});
+    managingNode.invoke(() -> ClientHealthStatsDUnitTest.verifyClientStats(serverMember, port, 0));
     helper.stopManagingNode(managingNode);
   }
   
@@ -172,42 +172,42 @@ public class ClientHealthStatsDUnitTest extends DistributedTestCase {
     helper.createManagementCache(managingNode);
     helper.startManagingNode(managingNode);
 
-    int port = (Integer) server.invoke(ClientHealthStatsDUnitTest.class, "createServerCache");
+    int port = (Integer) server.invoke(() -> ClientHealthStatsDUnitTest.createServerCache());
 
     DistributedMember serverMember = helper.getMember(server);
 
-    client.invoke(ClientHealthStatsDUnitTest.class, "createClientCache", new Object[] {server.getHost(), port, 1, true, true});
+    client.invoke(() -> ClientHealthStatsDUnitTest.createClientCache(server.getHost(), port, 1, true, true));
     
-    client2.invoke(ClientHealthStatsDUnitTest.class, "createClientCache", new Object[] {server.getHost(), port, 2, true, true});
+    client2.invoke(() -> ClientHealthStatsDUnitTest.createClientCache(server.getHost(), port, 2, true, true));
 
-    client.invoke(ClientHealthStatsDUnitTest.class, "put");
-    client2.invoke(ClientHealthStatsDUnitTest.class, "put");
+    client.invoke(() -> ClientHealthStatsDUnitTest.put());
+    client2.invoke(() -> ClientHealthStatsDUnitTest.put());
     
-    client.invoke(ClientHealthStatsDUnitTest.class, "closeClientCache");
+    client.invoke(() -> ClientHealthStatsDUnitTest.closeClientCache());
     
-    client2.invoke(ClientHealthStatsDUnitTest.class, "closeClientCache");
+    client2.invoke(() -> ClientHealthStatsDUnitTest.closeClientCache());
     
-    managingNode.invoke(ClientHealthStatsDUnitTest.class, "verifyClientStats", new Object[] {serverMember, port, 2});
+    managingNode.invoke(() -> ClientHealthStatsDUnitTest.verifyClientStats(serverMember, port, 2));
     helper.stopManagingNode(managingNode);
   }
   
   public void testStatsMatchWithSize() throws Exception {
     // start a server
-    int port = (Integer) server.invoke(ClientHealthStatsDUnitTest.class, "createServerCache");
+    int port = (Integer) server.invoke(() -> ClientHealthStatsDUnitTest.createServerCache());
     // create durable client, with durable RI
-    client.invoke(ClientHealthStatsDUnitTest.class, "createClientCache", new Object[] {server.getHost(), port, 1, true, false});
+    client.invoke(() -> ClientHealthStatsDUnitTest.createClientCache(server.getHost(), port, 1, true, false));
     // do puts on server from three different threads, pause after 500 puts each.
-    server.invoke(ClientHealthStatsDUnitTest.class, "doPuts");
+    server.invoke(() -> ClientHealthStatsDUnitTest.doPuts());
     // close durable client
-    client.invoke(ClientHealthStatsDUnitTest.class, "closeClientCache");
+    client.invoke(() -> ClientHealthStatsDUnitTest.closeClientCache());
     // resume puts on server, add another 100.
-    server.invokeAsync(ClientHealthStatsDUnitTest.class, "resumePuts");
+    server.invokeAsync(() -> ClientHealthStatsDUnitTest.resumePuts());
     // start durable client
-    client.invoke(ClientHealthStatsDUnitTest.class, "createClientCache", new Object[] {server.getHost(), port, 1, true, false});
+    client.invoke(() -> ClientHealthStatsDUnitTest.createClientCache(server.getHost(), port, 1, true, false));
     // wait for full queue dispatch
-    client.invoke(ClientHealthStatsDUnitTest.class, "waitForLastKey");
+    client.invoke(() -> ClientHealthStatsDUnitTest.waitForLastKey());
     // verify the stats
-    server.invoke(ClientHealthStatsDUnitTest.class, "verifyStats",new Object[] {port});
+    server.invoke(() -> ClientHealthStatsDUnitTest.verifyStats(port));
   }
   
   public static int createServerCache() throws Exception {


Mime
View raw message