geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From upthewatersp...@apache.org
Subject [07/56] [abbrv] incubator-geode git commit: Automatically converting calls of vm.invoke to lambdas
Date Tue, 16 Feb 2016 22:11:27 GMT
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/69024aa9/gemfire-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/serial/SerialWANPropagationLoopBackDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/serial/SerialWANPropagationLoopBackDUnitTest.java
b/gemfire-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/serial/SerialWANPropagationLoopBackDUnitTest.java
index 4269b76..bd971ce 100644
--- a/gemfire-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/serial/SerialWANPropagationLoopBackDUnitTest.java
+++ b/gemfire-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/serial/SerialWANPropagationLoopBackDUnitTest.java
@@ -37,85 +37,79 @@ public class SerialWANPropagationLoopBackDUnitTest extends WANTestBase
{
   }
   
   public void testReplicatedSerialPropagationLoopBack() throws Exception {
-    Integer lnPort = (Integer)vm0.invoke(WANTestBase.class,
-        "createFirstLocatorWithDSId", new Object[] { 1 });
-    Integer nyPort = (Integer)vm1.invoke(WANTestBase.class,
-        "createFirstRemoteLocator", new Object[] { 2, lnPort });
+    Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId(
1 ));
+    Integer nyPort = (Integer)vm1.invoke(() -> WANTestBase.createFirstRemoteLocator( 2,
lnPort ));
 
-    vm2.invoke(WANTestBase.class, "createReceiver", new Object[] { lnPort });
-    vm3.invoke(WANTestBase.class, "createReceiver", new Object[] { nyPort });
+    vm2.invoke(() -> WANTestBase.createReceiver( lnPort ));
+    vm3.invoke(() -> WANTestBase.createReceiver( nyPort ));
 
-    vm4.invoke(WANTestBase.class, "createCache", new Object[] { lnPort });
-    vm5.invoke(WANTestBase.class, "createCache", new Object[] { lnPort });
-    vm6.invoke(WANTestBase.class, "createCache", new Object[] { nyPort });
-    vm7.invoke(WANTestBase.class, "createCache", new Object[] { nyPort });
+    vm4.invoke(() -> WANTestBase.createCache( lnPort ));
+    vm5.invoke(() -> WANTestBase.createCache( lnPort ));
+    vm6.invoke(() -> WANTestBase.createCache( nyPort ));
+    vm7.invoke(() -> WANTestBase.createCache( nyPort ));
 
-    vm4.invoke(WANTestBase.class, "createSender", new Object[] { "ln", 2,
-        false, 100, 10, false, false, null, true });
-    vm6.invoke(WANTestBase.class, "createSender", new Object[] { "ny", 1,
-        false, 100, 10, false, false, null, true });
+    vm4.invoke(() -> WANTestBase.createSender( "ln", 2,
+        false, 100, 10, false, false, null, true ));
+    vm6.invoke(() -> WANTestBase.createSender( "ny", 1,
+        false, 100, 10, false, false, null, true ));
 
-    vm2.invoke(WANTestBase.class, "createReplicatedRegion", new Object[] {
-        getTestMethodName() + "_RR", "ln", isOffHeap() });
-    vm3.invoke(WANTestBase.class, "createReplicatedRegion", new Object[] {
-        getTestMethodName() + "_RR", "ny", isOffHeap() });
+    vm2.invoke(() -> WANTestBase.createReplicatedRegion(
+        getTestMethodName() + "_RR", "ln", isOffHeap() ));
+    vm3.invoke(() -> WANTestBase.createReplicatedRegion(
+        getTestMethodName() + "_RR", "ny", isOffHeap() ));
 
-    vm4.invoke(WANTestBase.class, "startSender", new Object[] { "ln" });
-    vm6.invoke(WANTestBase.class, "startSender", new Object[] { "ny" });
-    
-    vm4.invoke(WANTestBase.class, "addQueueListener", new Object[] { "ln",
-        false });
-    vm6.invoke(WANTestBase.class, "addQueueListener", new Object[] { "ny",
-        false });
-    
-    vm4.invoke(WANTestBase.class, "createReplicatedRegion", new Object[] {
-        getTestMethodName() + "_RR", "ln", isOffHeap() });
-    vm5.invoke(WANTestBase.class, "createReplicatedRegion", new Object[] {
-        getTestMethodName() + "_RR", "ln", isOffHeap()});
-    vm6.invoke(WANTestBase.class, "createReplicatedRegion", new Object[] {
-        getTestMethodName() + "_RR", "ny", isOffHeap() });
-    vm7.invoke(WANTestBase.class, "createReplicatedRegion", new Object[] {
-        getTestMethodName() + "_RR", "ny", isOffHeap()});
+    vm4.invoke(() -> WANTestBase.startSender( "ln" ));
+    vm6.invoke(() -> WANTestBase.startSender( "ny" ));
+    
+    vm4.invoke(() -> WANTestBase.addQueueListener( "ln",
+        false ));
+    vm6.invoke(() -> WANTestBase.addQueueListener( "ny",
+        false ));
+    
+    vm4.invoke(() -> WANTestBase.createReplicatedRegion(
+        getTestMethodName() + "_RR", "ln", isOffHeap() ));
+    vm5.invoke(() -> WANTestBase.createReplicatedRegion(
+        getTestMethodName() + "_RR", "ln", isOffHeap()));
+    vm6.invoke(() -> WANTestBase.createReplicatedRegion(
+        getTestMethodName() + "_RR", "ny", isOffHeap() ));
+    vm7.invoke(() -> WANTestBase.createReplicatedRegion(
+        getTestMethodName() + "_RR", "ny", isOffHeap()));
 
     final Map keyValues = new HashMap();
     for(int i=0; i< 1; i++) {
       keyValues.put(i, i);
     }
-    vm4.invoke(WANTestBase.class, "putGivenKeyValue", new Object[] { getTestMethodName()
+ "_RR",
-      keyValues });
+    vm4.invoke(() -> WANTestBase.putGivenKeyValue( getTestMethodName() + "_RR",
+      keyValues ));
     
     keyValues.clear();
     for(int i=1; i< 2; i++) {
       keyValues.put(i, i);
     }
-    vm6.invoke(WANTestBase.class, "putGivenKeyValue", new Object[] { getTestMethodName()
+ "_RR",
-      keyValues });
-    
-    vm2.invoke(WANTestBase.class, "validateRegionSize", new Object[] {
-        getTestMethodName() + "_RR", 2 });
-    vm3.invoke(WANTestBase.class, "validateRegionSize", new Object[] {
-        getTestMethodName() + "_RR", 2 });
-    
-    vm4.invoke(WANTestBase.class, "validateRegionSize", new Object[] {
-      getTestMethodName() + "_RR", 2 });
-    vm5.invoke(WANTestBase.class, "validateRegionSize", new Object[] {
-      getTestMethodName() + "_RR", 2 });
-    vm6.invoke(WANTestBase.class, "validateRegionSize", new Object[] {
-      getTestMethodName() + "_RR", 2 });
-    vm7.invoke(WANTestBase.class, "validateRegionSize", new Object[] {
-      getTestMethodName() + "_RR", 2 });
+    vm6.invoke(() -> WANTestBase.putGivenKeyValue( getTestMethodName() + "_RR",
+      keyValues ));
+    
+    vm2.invoke(() -> WANTestBase.validateRegionSize(
+        getTestMethodName() + "_RR", 2 ));
+    vm3.invoke(() -> WANTestBase.validateRegionSize(
+        getTestMethodName() + "_RR", 2 ));
+    
+    vm4.invoke(() -> WANTestBase.validateRegionSize(
+      getTestMethodName() + "_RR", 2 ));
+    vm5.invoke(() -> WANTestBase.validateRegionSize(
+      getTestMethodName() + "_RR", 2 ));
+    vm6.invoke(() -> WANTestBase.validateRegionSize(
+      getTestMethodName() + "_RR", 2 ));
+    vm7.invoke(() -> WANTestBase.validateRegionSize(
+      getTestMethodName() + "_RR", 2 ));
   
   
     Wait.pause(5000);
-    vm4.invoke(WANTestBase.class, "verifyQueueSize",
-        new Object[] { "ln", 0 });
-    vm6.invoke(WANTestBase.class, "verifyQueueSize",
-        new Object[] { "ny", 0 });
-    
-    Map queueMap1 = (HashMap)vm4.invoke(WANTestBase.class, "checkQueue",
-        new Object[] {});
-    Map queueMap2 = (HashMap)vm6.invoke(WANTestBase.class, "checkQueue",
-        new Object[] {});
+    vm4.invoke(() -> WANTestBase.verifyQueueSize( "ln", 0 ));
+    vm6.invoke(() -> WANTestBase.verifyQueueSize( "ny", 0 ));
+    
+    Map queueMap1 = (HashMap)vm4.invoke(() -> WANTestBase.checkQueue());
+    Map queueMap2 = (HashMap)vm6.invoke(() -> WANTestBase.checkQueue());
 
     List createList1 = (List)queueMap1.get("Create");
     List updateList1 = (List)queueMap1.get("Update");
@@ -131,101 +125,92 @@ public class SerialWANPropagationLoopBackDUnitTest extends WANTestBase
{
   
   
   public void testReplicatedSerialPropagationLoopBack3SitesLoop() throws Exception {
-    Integer lnPort = (Integer)vm0.invoke(WANTestBase.class,
-        "createFirstLocatorWithDSId", new Object[] { 1 });
-    Integer nyPort = (Integer)vm1.invoke(WANTestBase.class,
-        "createFirstRemoteLocator", new Object[] { 2, lnPort });
-    Integer tkPort = (Integer)vm2.invoke(WANTestBase.class,
-        "createFirstRemoteLocator", new Object[] { 3, lnPort });
+    Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId(
1 ));
+    Integer nyPort = (Integer)vm1.invoke(() -> WANTestBase.createFirstRemoteLocator( 2,
lnPort ));
+    Integer tkPort = (Integer)vm2.invoke(() -> WANTestBase.createFirstRemoteLocator( 3,
lnPort ));
 
     
-    vm3.invoke(WANTestBase.class, "createReceiver", new Object[] { lnPort });
-    vm4.invoke(WANTestBase.class, "createReceiver", new Object[] { nyPort });
-    vm5.invoke(WANTestBase.class, "createReceiver", new Object[] { tkPort });
+    vm3.invoke(() -> WANTestBase.createReceiver( lnPort ));
+    vm4.invoke(() -> WANTestBase.createReceiver( nyPort ));
+    vm5.invoke(() -> WANTestBase.createReceiver( tkPort ));
     
-    vm6.invoke(WANTestBase.class, "createCache", new Object[] { lnPort });
-    vm7.invoke(WANTestBase.class, "createCache", new Object[] { nyPort });
+    vm6.invoke(() -> WANTestBase.createCache( lnPort ));
+    vm7.invoke(() -> WANTestBase.createCache( nyPort ));
     // using vm5 for sender in ds 3. cache is already created.
     
-    vm6.invoke(WANTestBase.class, "createSender", new Object[] { "ln", 2,
-        false, 100, 10, false, false, null, true });
-    vm7.invoke(WANTestBase.class, "createSender", new Object[] { "ny", 3,
-        false, 100, 10, false, false, null, true });
-    vm5.invoke(WANTestBase.class, "createSender", new Object[] { "tk", 1,
-      false, 100, 10, false, false, null, true });
+    vm6.invoke(() -> WANTestBase.createSender( "ln", 2,
+        false, 100, 10, false, false, null, true ));
+    vm7.invoke(() -> WANTestBase.createSender( "ny", 3,
+        false, 100, 10, false, false, null, true ));
+    vm5.invoke(() -> WANTestBase.createSender( "tk", 1,
+      false, 100, 10, false, false, null, true ));
 
     
-    vm3.invoke(WANTestBase.class, "createReplicatedRegion", new Object[] {
-        getTestMethodName() + "_RR", "ln", isOffHeap()});
-    vm4.invoke(WANTestBase.class, "createReplicatedRegion", new Object[] {
-        getTestMethodName() + "_RR", "ny", isOffHeap()});
-    vm5.invoke(WANTestBase.class, "createReplicatedRegion", new Object[] {
-        getTestMethodName() + "_RR", "tk", isOffHeap()});
+    vm3.invoke(() -> WANTestBase.createReplicatedRegion(
+        getTestMethodName() + "_RR", "ln", isOffHeap()));
+    vm4.invoke(() -> WANTestBase.createReplicatedRegion(
+        getTestMethodName() + "_RR", "ny", isOffHeap()));
+    vm5.invoke(() -> WANTestBase.createReplicatedRegion(
+        getTestMethodName() + "_RR", "tk", isOffHeap()));
 
-    vm6.invoke(WANTestBase.class, "startSender", new Object[] { "ln" });
-    vm7.invoke(WANTestBase.class, "startSender", new Object[] { "ny" });
-    vm5.invoke(WANTestBase.class, "startSender", new Object[] { "tk" });
-    
-    vm6.invoke(WANTestBase.class, "addQueueListener", new Object[] { "ln",
-      false });
-    vm7.invoke(WANTestBase.class, "addQueueListener", new Object[] { "ny",
-      false });
-    vm5.invoke(WANTestBase.class, "addQueueListener", new Object[] { "tk",
-      false });
+    vm6.invoke(() -> WANTestBase.startSender( "ln" ));
+    vm7.invoke(() -> WANTestBase.startSender( "ny" ));
+    vm5.invoke(() -> WANTestBase.startSender( "tk" ));
+    
+    vm6.invoke(() -> WANTestBase.addQueueListener( "ln",
+      false ));
+    vm7.invoke(() -> WANTestBase.addQueueListener( "ny",
+      false ));
+    vm5.invoke(() -> WANTestBase.addQueueListener( "tk",
+      false ));
   
     
-    vm6.invoke(WANTestBase.class, "createReplicatedRegion", new Object[] {
-        getTestMethodName() + "_RR", "ln", isOffHeap() });
-    vm7.invoke(WANTestBase.class, "createReplicatedRegion", new Object[] {
-        getTestMethodName() + "_RR", "ny", isOffHeap() });
+    vm6.invoke(() -> WANTestBase.createReplicatedRegion(
+        getTestMethodName() + "_RR", "ln", isOffHeap() ));
+    vm7.invoke(() -> WANTestBase.createReplicatedRegion(
+        getTestMethodName() + "_RR", "ny", isOffHeap() ));
 
 
     final Map keyValues = new HashMap();
     for(int i=0; i< 1; i++) {
       keyValues.put(i, i);
     }
-    vm3.invoke(WANTestBase.class, "putGivenKeyValue", new Object[] { getTestMethodName()
+ "_RR",
-      keyValues });
+    vm3.invoke(() -> WANTestBase.putGivenKeyValue( getTestMethodName() + "_RR",
+      keyValues ));
     
     keyValues.clear();
     for(int i=1; i< 2; i++) {
       keyValues.put(i, i);
     }
-    vm4.invoke(WANTestBase.class, "putGivenKeyValue", new Object[] { getTestMethodName()
+ "_RR",
-      keyValues });
+    vm4.invoke(() -> WANTestBase.putGivenKeyValue( getTestMethodName() + "_RR",
+      keyValues ));
     
     keyValues.clear();
     for(int i=2; i< 3; i++) {
       keyValues.put(i, i);
     }
-    vm5.invoke(WANTestBase.class, "putGivenKeyValue", new Object[] { getTestMethodName()
+ "_RR",
-      keyValues });
+    vm5.invoke(() -> WANTestBase.putGivenKeyValue( getTestMethodName() + "_RR",
+      keyValues ));
     
         
-    vm5.invoke(WANTestBase.class, "validateRegionSize", new Object[] {
-        getTestMethodName() + "_RR", 3 });
-    vm6.invoke(WANTestBase.class, "validateRegionSize", new Object[] {
-        getTestMethodName() + "_RR", 3 });
-    vm7.invoke(WANTestBase.class, "validateRegionSize", new Object[] {
-        getTestMethodName() + "_RR", 3 });
+    vm5.invoke(() -> WANTestBase.validateRegionSize(
+        getTestMethodName() + "_RR", 3 ));
+    vm6.invoke(() -> WANTestBase.validateRegionSize(
+        getTestMethodName() + "_RR", 3 ));
+    vm7.invoke(() -> WANTestBase.validateRegionSize(
+        getTestMethodName() + "_RR", 3 ));
     
     
     Wait.pause(5000);
-    vm6.invoke(WANTestBase.class, "verifyQueueSize",
-        new Object[] { "ln", 0 });
-    vm7.invoke(WANTestBase.class, "verifyQueueSize",
-        new Object[] { "ny", 0 });
-    vm5.invoke(WANTestBase.class, "verifyQueueSize",
-        new Object[] { "tk", 0 });
+    vm6.invoke(() -> WANTestBase.verifyQueueSize( "ln", 0 ));
+    vm7.invoke(() -> WANTestBase.verifyQueueSize( "ny", 0 ));
+    vm5.invoke(() -> WANTestBase.verifyQueueSize( "tk", 0 ));
     
     
     
-    Map queueMap1 = (HashMap)vm6.invoke(WANTestBase.class, "checkQueue",
-        new Object[] {});
-    Map queueMap2 = (HashMap)vm7.invoke(WANTestBase.class, "checkQueue",
-        new Object[] {});
-    Map queueMap3 = (HashMap)vm5.invoke(WANTestBase.class, "checkQueue",
-        new Object[] {});
+    Map queueMap1 = (HashMap)vm6.invoke(() -> WANTestBase.checkQueue());
+    Map queueMap2 = (HashMap)vm7.invoke(() -> WANTestBase.checkQueue());
+    Map queueMap3 = (HashMap)vm5.invoke(() -> WANTestBase.checkQueue());
     
     List createList1 = (List)queueMap1.get("Create");
     List updateList1 = (List)queueMap1.get("Update");
@@ -245,129 +230,114 @@ public class SerialWANPropagationLoopBackDUnitTest extends WANTestBase
{
   
   
   public void testReplicatedSerialPropagationLoopBack3SitesNtoNPutInAllDS() throws Exception
{
-    Integer lnPort = (Integer)vm0.invoke(WANTestBase.class,
-        "createFirstLocatorWithDSId", new Object[] { 1 });
-    Integer nyPort = (Integer)vm1.invoke(WANTestBase.class,
-        "createFirstRemoteLocator", new Object[] { 2, lnPort });
-    Integer tkPort = (Integer)vm2.invoke(WANTestBase.class,
-        "createFirstRemoteLocator", new Object[] { 3, lnPort });
+    Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId(
1 ));
+    Integer nyPort = (Integer)vm1.invoke(() -> WANTestBase.createFirstRemoteLocator( 2,
lnPort ));
+    Integer tkPort = (Integer)vm2.invoke(() -> WANTestBase.createFirstRemoteLocator( 3,
lnPort ));
 
     
-    vm3.invoke(WANTestBase.class, "createReceiver", new Object[] { lnPort });
-    vm4.invoke(WANTestBase.class, "createReceiver", new Object[] { nyPort });
-    vm5.invoke(WANTestBase.class, "createReceiver", new Object[] { tkPort });
+    vm3.invoke(() -> WANTestBase.createReceiver( lnPort ));
+    vm4.invoke(() -> WANTestBase.createReceiver( nyPort ));
+    vm5.invoke(() -> WANTestBase.createReceiver( tkPort ));
     
-    vm6.invoke(WANTestBase.class, "createCache", new Object[] { lnPort });
-    vm7.invoke(WANTestBase.class, "createCache", new Object[] { nyPort });
+    vm6.invoke(() -> WANTestBase.createCache( lnPort ));
+    vm7.invoke(() -> WANTestBase.createCache( nyPort ));
     // using vm5 for sender in ds 3. cache is already created.
     
-    vm6.invoke(WANTestBase.class, "createSender", new Object[] { "ln1", 2,
-        false, 100, 10, false, false, null, true });
-    vm7.invoke(WANTestBase.class, "createSender", new Object[] { "ny1", 3,
-        false, 100, 10, false, false, null, true });
-    vm5.invoke(WANTestBase.class, "createSender", new Object[] { "tk1", 1,
-      false, 100, 10, false, false, null, true });
+    vm6.invoke(() -> WANTestBase.createSender( "ln1", 2,
+        false, 100, 10, false, false, null, true ));
+    vm7.invoke(() -> WANTestBase.createSender( "ny1", 3,
+        false, 100, 10, false, false, null, true ));
+    vm5.invoke(() -> WANTestBase.createSender( "tk1", 1,
+      false, 100, 10, false, false, null, true ));
 
-    vm6.invoke(WANTestBase.class, "createSender", new Object[] { "ln2", 3,
-      false, 100, 10, false, false, null, true });
-    vm7.invoke(WANTestBase.class, "createSender", new Object[] { "ny2", 1,
-      false, 100, 10, false, false, null, true });
-    vm5.invoke(WANTestBase.class, "createSender", new Object[] { "tk2", 2,
-    false, 100, 10, false, false, null, true });
+    vm6.invoke(() -> WANTestBase.createSender( "ln2", 3,
+      false, 100, 10, false, false, null, true ));
+    vm7.invoke(() -> WANTestBase.createSender( "ny2", 1,
+      false, 100, 10, false, false, null, true ));
+    vm5.invoke(() -> WANTestBase.createSender( "tk2", 2,
+    false, 100, 10, false, false, null, true ));
 
     
-    vm3.invoke(WANTestBase.class, "createReplicatedRegion", new Object[] {
-        getTestMethodName() + "_RR", "ln1,ln2", isOffHeap()});
-    vm4.invoke(WANTestBase.class, "createReplicatedRegion", new Object[] {
-        getTestMethodName() + "_RR", "ny1,ny2", isOffHeap()});
-    vm5.invoke(WANTestBase.class, "createReplicatedRegion", new Object[] {
-        getTestMethodName() + "_RR", "tk1,tk2", isOffHeap() });
+    vm3.invoke(() -> WANTestBase.createReplicatedRegion(
+        getTestMethodName() + "_RR", "ln1,ln2", isOffHeap()));
+    vm4.invoke(() -> WANTestBase.createReplicatedRegion(
+        getTestMethodName() + "_RR", "ny1,ny2", isOffHeap()));
+    vm5.invoke(() -> WANTestBase.createReplicatedRegion(
+        getTestMethodName() + "_RR", "tk1,tk2", isOffHeap() ));
 
-    vm6.invoke(WANTestBase.class, "startSender", new Object[] { "ln1" });
-    vm7.invoke(WANTestBase.class, "startSender", new Object[] { "ny1" });
-    vm5.invoke(WANTestBase.class, "startSender", new Object[] { "tk1" });
-    
-    vm6.invoke(WANTestBase.class, "startSender", new Object[] { "ln2" });
-    vm7.invoke(WANTestBase.class, "startSender", new Object[] { "ny2" });
-    vm5.invoke(WANTestBase.class, "startSender", new Object[] { "tk2" });
-    
-    
-    vm6.invoke(WANTestBase.class, "addQueueListener", new Object[] { "ln1",
-      false });
-    vm7.invoke(WANTestBase.class, "addQueueListener", new Object[] { "ny1",
-      false });
-    vm5.invoke(WANTestBase.class, "addQueueListener", new Object[] { "tk1",
-      false });
-    vm6.invoke(WANTestBase.class, "addSecondQueueListener", new Object[] { "ln2",
-      false });
-    vm7.invoke(WANTestBase.class, "addSecondQueueListener", new Object[] { "ny2",
-      false });
-    vm5.invoke(WANTestBase.class, "addSecondQueueListener", new Object[] { "tk2",
-      false });
+    vm6.invoke(() -> WANTestBase.startSender( "ln1" ));
+    vm7.invoke(() -> WANTestBase.startSender( "ny1" ));
+    vm5.invoke(() -> WANTestBase.startSender( "tk1" ));
+    
+    vm6.invoke(() -> WANTestBase.startSender( "ln2" ));
+    vm7.invoke(() -> WANTestBase.startSender( "ny2" ));
+    vm5.invoke(() -> WANTestBase.startSender( "tk2" ));
+    
+    
+    vm6.invoke(() -> WANTestBase.addQueueListener( "ln1",
+      false ));
+    vm7.invoke(() -> WANTestBase.addQueueListener( "ny1",
+      false ));
+    vm5.invoke(() -> WANTestBase.addQueueListener( "tk1",
+      false ));
+    vm6.invoke(() -> WANTestBase.addSecondQueueListener( "ln2",
+      false ));
+    vm7.invoke(() -> WANTestBase.addSecondQueueListener( "ny2",
+      false ));
+    vm5.invoke(() -> WANTestBase.addSecondQueueListener( "tk2",
+      false ));
   
     
-    vm6.invoke(WANTestBase.class, "createReplicatedRegion", new Object[] {
-        getTestMethodName() + "_RR", "ln1,ln2", isOffHeap() });
-    vm7.invoke(WANTestBase.class, "createReplicatedRegion", new Object[] {
-        getTestMethodName() + "_RR", "ny1,ny2", isOffHeap() });
+    vm6.invoke(() -> WANTestBase.createReplicatedRegion(
+        getTestMethodName() + "_RR", "ln1,ln2", isOffHeap() ));
+    vm7.invoke(() -> WANTestBase.createReplicatedRegion(
+        getTestMethodName() + "_RR", "ny1,ny2", isOffHeap() ));
     
     final Map keyValues = new HashMap();
     for(int i=0; i< 1; i++) {
       keyValues.put(i, i);
     }
-    vm3.invoke(WANTestBase.class, "putGivenKeyValue", new Object[] { getTestMethodName()
+ "_RR",
-      keyValues });
+    vm3.invoke(() -> WANTestBase.putGivenKeyValue( getTestMethodName() + "_RR",
+      keyValues ));
     
     keyValues.clear();
     for(int i=1; i< 2; i++) {
       keyValues.put(i, i);
     }
-    vm4.invoke(WANTestBase.class, "putGivenKeyValue", new Object[] { getTestMethodName()
+ "_RR",
-      keyValues });
+    vm4.invoke(() -> WANTestBase.putGivenKeyValue( getTestMethodName() + "_RR",
+      keyValues ));
     
     keyValues.clear();
     for(int i=2; i< 3; i++) {
       
       keyValues.put(i, i);
     }
-    vm5.invoke(WANTestBase.class, "putGivenKeyValue", new Object[] { getTestMethodName()
+ "_RR",
-      keyValues });
+    vm5.invoke(() -> WANTestBase.putGivenKeyValue( getTestMethodName() + "_RR",
+      keyValues ));
     
     Wait.pause(2000);
-    vm5.invoke(WANTestBase.class, "validateRegionSize", new Object[] {
-        getTestMethodName() + "_RR", 3 });
-    vm6.invoke(WANTestBase.class, "validateRegionSize", new Object[] {
-        getTestMethodName() + "_RR", 3 });
-    vm7.invoke(WANTestBase.class, "validateRegionSize", new Object[] {
-        getTestMethodName() + "_RR", 3 });
+    vm5.invoke(() -> WANTestBase.validateRegionSize(
+        getTestMethodName() + "_RR", 3 ));
+    vm6.invoke(() -> WANTestBase.validateRegionSize(
+        getTestMethodName() + "_RR", 3 ));
+    vm7.invoke(() -> WANTestBase.validateRegionSize(
+        getTestMethodName() + "_RR", 3 ));
     
     Wait.pause(5000);
-    vm6.invoke(WANTestBase.class, "verifyQueueSize",
-        new Object[] { "ln1", 0 });
-    vm7.invoke(WANTestBase.class, "verifyQueueSize",
-        new Object[] { "ny1", 0 });
-    vm5.invoke(WANTestBase.class, "verifyQueueSize",
-        new Object[] { "tk1", 0 });
-    vm6.invoke(WANTestBase.class, "verifyQueueSize",
-        new Object[] { "ln2", 0 });
-    vm7.invoke(WANTestBase.class, "verifyQueueSize",
-        new Object[] { "ny2", 0 });
-    vm5.invoke(WANTestBase.class, "verifyQueueSize",
-        new Object[] { "tk2", 0 });
-    
-    
-    Map queueMap1 = (HashMap)vm6.invoke(WANTestBase.class, "checkQueue",
-        new Object[] {});
-    Map queueMap2 = (HashMap)vm7.invoke(WANTestBase.class, "checkQueue",
-        new Object[] {});
-    Map queueMap3 = (HashMap)vm5.invoke(WANTestBase.class, "checkQueue",
-        new Object[] {});
-    Map queueMap4 = (HashMap)vm6.invoke(WANTestBase.class, "checkQueue2",
-        new Object[] {});
-    Map queueMap5 = (HashMap)vm7.invoke(WANTestBase.class, "checkQueue2",
-        new Object[] {});
-    Map queueMap6 = (HashMap)vm5.invoke(WANTestBase.class, "checkQueue2",
-        new Object[] {});
+    vm6.invoke(() -> WANTestBase.verifyQueueSize( "ln1", 0 ));
+    vm7.invoke(() -> WANTestBase.verifyQueueSize( "ny1", 0 ));
+    vm5.invoke(() -> WANTestBase.verifyQueueSize( "tk1", 0 ));
+    vm6.invoke(() -> WANTestBase.verifyQueueSize( "ln2", 0 ));
+    vm7.invoke(() -> WANTestBase.verifyQueueSize( "ny2", 0 ));
+    vm5.invoke(() -> WANTestBase.verifyQueueSize( "tk2", 0 ));
+    
+    
+    Map queueMap1 = (HashMap)vm6.invoke(() -> WANTestBase.checkQueue());
+    Map queueMap2 = (HashMap)vm7.invoke(() -> WANTestBase.checkQueue());
+    Map queueMap3 = (HashMap)vm5.invoke(() -> WANTestBase.checkQueue());
+    Map queueMap4 = (HashMap)vm6.invoke(() -> WANTestBase.checkQueue2());
+    Map queueMap5 = (HashMap)vm7.invoke(() -> WANTestBase.checkQueue2());
+    Map queueMap6 = (HashMap)vm5.invoke(() -> WANTestBase.checkQueue2());
     
     List createList1 = (List)queueMap1.get("Create");
     List updateList1 = (List)queueMap1.get("Update");
@@ -403,106 +373,91 @@ public class SerialWANPropagationLoopBackDUnitTest extends WANTestBase
{
 
   
   public void testReplicatedSerialPropagationLoopBack3SitesNtoNPutFromOneDS() throws Exception
{
-    Integer lnPort = (Integer)vm0.invoke(WANTestBase.class,
-        "createFirstLocatorWithDSId", new Object[] { 1 });
-    Integer nyPort = (Integer)vm1.invoke(WANTestBase.class,
-        "createFirstRemoteLocator", new Object[] { 2, lnPort });
-    Integer tkPort = (Integer)vm2.invoke(WANTestBase.class,
-        "createFirstRemoteLocator", new Object[] { 3, lnPort });
+    Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId(
1 ));
+    Integer nyPort = (Integer)vm1.invoke(() -> WANTestBase.createFirstRemoteLocator( 2,
lnPort ));
+    Integer tkPort = (Integer)vm2.invoke(() -> WANTestBase.createFirstRemoteLocator( 3,
lnPort ));
 
     
-    vm3.invoke(WANTestBase.class, "createReceiver", new Object[] { lnPort });
-    vm4.invoke(WANTestBase.class, "createReceiver", new Object[] { nyPort });
-    vm5.invoke(WANTestBase.class, "createReceiver", new Object[] { tkPort });
+    vm3.invoke(() -> WANTestBase.createReceiver( lnPort ));
+    vm4.invoke(() -> WANTestBase.createReceiver( nyPort ));
+    vm5.invoke(() -> WANTestBase.createReceiver( tkPort ));
     
     
-    vm3.invoke(WANTestBase.class, "createSender", new Object[] { "ln1", 2,
-        false, 100, 10, false, false, null, true });
-    vm3.invoke(WANTestBase.class, "createSender", new Object[] { "ln2", 3,
-      false, 100, 10, false, false, null, true });
+    vm3.invoke(() -> WANTestBase.createSender( "ln1", 2,
+        false, 100, 10, false, false, null, true ));
+    vm3.invoke(() -> WANTestBase.createSender( "ln2", 3,
+      false, 100, 10, false, false, null, true ));
     
-    vm4.invoke(WANTestBase.class, "createSender", new Object[] { "ny1", 3,
-        false, 100, 10, false, false, null, true });
-    vm4.invoke(WANTestBase.class, "createSender", new Object[] { "ny2", 1,
-      false, 100, 10, false, false, null, true });
+    vm4.invoke(() -> WANTestBase.createSender( "ny1", 3,
+        false, 100, 10, false, false, null, true ));
+    vm4.invoke(() -> WANTestBase.createSender( "ny2", 1,
+      false, 100, 10, false, false, null, true ));
     
-    vm5.invoke(WANTestBase.class, "createSender", new Object[] { "tk1", 1,
-      false, 100, 10, false, false, null, true });
-    vm5.invoke(WANTestBase.class, "createSender", new Object[] { "tk2", 2,
-    false, 100, 10, false, false, null, true });
+    vm5.invoke(() -> WANTestBase.createSender( "tk1", 1,
+      false, 100, 10, false, false, null, true ));
+    vm5.invoke(() -> WANTestBase.createSender( "tk2", 2,
+    false, 100, 10, false, false, null, true ));
 
     
-    vm3.invoke(WANTestBase.class, "createReplicatedRegion", new Object[] {
-        getTestMethodName() + "_RR", "ln1,ln2", isOffHeap() });
-    vm4.invoke(WANTestBase.class, "createReplicatedRegion", new Object[] {
-        getTestMethodName() + "_RR", "ny1,ny2", isOffHeap() });
-    vm5.invoke(WANTestBase.class, "createReplicatedRegion", new Object[] {
-        getTestMethodName() + "_RR", "tk1,tk2", isOffHeap() });
+    vm3.invoke(() -> WANTestBase.createReplicatedRegion(
+        getTestMethodName() + "_RR", "ln1,ln2", isOffHeap() ));
+    vm4.invoke(() -> WANTestBase.createReplicatedRegion(
+        getTestMethodName() + "_RR", "ny1,ny2", isOffHeap() ));
+    vm5.invoke(() -> WANTestBase.createReplicatedRegion(
+        getTestMethodName() + "_RR", "tk1,tk2", isOffHeap() ));
 
     
-    vm3.invoke(WANTestBase.class, "startSender", new Object[] { "ln1" });
-    vm4.invoke(WANTestBase.class, "startSender", new Object[] { "ny1" });
-    vm5.invoke(WANTestBase.class, "startSender", new Object[] { "tk1" });
-    
-    vm3.invoke(WANTestBase.class, "startSender", new Object[] { "ln2" });
-    vm4.invoke(WANTestBase.class, "startSender", new Object[] { "ny2" });
-    vm5.invoke(WANTestBase.class, "startSender", new Object[] { "tk2" });
-    
-    
-    vm3.invoke(WANTestBase.class, "addQueueListener", new Object[] { "ln1",
-      false });
-    vm4.invoke(WANTestBase.class, "addQueueListener", new Object[] { "ny1",
-      false });
-    vm5.invoke(WANTestBase.class, "addQueueListener", new Object[] { "tk1",
-      false });
-    vm3.invoke(WANTestBase.class, "addSecondQueueListener", new Object[] { "ln2",
-      false });
-    vm4.invoke(WANTestBase.class, "addSecondQueueListener", new Object[] { "ny2",
-      false });
-    vm5.invoke(WANTestBase.class, "addSecondQueueListener", new Object[] { "tk2",
-      false });
+    vm3.invoke(() -> WANTestBase.startSender( "ln1" ));
+    vm4.invoke(() -> WANTestBase.startSender( "ny1" ));
+    vm5.invoke(() -> WANTestBase.startSender( "tk1" ));
+    
+    vm3.invoke(() -> WANTestBase.startSender( "ln2" ));
+    vm4.invoke(() -> WANTestBase.startSender( "ny2" ));
+    vm5.invoke(() -> WANTestBase.startSender( "tk2" ));
+    
+    
+    vm3.invoke(() -> WANTestBase.addQueueListener( "ln1",
+      false ));
+    vm4.invoke(() -> WANTestBase.addQueueListener( "ny1",
+      false ));
+    vm5.invoke(() -> WANTestBase.addQueueListener( "tk1",
+      false ));
+    vm3.invoke(() -> WANTestBase.addSecondQueueListener( "ln2",
+      false ));
+    vm4.invoke(() -> WANTestBase.addSecondQueueListener( "ny2",
+      false ));
+    vm5.invoke(() -> WANTestBase.addSecondQueueListener( "tk2",
+      false ));
   
     final Map keyValues = new HashMap();
     for(int i=0; i< 1; i++) {
       keyValues.put(i, i);
     }
-    vm3.invoke(WANTestBase.class, "putGivenKeyValue", new Object[] { getTestMethodName()
+ "_RR",
-      keyValues });
+    vm3.invoke(() -> WANTestBase.putGivenKeyValue( getTestMethodName() + "_RR",
+      keyValues ));
     
-    vm3.invoke(WANTestBase.class, "validateRegionSize", new Object[] {
-        getTestMethodName() + "_RR", 1 });
-    vm4.invoke(WANTestBase.class, "validateRegionSize", new Object[] {
-        getTestMethodName() + "_RR", 1 });
-    vm5.invoke(WANTestBase.class, "validateRegionSize", new Object[] {
-        getTestMethodName() + "_RR", 1 });
+    vm3.invoke(() -> WANTestBase.validateRegionSize(
+        getTestMethodName() + "_RR", 1 ));
+    vm4.invoke(() -> WANTestBase.validateRegionSize(
+        getTestMethodName() + "_RR", 1 ));
+    vm5.invoke(() -> WANTestBase.validateRegionSize(
+        getTestMethodName() + "_RR", 1 ));
     
     Wait.pause(5000);
-    vm3.invoke(WANTestBase.class, "verifyQueueSize",
-        new Object[] { "ln1", 0 });
-    vm4.invoke(WANTestBase.class, "verifyQueueSize",
-        new Object[] { "ny1", 0 });
-    vm5.invoke(WANTestBase.class, "verifyQueueSize",
-        new Object[] { "tk1", 0 });
-    vm3.invoke(WANTestBase.class, "verifyQueueSize",
-        new Object[] { "ln2", 0 });
-    vm4.invoke(WANTestBase.class, "verifyQueueSize",
-        new Object[] { "ny2", 0 });
-    vm5.invoke(WANTestBase.class, "verifyQueueSize",
-        new Object[] { "tk2", 0 });
-    
-    
-    Map queueMap1 = (HashMap)vm3.invoke(WANTestBase.class, "checkQueue",
-        new Object[] {});
-    Map queueMap2 = (HashMap)vm4.invoke(WANTestBase.class, "checkQueue",
-        new Object[] {});
-    Map queueMap3 = (HashMap)vm5.invoke(WANTestBase.class, "checkQueue",
-        new Object[] {});
-    Map queueMap4 = (HashMap)vm3.invoke(WANTestBase.class, "checkQueue2",
-        new Object[] {});
-    Map queueMap5 = (HashMap)vm4.invoke(WANTestBase.class, "checkQueue2",
-        new Object[] {});
-    Map queueMap6 = (HashMap)vm5.invoke(WANTestBase.class, "checkQueue2",
-        new Object[] {});
+    vm3.invoke(() -> WANTestBase.verifyQueueSize( "ln1", 0 ));
+    vm4.invoke(() -> WANTestBase.verifyQueueSize( "ny1", 0 ));
+    vm5.invoke(() -> WANTestBase.verifyQueueSize( "tk1", 0 ));
+    vm3.invoke(() -> WANTestBase.verifyQueueSize( "ln2", 0 ));
+    vm4.invoke(() -> WANTestBase.verifyQueueSize( "ny2", 0 ));
+    vm5.invoke(() -> WANTestBase.verifyQueueSize( "tk2", 0 ));
+    
+    
+    Map queueMap1 = (HashMap)vm3.invoke(() -> WANTestBase.checkQueue());
+    Map queueMap2 = (HashMap)vm4.invoke(() -> WANTestBase.checkQueue());
+    Map queueMap3 = (HashMap)vm5.invoke(() -> WANTestBase.checkQueue());
+    Map queueMap4 = (HashMap)vm3.invoke(() -> WANTestBase.checkQueue2());
+    Map queueMap5 = (HashMap)vm4.invoke(() -> WANTestBase.checkQueue2());
+    Map queueMap6 = (HashMap)vm5.invoke(() -> WANTestBase.checkQueue2());
     
     List createList1 = (List)queueMap1.get("Create");
     List updateList1 = (List)queueMap1.get("Update");


Mime
View raw message