geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jasonhu...@apache.org
Subject [4/7] incubator-geode git commit: GEODE-1062: Refactor of WANTestBase
Date Fri, 01 Apr 2016 17:32:12 GMT
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/65d7a6f1/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/PDXNewWanDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/PDXNewWanDUnitTest.java b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/PDXNewWanDUnitTest.java
index dd9ab09..1782309 100644
--- a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/PDXNewWanDUnitTest.java
+++ b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/PDXNewWanDUnitTest.java
@@ -44,10 +44,10 @@ public class PDXNewWanDUnitTest extends WANTestBase{
   public void testWANPDX_RR_SerialSender() {
     Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 ));
     Integer nyPort = (Integer)vm1.invoke(() -> WANTestBase.createFirstRemoteLocator( 2, lnPort ));
-
+    createCacheInVMs(nyPort, vm2);
     vm2.invoke(() -> WANTestBase.createReceiver( nyPort ));
 
-    vm3.invoke(() -> WANTestBase.createCache( lnPort ));
+    createCacheInVMs(lnPort, vm3);
 
     vm3.invoke(() -> WANTestBase.createSender( "ln", 2,
         false, 100, 10, false, false, null, true ));
@@ -221,6 +221,9 @@ public class PDXNewWanDUnitTest extends WANTestBase{
     
     Integer tkPort = (Integer)vm2.invoke(() -> WANTestBase.createFirstRemoteLocator( 3, lnPort ));
 
+    createCacheInVMs(lnPort, vm3);
+    createCacheInVMs(nyPort, vm4);
+    createCacheInVMs(tkPort, vm5);
     vm3.invoke(() -> WANTestBase.createReceiver( lnPort ));
     vm4.invoke(() -> WANTestBase.createReceiver( nyPort ));
     vm5.invoke(() -> WANTestBase.createReceiver( tkPort ));
@@ -290,9 +293,10 @@ public class PDXNewWanDUnitTest extends WANTestBase{
     Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 ));
     Integer nyPort = (Integer)vm1.invoke(() -> WANTestBase.createFirstRemoteLocator( 2, lnPort ));
 
+    createCacheInVMs(nyPort, vm2);
     vm2.invoke(() -> WANTestBase.createReceiver( nyPort ));
 
-    vm3.invoke(() -> WANTestBase.createCache( lnPort ));
+    createCacheInVMs(lnPort, vm3);
 
     vm3.invoke(() -> WANTestBase.createSender( "ln", 2,
         false, 100, 10, false, false, null, true ));
@@ -330,15 +334,16 @@ public class PDXNewWanDUnitTest extends WANTestBase{
     Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 ));
     Integer nyPort = (Integer)vm1.invoke(() -> WANTestBase.createFirstRemoteLocator( 2, lnPort ));
 
+    createCacheInVMs(nyPort, vm2);
+    vm2.invoke(() -> WANTestBase.createPartitionedRegion(
+      getTestMethodName() + "_PR", null, 0, 2, isOffHeap() ));
     vm2.invoke(() -> WANTestBase.createReceiver( nyPort ));
 
-    vm3.invoke(() -> WANTestBase.createCache( lnPort ));
+    createCacheInVMs(lnPort, vm3);
 
     vm3.invoke(() -> WANTestBase.createSender( "ln", 2,
         false, 100, 10, false, false, null, true ));
 
-    vm2.invoke(() -> WANTestBase.createPartitionedRegion(
-        getTestMethodName() + "_PR", null, 0, 2, isOffHeap() ));
 
     vm3.invoke(() -> WANTestBase.startSender( "ln" ));
 
@@ -396,17 +401,16 @@ public class PDXNewWanDUnitTest extends WANTestBase{
     Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 ));
     Integer nyPort = (Integer)vm1.invoke(() -> WANTestBase.createFirstRemoteLocator( 2, lnPort ));
 
+    createCacheInVMs(nyPort, vm2);
+    vm2.invoke(() -> WANTestBase.createPartitionedRegion(
+      getTestMethodName() + "_PR", null,1, 5, isOffHeap() ));
     vm2.invoke(() -> WANTestBase.createReceiver( nyPort ));
 
-    vm3.invoke(() -> WANTestBase.createCache( lnPort ));
-    vm4.invoke(() -> WANTestBase.createCache( lnPort ));
-    
+    createCacheInVMs(lnPort, vm3, vm4);
+
     vm3.invoke(() -> WANTestBase.createSender( "ln", 2,
         false, 100, 10, false, false, null, true ));
 
-    vm2.invoke(() -> WANTestBase.createPartitionedRegion(
-        getTestMethodName() + "_PR", null,1, 5, isOffHeap() ));
-
     vm3.invoke(() -> WANTestBase.startSender( "ln" ));
 
     vm3.invoke(() -> WANTestBase.createPartitionedRegion(
@@ -468,6 +472,7 @@ public class PDXNewWanDUnitTest extends WANTestBase{
     Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 ));
     Integer nyPort = (Integer)vm1.invoke(() -> WANTestBase.createFirstRemoteLocator( 2, lnPort ));
 
+    createCacheInVMs(nyPort, vm2);
     vm2.invoke(() -> WANTestBase.createReceiver( nyPort ));
 
     vm3.invoke(() -> WANTestBase.createCache( lnPort ));
@@ -494,9 +499,12 @@ public class PDXNewWanDUnitTest extends WANTestBase{
     Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 ));
     Integer nyPort = (Integer)vm1.invoke(() -> WANTestBase.createFirstRemoteLocator( 2, lnPort ));
 
+    createCacheInVMs(nyPort, vm2);
+    vm2.invoke(() -> WANTestBase.createPartitionedRegion(
+      getTestMethodName() + "_PR", null, 0, 1, isOffHeap() ));
     vm2.invoke(() -> WANTestBase.createReceiver( nyPort ));
 
-    vm3.invoke(() -> WANTestBase.createCache( lnPort ));
+    createCacheInVMs(lnPort, vm3);
 
     vm3.invoke(() -> WANTestBase.createSender( "ln", 2, true,
         100, 10, false, false, null, true ));
@@ -504,16 +512,11 @@ public class PDXNewWanDUnitTest extends WANTestBase{
     vm3.invoke(() -> WANTestBase.createPartitionedRegion(
         getTestMethodName() + "_PR", "ln", 0, 1, isOffHeap() ));
 
-    vm3.invoke(() -> WANTestBase.unsetRemoveFromQueueOnException( "ln" ));
-
     vm3.invoke(() -> WANTestBase.startSender( "ln" ));
 
     vm3.invoke(() -> WANTestBase.doPutsPDXSerializable(
         getTestMethodName() + "_PR", 1 ));
 
-    vm2.invoke(() -> WANTestBase.createPartitionedRegion(
-        getTestMethodName() + "_PR", null, 0, 1, isOffHeap() ));
-
     vm2.invoke(() -> WANTestBase.validateRegionSize_PDX(
         getTestMethodName() + "_PR", 1 ));
   }
@@ -552,10 +555,10 @@ public class PDXNewWanDUnitTest extends WANTestBase{
     Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 ));
     Integer nyPort = (Integer)vm1.invoke(() -> WANTestBase.createFirstRemoteLocator( 2, lnPort ));
 
+    createCacheInVMs(nyPort, vm2);
     vm2.invoke(() -> WANTestBase.createReceiver( nyPort ));
 
-    vm3.invoke(() -> WANTestBase.createCache( lnPort ));
-    vm4.invoke(() -> WANTestBase.createCache( lnPort ));
+    createCacheInVMs(lnPort, vm3, vm4);
 
     vm3.invoke(() -> WANTestBase.createSender( "ln", 2,
         true, 100, 10, false, false, null, true ));
@@ -569,10 +572,9 @@ public class PDXNewWanDUnitTest extends WANTestBase{
       getTestMethodName() + "_PR", "ln", 0, 2, isOffHeap() ));
     vm4.invoke(() -> WANTestBase.createPartitionedRegion(
       getTestMethodName() + "_PR", "ln", 0, 2, isOffHeap() ));
-    
-    vm3.invoke(() -> WANTestBase.startSender( "ln" ));
-    vm4.invoke(() -> WANTestBase.startSender( "ln" ));
-    
+
+    startSenderInVMs("ln", vm3, vm4);
+
     vm3.invoke(() -> WANTestBase.doPutsPDXSerializable( getTestMethodName() + "_PR",
         10 ));
 
@@ -605,17 +607,8 @@ public class PDXNewWanDUnitTest extends WANTestBase{
     vm3.invoke(() -> WANTestBase.doPutsPDXSerializable( getTestMethodName() + "_PR",
         10 ));
 
-    AsyncInvocation inv1 = vm3.invokeAsync(() -> WANTestBase.startSender( "ln" ));
-    AsyncInvocation inv2 = vm4.invokeAsync(() -> WANTestBase.startSender( "ln" ));
-    
-    try{
-      inv1.join();
-      inv2.join();
-    }
-    catch(InterruptedException ie) {
-      fail("Caught interrupted exception");
-    }
-    
+    startSenderInVMsAsync("ln", vm3, vm4);
+
     vm4.invoke(() -> WANTestBase.doPutsPDXSerializable( getTestMethodName() + "_PR",
       40 ));
     
@@ -628,9 +621,10 @@ public class PDXNewWanDUnitTest extends WANTestBase{
     Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 ));
     Integer nyPort = (Integer)vm1.invoke(() -> WANTestBase.createFirstRemoteLocator( 2, lnPort ));
 
+    createCacheInVMs(nyPort, vm2);
     vm2.invoke(() -> WANTestBase.createReceiver( nyPort ));
 
-    vm3.invoke(() -> WANTestBase.createCache( lnPort ));
+    createCacheInVMs(lnPort, vm3);
 
     vm3.invoke(() -> WANTestBase.createSender( "ln", 2,
         false, 100, 10, false, false, new PDXGatewayEventFilter(), true ));
@@ -657,10 +651,10 @@ public class PDXNewWanDUnitTest extends WANTestBase{
     Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 ));
     Integer nyPort = (Integer)vm1.invoke(() -> WANTestBase.createFirstRemoteLocator( 2, lnPort ));
 
+    createCacheInVMs(nyPort, vm2);
     vm2.invoke(() -> WANTestBase.createReceiver( nyPort ));
 
-    vm3.invoke(() -> WANTestBase.createCache( lnPort ));
-    vm4.invoke(() -> WANTestBase.createCache( lnPort ));
+    createCacheInVMs(lnPort, vm3, vm4);
 
     vm3.invoke(() -> WANTestBase.createSender( "ln", 2,
         true, 100, 10, false, false, new PDXGatewayEventFilter(), true ));
@@ -674,10 +668,9 @@ public class PDXNewWanDUnitTest extends WANTestBase{
       getTestMethodName() + "_PR", "ln", 0, 2, isOffHeap() ));
     vm4.invoke(() -> WANTestBase.createPartitionedRegion(
       getTestMethodName() + "_PR", "ln", 0, 2, isOffHeap() ));
-    
-    vm3.invoke(() -> WANTestBase.startSender( "ln" ));
-    vm4.invoke(() -> WANTestBase.startSender( "ln" ));
-    
+
+    startSenderInVMs("ln", vm3, vm4);
+
     vm3.invoke(() -> WANTestBase.doPutsPDXSerializable( getTestMethodName() + "_PR",
         10 ));
 
@@ -697,9 +690,10 @@ public class PDXNewWanDUnitTest extends WANTestBase{
     Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 ));
     Integer nyPort = (Integer)vm1.invoke(() -> WANTestBase.createFirstRemoteLocator( 2, lnPort ));
 
+    createCacheInVMs(nyPort, vm2);
     vm2.invoke(() -> WANTestBase.createReceiver( nyPort ));
 
-    vm3.invoke(() -> WANTestBase.createCache( lnPort ));
+    createCacheInVMs(lnPort, vm3);
 
     vm3.invoke(() -> WANTestBase.createSender( "ln", 2,
         false, 100, 10, false, false, null, true ));
@@ -719,10 +713,9 @@ public class PDXNewWanDUnitTest extends WANTestBase{
         getTestMethodName() + "_PR", 1 ));
     
     vm2.invoke(() -> WANTestBase.killSender());
-    
-    vm2.invoke(() -> WANTestBase.createReceiver( nyPort ));
-    vm4.invoke(() -> WANTestBase.createReceiver( nyPort ));
-    
+
+    createReceiverInVMs(nyPort, vm2, vm4);
+
     vm2.invoke(() -> WANTestBase.createPartitionedRegion(
       getTestMethodName() + "_PR", null, 1, 2, isOffHeap() ));
     vm4.invoke(() -> WANTestBase.createPartitionedRegion(

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/65d7a6f1/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/ReplicatedRegion_ParallelWANPersistenceDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/ReplicatedRegion_ParallelWANPersistenceDUnitTest.java b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/ReplicatedRegion_ParallelWANPersistenceDUnitTest.java
index 8ad8a46..b0a14af 100644
--- a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/ReplicatedRegion_ParallelWANPersistenceDUnitTest.java
+++ b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/ReplicatedRegion_ParallelWANPersistenceDUnitTest.java
@@ -51,8 +51,8 @@ public class ReplicatedRegion_ParallelWANPersistenceDUnitTest extends WANTestBas
     Integer nyPort = (Integer)vm1.invoke(() -> WANTestBase.createFirstRemoteLocator( 2, lnPort ));
 
     //create receiver on remote site
-    vm2.invoke(() -> WANTestBase.createReceiver( nyPort ));
-    vm3.invoke(() -> WANTestBase.createReceiver( nyPort ));
+    createCacheInVMs(nyPort, vm2, vm3);
+    createReceiverInVMs(nyPort, vm2, vm3);
 
     vm2.invoke(() -> WANTestBase.createReplicatedRegion(
       getTestMethodName() + "_RR", null, isOffHeap() ));
@@ -60,10 +60,7 @@ public class ReplicatedRegion_ParallelWANPersistenceDUnitTest extends WANTestBas
       getTestMethodName() + "_RR", null, isOffHeap() ));
     
     //create cache in local site
-    vm4.invoke(() -> WANTestBase.createCache( lnPort ));
-    vm5.invoke(() -> WANTestBase.createCache( lnPort ));
-    vm6.invoke(() -> WANTestBase.createCache( lnPort ));
-    vm7.invoke(() -> WANTestBase.createCache( lnPort ));
+    createCacheInVMs(lnPort, vm4, vm5, vm6, vm7);
 
     //create senders with disk store
     String diskStore1 = (String) vm4.invoke(() -> WANTestBase.createSenderWithDiskStore( "ln", 2, true, 100, 10, false, true, null, null, true ));
@@ -82,11 +79,8 @@ public class ReplicatedRegion_ParallelWANPersistenceDUnitTest extends WANTestBas
     vm7.invoke(() -> WANTestBase.createReplicatedRegion(
       getTestMethodName() + "_RR", "ln", isOffHeap() ));
 
-    vm4.invoke(() -> WANTestBase.startSender( "ln" ));
-    vm5.invoke(() -> WANTestBase.startSender( "ln" ));
-    vm6.invoke(() -> WANTestBase.startSender( "ln" ));
-    vm7.invoke(() -> WANTestBase.startSender( "ln" ));
-    
+    startSenderInVMs("ln", vm4, vm5, vm6, vm7);
+
     vm4.invoke(() -> WANTestBase.waitForSenderRunningState( "ln" ));
     vm5.invoke(() -> WANTestBase.waitForSenderRunningState( "ln" ));
     vm6.invoke(() -> WANTestBase.waitForSenderRunningState( "ln" ));
@@ -154,11 +148,8 @@ public class ReplicatedRegion_ParallelWANPersistenceDUnitTest extends WANTestBas
     
     //start the senders in async mode. This will ensure that the 
     //node of shadow PR that went down last will come up first
-    vm4.invokeAsync(() -> WANTestBase.startSender( "ln" ));
-    vm5.invokeAsync(() -> WANTestBase.startSender( "ln" ));
-    vm6.invokeAsync(() -> WANTestBase.startSender( "ln" ));
-    vm7.invokeAsync(() -> WANTestBase.startSender( "ln" ));
-    
+    startSenderInVMsAsync("ln", vm4, vm5, vm6, vm7);
+
     LogWriterUtils.getLogWriter().info("Waiting for senders running.");
     //wait for senders running
     vm4.invoke(() -> WANTestBase.waitForSenderRunningState( "ln" ));
@@ -198,19 +189,15 @@ public class ReplicatedRegion_ParallelWANPersistenceDUnitTest extends WANTestBas
     Integer nyPort = (Integer)vm1.invoke(() -> WANTestBase.createFirstRemoteLocator( 2, lnPort ));
 
     //create receiver on remote site
-    vm2.invoke(() -> WANTestBase.createReceiver( nyPort ));
-    vm3.invoke(() -> WANTestBase.createReceiver( nyPort ));
-
+    createCacheInVMs(nyPort, vm2, vm3);
     vm2.invoke(() -> WANTestBase.createReplicatedRegion(
       getTestMethodName() + "_RR", null, isOffHeap() ));
     vm3.invoke(() -> WANTestBase.createReplicatedRegion(
       getTestMethodName() + "_RR", null, isOffHeap() ));
-    
+    createReceiverInVMs(nyPort, vm2, vm3);
+
     //create cache in local site
-    vm4.invoke(() -> WANTestBase.createCache( lnPort ));
-    vm5.invoke(() -> WANTestBase.createCache( lnPort ));
-    vm6.invoke(() -> WANTestBase.createCache( lnPort ));
-    vm7.invoke(() -> WANTestBase.createCache( lnPort ));
+    createCacheInVMs(lnPort, vm4, vm5, vm6, vm7);
 
     //create senders with disk store
     String diskStore1 = (String) vm4.invoke(() -> WANTestBase.createSenderWithDiskStore( "ln", 2, true, 100, 10, false, true, null, null, true ));
@@ -229,11 +216,8 @@ public class ReplicatedRegion_ParallelWANPersistenceDUnitTest extends WANTestBas
     vm7.invoke(() -> WANTestBase.createReplicatedRegion( getTestMethodName() + "_RR", "ln",
             Scope.DISTRIBUTED_ACK, DataPolicy.PERSISTENT_REPLICATE, isOffHeap() ));
 
-    vm4.invoke(() -> WANTestBase.startSender( "ln" ));
-    vm5.invoke(() -> WANTestBase.startSender( "ln" ));
-    vm6.invoke(() -> WANTestBase.startSender( "ln" ));
-    vm7.invoke(() -> WANTestBase.startSender( "ln" ));
-    
+    startSenderInVMs("ln", vm4, vm5, vm6, vm7);
+
     vm4.invoke(() -> WANTestBase.waitForSenderRunningState( "ln" ));
     vm5.invoke(() -> WANTestBase.waitForSenderRunningState( "ln" ));
     vm6.invoke(() -> WANTestBase.waitForSenderRunningState( "ln" ));
@@ -300,11 +284,8 @@ public class ReplicatedRegion_ParallelWANPersistenceDUnitTest extends WANTestBas
     
     //start the senders in async mode. This will ensure that the 
     //node of shadow PR that went down last will come up first
-    vm4.invokeAsync(() -> WANTestBase.startSender( "ln" ));
-    vm5.invokeAsync(() -> WANTestBase.startSender( "ln" ));
-    vm6.invokeAsync(() -> WANTestBase.startSender( "ln" ));
-    vm7.invokeAsync(() -> WANTestBase.startSender( "ln" ));
-    
+    startSenderInVMsAsync("ln", vm4, vm5, vm6, vm7);
+
     LogWriterUtils.getLogWriter().info("Waiting for senders running.");
     //wait for senders running
     vm4.invoke(() -> WANTestBase.waitForSenderRunningState( "ln" ));
@@ -359,6 +340,8 @@ public class ReplicatedRegion_ParallelWANPersistenceDUnitTest extends WANTestBas
     Integer nyPort = (Integer)vm1.invoke(() -> WANTestBase.createFirstRemoteLocator( 2, lnPort ));
 
     //create receiver on remote site
+    vm2.invoke(() -> WANTestBase.createCache( nyPort ));
+    vm3.invoke(() -> WANTestBase.createCache( nyPort ));
     vm2.invoke(() -> WANTestBase.createReceiver( nyPort ));
     vm3.invoke(() -> WANTestBase.createReceiver( nyPort ));
 
@@ -403,12 +386,9 @@ public class ReplicatedRegion_ParallelWANPersistenceDUnitTest extends WANTestBas
     vm5.invoke(() -> WANTestBase.createPersistentPartitionedRegion( getTestMethodName() + "_PR", "ln", 1, 100, isOffHeap() ));
     vm6.invoke(() -> WANTestBase.createPersistentPartitionedRegion( getTestMethodName() + "_PR", "ln", 1, 100, isOffHeap() ));
     vm7.invoke(() -> WANTestBase.createPersistentPartitionedRegion( getTestMethodName() + "_PR", "ln", 1, 100, isOffHeap() ));
-    
-    vm4.invoke(() -> WANTestBase.startSender( "ln" ));
-    vm5.invoke(() -> WANTestBase.startSender( "ln" ));
-    vm6.invoke(() -> WANTestBase.startSender( "ln" ));
-    vm7.invoke(() -> WANTestBase.startSender( "ln" ));
-    
+
+    startSenderInVMs("ln", vm4, vm5, vm6, vm7);
+
     vm4.invoke(() -> WANTestBase.waitForSenderRunningState( "ln" ));
     vm5.invoke(() -> WANTestBase.waitForSenderRunningState( "ln" ));
     vm6.invoke(() -> WANTestBase.waitForSenderRunningState( "ln" ));
@@ -498,11 +478,8 @@ public class ReplicatedRegion_ParallelWANPersistenceDUnitTest extends WANTestBas
     
     //start the senders in async mode. This will ensure that the 
     //node of shadow PR that went down last will come up first
-    vm4.invokeAsync(() -> WANTestBase.startSender( "ln" ));
-    vm5.invokeAsync(() -> WANTestBase.startSender( "ln" ));
-    vm6.invokeAsync(() -> WANTestBase.startSender( "ln" ));
-    vm7.invokeAsync(() -> WANTestBase.startSender( "ln" ));
-    
+    startSenderInVMsAsync("ln", vm4, vm5, vm6, vm7);
+
     LogWriterUtils.getLogWriter().info("Waiting for senders running.");
     //wait for senders running
     vm4.invoke(() -> WANTestBase.waitForSenderRunningState( "ln" ));
@@ -576,13 +553,10 @@ public class ReplicatedRegion_ParallelWANPersistenceDUnitTest extends WANTestBas
     Integer lnPort = (Integer) vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 ));
     Integer nyPort = (Integer) vm1.invoke(() -> WANTestBase.createFirstRemoteLocator( 2, lnPort ));
 
-    vm2.invoke(() -> WANTestBase.createReceiver( nyPort ));
-    vm3.invoke(() -> WANTestBase.createReceiver( nyPort ));
+    createCacheInVMs(nyPort, vm2, vm3);
+    createReceiverInVMs(nyPort, vm2, vm3);
 
-    vm4.invoke(() -> WANTestBase.createCache( lnPort ));
-    vm5.invoke(() -> WANTestBase.createCache( lnPort ));
-    vm6.invoke(() -> WANTestBase.createCache( lnPort ));
-    vm7.invoke(() -> WANTestBase.createCache( lnPort ));
+    createCacheInVMs(lnPort, vm4, vm5, vm6, vm7);
 
     // create senders with disk store
     String diskStore1 = (String) vm4.invoke(() -> WANTestBase.createSenderWithDiskStore( "ln", 2, true, 100, 10,
@@ -611,10 +585,7 @@ public class ReplicatedRegion_ParallelWANPersistenceDUnitTest extends WANTestBas
         getTestMethodName() + "_RR", "ln", Scope.DISTRIBUTED_ACK,
         DataPolicy.PERSISTENT_REPLICATE, isOffHeap() ));
 
-    vm4.invoke(() -> WANTestBase.startSender( "ln" ));
-    vm5.invoke(() -> WANTestBase.startSender( "ln" ));
-    vm6.invoke(() -> WANTestBase.startSender( "ln" ));
-    vm7.invoke(() -> WANTestBase.startSender( "ln" ));
+    startSenderInVMs("ln", vm4, vm5, vm6, vm7);
 
     vm2.invoke(() -> WANTestBase.createReplicatedRegion(
         getTestMethodName() + "_RR", "ln", isOffHeap() ));
@@ -672,8 +643,7 @@ public class ReplicatedRegion_ParallelWANPersistenceDUnitTest extends WANTestBas
       fail();
     }
 
-    vm4.invokeAsync(() -> WANTestBase.startSender( "ln" ));
-    vm5.invokeAsync(() -> WANTestBase.startSender( "ln" ));
+    startSenderInVMsAsync("ln", vm4, vm5);
 
     LogWriterUtils.getLogWriter().info("Waiting for senders running.");
     // wait for senders running

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/65d7a6f1/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/ReplicatedRegion_ParallelWANPropogationDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/ReplicatedRegion_ParallelWANPropogationDUnitTest.java b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/ReplicatedRegion_ParallelWANPropogationDUnitTest.java
index 83bf1e5..3387249 100644
--- a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/ReplicatedRegion_ParallelWANPropogationDUnitTest.java
+++ b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/ReplicatedRegion_ParallelWANPropogationDUnitTest.java
@@ -67,11 +67,12 @@ public class ReplicatedRegion_ParallelWANPropogationDUnitTest extends WANTestBas
       Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 ));
       Integer nyPort = (Integer)vm1.invoke(() -> WANTestBase.createFirstRemoteLocator( 2, lnPort ));
 
+      createCacheInVMs(nyPort, vm2);
       vm2.invoke(() -> WANTestBase.createReceiver( nyPort ));
       vm2.invoke(() -> WANTestBase.createReplicatedRegion(
           getTestMethodName() + "_RR", null, isOffHeap() ));
 
-      vm4.invoke(() -> WANTestBase.createCache( lnPort ));
+      createCacheInVMs(lnPort, vm4);
 
       vm4.invoke(() -> WANTestBase.createReplicatedRegion(
           getTestMethodName() + "_RR", "ln1", isOffHeap() ));
@@ -275,8 +276,7 @@ public class ReplicatedRegion_ParallelWANPropogationDUnitTest extends WANTestBas
         vm5.invoke(() -> WANTestBase.createSender( "ln1", 2,
             true, 10, 100, false, false, null, true ));
 
-        vm4.invoke(() -> WANTestBase.startSender( "ln1" ));
-        vm5.invoke(() -> WANTestBase.startSender( "ln1" ));
+        startSenderInVMs("ln1", vm4, vm5);
 
         vm4.invoke(() -> WANTestBase.doPuts(
             getTestMethodName() + "_RR", 1000 ));
@@ -342,12 +342,13 @@ public class ReplicatedRegion_ParallelWANPropogationDUnitTest extends WANTestBas
       Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 ));
       Integer nyPort = (Integer)vm1.invoke(() -> WANTestBase.createFirstRemoteLocator( 2, lnPort ));
 
+      createCacheInVMs(nyPort, vm2);
       vm2.invoke(() -> WANTestBase.createReceiver( nyPort ));
       vm2.invoke(() -> WANTestBase.createReplicatedRegion(
         getTestMethodName() + "_RR", null, isOffHeap()  ));
-      
-      vm4.invoke(() -> WANTestBase.createCache( lnPort ));
-      
+
+      createCacheInVMs(lnPort, vm4);
+
       vm4.invoke(() -> WANTestBase.createReplicatedRegion(
           getTestMethodName() + "_RR", "ln1", isOffHeap()  ));
       
@@ -385,12 +386,12 @@ public class ReplicatedRegion_ParallelWANPropogationDUnitTest extends WANTestBas
       Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 ));
       Integer nyPort = (Integer)vm1.invoke(() -> WANTestBase.createFirstRemoteLocator( 2, lnPort ));
 
-      vm2.invoke(() -> WANTestBase.createReceiver( nyPort ));
+      createCacheInVMs(nyPort, vm2);
       vm2.invoke(() -> WANTestBase.createReplicatedRegion(
         getTestMethodName() + "_RR", null, isOffHeap()  ));
-      
-      vm4.invoke(() -> WANTestBase.createCache( lnPort ));
-      vm5.invoke(() -> WANTestBase.createCache( lnPort ));
+      vm2.invoke(() -> WANTestBase.createReceiver( nyPort ));
+
+      createCacheInVMs(lnPort, vm4, vm5);
       
       vm4.invoke(() -> WANTestBase.createReplicatedRegion(
           getTestMethodName() + "_RR", "ln1", isOffHeap()  ));
@@ -402,8 +403,7 @@ public class ReplicatedRegion_ParallelWANPropogationDUnitTest extends WANTestBas
       vm5.invoke(() -> WANTestBase.createSender( "ln1", 2,
       true, 10, 100, false, false, null, true));
 
-      vm4.invoke(() -> WANTestBase.startSender( "ln1"));
-      vm5.invoke(() -> WANTestBase.startSender( "ln1"));
+      startSenderInVMs("ln1", vm4, vm5);
       
       vm4.invoke(() -> WANTestBase.doPuts( getTestMethodName() + "_RR",
         1000 ));
@@ -438,10 +438,11 @@ public class ReplicatedRegion_ParallelWANPropogationDUnitTest extends WANTestBas
       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.createCache( nyPort ));
       vm2.invoke(() -> WANTestBase.createReplicatedRegion(
         getTestMethodName() + "_RR", null, isOffHeap()  ));
-      
+      vm2.invoke(() -> WANTestBase.createReceiver( nyPort ));
+
       vm4.invoke(() -> WANTestBase.createCache( lnPort ));
       vm5.invoke(() -> WANTestBase.createCache( lnPort ));
       
@@ -455,8 +456,7 @@ public class ReplicatedRegion_ParallelWANPropogationDUnitTest extends WANTestBas
       vm5.invoke(() -> WANTestBase.createSender( "ln1", 2,
       true, 10, 100, false, false, null, true));
 
-      vm4.invoke(() -> WANTestBase.startSender( "ln1"));
-      vm5.invoke(() -> WANTestBase.startSender( "ln1"));
+      startSenderInVMs("ln1", vm4, vm5);
       
       vm4.invoke(() -> WANTestBase.doPuts( getTestMethodName() + "_RR",
         1000 ));
@@ -491,6 +491,7 @@ public class ReplicatedRegion_ParallelWANPropogationDUnitTest extends WANTestBas
       Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 ));
       Integer nyPort = (Integer)vm1.invoke(() -> WANTestBase.createFirstRemoteLocator( 2, lnPort ));
 
+      createCacheInVMs(nyPort, vm2, vm3);
       vm2.invoke(() -> WANTestBase.createReceiver( nyPort ));
       vm3.invoke(() -> WANTestBase.createReceiver( nyPort ));
       
@@ -503,11 +504,8 @@ public class ReplicatedRegion_ParallelWANPropogationDUnitTest extends WANTestBas
         getTestMethodName() + "_PR", null, 1, 100, isOffHeap()  ));
       vm3.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 ));
+
+      createCacheInVMs(lnPort, vm4, vm5, vm6, vm7);
       
       vm4.invoke(() -> WANTestBase.createPartitionedRegion(
           getTestMethodName() + "_PR", "ln", 1, 100, isOffHeap()  ));
@@ -536,11 +534,8 @@ public class ReplicatedRegion_ParallelWANPropogationDUnitTest extends WANTestBas
       vm7.invoke(() -> WANTestBase.createSender( "ln", 2,
           true, 10, 100, false, false, null, true ));
 
-      vm4.invoke(() -> WANTestBase.startSender( "ln"));
-      vm5.invoke(() -> WANTestBase.startSender( "ln"));
-      vm6.invoke(() -> WANTestBase.startSender( "ln"));
-      vm7.invoke(() -> WANTestBase.startSender( "ln"));
-      
+      startSenderInVMs("ln", vm4, vm5, vm6, vm7);
+
       vm4.invoke(() -> WANTestBase.waitForSenderRunningState( "ln" ));
       vm5.invoke(() -> WANTestBase.waitForSenderRunningState( "ln" ));
       vm6.invoke(() -> WANTestBase.waitForSenderRunningState( "ln" ));
@@ -594,14 +589,12 @@ public class ReplicatedRegion_ParallelWANPropogationDUnitTest extends WANTestBas
       Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 ));
       Integer nyPort = (Integer)vm1.invoke(() -> WANTestBase.createFirstRemoteLocator( 2, lnPort ));
 
+      createCacheInVMs(nyPort, vm2);
       vm2.invoke(() -> WANTestBase.createReceiver( nyPort ));
       vm2.invoke(() -> WANTestBase.createReplicatedRegion(
         getTestMethodName() + "_RR", null, isOffHeap()  ));
-      
-      vm4.invoke(() -> WANTestBase.createCache( lnPort ));
-      vm5.invoke(() -> WANTestBase.createCache( lnPort ));
-      vm6.invoke(() -> WANTestBase.createCache( lnPort ));
-      vm7.invoke(() -> WANTestBase.createCache( lnPort ));
+
+      createCacheInVMs(lnPort, vm4, vm5, vm6, vm7);
       
       vm4.invoke(() -> WANTestBase.createSender( "ln1", 2,
           true, 10, 100, false, false, null, false ));
@@ -671,13 +664,10 @@ public class ReplicatedRegion_ParallelWANPropogationDUnitTest extends WANTestBas
       Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 ));
       Integer nyPort = (Integer)vm1.invoke(() -> WANTestBase.createFirstRemoteLocator( 2, lnPort ));
 
-      vm2.invoke(() -> WANTestBase.createReceiver( nyPort ));
-      vm3.invoke(() -> WANTestBase.createReceiver( nyPort ));
+      createCacheInVMs(nyPort, vm2, vm3);
+      createReceiverInVMs(nyPort, vm2, vm3);
 
-      vm4.invoke(() -> WANTestBase.createCache( lnPort ));
-      vm5.invoke(() -> WANTestBase.createCache( lnPort ));
-      vm6.invoke(() -> WANTestBase.createCache( lnPort ));
-      vm7.invoke(() -> WANTestBase.createCache( lnPort ));
+      createCacheInVMs(lnPort, vm4, vm5, vm6, vm7);
 
       vm4.invoke(() -> WANTestBase.createSender( "ln", 2,
           true, 100, 10, false, false, null, true ));
@@ -697,10 +687,7 @@ public class ReplicatedRegion_ParallelWANPropogationDUnitTest extends WANTestBas
       vm7.invoke(() -> WANTestBase.createReplicatedRegion(
           getTestMethodName() + "_RR", "ln", isOffHeap()  ));
 
-      vm4.invoke(() -> WANTestBase.startSender( "ln" ));
-      vm5.invoke(() -> WANTestBase.startSender( "ln" ));
-      vm6.invoke(() -> WANTestBase.startSender( "ln" ));
-      vm7.invoke(() -> WANTestBase.startSender( "ln" ));
+      startSenderInVMs("ln", vm4, vm5, vm6, vm7);
 
       vm2.invoke(() -> WANTestBase.createReplicatedRegion(
           getTestMethodName() + "_RR", null, isOffHeap()  ));
@@ -732,10 +719,7 @@ public class ReplicatedRegion_ParallelWANPropogationDUnitTest extends WANTestBas
         exp1.remove();
       }*/
 
-      vm4.invoke(() -> WANTestBase.createCache( lnPort ));
-      vm5.invoke(() -> WANTestBase.createCache( lnPort ));
-      vm6.invoke(() -> WANTestBase.createCache( lnPort ));
-      vm7.invoke(() -> WANTestBase.createCache( lnPort ));
+      createCacheInVMs(lnPort, vm4, vm5, vm6, vm7);
 
       vm4.invoke(() -> WANTestBase.createSender( "ln", 2,
           true, 100, 10, false, false, null, true ));
@@ -755,10 +739,7 @@ public class ReplicatedRegion_ParallelWANPropogationDUnitTest extends WANTestBas
       vm7.invoke(() -> WANTestBase.createReplicatedRegion(
           getTestMethodName() + "_RR", "ln", isOffHeap()  ));
 
-      vm4.invoke(() -> WANTestBase.startSender( "ln" ));
-      vm5.invoke(() -> WANTestBase.startSender( "ln" ));
-      vm6.invoke(() -> WANTestBase.startSender( "ln" ));
-      vm7.invoke(() -> WANTestBase.startSender( "ln" ));
+      startSenderInVMs("ln", vm4, vm5, vm6, vm7);
 
       vm4.invoke(() -> WANTestBase.waitForSenderRunningState( "ln" ));
       vm5.invoke(() -> WANTestBase.waitForSenderRunningState( "ln" ));
@@ -804,12 +785,12 @@ public class ReplicatedRegion_ParallelWANPropogationDUnitTest extends WANTestBas
       Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 ));
       Integer nyPort = (Integer)vm1.invoke(() -> WANTestBase.createFirstRemoteLocator( 2, lnPort ));
 
-      vm2.invoke(() -> WANTestBase.createReceiver( nyPort ));
+      createCacheInVMs(nyPort, vm2);
       vm2.invoke(() -> WANTestBase.createReplicatedRegion(
         getTestMethodName() + "_RR", null, isOffHeap()  ));
-      
-      vm4.invoke(() -> WANTestBase.createCache( lnPort ));
-      vm5.invoke(() -> WANTestBase.createCache( lnPort ));
+      vm2.invoke(() -> WANTestBase.createReceiver( nyPort ));
+
+      createCacheInVMs(lnPort, vm4, vm5);
       
       vm4.invoke(() -> WANTestBase.createReplicatedRegion( getTestMethodName() + "_RR", "ln1",
               Scope.DISTRIBUTED_NO_ACK, DataPolicy.REPLICATE, isOffHeap()  ));
@@ -821,9 +802,8 @@ public class ReplicatedRegion_ParallelWANPropogationDUnitTest extends WANTestBas
       vm5.invoke(() -> WANTestBase.createSender( "ln1", 2,
       true, 10, 100, false, false, null, true));
 
-      vm4.invoke(() -> WANTestBase.startSender( "ln1"));
-      vm5.invoke(() -> WANTestBase.startSender( "ln1"));
-      
+      startSenderInVMs("ln1", vm4, vm5);
+
       vm4.invoke(() -> WANTestBase.doPuts( getTestMethodName() + "_RR",
         1000 ));
      
@@ -857,11 +837,10 @@ public class ReplicatedRegion_ParallelWANPropogationDUnitTest extends WANTestBas
     Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 ));
     Integer nyPort = (Integer)vm1.invoke(() -> WANTestBase.createFirstRemoteLocator( 2, lnPort ));
 
-    vm2.invoke(() -> WANTestBase.createReceiver( nyPort ));
-    vm3.invoke(() -> WANTestBase.createReceiver( nyPort ));
+    createCacheInVMs(nyPort, vm2, vm3);
+    createReceiverInVMs(nyPort, vm2, vm3);
 
-    vm4.invoke(() -> WANTestBase.createCache( lnPort ));
-    vm5.invoke(() -> WANTestBase.createCache( lnPort ));
+    createCacheInVMs(lnPort, vm4, vm5);
 
     vm4.invoke(() -> WANTestBase.createSender( "ln", 2, true,
         100, 10, false, false, null, true ));
@@ -873,8 +852,7 @@ public class ReplicatedRegion_ParallelWANPropogationDUnitTest extends WANTestBas
     vm5.invoke(() -> WANTestBase.createReplicatedRegion(
         getTestMethodName() + "_RR", "ln", isOffHeap()  ));
 
-    vm4.invoke(() -> WANTestBase.startSender( "ln" ));
-    vm5.invoke(() -> WANTestBase.startSender( "ln" ));
+    startSenderInVMs("ln", vm4, vm5);
 
     vm2.invoke(() -> WANTestBase.createReplicatedRegion(
         getTestMethodName() + "_RR", "ln", isOffHeap()  ));
@@ -930,13 +908,10 @@ public class ReplicatedRegion_ParallelWANPropogationDUnitTest extends WANTestBas
     Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 ));
     Integer nyPort = (Integer)vm1.invoke(() -> WANTestBase.createFirstRemoteLocator( 2, lnPort ));
 
-    vm2.invoke(() -> WANTestBase.createReceiver( nyPort ));
-    vm3.invoke(() -> WANTestBase.createReceiver( nyPort ));
+    createCacheInVMs(nyPort, vm2, vm3);
+    createReceiverInVMs(nyPort, vm2, vm3);
 
-    vm4.invoke(() -> WANTestBase.createCache( lnPort ));
-    vm5.invoke(() -> WANTestBase.createCache( lnPort ));
-    vm6.invoke(() -> WANTestBase.createCache( lnPort ));
-    vm7.invoke(() -> WANTestBase.createCache( lnPort ));
+    createCacheInVMs(lnPort, vm4, vm5, vm6, vm7);
 
     vm4.invoke(() -> WANTestBase.createSender( "ln", 2, true,
         100, 10, false, false, null, true ));
@@ -956,10 +931,7 @@ public class ReplicatedRegion_ParallelWANPropogationDUnitTest extends WANTestBas
     vm7.invoke(() -> WANTestBase.createReplicatedRegion(
         getTestMethodName() + "_RR", "ln", isOffHeap()  ));
 
-    vm4.invoke(() -> WANTestBase.startSender( "ln" ));
-    vm5.invoke(() -> WANTestBase.startSender( "ln" ));
-    vm6.invoke(() -> WANTestBase.startSender( "ln" ));
-    vm7.invoke(() -> WANTestBase.startSender( "ln" ));
+    startSenderInVMs("ln", vm4, vm5, vm6, vm7);
 
     vm2.invoke(() -> WANTestBase.createReplicatedRegion(
         getTestMethodName() + "_RR", "ln", isOffHeap()  ));

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/65d7a6f1/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/WANSSLDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/WANSSLDUnitTest.java b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/WANSSLDUnitTest.java
index 7331147..5f81d1f 100644
--- a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/WANSSLDUnitTest.java
+++ b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/WANSSLDUnitTest.java
@@ -97,6 +97,7 @@ public class WANSSLDUnitTest extends WANTestBase{
       Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 ));
       Integer nyPort = (Integer)vm1.invoke(() -> WANTestBase.createFirstRemoteLocator( 2, lnPort ));
 
+      createCacheInVMs(nyPort, vm2);
       vm2.invoke(() -> WANTestBase.createReceiver( nyPort ));
 
       vm4.invoke(() -> WANTestBase.createCacheWithSSL( lnPort ));

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/65d7a6f1/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/WanValidationsDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/WanValidationsDUnitTest.java b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/WanValidationsDUnitTest.java
index dbe9844..cb013ef 100644
--- a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/WanValidationsDUnitTest.java
+++ b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/WanValidationsDUnitTest.java
@@ -58,9 +58,8 @@ public class WanValidationsDUnitTest extends WANTestBase {
     try {
       Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId(1));
       Integer nyPort = (Integer)vm1.invoke(() -> WANTestBase.createFirstRemoteLocator(2, lnPort));
-      
-      vm4.invoke(createCacheRunnable(lnPort));
-      vm5.invoke(createCacheRunnable(lnPort));
+
+      createCacheInVMs(lnPort, vm4, vm5);
 
       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));
@@ -85,9 +84,6 @@ public class WanValidationsDUnitTest extends WANTestBase {
     }
   }
 
-  protected SerializableRunnableIF createCacheRunnable(Integer lnPort) {
-    return () -> WANTestBase.createCache(lnPort );
-  }
 
   /**
    * Validate that ParallelGatewaySender can be added to Distributed region
@@ -107,8 +103,7 @@ public class WanValidationsDUnitTest extends WANTestBase {
       Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 ));
       Integer nyPort = (Integer)vm1.invoke(() -> WANTestBase.createFirstRemoteLocator( 2, lnPort ));
 
-      vm4.invoke(createCacheRunnable(lnPort));
-      vm5.invoke(createCacheRunnable(lnPort));
+      createCacheInVMs(lnPort, vm4, vm5);
 
       vm4.invoke(() -> WANTestBase.createSender( "ln1", 2,
           true, 10, 100, false, false, null, false ));
@@ -138,9 +133,8 @@ public class WanValidationsDUnitTest extends WANTestBase {
     try {
       Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId(1));
 
-      vm4.invoke(createCacheRunnable(lnPort));
-      vm5.invoke(createCacheRunnable(lnPort));
-      
+      createCacheInVMs(lnPort, vm4, vm5);
+
       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));
       
@@ -169,8 +163,8 @@ public class WanValidationsDUnitTest extends WANTestBase {
     try {
       Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 ));
 
-      vm4.invoke(createCacheRunnable(lnPort));
-      vm5.invoke(createCacheRunnable(lnPort));
+      createCacheInVMs(lnPort, vm4, vm5);
+
 
       vm4.invoke(() -> WANTestBase.createReplicatedRegionWithAsyncEventQueue(
               getTestMethodName() + "_RR", "ln1", isOffHeap()  ));
@@ -198,9 +192,8 @@ public class WanValidationsDUnitTest extends WANTestBase {
     try {
       Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId(1));
 
-      vm4.invoke(createCacheRunnable(lnPort));
-      vm5.invoke(createCacheRunnable(lnPort));
-      
+      createCacheInVMs(lnPort, vm4, vm5);
+
       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));
       
@@ -235,8 +228,8 @@ public class WanValidationsDUnitTest extends WANTestBase {
     try {
       Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 ));
 
-      vm1.invoke(createCacheRunnable(lnPort));
-      
+      createCacheInVMs(lnPort, vm1);
+
       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));
       
@@ -261,8 +254,8 @@ public class WanValidationsDUnitTest extends WANTestBase {
     try {
       Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 ));
 
-      vm1.invoke(createCacheRunnable(lnPort));
-      
+      createCacheInVMs(lnPort, vm1);
+
       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));
       
@@ -295,8 +288,8 @@ public class WanValidationsDUnitTest extends WANTestBase {
     try {
       Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 ));
 
-      vm1.invoke(createCacheRunnable(lnPort));
-      
+      createCacheInVMs(lnPort, vm1);
+
       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));
       
@@ -322,7 +315,7 @@ public class WanValidationsDUnitTest extends WANTestBase {
     try {
       Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 ));
 
-      vm1.invoke(createCacheRunnable(lnPort));
+      createCacheInVMs(lnPort, vm1);
 
       vm1.invoke(() -> WANTestBase.createSender(
           "ln1_Parallel", 2, true, 10, 100, false, false, null, true ));
@@ -350,7 +343,7 @@ public class WanValidationsDUnitTest extends WANTestBase {
     try {
       Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 ));
 
-      vm1.invoke(createCacheRunnable(lnPort));
+      createCacheInVMs(lnPort, vm1);
 
       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));
@@ -379,7 +372,7 @@ public class WanValidationsDUnitTest extends WANTestBase {
   public void testSerialGatewaySenderAndParallelGatewaySenderWithSameName() {
     Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 ));
 
-    vm1.invoke(createCacheRunnable(lnPort));
+    createCacheInVMs(lnPort, vm1);
 
     vm1.invoke(() -> WANTestBase.createSenderForValidations(
         "ln", 2, false, 100, false, false, null, null, true, false ));
@@ -400,8 +393,7 @@ public class WanValidationsDUnitTest extends WANTestBase {
   public void testSameRemoteDSAcrossSameSender() {
     Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 ));
 
-    vm1.invoke(createCacheRunnable(lnPort));
-    vm2.invoke(createCacheRunnable(lnPort));
+    createCacheInVMs(lnPort, vm1, vm2);
 
     vm1.invoke(() -> WANTestBase.createSenderForValidations(
         "ln", 2, false, 100, false, false, null, null,
@@ -426,8 +418,7 @@ public class WanValidationsDUnitTest extends WANTestBase {
   public void testSerialSenderOnBothCache() {
     Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 ));
 
-    vm1.invoke(createCacheRunnable(lnPort));
-    vm2.invoke(createCacheRunnable(lnPort));
+    createCacheInVMs(lnPort, vm1, vm2);
 
     vm1.invoke(() -> WANTestBase.createSenderForValidations(
         "ln", 2, false, 100, false, false, null, null,
@@ -451,8 +442,7 @@ public class WanValidationsDUnitTest extends WANTestBase {
   public void testParallelSenderOnBothCache(){
     Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId(1));
 
-    vm1.invoke(createCacheRunnable(lnPort));
-    vm2.invoke(createCacheRunnable(lnPort));
+    createCacheInVMs(lnPort, vm1, vm2);
 
     vm1.invoke(() -> WANTestBase.createSenderForValidations( "ln", 2,
         true, 100,false, false,
@@ -477,8 +467,7 @@ public class WanValidationsDUnitTest extends WANTestBase {
   public void testBatchConflation() {
     Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 ));
 
-    vm1.invoke(createCacheRunnable(lnPort));
-    vm2.invoke(createCacheRunnable(lnPort));
+    createCacheInVMs(lnPort, vm1, vm2);
 
     vm1.invoke(() -> WANTestBase.createSenderForValidations( "ln", 2,
         false, 100, false, false,
@@ -503,8 +492,7 @@ public class WanValidationsDUnitTest extends WANTestBase {
   public void testisPersistentEnabled() {
     Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 ));
 
-    vm1.invoke(createCacheRunnable(lnPort));
-    vm2.invoke(createCacheRunnable(lnPort));
+    createCacheInVMs(lnPort, vm1, vm2);
 
     vm1.invoke(() -> WANTestBase.createSenderForValidations( "ln", 2,
         false, 100, false, false,
@@ -525,8 +513,7 @@ public class WanValidationsDUnitTest extends WANTestBase {
   public void testAlertThreshold() {
     Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 ));
 
-    vm1.invoke(createCacheRunnable(lnPort));
-    vm2.invoke(createCacheRunnable(lnPort));
+    createCacheInVMs(lnPort, vm1, vm2);
 
     vm1.invoke(() -> WANTestBase.createSenderForValidations( "ln", 2,
         false, 100, false, false,
@@ -547,8 +534,7 @@ public class WanValidationsDUnitTest extends WANTestBase {
   public void testManualStart() {
     Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 ));
 
-    vm1.invoke(createCacheRunnable(lnPort));
-    vm2.invoke(createCacheRunnable(lnPort));
+    createCacheInVMs(lnPort, vm1, vm2);
 
     vm1.invoke(() -> WANTestBase.createSenderForValidations( "ln", 2,
         false, 100, false, false,
@@ -569,8 +555,7 @@ public class WanValidationsDUnitTest extends WANTestBase {
   public void testGatewayEventFilters() {
     Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 ));
 
-    vm1.invoke(createCacheRunnable(lnPort));
-    vm2.invoke(createCacheRunnable(lnPort));
+    createCacheInVMs(lnPort, vm1, vm2);
 
     ArrayList<GatewayEventFilter> eventFiletrs = new ArrayList<GatewayEventFilter>();
     eventFiletrs.add(new MyGatewayEventFilter());
@@ -597,8 +582,7 @@ public class WanValidationsDUnitTest extends WANTestBase {
   public void testGatewayEventFilters2() {
     Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 ));
 
-    vm1.invoke(createCacheRunnable(lnPort));
-    vm2.invoke(createCacheRunnable(lnPort));
+    createCacheInVMs(lnPort, vm1, vm2);
 
     ArrayList<GatewayEventFilter> eventFiletrs = new ArrayList<GatewayEventFilter>();
     eventFiletrs.add(new MyGatewayEventFilter());
@@ -626,8 +610,7 @@ public class WanValidationsDUnitTest extends WANTestBase {
   public void testGatewayTransportFilters() {
     Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 ));
 
-    vm1.invoke(createCacheRunnable(lnPort));
-    vm2.invoke(createCacheRunnable(lnPort));
+    createCacheInVMs(lnPort, vm1, vm2);
 
     ArrayList<GatewayTransportFilter> transportFiletrs = new ArrayList<GatewayTransportFilter>();
     transportFiletrs.add(new MyGatewayTransportFilter1());
@@ -656,8 +639,7 @@ public class WanValidationsDUnitTest extends WANTestBase {
   public void testGatewayTransportFiltersOrder() {
     Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 ));
 
-    vm1.invoke(createCacheRunnable(lnPort));
-    vm2.invoke(createCacheRunnable(lnPort));
+    createCacheInVMs(lnPort, vm1, vm2);
 
     ArrayList<GatewayTransportFilter> transportFiletrs = new ArrayList<GatewayTransportFilter>();
     transportFiletrs.add(new MyGatewayTransportFilter1());
@@ -712,8 +694,7 @@ public class WanValidationsDUnitTest extends WANTestBase {
   public void testIsDiskSynchronous() {
     Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 ));
 
-    vm1.invoke(createCacheRunnable(lnPort));
-    vm2.invoke(createCacheRunnable(lnPort));
+    createCacheInVMs(lnPort, vm1, vm2);
 
     vm1.invoke(() -> WANTestBase.createSenderForValidations(
         "ln", 2, false, 100, false, false, null,
@@ -741,7 +722,8 @@ public class WanValidationsDUnitTest extends WANTestBase {
    */
   public void test_GetCacheServersDoesNotReturnReceivers() {
     Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 ));
-    
+
+    createCacheInVMs(lnPort, vm4);
     vm4.invoke(() -> WANTestBase.createReceiver( lnPort ));
     
     vm4.invoke(() -> WANTestBase.createCacheServer( ));
@@ -760,9 +742,9 @@ public class WanValidationsDUnitTest extends WANTestBase {
    */
   public void test_GetCacheServersDoesNotReturnReceivers_Scenario2() {
     Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 ));
-    
+    createCacheInVMs(lnPort, vm4);
     vm4.invoke(() -> WANTestBase.createReceiver( lnPort ));
-    vm5.invoke(createCacheRunnable(lnPort));
+    createCacheInVMs(lnPort, vm5);
     
     vm5.invoke(() -> WANTestBase.createCacheServer( ));
     
@@ -786,8 +768,7 @@ public class WanValidationsDUnitTest extends WANTestBase {
   public void DISABLED_testDispatcherThreadsForParallelGatewaySender() {
     Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 ));
 
-    vm1.invoke(createCacheRunnable(lnPort));
-    vm2.invoke(createCacheRunnable(lnPort));
+    createCacheInVMs(lnPort, vm1, vm2);
 
     vm1.invoke(() -> WANTestBase.createConcurrentSender( "ln", 2,
       true, 100, 10, false, false, null, true, 5, OrderPolicy.KEY ));
@@ -816,8 +797,7 @@ public class WanValidationsDUnitTest extends WANTestBase {
   public void DISABLED_testOrderPolicyForParallelGatewaySender() {
     Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 ));
 
-    vm1.invoke(createCacheRunnable(lnPort));
-    vm2.invoke(createCacheRunnable(lnPort));
+    createCacheInVMs(lnPort, vm1, vm2);
 
     vm1.invoke(() -> WANTestBase.createConcurrentSender( "ln", 2,
       true, 100, 10, false, false, null, true, 5, OrderPolicy.KEY ));
@@ -840,13 +820,11 @@ public class WanValidationsDUnitTest extends WANTestBase {
     Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 ));
     Integer nyPort = (Integer)vm1.invoke(() -> WANTestBase.createFirstRemoteLocator( 2, lnPort ));
 
-    vm2.invoke(() -> WANTestBase.createReceiver( nyPort ));
+    createCacheInVMs(nyPort, vm2);
     vm2.invoke(createReceiverReplicatedRegion());
+    vm2.invoke(() -> WANTestBase.createReceiver( nyPort ));
 
-    vm4.invoke(createCacheRunnable(lnPort));
-    vm5.invoke(createCacheRunnable(lnPort));
-    vm6.invoke(createCacheRunnable(lnPort));
-    vm7.invoke(createCacheRunnable(lnPort));
+    createCacheInVMs(lnPort, vm4, vm5, vm6, vm7);
 
     vm4.invoke(() -> WANTestBase.createSender( "ln", 2,
         false, 100, 10, false, false, null, true ));
@@ -881,10 +859,7 @@ public class WanValidationsDUnitTest extends WANTestBase {
   public void testBug50434_RR_SerialAsyncEventQueue() throws Exception {
     Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 ));
 
-    vm4.invoke(createCacheRunnable(lnPort));
-    vm5.invoke(createCacheRunnable(lnPort));
-    vm6.invoke(createCacheRunnable(lnPort));
-    vm7.invoke(createCacheRunnable(lnPort));
+    createCacheInVMs(lnPort, vm4, vm5, vm6, vm7);
 
     vm4.invoke(() -> WANTestBase.createAsyncEventQueue( "ln",
         false, 100, 100, false, false, null, false ));
@@ -927,13 +902,11 @@ public class WanValidationsDUnitTest extends WANTestBase {
     Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 ));
     Integer nyPort = (Integer)vm1.invoke(() -> WANTestBase.createFirstRemoteLocator( 2, lnPort ));
 
-    vm2.invoke(() -> WANTestBase.createReceiver( nyPort ));
+    createCacheInVMs(nyPort, vm2);
     vm2.invoke(createReceiverReplicatedRegion());
+    vm2.invoke(() -> WANTestBase.createReceiver( nyPort ));
 
-    vm4.invoke(createCacheRunnable(lnPort));
-    vm5.invoke(createCacheRunnable(lnPort));
-    vm6.invoke(createCacheRunnable(lnPort));
-    vm7.invoke(createCacheRunnable(lnPort));
+    createCacheInVMs(lnPort, vm4, vm5, vm6, vm7);
 
     vm4.invoke(() -> WANTestBase.createSender( "ln", 2,
         false, 100, 10, false, false, null, true ));
@@ -969,10 +942,7 @@ public class WanValidationsDUnitTest extends WANTestBase {
   public void testBug50434_RR_SerialAsyncEventQueue_Pass() throws Exception {
     Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 ));
 
-    vm4.invoke(createCacheRunnable(lnPort));
-    vm5.invoke(createCacheRunnable(lnPort));
-    vm6.invoke(createCacheRunnable(lnPort));
-    vm7.invoke(createCacheRunnable(lnPort));
+    createCacheInVMs(lnPort, vm4, vm5, vm6, vm7);
 
     vm4.invoke(() -> WANTestBase.createAsyncEventQueue( "ln",
         false, 100, 100, false, false, null, false ));
@@ -1010,14 +980,12 @@ public class WanValidationsDUnitTest extends WANTestBase {
     Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 ));
     Integer nyPort = (Integer)vm1.invoke(() -> WANTestBase.createFirstRemoteLocator( 2, lnPort ));
 
+    createCacheInVMs(nyPort, vm2);
     vm2.invoke(() -> WANTestBase.createReceiver( nyPort ));
     vm2.invoke(() -> WANTestBase.createPartitionedRegion(
       getTestMethodName() + "_RR", null, 1, 100, isOffHeap() ));
 
-    vm4.invoke(createCacheRunnable(lnPort));
-    vm5.invoke(createCacheRunnable(lnPort));
-    vm6.invoke(createCacheRunnable(lnPort));
-    vm7.invoke(createCacheRunnable(lnPort));
+    createCacheInVMs(lnPort, vm4, vm5, vm6, vm7);
 
     vm4.invoke(() -> WANTestBase.createSender( "ln", 2,
         false, 100, 10, false, false, null, true ));
@@ -1027,12 +995,9 @@ public class WanValidationsDUnitTest extends WANTestBase {
       false, 100, 10, false, false, null, true ));
     vm7.invoke(() -> WANTestBase.createSender( "ln", 2,
       false, 100, 10, false, false, null, true ));
-    
-    vm4.invoke(() -> WANTestBase.startSender( "ln" ));
-    vm5.invoke(() -> WANTestBase.startSender( "ln" ));
-    vm6.invoke(() -> WANTestBase.startSender( "ln" ));
-    vm7.invoke(() -> WANTestBase.startSender( "ln" ));
-    
+
+    startSenderInVMs("ln", vm4, vm5, vm6, vm7);
+
     vm4.invoke(() -> WANTestBase.createPartitionedRegion(
         getTestMethodName() + "_PR", null, 1, 100, isOffHeap() ));
     vm5.invoke(() -> WANTestBase.createPartitionedRegion(
@@ -1067,10 +1032,7 @@ public class WanValidationsDUnitTest extends WANTestBase {
   public void testBug50434_PR_SerialAsyncEventQueue() throws Exception {
     Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 ));
 
-    vm4.invoke(createCacheRunnable(lnPort));
-    vm5.invoke(createCacheRunnable(lnPort));
-    vm6.invoke(createCacheRunnable(lnPort));
-    vm7.invoke(createCacheRunnable(lnPort));
+    createCacheInVMs(lnPort, vm4, vm5, vm6, vm7);
 
     vm4.invoke(() -> WANTestBase.createAsyncEventQueue( "ln",
         false, 100, 100, false, false, null, false ));
@@ -1111,14 +1073,12 @@ public class WanValidationsDUnitTest extends WANTestBase {
     Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 ));
     Integer nyPort = (Integer)vm1.invoke(() -> WANTestBase.createFirstRemoteLocator( 2, lnPort ));
 
+    createCacheInVMs(nyPort, vm2);
     vm2.invoke(() -> WANTestBase.createReceiver( nyPort ));
     vm2.invoke(() -> WANTestBase.createPartitionedRegion(
       getTestMethodName() + "_PR", null, 1, 100, isOffHeap() ));
 
-    vm4.invoke(createCacheRunnable(lnPort));
-    vm5.invoke(createCacheRunnable(lnPort));
-    vm6.invoke(createCacheRunnable(lnPort));
-    vm7.invoke(createCacheRunnable(lnPort));
+    createCacheInVMs(lnPort, vm4, vm5, vm6, vm7);
 
     vm4.invoke(() -> WANTestBase.createSender( "ln", 2,
         false, 100, 10, false, false, null, true ));
@@ -1128,12 +1088,9 @@ public class WanValidationsDUnitTest extends WANTestBase {
       false, 100, 10, false, false, null, true ));
     vm7.invoke(() -> WANTestBase.createSender( "ln", 2,
       false, 100, 10, false, false, null, true ));
-    
-    vm4.invoke(() -> WANTestBase.startSender( "ln" ));
-    vm5.invoke(() -> WANTestBase.startSender( "ln" ));
-    vm6.invoke(() -> WANTestBase.startSender( "ln" ));
-    vm7.invoke(() -> WANTestBase.startSender( "ln" ));
-    
+
+    startSenderInVMs("ln", vm4, vm5, vm6, vm7);
+
     vm4.invoke(() -> WANTestBase.createPartitionedRegion(
         getTestMethodName() + "_PR", null, 1, 100, isOffHeap() ));
     vm5.invoke(() -> WANTestBase.createPartitionedRegion(
@@ -1167,10 +1124,7 @@ public class WanValidationsDUnitTest extends WANTestBase {
   public void testBug50434_PR_SerialAsyncEventQueue_Pass() throws Exception {
     Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 ));
 
-    vm4.invoke(createCacheRunnable(lnPort));
-    vm5.invoke(createCacheRunnable(lnPort));
-    vm6.invoke(createCacheRunnable(lnPort));
-    vm7.invoke(createCacheRunnable(lnPort));
+    createCacheInVMs(lnPort, vm4, vm5, vm6, vm7);
 
     vm4.invoke(() -> WANTestBase.createAsyncEventQueue( "ln",
         false, 100, 100, false, false, null, false ));
@@ -1212,22 +1166,19 @@ public class WanValidationsDUnitTest extends WANTestBase {
     Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 ));
     Integer nyPort = (Integer)vm1.invoke(() -> WANTestBase.createFirstRemoteLocator( 2, lnPort ));
 
-    vm2.invoke(() -> WANTestBase.createReceiver( nyPort ));
+    createCacheInVMs(nyPort, vm2);
     vm2.invoke(() -> WANTestBase.createPartitionedRegion(
       getTestMethodName() + "_PR", null, 1, 10, isOffHeap()));
+    vm2.invoke(() -> WANTestBase.createReceiver( nyPort ));
 
-    vm4.invoke(createCacheRunnable(lnPort));
-    vm5.invoke(createCacheRunnable(lnPort));
-    vm6.invoke(createCacheRunnable(lnPort));
-    vm7.invoke(createCacheRunnable(lnPort));
+    createCacheInVMs(lnPort, vm4, vm5, vm6, vm7);
 
     vm4.invoke(() -> WANTestBase.createSender( "ln", 2,
         true, 100, 10, false, false, null, true ));
     vm5.invoke(() -> WANTestBase.createSender( "ln", 2,
       true, 100, 10, false, false, null, true ));
-    vm4.invoke(() -> WANTestBase.startSender( "ln" ));
-    vm5.invoke(() -> WANTestBase.startSender( "ln" ));
-    
+    startSenderInVMs("ln", vm4, vm5);
+
     vm4.invoke(() -> WANTestBase.createPartitionedRegion(
         getTestMethodName() + "_PR", null, 1, 10, isOffHeap()));
     vm5.invoke(() -> WANTestBase.createPartitionedRegion(
@@ -1261,10 +1212,7 @@ public class WanValidationsDUnitTest extends WANTestBase {
   public void testBug50434_PR_ParallelAsyncEventQueue() throws Exception {
     Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 ));
 
-    vm4.invoke(createCacheRunnable(lnPort));
-    vm5.invoke(createCacheRunnable(lnPort));
-    vm6.invoke(createCacheRunnable(lnPort));
-    vm7.invoke(createCacheRunnable(lnPort));
+    createCacheInVMs(lnPort, vm4, vm5, vm6, vm7);
 
     vm4.invoke(() -> WANTestBase.createAsyncEventQueue( "ln",
         true, 100, 100, false, false, null, false ));
@@ -1305,14 +1253,12 @@ public class WanValidationsDUnitTest extends WANTestBase {
     Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 ));
     Integer nyPort = (Integer)vm1.invoke(() -> WANTestBase.createFirstRemoteLocator( 2, lnPort ));
 
-    vm2.invoke(() -> WANTestBase.createReceiver( nyPort ));
+    createCacheInVMs(nyPort, vm2);
     vm2.invoke(() -> WANTestBase.createPartitionedRegion(
       getTestMethodName() + "_PR", null, 1, 10, isOffHeap()));
+    vm2.invoke(() -> WANTestBase.createReceiver( nyPort ));
 
-    vm4.invoke(createCacheRunnable(lnPort));
-    vm5.invoke(createCacheRunnable(lnPort));
-    vm6.invoke(createCacheRunnable(lnPort));
-    vm7.invoke(createCacheRunnable(lnPort));
+    createCacheInVMs(lnPort, vm4, vm5, vm6, vm7);
 
     vm4.invoke(() -> WANTestBase.createSender( "ln", 2,
         true, 100, 10, false, false, null, true ));
@@ -1332,10 +1278,7 @@ public class WanValidationsDUnitTest extends WANTestBase {
     vm7.invoke(() -> WANTestBase.createPartitionedRegion(
       getTestMethodName() + "_PR", null, 1, 10, isOffHeap()));
 
-    vm4.invoke(() -> WANTestBase.startSender( "ln" ));
-    vm5.invoke(() -> WANTestBase.startSender( "ln" ));
-    vm6.invoke(() -> WANTestBase.startSender( "ln" ));
-    vm7.invoke(() -> WANTestBase.startSender( "ln" ));
+    startSenderInVMs("ln", vm4, vm5, vm6, vm7);
     
     vm4.invoke(() -> WANTestBase.addSenderThroughAttributesMutator(
       getTestMethodName() + "_PR", "ln"));
@@ -1356,10 +1299,7 @@ public class WanValidationsDUnitTest extends WANTestBase {
   public void testBug50434_PR_ParallelAsyncEventQueue_Pass() throws Exception {
     Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 ));
 
-    vm4.invoke(createCacheRunnable(lnPort));
-    vm5.invoke(createCacheRunnable(lnPort));
-    vm6.invoke(createCacheRunnable(lnPort));
-    vm7.invoke(createCacheRunnable(lnPort));
+    createCacheInVMs(lnPort, vm4, vm5, vm6, vm7);
 
     vm4.invoke(() -> WANTestBase.createAsyncEventQueue( "ln",
         true, 100, 100, false, false, null, false ));
@@ -1412,9 +1352,8 @@ public class WanValidationsDUnitTest extends WANTestBase {
     IgnoredException.addIgnoredException("could not get remote locator information");
     Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 ));
 
-    vm4.invoke(createCacheRunnable(lnPort));
-    vm5.invoke(createCacheRunnable(lnPort));
-    
+    createCacheInVMs(lnPort, vm4, vm5);
+
     try {
       vm4.invoke(() -> WANTestBase.createSender( "ln1", 2,
           true, 10, 100, false, false, null, false ));
@@ -1459,10 +1398,7 @@ public class WanValidationsDUnitTest extends WANTestBase {
     Integer nyPort = (Integer)vm1.invoke(() -> WANTestBase.createFirstRemoteLocator( 2, lnPort ));
 
     // ------------ START - CREATE CACHE, REGION ON LOCAL SITE ------------//
-    vm4.invoke(createCacheRunnable(lnPort));
-    vm5.invoke(createCacheRunnable(lnPort));
-    vm6.invoke(createCacheRunnable(lnPort));
-    vm7.invoke(createCacheRunnable(lnPort));
+    createCacheInVMs(lnPort, vm4, vm5, vm6, vm7);
 
     vm4.invoke(() -> WANTestBase.createSender( "ln", 2,
         false, 100, 10, false, false, null, true ));
@@ -1478,8 +1414,7 @@ public class WanValidationsDUnitTest extends WANTestBase {
     vm7.invoke(() -> WANTestBase.createAsyncEventQueue(
         "lnAsync", false, 100, 100, false, false, null, false ));
 
-    vm4.invoke(() -> WANTestBase.startSender( "ln" ));
-    vm5.invoke(() -> WANTestBase.startSender( "ln" ));
+    startSenderInVMs("ln", vm4, vm5);
 
     vm4.invoke(() -> WANTestBase.createReplicatedRegionWithSenderAndAsyncEventQueue(
             getTestMethodName() + "_RR", "ln", "lnAsync", isOffHeap() ));
@@ -1492,8 +1427,8 @@ public class WanValidationsDUnitTest extends WANTestBase {
     // ------------- END - CREATE CACHE, REGION ON LOCAL SITE -------------//
 
     // ------------- START - CREATE CACHE ON REMOTE SITE ---------------//
-    vm2.invoke(() -> WANTestBase.createReceiver( nyPort ));
-    vm3.invoke(() -> WANTestBase.createReceiver( nyPort ));
+    createCacheInVMs(nyPort, vm2, vm3);
+    createReceiverInVMs(nyPort, vm2, vm3);
 
     vm2.invoke(() -> WANTestBase.createSender( "ny", 1,
         false, 100, 10, false, false, null, true ));
@@ -1505,8 +1440,7 @@ public class WanValidationsDUnitTest extends WANTestBase {
     vm3.invoke(() -> WANTestBase.createAsyncEventQueue(
         "nyAsync", false, 100, 100, false, false, null, false ));
 
-    vm2.invoke(() -> WANTestBase.startSender( "ny" ));
-    vm3.invoke(() -> WANTestBase.startSender( "ny" ));
+    startSenderInVMs("ny", vm2, vm3);
 
     vm2.invoke(() -> WANTestBase.createReplicatedRegionWithSenderAndAsyncEventQueue(
             getTestMethodName() + "_RR", "ny", "nyAsync", isOffHeap() ));

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/65d7a6f1/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/parallel/ParallelGatewaySenderOperationsDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/parallel/ParallelGatewaySenderOperationsDUnitTest.java b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/parallel/ParallelGatewaySenderOperationsDUnitTest.java
index 57eb3de..3f0329a 100644
--- a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/parallel/ParallelGatewaySenderOperationsDUnitTest.java
+++ b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/parallel/ParallelGatewaySenderOperationsDUnitTest.java
@@ -175,11 +175,10 @@ public class ParallelGatewaySenderOperationsDUnitTest extends WANTestBase {
     Integer lnPort = locatorPorts[0];
     Integer nyPort = locatorPorts[1];
 
-    vm2.invoke(() -> WANTestBase.createReceiver( nyPort ));
-    vm3.invoke(() -> WANTestBase.createReceiver( nyPort ));
+    createCacheInVMs(nyPort, vm2, vm3);
+    createReceiverInVMs(nyPort, vm2, vm3);
 
-    vm4.invoke(() -> WANTestBase.createCache( lnPort ));
-    vm5.invoke(() -> WANTestBase.createCache( lnPort ));
+    createCacheInVMs(lnPort, vm4, vm5);
 
     vm4.invoke(() -> WANTestBase.createSender( "ln", 2,
         true, 100, 10, false, false, null, true ));
@@ -195,9 +194,8 @@ public class ParallelGatewaySenderOperationsDUnitTest extends WANTestBase {
       getTestMethodName() + "_PR", null, 1, 100, isOffHeap() ));
     vm3.invoke(() -> WANTestBase.createPartitionedRegion(
       getTestMethodName() + "_PR", null, 1, 100, isOffHeap() ));
-  
-    vm4.invoke(() -> WANTestBase.startSender( "ln" ));
-    vm5.invoke(() -> WANTestBase.startSender( "ln" ));
+
+    startSenderInVMs("ln", vm4, vm5);
 
     //wait till the senders are running
     vm4.invoke(() -> WANTestBase.waitForSenderRunningState( "ln" ));
@@ -283,7 +281,7 @@ public class ParallelGatewaySenderOperationsDUnitTest extends WANTestBase {
     vm2.invoke(() -> WANTestBase.validateRegionSizeRemainsSame(getTestMethodName() + "_PR", 200 ));
     
     //start the senders again
-    startSenders();
+    startSenderInVMs("ln", vm4, vm5, vm6, vm7);
 
     //Region size on remote site should remain same and below the number of puts done in the FIRST RUN
     vm2.invoke(() -> WANTestBase.validateRegionSizeRemainsSame(getTestMethodName() + "_PR", 200 ));
@@ -349,10 +347,7 @@ public class ParallelGatewaySenderOperationsDUnitTest extends WANTestBase {
 
     LogWriterUtils.getLogWriter().info("Starting the senders at the same time");
     //when puts are happening by another thread, start the senders
-    vm4.invokeAsync(() -> WANTestBase.startSender( "ln" ));
-    vm5.invokeAsync(() -> WANTestBase.startSender( "ln" ));
-    vm6.invokeAsync(() -> WANTestBase.startSender( "ln" ));
-    vm7.invokeAsync(() -> WANTestBase.startSender( "ln" ));
+    startSenderInVMsAsync("ln", vm4, vm5, vm6, vm7);
 
     LogWriterUtils.getLogWriter().info("All the senders are started");
     
@@ -399,7 +394,7 @@ public class ParallelGatewaySenderOperationsDUnitTest extends WANTestBase {
     vm2.invoke(() -> WANTestBase.validateRegionSizeRemainsSame(getTestMethodName() + "_PR", 200 ));
     
     //start the senders again
-    startSenders();
+    startSenderInVMs("ln", vm4, vm5, vm6, vm7);
 
     //Region size on remote site should remain same and below the number of puts done in the FIRST RUN
     vm2.invoke(() -> WANTestBase.validateRegionSizeRemainsSame(getTestMethodName() + "_PR", 200 ));
@@ -435,10 +430,7 @@ public class ParallelGatewaySenderOperationsDUnitTest extends WANTestBase {
     //During sender start, it will wait until those buckets are created for shadowPR as well.
     //Start the senders in async threads, so colocation of shadowPR will be complete and 
     //missing buckets will be created in PRHARedundancyProvider.createMissingBuckets().
-    vm4.invokeAsync(() -> WANTestBase.startSender( "ln" ));
-    vm5.invokeAsync(() -> WANTestBase.startSender( "ln" ));
-    vm6.invokeAsync(() -> WANTestBase.startSender( "ln" ));
-    vm7.invokeAsync(() -> WANTestBase.startSender( "ln" ));
+    startSenderInVMsAsync("ln", vm4, vm5, vm6, vm7);
 
     waitForSendersRunning();
     
@@ -581,8 +573,9 @@ public class ParallelGatewaySenderOperationsDUnitTest extends WANTestBase {
     // Start receiver
     IgnoredException ignoredMTLE = IgnoredException.addIgnoredException(MessageTooLargeException.class.getName(), vm4);
     IgnoredException ignoredGIOE = IgnoredException.addIgnoredException(GemFireIOException.class.getName(), vm4);
-    vm2.invoke(() -> createReceiver( nyPort ));
+    vm2.invoke(() -> createCache( nyPort ));
     vm2.invoke(() -> createPartitionedRegion( regionName, null, 0, 100, isOffHeap() ));
+    vm2.invoke(() -> createReceiver( nyPort ));
     validateRegionSizes( regionName, numPuts, vm2 );
 
     vm4.invoke(() -> {
@@ -607,20 +600,17 @@ public class ParallelGatewaySenderOperationsDUnitTest extends WANTestBase {
     createPartitionedRegions(createAccessors);
 
     if (startSenders) {
-      startSenders();
+      startSenderInVMs("ln", vm4, vm5, vm6, vm7);
     }
   }
 
   private void createSendersAndReceivers(Integer lnPort, Integer nyPort) {
     // Note: This is a test-specific method used by several test to create
     // receivers and senders.
-    vm2.invoke(() -> createReceiver(nyPort));
-    vm3.invoke(() -> createReceiver(nyPort));
+    createCacheInVMs(nyPort, vm2, vm3);
+    createReceiverInVMs(nyPort, vm2, vm3);
 
-    vm4.invoke(() -> createCache(lnPort));
-    vm5.invoke(() -> createCache(lnPort));
-    vm6.invoke(() -> createCache(lnPort));
-    vm7.invoke(() -> createCache(lnPort));
+    createCacheInVMs(lnPort, vm4, vm5, vm6, vm7);
 
     vm4.invoke(() -> createSender("ln", 2, true, 100, 10, false, false, null, true));
     vm5.invoke(() -> createSender("ln", 2, true, 100, 10, false, false, null, true));
@@ -647,13 +637,6 @@ public class ParallelGatewaySenderOperationsDUnitTest extends WANTestBase {
     vm3.invoke(() -> createPartitionedRegion(regionName, "ln", 1, 100, isOffHeap()));
   }
 
-  private void startSenders() {
-    vm4.invoke(() -> startSender("ln"));
-    vm5.invoke(() -> startSender("ln"));
-    vm6.invoke(() -> startSender("ln"));
-    vm7.invoke(() -> startSender("ln"));
-  }
-
   private void stopSenders() {
     vm4.invoke(() -> stopSender("ln"));
     vm5.invoke(() -> stopSender("ln"));

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/65d7a6f1/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/parallel/ParallelGatewaySenderQueueOverflowDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/parallel/ParallelGatewaySenderQueueOverflowDUnitTest.java b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/parallel/ParallelGatewaySenderQueueOverflowDUnitTest.java
index 615bba9..07c2610 100644
--- a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/parallel/ParallelGatewaySenderQueueOverflowDUnitTest.java
+++ b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/parallel/ParallelGatewaySenderQueueOverflowDUnitTest.java
@@ -60,13 +60,10 @@ public class ParallelGatewaySenderQueueOverflowDUnitTest extends WANTestBase {
     Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 ));
     Integer nyPort = (Integer)vm1.invoke(() -> WANTestBase.createFirstRemoteLocator( 2, lnPort ));
 
-    vm2.invoke(() -> WANTestBase.createReceiver( nyPort ));
-    vm3.invoke(() -> WANTestBase.createReceiver( nyPort ));
+    createCacheInVMs(nyPort, vm2, vm3);
+    createReceiverInVMs(nyPort, vm2, vm3);
 
-    vm4.invoke(() -> WANTestBase.createCache( lnPort ));
-    vm5.invoke(() -> WANTestBase.createCache( lnPort ));
-    vm6.invoke(() -> WANTestBase.createCache( lnPort ));
-    vm7.invoke(() -> WANTestBase.createCache( lnPort ));
+    createCacheInVMs(lnPort, vm4, vm5, vm6, vm7);
 
     vm4.invoke(() -> WANTestBase.createSenderWithoutDiskStore( "ln", 2,
         true, 10, 10, false, false, null, true ));
@@ -86,10 +83,7 @@ public class ParallelGatewaySenderQueueOverflowDUnitTest extends WANTestBase {
     vm7.invoke(() -> WANTestBase.createPartitionedRegion(
         getTestMethodName(), "ln", 1, 100, isOffHeap() ));
 
-    vm4.invoke(() -> WANTestBase.startSender( "ln" ));
-    vm5.invoke(() -> WANTestBase.startSender( "ln" ));
-    vm6.invoke(() -> WANTestBase.startSender( "ln" ));
-    vm7.invoke(() -> WANTestBase.startSender( "ln" ));
+    startSenderInVMs("ln", vm4, vm5, vm6, vm7);
     
     vm4.invoke(() -> WANTestBase.pauseSender( "ln" ));
     vm5.invoke(() -> WANTestBase.pauseSender( "ln" ));
@@ -146,13 +140,10 @@ public class ParallelGatewaySenderQueueOverflowDUnitTest extends WANTestBase {
     Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 ));
     Integer nyPort = (Integer)vm1.invoke(() -> WANTestBase.createFirstRemoteLocator( 2, lnPort ));
 
-    vm2.invoke(() -> WANTestBase.createReceiver( nyPort ));
-    vm3.invoke(() -> WANTestBase.createReceiver( nyPort ));
+    createCacheInVMs(nyPort, vm2, vm3);
+    createReceiverInVMs(nyPort, vm2, vm3);
 
-    vm4.invoke(() -> WANTestBase.createCache( lnPort ));
-    vm5.invoke(() -> WANTestBase.createCache( lnPort ));
-    vm6.invoke(() -> WANTestBase.createCache( lnPort ));
-    vm7.invoke(() -> WANTestBase.createCache( lnPort ));
+    createCacheInVMs(lnPort, vm4, vm5, vm6, vm7);
 
     vm4.invoke(() -> WANTestBase.createSender( "ln", 2,
         true, 10, 10, false, false, null, true ));
@@ -172,10 +163,7 @@ public class ParallelGatewaySenderQueueOverflowDUnitTest extends WANTestBase {
     vm7.invoke(() -> WANTestBase.createPartitionedRegion(
         getTestMethodName(), "ln", 1, 100, isOffHeap() ));
 
-    vm4.invoke(() -> WANTestBase.startSender( "ln" ));
-    vm5.invoke(() -> WANTestBase.startSender( "ln" ));
-    vm6.invoke(() -> WANTestBase.startSender( "ln" ));
-    vm7.invoke(() -> WANTestBase.startSender( "ln" ));
+    startSenderInVMs("ln", vm4, vm5, vm6, vm7);
     
     vm4.invoke(() -> WANTestBase.pauseSender( "ln" ));
     vm5.invoke(() -> WANTestBase.pauseSender( "ln" ));
@@ -233,13 +221,10 @@ public class ParallelGatewaySenderQueueOverflowDUnitTest extends WANTestBase {
     Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 ));
     Integer nyPort = (Integer)vm1.invoke(() -> WANTestBase.createFirstRemoteLocator( 2, lnPort ));
 
-    vm2.invoke(() -> WANTestBase.createReceiver( nyPort ));
-    vm3.invoke(() -> WANTestBase.createReceiver( nyPort ));
+    createCacheInVMs(nyPort, vm2, vm3);
+    createReceiverInVMs(nyPort, vm2, vm3);
 
-    vm4.invoke(() -> WANTestBase.createCache( lnPort ));
-    vm5.invoke(() -> WANTestBase.createCache( lnPort ));
-    vm6.invoke(() -> WANTestBase.createCache( lnPort ));
-    vm7.invoke(() -> WANTestBase.createCache( lnPort ));
+    createCacheInVMs(lnPort, vm4, vm5, vm6, vm7);
 
     vm4.invoke(() -> WANTestBase.createSender( "ln", 2,
         true, 10, 10, false, false, null, true ));
@@ -259,11 +244,8 @@ public class ParallelGatewaySenderQueueOverflowDUnitTest extends WANTestBase {
     vm7.invoke(() -> WANTestBase.createPartitionedRegion(
         getTestMethodName(), "ln", 1, 100, isOffHeap() ));
 
-    vm4.invoke(() -> WANTestBase.startSender( "ln" ));
-    vm5.invoke(() -> WANTestBase.startSender( "ln" ));
-    vm6.invoke(() -> WANTestBase.startSender( "ln" ));
-    vm7.invoke(() -> WANTestBase.startSender( "ln" ));
-    
+    startSenderInVMs("ln", vm4, vm5, vm6, vm7);
+
     vm4.invoke(() -> WANTestBase.pauseSender( "ln" ));
     vm5.invoke(() -> WANTestBase.pauseSender( "ln" ));
     vm6.invoke(() -> WANTestBase.pauseSender( "ln" ));
@@ -320,13 +302,10 @@ public class ParallelGatewaySenderQueueOverflowDUnitTest extends WANTestBase {
     Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 ));
     Integer nyPort = (Integer)vm1.invoke(() -> WANTestBase.createFirstRemoteLocator( 2, lnPort ));
 
-    vm2.invoke(() -> WANTestBase.createReceiver( nyPort ));
-    vm3.invoke(() -> WANTestBase.createReceiver( nyPort ));
+    createCacheInVMs(nyPort, vm2, vm3);
+    createReceiverInVMs(nyPort, vm2, vm3);
 
-    vm4.invoke(() -> WANTestBase.createCache( lnPort ));
-    vm5.invoke(() -> WANTestBase.createCache( lnPort ));
-    vm6.invoke(() -> WANTestBase.createCache( lnPort ));
-    vm7.invoke(() -> WANTestBase.createCache( lnPort ));
+    createCacheInVMs(lnPort, vm4, vm5, vm6, vm7);
 
     vm4.invoke(() -> WANTestBase.createSender( "ln", 2,
         true, 10, 10, false, false, null, true ));
@@ -346,10 +325,7 @@ public class ParallelGatewaySenderQueueOverflowDUnitTest extends WANTestBase {
     vm7.invoke(() -> WANTestBase.createPartitionedRegion(
         getTestMethodName(), "ln", 1, 100, isOffHeap() ));
 
-    vm4.invoke(() -> WANTestBase.startSender( "ln" ));
-    vm5.invoke(() -> WANTestBase.startSender( "ln" ));
-    vm6.invoke(() -> WANTestBase.startSender( "ln" ));
-    vm7.invoke(() -> WANTestBase.startSender( "ln" ));
+    startSenderInVMs("ln", vm4, vm5, vm6, vm7);
     
     vm4.invoke(() -> WANTestBase.pauseSender( "ln" ));
     vm5.invoke(() -> WANTestBase.pauseSender( "ln" ));

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/65d7a6f1/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/parallel/ParallelWANConflationDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/parallel/ParallelWANConflationDUnitTest.java b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/parallel/ParallelWANConflationDUnitTest.java
index ab96947..ab261fd 100644
--- a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/parallel/ParallelWANConflationDUnitTest.java
+++ b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/parallel/ParallelWANConflationDUnitTest.java
@@ -88,8 +88,8 @@ public class ParallelWANConflationDUnitTest extends WANTestBase {
     true, 100, 50, false, false, null, true ));
   
     createSenderPRs();
-    
-    startSenders();
+
+    startSenderInVMs("ln", vm4, vm5, vm6, vm7);
     
     pauseSenders();
     
@@ -424,7 +424,7 @@ public class ParallelWANConflationDUnitTest extends WANTestBase {
   }
 
   protected void startPausedSenders() {
-    startSenders();
+    startSenderInVMs("ln", vm4, vm5, vm6, vm7);
 
     pauseSenders();
   }
@@ -435,13 +435,6 @@ public class ParallelWANConflationDUnitTest extends WANTestBase {
     vm6.invoke(() ->pauseSender( "ln" ));
     vm7.invoke(() ->pauseSender( "ln" ));
   }
-
-  protected void startSenders() {
-    vm4.invoke(() ->startSender( "ln" ));
-    vm5.invoke(() ->startSender( "ln" ));
-    vm6.invoke(() ->startSender( "ln" ));
-    vm7.invoke(() ->startSender( "ln" ));
-  }
   
   protected void createSenderPRs() {
     createSenderPRs(0);
@@ -462,13 +455,10 @@ public class ParallelWANConflationDUnitTest extends WANTestBase {
     Integer lnPort = (Integer)vm0.invoke(() ->createFirstLocatorWithDSId( 1 ));
     Integer nyPort = (Integer)vm1.invoke(() ->createFirstRemoteLocator( 2, lnPort ));
 
-    vm2.invoke(() ->createReceiver( nyPort ));
-    vm3.invoke(() ->createReceiver( nyPort ));
+    createCacheInVMs(nyPort, vm2, vm3);
+    createReceiverInVMs(nyPort, vm2, vm3);
 
-    vm4.invoke(() ->createCache(lnPort ));
-    vm5.invoke(() ->createCache(lnPort ));
-    vm6.invoke(() ->createCache(lnPort ));
-    vm7.invoke(() ->createCache(lnPort ));
+    createCacheInVMs(lnPort, vm4, vm5, vm6, vm7);
   }
   
   protected void createSendersNoConflation() {


Mime
View raw message