geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From upthewatersp...@apache.org
Subject [28/56] [abbrv] incubator-geode git commit: Automatically converting calls of vm.invoke to lambdas
Date Tue, 16 Feb 2016 22:11:48 GMT
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/69024aa9/gemfire-core/src/test/java/com/gemstone/gemfire/management/QueryDataDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/management/QueryDataDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/management/QueryDataDUnitTest.java
index e52594e..e06fd3e 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/management/QueryDataDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/management/QueryDataDUnitTest.java
@@ -273,12 +273,12 @@ public class QueryDataDUnitTest extends ManagementTestBase {
   private void createRegionsInNodes() {
 
     // Create local Region on servers
-    managedNode1.invoke(QueryUsingFunctionContextDUnitTest.class, "createLocalRegion");
+    managedNode1.invoke(() -> QueryUsingFunctionContextDUnitTest.createLocalRegion());
 
     // Create ReplicatedRegion on servers
-    managedNode1.invoke(QueryUsingFunctionContextDUnitTest.class, "createReplicatedRegion");
-    managedNode2.invoke(QueryUsingFunctionContextDUnitTest.class, "createReplicatedRegion");
-    managedNode3.invoke(QueryUsingFunctionContextDUnitTest.class, "createReplicatedRegion");
+    managedNode1.invoke(() -> QueryUsingFunctionContextDUnitTest.createReplicatedRegion());
+    managedNode2.invoke(() -> QueryUsingFunctionContextDUnitTest.createReplicatedRegion());
+    managedNode3.invoke(() -> QueryUsingFunctionContextDUnitTest.createReplicatedRegion());
     try {
       this.createDistributedRegion(managedNode2, repRegionName2);
       this.createDistributedRegion(managedNode1, repRegionName3);
@@ -288,9 +288,9 @@ public class QueryDataDUnitTest extends ManagementTestBase {
     }
 
     // Create two colocated PartitionedRegions On Servers.
-    managedNode1.invoke(QueryUsingFunctionContextDUnitTest.class, "createColocatedPR");
-    managedNode2.invoke(QueryUsingFunctionContextDUnitTest.class, "createColocatedPR");
-    managedNode3.invoke(QueryUsingFunctionContextDUnitTest.class, "createColocatedPR");
+    managedNode1.invoke(() -> QueryUsingFunctionContextDUnitTest.createColocatedPR());
+    managedNode2.invoke(() -> QueryUsingFunctionContextDUnitTest.createColocatedPR());
+    managedNode3.invoke(() -> QueryUsingFunctionContextDUnitTest.createColocatedPR());
 
     this.managingNode.invoke(new SerializableRunnable("Wait for all Region Proxies to get replicated") {
 
@@ -760,11 +760,11 @@ public class QueryDataDUnitTest extends ManagementTestBase {
       }
     });
 
-    final List<String> member1RealData = (List<String>)managedNode1.invoke(QueryDataDUnitTest.class, "getLocalDataSet", new Object[] { PartitionedRegionName6 });
+    final List<String> member1RealData = (List<String>)managedNode1.invoke(() -> QueryDataDUnitTest.getLocalDataSet( PartitionedRegionName6 ));
    
-    final List<String> member2RealData = (List<String>) managedNode2.invoke(QueryDataDUnitTest.class, "getLocalDataSet", new Object[] { PartitionedRegionName6 });
+    final List<String> member2RealData = (List<String>) managedNode2.invoke(() -> QueryDataDUnitTest.getLocalDataSet( PartitionedRegionName6 ));
     
-    final List<String> member3RealData = (List<String>) managedNode3.invoke(QueryDataDUnitTest.class, "getLocalDataSet", new Object[] { PartitionedRegionName6 });
+    final List<String> member3RealData = (List<String>) managedNode3.invoke(() -> QueryDataDUnitTest.getLocalDataSet( PartitionedRegionName6 ));
     
 
     

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/69024aa9/gemfire-core/src/test/java/com/gemstone/gemfire/management/UniversalMembershipListenerAdapterDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/management/UniversalMembershipListenerAdapterDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/management/UniversalMembershipListenerAdapterDUnitTest.java
index c25a1db..fcb1e22 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/management/UniversalMembershipListenerAdapterDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/management/UniversalMembershipListenerAdapterDUnitTest.java
@@ -429,10 +429,8 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
 
     // create bridge client in vm0...
     vm0.invoke(createBridgeClient);
-    String clientMemberId = (String) vm0.invoke(
-      UniversalMembershipListenerAdapterDUnitTest.class, "getMemberId");
-    DistributedMember clientMember = (DistributedMember) vm0.invoke(
-      UniversalMembershipListenerAdapterDUnitTest.class, "getDistributedMember");
+    String clientMemberId = (String) vm0.invoke(() -> UniversalMembershipListenerAdapterDUnitTest.getMemberId());
+    DistributedMember clientMember = (DistributedMember) vm0.invoke(() -> UniversalMembershipListenerAdapterDUnitTest.getDistributedMember());
                                                 
     // should trigger both adapter and bridge listener but not system listener
     synchronized(adapter) {
@@ -565,10 +563,8 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
     
     // reconnect bridge client to test for crashed event
     vm0.invoke(createBridgeClient);
-    clientMemberId = (String) vm0.invoke(
-      UniversalMembershipListenerAdapterDUnitTest.class, "getMemberId");
-    clientMember = (DistributedMember) vm0.invoke(
-      UniversalMembershipListenerAdapterDUnitTest.class, "getDistributedMember");
+    clientMemberId = (String) vm0.invoke(() -> UniversalMembershipListenerAdapterDUnitTest.getMemberId());
+    clientMember = (DistributedMember) vm0.invoke(() -> UniversalMembershipListenerAdapterDUnitTest.getDistributedMember());
                                                 
     synchronized(adapter) {
       if (!firedAdapter[JOINED]) {
@@ -888,10 +884,8 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
 
     // create bridge client in vm0...
     vm0.invoke(createBridgeClient);
-    String clientMemberId = (String) vm0.invoke(
-      UniversalMembershipListenerAdapterDUnitTest.class, "getMemberId");
-    DistributedMember clientMember = (DistributedMember) vm0.invoke(
-      UniversalMembershipListenerAdapterDUnitTest.class, "getDistributedMember");
+    String clientMemberId = (String) vm0.invoke(() -> UniversalMembershipListenerAdapterDUnitTest.getMemberId());
+    DistributedMember clientMember = (DistributedMember) vm0.invoke(() -> UniversalMembershipListenerAdapterDUnitTest.getDistributedMember());
                                                 
     // should trigger both adapter and bridge listener but not system listener
     synchronized(adapter) {
@@ -1036,10 +1030,8 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
     
     // reconnect bridge client
     vm0.invoke(createBridgeClient);
-    clientMemberId = (String) vm0.invoke(
-      UniversalMembershipListenerAdapterDUnitTest.class, "getMemberId");
-    clientMember = (DistributedMember) vm0.invoke(
-      UniversalMembershipListenerAdapterDUnitTest.class, "getDistributedMember");
+    clientMemberId = (String) vm0.invoke(() -> UniversalMembershipListenerAdapterDUnitTest.getMemberId());
+    clientMember = (DistributedMember) vm0.invoke(() -> UniversalMembershipListenerAdapterDUnitTest.getDistributedMember());
                                                 
     synchronized(adapter) {
       if (!firedAdapter[JOINED]) {
@@ -1183,10 +1175,8 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
     
     // reconnect bridge client
     vm0.invoke(createBridgeClient);
-    clientMemberId = (String) vm0.invoke(
-      UniversalMembershipListenerAdapterDUnitTest.class, "getMemberId");
-    clientMember = (DistributedMember) vm0.invoke(
-      UniversalMembershipListenerAdapterDUnitTest.class, "getDistributedMember");
+    clientMemberId = (String) vm0.invoke(() -> UniversalMembershipListenerAdapterDUnitTest.getMemberId());
+    clientMember = (DistributedMember) vm0.invoke(() -> UniversalMembershipListenerAdapterDUnitTest.getDistributedMember());
                                                 
     synchronized(adapter) {
       if (!firedAdapter[JOINED]) {
@@ -1584,10 +1574,8 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
     
     vm0.invoke(createPeerCache);
     
-    String peerMemberId = (String) vm0.invoke(
-      UniversalMembershipListenerAdapterDUnitTest.class, "getMemberId");
-    DistributedMember peerMember = (DistributedMember) vm0.invoke(
-      UniversalMembershipListenerAdapterDUnitTest.class, "getDistributedMember");
+    String peerMemberId = (String) vm0.invoke(() -> UniversalMembershipListenerAdapterDUnitTest.getMemberId());
+    DistributedMember peerMember = (DistributedMember) vm0.invoke(() -> UniversalMembershipListenerAdapterDUnitTest.getDistributedMember());
 
     com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().info("[testServerEventsInPeerSystem] peerMemberId=" + peerMemberId);
     com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().info("[testServerEventsInPeerSystem] peerMember=" + peerMember);
@@ -1873,12 +1861,9 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
     
     // gather details for later creation of pool...
     assertEquals(ports[0],
-                 vm0.invokeInt(UniversalMembershipListenerAdapterDUnitTest.class, 
-                               "getTestServerEventsInLonerClient_port"));
-    String serverMemberId = (String) vm0.invoke(
-      UniversalMembershipListenerAdapterDUnitTest.class, "getMemberId");
-    DistributedMember serverMember = (DistributedMember) vm0.invoke(
-      UniversalMembershipListenerAdapterDUnitTest.class, "getDistributedMember");
+                 vm0.invoke(() -> UniversalMembershipListenerAdapterDUnitTest.getTestServerEventsInLonerClient_port()));
+    String serverMemberId = (String) vm0.invoke(() -> UniversalMembershipListenerAdapterDUnitTest.getMemberId());
+    DistributedMember serverMember = (DistributedMember) vm0.invoke(() -> UniversalMembershipListenerAdapterDUnitTest.getDistributedMember());
 
     com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().info("[testServerEventsInLonerClient] ports[0]=" + ports[0]);
     com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().info("[testServerEventsInLonerClient] serverMemberId=" + serverMemberId);
@@ -2044,12 +2029,9 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
     
     // gather details for later creation of pool...
     assertEquals(ports[0],
-                 vm0.invokeInt(UniversalMembershipListenerAdapterDUnitTest.class, 
-                               "getTestServerEventsInLonerClient_port"));
-    serverMemberId = (String) vm0.invoke(
-      UniversalMembershipListenerAdapterDUnitTest.class, "getMemberId");
-    serverMember = (DistributedMember) vm0.invoke(
-      UniversalMembershipListenerAdapterDUnitTest.class, "getDistributedMember");
+                 vm0.invoke(() -> UniversalMembershipListenerAdapterDUnitTest.getTestServerEventsInLonerClient_port()));
+    serverMemberId = (String) vm0.invoke(() -> UniversalMembershipListenerAdapterDUnitTest.getMemberId());
+    serverMember = (DistributedMember) vm0.invoke(() -> UniversalMembershipListenerAdapterDUnitTest.getDistributedMember());
 
     com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().info("[testServerEventsInLonerClient] ports[0]=" + ports[0]);
     com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().info("[testServerEventsInLonerClient] serverMemberId=" + serverMemberId);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/69024aa9/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/FunctionCommandsDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/FunctionCommandsDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/FunctionCommandsDUnitTest.java
index 7378ada..0eba700 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/FunctionCommandsDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/FunctionCommandsDUnitTest.java
@@ -250,7 +250,7 @@ public class FunctionCommandsDUnitTest extends CliCommandTestBase {
     Function function = new TestFunction(true, TestFunction.TEST_FUNCTION1);
     FunctionService.registerFunction(function);
     final VM vm1 = Host.getHost(0).getVM(1);
-    final String vm1MemberId = (String) vm1.invoke(FunctionCommandsDUnitTest.class, "getMemberId");
+    final String vm1MemberId = (String) vm1.invoke(() -> FunctionCommandsDUnitTest.getMemberId());
 
     Host.getHost(0).getVM(0).invoke(new SerializableRunnable() {
       public void run() {
@@ -404,7 +404,7 @@ public class FunctionCommandsDUnitTest extends CliCommandTestBase {
     Function function = new TestFunction(true, TestFunction.TEST_FUNCTION1);
     FunctionService.registerFunction(function);
     final VM vm1 = Host.getHost(0).getVM(1);
-    final String vm1MemberId = (String) vm1.invoke(FunctionCommandsDUnitTest.class, "getMemberId");
+    final String vm1MemberId = (String) vm1.invoke(() -> FunctionCommandsDUnitTest.getMemberId());
     String command = "destroy function --id=" + function.getId() + " --member=" + vm1MemberId;
     LogWriterUtils.getLogWriter().info("testDestroyOnMember command=" + command);
     CommandResult cmdResult = executeCommand(command);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/69024aa9/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/GemfireDataCommandsDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/GemfireDataCommandsDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/GemfireDataCommandsDUnitTest.java
index d6719d1..6d9d603 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/GemfireDataCommandsDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/GemfireDataCommandsDUnitTest.java
@@ -205,8 +205,8 @@ public class GemfireDataCommandsDUnitTest extends CliCommandTestBase {
       }
     });
 
-    final String vm1MemberId = (String) vm1.invoke(GemfireDataCommandsDUnitTest.class, "getMemberId");
-    final String vm2MemberId = (String) vm2.invoke(GemfireDataCommandsDUnitTest.class, "getMemberId");
+    final String vm1MemberId = (String) vm1.invoke(() -> GemfireDataCommandsDUnitTest.getMemberId());
+    final String vm2MemberId = (String) vm2.invoke(() -> GemfireDataCommandsDUnitTest.getMemberId());
     LogWriterUtils.getLogWriter().info("Vm1 ID : " + vm1MemberId);
     LogWriterUtils.getLogWriter().info("Vm2 ID : " + vm2MemberId);
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/69024aa9/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/MiscellaneousCommandsDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/MiscellaneousCommandsDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/MiscellaneousCommandsDUnitTest.java
index 841c960..a5260eb 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/MiscellaneousCommandsDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/MiscellaneousCommandsDUnitTest.java
@@ -109,7 +109,7 @@ public class MiscellaneousCommandsDUnitTest extends CliCommandTestBase {
   public void testGCForMemberID() {
     createDefaultSetup(null);
     final VM vm1 = Host.getHost(0).getVM(1);
-    final String vm1MemberId = (String) vm1.invoke(MiscellaneousCommandsDUnitTest.class, "getMemberId");
+    final String vm1MemberId = (String) vm1.invoke(() -> MiscellaneousCommandsDUnitTest.getMemberId());
     String command = "gc --member=" + vm1MemberId;
     CommandResult cmdResult = executeCommand(command);
     cmdResult.resetToFirstLine();
@@ -135,7 +135,7 @@ public class MiscellaneousCommandsDUnitTest extends CliCommandTestBase {
       props.setProperty("log-file", "testShowLogDefault.log");
       createDefaultSetup(props);
       final VM vm1 = Host.getHost(0).getVM(0);
-      final String vm1MemberId = (String) vm1.invoke(MiscellaneousCommandsDUnitTest.class, "getMemberId");
+      final String vm1MemberId = (String) vm1.invoke(() -> MiscellaneousCommandsDUnitTest.getMemberId());
       String command = "show log --member=" + vm1MemberId;
       CommandResult cmdResult = executeCommand(command);
       if (cmdResult != null) {
@@ -157,7 +157,7 @@ public class MiscellaneousCommandsDUnitTest extends CliCommandTestBase {
     try {
       createDefaultSetup(props);
       final VM vm1 = Host.getHost(0).getVM(0);
-      final String vm1MemberId = (String) vm1.invoke(MiscellaneousCommandsDUnitTest.class, "getMemberId");
+      final String vm1MemberId = (String) vm1.invoke(() -> MiscellaneousCommandsDUnitTest.getMemberId());
       String command = "show log --member=" + vm1MemberId + " --lines=50";
       CommandResult cmdResult = executeCommand(command);
       if (cmdResult != null) {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/69024aa9/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/MiscellaneousCommandsExportLogsPart3DUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/MiscellaneousCommandsExportLogsPart3DUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/MiscellaneousCommandsExportLogsPart3DUnitTest.java
index 7d67b61..9cc863f 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/MiscellaneousCommandsExportLogsPart3DUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/MiscellaneousCommandsExportLogsPart3DUnitTest.java
@@ -126,7 +126,7 @@ public class MiscellaneousCommandsExportLogsPart3DUnitTest extends CliCommandTes
     String end = sf.format(enddate);
 
     final VM vm1 = Host.getHost(0).getVM(1);
-    final String vm1MemberId = (String) vm1.invoke(MiscellaneousCommandsDUnitTest.class, "getMemberId");
+    final String vm1MemberId = (String) vm1.invoke(() -> MiscellaneousCommandsDUnitTest.getMemberId());
     String dir = getCurrentTimeString();
 
     String logLevel = LogWriterImpl.levelToString(LogWriterImpl.INFO_LEVEL);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/69024aa9/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/pulse/TestFunctionsDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/pulse/TestFunctionsDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/pulse/TestFunctionsDUnitTest.java
index c2f2b60..b410a82 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/pulse/TestFunctionsDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/pulse/TestFunctionsDUnitTest.java
@@ -95,8 +95,7 @@ public class TestFunctionsDUnitTest extends ManagementTestBase {
         }
       }
     });
-    Integer numOfRunningFunctions = (Integer) managingNode.invoke(
-        TestFunctionsDUnitTest.class, "getNumOfRunningFunction");
+    Integer numOfRunningFunctions = (Integer) managingNode.invoke(() -> TestFunctionsDUnitTest.getNumOfRunningFunction());
     LogWriterUtils.getLogWriter().info(
         "TestNumOfFunctions numOfRunningFunctions= " + numOfRunningFunctions);
     assertTrue(numOfRunningFunctions > 0 ? true : false);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/69024aa9/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/pulse/TestHeapDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/pulse/TestHeapDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/pulse/TestHeapDUnitTest.java
index f8abe35..78e91b0 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/pulse/TestHeapDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/pulse/TestHeapDUnitTest.java
@@ -79,11 +79,10 @@ public class TestHeapDUnitTest extends ManagementTestBase {
     long totalHeapSizeOnAll = 0;
     for (VM vm : managedNodeList) {
       totalHeapSizeOnAll = totalHeapSizeOnAll
-          + ((Number) vm.invoke(TestHeapDUnitTest.class, "getHeapSizeOfClient"))
+          + ((Number) vm.invoke(() -> TestHeapDUnitTest.getHeapSizeOfClient()))
               .longValue();
             }
-    long totalHeapSizeFromMXBean = ((Number) managingNode.invoke(
-        TestHeapDUnitTest.class, "getHeapSizeOfDS")).intValue();
+    long totalHeapSizeFromMXBean = ((Number) managingNode.invoke(() -> TestHeapDUnitTest.getHeapSizeOfDS())).intValue();
 
     LogWriterUtils.getLogWriter().info(
         "testTotalHeapSize totalHeapSizeFromMXBean = "

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/69024aa9/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/pulse/TestLocatorsDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/pulse/TestLocatorsDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/pulse/TestLocatorsDUnitTest.java
index e9b976a..926c2ff 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/pulse/TestLocatorsDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/pulse/TestLocatorsDUnitTest.java
@@ -70,8 +70,7 @@ public class TestLocatorsDUnitTest extends ManagementTestBase {
 
   public void testLocatorsDUnitTest() throws Exception {
     initManagement(false);
-    int locatorCount = ((Number) managingNode.invoke(
-        TestLocatorsDUnitTest.class, "getNumOfLocatorFromMBean")).intValue();
+    int locatorCount = ((Number) managingNode.invoke(() -> TestLocatorsDUnitTest.getNumOfLocatorFromMBean())).intValue();
     LogWriterUtils.getLogWriter().info("TestLocatorsDUnitTest locatorCount =" + locatorCount);
     assertEquals(1, locatorCount);
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/69024aa9/gemfire-core/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPITestBase.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPITestBase.java b/gemfire-core/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPITestBase.java
index 7cd95fd..50965f6 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPITestBase.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPITestBase.java
@@ -60,10 +60,10 @@ public class RestAPITestBase extends DistributedTestCase {
    */
   @Override
   protected final void preTearDown() throws Exception {
-    vm0.invoke(getClass(), "closeCache");
-    vm1.invoke(getClass(), "closeCache");
-    vm2.invoke(getClass(), "closeCache");
-    vm3.invoke(getClass(), "closeCache");
+    vm0.invoke(() -> closeCache());
+    vm1.invoke(() -> closeCache());
+    vm2.invoke(() -> closeCache());
+    vm3.invoke(() -> closeCache());
   }
 
   /**

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/69024aa9/gemfire-core/src/test/java/com/gemstone/gemfire/security/ClientAuthenticationDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/security/ClientAuthenticationDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/security/ClientAuthenticationDUnitTest.java
index 911454a..b866011 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/security/ClientAuthenticationDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/security/ClientAuthenticationDUnitTest.java
@@ -86,14 +86,10 @@ public class ClientAuthenticationDUnitTest extends DistributedTestCase {
     
     IgnoredException.addIgnoredException("Connection refused: connect");
 
-    server1.invoke(SecurityTestUtil.class, "registerExpectedExceptions",
-        new Object[] { serverExpectedExceptions });
-    server2.invoke(SecurityTestUtil.class, "registerExpectedExceptions",
-        new Object[] { serverExpectedExceptions });
-    client1.invoke(SecurityTestUtil.class, "registerExpectedExceptions",
-        new Object[] { clientExpectedExceptions });
-    client2.invoke(SecurityTestUtil.class, "registerExpectedExceptions",
-        new Object[] { clientExpectedExceptions });
+    server1.invoke(() -> SecurityTestUtil.registerExpectedExceptions( serverExpectedExceptions ));
+    server2.invoke(() -> SecurityTestUtil.registerExpectedExceptions( serverExpectedExceptions ));
+    client1.invoke(() -> SecurityTestUtil.registerExpectedExceptions( clientExpectedExceptions ));
+    client2.invoke(() -> SecurityTestUtil.registerExpectedExceptions( clientExpectedExceptions ));
   }
 
   // Region: Utility and static functions invoked by the tests
@@ -225,14 +221,10 @@ public class ClientAuthenticationDUnitTest extends DistributedTestCase {
       Integer locPort1 = SecurityTestUtil.getLocatorPort();
       Integer locPort2 = SecurityTestUtil.getLocatorPort();
       String locString = SecurityTestUtil.getLocatorString();
-      Integer port1 = (Integer)server1.invoke(
-          ClientAuthenticationDUnitTest.class, "createCacheServer",
-          new Object[] { locPort1, locString, authenticator, extraProps,
-              javaProps });
-      Integer port2 = (Integer)server2.invoke(
-          ClientAuthenticationDUnitTest.class, "createCacheServer",
-          new Object[] { locPort2, locString, authenticator, extraProps,
-              javaProps });
+      Integer port1 = (Integer)server1.invoke(() -> ClientAuthenticationDUnitTest.createCacheServer( locPort1, locString, authenticator, extraProps,
+              javaProps ));
+      Integer port2 = (Integer)server2.invoke(() -> ClientAuthenticationDUnitTest.createCacheServer( locPort2, locString, authenticator, extraProps,
+              javaProps ));
 
       // Start the clients with valid credentials
       Properties credentials1 = gen.getValidCredentials(1);
@@ -245,28 +237,22 @@ public class ClientAuthenticationDUnitTest extends DistributedTestCase {
       LogWriterUtils.getLogWriter().info(
           "testValidCredentials: For second client credentials: "
               + credentials2 + " : " + javaProps2);
-      client1.invoke(ClientAuthenticationDUnitTest.class, "createCacheClient",
-          new Object[] { authInit, credentials1, javaProps1, port1, port2,
-              null, multiUser, new Integer(SecurityTestUtil.NO_EXCEPTION) });
-      client2.invoke(ClientAuthenticationDUnitTest.class, "createCacheClient",
-          new Object[] { authInit, credentials2, javaProps2, port1, port2,
-              null, multiUser, new Integer(SecurityTestUtil.NO_EXCEPTION) });
+      client1.invoke(() -> ClientAuthenticationDUnitTest.createCacheClient( authInit, credentials1, javaProps1, port1, port2,
+              null, multiUser, new Integer(SecurityTestUtil.NO_EXCEPTION) ));
+      client2.invoke(() -> ClientAuthenticationDUnitTest.createCacheClient( authInit, credentials2, javaProps2, port1, port2,
+              null, multiUser, new Integer(SecurityTestUtil.NO_EXCEPTION) ));
 
       // Perform some put operations from client1
-      client1.invoke(SecurityTestUtil.class, "doPuts",
-          new Object[] { new Integer(2) });
+      client1.invoke(() -> SecurityTestUtil.doPuts( new Integer(2) ));
 
       // Verify that the puts succeeded
-      client2.invoke(SecurityTestUtil.class, "doGets",
-          new Object[] { new Integer(2) });
+      client2.invoke(() -> SecurityTestUtil.doGets( new Integer(2) ));
       
       if (multiUser) {
-        client1.invoke(SecurityTestUtil.class, "doProxyCacheClose");
-        client2.invoke(SecurityTestUtil.class, "doProxyCacheClose");
-        client1.invoke(SecurityTestUtil.class, "doSimplePut",
-            new Object[] {"CacheClosedException"});
-        client2.invoke(SecurityTestUtil.class, "doSimpleGet",
-            new Object[] {"CacheClosedException"});
+        client1.invoke(() -> SecurityTestUtil.doProxyCacheClose());
+        client2.invoke(() -> SecurityTestUtil.doProxyCacheClose());
+        client1.invoke(() -> SecurityTestUtil.doSimplePut("CacheClosedException"));
+        client2.invoke(() -> SecurityTestUtil.doSimpleGet("CacheClosedException"));
       }
   }
 
@@ -291,14 +277,10 @@ public class ClientAuthenticationDUnitTest extends DistributedTestCase {
       Integer locPort1 = SecurityTestUtil.getLocatorPort();
       Integer locPort2 = SecurityTestUtil.getLocatorPort();
       String locString = SecurityTestUtil.getLocatorString();
-      Integer port1 = ((Integer)server1.invoke(
-          ClientAuthenticationDUnitTest.class, "createCacheServer",
-          new Object[] { locPort1, locString, authenticator, extraProps,
-              javaProps }));
-      Integer port2 = ((Integer)server2.invoke(
-          ClientAuthenticationDUnitTest.class, "createCacheServer",
-          new Object[] { locPort2, locString, authenticator, extraProps,
-              javaProps }));
+      Integer port1 = ((Integer)server1.invoke(() -> ClientAuthenticationDUnitTest.createCacheServer( locPort1, locString, authenticator, extraProps,
+              javaProps )));
+      Integer port2 = ((Integer)server2.invoke(() -> ClientAuthenticationDUnitTest.createCacheServer( locPort2, locString, authenticator, extraProps,
+              javaProps )));
 
       // Start first client with valid credentials
       Properties credentials1 = gen.getValidCredentials(1);
@@ -306,13 +288,11 @@ public class ClientAuthenticationDUnitTest extends DistributedTestCase {
       LogWriterUtils.getLogWriter().info(
           "testNoCredentials: For first client credentials: " + credentials1
               + " : " + javaProps1);
-      client1.invoke(ClientAuthenticationDUnitTest.class, "createCacheClient",
-          new Object[] { authInit, credentials1, javaProps1, port1, port2,
-              null, multiUser, new Integer(SecurityTestUtil.NO_EXCEPTION) });
+      client1.invoke(() -> ClientAuthenticationDUnitTest.createCacheClient( authInit, credentials1, javaProps1, port1, port2,
+              null, multiUser, new Integer(SecurityTestUtil.NO_EXCEPTION) ));
 
       // Perform some put operations from client1
-      client1.invoke(SecurityTestUtil.class, "doPuts",
-          new Object[] { new Integer(2) });
+      client1.invoke(() -> SecurityTestUtil.doPuts( new Integer(2) ));
 
       // Trying to create the region on client2 
       if (gen.classCode().equals(ClassCode.SSL)) {
@@ -320,16 +300,14 @@ public class ClientAuthenticationDUnitTest extends DistributedTestCase {
         // before handshake message is sent from client. However exception
         // should come in any region operations.
         client2
-            .invoke(ClientAuthenticationDUnitTest.class, "createCacheClient",
-                new Object[] { null, null, null, port1, port2, null, multiUser,
-                    new Integer(SecurityTestUtil.NO_EXCEPTION) });
-        client2.invoke(SecurityTestUtil.class, "doPuts", new Object[] {
-            new Integer(2), new Integer(SecurityTestUtil.OTHER_EXCEPTION) });
+            .invoke(() -> ClientAuthenticationDUnitTest.createCacheClient( null, null, null, port1, port2, null, multiUser,
+                    new Integer(SecurityTestUtil.NO_EXCEPTION) ));
+        client2.invoke(() -> SecurityTestUtil.doPuts(
+            new Integer(2), new Integer(SecurityTestUtil.OTHER_EXCEPTION) ));
       }
       else {
-        client2.invoke(ClientAuthenticationDUnitTest.class,
-            "createCacheClient", new Object[] { null, null, null, port1, port2,
-                null, multiUser, new Integer(SecurityTestUtil.AUTHREQ_EXCEPTION) });
+        client2.invoke(() -> ClientAuthenticationDUnitTest.createCacheClient( null, null, null, port1, port2,
+                null, multiUser, new Integer(SecurityTestUtil.AUTHREQ_EXCEPTION) ));
       }
   }
 
@@ -357,14 +335,10 @@ public class ClientAuthenticationDUnitTest extends DistributedTestCase {
       Integer locPort1 = SecurityTestUtil.getLocatorPort();
       Integer locPort2 = SecurityTestUtil.getLocatorPort();
       String locString = SecurityTestUtil.getLocatorString();
-      Integer port1 = ((Integer)server1.invoke(
-          ClientAuthenticationDUnitTest.class, "createCacheServer",
-          new Object[] { locPort1, locString, authenticator, extraProps,
-              javaProps }));
-      Integer port2 = ((Integer)server2.invoke(
-          ClientAuthenticationDUnitTest.class, "createCacheServer",
-          new Object[] { locPort2, locString, authenticator, extraProps,
-              javaProps }));
+      Integer port1 = ((Integer)server1.invoke(() -> ClientAuthenticationDUnitTest.createCacheServer( locPort1, locString, authenticator, extraProps,
+              javaProps )));
+      Integer port2 = ((Integer)server2.invoke(() -> ClientAuthenticationDUnitTest.createCacheServer( locPort2, locString, authenticator, extraProps,
+              javaProps )));
 
       // Start first client with valid credentials
       Properties credentials1 = gen.getValidCredentials(1);
@@ -372,13 +346,11 @@ public class ClientAuthenticationDUnitTest extends DistributedTestCase {
       LogWriterUtils.getLogWriter().info(
           "testInvalidCredentials: For first client credentials: "
               + credentials1 + " : " + javaProps1);
-      client1.invoke(ClientAuthenticationDUnitTest.class, "createCacheClient",
-          new Object[] { authInit, credentials1, javaProps1, port1, port2,
-              null, multiUser, new Integer(SecurityTestUtil.NO_EXCEPTION) });
+      client1.invoke(() -> ClientAuthenticationDUnitTest.createCacheClient( authInit, credentials1, javaProps1, port1, port2,
+              null, multiUser, new Integer(SecurityTestUtil.NO_EXCEPTION) ));
 
       // Perform some put operations from client1
-      client1.invoke(SecurityTestUtil.class, "doPuts",
-          new Object[] { new Integer(2) });
+      client1.invoke(() -> SecurityTestUtil.doPuts( new Integer(2) ));
 
       // Start second client with invalid credentials
       // Trying to create the region on client2 should throw a security
@@ -388,9 +360,8 @@ public class ClientAuthenticationDUnitTest extends DistributedTestCase {
       LogWriterUtils.getLogWriter().info(
           "testInvalidCredentials: For second client credentials: "
               + credentials2 + " : " + javaProps2);
-      client2.invoke(ClientAuthenticationDUnitTest.class, "createCacheClient",
-          new Object[] { authInit, credentials2, javaProps2, port1, port2,
-              null, multiUser, new Integer(SecurityTestUtil.AUTHFAIL_EXCEPTION) });
+      client2.invoke(() -> ClientAuthenticationDUnitTest.createCacheClient( authInit, credentials2, javaProps2, port1, port2,
+              null, multiUser, new Integer(SecurityTestUtil.AUTHFAIL_EXCEPTION) ));
   }
 
   public void testInvalidAuthInit() {
@@ -412,10 +383,8 @@ public class ClientAuthenticationDUnitTest extends DistributedTestCase {
       // Start the server
       Integer locPort1 = SecurityTestUtil.getLocatorPort();
       String locString = SecurityTestUtil.getLocatorString();
-      Integer port1 = ((Integer)server1.invoke(
-          ClientAuthenticationDUnitTest.class, "createCacheServer",
-          new Object[] { locPort1, locString, authenticator, extraProps,
-              javaProps }));
+      Integer port1 = ((Integer)server1.invoke(() -> ClientAuthenticationDUnitTest.createCacheServer( locPort1, locString, authenticator, extraProps,
+              javaProps )));
 
       Properties credentials = gen.getValidCredentials(1);
       javaProps = gen.getJavaProperties();
@@ -450,14 +419,10 @@ public class ClientAuthenticationDUnitTest extends DistributedTestCase {
       Integer locPort1 = SecurityTestUtil.getLocatorPort();
       Integer locPort2 = SecurityTestUtil.getLocatorPort();
       String locString = SecurityTestUtil.getLocatorString();
-      Integer port1 = ((Integer)server1.invoke(
-          ClientAuthenticationDUnitTest.class, "createCacheServer",
-          new Object[] { locPort1, locString, authenticator, extraProps,
-              javaProps }));
-      Integer port2 = ((Integer)server2.invoke(
-          ClientAuthenticationDUnitTest.class, "createCacheServer",
-          new Object[] { locPort2, locString, authenticator, extraProps,
-              javaProps }));
+      Integer port1 = ((Integer)server1.invoke(() -> ClientAuthenticationDUnitTest.createCacheServer( locPort1, locString, authenticator, extraProps,
+              javaProps )));
+      Integer port2 = ((Integer)server2.invoke(() -> ClientAuthenticationDUnitTest.createCacheServer( locPort2, locString, authenticator, extraProps,
+              javaProps )));
 
       // Start the clients with valid credentials
       Properties credentials1 = gen.getValidCredentials(1);
@@ -470,21 +435,18 @@ public class ClientAuthenticationDUnitTest extends DistributedTestCase {
       LogWriterUtils.getLogWriter().info(
           "testNoAuthInitWithCredentials: For second client credentials: "
               + credentials2 + " : " + javaProps2);
-      client1.invoke(ClientAuthenticationDUnitTest.class, "createCacheClient",
-          new Object[] { null, credentials1, javaProps1, port1, port2, null,
-          multiUser, new Integer(SecurityTestUtil.AUTHREQ_EXCEPTION) });
-      client2.invoke(ClientAuthenticationDUnitTest.class, "createCacheClient",
-          new Object[] { null, credentials2, javaProps2, port1, port2, null,
-          multiUser, new Integer(SecurityTestUtil.AUTHREQ_EXCEPTION) });
-      client2.invoke(SecurityTestUtil.class, "closeCache");
+      client1.invoke(() -> ClientAuthenticationDUnitTest.createCacheClient( null, credentials1, javaProps1, port1, port2, null,
+          multiUser, new Integer(SecurityTestUtil.AUTHREQ_EXCEPTION) ));
+      client2.invoke(() -> ClientAuthenticationDUnitTest.createCacheClient( null, credentials2, javaProps2, port1, port2, null,
+          multiUser, new Integer(SecurityTestUtil.AUTHREQ_EXCEPTION) ));
+      client2.invoke(() -> SecurityTestUtil.closeCache());
       
 
       // Now also try with invalid credentials
       credentials2 = gen.getInvalidCredentials(5);
       javaProps2 = gen.getJavaProperties();
-      client2.invoke(ClientAuthenticationDUnitTest.class, "createCacheClient",
-          new Object[] { null, credentials2, javaProps2, port1, port2, null,
-          multiUser, new Integer(SecurityTestUtil.AUTHREQ_EXCEPTION) });
+      client2.invoke(() -> ClientAuthenticationDUnitTest.createCacheClient( null, credentials2, javaProps2, port1, port2, null,
+          multiUser, new Integer(SecurityTestUtil.AUTHREQ_EXCEPTION) ));
   }
 
   public void testInvalidAuthenticator() {
@@ -506,10 +468,8 @@ public class ClientAuthenticationDUnitTest extends DistributedTestCase {
       // Start the server with invalid authenticator
       Integer locPort1 = SecurityTestUtil.getLocatorPort();
       String locString = SecurityTestUtil.getLocatorString();
-      Integer port1 = (Integer)server1.invoke(
-          ClientAuthenticationDUnitTest.class, "createCacheServer",
-          new Object[] { locPort1, locString, "com.gemstone.gemfire.none",
-              extraProps, javaProps });
+      Integer port1 = (Integer)server1.invoke(() -> ClientAuthenticationDUnitTest.createCacheServer( locPort1, locString, "com.gemstone.gemfire.none",
+              extraProps, javaProps ));
 
       // Trying to create the region on client should throw a security exception
       Properties credentials = gen.getValidCredentials(1);
@@ -517,10 +477,9 @@ public class ClientAuthenticationDUnitTest extends DistributedTestCase {
       LogWriterUtils.getLogWriter().info(
           "testInvalidAuthenticator: For first client credentials: "
               + credentials + " : " + javaProps);
-      client1.invoke(ClientAuthenticationDUnitTest.class, "createCacheClient",
-          new Object[] { authInit, credentials, javaProps, port1, null,
-              new Integer(SecurityTestUtil.AUTHFAIL_EXCEPTION) });
-      client1.invoke(SecurityTestUtil.class, "closeCache");
+      client1.invoke(() -> ClientAuthenticationDUnitTest.createCacheClient( authInit, credentials, javaProps, port1, null,
+              new Integer(SecurityTestUtil.AUTHFAIL_EXCEPTION) ));
+      client1.invoke(() -> SecurityTestUtil.closeCache());
       
 
       // Also test with invalid credentials
@@ -529,9 +488,8 @@ public class ClientAuthenticationDUnitTest extends DistributedTestCase {
       LogWriterUtils.getLogWriter().info(
           "testInvalidAuthenticator: For first client credentials: "
               + credentials + " : " + javaProps);
-      client1.invoke(ClientAuthenticationDUnitTest.class, "createCacheClient",
-          new Object[] { authInit, credentials, javaProps, port1, null,
-              new Integer(SecurityTestUtil.AUTHFAIL_EXCEPTION) });
+      client1.invoke(() -> ClientAuthenticationDUnitTest.createCacheClient( authInit, credentials, javaProps, port1, null,
+              new Integer(SecurityTestUtil.AUTHFAIL_EXCEPTION) ));
   }
 
   public void testNoAuthenticatorWithCredentials() {
@@ -556,12 +514,8 @@ public class ClientAuthenticationDUnitTest extends DistributedTestCase {
       Integer locPort1 = SecurityTestUtil.getLocatorPort();
       Integer locPort2 = SecurityTestUtil.getLocatorPort();
       String locString = SecurityTestUtil.getLocatorString();
-      Integer port1 = (Integer)server1.invoke(
-          ClientAuthenticationDUnitTest.class, "createCacheServer",
-          new Object[] { locPort1, locString, null, extraProps, javaProps });
-      Integer port2 = (Integer)server2.invoke(
-          ClientAuthenticationDUnitTest.class, "createCacheServer",
-          new Object[] { locPort2, locString, null, extraProps, javaProps });
+      Integer port1 = (Integer)server1.invoke(() -> ClientAuthenticationDUnitTest.createCacheServer( locPort1, locString, null, extraProps, javaProps ));
+      Integer port2 = (Integer)server2.invoke(() -> ClientAuthenticationDUnitTest.createCacheServer( locPort2, locString, null, extraProps, javaProps ));
 
       // Clients should connect successfully and work properly with
       // valid/invalid credentials when none are required on the server side
@@ -575,20 +529,16 @@ public class ClientAuthenticationDUnitTest extends DistributedTestCase {
       LogWriterUtils.getLogWriter().info(
           "testNoAuthenticatorWithCredentials: For second client credentials: "
               + credentials2 + " : " + javaProps2);
-      client1.invoke(ClientAuthenticationDUnitTest.class, "createCacheClient",
-          new Object[] { authInit, credentials1, javaProps1, port1, port2,
-              null, multiUser, new Integer(SecurityTestUtil.NO_EXCEPTION) });
-      client2.invoke(ClientAuthenticationDUnitTest.class, "createCacheClient",
-          new Object[] { authInit, credentials2, javaProps2, port1, port2,
-              null, multiUser, new Integer(SecurityTestUtil.NO_EXCEPTION) });
+      client1.invoke(() -> ClientAuthenticationDUnitTest.createCacheClient( authInit, credentials1, javaProps1, port1, port2,
+              null, multiUser, new Integer(SecurityTestUtil.NO_EXCEPTION) ));
+      client2.invoke(() -> ClientAuthenticationDUnitTest.createCacheClient( authInit, credentials2, javaProps2, port1, port2,
+              null, multiUser, new Integer(SecurityTestUtil.NO_EXCEPTION) ));
 
       // Perform some put operations from client1
-      client1.invoke(SecurityTestUtil.class, "doPuts",
-          new Object[] { new Integer(2) });
+      client1.invoke(() -> SecurityTestUtil.doPuts( new Integer(2) ));
 
       // Verify that the puts succeeded
-      client2.invoke(SecurityTestUtil.class, "doGets",
-          new Object[] { new Integer(2) });
+      client2.invoke(() -> SecurityTestUtil.doGets( new Integer(2) ));
   }
 
   public void testCredentialsWithFailover() {
@@ -613,10 +563,8 @@ public class ClientAuthenticationDUnitTest extends DistributedTestCase {
       Integer locPort1 = SecurityTestUtil.getLocatorPort();
       Integer locPort2 = SecurityTestUtil.getLocatorPort();
       String locString = SecurityTestUtil.getLocatorString();
-      Integer port1 = (Integer)server1.invoke(
-          ClientAuthenticationDUnitTest.class, "createCacheServer",
-          new Object[] { locPort1, locString, authenticator, extraProps,
-              javaProps });
+      Integer port1 = (Integer)server1.invoke(() -> ClientAuthenticationDUnitTest.createCacheServer( locPort1, locString, authenticator, extraProps,
+              javaProps ));
       // Get a port for second server but do not start it
       // This forces the clients to connect to the first server
       Integer port2 = new Integer(AvailablePort
@@ -633,32 +581,25 @@ public class ClientAuthenticationDUnitTest extends DistributedTestCase {
       LogWriterUtils.getLogWriter().info(
           "testCredentialsWithFailover: For second client credentials: "
               + credentials2 + " : " + javaProps2);
-      client1.invoke(ClientAuthenticationDUnitTest.class, "createCacheClient",
-          new Object[] { authInit, credentials1, javaProps1, port1, port2,
-              null, multiUser, new Integer(SecurityTestUtil.NO_EXCEPTION) });
-      client2.invoke(ClientAuthenticationDUnitTest.class, "createCacheClient",
-          new Object[] { authInit, credentials2, javaProps2, port1, port2,
-              null, multiUser, new Integer(SecurityTestUtil.NO_EXCEPTION) });
+      client1.invoke(() -> ClientAuthenticationDUnitTest.createCacheClient( authInit, credentials1, javaProps1, port1, port2,
+              null, multiUser, new Integer(SecurityTestUtil.NO_EXCEPTION) ));
+      client2.invoke(() -> ClientAuthenticationDUnitTest.createCacheClient( authInit, credentials2, javaProps2, port1, port2,
+              null, multiUser, new Integer(SecurityTestUtil.NO_EXCEPTION) ));
 
       // Perform some put operations from client1
-      client1.invoke(SecurityTestUtil.class, "doPuts",
-          new Object[] { new Integer(2) });
+      client1.invoke(() -> SecurityTestUtil.doPuts( new Integer(2) ));
       // Verify that the puts succeeded
-      client2.invoke(SecurityTestUtil.class, "doGets",
-          new Object[] { new Integer(2) });
+      client2.invoke(() -> SecurityTestUtil.doGets( new Integer(2) ));
 
       // start the second one and stop the first server to force a failover
-      server2.invoke(ClientAuthenticationDUnitTest.class, "createCacheServer",
-          new Object[] { locPort2, locString, port2, authenticator, extraProps,
-              javaProps });
-      server1.invoke(SecurityTestUtil.class, "closeCache");
+      server2.invoke(() -> ClientAuthenticationDUnitTest.createCacheServer( locPort2, locString, port2, authenticator, extraProps,
+              javaProps ));
+      server1.invoke(() -> SecurityTestUtil.closeCache());
 
       // Perform some create/update operations from client1
-      client1.invoke(SecurityTestUtil.class, "doNPuts",
-          new Object[] { new Integer(4) });
+      client1.invoke(() -> SecurityTestUtil.doNPuts( new Integer(4) ));
       // Verify that the creates/updates succeeded
-      client2.invoke(SecurityTestUtil.class, "doNGets",
-          new Object[] { new Integer(4) });
+      client2.invoke(() -> SecurityTestUtil.doNGets( new Integer(4) ));
 
       // Try to connect client2 with no credentials
       // Verify that the creation of region throws security exception
@@ -667,16 +608,14 @@ public class ClientAuthenticationDUnitTest extends DistributedTestCase {
         // before handshake message is sent from client. However exception
         // should come in any region operations.
         client2
-            .invoke(ClientAuthenticationDUnitTest.class, "createCacheClient",
-                new Object[] { null, null, null, port1, port2, null, multiUser,
-                    new Integer(SecurityTestUtil.NOFORCE_AUTHREQ_EXCEPTION) });
-        client2.invoke(SecurityTestUtil.class, "doPuts", new Object[] {
-            new Integer(2), new Integer(SecurityTestUtil.OTHER_EXCEPTION) });
+            .invoke(() -> ClientAuthenticationDUnitTest.createCacheClient( null, null, null, port1, port2, null, multiUser,
+                    new Integer(SecurityTestUtil.NOFORCE_AUTHREQ_EXCEPTION) ));
+        client2.invoke(() -> SecurityTestUtil.doPuts(
+            new Integer(2), new Integer(SecurityTestUtil.OTHER_EXCEPTION) ));
       }
       else {
-        client2.invoke(ClientAuthenticationDUnitTest.class,
-            "createCacheClient", new Object[] { null, null, null, port1, port2,
-                null, multiUser, new Integer(SecurityTestUtil.AUTHREQ_EXCEPTION) });
+        client2.invoke(() -> ClientAuthenticationDUnitTest.createCacheClient( null, null, null, port1, port2,
+                null, multiUser, new Integer(SecurityTestUtil.AUTHREQ_EXCEPTION) ));
       }
 
       // Now try to connect client1 with invalid credentials
@@ -686,17 +625,14 @@ public class ClientAuthenticationDUnitTest extends DistributedTestCase {
       LogWriterUtils.getLogWriter().info(
           "testCredentialsWithFailover: For first client invalid credentials: "
               + credentials1 + " : " + javaProps1);
-      client1.invoke(ClientAuthenticationDUnitTest.class, "createCacheClient",
-          new Object[] { authInit, credentials1, javaProps1, port1, port2,
-              null, multiUser, new Integer(SecurityTestUtil.AUTHFAIL_EXCEPTION) });
+      client1.invoke(() -> ClientAuthenticationDUnitTest.createCacheClient( authInit, credentials1, javaProps1, port1, port2,
+              null, multiUser, new Integer(SecurityTestUtil.AUTHFAIL_EXCEPTION) ));
 
       if (multiUser) {
-        client1.invoke(SecurityTestUtil.class, "doProxyCacheClose");
-        client2.invoke(SecurityTestUtil.class, "doProxyCacheClose");
-        client1.invoke(SecurityTestUtil.class, "doSimplePut",
-            new Object[] {"CacheClosedException"});
-        client2.invoke(SecurityTestUtil.class, "doSimpleGet",
-            new Object[] {"CacheClosedException"});
+        client1.invoke(() -> SecurityTestUtil.doProxyCacheClose());
+        client2.invoke(() -> SecurityTestUtil.doProxyCacheClose());
+        client1.invoke(() -> SecurityTestUtil.doSimplePut("CacheClosedException"));
+        client2.invoke(() -> SecurityTestUtil.doSimpleGet("CacheClosedException"));
       }
   }
 
@@ -723,10 +659,8 @@ public class ClientAuthenticationDUnitTest extends DistributedTestCase {
       Integer locPort1 = SecurityTestUtil.getLocatorPort();
       Integer locPort2 = SecurityTestUtil.getLocatorPort();
       String locString = SecurityTestUtil.getLocatorString();
-      Integer port1 = (Integer)server1.invoke(
-          ClientAuthenticationDUnitTest.class, "createCacheServer",
-          new Object[] { locPort1, locString, authenticator, extraProps,
-              javaProps });
+      Integer port1 = (Integer)server1.invoke(() -> ClientAuthenticationDUnitTest.createCacheServer( locPort1, locString, authenticator, extraProps,
+              javaProps ));
       // Get a port for second server but do not start it
       // This forces the clients to connect to the first server
       Integer port2 = new Integer(AvailablePort
@@ -743,63 +677,53 @@ public class ClientAuthenticationDUnitTest extends DistributedTestCase {
       LogWriterUtils.getLogWriter().info(
           "testCredentialsForNotifications: For second client credentials: "
               + credentials2 + " : " + javaProps2);
-      client1.invoke(ClientAuthenticationDUnitTest.class, "createCacheClient",
-          new Object[] { authInit, credentials1, javaProps1, port1, port2,
-              null, multiUser, new Integer(SecurityTestUtil.NO_EXCEPTION) });
+      client1.invoke(() -> ClientAuthenticationDUnitTest.createCacheClient( authInit, credentials1, javaProps1, port1, port2,
+              null, multiUser, new Integer(SecurityTestUtil.NO_EXCEPTION) ));
       // Set up zero forward connections to check notification handshake only
       Object zeroConns = new Integer(0);
-      client2.invoke(ClientAuthenticationDUnitTest.class, "createCacheClient",
-          new Object[] { authInit, credentials2, javaProps2, port1, port2,
-              zeroConns, multiUser, new Integer(SecurityTestUtil.NO_EXCEPTION) });
+      client2.invoke(() -> ClientAuthenticationDUnitTest.createCacheClient( authInit, credentials2, javaProps2, port1, port2,
+              zeroConns, multiUser, new Integer(SecurityTestUtil.NO_EXCEPTION) ));
 
       // Register interest on all keys on second client
       client2
-          .invoke(ClientAuthenticationDUnitTest.class, "registerAllInterest");
+          .invoke(() -> ClientAuthenticationDUnitTest.registerAllInterest());
 
       // Perform some put operations from client1
-      client1.invoke(SecurityTestUtil.class, "doPuts",
-          new Object[] { new Integer(2) });
+      client1.invoke(() -> SecurityTestUtil.doPuts( new Integer(2) ));
 
       // Verify that the puts succeeded
-      client2.invoke(SecurityTestUtil.class, "doLocalGets",
-          new Object[] { new Integer(2) });
+      client2.invoke(() -> SecurityTestUtil.doLocalGets( new Integer(2) ));
 
       // start the second one and stop the first server to force a failover
-      server2.invoke(ClientAuthenticationDUnitTest.class, "createCacheServer",
-          new Object[] { locPort2, locString, port2, authenticator, extraProps,
-              javaProps });
-      server1.invoke(SecurityTestUtil.class, "closeCache");
+      server2.invoke(() -> ClientAuthenticationDUnitTest.createCacheServer( locPort2, locString, port2, authenticator, extraProps,
+              javaProps ));
+      server1.invoke(() -> SecurityTestUtil.closeCache());
 
       // Wait for failover to complete
       Wait.pause(500);
 
       // Perform some create/update operations from client1
-      client1.invoke(SecurityTestUtil.class, "doNPuts",
-          new Object[] { new Integer(4) });
+      client1.invoke(() -> SecurityTestUtil.doNPuts( new Integer(4) ));
       // Verify that the creates/updates succeeded
-      client2.invoke(SecurityTestUtil.class, "doNLocalGets",
-          new Object[] { new Integer(4) });
+      client2.invoke(() -> SecurityTestUtil.doNLocalGets( new Integer(4) ));
 
       // Try to connect client1 with no credentials
       // Verify that the creation of region throws security exception
-      server1.invoke(ClientAuthenticationDUnitTest.class, "createCacheServer",
-          new Object[] { locPort1, locString, port1, authenticator, extraProps,
-              javaProps });
+      server1.invoke(() -> ClientAuthenticationDUnitTest.createCacheServer( locPort1, locString, port1, authenticator, extraProps,
+              javaProps ));
       if (gen.classCode().equals(ClassCode.SSL)) {
         // For SSL the exception may not come since the server can close socket
         // before handshake message is sent from client. However exception
         // should come in any region operations.
-        client1.invoke(ClientAuthenticationDUnitTest.class,
-            "createCacheClient", new Object[] { null, null, null, port1, port2,
+        client1.invoke(() -> ClientAuthenticationDUnitTest.createCacheClient( null, null, null, port1, port2,
                 zeroConns, multiUser,
-                new Integer(SecurityTestUtil.NOFORCE_AUTHREQ_EXCEPTION) });
-        client1.invoke(SecurityTestUtil.class, "doPuts", new Object[] {
-            new Integer(2), new Integer(SecurityTestUtil.OTHER_EXCEPTION) });
+                new Integer(SecurityTestUtil.NOFORCE_AUTHREQ_EXCEPTION) ));
+        client1.invoke(() -> SecurityTestUtil.doPuts(
+            new Integer(2), new Integer(SecurityTestUtil.OTHER_EXCEPTION) ));
       }
       else {
-        client1.invoke(ClientAuthenticationDUnitTest.class,
-            "createCacheClient", new Object[] { null, null, null, port1, port2,
-                zeroConns, multiUser, new Integer(SecurityTestUtil.AUTHREQ_EXCEPTION) });
+        client1.invoke(() -> ClientAuthenticationDUnitTest.createCacheClient( null, null, null, port1, port2,
+                zeroConns, multiUser, new Integer(SecurityTestUtil.AUTHREQ_EXCEPTION) ));
       }
 
       // Now try to connect client2 with invalid credentials
@@ -809,41 +733,35 @@ public class ClientAuthenticationDUnitTest extends DistributedTestCase {
       LogWriterUtils.getLogWriter().info(
           "testCredentialsForNotifications: For second client invalid credentials: "
               + credentials2 + " : " + javaProps2);
-      client2.invoke(ClientAuthenticationDUnitTest.class, "createCacheClient",
-          new Object[] { authInit, credentials2, javaProps2, port1, port2,
-              zeroConns, multiUser, new Integer(SecurityTestUtil.AUTHFAIL_EXCEPTION) });
+      client2.invoke(() -> ClientAuthenticationDUnitTest.createCacheClient( authInit, credentials2, javaProps2, port1, port2,
+              zeroConns, multiUser, new Integer(SecurityTestUtil.AUTHFAIL_EXCEPTION) ));
 
       // Now try to connect client2 with invalid auth-init method
       // Trying to create the region on client with valid credentials should
       // throw a security exception
       client2
-          .invoke(ClientAuthenticationDUnitTest.class, "createCacheClient",
-              new Object[] { "com.gemstone.none", credentials1, javaProps1,
+          .invoke(() -> ClientAuthenticationDUnitTest.createCacheClient( "com.gemstone.none", credentials1, javaProps1,
                   port1, port2, zeroConns, multiUser, 
-                  new Integer(SecurityTestUtil.AUTHREQ_EXCEPTION) });
+                  new Integer(SecurityTestUtil.AUTHREQ_EXCEPTION) ));
 
       // Now start the servers with invalid authenticator method.
       // Skip this test for a scheme which does not have an authInit in the
       // first place (e.g. SSL) since that will fail with AuthReqEx before
       // authenticator is even invoked.
       if (authInit != null && authInit.length() > 0) {
-        server1.invoke(ClientAuthenticationDUnitTest.class,
-            "createCacheServer", new Object[] { locPort1, locString, port1,
-                "com.gemstone.gemfire.none", extraProps, javaProps });
-        server2.invoke(ClientAuthenticationDUnitTest.class,
-            "createCacheServer", new Object[] { locPort2, locString, port2,
-                "com.gemstone.gemfire.none", extraProps, javaProps });
+        server1.invoke(() -> ClientAuthenticationDUnitTest.createCacheServer( locPort1, locString, port1,
+                "com.gemstone.gemfire.none", extraProps, javaProps ));
+        server2.invoke(() -> ClientAuthenticationDUnitTest.createCacheServer( locPort2, locString, port2,
+                "com.gemstone.gemfire.none", extraProps, javaProps ));
 
         // Trying to create the region on client with valid/invalid credentials
         // should throw a security exception
-        client2.invoke(ClientAuthenticationDUnitTest.class,
-            "createCacheClient", new Object[] { authInit, credentials1,
+        client2.invoke(() -> ClientAuthenticationDUnitTest.createCacheClient( authInit, credentials1,
                 javaProps1, port1, port2, zeroConns, multiUser,
-                new Integer(SecurityTestUtil.AUTHFAIL_EXCEPTION) });
-        client1.invoke(ClientAuthenticationDUnitTest.class,
-            "createCacheClient", new Object[] { authInit, credentials2,
+                new Integer(SecurityTestUtil.AUTHFAIL_EXCEPTION) ));
+        client1.invoke(() -> ClientAuthenticationDUnitTest.createCacheClient( authInit, credentials2,
                 javaProps2, port1, port2, zeroConns, multiUser,
-                new Integer(SecurityTestUtil.AUTHFAIL_EXCEPTION) });
+                new Integer(SecurityTestUtil.AUTHFAIL_EXCEPTION) ));
       }
       else {
         LogWriterUtils.getLogWriter().info(
@@ -855,26 +773,21 @@ public class ClientAuthenticationDUnitTest extends DistributedTestCase {
       // Skip this test for a scheme which does not have an authInit in the
       // first place (e.g. SSL).
       if (authInit != null && authInit.length() > 0) {
-        server1.invoke(ClientAuthenticationDUnitTest.class,
-            "createCacheServer", new Object[] { locPort1, locString, port1,
-                authenticator, extraProps, javaProps });
-        server2.invoke(ClientAuthenticationDUnitTest.class,
-            "createCacheServer", new Object[] { locPort2, locString, port2,
-                authenticator, extraProps, javaProps });
-        client1.invoke(ClientAuthenticationDUnitTest.class,
-            "createCacheClient", new Object[] { null, credentials1, javaProps1,
+        server1.invoke(() -> ClientAuthenticationDUnitTest.createCacheServer( locPort1, locString, port1,
+                authenticator, extraProps, javaProps ));
+        server2.invoke(() -> ClientAuthenticationDUnitTest.createCacheServer( locPort2, locString, port2,
+                authenticator, extraProps, javaProps ));
+        client1.invoke(() -> ClientAuthenticationDUnitTest.createCacheClient( null, credentials1, javaProps1,
                 port1, port2, null, multiUser,
-                new Integer(SecurityTestUtil.AUTHREQ_EXCEPTION) });
-        client2.invoke(ClientAuthenticationDUnitTest.class,
-            "createCacheClient", new Object[] { null, credentials2, javaProps2,
+                new Integer(SecurityTestUtil.AUTHREQ_EXCEPTION) ));
+        client2.invoke(() -> ClientAuthenticationDUnitTest.createCacheClient( null, credentials2, javaProps2,
                 port1, port2, zeroConns, multiUser,
-                new Integer(SecurityTestUtil.AUTHREQ_EXCEPTION) });
+                new Integer(SecurityTestUtil.AUTHREQ_EXCEPTION) ));
 
         // Now also try with invalid credentials on client2
-        client2.invoke(ClientAuthenticationDUnitTest.class,
-            "createCacheClient", new Object[] { null, credentials2, javaProps2,
+        client2.invoke(() -> ClientAuthenticationDUnitTest.createCacheClient( null, credentials2, javaProps2,
                 port1, port2, zeroConns, multiUser,
-                new Integer(SecurityTestUtil.AUTHREQ_EXCEPTION) });
+                new Integer(SecurityTestUtil.AUTHREQ_EXCEPTION) ));
       }
       else {
         LogWriterUtils.getLogWriter().info(
@@ -887,54 +800,42 @@ public class ClientAuthenticationDUnitTest extends DistributedTestCase {
       // If the scheme does not have an authenticator in the first place (e.g.
       // SSL) then skip it since this test is useless.
       if (authenticator != null && authenticator.length() > 0) {
-        server1.invoke(ClientAuthenticationDUnitTest.class,
-            "createCacheServer", new Object[] { locPort1, locString, port1,
-                null, extraProps, javaProps });
-        server2.invoke(ClientAuthenticationDUnitTest.class,
-            "createCacheServer", new Object[] { locPort2, locString, port2,
-                null, extraProps, javaProps });
-        client1.invoke(ClientAuthenticationDUnitTest.class,
-            "createCacheClient", new Object[] { authInit, credentials1,
+        server1.invoke(() -> ClientAuthenticationDUnitTest.createCacheServer( locPort1, locString, port1,
+                null, extraProps, javaProps ));
+        server2.invoke(() -> ClientAuthenticationDUnitTest.createCacheServer( locPort2, locString, port2,
+                null, extraProps, javaProps ));
+        client1.invoke(() -> ClientAuthenticationDUnitTest.createCacheClient( authInit, credentials1,
                 javaProps1, port1, port2, null, multiUser,
-                new Integer(SecurityTestUtil.NO_EXCEPTION) });
-        client2.invoke(ClientAuthenticationDUnitTest.class,
-            "createCacheClient", new Object[] { authInit, credentials2,
+                new Integer(SecurityTestUtil.NO_EXCEPTION) ));
+        client2.invoke(() -> ClientAuthenticationDUnitTest.createCacheClient( authInit, credentials2,
                 javaProps2, port1, port2, zeroConns, multiUser,
-                new Integer(SecurityTestUtil.NO_EXCEPTION) });
+                new Integer(SecurityTestUtil.NO_EXCEPTION) ));
 
         // Register interest on all keys on second client
-        client2.invoke(ClientAuthenticationDUnitTest.class,
-            "registerAllInterest");
+        client2.invoke(() -> ClientAuthenticationDUnitTest.registerAllInterest());
 
         // Perform some put operations from client1
-        client1.invoke(SecurityTestUtil.class, "doPuts",
-            new Object[] { new Integer(4) });
+        client1.invoke(() -> SecurityTestUtil.doPuts( new Integer(4) ));
 
         // Verify that the puts succeeded
-        client2.invoke(SecurityTestUtil.class, "doLocalGets",
-            new Object[] { new Integer(4) });
+        client2.invoke(() -> SecurityTestUtil.doLocalGets( new Integer(4) ));
 
         // Now also try with valid credentials on client2
-        client1.invoke(ClientAuthenticationDUnitTest.class,
-            "createCacheClient", new Object[] { authInit, credentials2,
+        client1.invoke(() -> ClientAuthenticationDUnitTest.createCacheClient( authInit, credentials2,
                 javaProps2, port1, port2, null, multiUser,
-                new Integer(SecurityTestUtil.NO_EXCEPTION) });
-        client2.invoke(ClientAuthenticationDUnitTest.class,
-            "createCacheClient", new Object[] { authInit, credentials1,
+                new Integer(SecurityTestUtil.NO_EXCEPTION) ));
+        client2.invoke(() -> ClientAuthenticationDUnitTest.createCacheClient( authInit, credentials1,
                 javaProps1, port1, port2, zeroConns, multiUser,
-                new Integer(SecurityTestUtil.NO_EXCEPTION) });
+                new Integer(SecurityTestUtil.NO_EXCEPTION) ));
 
         // Register interest on all keys on second client
-        client2.invoke(ClientAuthenticationDUnitTest.class,
-            "registerAllInterest");
+        client2.invoke(() -> ClientAuthenticationDUnitTest.registerAllInterest());
 
         // Perform some put operations from client1
-        client1.invoke(SecurityTestUtil.class, "doNPuts",
-            new Object[] { new Integer(4) });
+        client1.invoke(() -> SecurityTestUtil.doNPuts( new Integer(4) ));
 
         // Verify that the puts succeeded
-        client2.invoke(SecurityTestUtil.class, "doNLocalGets",
-            new Object[] { new Integer(4) });
+        client2.invoke(() -> SecurityTestUtil.doNLocalGets( new Integer(4) ));
       }
       else {
         LogWriterUtils.getLogWriter().info(
@@ -958,10 +859,10 @@ public class ClientAuthenticationDUnitTest extends DistributedTestCase {
   @Override
   protected final void preTearDown() throws Exception {
     // close the clients first
-    client1.invoke(SecurityTestUtil.class, "closeCache");
-    client2.invoke(SecurityTestUtil.class, "closeCache");
+    client1.invoke(() -> SecurityTestUtil.closeCache());
+    client2.invoke(() -> SecurityTestUtil.closeCache());
     // then close the servers
-    server1.invoke(SecurityTestUtil.class, "closeCache");
-    server2.invoke(SecurityTestUtil.class, "closeCache");
+    server1.invoke(() -> SecurityTestUtil.closeCache());
+    server2.invoke(() -> SecurityTestUtil.closeCache());
   }
 }


Mime
View raw message