geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From upthewatersp...@apache.org
Subject [26/63] [abbrv] incubator-geode git commit: Automatically converting calls of vm.invoke to lambdas
Date Fri, 19 Feb 2016 18:37:03 GMT
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/69024aa9/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqPerfDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqPerfDUnitTest.java b/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqPerfDUnitTest.java
index a9747f2..97035f0 100644
--- a/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqPerfDUnitTest.java
+++ b/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqPerfDUnitTest.java
@@ -85,8 +85,7 @@ public class CqPerfDUnitTest extends CacheTestCase {
     
     cqDUnitTest.createServer(server);
     
-    final int port = server.invokeInt(CqQueryDUnitTest.class,
-    "getCacheServerPort");
+    final int port = server.invoke(() -> CqQueryDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server.getHost());
     
     // Create client.
@@ -191,7 +190,7 @@ public class CqPerfDUnitTest extends CacheTestCase {
     VM client = host.getVM(1);
     
     cqDUnitTest.createServer(server);
-    final int port = server.invokeInt(CqQueryDUnitTest.class, "getCacheServerPort");
+    final int port = server.invoke(() -> CqQueryDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server.getHost());
     cqDUnitTest.createClient(client, port, host0);
     
@@ -411,7 +410,7 @@ public class CqPerfDUnitTest extends CacheTestCase {
     VM client = host.getVM(1);
     
     cqDUnitTest.createServer(server);
-    final int port = server.invokeInt(CqQueryDUnitTest.class, "getCacheServerPort");
+    final int port = server.invoke(() -> CqQueryDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server.getHost());
     cqDUnitTest.createClient(client, port, host0);
     
@@ -526,7 +525,7 @@ public class CqPerfDUnitTest extends CacheTestCase {
     VM clients[] = new VM[]{client1, client2, client3};
     
     cqDUnitTest.createServer(server);
-    final int port = server.invokeInt(CqQueryDUnitTest.class, "getCacheServerPort");
+    final int port = server.invoke(() -> CqQueryDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server.getHost());
         
     for (int clientIndex=0; clientIndex < 3; clientIndex++){
@@ -685,7 +684,7 @@ public class CqPerfDUnitTest extends CacheTestCase {
     
     VM clients[] = new VM[]{client1, client2};
     
-    final int port1 = server1.invokeInt(CqQueryDUnitTest.class, "getCacheServerPort");
+    final int port1 = server1.invoke(() -> CqQueryDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server1.getHost());
     // Create client.
     
@@ -726,7 +725,7 @@ public class CqPerfDUnitTest extends CacheTestCase {
     cqDUnitTest.createServer(server2, ports[0]);
     
     
-    final int port2 = server2.invokeInt(CqQueryDUnitTest.class, "getCacheServerPort");
+    final int port2 = server2.invoke(() -> CqQueryDUnitTest.getCacheServerPort());
     System.out.println("### Port on which server1 running : " + port1 + 
         " Server2 running : " + port2);
 
@@ -848,7 +847,7 @@ public class CqPerfDUnitTest extends CacheTestCase {
     
     VM clients[] = new VM[]{client1, client2};
     
-    final int port1 = server1.invokeInt(CqQueryDUnitTest.class, "getCacheServerPort");
+    final int port1 = server1.invoke(() -> CqQueryDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server1.getHost());
     final int[] ports = AvailablePortHelper.getRandomAvailableTCPPorts(1);
     
@@ -896,8 +895,8 @@ public class CqPerfDUnitTest extends CacheTestCase {
     
 //    VM clients[] = new VM[]{client1, client2};
     
-    final int port1 = server1.invokeInt(CqQueryDUnitTest.class, "getCacheServerPort");
-    final int port2 = server2.invokeInt(CqQueryDUnitTest.class, "getCacheServerPort");
+    final int port1 = server1.invoke(() -> CqQueryDUnitTest.getCacheServerPort());
+    final int port2 = server2.invoke(() -> CqQueryDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server1.getHost());
 
     // Create client.

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/69024aa9/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqPerfUsingPoolDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqPerfUsingPoolDUnitTest.java b/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqPerfUsingPoolDUnitTest.java
index 3c7e3b5..e631886 100644
--- a/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqPerfUsingPoolDUnitTest.java
+++ b/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqPerfUsingPoolDUnitTest.java
@@ -85,8 +85,7 @@ public class CqPerfUsingPoolDUnitTest extends CacheTestCase {
     
     cqDUnitTest.createServer(server);
     
-    final int port = server.invokeInt(CqQueryUsingPoolDUnitTest.class,
-    "getCacheServerPort");
+    final int port = server.invoke(() -> CqQueryUsingPoolDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server.getHost());
     
     // Create client.
@@ -191,7 +190,7 @@ public class CqPerfUsingPoolDUnitTest extends CacheTestCase {
     VM client = host.getVM(1);
     
     cqDUnitTest.createServer(server);
-    final int port = server.invokeInt(CqQueryUsingPoolDUnitTest.class, "getCacheServerPort");
+    final int port = server.invoke(() -> CqQueryUsingPoolDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server.getHost());
     // cqDUnitTest.createClient(client, port, host0);
 
@@ -411,7 +410,7 @@ public class CqPerfUsingPoolDUnitTest extends CacheTestCase {
     VM client = host.getVM(1);
     
     cqDUnitTest.createServer(server);
-    final int port = server.invokeInt(CqQueryUsingPoolDUnitTest.class, "getCacheServerPort");
+    final int port = server.invoke(() -> CqQueryUsingPoolDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server.getHost());
     //cqDUnitTest.createClient(client, port, host0);
     
@@ -529,7 +528,7 @@ public class CqPerfUsingPoolDUnitTest extends CacheTestCase {
     VM clients[] = new VM[]{client1, client2, client3};
     
     cqDUnitTest.createServer(server);
-    final int port = server.invokeInt(CqQueryUsingPoolDUnitTest.class, "getCacheServerPort");
+    final int port = server.invoke(() -> CqQueryUsingPoolDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server.getHost());
     String poolName = "testMatchingCQWithMultipleClients";     
     for (int clientIndex=0; clientIndex < 3; clientIndex++){
@@ -692,7 +691,7 @@ public class CqPerfUsingPoolDUnitTest extends CacheTestCase {
     
     VM clients[] = new VM[]{client1, client2};
     
-    final int port1 = server1.invokeInt(CqQueryUsingPoolDUnitTest.class, "getCacheServerPort");
+    final int port1 = server1.invoke(() -> CqQueryUsingPoolDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server1.getHost());
     // Create client.
     
@@ -739,7 +738,7 @@ public class CqPerfUsingPoolDUnitTest extends CacheTestCase {
     cqDUnitTest.createServer(server2, ports[0]);
     
     
-    final int port2 = server2.invokeInt(CqQueryUsingPoolDUnitTest.class, "getCacheServerPort");
+    final int port2 = server2.invoke(() -> CqQueryUsingPoolDUnitTest.getCacheServerPort());
     System.out.println("### Port on which server1 running : " + port1 + 
         " Server2 running : " + port2);
 
@@ -856,8 +855,8 @@ public class CqPerfUsingPoolDUnitTest extends CacheTestCase {
     
 //    VM clients[] = new VM[]{client1, client2};
     
-    final int port1 = server1.invokeInt(CqQueryUsingPoolDUnitTest.class, "getCacheServerPort");
-    final int port2 = server2.invokeInt(CqQueryUsingPoolDUnitTest.class, "getCacheServerPort");
+    final int port1 = server1.invoke(() -> CqQueryUsingPoolDUnitTest.getCacheServerPort());
+    final int port2 = server2.invoke(() -> CqQueryUsingPoolDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server1.getHost());
 
     // Create client.

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/69024aa9/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqQueryDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqQueryDUnitTest.java b/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqQueryDUnitTest.java
index 24187a0..bc0121b 100644
--- a/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqQueryDUnitTest.java
+++ b/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqQueryDUnitTest.java
@@ -1618,7 +1618,7 @@ public class CqQueryDUnitTest extends CacheTestCase {
     createServer(server);
     createServer(server2);
 
-    final int thePort = server.invokeInt(CqQueryDUnitTest.class, "getCacheServerPort");
+    final int thePort = server.invoke(() -> CqQueryDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server.getHost());
 
     // Create client.
@@ -1661,7 +1661,7 @@ public class CqQueryDUnitTest extends CacheTestCase {
     
     /* Init Server and Client */
     createServer(server);
-    final int thePort = server.invokeInt(CqQueryDUnitTest.class, "getCacheServerPort");
+    final int thePort = server.invoke(() -> CqQueryDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server.getHost());
     createClient(client, thePort, host0);
     
@@ -1831,7 +1831,7 @@ public class CqQueryDUnitTest extends CacheTestCase {
     
     /* Init Server and Client */
     createServer(server);
-    final int thePort = server.invokeInt(CqQueryDUnitTest.class, "getCacheServerPort");
+    final int thePort = server.invoke(() -> CqQueryDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server.getHost());
     createClient(client, thePort, host0);
     
@@ -1914,7 +1914,7 @@ public class CqQueryDUnitTest extends CacheTestCase {
     
     /* Init Server and Client */
     createServer(server);
-    final int thePort = server.invokeInt(CqQueryDUnitTest.class, "getCacheServerPort");
+    final int thePort = server.invoke(() -> CqQueryDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server.getHost());
     createClient(client, thePort, host0);
     
@@ -2010,7 +2010,7 @@ public class CqQueryDUnitTest extends CacheTestCase {
     
     /* Init Server and Client */
     createServer(server);
-    final int thePort = server.invokeInt(CqQueryDUnitTest.class, "getCacheServerPort");
+    final int thePort = server.invoke(() -> CqQueryDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server.getHost());
     createClient(client, thePort, host0);
     
@@ -2196,7 +2196,7 @@ public class CqQueryDUnitTest extends CacheTestCase {
     
     /* Init Server and Client */
     createServer(server);
-    final int thePort = server.invokeInt(CqQueryDUnitTest.class, "getCacheServerPort");
+    final int thePort = server.invoke(() -> CqQueryDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server.getHost());
     createClient(client, thePort, host0);
     
@@ -2280,7 +2280,7 @@ public class CqQueryDUnitTest extends CacheTestCase {
     
     /* Create Server and Client */
     createServer(server);
-    final int thePort = server.invokeInt(CqQueryDUnitTest.class, "getCacheServerPort");
+    final int thePort = server.invoke(() -> CqQueryDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server.getHost());
     createClient(client1, thePort, host0);
     createClient(client2, thePort, host0);
@@ -2430,7 +2430,7 @@ public class CqQueryDUnitTest extends CacheTestCase {
     
     createServer(server);
     
-    final int thePort = server.invokeInt(CqQueryDUnitTest.class, "getCacheServerPort");
+    final int thePort = server.invoke(() -> CqQueryDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server.getHost());
     
     // Create client.
@@ -2501,7 +2501,7 @@ public class CqQueryDUnitTest extends CacheTestCase {
     
     createServer(server);
     
-    final int thePort = server.invokeInt(CqQueryDUnitTest.class, "getCacheServerPort");
+    final int thePort = server.invoke(() -> CqQueryDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server.getHost());
     
     // Create client.
@@ -2603,8 +2603,7 @@ public class CqQueryDUnitTest extends CacheTestCase {
     
     createMapValues(server, regions[0], size/2);
 
-    final int thePort = server.invokeInt(CqQueryDUnitTest.class,
-        "getCacheServerPort");
+    final int thePort = server.invoke(() -> CqQueryDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server.getHost());
 
     // Create client.
@@ -2688,7 +2687,7 @@ public class CqQueryDUnitTest extends CacheTestCase {
     
     createServer(server);
     
-    final int thePort = server.invokeInt(CqQueryDUnitTest.class, "getCacheServerPort");
+    final int thePort = server.invoke(() -> CqQueryDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server.getHost());
     
     // Create client.
@@ -2830,7 +2829,7 @@ public class CqQueryDUnitTest extends CacheTestCase {
     
     createServer(server);
     
-    final int thePort = server.invokeInt(CqQueryDUnitTest.class, "getCacheServerPort");
+    final int thePort = server.invoke(() -> CqQueryDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server.getHost());
     
     // Create client.
@@ -2872,7 +2871,7 @@ public class CqQueryDUnitTest extends CacheTestCase {
     
     createServer(server1);
     
-    final int port1 = server1.invokeInt(CqQueryDUnitTest.class, "getCacheServerPort");
+    final int port1 = server1.invoke(() -> CqQueryDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server1.getHost());
     // Create client.
 //    Properties props = new Properties();
@@ -2898,7 +2897,7 @@ public class CqQueryDUnitTest extends CacheTestCase {
     Wait.pause(1 * 1000);
     
     createServer(server2, ports[0]);
-    final int thePort2 = server2.invokeInt(CqQueryDUnitTest.class, "getCacheServerPort");
+    final int thePort2 = server2.invoke(() -> CqQueryDUnitTest.getCacheServerPort());
     System.out.println("### Port on which server1 running : " + port1 + 
         " Server2 running : " + thePort2);
     Wait.pause(3 * 1000);
@@ -2960,16 +2959,16 @@ public class CqQueryDUnitTest extends CacheTestCase {
     
     createServer(server1);
     
-    final int port1 = server1.invokeInt(CqQueryDUnitTest.class, "getCacheServerPort");
+    final int port1 = server1.invoke(() -> CqQueryDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server1.getHost());
     
     final int[] ports = AvailablePortHelper.getRandomAvailableTCPPorts(2);
     
     createServer(server2, ports[0]);
-    final int thePort2 = server2.invokeInt(CqQueryDUnitTest.class, "getCacheServerPort");
+    final int thePort2 = server2.invoke(() -> CqQueryDUnitTest.getCacheServerPort());
     
     createServer(server3, ports[1]);
-    final int port3 = server3.invokeInt(CqQueryDUnitTest.class, "getCacheServerPort");
+    final int port3 = server3.invoke(() -> CqQueryDUnitTest.getCacheServerPort());
     System.out.println("### Port on which server1 running : " + port1 + 
         " server2 running : " + thePort2 + 
         " Server3 running : " + port3);
@@ -3058,10 +3057,10 @@ public class CqQueryDUnitTest extends CacheTestCase {
     createServer(server1);
     createServer(server2);
     
-    final int port1 = server1.invokeInt(CqQueryDUnitTest.class, "getCacheServerPort");
+    final int port1 = server1.invoke(() -> CqQueryDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server1.getHost());
     
-    final int thePort2 = server2.invokeInt(CqQueryDUnitTest.class, "getCacheServerPort");
+    final int thePort2 = server2.invoke(() -> CqQueryDUnitTest.getCacheServerPort());
     
     SerializableRunnable createConnectionPool =
       new CacheSerializableRunnable("Create region") {
@@ -3118,7 +3117,7 @@ public class CqQueryDUnitTest extends CacheTestCase {
     
     createServer(server);
     
-    final int thePort = server.invokeInt(CqQueryDUnitTest.class, "getCacheServerPort");
+    final int thePort = server.invoke(() -> CqQueryDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server.getHost());
     
     // Create client.
@@ -3187,7 +3186,7 @@ public class CqQueryDUnitTest extends CacheTestCase {
     createReplicateRegionWithLocalDestroy(server, new String[]{regions[0]});
     
     
-    final int thePort = server.invokeInt(CqQueryDUnitTest.class, "getCacheServerPort");
+    final int thePort = server.invoke(() -> CqQueryDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server.getHost());
     
     // Create client.
@@ -3222,8 +3221,7 @@ public class CqQueryDUnitTest extends CacheTestCase {
 
     createServer(server);
 
-    final int thePort = server.invokeInt(CqQueryDUnitTest.class,
-        "getCacheServerPort");
+    final int thePort = server.invoke(() -> CqQueryDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server.getHost());
 
     // Create client.
@@ -3306,13 +3304,11 @@ public class CqQueryDUnitTest extends CacheTestCase {
     server1.invoke(createServer);
     server2.invoke(createServer);
     
-    final int port1 = server1.invokeInt(CqQueryDUnitTest.class,
-        "getCacheServerPort");
+    final int port1 = server1.invoke(() -> CqQueryDUnitTest.getCacheServerPort());
 
     final String host0 = NetworkUtils.getServerHostName(server1.getHost());
 
-    final int thePort2 = server2.invokeInt(CqQueryDUnitTest.class,
-    "getCacheServerPort");
+    final int thePort2 = server2.invoke(() -> CqQueryDUnitTest.getCacheServerPort());
 
     // Create client.
     createClient(client, new int[] {port1, thePort2}, host0, "-1");
@@ -3375,7 +3371,7 @@ public class CqQueryDUnitTest extends CacheTestCase {
       
       createServer(server);
       
-      final int thePort = server.invokeInt(CqQueryDUnitTest.class, "getCacheServerPort");
+      final int thePort = server.invoke(() -> CqQueryDUnitTest.getCacheServerPort());
       final String host0 = NetworkUtils.getServerHostName(server.getHost());
       
       // Create client.
@@ -3407,7 +3403,7 @@ public class CqQueryDUnitTest extends CacheTestCase {
       
       createServer(server);
       
-      final int thePort = server.invokeInt(CqQueryDUnitTest.class, "getCacheServerPort");
+      final int thePort = server.invoke(() -> CqQueryDUnitTest.getCacheServerPort());
       final String host0 = NetworkUtils.getServerHostName(server.getHost());
       
       // Create client.
@@ -3459,7 +3455,7 @@ public class CqQueryDUnitTest extends CacheTestCase {
       
       createServer(server);
       
-      final int thePort = server.invokeInt(CqQueryDUnitTest.class, "getCacheServerPort");
+      final int thePort = server.invoke(() -> CqQueryDUnitTest.getCacheServerPort());
       final String host0 = NetworkUtils.getServerHostName(server.getHost());
       
       // Create client.
@@ -3510,8 +3506,7 @@ public class CqQueryDUnitTest extends CacheTestCase {
 
     createServer(server1);
 
-    final int port1 = server1.invokeInt(CqQueryDUnitTest.class,
-        "getCacheServerPort");
+    final int port1 = server1.invoke(() -> CqQueryDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server1.getHost());
 
     final int[] ports = AvailablePortHelper.getRandomAvailableTCPPorts(1);
@@ -3530,8 +3525,7 @@ public class CqQueryDUnitTest extends CacheTestCase {
     waitForCreated(client, "testCQAllServersLeave_11", KEY + 10);
 
     createServer(server2, ports[0]);
-    final int thePort2 = server2.invokeInt(CqQueryDUnitTest.class,
-        "getCacheServerPort");
+    final int thePort2 = server2.invoke(() -> CqQueryDUnitTest.getCacheServerPort());
     Wait.pause(8 * 1000);
 
     // Close server1.
@@ -3558,8 +3552,7 @@ public class CqQueryDUnitTest extends CacheTestCase {
     VM client = host.getVM(2);
 
     createServer(server1);
-    final int port1 = server1.invokeInt(CqQueryDUnitTest.class,
-        "getCacheServerPort");
+    final int port1 = server1.invoke(() -> CqQueryDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server1.getHost());
     final int[] ports = AvailablePortHelper.getRandomAvailableTCPPorts(1);
     
@@ -3577,8 +3570,7 @@ public class CqQueryDUnitTest extends CacheTestCase {
     waitForCreated(client, "testCQAllServersLeave_11", KEY + 10);
 
     createServer(server2, ports[0]);
-    final int thePort2 = server2.invokeInt(CqQueryDUnitTest.class,
-        "getCacheServerPort");
+    final int thePort2 = server2.invoke(() -> CqQueryDUnitTest.getCacheServerPort());
     Wait.pause(10 * 1000);
 
     // Close server1 and pause so server has chance to close
@@ -3605,8 +3597,7 @@ public class CqQueryDUnitTest extends CacheTestCase {
     VM client = host.getVM(2);
 
     createServer(server1);
-    final int port1 = server1.invokeInt(CqQueryDUnitTest.class,
-        "getCacheServerPort");
+    final int port1 = server1.invoke(() -> CqQueryDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server1.getHost());
 
     final int[] ports = AvailablePortHelper.getRandomAvailableTCPPorts(1);
@@ -3626,8 +3617,7 @@ public class CqQueryDUnitTest extends CacheTestCase {
     
     //start server 2
     createServer(server2, ports[0]);
-    final int thePort2 = server2.invokeInt(CqQueryDUnitTest.class,
-        "getCacheServerPort");
+    final int thePort2 = server2.invoke(() -> CqQueryDUnitTest.getCacheServerPort());
     Wait.pause(8 * 1000);
 
     // Close server1.
@@ -3667,8 +3657,7 @@ public class CqQueryDUnitTest extends CacheTestCase {
     VM client = host.getVM(2);
 
     createServer(server1);
-    final int port1 = server1.invokeInt(CqQueryDUnitTest.class,
-        "getCacheServerPort");
+    final int port1 = server1.invoke(() -> CqQueryDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server1.getHost());
 
     final int[] ports = AvailablePortHelper.getRandomAvailableTCPPorts(1);
@@ -3685,8 +3674,7 @@ public class CqQueryDUnitTest extends CacheTestCase {
     waitForCreated(client, "testCQAllServersLeave_11", KEY + 10);
 
     createServer(server2, ports[0]);
-    final int thePort2 = server2.invokeInt(CqQueryDUnitTest.class,
-        "getCacheServerPort");
+    final int thePort2 = server2.invoke(() -> CqQueryDUnitTest.getCacheServerPort());
     Wait.pause(8 * 1000);
 
     // Close server1 and give time for server1 to actually shutdown
@@ -3716,14 +3704,12 @@ public class CqQueryDUnitTest extends CacheTestCase {
 
     createServer(server1);
 
-    final int port1 = server1.invokeInt(CqQueryDUnitTest.class,
-        "getCacheServerPort");
+    final int port1 = server1.invoke(() -> CqQueryDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server1.getHost());
     final int[] ports = AvailablePortHelper.getRandomAvailableTCPPorts(1);
 
     createServer(server2, ports[0]);
-    final int thePort2 = server2.invokeInt(CqQueryDUnitTest.class,
-        "getCacheServerPort");
+    final int thePort2 = server2.invoke(() -> CqQueryDUnitTest.getCacheServerPort());
     Wait.pause(8 * 1000);
 
     // Create client
@@ -3770,7 +3756,7 @@ public void testCqCloseAndExecuteWithInitialResults() throws Exception {
    
    createServer(server);
    
-   final int thePort = server.invokeInt(CqQueryDUnitTest.class, "getCacheServerPort");
+   final int thePort = server.invoke(() -> CqQueryDUnitTest.getCacheServerPort());
    final String host0 = NetworkUtils.getServerHostName(server.getHost());
    
    // Create client.
@@ -3799,7 +3785,7 @@ public void testCQEventsWithNotEqualsUndefined() throws Exception {
   
   createServer(server);
   
-  final int thePort = server.invokeInt(CqQueryDUnitTest.class, "getCacheServerPort");
+  final int thePort = server.invoke(() -> CqQueryDUnitTest.getCacheServerPort());
   final String host0 = NetworkUtils.getServerHostName(server.getHost());
   
   // Create client.

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/69024aa9/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqQueryOptimizedExecuteDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqQueryOptimizedExecuteDUnitTest.java b/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqQueryOptimizedExecuteDUnitTest.java
index 6be233a..a3ccf36 100644
--- a/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqQueryOptimizedExecuteDUnitTest.java
+++ b/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqQueryOptimizedExecuteDUnitTest.java
@@ -72,8 +72,7 @@ public class CqQueryOptimizedExecuteDUnitTest extends CqQueryDUnitTest{
     // Create values.
     createValues(server, regions[0], numOfEntries);
 
-    final int thePort = server.invokeInt(CqQueryDUnitTest.class,
-        "getCacheServerPort");
+    final int thePort = server.invoke(() -> CqQueryDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server.getHost());
 
     // Create client.
@@ -171,8 +170,7 @@ public class CqQueryOptimizedExecuteDUnitTest extends CqQueryDUnitTest{
     // Create values.
     createValues(server, regions[0], numOfEntries);
 
-    final int thePort = server.invokeInt(CqQueryDUnitTest.class,
-        "getCacheServerPort");
+    final int thePort = server.invoke(() -> CqQueryDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server.getHost());
 
     // Create client.
@@ -266,14 +264,12 @@ public class CqQueryOptimizedExecuteDUnitTest extends CqQueryDUnitTest{
 
     createServer(server1);
 
-    final int port1 = server1.invokeInt(CqQueryDUnitTest.class,
-        "getCacheServerPort");
+    final int port1 = server1.invoke(() -> CqQueryDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server1.getHost());
     final int[] ports = AvailablePortHelper.getRandomAvailableTCPPorts(1);
 
     createServer(server2, ports[0]);
-    final int thePort2 = server2.invokeInt(CqQueryDUnitTest.class,
-        "getCacheServerPort");
+    final int thePort2 = server2.invoke(() -> CqQueryDUnitTest.getCacheServerPort());
     Wait.pause(8 * 1000);
 
     // Create client

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/69024aa9/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqQueryUsingPoolDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqQueryUsingPoolDUnitTest.java b/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqQueryUsingPoolDUnitTest.java
index 2f317f2..680112b 100644
--- a/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqQueryUsingPoolDUnitTest.java
+++ b/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqQueryUsingPoolDUnitTest.java
@@ -1345,7 +1345,7 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
     
     /* Init Server and Client */
     createServer(server);
-    final int thePort = server.invokeInt(CqQueryUsingPoolDUnitTest.class, "getCacheServerPort");
+    final int thePort = server.invoke(() -> CqQueryUsingPoolDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server.getHost());
     
     String poolName = "testInterestListAndCQs";
@@ -1537,7 +1537,7 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
     
     /* Init Server and Client */
     createServer(server);
-    final int thePort = server.invokeInt(CqQueryUsingPoolDUnitTest.class, "getCacheServerPort");
+    final int thePort = server.invoke(() -> CqQueryUsingPoolDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server.getHost());
     
     String poolName = "testCQStopExecute";
@@ -1624,7 +1624,7 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
     
     /* Init Server and Client */
     createServer(server);
-    final int thePort = server.invokeInt(CqQueryUsingPoolDUnitTest.class, "getCacheServerPort");
+    final int thePort = server.invoke(() -> CqQueryUsingPoolDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server.getHost());
     
     String poolName = "testCQAttributesMutator";
@@ -1722,7 +1722,7 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
     
     /* Init Server and Client */
     createServer(server);
-    final int thePort = server.invokeInt(CqQueryUsingPoolDUnitTest.class, "getCacheServerPort");
+    final int thePort = server.invoke(() -> CqQueryUsingPoolDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server.getHost());
     
     String poolName = "testCQCreateClose";
@@ -1891,7 +1891,7 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
     
     /* Init Server and Client */
     createServer(server);
-    final int thePort = server.invokeInt(CqQueryUsingPoolDUnitTest.class, "getCacheServerPort");
+    final int thePort = server.invoke(() -> CqQueryUsingPoolDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server.getHost());
     
     String poolName = "testRegionDestroy";
@@ -1996,7 +1996,7 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
     
     /* Create Server and Client */
     createServer(server);
-    final int thePort = server.invokeInt(CqQueryUsingPoolDUnitTest.class, "getCacheServerPort");
+    final int thePort = server.invoke(() -> CqQueryUsingPoolDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server.getHost());
     
     String poolName1 = "testCQWithMultipleClients1";
@@ -2149,7 +2149,7 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
     
     createServer(server);
     
-    final int thePort = server.invokeInt(CqQueryUsingPoolDUnitTest.class, "getCacheServerPort");
+    final int thePort = server.invoke(() -> CqQueryUsingPoolDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server.getHost());
     
     String poolName = "testCQResultSet";
@@ -2223,7 +2223,7 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
     
     createServer(server);
     
-    final int thePort = server.invokeInt(CqQueryUsingPoolDUnitTest.class, "getCacheServerPort");
+    final int thePort = server.invoke(() -> CqQueryUsingPoolDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server.getHost());
 
     String poolName = "testCQEvents";
@@ -2328,7 +2328,7 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
     
     createServer(server);
     
-    final int thePort = server.invokeInt(CqQueryUsingPoolDUnitTest.class, "getCacheServerPort");
+    final int thePort = server.invoke(() -> CqQueryUsingPoolDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server.getHost());
 
     String poolName = "testCQEvents";
@@ -2430,7 +2430,7 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
     
     createServer(server);
     
-    final int thePort = server.invokeInt(CqQueryUsingPoolDUnitTest.class, "getCacheServerPort");
+    final int thePort = server.invoke(() -> CqQueryUsingPoolDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server.getHost());
 
     String poolName = "testEnableDisableCQ";
@@ -2571,7 +2571,7 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
     
     createServer(server);
     
-    final int thePort = server.invokeInt(CqQueryUsingPoolDUnitTest.class, "getCacheServerPort");
+    final int thePort = server.invoke(() -> CqQueryUsingPoolDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server.getHost());
     
     String poolName = "testQuery";
@@ -2616,7 +2616,7 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
     
     createServer(server1);
     
-    final int port1 = server1.invokeInt(CqQueryUsingPoolDUnitTest.class, "getCacheServerPort");
+    final int port1 = server1.invoke(() -> CqQueryUsingPoolDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server1.getHost());
     // Create client.
 //    Properties props = new Properties();
@@ -2645,7 +2645,7 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
     Wait.pause(1 * 1000);
     
     createServer(server2, ports[0]);
-    final int thePort2 = server2.invokeInt(CqQueryUsingPoolDUnitTest.class, "getCacheServerPort");
+    final int thePort2 = server2.invoke(() -> CqQueryUsingPoolDUnitTest.getCacheServerPort());
     System.out.println("### Port on which server1 running : " + port1 + 
         " Server2 running : " + thePort2);
     Wait.pause(3 * 1000);
@@ -2710,16 +2710,16 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
     
     createServer(server1);
     
-    final int port1 = server1.invokeInt(CqQueryUsingPoolDUnitTest.class, "getCacheServerPort");
+    final int port1 = server1.invoke(() -> CqQueryUsingPoolDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server1.getHost());
     
     final int[] ports = AvailablePortHelper.getRandomAvailableTCPPorts(2);
     
     createServer(server2, ports[0]);
-    final int thePort2 = server2.invokeInt(CqQueryUsingPoolDUnitTest.class, "getCacheServerPort");
+    final int thePort2 = server2.invoke(() -> CqQueryUsingPoolDUnitTest.getCacheServerPort());
     
     createServer(server3, ports[1]);
-    final int port3 = server3.invokeInt(CqQueryUsingPoolDUnitTest.class, "getCacheServerPort");
+    final int port3 = server3.invoke(() -> CqQueryUsingPoolDUnitTest.getCacheServerPort());
     System.out.println("### Port on which server1 running : " + port1 + 
         " server2 running : " + thePort2 + 
         " Server3 running : " + port3);
@@ -2810,7 +2810,7 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
     
     createServer(server1);
     
-    final int port1 = server1.invokeInt(CqQueryUsingPoolDUnitTest.class, "getCacheServerPort");
+    final int port1 = server1.invoke(() -> CqQueryUsingPoolDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server1.getHost());
     
     final int[] ports = AvailablePortHelper.getRandomAvailableTCPPorts(1);
@@ -2942,10 +2942,10 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
     createServer(server1);
     createServer(server2);
     
-    final int port1 = server1.invokeInt(CqQueryUsingPoolDUnitTest.class, "getCacheServerPort");
+    final int port1 = server1.invoke(() -> CqQueryUsingPoolDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server1.getHost());
     
-    final int thePort2 = server2.invokeInt(CqQueryUsingPoolDUnitTest.class, "getCacheServerPort");
+    final int thePort2 = server2.invoke(() -> CqQueryUsingPoolDUnitTest.getCacheServerPort());
     
     SerializableRunnable createConnectionPool =
       new CacheSerializableRunnable("Create region") {
@@ -3002,7 +3002,7 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
     
     createServer(server);
     
-    final int thePort = server.invokeInt(CqQueryUsingPoolDUnitTest.class, "getCacheServerPort");
+    final int thePort = server.invoke(() -> CqQueryUsingPoolDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server.getHost());
     
     // Create client.
@@ -3076,8 +3076,7 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
 
     createServer(server);
 
-    final int thePort = server.invokeInt(CqQueryUsingPoolDUnitTest.class,
-        "getCacheServerPort");
+    final int thePort = server.invoke(() -> CqQueryUsingPoolDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server.getHost());
 
     String poolName = "testQueryWithNULLInWhereClause";
@@ -3164,13 +3163,11 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
     server1.invoke(createServer);
     server2.invoke(createServer);
     
-    final int port1 = server1.invokeInt(CqQueryUsingPoolDUnitTest.class,
-        "getCacheServerPort");
+    final int port1 = server1.invoke(() -> CqQueryUsingPoolDUnitTest.getCacheServerPort());
 
     final String host0 = NetworkUtils.getServerHostName(server1.getHost());
 
-    final int thePort2 = server2.invokeInt(CqQueryUsingPoolDUnitTest.class,
-    "getCacheServerPort");
+    final int thePort2 = server2.invoke(() -> CqQueryUsingPoolDUnitTest.getCacheServerPort());
 
     String poolName = "testForSupportedRegionAttributes";
     createPool(client, poolName, new String[] {host0, host0}, new int[] {port1, thePort2});

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/69024aa9/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqResultSetUsingPoolDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqResultSetUsingPoolDUnitTest.java b/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqResultSetUsingPoolDUnitTest.java
index 7104947..35cef9d 100644
--- a/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqResultSetUsingPoolDUnitTest.java
+++ b/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqResultSetUsingPoolDUnitTest.java
@@ -159,8 +159,7 @@ public class CqResultSetUsingPoolDUnitTest extends CacheTestCase {
 
     cqDUnitTest.createServer(server);
 
-    final int port = server.invokeInt(CqQueryUsingPoolDUnitTest.class,
-        "getCacheServerPort");
+    final int port = server.invoke(() -> CqQueryUsingPoolDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server.getHost());
 
     String poolName = "testCqResults";
@@ -214,8 +213,7 @@ public class CqResultSetUsingPoolDUnitTest extends CacheTestCase {
 
     cqDUnitTest.createServer(server);
 
-    final int port = server.invokeInt(CqQueryUsingPoolDUnitTest.class,
-        "getCacheServerPort");
+    final int port = server.invoke(() -> CqQueryUsingPoolDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server.getHost());
 
     String poolName = "testCqResults";
@@ -259,8 +257,7 @@ public class CqResultSetUsingPoolDUnitTest extends CacheTestCase {
 
     cqDUnitTest.createServer(server);
 
-    final int port = server.invokeInt(CqQueryUsingPoolDUnitTest.class,
-        "getCacheServerPort");
+    final int port = server.invoke(() -> CqQueryUsingPoolDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server.getHost());
 
     String poolName = "testCqResults";
@@ -318,8 +315,7 @@ public class CqResultSetUsingPoolDUnitTest extends CacheTestCase {
     cqDUnitTest.createServerWithPR(server1, 0, false, 0);
     cqDUnitTest.createServerWithPR(server2, 0, false, 0);
     
-    final int port = server1.invokeInt(CqQueryUsingPoolDUnitTest.class,
-        "getCacheServerPort");
+    final int port = server1.invoke(() -> CqQueryUsingPoolDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server1.getHost());
 
     String poolName = "testCqResults";
@@ -375,8 +371,7 @@ public class CqResultSetUsingPoolDUnitTest extends CacheTestCase {
     cqDUnitTest.createServerWithPR(server1, 0, false, 0);
     cqDUnitTest.createServerWithPR(server2, 0, false, 0);
 
-    final int port = server1.invokeInt(CqQueryUsingPoolDUnitTest.class,
-        "getCacheServerPort");
+    final int port = server1.invoke(() -> CqQueryUsingPoolDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server1.getHost());
 
     String poolName = "testCqResults";
@@ -424,8 +419,7 @@ public class CqResultSetUsingPoolDUnitTest extends CacheTestCase {
     cqDUnitTest.createServerWithPR(server1, 0, false, 0);
     cqDUnitTest.createServerWithPR(server2, 0, false, 0);
 
-    final int port = server1.invokeInt(CqQueryUsingPoolDUnitTest.class,
-        "getCacheServerPort");
+    final int port = server1.invoke(() -> CqQueryUsingPoolDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server1.getHost());
 
     String poolName = "testCqResults";
@@ -493,8 +487,7 @@ public class CqResultSetUsingPoolDUnitTest extends CacheTestCase {
 
     cqDUnitTest.createServer(server);
 
-    final int port = server.invokeInt(CqQueryUsingPoolDUnitTest.class,
-        "getCacheServerPort");
+    final int port = server.invoke(() -> CqQueryUsingPoolDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server.getHost());
 
     String poolName = "testCqResults";
@@ -617,8 +610,7 @@ public class CqResultSetUsingPoolDUnitTest extends CacheTestCase {
 
     cqDUnitTest.createServer(server);
 
-    final int port = server.invokeInt(CqQueryUsingPoolDUnitTest.class,
-        "getCacheServerPort");
+    final int port = server.invoke(() -> CqQueryUsingPoolDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server.getHost());
 
     String poolName = "testCqResults";
@@ -746,8 +738,7 @@ public class CqResultSetUsingPoolDUnitTest extends CacheTestCase {
     cqDUnitTest.createServerWithPR(server1, 0, false, 0);
     cqDUnitTest.createServerWithPR(server2, 0, false, 0);
     
-    final int port = server1.invokeInt(CqQueryUsingPoolDUnitTest.class,
-        "getCacheServerPort");
+    final int port = server1.invoke(() -> CqQueryUsingPoolDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server1.getHost());
 
     String poolName = "testCqResults";
@@ -859,8 +850,7 @@ public class CqResultSetUsingPoolDUnitTest extends CacheTestCase {
     cqDUnitTest.createServerWithPR(server1, 0, false, 0);
     cqDUnitTest.createServerWithPR(server2, 0, false, 0);
     
-    final int port = server1.invokeInt(CqQueryUsingPoolDUnitTest.class,
-        "getCacheServerPort");
+    final int port = server1.invoke(() -> CqQueryUsingPoolDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server1.getHost());
 
     String poolName = "testCqResults";
@@ -977,7 +967,7 @@ public class CqResultSetUsingPoolDUnitTest extends CacheTestCase {
     
     cqDUnitTest.createServer(server1);
     
-    final int port1 = server1.invokeInt(CqQueryUsingPoolDUnitTest.class, "getCacheServerPort");
+    final int port1 = server1.invoke(() -> CqQueryUsingPoolDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server1.getHost());
     final int[] ports = AvailablePortHelper.getRandomAvailableTCPPorts(1);
     
@@ -1080,7 +1070,7 @@ public class CqResultSetUsingPoolDUnitTest extends CacheTestCase {
     });
     
     cqDUnitTest.createServer(server2, ports[0]);
-    final int thePort2 = server2.invokeInt(CqQueryUsingPoolDUnitTest.class, "getCacheServerPort");
+    final int thePort2 = server2.invoke(() -> CqQueryUsingPoolDUnitTest.getCacheServerPort());
     System.out.println("### Port on which server1 running : " + port1 + 
         " Server2 running : " + thePort2);
     Wait.pause(3 * 1000);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/69024aa9/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqResultSetUsingPoolOptimizedExecuteDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqResultSetUsingPoolOptimizedExecuteDUnitTest.java b/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqResultSetUsingPoolOptimizedExecuteDUnitTest.java
index facb3d9..2363d2d 100644
--- a/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqResultSetUsingPoolOptimizedExecuteDUnitTest.java
+++ b/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqResultSetUsingPoolOptimizedExecuteDUnitTest.java
@@ -79,7 +79,7 @@ public class CqResultSetUsingPoolOptimizedExecuteDUnitTest extends CqResultSetUs
     
     cqDUnitTest.createServer(server1);
     
-    final int port1 = server1.invokeInt(CqQueryUsingPoolDUnitTest.class, "getCacheServerPort");
+    final int port1 = server1.invoke(() -> CqQueryUsingPoolDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server1.getHost());
     final int[] ports = AvailablePortHelper.getRandomAvailableTCPPorts(1);
     
@@ -182,7 +182,7 @@ public class CqResultSetUsingPoolOptimizedExecuteDUnitTest extends CqResultSetUs
     });
     
     cqDUnitTest.createServer(server2, ports[0]);
-    final int thePort2 = server2.invokeInt(CqQueryUsingPoolDUnitTest.class, "getCacheServerPort");
+    final int thePort2 = server2.invoke(() -> CqQueryUsingPoolDUnitTest.getCacheServerPort());
     System.out.println("### Port on which server1 running : " + port1 + 
         " Server2 running : " + thePort2);
     Wait.pause(3 * 1000);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/69024aa9/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqStatsDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqStatsDUnitTest.java b/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqStatsDUnitTest.java
index a006f46..6afdaec 100644
--- a/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqStatsDUnitTest.java
+++ b/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqStatsDUnitTest.java
@@ -248,7 +248,7 @@ public class CqStatsDUnitTest extends CacheTestCase {
     
     /* Init Server and Client */
     cqDUnitTest.createServer(server);
-    final int port = server.invokeInt(CqQueryDUnitTest.class, "getCacheServerPort");
+    final int port = server.invoke(() -> CqQueryDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server.getHost());
     cqDUnitTest.createClient(client, port, host0);
     
@@ -339,7 +339,7 @@ public class CqStatsDUnitTest extends CacheTestCase {
     
     /* Init Server and Client */
     cqDUnitTest.createServer(server);
-    final int port = server.invokeInt(CqQueryDUnitTest.class, "getCacheServerPort");
+    final int port = server.invoke(() -> CqQueryDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server.getHost());
     cqDUnitTest.createClient(client1, port, host0);
     cqDUnitTest.createClient(client2, port, host0);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/69024aa9/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqStatsUsingPoolDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqStatsUsingPoolDUnitTest.java b/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqStatsUsingPoolDUnitTest.java
index 869ea81..04e9b42 100644
--- a/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqStatsUsingPoolDUnitTest.java
+++ b/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqStatsUsingPoolDUnitTest.java
@@ -248,7 +248,7 @@ public class CqStatsUsingPoolDUnitTest extends CacheTestCase {
     
     /* Init Server and Client */
     cqDUnitTest.createServer(server);
-    final int port = server.invokeInt(CqQueryUsingPoolDUnitTest.class, "getCacheServerPort");
+    final int port = server.invoke(() -> CqQueryUsingPoolDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server.getHost());
     
     String poolName = "testCQStatistics";
@@ -343,7 +343,7 @@ public class CqStatsUsingPoolDUnitTest extends CacheTestCase {
     
     /* Init Server and Client */
     cqDUnitTest.createServer(server);
-    final int port = server.invokeInt(CqQueryUsingPoolDUnitTest.class, "getCacheServerPort");
+    final int port = server.invoke(() -> CqQueryUsingPoolDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server.getHost());
     
     String poolName1 = "testCQServiceStatistics1";

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/69024aa9/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/PartitionedRegionCqQueryDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/PartitionedRegionCqQueryDUnitTest.java b/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/PartitionedRegionCqQueryDUnitTest.java
index c9aa564..ca506fa 100644
--- a/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/PartitionedRegionCqQueryDUnitTest.java
+++ b/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/PartitionedRegionCqQueryDUnitTest.java
@@ -128,7 +128,7 @@ public class PartitionedRegionCqQueryDUnitTest extends CacheTestCase {
     
     // create client 
     
-    final int port = server1.invokeInt(PartitionedRegionCqQueryDUnitTest.class, "getCacheServerPort");
+    final int port = server1.invoke(() -> PartitionedRegionCqQueryDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server1.getHost());
     
     createClient(client, port, host0);
@@ -158,8 +158,8 @@ public class PartitionedRegionCqQueryDUnitTest extends CacheTestCase {
         /* totalEvents: */ size);
     
     
-    int cc1 = server1.invokeInt(PartitionedRegionCqQueryDUnitTest.class, "getCqCountFromRegionProfile");
-    int cc2 = server2.invokeInt(PartitionedRegionCqQueryDUnitTest.class, "getCqCountFromRegionProfile");
+    int cc1 = server1.invoke(() -> PartitionedRegionCqQueryDUnitTest.getCqCountFromRegionProfile());
+    int cc2 = server2.invoke(() -> PartitionedRegionCqQueryDUnitTest.getCqCountFromRegionProfile());
     assertEquals("Should have one", 1, cc1);
     assertEquals("Should have one", 1, cc2);
     
@@ -167,8 +167,8 @@ public class PartitionedRegionCqQueryDUnitTest extends CacheTestCase {
     
     cqHelper.closeClient(client);
     Wait.pause(10 * 1000);
-    //cc1 = server1.invokeInt(PartitionedRegionCqQueryDUnitTest.class, "getCqCountFromRegionProfile");
-    cc2 = server2.invokeInt(PartitionedRegionCqQueryDUnitTest.class, "getCqCountFromRegionProfile");
+    //cc1 = server1.invoke(() -> PartitionedRegionCqQueryDUnitTest.getCqCountFromRegionProfile());
+    cc2 = server2.invoke(() -> PartitionedRegionCqQueryDUnitTest.getCqCountFromRegionProfile());
     
     //assertEquals("Should have one", 0, cc1);
     assertEquals("Should have one", 0, cc2);
@@ -190,7 +190,7 @@ public class PartitionedRegionCqQueryDUnitTest extends CacheTestCase {
     
     // create client 
     
-    final int port = server1.invokeInt(PartitionedRegionCqQueryDUnitTest.class, "getCacheServerPort");
+    final int port = server1.invoke(() -> PartitionedRegionCqQueryDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server1.getHost());
     
     createClient(client, port, host0);
@@ -303,7 +303,7 @@ public class PartitionedRegionCqQueryDUnitTest extends CacheTestCase {
     
     // create client 
     
-    final int port = server1.invokeInt(PartitionedRegionCqQueryDUnitTest.class, "getCacheServerPort");
+    final int port = server1.invoke(() -> PartitionedRegionCqQueryDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server1.getHost());
     
     createClient(client, port, host0);
@@ -394,7 +394,7 @@ public class PartitionedRegionCqQueryDUnitTest extends CacheTestCase {
     
     // creating an accessor vm with Bridge Server installed.
     createServer(server1);
-    final int port = server1.invokeInt(PartitionedRegionCqQueryDUnitTest.class, "getCacheServerPort");
+    final int port = server1.invoke(() -> PartitionedRegionCqQueryDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server1.getHost());
     
     createClient(client, port, host0);
@@ -492,7 +492,7 @@ public class PartitionedRegionCqQueryDUnitTest extends CacheTestCase {
     
     // create client 
     
-    final int port = server2.invokeInt(PartitionedRegionCqQueryDUnitTest.class, "getCacheServerPort");
+    final int port = server2.invoke(() -> PartitionedRegionCqQueryDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server2.getHost());
     
     createClient(client, port, host0);
@@ -587,7 +587,7 @@ public class PartitionedRegionCqQueryDUnitTest extends CacheTestCase {
     createServer(server2);
     
     
-    final int port = server1.invokeInt(PartitionedRegionCqQueryDUnitTest.class, "getCacheServerPort");
+    final int port = server1.invoke(() -> PartitionedRegionCqQueryDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server1.getHost());
     
     createClient(client, port, host0);
@@ -683,7 +683,7 @@ public class PartitionedRegionCqQueryDUnitTest extends CacheTestCase {
     createServer(server2);
     
     
-    final int port = server1.invokeInt(PartitionedRegionCqQueryDUnitTest.class, "getCacheServerPort");
+    final int port = server1.invoke(() -> PartitionedRegionCqQueryDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server1.getHost());
     
     createClient(client, port, host0);
@@ -779,7 +779,7 @@ public class PartitionedRegionCqQueryDUnitTest extends CacheTestCase {
     createServer(server2, false , 1);
     
     
-    final int port = server1.invokeInt(PartitionedRegionCqQueryDUnitTest.class, "getCacheServerPort");
+    final int port = server1.invoke(() -> PartitionedRegionCqQueryDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server1.getHost());
     
     createClient(client, port, host0);
@@ -881,7 +881,7 @@ public class PartitionedRegionCqQueryDUnitTest extends CacheTestCase {
     // Wait for server to initialize.
     Wait.pause(2000);
     
-    final int port = server1.invokeInt(PartitionedRegionCqQueryDUnitTest.class, "getCacheServerPort");
+    final int port = server1.invoke(() -> PartitionedRegionCqQueryDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server1.getHost());
     
     createClient(client, port, host0);
@@ -1022,7 +1022,7 @@ public class PartitionedRegionCqQueryDUnitTest extends CacheTestCase {
     createServer(server2, false , 1);
     
     
-    final int port = server1.invokeInt(PartitionedRegionCqQueryDUnitTest.class, "getCacheServerPort");
+    final int port = server1.invoke(() -> PartitionedRegionCqQueryDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server1.getHost());
     
     createClient(client, port, host0);
@@ -1240,7 +1240,7 @@ public class PartitionedRegionCqQueryDUnitTest extends CacheTestCase {
     createServer(server1);
     createServer(server2);
     
-    final int port = server1.invokeInt(PartitionedRegionCqQueryDUnitTest.class, "getCacheServerPort");
+    final int port = server1.invoke(() -> PartitionedRegionCqQueryDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server1.getHost());
     
     // Initialize Client.
@@ -1373,7 +1373,7 @@ public class PartitionedRegionCqQueryDUnitTest extends CacheTestCase {
     
     createServerWithoutRootRegion(server, 0, false, 0);
     
-    final int port = server.invokeInt(PartitionedRegionCqQueryDUnitTest.class, "getCacheServerPort");
+    final int port = server.invoke(() -> PartitionedRegionCqQueryDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server.getHost());
     
     // Initialize Client.

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/69024aa9/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/PartitionedRegionCqQueryOptimizedExecuteDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/PartitionedRegionCqQueryOptimizedExecuteDUnitTest.java b/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/PartitionedRegionCqQueryOptimizedExecuteDUnitTest.java
index 659bf12..7989bc0 100644
--- a/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/PartitionedRegionCqQueryOptimizedExecuteDUnitTest.java
+++ b/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/PartitionedRegionCqQueryOptimizedExecuteDUnitTest.java
@@ -66,8 +66,7 @@ public class PartitionedRegionCqQueryOptimizedExecuteDUnitTest extends Partition
     // Create values.
     createValues(server, regions[0], numOfEntries);
 
-    final int thePort = server.invokeInt(PartitionedRegionCqQueryOptimizedExecuteDUnitTest.class,
-        "getCacheServerPort");
+    final int thePort = server.invoke(() -> PartitionedRegionCqQueryOptimizedExecuteDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server.getHost());
 
     // Create client.
@@ -164,8 +163,7 @@ public class PartitionedRegionCqQueryOptimizedExecuteDUnitTest extends Partition
     // Create values.
     createValues(server, regions[0], numOfEntries);
 
-    final int thePort = server.invokeInt(PartitionedRegionCqQueryDUnitTest.class,
-        "getCacheServerPort");
+    final int thePort = server.invoke(() -> PartitionedRegionCqQueryDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server.getHost());
 
     // Create client.

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/69024aa9/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/PrCqUsingPoolDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/PrCqUsingPoolDUnitTest.java b/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/PrCqUsingPoolDUnitTest.java
index 273380d..a443641 100644
--- a/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/PrCqUsingPoolDUnitTest.java
+++ b/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/PrCqUsingPoolDUnitTest.java
@@ -120,7 +120,7 @@ public class PrCqUsingPoolDUnitTest extends CacheTestCase {
     
     // create client 
     
-    final int port = server1.invokeInt(PrCqUsingPoolDUnitTest.class, "getCacheServerPort");
+    final int port = server1.invoke(() -> PrCqUsingPoolDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server1.getHost());
     
     //createClient(client, port, host0);
@@ -235,7 +235,7 @@ public class PrCqUsingPoolDUnitTest extends CacheTestCase {
     
     // create client 
     
-    final int port = server1.invokeInt(PrCqUsingPoolDUnitTest.class, "getCacheServerPort");
+    final int port = server1.invoke(() -> PrCqUsingPoolDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server1.getHost());
     
     String poolName = "testPartitionedCqOnAccessorBridgeServer";
@@ -329,7 +329,7 @@ public class PrCqUsingPoolDUnitTest extends CacheTestCase {
     
     // creating an accessor vm with Bridge Server installed.
     createServer(server1);
-    final int port = server1.invokeInt(PrCqUsingPoolDUnitTest.class, "getCacheServerPort");
+    final int port = server1.invoke(() -> PrCqUsingPoolDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server1.getHost());
     
     String poolName = "testPartitionedCqOnSingleBridgeServer";
@@ -429,7 +429,7 @@ public class PrCqUsingPoolDUnitTest extends CacheTestCase {
     
     // create client 
     
-    final int port = server2.invokeInt(PrCqUsingPoolDUnitTest.class, "getCacheServerPort");
+    final int port = server2.invoke(() -> PrCqUsingPoolDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server2.getHost());
     
     String poolName = "testPRCqOnSingleBridgeServerUpdatesOriginatingAtAccessor";
@@ -527,7 +527,7 @@ public class PrCqUsingPoolDUnitTest extends CacheTestCase {
     createServer(server2);
     
     
-    final int port = server1.invokeInt(PrCqUsingPoolDUnitTest.class, "getCacheServerPort");
+    final int port = server1.invoke(() -> PrCqUsingPoolDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server1.getHost());
 
     String poolName = "testPRCqWithInvalidatesOnBridgeServer";
@@ -627,7 +627,7 @@ public class PrCqUsingPoolDUnitTest extends CacheTestCase {
     createServer(server2);
     
     
-    final int port = server1.invokeInt(PrCqUsingPoolDUnitTest.class, "getCacheServerPort");
+    final int port = server1.invoke(() -> PrCqUsingPoolDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server1.getHost());
     
     String poolName = "testPRCqWithInvalidatesOnAccessorBridgeServer";
@@ -728,7 +728,7 @@ public class PrCqUsingPoolDUnitTest extends CacheTestCase {
     createServer(server2, false , 1);
     
     
-    final int port = server1.invokeInt(PrCqUsingPoolDUnitTest.class, "getCacheServerPort");
+    final int port = server1.invoke(() -> PrCqUsingPoolDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server1.getHost());
     
     String poolName1 = "testPRCqWithUpdatesFromClients1";
@@ -837,7 +837,7 @@ public class PrCqUsingPoolDUnitTest extends CacheTestCase {
     // Wait for server to initialize.
     Wait.pause(2000);
     
-    final int port = server1.invokeInt(PrCqUsingPoolDUnitTest.class, "getCacheServerPort");
+    final int port = server1.invoke(() -> PrCqUsingPoolDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server1.getHost());
 
     String poolName1 = "testPRCqWithMultipleRegionsOnServer1";
@@ -983,7 +983,7 @@ public class PrCqUsingPoolDUnitTest extends CacheTestCase {
     // Wait for server to initialize.
     Wait.pause(2000);
     
-    final int port = server1.invokeInt(PrCqUsingPoolDUnitTest.class, "getCacheServerPort");
+    final int port = server1.invoke(() -> PrCqUsingPoolDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server1.getHost());
     
     String poolName1 = "testPRWithCQsAndProfileUpdates1";
@@ -1202,7 +1202,7 @@ public class PrCqUsingPoolDUnitTest extends CacheTestCase {
     createServer(server1);
     createServer(server2);
     
-    final int port = server1.invokeInt(PrCqUsingPoolDUnitTest.class, "getCacheServerPort");
+    final int port = server1.invoke(() -> PrCqUsingPoolDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server1.getHost());
     
     String poolName1 = "testEventsDuringQueryExecution";
@@ -1336,7 +1336,7 @@ public class PrCqUsingPoolDUnitTest extends CacheTestCase {
     // create values
     final int size = 100;
 
-    final int port = server1.invokeInt(PrCqUsingPoolDUnitTest.class, "getCacheServerPort");
+    final int port = server1.invoke(() -> PrCqUsingPoolDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server1.getHost());
 
     String poolName = "testCQsWithPutalls";
@@ -1430,7 +1430,7 @@ public class PrCqUsingPoolDUnitTest extends CacheTestCase {
     // create values
     final int size = 100;
 
-    final int port = server1.invokeInt(PrCqUsingPoolDUnitTest.class, "getCacheServerPort");
+    final int port = server1.invoke(() -> PrCqUsingPoolDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server1.getHost());
 
     String poolName = "testCQsWithPutalls";
@@ -1532,7 +1532,7 @@ public class PrCqUsingPoolDUnitTest extends CacheTestCase {
     // create values
     final int size = 100;
 
-    final int port = server1.invokeInt(PrCqUsingPoolDUnitTest.class, "getCacheServerPort");
+    final int port = server1.invoke(() -> PrCqUsingPoolDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server1.getHost());
 
     String poolName = "testCQsWithPutallsTx";
@@ -1654,7 +1654,7 @@ public class PrCqUsingPoolDUnitTest extends CacheTestCase {
     // create values
     final int size = 100;
 
-    final int port = server1.invokeInt(PrCqUsingPoolDUnitTest.class, "getCacheServerPort");
+    final int port = server1.invoke(() -> PrCqUsingPoolDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server1.getHost());
 
     String poolName = "testCQsWithPutallsTx";

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/69024aa9/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/dunit/PdxQueryCQDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/dunit/PdxQueryCQDUnitTest.java b/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/dunit/PdxQueryCQDUnitTest.java
index 49a1252..8180b31 100644
--- a/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/dunit/PdxQueryCQDUnitTest.java
+++ b/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/dunit/PdxQueryCQDUnitTest.java
@@ -85,8 +85,8 @@ public class PdxQueryCQDUnitTest extends PdxQueryCQTestBase {
     });
 
     // Client pool.
-    final int port0 = vm0.invokeInt(PdxQueryCQTestBase.class, "getCacheServerPort");
-    final int port1 = vm1.invokeInt(PdxQueryCQTestBase.class, "getCacheServerPort");
+    final int port0 = vm0.invoke(() -> PdxQueryCQTestBase.getCacheServerPort());
+    final int port1 = vm1.invoke(() -> PdxQueryCQTestBase.getCacheServerPort());
 
     final String host0 = NetworkUtils.getServerHostName(vm0.getHost());
 
@@ -266,8 +266,8 @@ public class PdxQueryCQDUnitTest extends PdxQueryCQTestBase {
     });
 
     // Client pool.
-    final int port0 = vm0.invokeInt(PdxQueryCQTestBase.class, "getCacheServerPort");
-    final int port1 = vm1.invokeInt(PdxQueryCQTestBase.class, "getCacheServerPort");
+    final int port0 = vm0.invoke(() -> PdxQueryCQTestBase.getCacheServerPort());
+    final int port1 = vm1.invoke(() -> PdxQueryCQTestBase.getCacheServerPort());
 
     final String host0 = NetworkUtils.getServerHostName(vm0.getHost());
 
@@ -469,9 +469,9 @@ public class PdxQueryCQDUnitTest extends PdxQueryCQTestBase {
     });
     
     // Client pool.
-    final int port0 = vm0.invokeInt(PdxQueryCQTestBase.class, "getCacheServerPort");
-    final int port1 = vm1.invokeInt(PdxQueryCQTestBase.class, "getCacheServerPort");
-    final int port2 = vm2.invokeInt(PdxQueryCQTestBase.class, "getCacheServerPort");
+    final int port0 = vm0.invoke(() -> PdxQueryCQTestBase.getCacheServerPort());
+    final int port1 = vm1.invoke(() -> PdxQueryCQTestBase.getCacheServerPort());
+    final int port2 = vm2.invoke(() -> PdxQueryCQTestBase.getCacheServerPort());
     
     final String host0 = NetworkUtils.getServerHostName(vm0.getHost());
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/69024aa9/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryIndexUpdateRIDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryIndexUpdateRIDUnitTest.java b/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryIndexUpdateRIDUnitTest.java
index 6e4de65..2662120 100644
--- a/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryIndexUpdateRIDUnitTest.java
+++ b/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryIndexUpdateRIDUnitTest.java
@@ -96,8 +96,7 @@ public class QueryIndexUpdateRIDUnitTest extends CacheTestCase{
 
     this.createServer(server, 0, false);
 
-    final int port = server.invokeInt(QueryIndexUpdateRIDUnitTest.class,
-        "getCacheServerPort");
+    final int port = server.invoke(() -> QueryIndexUpdateRIDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server.getHost());
 
     // Init values at server. 
@@ -142,8 +141,7 @@ public class QueryIndexUpdateRIDUnitTest extends CacheTestCase{
 
     this.createServer(server, 0, false);
 
-    final int port = server.invokeInt(QueryIndexUpdateRIDUnitTest.class,
-        "getCacheServerPort");
+    final int port = server.invoke(() -> QueryIndexUpdateRIDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server.getHost());
 
     String poolName = "testClientIndexUpdateWithRegisterInterest";
@@ -193,8 +191,7 @@ public class QueryIndexUpdateRIDUnitTest extends CacheTestCase{
 
     this.createServer(server, 0, false);
 
-    final int port = server.invokeInt(QueryIndexUpdateRIDUnitTest.class,
-        "getCacheServerPort");
+    final int port = server.invoke(() -> QueryIndexUpdateRIDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server.getHost());
 
     //Init values at server. 
@@ -234,8 +231,7 @@ public class QueryIndexUpdateRIDUnitTest extends CacheTestCase{
 
     this.createServer(server, 0, false);
 
-    final int port = server.invokeInt(QueryIndexUpdateRIDUnitTest.class,
-        "getCacheServerPort");
+    final int port = server.invoke(() -> QueryIndexUpdateRIDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server.getHost());
 
     //Init values at server. 
@@ -281,8 +277,7 @@ public class QueryIndexUpdateRIDUnitTest extends CacheTestCase{
 
     this.createServer(server, 0, false);
 
-    final int port = server.invokeInt(QueryIndexUpdateRIDUnitTest.class,
-        "getCacheServerPort");
+    final int port = server.invoke(() -> QueryIndexUpdateRIDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server.getHost());
 
     //Init values at server. 
@@ -338,8 +333,7 @@ public class QueryIndexUpdateRIDUnitTest extends CacheTestCase{
 
     this.createServer(server, 0, true);
 
-    final int port = server.invokeInt(QueryIndexUpdateRIDUnitTest.class,
-        "getCacheServerPort");
+    final int port = server.invoke(() -> QueryIndexUpdateRIDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server.getHost());
 
     // Init values at server. 
@@ -379,8 +373,7 @@ public class QueryIndexUpdateRIDUnitTest extends CacheTestCase{
 
     this.createServer(server, 0, true);
 
-    final int port = server.invokeInt(QueryIndexUpdateRIDUnitTest.class,
-        "getCacheServerPort");
+    final int port = server.invoke(() -> QueryIndexUpdateRIDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server.getHost());
 
     // Init values at server. 
@@ -420,8 +413,7 @@ public class QueryIndexUpdateRIDUnitTest extends CacheTestCase{
 
     this.createServer(server, 0, true);
 
-    final int port = server.invokeInt(QueryIndexUpdateRIDUnitTest.class,
-        "getCacheServerPort");
+    final int port = server.invoke(() -> QueryIndexUpdateRIDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server.getHost());
 
     // Init values at server. 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/69024aa9/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryMonitorDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryMonitorDUnitTest.java b/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryMonitorDUnitTest.java
index febe78e..8008c3a 100644
--- a/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryMonitorDUnitTest.java
+++ b/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryMonitorDUnitTest.java
@@ -177,7 +177,7 @@ public class QueryMonitorDUnitTest extends CacheTestCase {
     disconnectFromDS();
     // shut down clients before servers
     for (int i=numServers; i<4; i++) {
-      host.getVM(i).invoke(CacheTestCase.class, "disconnectFromDS");
+      host.getVM(i).invoke(() -> CacheTestCase.disconnectFromDS());
     }
   }
   
@@ -262,7 +262,7 @@ public class QueryMonitorDUnitTest extends CacheTestCase {
   public void configClient(VM client, VM[] server){
     final int[] port = new int[server.length];
     for (int i=0; i < server.length; i++){
-      port[i] = server[i].invokeInt(QueryMonitorDUnitTest.class, "getCacheServerPort");
+      port[i] = server[i].invoke(() -> QueryMonitorDUnitTest.getCacheServerPort());
     }
     final String host0 = NetworkUtils.getServerHostName(server[0].getHost());
 
@@ -1018,8 +1018,7 @@ public class QueryMonitorDUnitTest extends CacheTestCase {
     VM producerClient = host.getVM(2);
     
     cqDUnitTest.createServer(server, 0, true);
-    final int port = server.invokeInt(CqQueryDUnitTest.class,
-        "getCacheServerPort");
+    final int port = server.invoke(() -> CqQueryDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server.getHost());
 
     // Create client.


Mime
View raw message