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:17 UTC
[40/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/ha/PutAllDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/PutAllDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/PutAllDUnitTest.java
index ef75a38..f23a30f 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/PutAllDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/PutAllDUnitTest.java
@@ -104,11 +104,11 @@ public class PutAllDUnitTest extends DistributedTestCase
/** close the caches**/
@Override
protected final void preTearDown() throws Exception {
- client1.invoke(PutAllDUnitTest.class, "closeCache");
- client2.invoke(PutAllDUnitTest.class, "closeCache");
+ client1.invoke(() -> PutAllDUnitTest.closeCache());
+ client2.invoke(() -> PutAllDUnitTest.closeCache());
// close server
- server1.invoke(PutAllDUnitTest.class, "closeCache");
- server2.invoke(PutAllDUnitTest.class, "closeCache");
+ server1.invoke(() -> PutAllDUnitTest.closeCache());
+ server2.invoke(() -> PutAllDUnitTest.closeCache());
// close cache in the controller VM (ezoerner) Not doing this was causing CacheExistsExceptions in other dunit tests
closeCache();
@@ -130,14 +130,10 @@ public class PutAllDUnitTest extends DistributedTestCase
/** function to create a 2 servers and 3 client (1 client will be in the unit controller VM) **/
private void createClientServerConfiguration()
{
- PORT1 = ((Integer)server1.invoke(PutAllDUnitTest.class,
- "createServerCache")).intValue();
- PORT2 = ((Integer)server2.invoke(PutAllDUnitTest.class,
- "createServerCache")).intValue();
- client1.invoke(PutAllDUnitTest.class, "createClientCache1",
- new Object[] { NetworkUtils.getServerHostName(server1.getHost()), new Integer(PORT1) });
- client2.invoke(PutAllDUnitTest.class, "createClientCache2",
- new Object[] { NetworkUtils.getServerHostName(server1.getHost()), new Integer(PORT2) });
+ PORT1 = ((Integer)server1.invoke(() -> PutAllDUnitTest.createServerCache())).intValue();
+ PORT2 = ((Integer)server2.invoke(() -> PutAllDUnitTest.createServerCache())).intValue();
+ client1.invoke(() -> PutAllDUnitTest.createClientCache1( NetworkUtils.getServerHostName(server1.getHost()), new Integer(PORT1) ));
+ client2.invoke(() -> PutAllDUnitTest.createClientCache2( NetworkUtils.getServerHostName(server1.getHost()), new Integer(PORT2) ));
try {
createClientCache2(NetworkUtils.getServerHostName(server1.getHost()), new Integer(PORT2));
}
@@ -354,34 +350,25 @@ public class PutAllDUnitTest extends DistributedTestCase
public void testPutAll() throws Exception
{
setReceivedOperationToFalse();
- client2.invoke(PutAllDUnitTest.class, "setReceivedOperationToFalse");
+ client2.invoke(() -> PutAllDUnitTest.setReceivedOperationToFalse());
createClientServerConfiguration();
- EventID[] eventIds1 = (EventID[])client1.invoke(PutAllDUnitTest.class,
- "putAll");
+ EventID[] eventIds1 = (EventID[])client1.invoke(() -> PutAllDUnitTest.putAll());
assertNotNull(eventIds1);
// wait for key to propagate till client
// assert map not null on client
- client2.invoke(PutAllDUnitTest.class, "waitTillOperationReceived");
+ client2.invoke(() -> PutAllDUnitTest.waitTillOperationReceived());
waitTillOperationReceived();
- EventID[] eventIds2 = (EventID[])client2.invoke(PutAllDUnitTest.class,
- "assertThreadIdToSequenceIdMapHasEntryIds");
+ EventID[] eventIds2 = (EventID[])client2.invoke(() -> PutAllDUnitTest.assertThreadIdToSequenceIdMapHasEntryIds());
assertNotNull(eventIds2);
- server1.invoke(PutAllDUnitTest.class,
- "assertGotAllValues");
- server2.invoke(PutAllDUnitTest.class,
- "assertGotAllValues");
- client1.invoke(PutAllDUnitTest.class,
- "assertCallbackArgs");
- client2.invoke(PutAllDUnitTest.class,
- "assertGotAllValues");
- client2.invoke(PutAllDUnitTest.class,
- "assertCallbackArgs");
- server1.invoke(PutAllDUnitTest.class,
- "assertCallbackArgs");
- server2.invoke(PutAllDUnitTest.class,
- "assertCallbackArgs");
+ server1.invoke(() -> PutAllDUnitTest.assertGotAllValues());
+ server2.invoke(() -> PutAllDUnitTest.assertGotAllValues());
+ client1.invoke(() -> PutAllDUnitTest.assertCallbackArgs());
+ client2.invoke(() -> PutAllDUnitTest.assertGotAllValues());
+ client2.invoke(() -> PutAllDUnitTest.assertCallbackArgs());
+ server1.invoke(() -> PutAllDUnitTest.assertCallbackArgs());
+ server2.invoke(() -> PutAllDUnitTest.assertCallbackArgs());
assertGotAllValues();
assertCallbackArgs();
EventID[] eventIds3 = (EventID[])assertThreadIdToSequenceIdMapHasEntryIds();
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/69024aa9/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/StatsBugDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/StatsBugDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/StatsBugDUnitTest.java
index dd8cf87..f263113 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/StatsBugDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/StatsBugDUnitTest.java
@@ -119,10 +119,8 @@ public class StatsBugDUnitTest extends DistributedTestCase
primary = host.getVM(0);
secondary = host.getVM(1);
client1 = host.getVM(2);
- PORT1 = ((Integer)primary.invoke(StatsBugDUnitTest.class,
- "createServerCache")).intValue();
- PORT2 = ((Integer)secondary.invoke(StatsBugDUnitTest.class,
- "createServerCache")).intValue();
+ PORT1 = ((Integer)primary.invoke(() -> StatsBugDUnitTest.createServerCache())).intValue();
+ PORT2 = ((Integer)secondary.invoke(() -> StatsBugDUnitTest.createServerCache())).intValue();
}
/**
@@ -156,11 +154,11 @@ public class StatsBugDUnitTest extends DistributedTestCase
@Override
protected final void preTearDown() throws Exception {
// close client
- client1.invoke(StatsBugDUnitTest.class, "closeCache");
+ client1.invoke(() -> StatsBugDUnitTest.closeCache());
// close server
- primary.invoke(StatsBugDUnitTest.class, "closeCache");
- secondary.invoke(StatsBugDUnitTest.class, "closeCache");
+ primary.invoke(() -> StatsBugDUnitTest.closeCache());
+ secondary.invoke(() -> StatsBugDUnitTest.closeCache());
}
/**
@@ -179,13 +177,12 @@ public class StatsBugDUnitTest extends DistributedTestCase
public void testBug36109() throws Exception
{
LogWriterUtils.getLogWriter().info("testBug36109 : BEGIN");
- client1.invoke(StatsBugDUnitTest.class, "createClientCacheForInvalidates", new Object[] {
- NetworkUtils.getServerHostName(Host.getHost(0)), new Integer(PORT1), new Integer(PORT2) });
- client1.invoke(StatsBugDUnitTest.class, "prepopulateClient");
- primary.invoke(StatsBugDUnitTest.class, "doEntryOperations",
- new Object[] { primaryPrefix });
+ client1.invoke(() -> StatsBugDUnitTest.createClientCacheForInvalidates(
+ NetworkUtils.getServerHostName(Host.getHost(0)), new Integer(PORT1), new Integer(PORT2) ));
+ client1.invoke(() -> StatsBugDUnitTest.prepopulateClient());
+ primary.invoke(() -> StatsBugDUnitTest.doEntryOperations( primaryPrefix ));
Wait.pause(3000);
- primary.invoke(StatsBugDUnitTest.class, "stopServer");
+ primary.invoke(() -> StatsBugDUnitTest.stopServer());
try {
Thread.sleep(5000);
}
@@ -193,8 +190,7 @@ public class StatsBugDUnitTest extends DistributedTestCase
fail("interrupted");
}
- secondary.invoke(StatsBugDUnitTest.class, "doEntryOperations",
- new Object[] { secondaryPrefix });
+ secondary.invoke(() -> StatsBugDUnitTest.doEntryOperations( secondaryPrefix ));
try {
Thread.sleep(5000);
}
@@ -202,7 +198,7 @@ public class StatsBugDUnitTest extends DistributedTestCase
fail("interrupted");
}
- client1.invoke(StatsBugDUnitTest.class, "verifyNumInvalidates");
+ client1.invoke(() -> StatsBugDUnitTest.verifyNumInvalidates());
LogWriterUtils.getLogWriter().info("testBug36109 : END");
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/69024aa9/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/locks/TXLockServiceDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/locks/TXLockServiceDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/locks/TXLockServiceDUnitTest.java
index 01e7eca..8d150f9 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/locks/TXLockServiceDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/locks/TXLockServiceDUnitTest.java
@@ -77,7 +77,7 @@ public class TXLockServiceDUnitTest extends DistributedTestCase {
Host host = Host.getHost(h);
for (int v = 0; v < host.getVMCount(); v++) {
- //host.getVM(v).invoke(TXLockServiceDUnitTest.class, "dumpStack");
+ //host.getVM(v).invoke(() -> TXLockServiceDUnitTest.dumpStack());
host.getVM(v).invoke(
TXLockServiceDUnitTest.class, "connectDistributedSystem", null);
}
@@ -249,9 +249,7 @@ public class TXLockServiceDUnitTest extends DistributedTestCase {
});
/* try {
- Host.getHost(0).getVM(clientB).invoke(
- TXLockServiceDUnitTest.class, "txLock_DTLS",
- new Object[] { regionLockReqs, participants });
+ Host.getHost(0).getVM(clientB).invoke(() -> TXLockServiceDUnitTest.txLock_DTLS( regionLockReqs, participants ));
fail("expected CommitConflictException");
} catch (RMIException expected) {
assertTrue(expected.getCause() instanceof CommitConflictException);
@@ -314,8 +312,7 @@ public class TXLockServiceDUnitTest extends DistributedTestCase {
final Set participants = new HashSet();
for (int i = 1; i <= particpantB; i++) {
final int finalvm = i;
- dmId = (InternalDistributedMember)Host.getHost(0).getVM(finalvm).invoke(
- TXLockServiceDUnitTest.class, "fetchDistributionManagerId", new Object[] {});
+ dmId = (InternalDistributedMember)Host.getHost(0).getVM(finalvm).invoke(() -> TXLockServiceDUnitTest.fetchDistributionManagerId());
assertEquals("dmId should not be null for vm " + finalvm,
false, dmId == null);
participants.add(dmId);
@@ -330,11 +327,9 @@ public class TXLockServiceDUnitTest extends DistributedTestCase {
}
});
- Host.getHost(0).getVM(grantorVM).invoke(
- TXLockServiceDUnitTest.class, "identifyLockGrantor_DTLS", new Object[] {});
+ Host.getHost(0).getVM(grantorVM).invoke(() -> TXLockServiceDUnitTest.identifyLockGrantor_DTLS());
- Boolean isGrantor = (Boolean)Host.getHost(0).getVM(grantorVM).invoke(
- TXLockServiceDUnitTest.class, "isLockGrantor_DTLS", new Object[] {});
+ Boolean isGrantor = (Boolean)Host.getHost(0).getVM(grantorVM).invoke(() -> TXLockServiceDUnitTest.isLockGrantor_DTLS());
assertEquals("isLockGrantor should not be false for DTLS",
Boolean.TRUE, isGrantor);
@@ -392,9 +387,7 @@ public class TXLockServiceDUnitTest extends DistributedTestCase {
TXLockService.destroyServices();
}
});
- Host.getHost(0).getVM(originatorVM).invoke(
- DistributedTestCase.class, "disconnectFromDS",
- new Object[] {});
+ Host.getHost(0).getVM(originatorVM).invoke(() -> DistributedTestCase.disconnectFromDS());
// grantor sends TXOriginatorRecoveryMessage...
@@ -439,22 +432,19 @@ public class TXLockServiceDUnitTest extends DistributedTestCase {
});
// assert that isDistributed returns false
- Boolean isDistributed = (Boolean)host.getVM(finalvm).invoke(
- TXLockServiceDUnitTest.class, "isDistributed_DTLS", new Object[] {});
+ Boolean isDistributed = (Boolean)host.getVM(finalvm).invoke(() -> TXLockServiceDUnitTest.isDistributed_DTLS());
assertEquals("isDistributed should be true for DTLS",
Boolean.TRUE, isDistributed);
LogWriterUtils.getLogWriter().info("[testDTLSIsDistributed] isDistributed=" + isDistributed);
// lock a key...
- Boolean gotLock = (Boolean)host.getVM(finalvm).invoke(
- TXLockServiceDUnitTest.class, "lock_DTLS", new Object[] {"KEY"});
+ Boolean gotLock = (Boolean)host.getVM(finalvm).invoke(() -> TXLockServiceDUnitTest.lock_DTLS("KEY"));
assertEquals("gotLock is false after calling lock_DTLS",
Boolean.TRUE, gotLock);
LogWriterUtils.getLogWriter().info("[testDTLSIsDistributed] gotLock=" + gotLock);
// unlock it...
- Boolean unlock = (Boolean)host.getVM(finalvm).invoke(
- TXLockServiceDUnitTest.class, "unlock_DTLS", new Object[] {"KEY"});
+ Boolean unlock = (Boolean)host.getVM(finalvm).invoke(() -> TXLockServiceDUnitTest.unlock_DTLS("KEY"));
assertEquals("unlock is false after calling unlock_DTLS",
Boolean.TRUE, unlock);
LogWriterUtils.getLogWriter().info("[testDTLSIsDistributed] unlock=" + unlock);
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/69024aa9/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/Bug43684DUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/Bug43684DUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/Bug43684DUnitTest.java
index eca9bca..272a3ea 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/Bug43684DUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/Bug43684DUnitTest.java
@@ -84,10 +84,10 @@ public class Bug43684DUnitTest extends DistributedTestCase {
@Override
protected final void preTearDown() throws Exception {
closeCache();
- client1.invoke(Bug43684DUnitTest.class, "closeCache");
- server1.invoke(Bug43684DUnitTest.class, "closeCache");
- server2.invoke(Bug43684DUnitTest.class, "closeCache");
- server3.invoke(Bug43684DUnitTest.class, "closeCache");
+ client1.invoke(() -> Bug43684DUnitTest.closeCache());
+ server1.invoke(() -> Bug43684DUnitTest.closeCache());
+ server2.invoke(() -> Bug43684DUnitTest.closeCache());
+ server3.invoke(() -> Bug43684DUnitTest.closeCache());
}
public static void closeCache() {
@@ -201,33 +201,33 @@ public class Bug43684DUnitTest extends DistributedTestCase {
@SuppressWarnings("rawtypes")
private void doRegisterInterest(Object keys, String regEx, Integer numOfPuts, Boolean isReplicated, Boolean isPrimaryEmpty) throws Exception {
- int port1 = (Integer)server1.invoke(Bug43684DUnitTest.class, "createServerCache", new Object[]{isReplicated, isPrimaryEmpty});
- server2.invoke(Bug43684DUnitTest.class, "createServerCache", new Object[]{isReplicated, false});
- server3.invoke(Bug43684DUnitTest.class, "createServerCache", new Object[]{isReplicated, false});
+ int port1 = (Integer)server1.invoke(() -> Bug43684DUnitTest.createServerCache(isReplicated, isPrimaryEmpty));
+ server2.invoke(() -> Bug43684DUnitTest.createServerCache(isReplicated, false));
+ server3.invoke(() -> Bug43684DUnitTest.createServerCache(isReplicated, false));
int regexNum = 20;
- server1.invoke(Bug43684DUnitTest.class, "doPuts", new Object[]{numOfPuts, regEx, regexNum});
+ server1.invoke(() -> Bug43684DUnitTest.doPuts(numOfPuts, regEx, regexNum));
- client1.invoke(Bug43684DUnitTest.class, "createClientCache", new Object[] {host, port1});
- client1.invoke(Bug43684DUnitTest.class, "registerInterest", new Object[] {keys, regEx});
+ client1.invoke(() -> Bug43684DUnitTest.createClientCache(host, port1));
+ client1.invoke(() -> Bug43684DUnitTest.registerInterest(keys, regEx));
- server1.invoke(Bug43684DUnitTest.class, "closeCache");
+ server1.invoke(() -> Bug43684DUnitTest.closeCache());
int size = keys != null ? (keys instanceof List ? ((List)keys).size() : 1) : regEx == null ? numOfPuts : regexNum;
- client1.invoke(Bug43684DUnitTest.class, "verifyResponse", new Object[]{size});
+ client1.invoke(() -> Bug43684DUnitTest.verifyResponse(size));
}
@SuppressWarnings("rawtypes")
private void doRegisterInterest2(Object keys, Boolean isReplicated, Boolean isPrimaryEmpty) throws Exception {
- int port1 = (Integer)server1.invoke(Bug43684DUnitTest.class, "createServerCache", new Object[]{isReplicated, isPrimaryEmpty});
- server2.invoke(Bug43684DUnitTest.class, "createServerCache", new Object[]{isReplicated, false});
- server3.invoke(Bug43684DUnitTest.class, "createServerCache", new Object[]{isReplicated, false});
+ int port1 = (Integer)server1.invoke(() -> Bug43684DUnitTest.createServerCache(isReplicated, isPrimaryEmpty));
+ server2.invoke(() -> Bug43684DUnitTest.createServerCache(isReplicated, false));
+ server3.invoke(() -> Bug43684DUnitTest.createServerCache(isReplicated, false));
- client1.invoke(Bug43684DUnitTest.class, "createClientCache", new Object[] {host, port1});
+ client1.invoke(() -> Bug43684DUnitTest.createClientCache(host, port1));
createClientCache(host, port1);
doOps();
- client1.invoke(Bug43684DUnitTest.class, "registerInterest", new Object[] {keys, null});
- client1.invoke(Bug43684DUnitTest.class, "verifyResponse2");
+ client1.invoke(() -> Bug43684DUnitTest.registerInterest(keys, null));
+ client1.invoke(() -> Bug43684DUnitTest.verifyResponse2());
}
public static Integer createServerCache() throws Exception {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/69024aa9/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/Bug47388DUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/Bug47388DUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/Bug47388DUnitTest.java
index 1a02b90..193a7dd 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/Bug47388DUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/Bug47388DUnitTest.java
@@ -90,10 +90,8 @@ public class Bug47388DUnitTest extends DistributedTestCase {
vm3 = host.getVM(3); // durable client without subscription
//int mcastPort = AvailablePort.getRandomAvailablePort(AvailablePort.JGROUPS);
- int port0 = (Integer) vm0.invoke(Bug47388DUnitTest.class,
- "createCacheServerWithPRDatastore", new Object[] { });
- int port1 = (Integer) vm1.invoke(Bug47388DUnitTest.class,
- "createCacheServerWithPRDatastore", new Object[] { });
+ int port0 = (Integer) vm0.invoke(() -> Bug47388DUnitTest.createCacheServerWithPRDatastore( ));
+ int port1 = (Integer) vm1.invoke(() -> Bug47388DUnitTest.createCacheServerWithPRDatastore( ));
vm2.invoke(Bug47388DUnitTest.class, "createClientCache",
new Object[] { vm2.getHost(), new Integer[] { port0, port1 },
@@ -107,11 +105,11 @@ public class Bug47388DUnitTest extends DistributedTestCase {
protected final void preTearDown() throws Exception {
closeCache();
- vm2.invoke(Bug47388DUnitTest.class, "closeCache");
- vm3.invoke(Bug47388DUnitTest.class, "closeCache");
+ vm2.invoke(() -> Bug47388DUnitTest.closeCache());
+ vm3.invoke(() -> Bug47388DUnitTest.closeCache());
- vm0.invoke(Bug47388DUnitTest.class, "closeCache");
- vm1.invoke(Bug47388DUnitTest.class, "closeCache");
+ vm0.invoke(() -> Bug47388DUnitTest.closeCache());
+ vm1.invoke(() -> Bug47388DUnitTest.closeCache());
}
public static void closeCache() throws Exception {
@@ -272,18 +270,15 @@ public class Bug47388DUnitTest extends DistributedTestCase {
int totalEvents = 23; // = (numOfSets * numOfPuts) * 2 [eviction-destroys] +
// 2 [last key's put and eviction-destroy] + 1 [marker
// message]
- vm3.invoke(Bug47388DUnitTest.class, "doPuts", new Object[] { numOfSets,
- numOfPuts });
+ vm3.invoke(() -> Bug47388DUnitTest.doPuts( numOfSets,
+ numOfPuts ));
- boolean isvm0Primary = (Boolean) vm0.invoke(Bug47388DUnitTest.class,
- "isPrimaryServer");
+ boolean isvm0Primary = (Boolean) vm0.invoke(() -> Bug47388DUnitTest.isPrimaryServer());
- vm2.invoke(Bug47388DUnitTest.class, "waitForLastKeyDestroyed");
+ vm2.invoke(() -> Bug47388DUnitTest.waitForLastKeyDestroyed());
- vm0.invoke(Bug47388DUnitTest.class, "verifyClientSubscriptionStats",
- new Object[] { isvm0Primary, totalEvents });
- vm1.invoke(Bug47388DUnitTest.class, "verifyClientSubscriptionStats",
- new Object[] { !isvm0Primary, totalEvents });
+ vm0.invoke(() -> Bug47388DUnitTest.verifyClientSubscriptionStats( isvm0Primary, totalEvents ));
+ vm1.invoke(() -> Bug47388DUnitTest.verifyClientSubscriptionStats( !isvm0Primary, totalEvents ));
}
public void testNothingBecauseOfBug51931() {
// remove this when bug #51931 is fixed
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/69024aa9/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/Bug51400DUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/Bug51400DUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/Bug51400DUnitTest.java
index 5b08a3e..1715674 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/Bug51400DUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/Bug51400DUnitTest.java
@@ -79,11 +79,11 @@ public class Bug51400DUnitTest extends DistributedTestCase {
protected final void preTearDown() throws Exception {
closeCache();
- client0.invoke(Bug51400DUnitTest.class, "closeCache");
- client1.invoke(Bug51400DUnitTest.class, "closeCache");
+ client0.invoke(() -> Bug51400DUnitTest.closeCache());
+ client1.invoke(() -> Bug51400DUnitTest.closeCache());
- server0.invoke(Bug51400DUnitTest.class, "closeCache");
- server1.invoke(Bug51400DUnitTest.class, "closeCache");
+ server0.invoke(() -> Bug51400DUnitTest.closeCache());
+ server1.invoke(() -> Bug51400DUnitTest.closeCache());
}
public static void closeCache() throws Exception {
@@ -174,22 +174,19 @@ public class Bug51400DUnitTest extends DistributedTestCase {
// Set infinite ack interval so that the queue will not be drained.
int ackInterval = Integer.MAX_VALUE;
- int port1 = (Integer) server0.invoke(Bug51400DUnitTest.class,
- "createServerCache", new Object[] { maxQSize });
+ int port1 = (Integer) server0.invoke(() -> Bug51400DUnitTest.createServerCache( maxQSize ));
client1.invoke(Bug51400DUnitTest.class, "createClientCache",
new Object[] { NetworkUtils.getServerHostName(Host.getHost(0)), new Integer[]{port1}, ackInterval});
// Do puts from server as well as from client on the same key.
- AsyncInvocation ai1 = server0.invokeAsync(Bug51400DUnitTest.class,
- "updateKey", new Object[] { 2 * maxQSize });
- AsyncInvocation ai2 = client1.invokeAsync(Bug51400DUnitTest.class,
- "updateKey", new Object[] { 2 * maxQSize });
+ AsyncInvocation ai1 = server0.invokeAsync(() -> Bug51400DUnitTest.updateKey( 2 * maxQSize ));
+ AsyncInvocation ai2 = client1.invokeAsync(() -> Bug51400DUnitTest.updateKey( 2 * maxQSize ));
ai1.getResult();
ai2.getResult();
// Verify that the queue has crossed its limit of maxQSize
- server0.invoke(Bug51400DUnitTest.class, "verifyQueueSize", new Object[] {
- true, 2 * maxQSize });
+ server0.invoke(() -> Bug51400DUnitTest.verifyQueueSize(
+ true, 2 * maxQSize ));
}
public static void updateKey(Integer num) {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/69024aa9/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/PartitionedRegionLoaderWriterDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/PartitionedRegionLoaderWriterDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/PartitionedRegionLoaderWriterDUnitTest.java
index e06e49a..faa6fb6 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/PartitionedRegionLoaderWriterDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/PartitionedRegionLoaderWriterDUnitTest.java
@@ -66,30 +66,24 @@ public class PartitionedRegionLoaderWriterDUnitTest extends CacheTestCase {
host = Host.getHost(0);
accessor = host.getVM(0);
datastore1 = host.getVM(1);
- accessor.invoke(PartitionedRegionLoaderWriterDUnitTest.class,
- "createRegion", new Object[] {new CacheLoader2(), null, 0});
- datastore1.invoke(PartitionedRegionLoaderWriterDUnitTest.class,
- "createRegion", new Object[] {null, null, 10});
+ accessor.invoke(() -> PartitionedRegionLoaderWriterDUnitTest.createRegion(new CacheLoader2(), null, 0));
+ datastore1.invoke(() -> PartitionedRegionLoaderWriterDUnitTest.createRegion(null, null, 10));
}
public void testWriter_NotOnAccessor_OnDataStore(){
host = Host.getHost(0);
accessor = host.getVM(1);
datastore1 = host.getVM(2);
- accessor.invoke(PartitionedRegionLoaderWriterDUnitTest.class,
- "createRegion", new Object[] {null, null, 0});
- datastore1.invoke(PartitionedRegionLoaderWriterDUnitTest.class,
- "createRegion", new Object[] {null, new CacheWriter2(), 10});
+ accessor.invoke(() -> PartitionedRegionLoaderWriterDUnitTest.createRegion(null, null, 0));
+ datastore1.invoke(() -> PartitionedRegionLoaderWriterDUnitTest.createRegion(null, new CacheWriter2(), 10));
}
public void testWriter_OnDataStore_NotOnAccessor(){
host = Host.getHost(0);
accessor = host.getVM(1);
datastore1 = host.getVM(2);
- datastore1.invoke(PartitionedRegionLoaderWriterDUnitTest.class,
- "createRegion", new Object[] {null, new CacheWriter2(), 10});
- accessor.invoke(PartitionedRegionLoaderWriterDUnitTest.class,
- "createRegion", new Object[] {null, null, 0});
+ datastore1.invoke(() -> PartitionedRegionLoaderWriterDUnitTest.createRegion(null, new CacheWriter2(), 10));
+ accessor.invoke(() -> PartitionedRegionLoaderWriterDUnitTest.createRegion(null, null, 0));
}
public void testLoader_OnAccessor_NotOnFirstDataStore_OnSecondDataStore(){
@@ -97,12 +91,9 @@ public class PartitionedRegionLoaderWriterDUnitTest extends CacheTestCase {
accessor = host.getVM(1);
datastore1 = host.getVM(2);
datastore2 = host.getVM(3);
- accessor.invoke(PartitionedRegionLoaderWriterDUnitTest.class,
- "createRegion", new Object[] {new CacheLoader2(), null, 0});
- datastore1.invoke(PartitionedRegionLoaderWriterDUnitTest.class,
- "createRegion", new Object[] {null, null, 10});
- datastore2.invoke(PartitionedRegionLoaderWriterDUnitTest.class,
- "createRegionWithPossibleFail", new Object[] {new CacheLoader2(),null, 10});
+ accessor.invoke(() -> PartitionedRegionLoaderWriterDUnitTest.createRegion(new CacheLoader2(), null, 0));
+ datastore1.invoke(() -> PartitionedRegionLoaderWriterDUnitTest.createRegion(null, null, 10));
+ datastore2.invoke(() -> PartitionedRegionLoaderWriterDUnitTest.createRegionWithPossibleFail(new CacheLoader2(),null, 10));
}
public void testLoader_NotOnFirstDataStore_OnAccessor_OnSecondDataStore(){
@@ -110,12 +101,9 @@ public class PartitionedRegionLoaderWriterDUnitTest extends CacheTestCase {
accessor = host.getVM(1);
datastore1 = host.getVM(2);
datastore2 = host.getVM(3);
- datastore1.invoke(PartitionedRegionLoaderWriterDUnitTest.class,
- "createRegion", new Object[] {null, null, 10});
- accessor.invoke(PartitionedRegionLoaderWriterDUnitTest.class,
- "createRegion", new Object[] {new CacheLoader2(), null, 0});
- datastore2.invoke(PartitionedRegionLoaderWriterDUnitTest.class,
- "createRegionWithPossibleFail", new Object[] {new CacheLoader2(),null, 10});
+ datastore1.invoke(() -> PartitionedRegionLoaderWriterDUnitTest.createRegion(null, null, 10));
+ accessor.invoke(() -> PartitionedRegionLoaderWriterDUnitTest.createRegion(new CacheLoader2(), null, 0));
+ datastore2.invoke(() -> PartitionedRegionLoaderWriterDUnitTest.createRegionWithPossibleFail(new CacheLoader2(),null, 10));
}
public void testLoader_OnFirstDataStore_OnSecondDataStore_OnAccessor(){
@@ -123,12 +111,9 @@ public class PartitionedRegionLoaderWriterDUnitTest extends CacheTestCase {
accessor = host.getVM(1);
datastore1 = host.getVM(2);
datastore2 = host.getVM(3);
- datastore1.invoke(PartitionedRegionLoaderWriterDUnitTest.class,
- "createRegion", new Object[] {new CacheLoader2(), null, 10});
- datastore2.invoke(PartitionedRegionLoaderWriterDUnitTest.class,
- "createRegion", new Object[] {new CacheLoader2(),null, 10});
- accessor.invoke(PartitionedRegionLoaderWriterDUnitTest.class,
- "createRegion", new Object[] {new CacheLoader2(), null, 0});
+ datastore1.invoke(() -> PartitionedRegionLoaderWriterDUnitTest.createRegion(new CacheLoader2(), null, 10));
+ datastore2.invoke(() -> PartitionedRegionLoaderWriterDUnitTest.createRegion(new CacheLoader2(),null, 10));
+ accessor.invoke(() -> PartitionedRegionLoaderWriterDUnitTest.createRegion(new CacheLoader2(), null, 0));
}
public void testLoader_OnFirstDataStore_OnSecondDataStore_NotOnAccessor(){
@@ -136,12 +121,9 @@ public class PartitionedRegionLoaderWriterDUnitTest extends CacheTestCase {
accessor = host.getVM(1);
datastore1 = host.getVM(2);
datastore2 = host.getVM(3);
- datastore1.invoke(PartitionedRegionLoaderWriterDUnitTest.class,
- "createRegion", new Object[] {new CacheLoader2(), null, 10});
- datastore2.invoke(PartitionedRegionLoaderWriterDUnitTest.class,
- "createRegion", new Object[] {new CacheLoader2(),null, 10});
- accessor.invoke(PartitionedRegionLoaderWriterDUnitTest.class,
- "createRegion", new Object[] {null, null, 0});
+ datastore1.invoke(() -> PartitionedRegionLoaderWriterDUnitTest.createRegion(new CacheLoader2(), null, 10));
+ datastore2.invoke(() -> PartitionedRegionLoaderWriterDUnitTest.createRegion(new CacheLoader2(),null, 10));
+ accessor.invoke(() -> PartitionedRegionLoaderWriterDUnitTest.createRegion(null, null, 0));
}