geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From upthewatersp...@apache.org
Subject [31/63] [abbrv] incubator-geode git commit: Automatically converting calls of vm.invoke to lambdas
Date Fri, 19 Feb 2016 18:37:08 GMT
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/69024aa9/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/VerifyEventIDGenerationInP2PDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/VerifyEventIDGenerationInP2PDUnitTest.java
b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/VerifyEventIDGenerationInP2PDUnitTest.java
index 83df124..4934a9d 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/VerifyEventIDGenerationInP2PDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/VerifyEventIDGenerationInP2PDUnitTest.java
@@ -74,17 +74,15 @@ public class VerifyEventIDGenerationInP2PDUnitTest extends DistributedTestCase
     vm0 = host.getVM(0);
     createServerCache();
     vm0
-        .invoke(VerifyEventIDGenerationInP2PDUnitTest.class,
-            "createServerCache");
+        .invoke(() -> VerifyEventIDGenerationInP2PDUnitTest.createServerCache());
     receiver = false;
   }
 
   public void _testEventIDGeneration() throws Exception
   {
     createEntry();
-    vm0.invoke(VerifyEventIDGenerationInP2PDUnitTest.class, "get");
-    Boolean pass = (Boolean)vm0.invoke(
-        VerifyEventIDGenerationInP2PDUnitTest.class, "verifyResult");
+    vm0.invoke(() -> VerifyEventIDGenerationInP2PDUnitTest.get());
+    Boolean pass = (Boolean)vm0.invoke(() -> VerifyEventIDGenerationInP2PDUnitTest.verifyResult());
     assertFalse(pass.booleanValue());
   }
 
@@ -120,8 +118,7 @@ public class VerifyEventIDGenerationInP2PDUnitTest extends DistributedTestCase
       public void afterCreate(EntryEvent event)
       {
         if (!receiver) {
-          vm0.invoke(EventIDVerificationInP2PDUnitTest.class, "setEventIDData",
-              new Object[] { ((EntryEventImpl)event).getEventId() });
+          vm0.invoke(() -> EventIDVerificationInP2PDUnitTest.setEventIDData( ((EntryEventImpl)event).getEventId()
));
         }
         else {
           testEventIDResult = ((EntryEventImpl)event).getEventId().equals(
@@ -175,7 +172,7 @@ public class VerifyEventIDGenerationInP2PDUnitTest extends DistributedTestCase
   @Override
   protected final void preTearDown() throws Exception {
     closeCache();
-    vm0.invoke(VerifyEventIDGenerationInP2PDUnitTest.class, "closeCache");
+    vm0.invoke(() -> VerifyEventIDGenerationInP2PDUnitTest.closeCache());
   }
 
   public static void closeCache()

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/69024aa9/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/VerifyUpdatesFromNonInterestEndPointDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/VerifyUpdatesFromNonInterestEndPointDUnitTest.java
b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/VerifyUpdatesFromNonInterestEndPointDUnitTest.java
index c2a0016..eb5637c 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/VerifyUpdatesFromNonInterestEndPointDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/VerifyUpdatesFromNonInterestEndPointDUnitTest.java
@@ -83,11 +83,10 @@ public class VerifyUpdatesFromNonInterestEndPointDUnitTest extends DistributedTe
     vm2 = host.getVM(2);
 
 
-    PORT1 =  ((Integer)vm0.invoke(VerifyUpdatesFromNonInterestEndPointDUnitTest.class, "createServerCache"
)).intValue();
-    PORT2 =  ((Integer)vm1.invoke(VerifyUpdatesFromNonInterestEndPointDUnitTest.class, "createServerCache"
)).intValue();
+    PORT1 =  ((Integer)vm0.invoke(() -> VerifyUpdatesFromNonInterestEndPointDUnitTest.createServerCache())).intValue();
+    PORT2 =  ((Integer)vm1.invoke(() -> VerifyUpdatesFromNonInterestEndPointDUnitTest.createServerCache())).intValue();
 
-    vm2.invoke(VerifyUpdatesFromNonInterestEndPointDUnitTest.class, "createClientCache",
-        new Object[] { NetworkUtils.getServerHostName(vm0.getHost()), new Integer(PORT1),new
Integer(PORT2)});
+    vm2.invoke(() -> VerifyUpdatesFromNonInterestEndPointDUnitTest.createClientCache(
NetworkUtils.getServerHostName(vm0.getHost()), new Integer(PORT1),new Integer(PORT2)));
 
 
   }
@@ -106,15 +105,15 @@ public class VerifyUpdatesFromNonInterestEndPointDUnitTest extends DistributedTe
 
   public void testVerifyUpdatesFromNonInterestEndPoint()
   {
-    vm2.invoke(VerifyUpdatesFromNonInterestEndPointDUnitTest.class, "createEntries");
-    vm1.invoke(VerifyUpdatesFromNonInterestEndPointDUnitTest.class, "createEntries");
-    vm0.invoke(VerifyUpdatesFromNonInterestEndPointDUnitTest.class, "createEntries");
+    vm2.invoke(() -> VerifyUpdatesFromNonInterestEndPointDUnitTest.createEntries());
+    vm1.invoke(() -> VerifyUpdatesFromNonInterestEndPointDUnitTest.createEntries());
+    vm0.invoke(() -> VerifyUpdatesFromNonInterestEndPointDUnitTest.createEntries());
 
-    vm2.invoke(VerifyUpdatesFromNonInterestEndPointDUnitTest.class, "registerKey");
+    vm2.invoke(() -> VerifyUpdatesFromNonInterestEndPointDUnitTest.registerKey());
 
-    vm2.invoke(VerifyUpdatesFromNonInterestEndPointDUnitTest.class, "acquireConnectionsAndPut",
new Object[] { new Integer(PORT2)});
+    vm2.invoke(() -> VerifyUpdatesFromNonInterestEndPointDUnitTest.acquireConnectionsAndPut(
new Integer(PORT2)));
     Wait.pause(30000);
-    vm2.invoke(VerifyUpdatesFromNonInterestEndPointDUnitTest.class, "verifyPut");
+    vm2.invoke(() -> VerifyUpdatesFromNonInterestEndPointDUnitTest.verifyPut());
   }
 
 
@@ -249,9 +248,9 @@ public class VerifyUpdatesFromNonInterestEndPointDUnitTest extends DistributedTe
   @Override
   protected final void preTearDown() throws Exception {
     //close client
-    vm2.invoke(VerifyUpdatesFromNonInterestEndPointDUnitTest.class, "closeCache");
+    vm2.invoke(() -> VerifyUpdatesFromNonInterestEndPointDUnitTest.closeCache());
     //close server
-    vm0.invoke(VerifyUpdatesFromNonInterestEndPointDUnitTest.class, "closeCache");
-    vm1.invoke(VerifyUpdatesFromNonInterestEndPointDUnitTest.class, "closeCache");
+    vm0.invoke(() -> VerifyUpdatesFromNonInterestEndPointDUnitTest.closeCache());
+    vm1.invoke(() -> VerifyUpdatesFromNonInterestEndPointDUnitTest.closeCache());
   }
 }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/69024aa9/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/AsyncEventQueueTestBase.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/AsyncEventQueueTestBase.java
b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/AsyncEventQueueTestBase.java
index ff918b8..811300d 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/AsyncEventQueueTestBase.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/AsyncEventQueueTestBase.java
@@ -1574,14 +1574,14 @@ public class AsyncEventQueueTestBase extends DistributedTestCase {
   @Override
   protected final void postTearDown() throws Exception {
     cleanupVM();
-    vm0.invoke(AsyncEventQueueTestBase.class, "cleanupVM");
-    vm1.invoke(AsyncEventQueueTestBase.class, "cleanupVM");
-    vm2.invoke(AsyncEventQueueTestBase.class, "cleanupVM");
-    vm3.invoke(AsyncEventQueueTestBase.class, "cleanupVM");
-    vm4.invoke(AsyncEventQueueTestBase.class, "cleanupVM");
-    vm5.invoke(AsyncEventQueueTestBase.class, "cleanupVM");
-    vm6.invoke(AsyncEventQueueTestBase.class, "cleanupVM");
-    vm7.invoke(AsyncEventQueueTestBase.class, "cleanupVM");
+    vm0.invoke(() -> AsyncEventQueueTestBase.cleanupVM());
+    vm1.invoke(() -> AsyncEventQueueTestBase.cleanupVM());
+    vm2.invoke(() -> AsyncEventQueueTestBase.cleanupVM());
+    vm3.invoke(() -> AsyncEventQueueTestBase.cleanupVM());
+    vm4.invoke(() -> AsyncEventQueueTestBase.cleanupVM());
+    vm5.invoke(() -> AsyncEventQueueTestBase.cleanupVM());
+    vm6.invoke(() -> AsyncEventQueueTestBase.cleanupVM());
+    vm7.invoke(() -> AsyncEventQueueTestBase.cleanupVM());
   }
 
   public static void cleanupVM() throws IOException {


Mime
View raw message