geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From upthewatersp...@apache.org
Subject [3/3] incubator-geode git commit: Extracting common lambdas from methods to avoid "Code to large" error
Date Wed, 17 Feb 2016 00:41:11 GMT
Extracting common lambdas from methods to avoid "Code to large" error

After converting these tests to use lambdas, it appears that the large
number of lambdas are overflowing some limit of the compiler. By
extracting methods for common lambdas, the overall number of lambda
classes required is reduced for these tests.


Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/0804a139
Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/0804a139
Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/0804a139

Branch: refs/heads/feature/GEODE-866
Commit: 0804a1396588116caed281d2ce7303ec39aa8df1
Parents: 51c03a9
Author: Dan Smith <upthewaterspout@apache.org>
Authored: Tue Feb 16 16:36:52 2016 -0800
Committer: Dan Smith <upthewaterspout@apache.org>
Committed: Tue Feb 16 16:38:29 2016 -0800

----------------------------------------------------------------------
 .../asyncqueue/AsyncEventListenerDUnitTest.java | 511 ++++++------
 .../cache/wan/misc/WanValidationsDUnitTest.java | 262 +++---
 ...ersistenceEnabledGatewaySenderDUnitTest.java | 824 ++++++++++---------
 .../ParallelWANPropagationDUnitTest.java        | 639 +++++++-------
 .../serial/SerialWANPropogationDUnitTest.java   | 277 +++----
 5 files changed, 1207 insertions(+), 1306 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/0804a139/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/asyncqueue/AsyncEventListenerDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/asyncqueue/AsyncEventListenerDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/asyncqueue/AsyncEventListenerDUnitTest.java
index f5ed32b..fdc9ea9 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/asyncqueue/AsyncEventListenerDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/asyncqueue/AsyncEventListenerDUnitTest.java
@@ -33,6 +33,7 @@ import com.gemstone.gemfire.distributed.internal.InternalDistributedSystem;
 import com.gemstone.gemfire.internal.AvailablePortHelper;
 import com.gemstone.gemfire.internal.cache.wan.AsyncEventQueueTestBase;
 import com.gemstone.gemfire.test.dunit.LogWriterUtils;
+import com.gemstone.gemfire.test.dunit.SerializableRunnableIF;
 import com.gemstone.gemfire.test.dunit.Wait;
 
 public class AsyncEventListenerDUnitTest extends AsyncEventQueueTestBase {
@@ -73,7 +74,7 @@ public class AsyncEventListenerDUnitTest extends AsyncEventQueueTestBase {
   public void testSerialAsyncEventQueueAttributes() {
     Integer lnPort = (Integer)vm0.invoke(() -> AsyncEventQueueTestBase.createFirstLocatorWithDSId( 1 ));
 
-    vm4.invoke(() -> AsyncEventQueueTestBase.createCache( lnPort ));
+    vm4.invoke(createCacheRunnable(lnPort));
 
     vm4.invoke(() -> AsyncEventQueueTestBase.createAsyncEventQueue( "ln",
         false, 100, 150, true, true, "testDS", true ));
@@ -84,33 +85,29 @@ public class AsyncEventListenerDUnitTest extends AsyncEventQueueTestBase {
   public void testSerialAsyncEventQueueSize() {
     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(createCacheRunnable(lnPort));
+    vm5.invoke(createCacheRunnable(lnPort));
+    vm6.invoke(createCacheRunnable(lnPort));
+    vm7.invoke(createCacheRunnable(lnPort));
 
-    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(createAsyncEventQueueRunnable());
+    vm5.invoke(createAsyncEventQueueRunnable());
+    vm6.invoke(createAsyncEventQueueRunnable());
+    vm7.invoke(createAsyncEventQueueRunnable());
 
-    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(createReplicatedRegionRunnable());
+    vm5.invoke(createReplicatedRegionRunnable());
+    vm6.invoke(createReplicatedRegionRunnable());
+    vm7.invoke(createReplicatedRegionRunnable());
 
     vm4
-        .invoke(() -> AsyncEventQueueTestBase.pauseAsyncEventQueue( "ln" ));
+        .invoke(pauseAsyncEventQueueRunnable());
     vm5
-        .invoke(() -> AsyncEventQueueTestBase.pauseAsyncEventQueue( "ln" ));
+        .invoke(pauseAsyncEventQueueRunnable());
     vm6
-        .invoke(() -> AsyncEventQueueTestBase.pauseAsyncEventQueue( "ln" ));
+        .invoke(pauseAsyncEventQueueRunnable());
     vm7
-        .invoke(() -> AsyncEventQueueTestBase.pauseAsyncEventQueue( "ln" ));
+        .invoke(pauseAsyncEventQueueRunnable());
     Wait.pause(1000);// pause at least for the batchTimeInterval
 
     vm4.invoke(() -> AsyncEventQueueTestBase.doPuts( getTestMethodName() + "_RR",
@@ -121,6 +118,23 @@ public class AsyncEventListenerDUnitTest extends AsyncEventQueueTestBase {
     assertEquals("Size of AsyncEventQueue is incorrect", 1000, vm4size);
     assertEquals("Size of AsyncEventQueue is incorrect", 1000, vm5size);
   }
+
+  protected SerializableRunnableIF pauseAsyncEventQueueRunnable() {
+    return () -> AsyncEventQueueTestBase.pauseAsyncEventQueue( "ln" );
+  }
+
+  protected SerializableRunnableIF createReplicatedRegionRunnable() {
+    return () -> AsyncEventQueueTestBase.createReplicatedRegionWithAsyncEventQueue( getTestMethodName() + "_RR", "ln", isOffHeap() );
+  }
+
+  protected SerializableRunnableIF createAsyncEventQueueRunnable() {
+    return () -> AsyncEventQueueTestBase.createAsyncEventQueue( "ln",
+        false, 100, 100, false, false, null, false );
+  }
+
+  protected SerializableRunnableIF createCacheRunnable(Integer lnPort) {
+    return () -> AsyncEventQueueTestBase.createCache( lnPort );
+  }
   
   /**
    * Added to reproduce defect #50366: 
@@ -129,25 +143,25 @@ public class AsyncEventListenerDUnitTest extends AsyncEventQueueTestBase {
   public void testConcurrentSerialAsyncEventQueueSize() {
 	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(createCacheRunnable(lnPort));
+	vm5.invoke(createCacheRunnable(lnPort));
+	vm6.invoke(createCacheRunnable(lnPort));
+	vm7.invoke(createCacheRunnable(lnPort));
 
     vm4.invoke(() -> AsyncEventQueueTestBase.createConcurrentAsyncEventQueue( "ln",
         false, 100, 150, true, false, null, false, 2, OrderPolicy.KEY ));
     vm5.invoke(() -> AsyncEventQueueTestBase.createConcurrentAsyncEventQueue( "ln",
         false, 100, 150, true, false, null, false, 2, 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(createReplicatedRegionRunnable());
+	vm5.invoke(createReplicatedRegionRunnable());
+	vm6.invoke(createReplicatedRegionRunnable());
+	vm7.invoke(createReplicatedRegionRunnable());
 
 	vm4
-	  .invoke(() -> AsyncEventQueueTestBase.pauseAsyncEventQueue( "ln" ));
+	  .invoke(pauseAsyncEventQueueRunnable());
 	vm5
-	  .invoke(() -> AsyncEventQueueTestBase.pauseAsyncEventQueue( "ln" ));
+	  .invoke(pauseAsyncEventQueueRunnable());
 
 	Wait.pause(1000);// pause at least for the batchTimeInterval
 
@@ -170,24 +184,20 @@ public class AsyncEventListenerDUnitTest extends AsyncEventQueueTestBase {
   public void testReplicatedSerialAsyncEventQueue() {
     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(createCacheRunnable(lnPort));
+    vm5.invoke(createCacheRunnable(lnPort));
+    vm6.invoke(createCacheRunnable(lnPort));
+    vm7.invoke(createCacheRunnable(lnPort));
 
-    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(createAsyncEventQueueRunnable());
+    vm5.invoke(createAsyncEventQueueRunnable());
+    vm6.invoke(createAsyncEventQueueRunnable());
+    vm7.invoke(createAsyncEventQueueRunnable());
 
-    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(createReplicatedRegionRunnable());
+    vm5.invoke(createReplicatedRegionRunnable());
+    vm6.invoke(createReplicatedRegionRunnable());
+    vm7.invoke(createReplicatedRegionRunnable());
 
     vm4.invoke(() -> AsyncEventQueueTestBase.doPuts( getTestMethodName() + "_RR",
         1000 ));
@@ -205,10 +215,10 @@ public class AsyncEventListenerDUnitTest extends AsyncEventQueueTestBase {
   public void testReplicatedSerialAsyncEventQueueWithCacheLoader() {
     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(createCacheRunnable(lnPort));
+    vm5.invoke(createCacheRunnable(lnPort));
+    vm6.invoke(createCacheRunnable(lnPort));
+    vm7.invoke(createCacheRunnable(lnPort));
 
     vm4.invoke(() -> AsyncEventQueueTestBase.createAsyncEventQueue( "ln",
         false, 100, 100, false, false, null, false, "MyAsyncEventListener_CacheLoader" ));
@@ -248,10 +258,10 @@ public class AsyncEventListenerDUnitTest extends AsyncEventQueueTestBase {
   public void testReplicatedSerialAsyncEventQueue_ExceptionScenario() {
     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(createCacheRunnable(lnPort));
+    vm5.invoke(createCacheRunnable(lnPort));
+    vm6.invoke(createCacheRunnable(lnPort));
+    vm7.invoke(createCacheRunnable(lnPort));
 
     vm4.invoke(() -> AsyncEventQueueTestBase.createAsyncEventQueueWithCustomListener( "ln",
         false, 100, 100, false, false, null, false, 1 ));
@@ -262,19 +272,19 @@ public class AsyncEventListenerDUnitTest extends AsyncEventQueueTestBase {
     vm7.invoke(() -> AsyncEventQueueTestBase.createAsyncEventQueueWithCustomListener( "ln",
         false, 100, 100, false, false, null, false, 1 ));
 
-    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(createReplicatedRegionRunnable());
+    vm5.invoke(createReplicatedRegionRunnable());
+    vm6.invoke(createReplicatedRegionRunnable());
+    vm7.invoke(createReplicatedRegionRunnable());
     
     vm4
-        .invoke(() -> AsyncEventQueueTestBase.pauseAsyncEventQueue( "ln" ));
+        .invoke(pauseAsyncEventQueueRunnable());
     vm5
-        .invoke(() -> AsyncEventQueueTestBase.pauseAsyncEventQueue( "ln" ));
+        .invoke(pauseAsyncEventQueueRunnable());
     vm6
-        .invoke(() -> AsyncEventQueueTestBase.pauseAsyncEventQueue( "ln" ));
+        .invoke(pauseAsyncEventQueueRunnable());
     vm7
-        .invoke(() -> AsyncEventQueueTestBase.pauseAsyncEventQueue( "ln" ));
+        .invoke(pauseAsyncEventQueueRunnable());
     Wait.pause(2000);// pause at least for the batchTimeInterval
 
     vm4.invoke(() -> AsyncEventQueueTestBase.doPuts( getTestMethodName() + "_RR",
@@ -300,10 +310,10 @@ public class AsyncEventListenerDUnitTest extends AsyncEventQueueTestBase {
   public void testReplicatedSerialAsyncEventQueueWithConflationEnabled() {
     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(createCacheRunnable(lnPort));
+    vm5.invoke(createCacheRunnable(lnPort));
+    vm6.invoke(createCacheRunnable(lnPort));
+    vm7.invoke(createCacheRunnable(lnPort));
 
     vm4.invoke(() -> AsyncEventQueueTestBase.createAsyncEventQueue( "ln",
         false, 100, 100, true, false, null, false ));
@@ -314,19 +324,19 @@ public class AsyncEventListenerDUnitTest extends AsyncEventQueueTestBase {
     vm7.invoke(() -> AsyncEventQueueTestBase.createAsyncEventQueue( "ln",
         false, 100, 100, true, false, null, false ));
 
-    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(createReplicatedRegionRunnable());
+    vm5.invoke(createReplicatedRegionRunnable());
+    vm6.invoke(createReplicatedRegionRunnable());
+    vm7.invoke(createReplicatedRegionRunnable());
 
     vm4
-        .invoke(() -> AsyncEventQueueTestBase.pauseAsyncEventQueue( "ln" ));
+        .invoke(pauseAsyncEventQueueRunnable());
     vm5
-        .invoke(() -> AsyncEventQueueTestBase.pauseAsyncEventQueue( "ln" ));
+        .invoke(pauseAsyncEventQueueRunnable());
     vm6
-        .invoke(() -> AsyncEventQueueTestBase.pauseAsyncEventQueue( "ln" ));
+        .invoke(pauseAsyncEventQueueRunnable());
     vm7
-        .invoke(() -> AsyncEventQueueTestBase.pauseAsyncEventQueue( "ln" ));
+        .invoke(pauseAsyncEventQueueRunnable());
     Wait.pause(1000);// pause at least for the batchTimeInterval
 
     final Map keyValues = new HashMap();
@@ -391,19 +401,15 @@ public class AsyncEventListenerDUnitTest extends AsyncEventQueueTestBase {
     vm6.invoke(() -> AsyncEventQueueTestBase.createCacheWithoutLocator( mPort ));
     vm7.invoke(() -> AsyncEventQueueTestBase.createCacheWithoutLocator( mPort ));
 
-    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(createAsyncEventQueueRunnable());
+    vm5.invoke(createAsyncEventQueueRunnable());
+    vm6.invoke(createAsyncEventQueueRunnable());
+    vm7.invoke(createAsyncEventQueueRunnable());
 
-    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(createReplicatedRegionRunnable());
+    vm5.invoke(createReplicatedRegionRunnable());
+    vm6.invoke(createReplicatedRegionRunnable());
+    vm7.invoke(createReplicatedRegionRunnable());
 
     vm4.invoke(() -> AsyncEventQueueTestBase.doPuts( getTestMethodName() + "_RR",
         1000 ));
@@ -426,10 +432,10 @@ public class AsyncEventListenerDUnitTest extends AsyncEventQueueTestBase {
   public void testReplicatedSerialAsyncEventQueueWithPeristenceEnabled() {
     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(createCacheRunnable(lnPort));
+    vm5.invoke(createCacheRunnable(lnPort));
+    vm6.invoke(createCacheRunnable(lnPort));
+    vm7.invoke(createCacheRunnable(lnPort));
 
     vm4.invoke(() -> AsyncEventQueueTestBase.createAsyncEventQueue( "ln",
         false, 100, 100, true, false, null, false ));
@@ -440,10 +446,10 @@ public class AsyncEventListenerDUnitTest extends AsyncEventQueueTestBase {
     vm7.invoke(() -> AsyncEventQueueTestBase.createAsyncEventQueue( "ln",
         false, 100, 100, true, false, null, false ));
 
-    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(createReplicatedRegionRunnable());
+    vm5.invoke(createReplicatedRegionRunnable());
+    vm6.invoke(createReplicatedRegionRunnable());
+    vm7.invoke(createReplicatedRegionRunnable());
 
     vm4.invoke(() -> AsyncEventQueueTestBase.doPuts( getTestMethodName() + "_RR",
         1000 ));
@@ -466,19 +472,19 @@ public class AsyncEventListenerDUnitTest extends AsyncEventQueueTestBase {
   public void DISABLED_testReplicatedSerialAsyncEventQueueWithPeristenceEnabled_Restart() {
     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(createCacheRunnable(lnPort));
+    vm5.invoke(createCacheRunnable(lnPort));
+    vm6.invoke(createCacheRunnable(lnPort));
+    vm7.invoke(createCacheRunnable(lnPort));
 
     String firstDStore = (String)vm4.invoke(() -> AsyncEventQueueTestBase.createAsyncEventQueueWithDiskStore( "ln", false, 100,
             100, true, null ));
 
-    vm4.invoke(() -> AsyncEventQueueTestBase.createReplicatedRegionWithAsyncEventQueue( getTestMethodName() + "_RR", "ln", isOffHeap() ));
+    vm4.invoke(createReplicatedRegionRunnable());
 
     // pause async channel and then do the puts
     vm4
-        .invoke(() -> AsyncEventQueueTestBase.pauseAsyncEventQueue( "ln" ));
+        .invoke(pauseAsyncEventQueueRunnable());
     vm4.invoke(() -> AsyncEventQueueTestBase.doPuts( getTestMethodName() + "_RR",
         1000 ));
 
@@ -486,9 +492,9 @@ public class AsyncEventListenerDUnitTest extends AsyncEventQueueTestBase {
     // ------------------------------------------
     vm4.invoke(() -> AsyncEventQueueTestBase.killSender());
 
-    vm4.invoke(() -> AsyncEventQueueTestBase.createCache( lnPort ));
+    vm4.invoke(createCacheRunnable(lnPort));
     vm4.invoke(() -> AsyncEventQueueTestBase.createAsyncEventQueueWithDiskStore( "ln", false, 100, 100, true, firstDStore ));
-    vm4.invoke(() -> AsyncEventQueueTestBase.createReplicatedRegionWithAsyncEventQueue( getTestMethodName() + "_RR", "ln", isOffHeap() ));
+    vm4.invoke(createReplicatedRegionRunnable());
     // -----------------------------------------------------------------------------------
 
     vm4.invoke(() -> AsyncEventQueueTestBase.validateAsyncEventListener( "ln", 1000 ));// primary sender
@@ -506,18 +512,18 @@ public class AsyncEventListenerDUnitTest extends AsyncEventQueueTestBase {
   public void DISABLED_testReplicatedSerialAsyncEventQueueWithPeristenceEnabled_Restart2() {
     Integer lnPort = (Integer)vm0.invoke(() -> AsyncEventQueueTestBase.createFirstLocatorWithDSId( 1 ));
 
-    vm4.invoke(() -> AsyncEventQueueTestBase.createCache( lnPort ));
-    vm5.invoke(() -> AsyncEventQueueTestBase.createCache( lnPort ));
-    vm6.invoke(() -> AsyncEventQueueTestBase.createCache( lnPort ));
+    vm4.invoke(createCacheRunnable(lnPort));
+    vm5.invoke(createCacheRunnable(lnPort));
+    vm6.invoke(createCacheRunnable(lnPort));
 
     vm4.invoke(() -> AsyncEventQueueTestBase.createAsyncEventQueueWithDiskStore( "ln", false, 100, 100, true, null ));
     vm5.invoke(() -> AsyncEventQueueTestBase.createAsyncEventQueueWithDiskStore( "ln", false, 100, 100, true, null ));
     vm6.invoke(() -> AsyncEventQueueTestBase.createAsyncEventQueueWithDiskStore( "ln", false, 100, 100, true, null ));
 
-    vm4.invoke(() -> AsyncEventQueueTestBase.createReplicatedRegionWithAsyncEventQueue( getTestMethodName() + "_RR", "ln", isOffHeap() ));
+    vm4.invoke(createReplicatedRegionRunnable());
     vm4.invoke(() -> AsyncEventQueueTestBase.addCacheListenerAndCloseCache( getTestMethodName() + "_RR" ));
-    vm5.invoke(() -> AsyncEventQueueTestBase.createReplicatedRegionWithAsyncEventQueue( getTestMethodName() + "_RR", "ln", isOffHeap() ));
-    vm6.invoke(() -> AsyncEventQueueTestBase.createReplicatedRegionWithAsyncEventQueue( getTestMethodName() + "_RR", "ln", isOffHeap() ));
+    vm5.invoke(createReplicatedRegionRunnable());
+    vm6.invoke(createReplicatedRegionRunnable());
 
     vm5.invoke(() -> AsyncEventQueueTestBase.doPuts( getTestMethodName() + "_RR", 2000 ));
 
@@ -549,10 +555,10 @@ public class AsyncEventListenerDUnitTest extends AsyncEventQueueTestBase {
   public void testConcurrentSerialAsyncEventQueueWithReplicatedRegion() {
     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(createCacheRunnable(lnPort));
+    vm5.invoke(createCacheRunnable(lnPort));
+    vm6.invoke(createCacheRunnable(lnPort));
+    vm7.invoke(createCacheRunnable(lnPort));
 
     vm4.invoke(() -> AsyncEventQueueTestBase.createConcurrentAsyncEventQueue( "ln",
         false, 100, 100, true, false, null, false, 3, OrderPolicy.KEY ));
@@ -563,10 +569,10 @@ public class AsyncEventListenerDUnitTest extends AsyncEventQueueTestBase {
     vm7.invoke(() -> AsyncEventQueueTestBase.createConcurrentAsyncEventQueue( "ln",
         false, 100, 100, 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(createReplicatedRegionRunnable());
+    vm5.invoke(createReplicatedRegionRunnable());
+    vm6.invoke(createReplicatedRegionRunnable());
+    vm7.invoke(createReplicatedRegionRunnable());
 
     vm4.invoke(() -> AsyncEventQueueTestBase.doPuts( getTestMethodName() + "_RR",
         1000 ));
@@ -587,10 +593,10 @@ public class AsyncEventListenerDUnitTest extends AsyncEventQueueTestBase {
   public void testConcurrentSerialAsyncEventQueueWithReplicatedRegion_2() {
     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(createCacheRunnable(lnPort));
+    vm5.invoke(createCacheRunnable(lnPort));
+    vm6.invoke(createCacheRunnable(lnPort));
+    vm7.invoke(createCacheRunnable(lnPort));
 
     vm4.invoke(() -> AsyncEventQueueTestBase.createConcurrentAsyncEventQueue( "ln",
         false, 100, 100, true, false, null, false, 3, OrderPolicy.THREAD ));
@@ -601,10 +607,10 @@ public class AsyncEventListenerDUnitTest extends AsyncEventQueueTestBase {
     vm7.invoke(() -> AsyncEventQueueTestBase.createConcurrentAsyncEventQueue( "ln",
         false, 100, 100, 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() ));
+    vm4.invoke(createReplicatedRegionRunnable());
+    vm5.invoke(createReplicatedRegionRunnable());
+    vm6.invoke(createReplicatedRegionRunnable());
+    vm7.invoke(createReplicatedRegionRunnable());
 
     vm4.invokeAsync(() -> AsyncEventQueueTestBase.doPuts( getTestMethodName() + "_RR",
         500 ));
@@ -627,10 +633,10 @@ public class AsyncEventListenerDUnitTest extends AsyncEventQueueTestBase {
   public void testConcurrentSerialAsyncEventQueueWithoutOrderPolicy() {
     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(createCacheRunnable(lnPort));
+    vm5.invoke(createCacheRunnable(lnPort));
+    vm6.invoke(createCacheRunnable(lnPort));
+    vm7.invoke(createCacheRunnable(lnPort));
 
     vm4.invoke(() -> AsyncEventQueueTestBase.createConcurrentAsyncEventQueue( "ln",
         false, 100, 100, true, false, null, false, 3, null ));
@@ -641,10 +647,10 @@ public class AsyncEventListenerDUnitTest extends AsyncEventQueueTestBase {
     vm7.invoke(() -> AsyncEventQueueTestBase.createConcurrentAsyncEventQueue( "ln",
         false, 100, 100, true, false, null, false, 3, null ));
 
-    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(createReplicatedRegionRunnable());
+    vm5.invoke(createReplicatedRegionRunnable());
+    vm6.invoke(createReplicatedRegionRunnable());
+    vm7.invoke(createReplicatedRegionRunnable());
 
     vm4.invoke(() -> AsyncEventQueueTestBase.doPuts( getTestMethodName() + "_RR",
         1000 ));
@@ -663,19 +669,15 @@ public class AsyncEventListenerDUnitTest extends AsyncEventQueueTestBase {
   public void testPartitionedSerialAsyncEventQueue() {
     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(createCacheRunnable(lnPort));
+    vm5.invoke(createCacheRunnable(lnPort));
+    vm6.invoke(createCacheRunnable(lnPort));
+    vm7.invoke(createCacheRunnable(lnPort));
 
-    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(createAsyncEventQueueRunnable());
+    vm5.invoke(createAsyncEventQueueRunnable());
+    vm6.invoke(createAsyncEventQueueRunnable());
+    vm7.invoke(createAsyncEventQueueRunnable());
 
     vm4.invoke(() -> AsyncEventQueueTestBase.createPartitionedRegionWithAsyncEventQueue( getTestMethodName() + "_PR", "ln", isOffHeap() ));
     vm5.invoke(() -> AsyncEventQueueTestBase.createPartitionedRegionWithAsyncEventQueue( getTestMethodName() + "_PR", "ln", isOffHeap() ));
@@ -701,10 +703,10 @@ public class AsyncEventListenerDUnitTest extends AsyncEventQueueTestBase {
   public void testPartitionedSerialAsyncEventQueueWithConflationEnabled() {
     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(createCacheRunnable(lnPort));
+    vm5.invoke(createCacheRunnable(lnPort));
+    vm6.invoke(createCacheRunnable(lnPort));
+    vm7.invoke(createCacheRunnable(lnPort));
 
     vm4.invoke(() -> AsyncEventQueueTestBase.createAsyncEventQueue( "ln",
         false, 100, 100, true, false, null, false ));
@@ -721,13 +723,13 @@ public class AsyncEventListenerDUnitTest extends AsyncEventQueueTestBase {
     vm7.invoke(() -> AsyncEventQueueTestBase.createPartitionedRegionWithAsyncEventQueue( getTestMethodName() + "_PR", "ln", isOffHeap() ));
 
     vm4
-        .invoke(() -> AsyncEventQueueTestBase.pauseAsyncEventQueue( "ln" ));
+        .invoke(pauseAsyncEventQueueRunnable());
     vm5
-        .invoke(() -> AsyncEventQueueTestBase.pauseAsyncEventQueue( "ln" ));
+        .invoke(pauseAsyncEventQueueRunnable());
     vm6
-        .invoke(() -> AsyncEventQueueTestBase.pauseAsyncEventQueue( "ln" ));
+        .invoke(pauseAsyncEventQueueRunnable());
     vm7
-        .invoke(() -> AsyncEventQueueTestBase.pauseAsyncEventQueue( "ln" ));
+        .invoke(pauseAsyncEventQueueRunnable());
     
     Wait.pause(2000);
 
@@ -785,10 +787,10 @@ public class AsyncEventListenerDUnitTest extends AsyncEventQueueTestBase {
   public void testPartitionedSerialAsyncEventQueueWithPeristenceEnabled() {
     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(createCacheRunnable(lnPort));
+    vm5.invoke(createCacheRunnable(lnPort));
+    vm6.invoke(createCacheRunnable(lnPort));
+    vm7.invoke(createCacheRunnable(lnPort));
 
     vm4.invoke(() -> AsyncEventQueueTestBase.createAsyncEventQueue( "ln",
         false, 100, 100, false, true, null, false ));
@@ -825,10 +827,10 @@ public class AsyncEventListenerDUnitTest extends AsyncEventQueueTestBase {
   public void testPartitionedSerialAsyncEventQueueWithPeristenceEnabled_Restart() {
     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(createCacheRunnable(lnPort));
+    vm5.invoke(createCacheRunnable(lnPort));
+    vm6.invoke(createCacheRunnable(lnPort));
+    vm7.invoke(createCacheRunnable(lnPort));
 
     String firstDStore = (String)vm4.invoke(() -> AsyncEventQueueTestBase.createAsyncEventQueueWithDiskStore( "ln", false, 100,
             100, true, null ));
@@ -846,7 +848,7 @@ public class AsyncEventListenerDUnitTest extends AsyncEventQueueTestBase {
     // ------------------------------------------
     vm4.invoke(() -> AsyncEventQueueTestBase.killSender());
 
-    vm4.invoke(() -> AsyncEventQueueTestBase.createCache( lnPort ));
+    vm4.invoke(createCacheRunnable(lnPort));
     vm4.invoke(() -> AsyncEventQueueTestBase.createAsyncEventQueueWithDiskStore( "ln", false, 100, 100, true, firstDStore ));
     vm4.invoke(() -> AsyncEventQueueTestBase.createPartitionedRegionWithAsyncEventQueue( getTestMethodName() + "_PR", "ln", isOffHeap() ));
     // -----------------------------------------------------------------------------------
@@ -858,10 +860,10 @@ public class AsyncEventListenerDUnitTest extends AsyncEventQueueTestBase {
     try {
       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(createCacheRunnable(lnPort));
+      vm5.invoke(createCacheRunnable(lnPort));
+      vm6.invoke(createCacheRunnable(lnPort));
+      vm7.invoke(createCacheRunnable(lnPort));
 
       vm4.invoke(() -> AsyncEventQueueTestBase.createAsyncEventQueue(
           "ln", true, 100, 100, true, false, null, false ));
@@ -872,8 +874,7 @@ public class AsyncEventListenerDUnitTest extends AsyncEventQueueTestBase {
       vm7.invoke(() -> AsyncEventQueueTestBase.createAsyncEventQueue(
           "ln", true, 100, 100, true, false, null, false ));
 
-      vm4.invoke(() -> AsyncEventQueueTestBase.createReplicatedRegionWithAsyncEventQueue(
-              getTestMethodName() + "_RR", "ln", isOffHeap() ));
+      vm4.invoke(createReplicatedRegionRunnable());
       fail("Expected GatewaySenderConfigException where parallel async event queue can not be used with replicated region");
     }
     catch (Exception e) {
@@ -887,10 +888,10 @@ public class AsyncEventListenerDUnitTest extends AsyncEventQueueTestBase {
   public void testParallelAsyncEventQueue() {
     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(createCacheRunnable(lnPort));
+    vm5.invoke(createCacheRunnable(lnPort));
+    vm6.invoke(createCacheRunnable(lnPort));
+    vm7.invoke(createCacheRunnable(lnPort));
 
     vm4.invoke(() -> AsyncEventQueueTestBase.createAsyncEventQueue( "ln",
         true, 100, 100, false, false, null, false ));
@@ -929,10 +930,10 @@ public class AsyncEventListenerDUnitTest extends AsyncEventQueueTestBase {
   public void testParallelAsyncEventQueueWithCacheLoader() {
     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(createCacheRunnable(lnPort));
+    vm5.invoke(createCacheRunnable(lnPort));
+    vm6.invoke(createCacheRunnable(lnPort));
+    vm7.invoke(createCacheRunnable(lnPort));
 
     vm4.invoke(() -> AsyncEventQueueTestBase.createAsyncEventQueue( "ln",
     	true, 100, 100, false, false, null, false, "MyAsyncEventListener_CacheLoader" ));
@@ -959,10 +960,10 @@ public class AsyncEventListenerDUnitTest extends AsyncEventQueueTestBase {
   public void testParallelAsyncEventQueueSize() {
     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(createCacheRunnable(lnPort));
+    vm5.invoke(createCacheRunnable(lnPort));
+    vm6.invoke(createCacheRunnable(lnPort));
+    vm7.invoke(createCacheRunnable(lnPort));
 
     vm4.invoke(() -> AsyncEventQueueTestBase.createAsyncEventQueue( "ln",
         true, 100, 100, false, false, null, false ));
@@ -979,13 +980,13 @@ public class AsyncEventListenerDUnitTest extends AsyncEventQueueTestBase {
     vm7.invoke(() -> AsyncEventQueueTestBase.createPartitionedRegionWithAsyncEventQueue( getTestMethodName() + "_PR", "ln", isOffHeap() ));
 
     vm4
-        .invoke(() -> AsyncEventQueueTestBase.pauseAsyncEventQueue( "ln" ));
+        .invoke(pauseAsyncEventQueueRunnable());
     vm5
-        .invoke(() -> AsyncEventQueueTestBase.pauseAsyncEventQueue( "ln" ));
+        .invoke(pauseAsyncEventQueueRunnable());
     vm6
-        .invoke(() -> AsyncEventQueueTestBase.pauseAsyncEventQueue( "ln" ));
+        .invoke(pauseAsyncEventQueueRunnable());
     vm7
-        .invoke(() -> AsyncEventQueueTestBase.pauseAsyncEventQueue( "ln" ));
+        .invoke(pauseAsyncEventQueueRunnable());
     Wait.pause(1000);// pause at least for the batchTimeInterval
 
     vm4.invoke(() -> AsyncEventQueueTestBase.doPuts( getTestMethodName() + "_PR",
@@ -1005,10 +1006,10 @@ public class AsyncEventListenerDUnitTest extends AsyncEventQueueTestBase {
   public void testConcurrentParallelAsyncEventQueueSize() {
 	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(createCacheRunnable(lnPort));
+	vm5.invoke(createCacheRunnable(lnPort));
+	vm6.invoke(createCacheRunnable(lnPort));
+	vm7.invoke(createCacheRunnable(lnPort));
 
 	vm4.invoke(() -> AsyncEventQueueTestBase.createConcurrentAsyncEventQueue( "ln",
 	  true, 100, 100, false, false, null, false, 2, OrderPolicy.KEY ));
@@ -1025,13 +1026,13 @@ public class AsyncEventListenerDUnitTest extends AsyncEventQueueTestBase {
 	vm7.invoke(() -> AsyncEventQueueTestBase.createPartitionedRegionWithAsyncEventQueue( getTestMethodName() + "_PR", "ln", isOffHeap() ));
 
 	vm4
-	  .invoke(() -> AsyncEventQueueTestBase.pauseAsyncEventQueue( "ln" ));
+	  .invoke(pauseAsyncEventQueueRunnable());
 	vm5
-	  .invoke(() -> AsyncEventQueueTestBase.pauseAsyncEventQueue( "ln" ));
+	  .invoke(pauseAsyncEventQueueRunnable());
 	vm6
-	  .invoke(() -> AsyncEventQueueTestBase.pauseAsyncEventQueue( "ln" ));
+	  .invoke(pauseAsyncEventQueueRunnable());
 	vm7
-	  .invoke(() -> AsyncEventQueueTestBase.pauseAsyncEventQueue( "ln" ));
+	  .invoke(pauseAsyncEventQueueRunnable());
 	Wait.pause(1000);// pause at least for the batchTimeInterval
 
 	vm4.invoke(() -> AsyncEventQueueTestBase.doPuts( getTestMethodName() + "_PR",
@@ -1047,10 +1048,10 @@ public class AsyncEventListenerDUnitTest extends AsyncEventQueueTestBase {
   public void testParallelAsyncEventQueueWithConflationEnabled() {
     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(createCacheRunnable(lnPort));
+    vm5.invoke(createCacheRunnable(lnPort));
+    vm6.invoke(createCacheRunnable(lnPort));
+    vm7.invoke(createCacheRunnable(lnPort));
 
     vm4.invoke(() -> AsyncEventQueueTestBase.createAsyncEventQueue( "ln",
         true, 100, 100, true, false, null, false ));
@@ -1067,13 +1068,13 @@ public class AsyncEventListenerDUnitTest extends AsyncEventQueueTestBase {
     vm7.invoke(() -> AsyncEventQueueTestBase.createPartitionedRegionWithAsyncEventQueue( getTestMethodName() + "_PR", "ln", isOffHeap() ));
 
     vm4
-        .invoke(() -> AsyncEventQueueTestBase.pauseAsyncEventQueue( "ln" ));
+        .invoke(pauseAsyncEventQueueRunnable());
     vm5
-        .invoke(() -> AsyncEventQueueTestBase.pauseAsyncEventQueue( "ln" ));
+        .invoke(pauseAsyncEventQueueRunnable());
     vm6
-        .invoke(() -> AsyncEventQueueTestBase.pauseAsyncEventQueue( "ln" ));
+        .invoke(pauseAsyncEventQueueRunnable());
     vm7
-        .invoke(() -> AsyncEventQueueTestBase.pauseAsyncEventQueue( "ln" ));
+        .invoke(pauseAsyncEventQueueRunnable());
 
     Wait.pause(2000);// pause for the batchTimeInterval to ensure that all the
     // senders are paused
@@ -1131,10 +1132,10 @@ public class AsyncEventListenerDUnitTest extends AsyncEventQueueTestBase {
   public void testParallelAsyncEventQueueWithConflationEnabled_bug47213() {
     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(createCacheRunnable(lnPort));
+    vm5.invoke(createCacheRunnable(lnPort));
+    vm6.invoke(createCacheRunnable(lnPort));
+    vm7.invoke(createCacheRunnable(lnPort));
 
     vm4.invoke(() -> AsyncEventQueueTestBase.createAsyncEventQueue( "ln",
         true, 100, 100, true, false, null, false ));
@@ -1151,13 +1152,13 @@ public class AsyncEventListenerDUnitTest extends AsyncEventQueueTestBase {
     vm7.invoke(() -> AsyncEventQueueTestBase.createPRWithRedundantCopyWithAsyncEventQueue( getTestMethodName() + "_PR", "ln", isOffHeap() ));
 
     vm4
-        .invoke(() -> AsyncEventQueueTestBase.pauseAsyncEventQueue( "ln" ));
+        .invoke(pauseAsyncEventQueueRunnable());
     vm5
-        .invoke(() -> AsyncEventQueueTestBase.pauseAsyncEventQueue( "ln" ));
+        .invoke(pauseAsyncEventQueueRunnable());
     vm6
-        .invoke(() -> AsyncEventQueueTestBase.pauseAsyncEventQueue( "ln" ));
+        .invoke(pauseAsyncEventQueueRunnable());
     vm7
-        .invoke(() -> AsyncEventQueueTestBase.pauseAsyncEventQueue( "ln" ));
+        .invoke(pauseAsyncEventQueueRunnable());
 
     Wait.pause(2000);// pause for the batchTimeInterval to ensure that all the
     // senders are paused
@@ -1212,11 +1213,11 @@ public class AsyncEventListenerDUnitTest extends AsyncEventQueueTestBase {
   public void testParallelAsyncEventQueueWithOneAccessor() {
     Integer lnPort = (Integer)vm0.invoke(() -> AsyncEventQueueTestBase.createFirstLocatorWithDSId( 1 ));
 
-    vm3.invoke(() -> AsyncEventQueueTestBase.createCache( lnPort ));
-    vm4.invoke(() -> AsyncEventQueueTestBase.createCache( lnPort ));
-    vm5.invoke(() -> AsyncEventQueueTestBase.createCache( lnPort ));
-    vm6.invoke(() -> AsyncEventQueueTestBase.createCache( lnPort ));
-    vm7.invoke(() -> AsyncEventQueueTestBase.createCache( lnPort ));
+    vm3.invoke(createCacheRunnable(lnPort));
+    vm4.invoke(createCacheRunnable(lnPort));
+    vm5.invoke(createCacheRunnable(lnPort));
+    vm6.invoke(createCacheRunnable(lnPort));
+    vm7.invoke(createCacheRunnable(lnPort));
 
     vm3.invoke(() -> AsyncEventQueueTestBase.createAsyncEventQueue( "ln",
         true, 100, 100, false, false, null, false ));
@@ -1258,10 +1259,10 @@ public class AsyncEventListenerDUnitTest extends AsyncEventQueueTestBase {
   public void testParallelAsyncEventQueueWithPersistence() {
     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(createCacheRunnable(lnPort));
+    vm5.invoke(createCacheRunnable(lnPort));
+    vm6.invoke(createCacheRunnable(lnPort));
+    vm7.invoke(createCacheRunnable(lnPort));
 
     vm4.invoke(() -> AsyncEventQueueTestBase.createAsyncEventQueue( "ln",
         true, 100, 100, false, true, null, false ));
@@ -1293,52 +1294,6 @@ public class AsyncEventListenerDUnitTest extends AsyncEventQueueTestBase {
     assertEquals(vm4size + vm5size + vm6size + vm7size, 256);
   }
   
-  /**
-   * Below test is disabled intentionally Replicated region with Parallel Async
-   * Event queue is not supported. Test is added for the same
-   * testParallelAsyncEventQueueWithReplicatedRegion
-   * 
-   * We are gone support this configuration in upcoming releases
-   */
-  
-  public void DISABLED_DUETO_BUG51491_testReplicatedParallelAsyncEventQueue() {
-    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.createAsyncEventQueue( "ln",
-        true, 100, 100, false, false, null, false ));
-    vm5.invoke(() -> AsyncEventQueueTestBase.createAsyncEventQueue( "ln",
-        true, 100, 100, false, false, null, false ));
-    vm6.invoke(() -> AsyncEventQueueTestBase.createAsyncEventQueue( "ln",
-        true, 100, 100, false, false, null, false ));
-    vm7.invoke(() -> AsyncEventQueueTestBase.createAsyncEventQueue( "ln",
-        true, 100, 100, false, false, null, false ));
-
-    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",
-        1000 ));
-
-    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(vm4size + vm5size + vm6size + vm7size, 1000);
-  }
-  
 /**
  * Test case to test possibleDuplicates. vm4 & vm5 are hosting the PR. vm5 is
  * killed so the buckets hosted by it are shifted to vm4.
@@ -1346,8 +1301,8 @@ public class AsyncEventListenerDUnitTest extends AsyncEventQueueTestBase {
   @Ignore("Disabled for 52349")
   public void DISABLED_testParallelAsyncEventQueueHA_Scenario1() {
     Integer lnPort = (Integer)vm0.invoke(() -> AsyncEventQueueTestBase.createFirstLocatorWithDSId( 1 ));
-    vm4.invoke(() -> AsyncEventQueueTestBase.createCache( lnPort ));
-    vm5.invoke(() -> AsyncEventQueueTestBase.createCache( lnPort ));
+    vm4.invoke(createCacheRunnable(lnPort));
+    vm5.invoke(createCacheRunnable(lnPort));
 
     LogWriterUtils.getLogWriter().info("Created the cache");
 
@@ -1364,9 +1319,9 @@ public class AsyncEventListenerDUnitTest extends AsyncEventQueueTestBase {
     LogWriterUtils.getLogWriter().info("Created PR with AsyncEventQueue");
 
     vm4
-        .invoke(() -> AsyncEventQueueTestBase.pauseAsyncEventQueue( "ln" ));
+        .invoke(pauseAsyncEventQueueRunnable());
     vm5
-        .invoke(() -> AsyncEventQueueTestBase.pauseAsyncEventQueue( "ln" ));
+        .invoke(pauseAsyncEventQueueRunnable());
     Wait.pause(1000);// pause for the batchTimeInterval to make sure the AsyncQueue
                 // is paused
 
@@ -1399,8 +1354,8 @@ public class AsyncEventListenerDUnitTest extends AsyncEventQueueTestBase {
   public void testParallelAsyncEventQueueHA_Scenario2() {
     Integer lnPort = (Integer)vm0.invoke(() -> AsyncEventQueueTestBase.createFirstLocatorWithDSId( 1 ));
 
-    vm4.invoke(() -> AsyncEventQueueTestBase.createCache( lnPort ));
-    vm5.invoke(() -> AsyncEventQueueTestBase.createCache( lnPort ));
+    vm4.invoke(createCacheRunnable(lnPort));
+    vm5.invoke(createCacheRunnable(lnPort));
 
     LogWriterUtils.getLogWriter().info("Created the cache");
 
@@ -1417,9 +1372,9 @@ public class AsyncEventListenerDUnitTest extends AsyncEventQueueTestBase {
     LogWriterUtils.getLogWriter().info("Created PR with AsyncEventQueue");
 
     vm4
-        .invoke(() -> AsyncEventQueueTestBase.pauseAsyncEventQueue( "ln" ));
+        .invoke(pauseAsyncEventQueueRunnable());
     vm5
-        .invoke(() -> AsyncEventQueueTestBase.pauseAsyncEventQueue( "ln" ));
+        .invoke(pauseAsyncEventQueueRunnable());
     Wait.pause(1000);// pause for the batchTimeInterval to make sure the AsyncQueue
                 // is paused
 
@@ -1437,7 +1392,7 @@ public class AsyncEventListenerDUnitTest extends AsyncEventQueueTestBase {
     // ----------------------------------------------------------------
 
     // ---------------------------- start vm6 --------------------------
-    vm6.invoke(() -> AsyncEventQueueTestBase.createCache( lnPort ));
+    vm6.invoke(createCacheRunnable(lnPort));
     vm6.invoke(() -> AsyncEventQueueTestBase.createAsyncEventQueueWithListener2( "ln", true, 100, 5, false, null ));
     vm6.invoke(() -> AsyncEventQueueTestBase.createPRWithRedundantCopyWithAsyncEventQueue(
             getTestMethodName() + "_PR", "ln", isOffHeap() ));
@@ -1465,8 +1420,8 @@ public class AsyncEventListenerDUnitTest extends AsyncEventQueueTestBase {
   public void testParallelAsyncEventQueueHA_Scenario3() {
     Integer lnPort = (Integer)vm0.invoke(() -> AsyncEventQueueTestBase.createFirstLocatorWithDSId( 1 ));
 
-    vm4.invoke(() -> AsyncEventQueueTestBase.createCache( lnPort ));
-    vm5.invoke(() -> AsyncEventQueueTestBase.createCache( lnPort ));
+    vm4.invoke(createCacheRunnable(lnPort));
+    vm5.invoke(createCacheRunnable(lnPort));
 
     LogWriterUtils.getLogWriter().info("Created the cache");
 
@@ -1483,9 +1438,9 @@ public class AsyncEventListenerDUnitTest extends AsyncEventQueueTestBase {
     LogWriterUtils.getLogWriter().info("Created PR with AsyncEventQueue");
 
     vm4
-        .invoke(() -> AsyncEventQueueTestBase.pauseAsyncEventQueue( "ln" ));
+        .invoke(pauseAsyncEventQueueRunnable());
     vm5
-        .invoke(() -> AsyncEventQueueTestBase.pauseAsyncEventQueue( "ln" ));
+        .invoke(pauseAsyncEventQueueRunnable());
     Wait.pause(1000);// pause for the batchTimeInterval to make sure the AsyncQueue
                 // is paused
 
@@ -1496,7 +1451,7 @@ public class AsyncEventListenerDUnitTest extends AsyncEventQueueTestBase {
     LogWriterUtils.getLogWriter().info("Done puts");
 
     // ---------------------------- start vm6 --------------------------
-    vm6.invoke(() -> AsyncEventQueueTestBase.createCache( lnPort ));
+    vm6.invoke(createCacheRunnable(lnPort));
     vm6.invoke(() -> AsyncEventQueueTestBase.createAsyncEventQueueWithListener2( "ln", true, 100, 5, false, null ));
     vm6.invoke(() -> AsyncEventQueueTestBase.createPRWithRedundantCopyWithAsyncEventQueue(
             getTestMethodName() + "_PR", "ln", isOffHeap() ));
@@ -1524,7 +1479,7 @@ public class AsyncEventListenerDUnitTest extends AsyncEventQueueTestBase {
     Integer lnPort = (Integer)vm0.invoke(() -> AsyncEventQueueTestBase.createFirstLocatorWithDSId( 1 ));
 
     // create cache on node
-    vm3.invoke(() -> AsyncEventQueueTestBase.createCache( lnPort ));
+    vm3.invoke(createCacheRunnable(lnPort));
 
     // create AsyncEventQueue on node
     vm3.invoke(() -> AsyncEventQueueTestBase.createAsyncEventQueue( "ln", true, 100, 10, false, false, null, true ));

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/0804a139/gemfire-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/WanValidationsDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/WanValidationsDUnitTest.java b/gemfire-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/WanValidationsDUnitTest.java
index 88696fe..3d0c01b 100644
--- a/gemfire-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/WanValidationsDUnitTest.java
+++ b/gemfire-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/WanValidationsDUnitTest.java
@@ -33,6 +33,7 @@ import com.gemstone.gemfire.internal.cache.wan.MyGatewayTransportFilter4;
 import com.gemstone.gemfire.internal.cache.wan.WANTestBase;
 import com.gemstone.gemfire.test.dunit.Assert;
 import com.gemstone.gemfire.test.dunit.IgnoredException;
+import com.gemstone.gemfire.test.dunit.SerializableRunnableIF;
 
 public class WanValidationsDUnitTest extends WANTestBase {
 
@@ -62,8 +63,8 @@ public class WanValidationsDUnitTest extends WANTestBase {
       Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId(1));
       Integer nyPort = (Integer)vm1.invoke(() -> WANTestBase.createFirstRemoteLocator(2, lnPort));
       
-      vm4.invoke(() -> WANTestBase.createCache(lnPort ));
-      vm5.invoke(() -> WANTestBase.createCache(lnPort ));
+      vm4.invoke(createCacheRunnable(lnPort));
+      vm5.invoke(createCacheRunnable(lnPort));
 
       vm4.invoke(() -> WANTestBase.createSender("ln1", 2, false, 10, 100, false, false, null, true));
       vm4.invoke(() -> WANTestBase.createSender("ln2", 2, false, 10, 100, false, false, null, true));
@@ -88,6 +89,10 @@ public class WanValidationsDUnitTest extends WANTestBase {
     }
   }
 
+  protected SerializableRunnableIF createCacheRunnable(Integer lnPort) {
+    return () -> WANTestBase.createCache(lnPort );
+  }
+
   /**
    * Validate that ParallelGatewaySender can be added to Distributed region
    * 
@@ -106,8 +111,8 @@ public class WanValidationsDUnitTest extends WANTestBase {
       Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 ));
       Integer nyPort = (Integer)vm1.invoke(() -> WANTestBase.createFirstRemoteLocator( 2, lnPort ));
 
-      vm4.invoke(() -> WANTestBase.createCache( lnPort ));
-      vm5.invoke(() -> WANTestBase.createCache( lnPort ));
+      vm4.invoke(createCacheRunnable(lnPort));
+      vm5.invoke(createCacheRunnable(lnPort));
 
       vm4.invoke(() -> WANTestBase.createSender( "ln1", 2,
           true, 10, 100, false, false, null, false ));
@@ -137,8 +142,8 @@ public class WanValidationsDUnitTest extends WANTestBase {
     try {
       Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId(1));
 
-      vm4.invoke(() -> WANTestBase.createCache(lnPort ));
-      vm5.invoke(() -> WANTestBase.createCache(lnPort ));
+      vm4.invoke(createCacheRunnable(lnPort));
+      vm5.invoke(createCacheRunnable(lnPort));
       
       vm4.invoke(() -> WANTestBase.createSender("ln1", 2, false, 10, 100, false, false, null, true));
       vm4.invoke(() -> WANTestBase.createSender("ln2", 2, false, 10, 100, false, false, null, true));
@@ -168,8 +173,8 @@ public class WanValidationsDUnitTest extends WANTestBase {
     try {
       Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 ));
 
-      vm4.invoke(() -> WANTestBase.createCache( lnPort ));
-      vm5.invoke(() -> WANTestBase.createCache( lnPort ));
+      vm4.invoke(createCacheRunnable(lnPort));
+      vm5.invoke(createCacheRunnable(lnPort));
 
       vm4.invoke(() -> WANTestBase.createReplicatedRegionWithAsyncEventQueue(
               getTestMethodName() + "_RR", "ln1", isOffHeap()  ));
@@ -197,8 +202,8 @@ public class WanValidationsDUnitTest extends WANTestBase {
     try {
       Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId(1));
 
-      vm4.invoke(() -> WANTestBase.createCache(lnPort ));
-      vm5.invoke(() -> WANTestBase.createCache(lnPort ));
+      vm4.invoke(createCacheRunnable(lnPort));
+      vm5.invoke(createCacheRunnable(lnPort));
       
       vm4.invoke(() -> WANTestBase.createSender("ln1", 2, true, 10, 100, false, false, null, true));
       vm4.invoke(() -> WANTestBase.createSender("ln2", 2, true, 10, 100, false, false, null, true));
@@ -234,7 +239,7 @@ public class WanValidationsDUnitTest extends WANTestBase {
     try {
       Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 ));
 
-      vm1.invoke(() -> WANTestBase.createCache( lnPort ));
+      vm1.invoke(createCacheRunnable(lnPort));
       
       vm1.invoke(() -> WANTestBase.createSender("ln1_Parallel", 2, true, 10, 100, false, false, null, true));
       vm1.invoke(() -> WANTestBase.createSender("ln2_Parallel", 2, true, 10, 100, false, false, null, true));
@@ -260,7 +265,7 @@ public class WanValidationsDUnitTest extends WANTestBase {
     try {
       Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 ));
 
-      vm1.invoke(() -> WANTestBase.createCache( lnPort ));
+      vm1.invoke(createCacheRunnable(lnPort));
       
       vm1.invoke(() -> WANTestBase.createSender("ln1_Parallel", 2, true, 10, 100, false, false, null, true));
       vm1.invoke(() -> WANTestBase.createSender("ln2_Parallel", 2, true, 10, 100, false, false, null, true));
@@ -294,7 +299,7 @@ public class WanValidationsDUnitTest extends WANTestBase {
     try {
       Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 ));
 
-      vm1.invoke(() -> WANTestBase.createCache( lnPort ));
+      vm1.invoke(createCacheRunnable(lnPort));
       
       vm1.invoke(() -> WANTestBase.createSender("ln1_Parallel", 2, true, 10, 100, false, false, null, true));
       vm1.invoke(() -> WANTestBase.createSender("ln2_Parallel", 2, true, 10, 100, false, false, null, true));
@@ -321,7 +326,7 @@ public class WanValidationsDUnitTest extends WANTestBase {
     try {
       Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 ));
 
-      vm1.invoke(() -> WANTestBase.createCache( lnPort ));
+      vm1.invoke(createCacheRunnable(lnPort));
 
       vm1.invoke(() -> WANTestBase.createSender(
           "ln1_Parallel", 2, true, 10, 100, false, false, null, true ));
@@ -349,7 +354,7 @@ public class WanValidationsDUnitTest extends WANTestBase {
     try {
       Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 ));
 
-      vm1.invoke(() -> WANTestBase.createCache( lnPort ));
+      vm1.invoke(createCacheRunnable(lnPort));
 
       vm1.invoke(() -> WANTestBase.createSender("ln1_Parallel", 2, true, 10, 100, false, false, null, true));
       vm1.invoke(() -> WANTestBase.createSender("ln2_Parallel", 2, true, 10, 100, false, false, null, true));
@@ -378,7 +383,7 @@ public class WanValidationsDUnitTest extends WANTestBase {
   public void testSerialGatewaySenderAndParallelGatewaySenderWithSameName() {
     Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 ));
 
-    vm1.invoke(() -> WANTestBase.createCache( lnPort ));
+    vm1.invoke(createCacheRunnable(lnPort));
 
     vm1.invoke(() -> WANTestBase.createSenderForValidations(
         "ln", 2, false, 100, false, false, null, null, true, false ));
@@ -399,8 +404,8 @@ public class WanValidationsDUnitTest extends WANTestBase {
   public void testSameRemoteDSAcrossSameSender() {
     Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 ));
 
-    vm1.invoke(() -> WANTestBase.createCache( lnPort ));
-    vm2.invoke(() -> WANTestBase.createCache( lnPort ));
+    vm1.invoke(createCacheRunnable(lnPort));
+    vm2.invoke(createCacheRunnable(lnPort));
 
     vm1.invoke(() -> WANTestBase.createSenderForValidations(
         "ln", 2, false, 100, false, false, null, null,
@@ -425,8 +430,8 @@ public class WanValidationsDUnitTest extends WANTestBase {
   public void testSerialSenderOnBothCache() {
     Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 ));
 
-    vm1.invoke(() -> WANTestBase.createCache( lnPort ));
-    vm2.invoke(() -> WANTestBase.createCache( lnPort ));
+    vm1.invoke(createCacheRunnable(lnPort));
+    vm2.invoke(createCacheRunnable(lnPort));
 
     vm1.invoke(() -> WANTestBase.createSenderForValidations(
         "ln", 2, false, 100, false, false, null, null,
@@ -450,8 +455,8 @@ public class WanValidationsDUnitTest extends WANTestBase {
   public void testParallelSenderOnBothCache(){
     Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId(1));
 
-    vm1.invoke(() -> WANTestBase.createCache( lnPort ));
-    vm2.invoke(() -> WANTestBase.createCache( lnPort ));
+    vm1.invoke(createCacheRunnable(lnPort));
+    vm2.invoke(createCacheRunnable(lnPort));
 
     vm1.invoke(() -> WANTestBase.createSenderForValidations( "ln", 2,
         true, 100,false, false,
@@ -476,8 +481,8 @@ public class WanValidationsDUnitTest extends WANTestBase {
   public void testBatchConflation() {
     Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 ));
 
-    vm1.invoke(() -> WANTestBase.createCache( lnPort ));
-    vm2.invoke(() -> WANTestBase.createCache( lnPort ));
+    vm1.invoke(createCacheRunnable(lnPort));
+    vm2.invoke(createCacheRunnable(lnPort));
 
     vm1.invoke(() -> WANTestBase.createSenderForValidations( "ln", 2,
         false, 100, false, false,
@@ -502,8 +507,8 @@ public class WanValidationsDUnitTest extends WANTestBase {
   public void testisPersistentEnabled() {
     Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 ));
 
-    vm1.invoke(() -> WANTestBase.createCache( lnPort ));
-    vm2.invoke(() -> WANTestBase.createCache( lnPort ));
+    vm1.invoke(createCacheRunnable(lnPort));
+    vm2.invoke(createCacheRunnable(lnPort));
 
     vm1.invoke(() -> WANTestBase.createSenderForValidations( "ln", 2,
         false, 100, false, false,
@@ -524,8 +529,8 @@ public class WanValidationsDUnitTest extends WANTestBase {
   public void testAlertThreshold() {
     Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 ));
 
-    vm1.invoke(() -> WANTestBase.createCache( lnPort ));
-    vm2.invoke(() -> WANTestBase.createCache( lnPort ));
+    vm1.invoke(createCacheRunnable(lnPort));
+    vm2.invoke(createCacheRunnable(lnPort));
 
     vm1.invoke(() -> WANTestBase.createSenderForValidations( "ln", 2,
         false, 100, false, false,
@@ -546,8 +551,8 @@ public class WanValidationsDUnitTest extends WANTestBase {
   public void testManualStart() {
     Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 ));
 
-    vm1.invoke(() -> WANTestBase.createCache( lnPort ));
-    vm2.invoke(() -> WANTestBase.createCache( lnPort ));
+    vm1.invoke(createCacheRunnable(lnPort));
+    vm2.invoke(createCacheRunnable(lnPort));
 
     vm1.invoke(() -> WANTestBase.createSenderForValidations( "ln", 2,
         false, 100, false, false,
@@ -568,8 +573,8 @@ public class WanValidationsDUnitTest extends WANTestBase {
   public void testGatewayEventFilters() {
     Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 ));
 
-    vm1.invoke(() -> WANTestBase.createCache( lnPort ));
-    vm2.invoke(() -> WANTestBase.createCache( lnPort ));
+    vm1.invoke(createCacheRunnable(lnPort));
+    vm2.invoke(createCacheRunnable(lnPort));
 
     ArrayList<GatewayEventFilter> eventFiletrs = new ArrayList<GatewayEventFilter>();
     eventFiletrs.add(new MyGatewayEventFilter());
@@ -596,8 +601,8 @@ public class WanValidationsDUnitTest extends WANTestBase {
   public void testGatewayEventFilters2() {
     Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 ));
 
-    vm1.invoke(() -> WANTestBase.createCache( lnPort ));
-    vm2.invoke(() -> WANTestBase.createCache( lnPort ));
+    vm1.invoke(createCacheRunnable(lnPort));
+    vm2.invoke(createCacheRunnable(lnPort));
 
     ArrayList<GatewayEventFilter> eventFiletrs = new ArrayList<GatewayEventFilter>();
     eventFiletrs.add(new MyGatewayEventFilter());
@@ -625,8 +630,8 @@ public class WanValidationsDUnitTest extends WANTestBase {
   public void testGatewayTransportFilters() {
     Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 ));
 
-    vm1.invoke(() -> WANTestBase.createCache( lnPort ));
-    vm2.invoke(() -> WANTestBase.createCache( lnPort ));
+    vm1.invoke(createCacheRunnable(lnPort));
+    vm2.invoke(createCacheRunnable(lnPort));
 
     ArrayList<GatewayTransportFilter> transportFiletrs = new ArrayList<GatewayTransportFilter>();
     transportFiletrs.add(new MyGatewayTransportFilter1());
@@ -655,8 +660,8 @@ public class WanValidationsDUnitTest extends WANTestBase {
   public void testGatewayTransportFiltersOrder() {
     Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 ));
 
-    vm1.invoke(() -> WANTestBase.createCache( lnPort ));
-    vm2.invoke(() -> WANTestBase.createCache( lnPort ));
+    vm1.invoke(createCacheRunnable(lnPort));
+    vm2.invoke(createCacheRunnable(lnPort));
 
     ArrayList<GatewayTransportFilter> transportFiletrs = new ArrayList<GatewayTransportFilter>();
     transportFiletrs.add(new MyGatewayTransportFilter1());
@@ -711,8 +716,8 @@ public class WanValidationsDUnitTest extends WANTestBase {
   public void testIsDiskSynchronous() {
     Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 ));
 
-    vm1.invoke(() -> WANTestBase.createCache( lnPort ));
-    vm2.invoke(() -> WANTestBase.createCache( lnPort ));
+    vm1.invoke(createCacheRunnable(lnPort));
+    vm2.invoke(createCacheRunnable(lnPort));
 
     vm1.invoke(() -> WANTestBase.createSenderForValidations(
         "ln", 2, false, 100, false, false, null,
@@ -761,7 +766,7 @@ public class WanValidationsDUnitTest extends WANTestBase {
     Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 ));
     
     vm4.invoke(() -> WANTestBase.createReceiver( lnPort ));
-    vm5.invoke(() -> WANTestBase.createCache( lnPort ));
+    vm5.invoke(createCacheRunnable(lnPort));
     
     vm5.invoke(() -> WANTestBase.createCacheServer( ));
     
@@ -785,8 +790,8 @@ public class WanValidationsDUnitTest extends WANTestBase {
   public void DISABLED_testDispatcherThreadsForParallelGatewaySender() {
     Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 ));
 
-    vm1.invoke(() -> WANTestBase.createCache( lnPort ));
-    vm2.invoke(() -> WANTestBase.createCache( lnPort ));
+    vm1.invoke(createCacheRunnable(lnPort));
+    vm2.invoke(createCacheRunnable(lnPort));
 
     vm1.invoke(() -> WANTestBase.createConcurrentSender( "ln", 2,
       true, 100, 10, false, false, null, true, 5, OrderPolicy.KEY ));
@@ -815,8 +820,8 @@ public class WanValidationsDUnitTest extends WANTestBase {
   public void DISABLED_testOrderPolicyForParallelGatewaySender() {
     Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 ));
 
-    vm1.invoke(() -> WANTestBase.createCache( lnPort ));
-    vm2.invoke(() -> WANTestBase.createCache( lnPort ));
+    vm1.invoke(createCacheRunnable(lnPort));
+    vm2.invoke(createCacheRunnable(lnPort));
 
     vm1.invoke(() -> WANTestBase.createConcurrentSender( "ln", 2,
       true, 100, 10, false, false, null, true, 5, OrderPolicy.KEY ));
@@ -840,27 +845,22 @@ public class WanValidationsDUnitTest extends WANTestBase {
     Integer nyPort = (Integer)vm1.invoke(() -> WANTestBase.createFirstRemoteLocator( 2, lnPort ));
 
     vm2.invoke(() -> WANTestBase.createReceiver( nyPort ));
-    vm2.invoke(() -> WANTestBase.createReplicatedRegion(
-      getTestMethodName() + "_RR", null, isOffHeap() ));
+    vm2.invoke(createReceiverReplicatedRegion());
 
-    vm4.invoke(() -> WANTestBase.createCache( lnPort ));
-    vm5.invoke(() -> WANTestBase.createCache( lnPort ));
-    vm6.invoke(() -> WANTestBase.createCache( lnPort ));
-    vm7.invoke(() -> WANTestBase.createCache( lnPort ));
+    vm4.invoke(createCacheRunnable(lnPort));
+    vm5.invoke(createCacheRunnable(lnPort));
+    vm6.invoke(createCacheRunnable(lnPort));
+    vm7.invoke(createCacheRunnable(lnPort));
 
     vm4.invoke(() -> WANTestBase.createSender( "ln", 2,
         false, 100, 10, false, false, null, true ));
 
     vm4.invoke(() -> WANTestBase.startSender( "ln" ));
     
-    vm4.invoke(() -> WANTestBase.createReplicatedRegion(
-        getTestMethodName() + "_RR", null, isOffHeap() ));
-    vm5.invoke(() -> WANTestBase.createReplicatedRegion(
-      getTestMethodName() + "_RR", null, isOffHeap() ));
-    vm6.invoke(() -> WANTestBase.createReplicatedRegion(
-      getTestMethodName() + "_RR", null, isOffHeap() ));
-    vm7.invoke(() -> WANTestBase.createReplicatedRegion(
-      getTestMethodName() + "_RR", null, isOffHeap() ));
+    vm4.invoke(createReceiverReplicatedRegion());
+    vm5.invoke(createReceiverReplicatedRegion());
+    vm6.invoke(createReceiverReplicatedRegion());
+    vm7.invoke(createReceiverReplicatedRegion());
 
     vm4.invoke(() -> WANTestBase.addSenderThroughAttributesMutator(
       getTestMethodName() + "_RR", "ln"));
@@ -885,10 +885,10 @@ public class WanValidationsDUnitTest extends WANTestBase {
   public void testBug50434_RR_SerialAsyncEventQueue() throws Exception {
     Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 ));
 
-    vm4.invoke(() -> WANTestBase.createCache( lnPort ));
-    vm5.invoke(() -> WANTestBase.createCache( lnPort ));
-    vm6.invoke(() -> WANTestBase.createCache( lnPort ));
-    vm7.invoke(() -> WANTestBase.createCache( lnPort ));
+    vm4.invoke(createCacheRunnable(lnPort));
+    vm5.invoke(createCacheRunnable(lnPort));
+    vm6.invoke(createCacheRunnable(lnPort));
+    vm7.invoke(createCacheRunnable(lnPort));
 
     vm4.invoke(() -> WANTestBase.createAsyncEventQueue( "ln",
         false, 100, 100, false, false, null, false ));
@@ -899,14 +899,10 @@ public class WanValidationsDUnitTest extends WANTestBase {
     vm7.invoke(() -> WANTestBase.createAsyncEventQueue( "ln",
         false, 100, 100, false, false, null, false ));
 
-    vm4.invoke(() -> WANTestBase.createReplicatedRegion(
-        getTestMethodName() + "_RR", null, isOffHeap() ));
-    vm5.invoke(() -> WANTestBase.createReplicatedRegion(
-        getTestMethodName() + "_RR", null, isOffHeap() ));
-    vm6.invoke(() -> WANTestBase.createReplicatedRegion(
-        getTestMethodName() + "_RR", null, isOffHeap() ));
-    vm7.invoke(() -> WANTestBase.createReplicatedRegion(
-        getTestMethodName() + "_RR", null, isOffHeap() ));
+    vm4.invoke(createReceiverReplicatedRegion());
+    vm5.invoke(createReceiverReplicatedRegion());
+    vm6.invoke(createReceiverReplicatedRegion());
+    vm7.invoke(createReceiverReplicatedRegion());
 
     vm4.invoke(() -> WANTestBase.addAsyncEventQueueThroughAttributesMutator( getTestMethodName() + "_RR", "ln" ));
 
@@ -925,33 +921,33 @@ public class WanValidationsDUnitTest extends WANTestBase {
       }
     }
   }
+
+  protected SerializableRunnableIF createReceiverReplicatedRegion() {
+    return () -> WANTestBase.createReplicatedRegion(
+        getTestMethodName() + "_RR", null, isOffHeap() );
+  }
   
   public void testBug50434_RR_Serial_Pass() throws Exception {
     Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 ));
     Integer nyPort = (Integer)vm1.invoke(() -> WANTestBase.createFirstRemoteLocator( 2, lnPort ));
 
     vm2.invoke(() -> WANTestBase.createReceiver( nyPort ));
-    vm2.invoke(() -> WANTestBase.createReplicatedRegion(
-      getTestMethodName() + "_RR", null, isOffHeap() ));
+    vm2.invoke(createReceiverReplicatedRegion());
 
-    vm4.invoke(() -> WANTestBase.createCache( lnPort ));
-    vm5.invoke(() -> WANTestBase.createCache( lnPort ));
-    vm6.invoke(() -> WANTestBase.createCache( lnPort ));
-    vm7.invoke(() -> WANTestBase.createCache( lnPort ));
+    vm4.invoke(createCacheRunnable(lnPort));
+    vm5.invoke(createCacheRunnable(lnPort));
+    vm6.invoke(createCacheRunnable(lnPort));
+    vm7.invoke(createCacheRunnable(lnPort));
 
     vm4.invoke(() -> WANTestBase.createSender( "ln", 2,
         false, 100, 10, false, false, null, true ));
 
     vm4.invoke(() -> WANTestBase.startSender( "ln" ));
     
-    vm4.invoke(() -> WANTestBase.createReplicatedRegion(
-        getTestMethodName() + "_RR", null, isOffHeap() ));
-    vm5.invoke(() -> WANTestBase.createReplicatedRegion(
-      getTestMethodName() + "_RR", null, isOffHeap() ));
-    vm6.invoke(() -> WANTestBase.createReplicatedRegion(
-      getTestMethodName() + "_RR", null, isOffHeap() ));
-    vm7.invoke(() -> WANTestBase.createReplicatedRegion(
-      getTestMethodName() + "_RR", null, isOffHeap() ));
+    vm4.invoke(createReceiverReplicatedRegion());
+    vm5.invoke(createReceiverReplicatedRegion());
+    vm6.invoke(createReceiverReplicatedRegion());
+    vm7.invoke(createReceiverReplicatedRegion());
 
     vm4.invoke(() -> WANTestBase.addSenderThroughAttributesMutator(
       getTestMethodName() + "_RR", "ln"));
@@ -977,10 +973,10 @@ public class WanValidationsDUnitTest extends WANTestBase {
   public void testBug50434_RR_SerialAsyncEventQueue_Pass() throws Exception {
     Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 ));
 
-    vm4.invoke(() -> WANTestBase.createCache( lnPort ));
-    vm5.invoke(() -> WANTestBase.createCache( lnPort ));
-    vm6.invoke(() -> WANTestBase.createCache( lnPort ));
-    vm7.invoke(() -> WANTestBase.createCache( lnPort ));
+    vm4.invoke(createCacheRunnable(lnPort));
+    vm5.invoke(createCacheRunnable(lnPort));
+    vm6.invoke(createCacheRunnable(lnPort));
+    vm7.invoke(createCacheRunnable(lnPort));
 
     vm4.invoke(() -> WANTestBase.createAsyncEventQueue( "ln",
         false, 100, 100, false, false, null, false ));
@@ -991,14 +987,10 @@ public class WanValidationsDUnitTest extends WANTestBase {
     vm7.invoke(() -> WANTestBase.createAsyncEventQueue( "ln",
         false, 100, 100, false, false, null, false ));
 
-    vm4.invoke(() -> WANTestBase.createReplicatedRegion(
-        getTestMethodName() + "_RR", null, isOffHeap() ));
-    vm5.invoke(() -> WANTestBase.createReplicatedRegion(
-        getTestMethodName() + "_RR", null, isOffHeap() ));
-    vm6.invoke(() -> WANTestBase.createReplicatedRegion(
-        getTestMethodName() + "_RR", null, isOffHeap() ));
-    vm7.invoke(() -> WANTestBase.createReplicatedRegion(
-        getTestMethodName() + "_RR", null, isOffHeap() ));
+    vm4.invoke(createReceiverReplicatedRegion());
+    vm5.invoke(createReceiverReplicatedRegion());
+    vm6.invoke(createReceiverReplicatedRegion());
+    vm7.invoke(createReceiverReplicatedRegion());
 
     vm4.invoke(() -> WANTestBase.addAsyncEventQueueThroughAttributesMutator( getTestMethodName() + "_RR", "ln" ));
     vm5.invoke(() -> WANTestBase.addAsyncEventQueueThroughAttributesMutator( getTestMethodName() + "_RR", "ln" ));
@@ -1026,10 +1018,10 @@ public class WanValidationsDUnitTest extends WANTestBase {
     vm2.invoke(() -> WANTestBase.createPartitionedRegion(
       getTestMethodName() + "_RR", null, 1, 100, isOffHeap() ));
 
-    vm4.invoke(() -> WANTestBase.createCache( lnPort ));
-    vm5.invoke(() -> WANTestBase.createCache( lnPort ));
-    vm6.invoke(() -> WANTestBase.createCache( lnPort ));
-    vm7.invoke(() -> WANTestBase.createCache( lnPort ));
+    vm4.invoke(createCacheRunnable(lnPort));
+    vm5.invoke(createCacheRunnable(lnPort));
+    vm6.invoke(createCacheRunnable(lnPort));
+    vm7.invoke(createCacheRunnable(lnPort));
 
     vm4.invoke(() -> WANTestBase.createSender( "ln", 2,
         false, 100, 10, false, false, null, true ));
@@ -1079,10 +1071,10 @@ public class WanValidationsDUnitTest extends WANTestBase {
   public void testBug50434_PR_SerialAsyncEventQueue() throws Exception {
     Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 ));
 
-    vm4.invoke(() -> WANTestBase.createCache( lnPort ));
-    vm5.invoke(() -> WANTestBase.createCache( lnPort ));
-    vm6.invoke(() -> WANTestBase.createCache( lnPort ));
-    vm7.invoke(() -> WANTestBase.createCache( lnPort ));
+    vm4.invoke(createCacheRunnable(lnPort));
+    vm5.invoke(createCacheRunnable(lnPort));
+    vm6.invoke(createCacheRunnable(lnPort));
+    vm7.invoke(createCacheRunnable(lnPort));
 
     vm4.invoke(() -> WANTestBase.createAsyncEventQueue( "ln",
         false, 100, 100, false, false, null, false ));
@@ -1127,10 +1119,10 @@ public class WanValidationsDUnitTest extends WANTestBase {
     vm2.invoke(() -> WANTestBase.createPartitionedRegion(
       getTestMethodName() + "_PR", null, 1, 100, isOffHeap() ));
 
-    vm4.invoke(() -> WANTestBase.createCache( lnPort ));
-    vm5.invoke(() -> WANTestBase.createCache( lnPort ));
-    vm6.invoke(() -> WANTestBase.createCache( lnPort ));
-    vm7.invoke(() -> WANTestBase.createCache( lnPort ));
+    vm4.invoke(createCacheRunnable(lnPort));
+    vm5.invoke(createCacheRunnable(lnPort));
+    vm6.invoke(createCacheRunnable(lnPort));
+    vm7.invoke(createCacheRunnable(lnPort));
 
     vm4.invoke(() -> WANTestBase.createSender( "ln", 2,
         false, 100, 10, false, false, null, true ));
@@ -1179,10 +1171,10 @@ public class WanValidationsDUnitTest extends WANTestBase {
   public void testBug50434_PR_SerialAsyncEventQueue_Pass() throws Exception {
     Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 ));
 
-    vm4.invoke(() -> WANTestBase.createCache( lnPort ));
-    vm5.invoke(() -> WANTestBase.createCache( lnPort ));
-    vm6.invoke(() -> WANTestBase.createCache( lnPort ));
-    vm7.invoke(() -> WANTestBase.createCache( lnPort ));
+    vm4.invoke(createCacheRunnable(lnPort));
+    vm5.invoke(createCacheRunnable(lnPort));
+    vm6.invoke(createCacheRunnable(lnPort));
+    vm7.invoke(createCacheRunnable(lnPort));
 
     vm4.invoke(() -> WANTestBase.createAsyncEventQueue( "ln",
         false, 100, 100, false, false, null, false ));
@@ -1228,10 +1220,10 @@ public class WanValidationsDUnitTest extends WANTestBase {
     vm2.invoke(() -> WANTestBase.createPartitionedRegion(
       getTestMethodName() + "_PR", null, 1, 10, isOffHeap()));
 
-    vm4.invoke(() -> WANTestBase.createCache( lnPort ));
-    vm5.invoke(() -> WANTestBase.createCache( lnPort ));
-    vm6.invoke(() -> WANTestBase.createCache( lnPort ));
-    vm7.invoke(() -> WANTestBase.createCache( lnPort ));
+    vm4.invoke(createCacheRunnable(lnPort));
+    vm5.invoke(createCacheRunnable(lnPort));
+    vm6.invoke(createCacheRunnable(lnPort));
+    vm7.invoke(createCacheRunnable(lnPort));
 
     vm4.invoke(() -> WANTestBase.createSender( "ln", 2,
         true, 100, 10, false, false, null, true ));
@@ -1273,10 +1265,10 @@ public class WanValidationsDUnitTest extends WANTestBase {
   public void testBug50434_PR_ParallelAsyncEventQueue() throws Exception {
     Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 ));
 
-    vm4.invoke(() -> WANTestBase.createCache( lnPort ));
-    vm5.invoke(() -> WANTestBase.createCache( lnPort ));
-    vm6.invoke(() -> WANTestBase.createCache( lnPort ));
-    vm7.invoke(() -> WANTestBase.createCache( lnPort ));
+    vm4.invoke(createCacheRunnable(lnPort));
+    vm5.invoke(createCacheRunnable(lnPort));
+    vm6.invoke(createCacheRunnable(lnPort));
+    vm7.invoke(createCacheRunnable(lnPort));
 
     vm4.invoke(() -> WANTestBase.createAsyncEventQueue( "ln",
         true, 100, 100, false, false, null, false ));
@@ -1321,10 +1313,10 @@ public class WanValidationsDUnitTest extends WANTestBase {
     vm2.invoke(() -> WANTestBase.createPartitionedRegion(
       getTestMethodName() + "_PR", null, 1, 10, isOffHeap()));
 
-    vm4.invoke(() -> WANTestBase.createCache( lnPort ));
-    vm5.invoke(() -> WANTestBase.createCache( lnPort ));
-    vm6.invoke(() -> WANTestBase.createCache( lnPort ));
-    vm7.invoke(() -> WANTestBase.createCache( lnPort ));
+    vm4.invoke(createCacheRunnable(lnPort));
+    vm5.invoke(createCacheRunnable(lnPort));
+    vm6.invoke(createCacheRunnable(lnPort));
+    vm7.invoke(createCacheRunnable(lnPort));
 
     vm4.invoke(() -> WANTestBase.createSender( "ln", 2,
         true, 100, 10, false, false, null, true ));
@@ -1368,10 +1360,10 @@ public class WanValidationsDUnitTest extends WANTestBase {
   public void testBug50434_PR_ParallelAsyncEventQueue_Pass() throws Exception {
     Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 ));
 
-    vm4.invoke(() -> WANTestBase.createCache( lnPort ));
-    vm5.invoke(() -> WANTestBase.createCache( lnPort ));
-    vm6.invoke(() -> WANTestBase.createCache( lnPort ));
-    vm7.invoke(() -> WANTestBase.createCache( lnPort ));
+    vm4.invoke(createCacheRunnable(lnPort));
+    vm5.invoke(createCacheRunnable(lnPort));
+    vm6.invoke(createCacheRunnable(lnPort));
+    vm7.invoke(createCacheRunnable(lnPort));
 
     vm4.invoke(() -> WANTestBase.createAsyncEventQueue( "ln",
         true, 100, 100, false, false, null, false ));
@@ -1424,8 +1416,8 @@ public class WanValidationsDUnitTest extends WANTestBase {
     IgnoredException.addIgnoredException("could not get remote locator information");
     Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 ));
 
-    vm4.invoke(() -> WANTestBase.createCache( lnPort ));
-    vm5.invoke(() -> WANTestBase.createCache( lnPort ));
+    vm4.invoke(createCacheRunnable(lnPort));
+    vm5.invoke(createCacheRunnable(lnPort));
     
     try {
       vm4.invoke(() -> WANTestBase.createSender( "ln1", 2,
@@ -1471,10 +1463,10 @@ public class WanValidationsDUnitTest extends WANTestBase {
     Integer nyPort = (Integer)vm1.invoke(() -> WANTestBase.createFirstRemoteLocator( 2, lnPort ));
 
     // ------------ START - CREATE CACHE, REGION ON LOCAL SITE ------------//
-    vm4.invoke(() -> WANTestBase.createCache( lnPort ));
-    vm5.invoke(() -> WANTestBase.createCache( lnPort ));
-    vm6.invoke(() -> WANTestBase.createCache( lnPort ));
-    vm7.invoke(() -> WANTestBase.createCache( lnPort ));
+    vm4.invoke(createCacheRunnable(lnPort));
+    vm5.invoke(createCacheRunnable(lnPort));
+    vm6.invoke(createCacheRunnable(lnPort));
+    vm7.invoke(createCacheRunnable(lnPort));
 
     vm4.invoke(() -> WANTestBase.createSender( "ln", 2,
         false, 100, 10, false, false, null, true ));



Mime
View raw message