You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by up...@apache.org on 2016/02/19 19:37:19 UTC
[42/63] [abbrv] incubator-geode git commit: Automatically converting
calls of vm.invoke to lambdas
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/69024aa9/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRClientServerRegionFunctionExecutionSingleHopDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRClientServerRegionFunctionExecutionSingleHopDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRClientServerRegionFunctionExecutionSingleHopDUnitTest.java
index 1afd8f5..a1c31d8 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRClientServerRegionFunctionExecutionSingleHopDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRClientServerRegionFunctionExecutionSingleHopDUnitTest.java
@@ -82,9 +82,7 @@ import com.gemstone.gemfire.test.dunit.WaitCriterion;
Function function = new TestFunction(true,TEST_FUNCTION2);
registerFunctionAtServer(function);
isByName = new Boolean(false);
- client.invoke(PRClientServerRegionFunctionExecutionSingleHopDUnitTest.class,
- "serverAllKeyExecution",
- new Object[] { isByName});
+ client.invoke(() -> PRClientServerRegionFunctionExecutionSingleHopDUnitTest.serverAllKeyExecution( isByName));
}
@@ -93,8 +91,7 @@ import com.gemstone.gemfire.test.dunit.WaitCriterion;
*/
public void testServerGetAllFunction(){
createScenario();
- client.invoke(PRClientServerRegionFunctionExecutionSingleHopDUnitTest.class,
- "getAll");
+ client.invoke(() -> PRClientServerRegionFunctionExecutionSingleHopDUnitTest.getAll());
}
/*
@@ -102,8 +99,7 @@ import com.gemstone.gemfire.test.dunit.WaitCriterion;
*/
public void testServerPutAllFunction(){
createScenario();
- client.invoke(PRClientServerRegionFunctionExecutionSingleHopDUnitTest.class,
- "putAll");
+ client.invoke(() -> PRClientServerRegionFunctionExecutionSingleHopDUnitTest.putAll());
}
/*
* Execution of the function on server with single key as the routing
@@ -114,8 +110,7 @@ import com.gemstone.gemfire.test.dunit.WaitCriterion;
Function function = new TestFunction(true,TEST_FUNCTION2);
registerFunctionAtServer(function);
isByName = new Boolean(true);
- client.invoke(PRClientServerRegionFunctionExecutionSingleHopDUnitTest.class,
- "serverSingleKeyExecution", new Object[] { isByName});
+ client.invoke(() -> PRClientServerRegionFunctionExecutionSingleHopDUnitTest.serverSingleKeyExecution( isByName));
}
/*
@@ -126,8 +121,7 @@ import com.gemstone.gemfire.test.dunit.WaitCriterion;
*/
public void testserverSingleKeyExecution_FunctionInvocationTargetException() {
createScenario();
- client.invoke(PRClientServerRegionFunctionExecutionSingleHopDUnitTest.class,
- "serverSingleKeyExecution_FunctionInvocationTargetException");
+ client.invoke(() -> PRClientServerRegionFunctionExecutionSingleHopDUnitTest.serverSingleKeyExecution_FunctionInvocationTargetException());
}
public void testServerSingleKeyExecution_SocketTimeOut() {
@@ -140,9 +134,7 @@ import com.gemstone.gemfire.test.dunit.WaitCriterion;
final IgnoredException expectedEx = IgnoredException.addIgnoredException(
DistributedSystemDisconnectedException.class.getName(), server1);
try {
- client.invoke(
- PRClientServerRegionFunctionExecutionSingleHopDUnitTest.class,
- "serverSingleKeyExecutionSocketTimeOut", new Object[] { isByName });
+ client.invoke(() -> PRClientServerRegionFunctionExecutionSingleHopDUnitTest.serverSingleKeyExecutionSocketTimeOut( isByName ));
} finally {
expectedEx.remove();
}
@@ -157,8 +149,7 @@ import com.gemstone.gemfire.test.dunit.WaitCriterion;
Function function = new TestFunction(true,TEST_FUNCTION2);
registerFunctionAtServer(function);
isByName = new Boolean(false);
- client.invoke(PRClientServerRegionFunctionExecutionSingleHopDUnitTest.class,
- "serverSingleKeyExecution", new Object[] { isByName });
+ client.invoke(() -> PRClientServerRegionFunctionExecutionSingleHopDUnitTest.serverSingleKeyExecution( isByName ));
}
/*
@@ -167,8 +158,7 @@ import com.gemstone.gemfire.test.dunit.WaitCriterion;
*/
public void testServerSingleKeyExecution_byInlineFunction() {
createScenario();
- client.invoke(PRClientServerRegionFunctionExecutionSingleHopDUnitTest.class,
- "serverSingleKeyExecution_Inline");
+ client.invoke(() -> PRClientServerRegionFunctionExecutionSingleHopDUnitTest.serverSingleKeyExecution_Inline());
}
/*
@@ -180,12 +170,10 @@ import com.gemstone.gemfire.test.dunit.WaitCriterion;
Function function = new TestFunction(true,TEST_FUNCTION2);
registerFunctionAtServer(function);
isByName = new Boolean(true);
- client.invoke(PRClientServerRegionFunctionExecutionSingleHopDUnitTest.class,
- "serverMultiKeyExecution",
- new Object[] { isByName});
- server1.invoke(PRClientServerRegionFunctionExecutionSingleHopDUnitTest.class, "checkBucketsOnServer");
- server2.invoke(PRClientServerRegionFunctionExecutionSingleHopDUnitTest.class, "checkBucketsOnServer");
- server3.invoke(PRClientServerRegionFunctionExecutionSingleHopDUnitTest.class, "checkBucketsOnServer");
+ client.invoke(() -> PRClientServerRegionFunctionExecutionSingleHopDUnitTest.serverMultiKeyExecution( isByName));
+ server1.invoke(() -> PRClientServerRegionFunctionExecutionSingleHopDUnitTest.checkBucketsOnServer());
+ server2.invoke(() -> PRClientServerRegionFunctionExecutionSingleHopDUnitTest.checkBucketsOnServer());
+ server3.invoke(() -> PRClientServerRegionFunctionExecutionSingleHopDUnitTest.checkBucketsOnServer());
}
/*
@@ -199,15 +187,11 @@ import com.gemstone.gemfire.test.dunit.WaitCriterion;
bucketFilterSet.add(3);
bucketFilterSet.add(6);
bucketFilterSet.add(8);
- client.invoke(PRClientServerTestBase.class,
- "serverBucketFilterExecution",
- new Object[]{bucketFilterSet});
+ client.invoke(() -> PRClientServerTestBase.serverBucketFilterExecution(bucketFilterSet));
bucketFilterSet.clear();
//Test single filter
bucketFilterSet.add(7);
- client.invoke(PRClientServerTestBase.class,
- "serverBucketFilterExecution",
- new Object[]{bucketFilterSet});
+ client.invoke(() -> PRClientServerTestBase.serverBucketFilterExecution(bucketFilterSet));
}
public void testBucketFilterOverride(){
@@ -224,9 +208,7 @@ import com.gemstone.gemfire.test.dunit.WaitCriterion;
keyFilterSet.add(75);
keyFilterSet.add(25);
- client.invoke(PRClientServerTestBase.class,
- "serverBucketFilterOverrideExecution",
- new Object[]{bucketFilterSet, keyFilterSet});
+ client.invoke(() -> PRClientServerTestBase.serverBucketFilterOverrideExecution(bucketFilterSet, keyFilterSet));
}
@@ -235,9 +217,7 @@ import com.gemstone.gemfire.test.dunit.WaitCriterion;
Function function = new TestFunction(true,TestFunction.TEST_FUNCTION_SOCKET_TIMEOUT);
registerFunctionAtServer(function);
isByName = new Boolean(true);
- client.invoke(PRClientServerRegionFunctionExecutionSingleHopDUnitTest.class,
- "serverMultiKeyExecutionSocketTimeOut",
- new Object[] { isByName});
+ client.invoke(() -> PRClientServerRegionFunctionExecutionSingleHopDUnitTest.serverMultiKeyExecutionSocketTimeOut( isByName));
}
/*
@@ -246,8 +226,7 @@ import com.gemstone.gemfire.test.dunit.WaitCriterion;
*/
public void testserverMultiKeyExecution_byInlineFunction(){
createScenario();
- client.invoke(PRClientServerRegionFunctionExecutionSingleHopDUnitTest.class,
- "serverMultiKeyExecution_Inline");
+ client.invoke(() -> PRClientServerRegionFunctionExecutionSingleHopDUnitTest.serverMultiKeyExecution_Inline());
}
/*
@@ -260,8 +239,7 @@ import com.gemstone.gemfire.test.dunit.WaitCriterion;
IgnoredException.addIgnoredException("FunctionException: IOException while sending");
IgnoredException.addIgnoredException("java.net.SocketException: Software caused connection abort");
createScenario();
- client.invoke(PRClientServerRegionFunctionExecutionSingleHopDUnitTest.class,
- "serverMultiKeyExecution_FunctionInvocationTargetException");
+ client.invoke(() -> PRClientServerRegionFunctionExecutionSingleHopDUnitTest.serverMultiKeyExecution_FunctionInvocationTargetException());
}
/*
@@ -274,9 +252,7 @@ import com.gemstone.gemfire.test.dunit.WaitCriterion;
Function function = new TestFunction(false,TEST_FUNCTION7);
registerFunctionAtServer(function);
isByName = new Boolean(true);
- client.invoke(PRClientServerRegionFunctionExecutionSingleHopDUnitTest.class,
- "serverMultiKeyExecutionNoResult",
- new Object[] { isByName});
+ client.invoke(() -> PRClientServerRegionFunctionExecutionSingleHopDUnitTest.serverMultiKeyExecutionNoResult( isByName));
}
/*
@@ -288,9 +264,7 @@ import com.gemstone.gemfire.test.dunit.WaitCriterion;
Function function = new TestFunction(true,TEST_FUNCTION2);
registerFunctionAtServer(function);
isByName = new Boolean(false);
- client.invoke(PRClientServerRegionFunctionExecutionSingleHopDUnitTest.class,
- "serverMultiKeyExecution",
- new Object[] { isByName});
+ client.invoke(() -> PRClientServerRegionFunctionExecutionSingleHopDUnitTest.serverMultiKeyExecution( isByName));
}
/*
@@ -303,8 +277,7 @@ import com.gemstone.gemfire.test.dunit.WaitCriterion;
Function function = new TestFunction(true,TEST_FUNCTION2);
registerFunctionAtServer(function);
isByName = new Boolean(true);
- client.invoke(PRClientServerRegionFunctionExecutionSingleHopDUnitTest.class,
- "serverMultiKeyExecutionOnASingleBucket", new Object[] { isByName});
+ client.invoke(() -> PRClientServerRegionFunctionExecutionSingleHopDUnitTest.serverMultiKeyExecutionOnASingleBucket( isByName));
}
/*
@@ -317,8 +290,7 @@ import com.gemstone.gemfire.test.dunit.WaitCriterion;
Function function = new TestFunction(true,TEST_FUNCTION2);
registerFunctionAtServer(function);
isByName = new Boolean(false);
- client.invoke(PRClientServerRegionFunctionExecutionSingleHopDUnitTest.class,
- "serverMultiKeyExecutionOnASingleBucket", new Object[] { isByName});
+ client.invoke(() -> PRClientServerRegionFunctionExecutionSingleHopDUnitTest.serverMultiKeyExecutionOnASingleBucket( isByName));
}
/*
@@ -332,27 +304,18 @@ import com.gemstone.gemfire.test.dunit.WaitCriterion;
createClientServerScenarion(commonAttributes, 20, 20, 20);
Function function = new TestFunction(true, TestFunction.TEST_FUNCTION_HA);
registerFunctionAtServer(function);
- server2.invoke(PRClientServerRegionFunctionExecutionSingleHopDUnitTest.class,
- "stopServerHA");
- server3.invoke(PRClientServerRegionFunctionExecutionSingleHopDUnitTest.class,
- "stopServerHA");
- client.invoke(PRClientServerRegionFunctionExecutionSingleHopDUnitTest.class,
- "putOperation");
+ server2.invoke(() -> PRClientServerRegionFunctionExecutionSingleHopDUnitTest.stopServerHA());
+ server3.invoke(() -> PRClientServerRegionFunctionExecutionSingleHopDUnitTest.stopServerHA());
+ client.invoke(() -> PRClientServerRegionFunctionExecutionSingleHopDUnitTest.putOperation());
int AsyncInvocationArrSize = 1;
AsyncInvocation[] async = new AsyncInvocation[AsyncInvocationArrSize];
- async[0] = client.invokeAsync(
- PRClientServerRegionFunctionExecutionSingleHopDUnitTest.class,
- "executeFunctionHA");
- server2.invoke(PRClientServerRegionFunctionExecutionSingleHopDUnitTest.class,
- "startServerHA");
- server3.invoke(PRClientServerRegionFunctionExecutionSingleHopDUnitTest.class,
- "startServerHA");
- server1.invoke(PRClientServerRegionFunctionExecutionSingleHopDUnitTest.class,
- "stopServerHA");
- client.invoke(PRClientServerRegionFunctionExecutionDUnitTest.class,
- "verifyDeadAndLiveServers", new Object[] { new Integer(1),
- new Integer(2) });
+ async[0] = client.invokeAsync(() -> PRClientServerRegionFunctionExecutionSingleHopDUnitTest.executeFunctionHA());
+ server2.invoke(() -> PRClientServerRegionFunctionExecutionSingleHopDUnitTest.startServerHA());
+ server3.invoke(() -> PRClientServerRegionFunctionExecutionSingleHopDUnitTest.startServerHA());
+ server1.invoke(() -> PRClientServerRegionFunctionExecutionSingleHopDUnitTest.stopServerHA());
+ client.invoke(() -> PRClientServerRegionFunctionExecutionDUnitTest.verifyDeadAndLiveServers( new Integer(1),
+ new Integer(2) ));
ThreadUtils.join(async[0], 6 * 60 * 1000);
if (async[0].getException() != null) {
Assert.fail("UnExpected Exception Occured : ", async[0].getException());
@@ -372,16 +335,16 @@ import com.gemstone.gemfire.test.dunit.WaitCriterion;
createClientServerScenarion(commonAttributes,20, 20, 20);
Function function = new TestFunction(true,TestFunction.TEST_FUNCTION_HA);
registerFunctionAtServer(function);
- server2.invoke(PRClientServerRegionFunctionExecutionSingleHopDUnitTest.class, "stopServerHA");
- server3.invoke(PRClientServerRegionFunctionExecutionSingleHopDUnitTest.class, "stopServerHA");
- client.invoke(PRClientServerRegionFunctionExecutionSingleHopDUnitTest.class, "putOperation");
+ server2.invoke(() -> PRClientServerRegionFunctionExecutionSingleHopDUnitTest.stopServerHA());
+ server3.invoke(() -> PRClientServerRegionFunctionExecutionSingleHopDUnitTest.stopServerHA());
+ client.invoke(() -> PRClientServerRegionFunctionExecutionSingleHopDUnitTest.putOperation());
int AsyncInvocationArrSize = 1;
AsyncInvocation[] async = new AsyncInvocation[AsyncInvocationArrSize];
- async[0] = client.invokeAsync(PRClientServerRegionFunctionExecutionSingleHopDUnitTest.class, "executeFunctionHA");
- server2.invoke(PRClientServerRegionFunctionExecutionSingleHopDUnitTest.class, "startServerHA");
- server3.invoke(PRClientServerRegionFunctionExecutionSingleHopDUnitTest.class, "startServerHA");
- server1.invoke(PRClientServerRegionFunctionExecutionSingleHopDUnitTest.class, "closeCacheHA");
- client.invoke(PRClientServerRegionFunctionExecutionSingleHopDUnitTest.class, "verifyDeadAndLiveServers",new Object[]{new Integer(1),new Integer(2)});
+ async[0] = client.invokeAsync(() -> PRClientServerRegionFunctionExecutionSingleHopDUnitTest.executeFunctionHA());
+ server2.invoke(() -> PRClientServerRegionFunctionExecutionSingleHopDUnitTest.startServerHA());
+ server3.invoke(() -> PRClientServerRegionFunctionExecutionSingleHopDUnitTest.startServerHA());
+ server1.invoke(() -> PRClientServerRegionFunctionExecutionSingleHopDUnitTest.closeCacheHA());
+ client.invoke(() -> PRClientServerRegionFunctionExecutionSingleHopDUnitTest.verifyDeadAndLiveServers(new Integer(1),new Integer(2)));
ThreadUtils.join(async[0], 5 * 60 * 1000);
if(async[0].getException() != null){
Assert.fail("UnExpected Exception Occured : ", async[0].getException());
@@ -392,16 +355,11 @@ import com.gemstone.gemfire.test.dunit.WaitCriterion;
public void testBug40714() {
createScenario();
- server1.invoke(PRClientServerRegionFunctionExecutionSingleHopDUnitTest.class,
- "registerFunction");
- server1.invoke(PRClientServerRegionFunctionExecutionSingleHopDUnitTest.class,
- "registerFunction");
- server1.invoke(PRClientServerRegionFunctionExecutionSingleHopDUnitTest.class,
- "registerFunction");
- client.invoke(PRClientServerRegionFunctionExecutionSingleHopDUnitTest.class,
- "registerFunction");
- client.invoke(PRClientServerRegionFunctionExecutionDUnitTest.class,
- "FunctionExecution_Inline_Bug40714");
+ server1.invoke(() -> PRClientServerRegionFunctionExecutionSingleHopDUnitTest.registerFunction());
+ server1.invoke(() -> PRClientServerRegionFunctionExecutionSingleHopDUnitTest.registerFunction());
+ server1.invoke(() -> PRClientServerRegionFunctionExecutionSingleHopDUnitTest.registerFunction());
+ client.invoke(() -> PRClientServerRegionFunctionExecutionSingleHopDUnitTest.registerFunction());
+ client.invoke(() -> PRClientServerRegionFunctionExecutionDUnitTest.FunctionExecution_Inline_Bug40714());
}
public static void registerFunction() {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/69024aa9/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRClientServerTestBase.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRClientServerTestBase.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRClientServerTestBase.java
index 4bee088..d09a30f 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRClientServerTestBase.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRClientServerTestBase.java
@@ -464,35 +464,23 @@ public class PRClientServerTestBase extends CacheTestCase {
protected void createClientServerScenarion(ArrayList commonAttributes , int localMaxMemoryServer1,
int localMaxMemoryServer2, int localMaxMemoryServer3) {
createCacheInClientServer();
- Integer port1 = (Integer)server1.invoke(PRClientServerTestBase.class,
- "createCacheServer",
- new Object[] {commonAttributes ,new Integer(localMaxMemoryServer1) });
- Integer port2 = (Integer)server2.invoke(PRClientServerTestBase.class,
- "createCacheServer",
- new Object[] {commonAttributes, new Integer(localMaxMemoryServer2) });
- Integer port3 = (Integer)server3.invoke(PRClientServerTestBase.class,
- "createCacheServer",
- new Object[] { commonAttributes, new Integer(localMaxMemoryServer3) });
+ Integer port1 = (Integer)server1.invoke(() -> PRClientServerTestBase.createCacheServer(commonAttributes ,new Integer(localMaxMemoryServer1) ));
+ Integer port2 = (Integer)server2.invoke(() -> PRClientServerTestBase.createCacheServer(commonAttributes, new Integer(localMaxMemoryServer2) ));
+ Integer port3 = (Integer)server3.invoke(() -> PRClientServerTestBase.createCacheServer( commonAttributes, new Integer(localMaxMemoryServer3) ));
serverPort1 = port1;
serverPort2 = port2;
serverPort3 = port3;
- client.invoke(PRClientServerTestBase.class, "createCacheClient",
- new Object[] { NetworkUtils.getServerHostName(server1.getHost()), port1, port2,
- port3 });
+ client.invoke(() -> PRClientServerTestBase.createCacheClient( NetworkUtils.getServerHostName(server1.getHost()), port1, port2,
+ port3 ));
}
protected void createClientServerScenarion_SingleConnection(ArrayList commonAttributes , int localMaxMemoryServer1,
int localMaxMemoryServer2, int localMaxMemoryServer3) {
createCacheInClientServer();
- Integer port1 = (Integer)server1.invoke(PRClientServerTestBase.class,
- "createCacheServer",
- new Object[] {commonAttributes ,new Integer(localMaxMemoryServer1) });
- server2.invoke(PRClientServerTestBase.class,
- "createCacheServer",
- new Object[] {commonAttributes ,new Integer(localMaxMemoryServer2) });
+ Integer port1 = (Integer)server1.invoke(() -> PRClientServerTestBase.createCacheServer(commonAttributes ,new Integer(localMaxMemoryServer1) ));
+ server2.invoke(() -> PRClientServerTestBase.createCacheServer(commonAttributes ,new Integer(localMaxMemoryServer2) ));
serverPort1 = port1;
- client.invoke(PRClientServerTestBase.class, "createCacheClient_SingleConnection",
- new Object[] { NetworkUtils.getServerHostName(server1.getHost()), port1});
+ client.invoke(() -> PRClientServerTestBase.createCacheClient_SingleConnection( NetworkUtils.getServerHostName(server1.getHost()), port1));
}
@@ -500,46 +488,31 @@ public class PRClientServerTestBase extends CacheTestCase {
protected void createClientServerScenarionWith2Regions(ArrayList commonAttributes , int localMaxMemoryServer1,
int localMaxMemoryServer2, int localMaxMemoryServer3) {
createCacheInClientServer();
- Integer port1 = (Integer)server1.invoke(PRClientServerTestBase.class,
- "createCacheServerWith2Regions",
- new Object[] {commonAttributes ,new Integer(localMaxMemoryServer1) });
- Integer port2 = (Integer)server2.invoke(PRClientServerTestBase.class,
- "createCacheServerWith2Regions",
- new Object[] {commonAttributes, new Integer(localMaxMemoryServer2) });
- Integer port3 = (Integer)server3.invoke(PRClientServerTestBase.class,
- "createCacheServerWith2Regions",
- new Object[] { commonAttributes, new Integer(localMaxMemoryServer3) });
+ Integer port1 = (Integer)server1.invoke(() -> PRClientServerTestBase.createCacheServerWith2Regions(commonAttributes ,new Integer(localMaxMemoryServer1) ));
+ Integer port2 = (Integer)server2.invoke(() -> PRClientServerTestBase.createCacheServerWith2Regions(commonAttributes, new Integer(localMaxMemoryServer2) ));
+ Integer port3 = (Integer)server3.invoke(() -> PRClientServerTestBase.createCacheServerWith2Regions( commonAttributes, new Integer(localMaxMemoryServer3) ));
serverPort1 = port1;
serverPort2 = port2;
serverPort3 = port3;
- client.invoke(PRClientServerTestBase.class, "createCacheClientWith2Regions",
- new Object[] { NetworkUtils.getServerHostName(server1.getHost()), port1, port2,
- port3 });
+ client.invoke(() -> PRClientServerTestBase.createCacheClientWith2Regions( NetworkUtils.getServerHostName(server1.getHost()), port1, port2,
+ port3 ));
}
protected void createClientServerScenarioSingleHop(ArrayList commonAttributes , int localMaxMemoryServer1,
int localMaxMemoryServer2, int localMaxMemoryServer3) {
createCacheInClientServer();
- Integer port1 = (Integer)server1.invoke(PRClientServerTestBase.class,
- "createCacheServer",
- new Object[] {commonAttributes ,new Integer(localMaxMemoryServer1) });
- Integer port2 = (Integer)server2.invoke(PRClientServerTestBase.class,
- "createCacheServer",
- new Object[] {commonAttributes, new Integer(localMaxMemoryServer2) });
- Integer port3 = (Integer)server3.invoke(PRClientServerTestBase.class,
- "createCacheServer",
- new Object[] { commonAttributes, new Integer(localMaxMemoryServer3) });
+ Integer port1 = (Integer)server1.invoke(() -> PRClientServerTestBase.createCacheServer(commonAttributes ,new Integer(localMaxMemoryServer1) ));
+ Integer port2 = (Integer)server2.invoke(() -> PRClientServerTestBase.createCacheServer(commonAttributes, new Integer(localMaxMemoryServer2) ));
+ Integer port3 = (Integer)server3.invoke(() -> PRClientServerTestBase.createCacheServer( commonAttributes, new Integer(localMaxMemoryServer3) ));
serverPort1 = port1;
serverPort2 = port2;
serverPort3 = port3;
//Workaround for the issue that hostnames returned by the client metadata may
//not match those configured by the pool, leading to multiple copies
//of the endpoint in the client.
- String hostname = (String) server1.invoke(PRClientServerTestBase.class,
- "getHostname", new Object[] {});
- client.invoke(PRClientServerTestBase.class, "createSingleHopCacheClient",
- new Object[] { hostname, port1, port2,
- port3 });
+ String hostname = (String) server1.invoke(() -> PRClientServerTestBase.getHostname());
+ client.invoke(() -> PRClientServerTestBase.createSingleHopCacheClient( hostname, port1, port2,
+ port3 ));
}
public static String getHostname() {
@@ -549,79 +522,57 @@ public class PRClientServerTestBase extends CacheTestCase {
protected void createClientServerScenarioNoSingleHop(ArrayList commonAttributes , int localMaxMemoryServer1,
int localMaxMemoryServer2, int localMaxMemoryServer3) {
createCacheInClientServer();
- Integer port1 = (Integer)server1.invoke(PRClientServerTestBase.class,
- "createCacheServer",
- new Object[] {commonAttributes ,new Integer(localMaxMemoryServer1) });
- Integer port2 = (Integer)server2.invoke(PRClientServerTestBase.class,
- "createCacheServer",
- new Object[] {commonAttributes, new Integer(localMaxMemoryServer2) });
- Integer port3 = (Integer)server3.invoke(PRClientServerTestBase.class,
- "createCacheServer",
- new Object[] { commonAttributes, new Integer(localMaxMemoryServer3) });
+ Integer port1 = (Integer)server1.invoke(() -> PRClientServerTestBase.createCacheServer(commonAttributes ,new Integer(localMaxMemoryServer1) ));
+ Integer port2 = (Integer)server2.invoke(() -> PRClientServerTestBase.createCacheServer(commonAttributes, new Integer(localMaxMemoryServer2) ));
+ Integer port3 = (Integer)server3.invoke(() -> PRClientServerTestBase.createCacheServer( commonAttributes, new Integer(localMaxMemoryServer3) ));
serverPort1 = port1;
serverPort2 = port2;
serverPort3 = port3;
- client.invoke(PRClientServerTestBase.class, "createNoSingleHopCacheClient",
- new Object[] { NetworkUtils.getServerHostName(server1.getHost()), port1, port2,
- port3 });
+ client.invoke(() -> PRClientServerTestBase.createNoSingleHopCacheClient( NetworkUtils.getServerHostName(server1.getHost()), port1, port2,
+ port3 ));
}
protected void createClientServerScenarioSelectorNoSingleHop(ArrayList commonAttributes , int localMaxMemoryServer1,
int localMaxMemoryServer2, int localMaxMemoryServer3) {
createCacheInClientServer();
- Integer port1 = (Integer)server1.invoke(PRClientServerTestBase.class,
- "createSelectorCacheServer",
- new Object[] {commonAttributes ,new Integer(localMaxMemoryServer1) });
- Integer port2 = (Integer)server2.invoke(PRClientServerTestBase.class,
- "createSelectorCacheServer",
- new Object[] {commonAttributes, new Integer(localMaxMemoryServer2) });
- Integer port3 = (Integer)server3.invoke(PRClientServerTestBase.class,
- "createSelectorCacheServer",
- new Object[] { commonAttributes, new Integer(localMaxMemoryServer3) });
+ Integer port1 = (Integer)server1.invoke(() -> PRClientServerTestBase.createSelectorCacheServer(commonAttributes ,new Integer(localMaxMemoryServer1) ));
+ Integer port2 = (Integer)server2.invoke(() -> PRClientServerTestBase.createSelectorCacheServer(commonAttributes, new Integer(localMaxMemoryServer2) ));
+ Integer port3 = (Integer)server3.invoke(() -> PRClientServerTestBase.createSelectorCacheServer( commonAttributes, new Integer(localMaxMemoryServer3) ));
serverPort1 = port1;
serverPort2 = port2;
serverPort3 = port3;
- client.invoke(PRClientServerTestBase.class, "createNoSingleHopCacheClient",
- new Object[] { NetworkUtils.getServerHostName(server1.getHost()), port1, port2,
- port3 });
+ client.invoke(() -> PRClientServerTestBase.createNoSingleHopCacheClient( NetworkUtils.getServerHostName(server1.getHost()), port1, port2,
+ port3 ));
}
protected void createClientServerScenarionWithoutRegion () {
LogWriterUtils.getLogWriter().info("PRClientServerTestBase#createClientServerScenarionWithoutRegion : creating client server");
createCacheInClientServer();
- Integer port1 = (Integer)server1.invoke(PRClientServerTestBase.class,
- "createCacheServer");
- Integer port2 = (Integer)server2.invoke(PRClientServerTestBase.class,
- "createCacheServer");
- Integer port3 = (Integer)server3.invoke(PRClientServerTestBase.class,
- "createCacheServer");
+ Integer port1 = (Integer)server1.invoke(() -> PRClientServerTestBase.createCacheServer());
+ Integer port2 = (Integer)server2.invoke(() -> PRClientServerTestBase.createCacheServer());
+ Integer port3 = (Integer)server3.invoke(() -> PRClientServerTestBase.createCacheServer());
serverPort1 = port1;
serverPort2 = port2;
serverPort3 = port3;
- client.invoke(PRClientServerTestBase.class, "createCacheClientWithoutRegion",
- new Object[] { NetworkUtils.getServerHostName(server1.getHost()), port1, port2,
- port3 });
+ client.invoke(() -> PRClientServerTestBase.createCacheClientWithoutRegion( NetworkUtils.getServerHostName(server1.getHost()), port1, port2,
+ port3 ));
}
protected void createClientServerScenarionWithDistributedtRegion () {
LogWriterUtils.getLogWriter().info("PRClientServerTestBase#createClientServerScenarionWithoutRegion : creating client server");
createCacheInClientServer();
- Integer port1 = (Integer)server1.invoke(PRClientServerTestBase.class,
- "createCacheServerWithDR");
- Integer port2 = (Integer)server2.invoke(PRClientServerTestBase.class,
- "createCacheServerWithDR");
- Integer port3 = (Integer)server3.invoke(PRClientServerTestBase.class,
- "createCacheServerWithDR");
+ Integer port1 = (Integer)server1.invoke(() -> PRClientServerTestBase.createCacheServerWithDR());
+ Integer port2 = (Integer)server2.invoke(() -> PRClientServerTestBase.createCacheServerWithDR());
+ Integer port3 = (Integer)server3.invoke(() -> PRClientServerTestBase.createCacheServerWithDR());
serverPort1 = port1;
serverPort2 = port2;
serverPort3 = port3;
- client.invoke(PRClientServerTestBase.class, "createCacheClientWithDistributedRegion",
- new Object[] { NetworkUtils.getServerHostName(server1.getHost()), port1, port2,
- port3 });
+ client.invoke(() -> PRClientServerTestBase.createCacheClientWithDistributedRegion( NetworkUtils.getServerHostName(server1.getHost()), port1, port2,
+ port3 ));
}
protected void runOnAllServers(SerializableRunnable runnable) {
@@ -647,21 +598,17 @@ public class PRClientServerTestBase extends CacheTestCase {
private void createCacheInClientServer() {
Properties props = new Properties();
- server1.invoke(PRClientServerTestBase.class, "createCacheInVm",
- new Object[] { props });
+ server1.invoke(() -> PRClientServerTestBase.createCacheInVm( props ));
- server2.invoke(PRClientServerTestBase.class, "createCacheInVm",
- new Object[] { props });
+ server2.invoke(() -> PRClientServerTestBase.createCacheInVm( props ));
- server3.invoke(PRClientServerTestBase.class, "createCacheInVm",
- new Object[] { props });
+ server3.invoke(() -> PRClientServerTestBase.createCacheInVm( props ));
props = new Properties();
props.setProperty("mcast-port", "0");
props.setProperty("locators", "");
- client.invoke(PRClientServerTestBase.class, "createCacheInVm",
- new Object[] { props });
+ client.invoke(() -> PRClientServerTestBase.createCacheInVm( props ));
}
public static void createCacheInVm(Properties props) {
@@ -737,10 +684,10 @@ public class PRClientServerTestBase extends CacheTestCase {
@Override
protected final void postTearDownCacheTestCase() throws Exception {
closeCache();
- client.invoke(PRClientServerTestBase.class, "closeCache");
- server1.invoke(PRClientServerTestBase.class, "closeCache");
- server2.invoke(PRClientServerTestBase.class, "closeCache");
- server3.invoke(PRClientServerTestBase.class, "closeCache");
+ client.invoke(() -> PRClientServerTestBase.closeCache());
+ server1.invoke(() -> PRClientServerTestBase.closeCache());
+ server2.invoke(() -> PRClientServerTestBase.closeCache());
+ server3.invoke(() -> PRClientServerTestBase.closeCache());
}
public static void closeCache() {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/69024aa9/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRColocationDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRColocationDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRColocationDUnitTest.java
index 5ce60f3..839d78c 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRColocationDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRColocationDUnitTest.java
@@ -275,25 +275,15 @@ public class PRColocationDUnitTest extends CacheTestCase {
totalNumBuckets, colocatedWith, isPartitionResolver };
createPartitionedRegion(attributeObjects);
- accessor.invoke(PRColocationDUnitTest.class,
- "validateColocatedRegions",
- new Object[] { "A" });
+ accessor.invoke(() -> PRColocationDUnitTest.validateColocatedRegions( "A" ));
- accessor.invoke(PRColocationDUnitTest.class,
- "validateColocatedRegions",
- new Object[] { "D" });
+ accessor.invoke(() -> PRColocationDUnitTest.validateColocatedRegions( "D" ));
- accessor.invoke(PRColocationDUnitTest.class,
- "validateColocatedRegions",
- new Object[] { "H" });
+ accessor.invoke(() -> PRColocationDUnitTest.validateColocatedRegions( "H" ));
- accessor.invoke(PRColocationDUnitTest.class,
- "validateColocatedRegions",
- new Object[] { "B" });
+ accessor.invoke(() -> PRColocationDUnitTest.validateColocatedRegions( "B" ));
- accessor.invoke(PRColocationDUnitTest.class,
- "validateColocatedRegions",
- new Object[] { "K" });
+ accessor.invoke(() -> PRColocationDUnitTest.validateColocatedRegions( "K" ));
}
/*
* Test for checking the colocation of the regions which forms the tree
@@ -408,25 +398,15 @@ public class PRColocationDUnitTest extends CacheTestCase {
totalNumBuckets, colocatedWith, isPartitionResolver };
createPartitionedRegion(attributeObjects);
- accessor.invoke(PRColocationDUnitTest.class,
- "validateColocatedRegions",
- new Object[] { "A" });
+ accessor.invoke(() -> PRColocationDUnitTest.validateColocatedRegions( "A" ));
- accessor.invoke(PRColocationDUnitTest.class,
- "validateColocatedRegions",
- new Object[] { "D" });
+ accessor.invoke(() -> PRColocationDUnitTest.validateColocatedRegions( "D" ));
- accessor.invoke(PRColocationDUnitTest.class,
- "validateColocatedRegions",
- new Object[] { "H" });
+ accessor.invoke(() -> PRColocationDUnitTest.validateColocatedRegions( "H" ));
- accessor.invoke(PRColocationDUnitTest.class,
- "validateColocatedRegions",
- new Object[] { "B" });
+ accessor.invoke(() -> PRColocationDUnitTest.validateColocatedRegions( "B" ));
- accessor.invoke(PRColocationDUnitTest.class,
- "validateColocatedRegions",
- new Object[] { "K" });
+ accessor.invoke(() -> PRColocationDUnitTest.validateColocatedRegions( "K" ));
}
public void testColocatedSubPartitionedRegion() throws Throwable {
createCacheInAllVms();
@@ -538,25 +518,15 @@ public class PRColocationDUnitTest extends CacheTestCase {
totalNumBuckets, colocatedWith, isPartitionResolver };
createSubPartitionedRegion(attributeObjects);
- accessor.invoke(PRColocationDUnitTest.class,
- "validateColocatedRegions",
- new Object[] { "rootA/A" });
+ accessor.invoke(() -> PRColocationDUnitTest.validateColocatedRegions( "rootA/A" ));
- accessor.invoke(PRColocationDUnitTest.class,
- "validateColocatedRegions",
- new Object[] { "rootD/D" });
+ accessor.invoke(() -> PRColocationDUnitTest.validateColocatedRegions( "rootD/D" ));
- accessor.invoke(PRColocationDUnitTest.class,
- "validateColocatedRegions",
- new Object[] { "rootH/H" });
+ accessor.invoke(() -> PRColocationDUnitTest.validateColocatedRegions( "rootH/H" ));
- accessor.invoke(PRColocationDUnitTest.class,
- "validateColocatedRegions",
- new Object[] { "rootB/B" });
+ accessor.invoke(() -> PRColocationDUnitTest.validateColocatedRegions( "rootB/B" ));
- accessor.invoke(PRColocationDUnitTest.class,
- "validateColocatedRegions",
- new Object[] { "rootK/K" });
+ accessor.invoke(() -> PRColocationDUnitTest.validateColocatedRegions( "rootK/K" ));
}
public void testColocatedSubPartitionedRegion_NoFullPath() throws Throwable {
@@ -669,25 +639,15 @@ public class PRColocationDUnitTest extends CacheTestCase {
totalNumBuckets, colocatedWith, isPartitionResolver };
createSubPartitionedRegion(attributeObjects);
- accessor.invoke(PRColocationDUnitTest.class,
- "validateColocatedRegions",
- new Object[] { "rootA/A" });
+ accessor.invoke(() -> PRColocationDUnitTest.validateColocatedRegions( "rootA/A" ));
- accessor.invoke(PRColocationDUnitTest.class,
- "validateColocatedRegions",
- new Object[] { "rootD/D" });
+ accessor.invoke(() -> PRColocationDUnitTest.validateColocatedRegions( "rootD/D" ));
- accessor.invoke(PRColocationDUnitTest.class,
- "validateColocatedRegions",
- new Object[] { "rootH/H" });
+ accessor.invoke(() -> PRColocationDUnitTest.validateColocatedRegions( "rootH/H" ));
- accessor.invoke(PRColocationDUnitTest.class,
- "validateColocatedRegions",
- new Object[] { "rootB/B" });
+ accessor.invoke(() -> PRColocationDUnitTest.validateColocatedRegions( "rootB/B" ));
- accessor.invoke(PRColocationDUnitTest.class,
- "validateColocatedRegions",
- new Object[] { "rootK/K" });
+ accessor.invoke(() -> PRColocationDUnitTest.validateColocatedRegions( "rootK/K" ));
}
public void testColocatedPRWithAccessorOnDifferentNode1() throws Throwable {
@@ -994,12 +954,9 @@ public class PRColocationDUnitTest extends CacheTestCase {
// Put the customer 1-10 in CustomerPartitionedRegion
- accessor.invoke(PRColocationDUnitTest.class,
- "putCustomerPartitionedRegion",
- new Object[] { CustomerPartitionedRegionName });
+ accessor.invoke(() -> PRColocationDUnitTest.putCustomerPartitionedRegion( CustomerPartitionedRegionName ));
// Put the order 1-10 for each Customer in OrderPartitionedRegion
- accessor.invoke(PRColocationDUnitTest.class, "putOrderPartitionedRegion",
- new Object[] { OrderPartitionedRegionName });
+ accessor.invoke(() -> PRColocationDUnitTest.putOrderPartitionedRegion( OrderPartitionedRegionName ));
// add expected exception string
final String expectedExMessage =
@@ -1072,12 +1029,9 @@ public class PRColocationDUnitTest extends CacheTestCase {
// Put the customer 1-10 in CustomerPartitionedRegion
- accessor.invoke(PRColocationDUnitTest.class,
- "putCustomerPartitionedRegion",
- new Object[] { CustomerPartitionedRegionName });
+ accessor.invoke(() -> PRColocationDUnitTest.putCustomerPartitionedRegion( CustomerPartitionedRegionName ));
// Put the order 1-10 for each Customer in OrderPartitionedRegion
- accessor.invoke(PRColocationDUnitTest.class, "putOrderPartitionedRegion",
- new Object[] { OrderPartitionedRegionName });
+ accessor.invoke(() -> PRColocationDUnitTest.putOrderPartitionedRegion( OrderPartitionedRegionName ));
// add expected exception string
final String expectedExMessage = "colocation chain cannot be destroyed, "
@@ -1162,34 +1116,23 @@ public class PRColocationDUnitTest extends CacheTestCase {
// Put the customer 1-10 in CustomerPartitionedRegion
- accessor.invoke(PRColocationDUnitTest.class,
- "putCustomerPartitionedRegion",
- new Object[] { CustomerPartitionedRegionName });
+ accessor.invoke(() -> PRColocationDUnitTest.putCustomerPartitionedRegion( CustomerPartitionedRegionName ));
// Put the order 1-10 for each Customer in OrderPartitionedRegion
- accessor.invoke(PRColocationDUnitTest.class, "putOrderPartitionedRegion",
- new Object[] { OrderPartitionedRegionName });
+ accessor.invoke(() -> PRColocationDUnitTest.putOrderPartitionedRegion( OrderPartitionedRegionName ));
// Closing region with colocated regions will throw an exception
// and the region will not be closed.
- accessor.invoke(PRColocationDUnitTest.class,
- "closeRegionWithColocatedRegions",
- new Object[] { CustomerPartitionedRegionName, false });
+ accessor.invoke(() -> PRColocationDUnitTest.closeRegionWithColocatedRegions( CustomerPartitionedRegionName, false ));
// Destroying region with colocated regions will throw an exception
// and the region will not be closed.
- accessor.invoke(PRColocationDUnitTest.class,
- "closeRegionWithColocatedRegions",
- new Object[] { CustomerPartitionedRegionName, true });
+ accessor.invoke(() -> PRColocationDUnitTest.closeRegionWithColocatedRegions( CustomerPartitionedRegionName, true ));
// Closing the colocated regions in the right order should work
- accessor.invoke(PRColocationDUnitTest.class,
- "closeRegion",
- new Object[] { OrderPartitionedRegionName});
- accessor.invoke(PRColocationDUnitTest.class,
- "closeRegion",
- new Object[] { CustomerPartitionedRegionName});
+ accessor.invoke(() -> PRColocationDUnitTest.closeRegion( OrderPartitionedRegionName));
+ accessor.invoke(() -> PRColocationDUnitTest.closeRegion( CustomerPartitionedRegionName));
}
/*
* Test For partition Region with Key Based Routing Resolver
@@ -1285,44 +1228,34 @@ public class PRColocationDUnitTest extends CacheTestCase {
createPartitionedRegion(attributeObjects);
// Initial Validation for the number of data stores and number of profiles
- accessor.invoke(PRColocationDUnitTest.class,
- "validateBeforePutCustomerPartitionedRegion",
- new Object[] { CustomerPartitionedRegionName });
+ accessor.invoke(() -> PRColocationDUnitTest.validateBeforePutCustomerPartitionedRegion( CustomerPartitionedRegionName ));
// Put the customer 1-10 in CustomerPartitionedRegion
- accessor.invoke(PRColocationDUnitTest.class,
- "putCustomerPartitionedRegion",
- new Object[] { CustomerPartitionedRegionName });
+ accessor.invoke(() -> PRColocationDUnitTest.putCustomerPartitionedRegion( CustomerPartitionedRegionName ));
// Put the order 1-10 for each Customer in OrderPartitionedRegion
- accessor.invoke(PRColocationDUnitTest.class, "putOrderPartitionedRegion",
- new Object[] { OrderPartitionedRegionName });
+ accessor.invoke(() -> PRColocationDUnitTest.putOrderPartitionedRegion( OrderPartitionedRegionName ));
// Put the shipment 1-10 for each order in ShipmentPartitionedRegion
- accessor.invoke(PRColocationDUnitTest.class,
- "putShipmentPartitionedRegion",
- new Object[] { ShipmentPartitionedRegionName });
+ accessor.invoke(() -> PRColocationDUnitTest.putShipmentPartitionedRegion( ShipmentPartitionedRegionName ));
// for VM0 DataStore check the number of buckets created and the size of
// bucket for all partitionedRegion
- Integer totalBucketsInDataStore1 = (Integer)dataStore1.invoke(
- PRColocationDUnitTest.class, "validateDataStore", new Object[] {
+ Integer totalBucketsInDataStore1 = (Integer)dataStore1.invoke(() -> PRColocationDUnitTest.validateDataStore(
CustomerPartitionedRegionName, OrderPartitionedRegionName,
- ShipmentPartitionedRegionName });
+ ShipmentPartitionedRegionName ));
// for VM1 DataStore check the number of buckets created and the size of
// bucket for all partitionedRegion
- Integer totalBucketsInDataStore2 = (Integer)dataStore2.invoke(
- PRColocationDUnitTest.class, "validateDataStore", new Object[] {
+ Integer totalBucketsInDataStore2 = (Integer)dataStore2.invoke(() -> PRColocationDUnitTest.validateDataStore(
CustomerPartitionedRegionName, OrderPartitionedRegionName,
- ShipmentPartitionedRegionName });
+ ShipmentPartitionedRegionName ));
// for VM3 Datastore check the number of buckets created and the size of
// bucket for all partitionedRegion
- Integer totalBucketsInDataStore3 = (Integer)dataStore3.invoke(
- PRColocationDUnitTest.class, "validateDataStore", new Object[] {
+ Integer totalBucketsInDataStore3 = (Integer)dataStore3.invoke(() -> PRColocationDUnitTest.validateDataStore(
CustomerPartitionedRegionName, OrderPartitionedRegionName,
- ShipmentPartitionedRegionName });
+ ShipmentPartitionedRegionName ));
// Check the total number of buckets created in all three Vms are equalto 30
totalNumBucketsInTest = totalBucketsInDataStore1.intValue()
@@ -1333,10 +1266,9 @@ public class PRColocationDUnitTest extends CacheTestCase {
// This is the importatnt check. Checks that the colocated Customer,Order
// and Shipment are in the same VM
- accessor.invoke(PRColocationDUnitTest.class,
- "validateAfterPutPartitionedRegion", new Object[] {
+ accessor.invoke(() -> PRColocationDUnitTest.validateAfterPutPartitionedRegion(
CustomerPartitionedRegionName, OrderPartitionedRegionName,
- ShipmentPartitionedRegionName });
+ ShipmentPartitionedRegionName ));
}
@@ -1432,70 +1364,56 @@ public class PRColocationDUnitTest extends CacheTestCase {
createPartitionedRegion(attributeObjects);
// Initial Validation for the number of data stores and number of profiles
- accessor.invoke(PRColocationDUnitTest.class,
- "validateBeforePutCustomerPartitionedRegion",
- new Object[] { CustomerPartitionedRegionName });
+ accessor.invoke(() -> PRColocationDUnitTest.validateBeforePutCustomerPartitionedRegion( CustomerPartitionedRegionName ));
// Put the customer 1-10 in CustomerPartitionedRegion
- accessor.invoke(PRColocationDUnitTest.class,
- "putCustomerPartitionedRegion",
- new Object[] { CustomerPartitionedRegionName });
+ accessor.invoke(() -> PRColocationDUnitTest.putCustomerPartitionedRegion( CustomerPartitionedRegionName ));
// Put the order 1-10 for each Customer in OrderPartitionedRegion
- accessor.invoke(PRColocationDUnitTest.class, "putOrderPartitionedRegion",
- new Object[] { OrderPartitionedRegionName });
+ accessor.invoke(() -> PRColocationDUnitTest.putOrderPartitionedRegion( OrderPartitionedRegionName ));
// Put the shipment 1-10 for each order in ShipmentPartitionedRegion
- accessor.invoke(PRColocationDUnitTest.class,
- "putShipmentPartitionedRegion",
- new Object[] { ShipmentPartitionedRegionName });
+ accessor.invoke(() -> PRColocationDUnitTest.putShipmentPartitionedRegion( ShipmentPartitionedRegionName ));
// This is the importatnt check. Checks that the colocated Customer,Order
// and Shipment are in the same VM
- accessor.invoke(PRColocationDUnitTest.class,
- "validateAfterPutPartitionedRegion", new Object[] {
+ accessor.invoke(() -> PRColocationDUnitTest.validateAfterPutPartitionedRegion(
CustomerPartitionedRegionName, OrderPartitionedRegionName,
- ShipmentPartitionedRegionName });
+ ShipmentPartitionedRegionName ));
// for VM0 DataStore check the number of buckets created and the size of
// bucket for all partitionedRegion
- Integer totalBucketsInDataStore1 = (Integer)dataStore1.invoke(
- PRColocationDUnitTest.class, "validateDataStore", new Object[] {
+ Integer totalBucketsInDataStore1 = (Integer)dataStore1.invoke(() -> PRColocationDUnitTest.validateDataStore(
CustomerPartitionedRegionName, OrderPartitionedRegionName,
- ShipmentPartitionedRegionName });
+ ShipmentPartitionedRegionName ));
// for VM1 DataStore check the number of buckets created and the size of
// bucket for all partitionedRegion
- Integer totalBucketsInDataStore2 = (Integer)dataStore2.invoke(
- PRColocationDUnitTest.class, "validateDataStore", new Object[] {
+ Integer totalBucketsInDataStore2 = (Integer)dataStore2.invoke(() -> PRColocationDUnitTest.validateDataStore(
CustomerPartitionedRegionName, OrderPartitionedRegionName,
- ShipmentPartitionedRegionName });
+ ShipmentPartitionedRegionName ));
// for VM3 Datastore check the number of buckets created and the size of
// bucket for all partitionedRegion
- Integer totalBucketsInDataStore3 = (Integer)dataStore3.invoke(
- PRColocationDUnitTest.class, "validateDataStore", new Object[] {
+ Integer totalBucketsInDataStore3 = (Integer)dataStore3.invoke(() -> PRColocationDUnitTest.validateDataStore(
CustomerPartitionedRegionName, OrderPartitionedRegionName,
- ShipmentPartitionedRegionName });
+ ShipmentPartitionedRegionName ));
if (redundancy.intValue() > 0) {
// for VM0 DataStore check the number of buckets created and the size of
// bucket for all partitionedRegion
- dataStore1.invoke(PRColocationDUnitTest.class, "validateDataStoreForRedundancy",
- new Object[] { CustomerPartitionedRegionName,
- OrderPartitionedRegionName, ShipmentPartitionedRegionName });
+ dataStore1.invoke(() -> PRColocationDUnitTest.validateDataStoreForRedundancy( CustomerPartitionedRegionName,
+ OrderPartitionedRegionName, ShipmentPartitionedRegionName ));
// for VM1 DataStore check the number of buckets created and the size of
// bucket for all partitionedRegion
- dataStore2.invoke(PRColocationDUnitTest.class, "validateDataStoreForRedundancy",
- new Object[] { CustomerPartitionedRegionName,
- OrderPartitionedRegionName, ShipmentPartitionedRegionName });
+ dataStore2.invoke(() -> PRColocationDUnitTest.validateDataStoreForRedundancy( CustomerPartitionedRegionName,
+ OrderPartitionedRegionName, ShipmentPartitionedRegionName ));
// for VM3 Datastore check the number of buckets created and the size of
// bucket for all partitionedRegion
- dataStore3.invoke(PRColocationDUnitTest.class, "validateDataStoreForRedundancy",
- new Object[] { CustomerPartitionedRegionName,
- OrderPartitionedRegionName, ShipmentPartitionedRegionName });
+ dataStore3.invoke(() -> PRColocationDUnitTest.validateDataStoreForRedundancy( CustomerPartitionedRegionName,
+ OrderPartitionedRegionName, ShipmentPartitionedRegionName ));
}
// Check the total number of buckets created in all three Vms are equalto 60
@@ -1671,15 +1589,12 @@ public class PRColocationDUnitTest extends CacheTestCase {
createPartitionedRegion(attributeObjects);
// Initial Validation for the number of data stores and number of profiles
- accessor.invoke(PRColocationDUnitTest.class,
- "validateBeforePutCustomerPartitionedRegion",
- new Object[] { CustomerPartitionedRegionName });
+ accessor.invoke(() -> PRColocationDUnitTest.validateBeforePutCustomerPartitionedRegion( CustomerPartitionedRegionName ));
// Put the customer 1-10 in CustomerPartitionedRegion
- accessor.invoke(PRColocationDUnitTest.class,
- "putData_KeyBasedPartitionResolver");
+ accessor.invoke(() -> PRColocationDUnitTest.putData_KeyBasedPartitionResolver());
- accessor.invoke(PRColocationDUnitTest.class, "executeFunction");
+ accessor.invoke(() -> PRColocationDUnitTest.executeFunction());
}
public void testColocatedPRRedundancyRecovery2() throws Throwable {
@@ -2387,10 +2302,10 @@ public class PRColocationDUnitTest extends CacheTestCase {
}
protected void createCacheInAllVms() {
- dataStore1.invoke(PRColocationDUnitTest.class, "createCacheInVm");
- dataStore2.invoke(PRColocationDUnitTest.class, "createCacheInVm");
- dataStore3.invoke(PRColocationDUnitTest.class, "createCacheInVm");
- accessor.invoke(PRColocationDUnitTest.class, "createCacheInVm");
+ dataStore1.invoke(() -> PRColocationDUnitTest.createCacheInVm());
+ dataStore2.invoke(() -> PRColocationDUnitTest.createCacheInVm());
+ dataStore3.invoke(() -> PRColocationDUnitTest.createCacheInVm());
+ accessor.invoke(() -> PRColocationDUnitTest.createCacheInVm());
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/69024aa9/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRCustomPartitioningDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRCustomPartitioningDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRCustomPartitioningDUnitTest.java
index 981db10..55ab928 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRCustomPartitioningDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRCustomPartitioningDUnitTest.java
@@ -443,10 +443,10 @@ public class PRCustomPartitioningDUnitTest extends
final VM accessor = vm3;
//create cache in all vms
- vm0.invoke(PRCustomPartitioningDUnitTest.class, "createCacheInVm");
- vm1.invoke(PRCustomPartitioningDUnitTest.class, "createCacheInVm");
- vm2.invoke(PRCustomPartitioningDUnitTest.class, "createCacheInVm");
- accessor.invoke(PRCustomPartitioningDUnitTest.class, "createCacheInVm");
+ vm0.invoke(() -> PRCustomPartitioningDUnitTest.createCacheInVm());
+ vm1.invoke(() -> PRCustomPartitioningDUnitTest.createCacheInVm());
+ vm2.invoke(() -> PRCustomPartitioningDUnitTest.createCacheInVm());
+ accessor.invoke(() -> PRCustomPartitioningDUnitTest.createCacheInVm());
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/69024aa9/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRFunctionExecutionDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRFunctionExecutionDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRFunctionExecutionDUnitTest.java
index 0c4b7a9..a8df3f6 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRFunctionExecutionDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRFunctionExecutionDUnitTest.java
@@ -968,8 +968,7 @@ public class PRFunctionExecutionDUnitTest extends
int AsyncInvocationArrSize = 1;
AsyncInvocation[] async = new AsyncInvocation[AsyncInvocationArrSize];
- async[0] = accessor.invokeAsync(PRFunctionExecutionDUnitTest.class,
- "executeFunction");
+ async[0] = accessor.invokeAsync(() -> PRFunctionExecutionDUnitTest.executeFunction());
o = datastore0.invoke(new SerializableCallable("close cache") {
public Object call() throws Exception {
@@ -1066,8 +1065,7 @@ public class PRFunctionExecutionDUnitTest extends
int AsyncInvocationArrSize = 1;
AsyncInvocation[] async = new AsyncInvocation[AsyncInvocationArrSize];
- async[0] = accessor.invokeAsync(PRFunctionExecutionDUnitTest.class,
- "executeFunction");
+ async[0] = accessor.invokeAsync(() -> PRFunctionExecutionDUnitTest.executeFunction());
o = datastore0.invoke(new SerializableCallable("disconnect") {
public Object call() throws Exception {
@@ -2994,7 +2992,7 @@ public class PRFunctionExecutionDUnitTest extends
public void testBug41118() {
Host host = Host.getHost(0);
final VM lonerVM = host.getVM(1);
- lonerVM.invoke(PRFunctionExecutionDUnitTest.class, "bug41118");
+ lonerVM.invoke(() -> PRFunctionExecutionDUnitTest.bug41118());
}
public static void bug41118(){
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/69024aa9/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRPerformanceTestDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRPerformanceTestDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRPerformanceTestDUnitTest.java
index cd35f50..4643123 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRPerformanceTestDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRPerformanceTestDUnitTest.java
@@ -330,10 +330,10 @@ public class PRPerformanceTestDUnitTest extends
//final VM accessor = vm3;
//create cache in all vms
- accessor.invoke(PRPerformanceTestDUnitTest.class, "createCacheInVm");
- vm1.invoke(PRPerformanceTestDUnitTest.class, "createCacheInVm");
- vm2.invoke(PRPerformanceTestDUnitTest.class, "createCacheInVm");
- vm3.invoke(PRPerformanceTestDUnitTest.class, "createCacheInVm");
+ accessor.invoke(() -> PRPerformanceTestDUnitTest.createCacheInVm());
+ vm1.invoke(() -> PRPerformanceTestDUnitTest.createCacheInVm());
+ vm2.invoke(() -> PRPerformanceTestDUnitTest.createCacheInVm());
+ vm3.invoke(() -> PRPerformanceTestDUnitTest.createCacheInVm());
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/69024aa9/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRTransactionDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRTransactionDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRTransactionDUnitTest.java
index b253dc0..15cf753 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRTransactionDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRTransactionDUnitTest.java
@@ -232,9 +232,7 @@ public class PRTransactionDUnitTest extends PRColocationDUnitTest {
OrderPartitionedRegionName);
// Initial Validation for the number of data stores and number of profiles
- accessor.invoke(PRColocationDUnitTest.class,
- "validateBeforePutCustomerPartitionedRegion",
- new Object[] { CustomerPartitionedRegionName });
+ accessor.invoke(() -> PRColocationDUnitTest.validateBeforePutCustomerPartitionedRegion( CustomerPartitionedRegionName ));
}
@Override
@@ -254,39 +252,31 @@ public class PRTransactionDUnitTest extends PRColocationDUnitTest {
protected void populateAndVerifyColocatedPRs(int redundantBuckets) {
// Put the customer 1-10 in CustomerPartitionedRegion
- accessor.invoke(PRColocationDUnitTest.class,
- "putCustomerPartitionedRegion",
- new Object[] { CustomerPartitionedRegionName });
+ accessor.invoke(() -> PRColocationDUnitTest.putCustomerPartitionedRegion( CustomerPartitionedRegionName ));
// Put the order 1-10 for each Customer in OrderPartitionedRegion
- accessor.invoke(PRColocationDUnitTest.class, "putOrderPartitionedRegion",
- new Object[] { OrderPartitionedRegionName });
+ accessor.invoke(() -> PRColocationDUnitTest.putOrderPartitionedRegion( OrderPartitionedRegionName ));
// Put the shipment 1-10 for each order in ShipmentPartitionedRegion
- accessor.invoke(PRColocationDUnitTest.class,
- "putShipmentPartitionedRegion",
- new Object[] { ShipmentPartitionedRegionName });
+ accessor.invoke(() -> PRColocationDUnitTest.putShipmentPartitionedRegion( ShipmentPartitionedRegionName ));
// for VM0 DataStore check the number of buckets created and the size of
// bucket for all partitionedRegion
- Integer totalBucketsInDataStore1 = (Integer)dataStore1.invoke(
- PRColocationDUnitTest.class, "validateDataStore", new Object[] {
+ Integer totalBucketsInDataStore1 = (Integer)dataStore1.invoke(() -> PRColocationDUnitTest.validateDataStore(
CustomerPartitionedRegionName, OrderPartitionedRegionName,
- ShipmentPartitionedRegionName });
+ ShipmentPartitionedRegionName ));
// for VM1 DataStore check the number of buckets created and the size of
// bucket for all partitionedRegion
- Integer totalBucketsInDataStore2 = (Integer)dataStore2.invoke(
- PRColocationDUnitTest.class, "validateDataStore", new Object[] {
+ Integer totalBucketsInDataStore2 = (Integer)dataStore2.invoke(() -> PRColocationDUnitTest.validateDataStore(
CustomerPartitionedRegionName, OrderPartitionedRegionName,
- ShipmentPartitionedRegionName });
+ ShipmentPartitionedRegionName ));
// for VM3 Datastore check the number of buckets created and the size of
// bucket for all partitionedRegion
- Integer totalBucketsInDataStore3 = (Integer)dataStore3.invoke(
- PRColocationDUnitTest.class, "validateDataStore", new Object[] {
+ Integer totalBucketsInDataStore3 = (Integer)dataStore3.invoke(() -> PRColocationDUnitTest.validateDataStore(
CustomerPartitionedRegionName, OrderPartitionedRegionName,
- ShipmentPartitionedRegionName });
+ ShipmentPartitionedRegionName ));
// Check the total number of buckets created in all three Vms are equalto 30
totalNumBucketsInTest = totalBucketsInDataStore1.intValue()
@@ -297,10 +287,9 @@ public class PRTransactionDUnitTest extends PRColocationDUnitTest {
// This is the importatnt check. Checks that the colocated Customer,Order
// and Shipment are in the same VM
- accessor.invoke(PRColocationDUnitTest.class,
- "validateAfterPutPartitionedRegion", new Object[] {
+ accessor.invoke(() -> PRColocationDUnitTest.validateAfterPutPartitionedRegion(
CustomerPartitionedRegionName, OrderPartitionedRegionName,
- ShipmentPartitionedRegionName });
+ ShipmentPartitionedRegionName ));
}
@@ -364,16 +353,11 @@ public class PRTransactionDUnitTest extends PRColocationDUnitTest {
dataStore3.invoke(registerListeners);
// Put the customer 1-10 in CustomerPartitionedRegion
- accessor.invoke(PRColocationDUnitTest.class,
- "putCustomerPartitionedRegion",
- new Object[] { CustomerPartitionedRegionName });
-
- dataStore1.invoke(PRTransactionDUnitTest.class,
- "validatePRTXInCacheListener");
- dataStore2.invoke(PRTransactionDUnitTest.class,
- "validatePRTXInCacheListener");
- dataStore3.invoke(PRTransactionDUnitTest.class,
- "validatePRTXInCacheListener");
+ accessor.invoke(() -> PRColocationDUnitTest.putCustomerPartitionedRegion( CustomerPartitionedRegionName ));
+
+ dataStore1.invoke(() -> PRTransactionDUnitTest.validatePRTXInCacheListener());
+ dataStore2.invoke(() -> PRTransactionDUnitTest.validatePRTXInCacheListener());
+ dataStore3.invoke(() -> PRTransactionDUnitTest.validatePRTXInCacheListener());
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/69024aa9/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/SingleHopGetAllPutAllDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/SingleHopGetAllPutAllDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/SingleHopGetAllPutAllDUnitTest.java
index 33e22f4..863e260 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/SingleHopGetAllPutAllDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/SingleHopGetAllPutAllDUnitTest.java
@@ -58,8 +58,7 @@ public class SingleHopGetAllPutAllDUnitTest extends PRClientServerTestBase{
@Ignore("Disabled due to bug #50618")
public void testServerGetAllFunction(){
createScenario();
- client.invoke(SingleHopGetAllPutAllDUnitTest.class,
- "getAll");
+ client.invoke(() -> SingleHopGetAllPutAllDUnitTest.getAll());
}
private void createScenario() {
@@ -148,8 +147,7 @@ public class SingleHopGetAllPutAllDUnitTest extends PRClientServerTestBase{
*/
public void testServerPutAllFunction(){
createScenario();
- client.invoke(SingleHopGetAllPutAllDUnitTest.class,
- "putAll");
+ client.invoke(() -> SingleHopGetAllPutAllDUnitTest.putAll());
}
public static void putAll() {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/69024aa9/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/Bug36853EventsExpiryDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/Bug36853EventsExpiryDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/Bug36853EventsExpiryDUnitTest.java
index 09e0fbf..cee0304 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/Bug36853EventsExpiryDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/Bug36853EventsExpiryDUnitTest.java
@@ -109,12 +109,10 @@ public class Bug36853EventsExpiryDUnitTest extends CacheTestCase
final Host host = Host.getHost(0);
server = host.getVM(0);
client = host.getVM(1);
- server.invoke(ConflationDUnitTest.class, "setIsSlowStart");
- int PORT2 = ((Integer)server.invoke(Bug36853EventsExpiryDUnitTest.class,
- "createServerCache")).intValue();
+ server.invoke(() -> ConflationDUnitTest.setIsSlowStart());
+ int PORT2 = ((Integer)server.invoke(() -> Bug36853EventsExpiryDUnitTest.createServerCache())).intValue();
- client.invoke(Bug36853EventsExpiryDUnitTest.class, "createClientCache",
- new Object[] { NetworkUtils.getServerHostName(host), new Integer(PORT2) });
+ client.invoke(() -> Bug36853EventsExpiryDUnitTest.createClientCache( NetworkUtils.getServerHostName(host), new Integer(PORT2) ));
}
@@ -244,9 +242,8 @@ public class Bug36853EventsExpiryDUnitTest extends CacheTestCase
{
IgnoredException.addIgnoredException("Unexpected IOException");
IgnoredException.addIgnoredException("Connection reset");
- server.invoke(Bug36853EventsExpiryDUnitTest.class, "generateEvents");
- client.invoke(Bug36853EventsExpiryDUnitTest.class,
- "validateEventCountAtClient");
+ server.invoke(() -> Bug36853EventsExpiryDUnitTest.generateEvents());
+ client.invoke(() -> Bug36853EventsExpiryDUnitTest.validateEventCountAtClient());
}
/**
@@ -298,9 +295,9 @@ public class Bug36853EventsExpiryDUnitTest extends CacheTestCase
protected final void preTearDownCacheTestCase() throws Exception
{
// close client
- client.invoke(Bug36853EventsExpiryDUnitTest.class, "closeCache");
+ client.invoke(() -> Bug36853EventsExpiryDUnitTest.closeCache());
// close server
- server.invoke(Bug36853EventsExpiryDUnitTest.class, "closeCache");
+ server.invoke(() -> Bug36853EventsExpiryDUnitTest.closeCache());
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/69024aa9/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/Bug48571DUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/Bug48571DUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/Bug48571DUnitTest.java
index 66f1a11..9e03a70 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/Bug48571DUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/Bug48571DUnitTest.java
@@ -72,8 +72,8 @@ public class Bug48571DUnitTest extends DistributedTestCase {
@Override
protected final void preTearDown() throws Exception {
reset();
- server.invoke(Bug48571DUnitTest.class, "reset");
- client.invoke(Bug48571DUnitTest.class, "reset");
+ server.invoke(() -> Bug48571DUnitTest.reset());
+ client.invoke(() -> Bug48571DUnitTest.reset());
}
public static void reset() throws Exception {
@@ -90,21 +90,21 @@ public class Bug48571DUnitTest extends DistributedTestCase {
public void testStatsMatchWithSize() throws Exception {
IgnoredException.addIgnoredException("Unexpected IOException||Connection reset");
// start a server
- int port = (Integer) server.invoke(Bug48571DUnitTest.class, "createServerCache");
+ int port = (Integer) server.invoke(() -> Bug48571DUnitTest.createServerCache());
// create durable client, with durable RI
- client.invoke(Bug48571DUnitTest.class, "createClientCache", new Object[] {client.getHost(), port});
+ client.invoke(() -> Bug48571DUnitTest.createClientCache(client.getHost(), port));
// do puts on server from three different threads, pause after 500 puts each.
- server.invoke(Bug48571DUnitTest.class, "doPuts");
+ server.invoke(() -> Bug48571DUnitTest.doPuts());
// close durable client
- client.invoke(Bug48571DUnitTest.class, "closeClientCache");
+ client.invoke(() -> Bug48571DUnitTest.closeClientCache());
// resume puts on server, add another 100.
- server.invokeAsync(Bug48571DUnitTest.class, "resumePuts");
+ server.invokeAsync(() -> Bug48571DUnitTest.resumePuts());
// start durable client
- client.invoke(Bug48571DUnitTest.class, "createClientCache", new Object[] {client.getHost(), port});
+ client.invoke(() -> Bug48571DUnitTest.createClientCache(client.getHost(), port));
// wait for full queue dispatch
- client.invoke(Bug48571DUnitTest.class, "waitForLastKey");
+ client.invoke(() -> Bug48571DUnitTest.waitForLastKey());
// verify the stats
- server.invoke(Bug48571DUnitTest.class, "verifyStats");
+ server.invoke(() -> Bug48571DUnitTest.verifyStats());
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/69024aa9/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/Bug48879DUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/Bug48879DUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/Bug48879DUnitTest.java
index c7ff13a..636333a 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/Bug48879DUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/Bug48879DUnitTest.java
@@ -59,10 +59,8 @@ public class Bug48879DUnitTest extends DistributedTestCase {
vm0 = host.getVM(0); // server1
vm1 = host.getVM(1); // server2
- int port0 = (Integer) vm0.invoke(Bug48879DUnitTest.class,
- "createCacheServer", new Object[] { });
- int port1 = (Integer) vm1.invoke(Bug48879DUnitTest.class,
- "createCacheServer", new Object[] { });
+ int port0 = (Integer) vm0.invoke(() -> Bug48879DUnitTest.createCacheServer( ));
+ int port1 = (Integer) vm1.invoke(() -> Bug48879DUnitTest.createCacheServer( ));
createClientCache(host, new Integer[] {port0, port1}, Boolean.TRUE);
}
@@ -71,8 +69,8 @@ public class Bug48879DUnitTest extends DistributedTestCase {
protected final void preTearDown() throws Exception {
closeCache();
- vm0.invoke(Bug48879DUnitTest.class, "closeCache");
- vm1.invoke(Bug48879DUnitTest.class, "closeCache");
+ vm0.invoke(() -> Bug48879DUnitTest.closeCache());
+ vm1.invoke(() -> Bug48879DUnitTest.closeCache());
}
public static void closeCache() throws Exception {
@@ -206,16 +204,16 @@ public class Bug48879DUnitTest extends DistributedTestCase {
// put events in region
int threads = 10;
int putsPerThread = 1;
- vm0.invoke(Bug48879DUnitTest.class, "doPuts", new Object[] {threads, putsPerThread});
- vm0.invoke(Bug48879DUnitTest.class, "verifyThreadsBeforeExpiry", new Object[] {threads});
- vm1.invoke(Bug48879DUnitTest.class, "verifyThreadsBeforeExpiry", new Object[] {threads});
+ vm0.invoke(() -> Bug48879DUnitTest.doPuts(threads, putsPerThread));
+ vm0.invoke(() -> Bug48879DUnitTest.verifyThreadsBeforeExpiry(threads));
+ vm1.invoke(() -> Bug48879DUnitTest.verifyThreadsBeforeExpiry(threads));
// sleep till expiry time elapses
Thread.sleep(SLEEP_TIME*2 + 30000);
// Assert that threadidentifiers are expired and region events are retained on primary server
- vm0.invoke(Bug48879DUnitTest.class, "verifyStats", new Object[] {threads*putsPerThread, threads});
+ vm0.invoke(() -> Bug48879DUnitTest.verifyStats(threads*putsPerThread, threads));
// Assert that region events and threadidentifiers are expired on secondary server.
- vm1.invoke(Bug48879DUnitTest.class, "verifyStats", new Object[] {threads*putsPerThread, threads});
+ vm1.invoke(() -> Bug48879DUnitTest.verifyStats(threads*putsPerThread, threads));
}
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/69024aa9/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/EventIdOptimizationDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/EventIdOptimizationDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/EventIdOptimizationDUnitTest.java
index 086b956..b4fbc58 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/EventIdOptimizationDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/EventIdOptimizationDUnitTest.java
@@ -169,15 +169,11 @@ public class EventIdOptimizationDUnitTest extends DistributedTestCase
client1 = host.getVM(2);
client2 = host.getVM(3);
- int PORT1 = ((Integer)server1.invoke(EventIdOptimizationDUnitTest.class,
- "createServerCache")).intValue();
- int PORT2 = ((Integer)server2.invoke(EventIdOptimizationDUnitTest.class,
- "createServerCache")).intValue();
+ int PORT1 = ((Integer)server1.invoke(() -> EventIdOptimizationDUnitTest.createServerCache())).intValue();
+ int PORT2 = ((Integer)server2.invoke(() -> EventIdOptimizationDUnitTest.createServerCache())).intValue();
- client1.invoke(EventIdOptimizationDUnitTest.class, "createClientCache1",
- new Object[] { NetworkUtils.getServerHostName(host), new Integer(PORT1) });
- client2.invoke(EventIdOptimizationDUnitTest.class, "createClientCache2",
- new Object[] { NetworkUtils.getServerHostName(host), new Integer(PORT2) });
+ client1.invoke(() -> EventIdOptimizationDUnitTest.createClientCache1( NetworkUtils.getServerHostName(host), new Integer(PORT1) ));
+ client2.invoke(() -> EventIdOptimizationDUnitTest.createClientCache2( NetworkUtils.getServerHostName(host), new Integer(PORT2) ));
}
@@ -388,10 +384,8 @@ public class EventIdOptimizationDUnitTest extends DistributedTestCase
*/
public void testEventIdOptimizationByPutOperation() throws Exception
{
- client1.invoke(EventIdOptimizationDUnitTest.class,
- "generateEventsByPutOperation");
- client2.invoke(EventIdOptimizationDUnitTest.class,
- "verifyEventIdsOnClient2");
+ client1.invoke(() -> EventIdOptimizationDUnitTest.generateEventsByPutOperation());
+ client2.invoke(() -> EventIdOptimizationDUnitTest.verifyEventIdsOnClient2());
}
@@ -405,10 +399,8 @@ public class EventIdOptimizationDUnitTest extends DistributedTestCase
*/
public void testEventIdOptimizationByDestroyEntryOperation() throws Exception
{
- client1.invoke(EventIdOptimizationDUnitTest.class,
- "generateEventsByDestroyEntryOperation");
- client2.invoke(EventIdOptimizationDUnitTest.class,
- "verifyEventIdsOnClient2");
+ client1.invoke(() -> EventIdOptimizationDUnitTest.generateEventsByDestroyEntryOperation());
+ client2.invoke(() -> EventIdOptimizationDUnitTest.verifyEventIdsOnClient2());
}
/**
@@ -422,10 +414,8 @@ public class EventIdOptimizationDUnitTest extends DistributedTestCase
public void testEventIdOptimizationByDestroyRegionOperation()
throws Exception
{
- client1.invoke(EventIdOptimizationDUnitTest.class,
- "generateEventsByDestroyRegionOperation");
- client2.invoke(EventIdOptimizationDUnitTest.class,
- "verifyEventIdsOnClient2");
+ client1.invoke(() -> EventIdOptimizationDUnitTest.generateEventsByDestroyRegionOperation());
+ client2.invoke(() -> EventIdOptimizationDUnitTest.verifyEventIdsOnClient2());
}
/**
@@ -438,10 +428,8 @@ public class EventIdOptimizationDUnitTest extends DistributedTestCase
*/
public void testEventIdOptimizationByClearRegionOperation() throws Exception
{
- client1.invoke(EventIdOptimizationDUnitTest.class,
- "generateEventsByClearRegionOperation");
- client2.invoke(EventIdOptimizationDUnitTest.class,
- "verifyEventIdsOnClient2");
+ client1.invoke(() -> EventIdOptimizationDUnitTest.generateEventsByClearRegionOperation());
+ client2.invoke(() -> EventIdOptimizationDUnitTest.verifyEventIdsOnClient2());
}
/**
@@ -513,11 +501,11 @@ public class EventIdOptimizationDUnitTest extends DistributedTestCase
@Override
protected final void preTearDown() throws Exception {
// close client
- client1.invoke(EventIdOptimizationDUnitTest.class, "closeCache");
- client2.invoke(EventIdOptimizationDUnitTest.class, "closeCache");
+ client1.invoke(() -> EventIdOptimizationDUnitTest.closeCache());
+ client2.invoke(() -> EventIdOptimizationDUnitTest.closeCache());
// close server
- server1.invoke(EventIdOptimizationDUnitTest.class, "closeCache");
- server2.invoke(EventIdOptimizationDUnitTest.class, "closeCache");
+ server1.invoke(() -> EventIdOptimizationDUnitTest.closeCache());
+ server2.invoke(() -> EventIdOptimizationDUnitTest.closeCache());
}
/**
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/69024aa9/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/FailoverDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/FailoverDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/FailoverDUnitTest.java
index 1119313..90e9703 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/FailoverDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/FailoverDUnitTest.java
@@ -84,10 +84,10 @@ public class FailoverDUnitTest extends DistributedTestCase
vm1 = host.getVM(1);
//start servers first
- vm0.invoke(ConflationDUnitTest.class, "unsetIsSlowStart");
- vm1.invoke(ConflationDUnitTest.class, "unsetIsSlowStart");
- PORT1 = ((Integer)vm0.invoke(FailoverDUnitTest.class, "createServerCache" )).intValue();
- PORT2 = ((Integer)vm1.invoke(FailoverDUnitTest.class, "createServerCache" )).intValue();
+ vm0.invoke(() -> ConflationDUnitTest.unsetIsSlowStart());
+ vm1.invoke(() -> ConflationDUnitTest.unsetIsSlowStart());
+ PORT1 = ((Integer)vm0.invoke(() -> FailoverDUnitTest.createServerCache())).intValue();
+ PORT2 = ((Integer)vm1.invoke(() -> FailoverDUnitTest.createServerCache())).intValue();
CacheServerTestUtil.disableShufflingOfEndpoints();
createClientCache(NetworkUtils.getServerHostName(host), new Integer(PORT1),new Integer(PORT2));
@@ -108,10 +108,10 @@ public class FailoverDUnitTest extends DistributedTestCase
createEntries();
waitForPrimaryAndBackups(1);
registerInterestList();
- primary.invoke(FailoverDUnitTest.class, "put");
+ primary.invoke(() -> FailoverDUnitTest.put());
verifyEntries();
setClientServerObserver();
- primary.invoke(FailoverDUnitTest.class, "stopServer");
+ primary.invoke(() -> FailoverDUnitTest.stopServer());
verifyEntriesAfterFailover();
}
@@ -286,7 +286,7 @@ public class FailoverDUnitTest extends DistributedTestCase
PoolImpl.BEFORE_PRIMARY_IDENTIFICATION_FROM_BACKUP_CALLBACK_FLAG = true;
ClientServerObserverHolder.setInstance(new ClientServerObserverAdapter() {
public void beforePrimaryIdentificationFromBackup() {
- primary.invoke(FailoverDUnitTest.class, "putDuringFailover");
+ primary.invoke(() -> FailoverDUnitTest.putDuringFailover());
PoolImpl.BEFORE_PRIMARY_IDENTIFICATION_FROM_BACKUP_CALLBACK_FLAG = false;
}
});
@@ -329,8 +329,8 @@ public class FailoverDUnitTest extends DistributedTestCase
// close the clients first
closeCache();
// then close the servers
- vm0.invoke(FailoverDUnitTest.class, "closeCache");
- vm1.invoke(FailoverDUnitTest.class, "closeCache");
+ vm0.invoke(() -> FailoverDUnitTest.closeCache());
+ vm1.invoke(() -> FailoverDUnitTest.closeCache());
CacheServerTestUtil.resetDisableShufflingOfEndpointsFlag();
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/69024aa9/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HABugInPutDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HABugInPutDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HABugInPutDUnitTest.java
index 02cd880..41f56cc 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HABugInPutDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HABugInPutDUnitTest.java
@@ -91,26 +91,26 @@ public class HABugInPutDUnitTest extends DistributedTestCase
client2 = host.getVM(3);
//System.setProperty())
- PORT1 = ((Integer)server1.invoke(HABugInPutDUnitTest.class, "createServerCache"))
+ PORT1 = ((Integer)server1.invoke(() -> HABugInPutDUnitTest.createServerCache()))
.intValue();
- PORT2 = ((Integer)server2.invoke(HABugInPutDUnitTest.class, "createServerCache"))
+ PORT2 = ((Integer)server2.invoke(() -> HABugInPutDUnitTest.createServerCache()))
.intValue();
- client1.invoke(HABugInPutDUnitTest.class, "createClientCache", new Object[] {
- NetworkUtils.getServerHostName(host), new Integer(PORT1), new Integer(PORT2) });
- client2.invoke(HABugInPutDUnitTest.class, "createClientCache", new Object[] {
- NetworkUtils.getServerHostName(host), new Integer(PORT1), new Integer(PORT2) });
+ client1.invoke(() -> HABugInPutDUnitTest.createClientCache(
+ NetworkUtils.getServerHostName(host), new Integer(PORT1), new Integer(PORT2) ));
+ client2.invoke(() -> HABugInPutDUnitTest.createClientCache(
+ NetworkUtils.getServerHostName(host), new Integer(PORT1), new Integer(PORT2) ));
//Boolean.getBoolean("")
}
@Override
protected final void preTearDown() throws Exception {
- client1.invoke(HABugInPutDUnitTest.class, "closeCache");
- client2.invoke(HABugInPutDUnitTest.class, "closeCache");
+ client1.invoke(() -> HABugInPutDUnitTest.closeCache());
+ client2.invoke(() -> HABugInPutDUnitTest.closeCache());
// close server
- server1.invoke(HABugInPutDUnitTest.class, "closeCache");
- server2.invoke(HABugInPutDUnitTest.class, "closeCache");
+ server1.invoke(() -> HABugInPutDUnitTest.closeCache());
+ server2.invoke(() -> HABugInPutDUnitTest.closeCache());
}
public static void closeCache()
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/69024aa9/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAClearDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAClearDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAClearDUnitTest.java
index 58e54ed..6a34318 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAClearDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAClearDUnitTest.java
@@ -95,10 +95,10 @@ public class HAClearDUnitTest extends DistributedTestCase
final Host host = Host.getHost(0);
server1 = host.getVM(0);
- server1.invoke(ConflationDUnitTest.class, "unsetIsSlowStart");
+ server1.invoke(() -> ConflationDUnitTest.unsetIsSlowStart());
server2 = host.getVM(1);
- server2.invoke(ConflationDUnitTest.class, "unsetIsSlowStart");
+ server2.invoke(() -> ConflationDUnitTest.unsetIsSlowStart());
client1 = host.getVM(2);
@@ -110,10 +110,10 @@ public class HAClearDUnitTest extends DistributedTestCase
@Override
protected final void preTearDown() throws Exception {
- client1.invoke(HAClearDUnitTest.class, "closeCache");
- client2.invoke(HAClearDUnitTest.class, "closeCache");
- server1.invoke(HAClearDUnitTest.class, "closeCache");
- server2.invoke(HAClearDUnitTest.class, "closeCache");
+ client1.invoke(() -> HAClearDUnitTest.closeCache());
+ client2.invoke(() -> HAClearDUnitTest.closeCache());
+ server1.invoke(() -> HAClearDUnitTest.closeCache());
+ server2.invoke(() -> HAClearDUnitTest.closeCache());
closeCache();
}
@@ -554,18 +554,16 @@ public class HAClearDUnitTest extends DistributedTestCase
// function to create 2servers and 3 clients
private void createClientServerConfigurationForClearTest() throws Exception
{
- PORT1 = ((Integer)server1.invoke(HAClearDUnitTest.class,
- "createServerCache")).intValue();
- PORT2 = ((Integer)server2.invoke(HAClearDUnitTest.class,
- "createServerCache")).intValue();
- client1.invoke(HAClearDUnitTest.class, "createClientCache", new Object[] {
+ PORT1 = ((Integer)server1.invoke(() -> HAClearDUnitTest.createServerCache())).intValue();
+ PORT2 = ((Integer)server2.invoke(() -> HAClearDUnitTest.createServerCache())).intValue();
+ client1.invoke(() -> HAClearDUnitTest.createClientCache(
NetworkUtils.getServerHostName(Host.getHost(0)),
new Integer(PORT1), new Integer(PORT2), new Boolean(true),
- new Boolean(true) });
- client2.invoke(HAClearDUnitTest.class, "createClientCache", new Object[] {
+ new Boolean(true) ));
+ client2.invoke(() -> HAClearDUnitTest.createClientCache(
NetworkUtils.getServerHostName(Host.getHost(0)),
new Integer(PORT1), new Integer(PORT2), new Boolean(true),
- new Boolean(true) });
+ new Boolean(true) ));
createClientCache(NetworkUtils.getServerHostName(Host.getHost(0)),
new Integer(PORT1), new Integer(PORT2),
new Boolean(true), new Boolean(true));
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/69024aa9/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAConflationDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAConflationDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAConflationDUnitTest.java
index 241ac39..629f1a4 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAConflationDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAConflationDUnitTest.java
@@ -109,20 +109,18 @@ public class HAConflationDUnitTest extends CacheTestCase
// Client 1 VM
client1 = host.getVM(2);
- PORT1 = ((Integer)server1.invoke(HAConflationDUnitTest.class,
- "createServerCache", new Object[] { new Boolean(false) })).intValue();
- server1.invoke(ConflationDUnitTest.class, "setIsSlowStart");
- server1.invoke(HAConflationDUnitTest.class, "makeDispatcherSlow");
- client1.invoke(HAConflationDUnitTest.class, "createClientCache",
- new Object[] { NetworkUtils.getServerHostName(host), new Integer(PORT1), new Boolean(true) });
+ PORT1 = ((Integer)server1.invoke(() -> HAConflationDUnitTest.createServerCache( new Boolean(false) ))).intValue();
+ server1.invoke(() -> ConflationDUnitTest.setIsSlowStart());
+ server1.invoke(() -> HAConflationDUnitTest.makeDispatcherSlow());
+ client1.invoke(() -> HAConflationDUnitTest.createClientCache( NetworkUtils.getServerHostName(host), new Integer(PORT1), new Boolean(true) ));
}
@Override
protected final void postTearDownCacheTestCase() throws Exception {
- client1.invoke(HAConflationDUnitTest.class, "closeCache");
+ client1.invoke(() -> HAConflationDUnitTest.closeCache());
// close server
- server1.invoke(HAConflationDUnitTest.class, "closeCache");
+ server1.invoke(() -> HAConflationDUnitTest.closeCache());
}
public static void closeCache()