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:22 UTC
[45/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/PartitionedRegionSingleHopWithServerGroupDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionSingleHopWithServerGroupDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionSingleHopWithServerGroupDUnitTest.java
index 87738b8..5c9e643 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionSingleHopWithServerGroupDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionSingleHopWithServerGroupDUnitTest.java
@@ -128,10 +128,10 @@ public class PartitionedRegionSingleHopWithServerGroupDUnitTest extends CacheTes
@Override
protected final void preTearDownCacheTestCase() throws Exception {
// close the clients first
- member0.invoke(PartitionedRegionSingleHopWithServerGroupDUnitTest.class, "closeCache");
- member1.invoke(PartitionedRegionSingleHopWithServerGroupDUnitTest.class, "closeCache");
- member2.invoke(PartitionedRegionSingleHopWithServerGroupDUnitTest.class, "closeCache");
- member3.invoke(PartitionedRegionSingleHopWithServerGroupDUnitTest.class, "closeCache");
+ member0.invoke(() -> PartitionedRegionSingleHopWithServerGroupDUnitTest.closeCache());
+ member1.invoke(() -> PartitionedRegionSingleHopWithServerGroupDUnitTest.closeCache());
+ member2.invoke(() -> PartitionedRegionSingleHopWithServerGroupDUnitTest.closeCache());
+ member3.invoke(() -> PartitionedRegionSingleHopWithServerGroupDUnitTest.closeCache());
closeCache();
}
@@ -179,16 +179,12 @@ public class PartitionedRegionSingleHopWithServerGroupDUnitTest extends CacheTes
int port3 = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
final String host0 = NetworkUtils.getServerHostName(member3.getHost());
final String locator = host0 + "[" + port3 + "]";
- member3.invoke(PartitionedRegionSingleHopWithServerGroupDUnitTest.class,
- "startLocatorInVM", new Object[] { port3 });
+ member3.invoke(() -> PartitionedRegionSingleHopWithServerGroupDUnitTest.startLocatorInVM( port3 ));
try {
- member0.invoke(PartitionedRegionSingleHopWithServerGroupDUnitTest.class,
- "createServerWithLocatorAndServerGroup", new Object[] { locator, 100,2, 8, "group1" });
- member1.invoke(PartitionedRegionSingleHopWithServerGroupDUnitTest.class,
- "createServerWithLocatorAndServerGroup", new Object[] { locator, 100,2, 8, "group2" });
- member2.invoke(PartitionedRegionSingleHopWithServerGroupDUnitTest.class,
- "createServerWithLocatorAndServerGroup", new Object[] { locator, 100,2, 8, "group2" });
+ member0.invoke(() -> PartitionedRegionSingleHopWithServerGroupDUnitTest.createServerWithLocatorAndServerGroup( locator, 100,2, 8, "group1" ));
+ member1.invoke(() -> PartitionedRegionSingleHopWithServerGroupDUnitTest.createServerWithLocatorAndServerGroup( locator, 100,2, 8, "group2" ));
+ member2.invoke(() -> PartitionedRegionSingleHopWithServerGroupDUnitTest.createServerWithLocatorAndServerGroup( locator, 100,2, 8, "group2" ));
setHonourServerGroupsInPRSingleHop();
createClientWithLocator(host0, port3, "group1");
@@ -205,7 +201,7 @@ public class PartitionedRegionSingleHopWithServerGroupDUnitTest extends CacheTes
resetHonourServerGroupsInPRSingleHop();
}
} finally {
- member3.invoke(PartitionedRegionSingleHopWithServerGroupDUnitTest.class, "stopLocator");
+ member3.invoke(() -> PartitionedRegionSingleHopWithServerGroupDUnitTest.stopLocator());
}
}
@@ -213,16 +209,12 @@ public class PartitionedRegionSingleHopWithServerGroupDUnitTest extends CacheTes
int port3 = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
final String host0 = NetworkUtils.getServerHostName(member3.getHost());
final String locator = host0 + "[" + port3 + "]";
- member3.invoke(PartitionedRegionSingleHopWithServerGroupDUnitTest.class,
- "startLocatorInVM", new Object[] { port3 });
+ member3.invoke(() -> PartitionedRegionSingleHopWithServerGroupDUnitTest.startLocatorInVM( port3 ));
try {
- member0.invoke(PartitionedRegionSingleHopWithServerGroupDUnitTest.class,
- "createServerWithLocatorAndServerGroup", new Object[] { locator, 100,2, 8, "group1" });
- member1.invoke(PartitionedRegionSingleHopWithServerGroupDUnitTest.class,
- "createServerWithLocatorAndServerGroup", new Object[] { locator, 100,2, 8, "group1" });
- member2.invoke(PartitionedRegionSingleHopWithServerGroupDUnitTest.class,
- "createServerWithLocatorAndServerGroup", new Object[] { locator, 100,2, 8, "group2" });
+ member0.invoke(() -> PartitionedRegionSingleHopWithServerGroupDUnitTest.createServerWithLocatorAndServerGroup( locator, 100,2, 8, "group1" ));
+ member1.invoke(() -> PartitionedRegionSingleHopWithServerGroupDUnitTest.createServerWithLocatorAndServerGroup( locator, 100,2, 8, "group1" ));
+ member2.invoke(() -> PartitionedRegionSingleHopWithServerGroupDUnitTest.createServerWithLocatorAndServerGroup( locator, 100,2, 8, "group2" ));
setHonourServerGroupsInPRSingleHop();
createClientWithLocator(host0, port3, "group1");
@@ -239,7 +231,7 @@ public class PartitionedRegionSingleHopWithServerGroupDUnitTest extends CacheTes
resetHonourServerGroupsInPRSingleHop();
}
} finally {
- member3.invoke(PartitionedRegionSingleHopWithServerGroupDUnitTest.class, "stopLocator");
+ member3.invoke(() -> PartitionedRegionSingleHopWithServerGroupDUnitTest.stopLocator());
}
}
@@ -247,16 +239,12 @@ public class PartitionedRegionSingleHopWithServerGroupDUnitTest extends CacheTes
int port3 = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
final String host0 = NetworkUtils.getServerHostName(member3.getHost());
final String locator = host0 + "[" + port3 + "]";
- member3.invoke(PartitionedRegionSingleHopWithServerGroupDUnitTest.class,
- "startLocatorInVM", new Object[] { port3 });
+ member3.invoke(() -> PartitionedRegionSingleHopWithServerGroupDUnitTest.startLocatorInVM( port3 ));
try {
- member0.invoke(PartitionedRegionSingleHopWithServerGroupDUnitTest.class,
- "createServerWithLocatorAndServerGroup", new Object[] { locator, 100,2, 8, "group1" });
- member1.invoke(PartitionedRegionSingleHopWithServerGroupDUnitTest.class,
- "createServerWithLocatorAndServerGroup", new Object[] { locator, 100,2, 8, "group1" });
- member2.invoke(PartitionedRegionSingleHopWithServerGroupDUnitTest.class,
- "createServerWithLocatorAndServerGroup", new Object[] { locator, 100,2, 8, "group2" });
+ member0.invoke(() -> PartitionedRegionSingleHopWithServerGroupDUnitTest.createServerWithLocatorAndServerGroup( locator, 100,2, 8, "group1" ));
+ member1.invoke(() -> PartitionedRegionSingleHopWithServerGroupDUnitTest.createServerWithLocatorAndServerGroup( locator, 100,2, 8, "group1" ));
+ member2.invoke(() -> PartitionedRegionSingleHopWithServerGroupDUnitTest.createServerWithLocatorAndServerGroup( locator, 100,2, 8, "group2" ));
createClientWithLocator(host0, port3, "group1");
@@ -268,7 +256,7 @@ public class PartitionedRegionSingleHopWithServerGroupDUnitTest extends CacheTes
verifyMetadata(4,3);
}
finally{
- member3.invoke(PartitionedRegionSingleHopWithServerGroupDUnitTest.class, "stopLocator");
+ member3.invoke(() -> PartitionedRegionSingleHopWithServerGroupDUnitTest.stopLocator());
}
}
@@ -276,16 +264,12 @@ public class PartitionedRegionSingleHopWithServerGroupDUnitTest extends CacheTes
int port3 = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
final String host0 = NetworkUtils.getServerHostName(member3.getHost());
final String locator = host0 + "[" + port3 + "]";
- member3.invoke(PartitionedRegionSingleHopWithServerGroupDUnitTest.class,
- "startLocatorInVM", new Object[] { port3 });
+ member3.invoke(() -> PartitionedRegionSingleHopWithServerGroupDUnitTest.startLocatorInVM( port3 ));
try {
- member0.invoke(PartitionedRegionSingleHopWithServerGroupDUnitTest.class,
- "createServerWithLocatorAndServerGroup", new Object[] { locator, 0,2, 8, "group1" });
- member1.invoke(PartitionedRegionSingleHopWithServerGroupDUnitTest.class,
- "createServerWithLocatorAndServerGroup", new Object[] { locator, 100,2, 8, "group2" });
- member2.invoke(PartitionedRegionSingleHopWithServerGroupDUnitTest.class,
- "createServerWithLocatorAndServerGroup", new Object[] { locator, 100,2, 8, "group2" });
+ member0.invoke(() -> PartitionedRegionSingleHopWithServerGroupDUnitTest.createServerWithLocatorAndServerGroup( locator, 0,2, 8, "group1" ));
+ member1.invoke(() -> PartitionedRegionSingleHopWithServerGroupDUnitTest.createServerWithLocatorAndServerGroup( locator, 100,2, 8, "group2" ));
+ member2.invoke(() -> PartitionedRegionSingleHopWithServerGroupDUnitTest.createServerWithLocatorAndServerGroup( locator, 100,2, 8, "group2" ));
setHonourServerGroupsInPRSingleHop();
createClientWithLocator(host0, port3, "group1");
@@ -301,7 +285,7 @@ public class PartitionedRegionSingleHopWithServerGroupDUnitTest extends CacheTes
resetHonourServerGroupsInPRSingleHop();
}
} finally {
- member3.invoke(PartitionedRegionSingleHopWithServerGroupDUnitTest.class, "stopLocator");
+ member3.invoke(() -> PartitionedRegionSingleHopWithServerGroupDUnitTest.stopLocator());
}
}
@@ -309,19 +293,15 @@ public class PartitionedRegionSingleHopWithServerGroupDUnitTest extends CacheTes
int port3 = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
final String host0 = NetworkUtils.getServerHostName(member3.getHost());
final String locator = host0 + "[" + port3 + "]";
- member3.invoke(PartitionedRegionSingleHopWithServerGroupDUnitTest.class,
- "startLocatorInVM", new Object[] { port3 });
+ member3.invoke(() -> PartitionedRegionSingleHopWithServerGroupDUnitTest.startLocatorInVM( port3 ));
try {
- member0.invoke(PartitionedRegionSingleHopWithServerGroupDUnitTest.class,
- "createServerWithLocatorAndServerGroup", new Object[] { locator, 100,
- 2, 8, "group1" });
- member1.invoke(PartitionedRegionSingleHopWithServerGroupDUnitTest.class,
- "createServerWithLocatorAndServerGroup", new Object[] { locator, 100,
- 2, 8, "group1" });
- member2.invoke(PartitionedRegionSingleHopWithServerGroupDUnitTest.class,
- "createServerWithLocatorAndServerGroup", new Object[] { locator, 100,
- 2, 8, "group1,group2" });
+ member0.invoke(() -> PartitionedRegionSingleHopWithServerGroupDUnitTest.createServerWithLocatorAndServerGroup( locator, 100,
+ 2, 8, "group1" ));
+ member1.invoke(() -> PartitionedRegionSingleHopWithServerGroupDUnitTest.createServerWithLocatorAndServerGroup( locator, 100,
+ 2, 8, "group1" ));
+ member2.invoke(() -> PartitionedRegionSingleHopWithServerGroupDUnitTest.createServerWithLocatorAndServerGroup( locator, 100,
+ 2, 8, "group1,group2" ));
setHonourServerGroupsInPRSingleHop();
createClientWithLocator(host0, port3, "group1");
@@ -337,8 +317,7 @@ public class PartitionedRegionSingleHopWithServerGroupDUnitTest extends CacheTes
resetHonourServerGroupsInPRSingleHop();
}
} finally {
- member3.invoke(PartitionedRegionSingleHopWithServerGroupDUnitTest.class,
- "stopLocator");
+ member3.invoke(() -> PartitionedRegionSingleHopWithServerGroupDUnitTest.stopLocator());
}
@@ -348,16 +327,12 @@ public class PartitionedRegionSingleHopWithServerGroupDUnitTest extends CacheTes
int port3 = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
final String host0 = NetworkUtils.getServerHostName(member3.getHost());
final String locator = host0 + "[" + port3 + "]";
- member3.invoke(PartitionedRegionSingleHopWithServerGroupDUnitTest.class,
- "startLocatorInVM", new Object[] { port3 });
+ member3.invoke(() -> PartitionedRegionSingleHopWithServerGroupDUnitTest.startLocatorInVM( port3 ));
try {
- member0.invoke(PartitionedRegionSingleHopWithServerGroupDUnitTest.class,
- "createServerWithLocatorAndServerGroup", new Object[] { locator, 100,2, 8, "group1" });
- member1.invoke(PartitionedRegionSingleHopWithServerGroupDUnitTest.class,
- "createServerWithLocatorAndServerGroup", new Object[] { locator, 100,2, 8, "group2" });
- member2.invoke(PartitionedRegionSingleHopWithServerGroupDUnitTest.class,
- "createServerWithLocatorAndServerGroup", new Object[] { locator, 100,2, 8, "" });
+ member0.invoke(() -> PartitionedRegionSingleHopWithServerGroupDUnitTest.createServerWithLocatorAndServerGroup( locator, 100,2, 8, "group1" ));
+ member1.invoke(() -> PartitionedRegionSingleHopWithServerGroupDUnitTest.createServerWithLocatorAndServerGroup( locator, 100,2, 8, "group2" ));
+ member2.invoke(() -> PartitionedRegionSingleHopWithServerGroupDUnitTest.createServerWithLocatorAndServerGroup( locator, 100,2, 8, "" ));
setHonourServerGroupsInPRSingleHop();
createClientWithLocator(host0, port3, "group1");
@@ -373,7 +348,7 @@ public class PartitionedRegionSingleHopWithServerGroupDUnitTest extends CacheTes
resetHonourServerGroupsInPRSingleHop();
}
} finally {
- member3.invoke(PartitionedRegionSingleHopWithServerGroupDUnitTest.class, "stopLocator");
+ member3.invoke(() -> PartitionedRegionSingleHopWithServerGroupDUnitTest.stopLocator());
}
}
@@ -381,16 +356,12 @@ public class PartitionedRegionSingleHopWithServerGroupDUnitTest extends CacheTes
int port3 = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
final String host0 = NetworkUtils.getServerHostName(member3.getHost());
final String locator = host0 + "[" + port3 + "]";
- member3.invoke(PartitionedRegionSingleHopWithServerGroupDUnitTest.class,
- "startLocatorInVM", new Object[] { port3 });
+ member3.invoke(() -> PartitionedRegionSingleHopWithServerGroupDUnitTest.startLocatorInVM( port3 ));
try {
- member0.invoke(PartitionedRegionSingleHopWithServerGroupDUnitTest.class,
- "createServerWithLocatorAndServerGroup", new Object[] { locator, 100,2, 8, "group1" });
- member1.invoke(PartitionedRegionSingleHopWithServerGroupDUnitTest.class,
- "createServerWithLocatorAndServerGroup", new Object[] { locator, 100,2, 8, "group2" });
- member2.invoke(PartitionedRegionSingleHopWithServerGroupDUnitTest.class,
- "createServerWithLocatorAndServerGroup", new Object[] { locator, 100,2, 8, "group3" });
+ member0.invoke(() -> PartitionedRegionSingleHopWithServerGroupDUnitTest.createServerWithLocatorAndServerGroup( locator, 100,2, 8, "group1" ));
+ member1.invoke(() -> PartitionedRegionSingleHopWithServerGroupDUnitTest.createServerWithLocatorAndServerGroup( locator, 100,2, 8, "group2" ));
+ member2.invoke(() -> PartitionedRegionSingleHopWithServerGroupDUnitTest.createServerWithLocatorAndServerGroup( locator, 100,2, 8, "group3" ));
setHonourServerGroupsInPRSingleHop();
createClientWithLocator(host0, port3, "");
@@ -405,8 +376,7 @@ public class PartitionedRegionSingleHopWithServerGroupDUnitTest extends CacheTes
resetHonourServerGroupsInPRSingleHop();
}
} finally {
- member3.invoke(PartitionedRegionSingleHopWithServerGroupDUnitTest.class,
- "stopLocator");
+ member3.invoke(() -> PartitionedRegionSingleHopWithServerGroupDUnitTest.stopLocator());
}
}
@@ -414,46 +384,36 @@ public class PartitionedRegionSingleHopWithServerGroupDUnitTest extends CacheTes
int port3 = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
final String host0 = NetworkUtils.getServerHostName(member3.getHost());
final String locator = host0 + "[" + port3 + "]";
- member3.invoke(PartitionedRegionSingleHopWithServerGroupDUnitTest.class,
- "startLocatorInVM", new Object[] { port3 });
+ member3.invoke(() -> PartitionedRegionSingleHopWithServerGroupDUnitTest.startLocatorInVM( port3 ));
try {
- member0.invoke(PartitionedRegionSingleHopWithServerGroupDUnitTest.class,
- "createServerWithLocatorAndServerGroup", new Object[] { locator, 100,2, 8, "group1" });
- member1.invoke(PartitionedRegionSingleHopWithServerGroupDUnitTest.class,
- "createServerWithLocatorAndServerGroup", new Object[] { locator, 100,2, 8, "group2" });
+ member0.invoke(() -> PartitionedRegionSingleHopWithServerGroupDUnitTest.createServerWithLocatorAndServerGroup( locator, 100,2, 8, "group1" ));
+ member1.invoke(() -> PartitionedRegionSingleHopWithServerGroupDUnitTest.createServerWithLocatorAndServerGroup( locator, 100,2, 8, "group2" ));
- member2.invoke(PartitionedRegionSingleHopWithServerGroupDUnitTest.class,
- "setHonourServerGroupsInPRSingleHop", new Object[] {});
+ member2.invoke(() -> PartitionedRegionSingleHopWithServerGroupDUnitTest.setHonourServerGroupsInPRSingleHop());
- member2.invoke(PartitionedRegionSingleHopWithServerGroupDUnitTest.class,
- "createClientWithLocator", new Object[] {host0,port3,"group1"});
+ member2.invoke(() -> PartitionedRegionSingleHopWithServerGroupDUnitTest.createClientWithLocator(host0,port3,"group1"));
setHonourServerGroupsInPRSingleHop();
createClientWithLocator(host0, port3, "");
- member2.invoke(PartitionedRegionSingleHopWithServerGroupDUnitTest.class,
- "putIntoPartitionedRegions", new Object[] {});
+ member2.invoke(() -> PartitionedRegionSingleHopWithServerGroupDUnitTest.putIntoPartitionedRegions());
putIntoPartitionedRegions();
getFromPartitionedRegions();
- member2.invoke(PartitionedRegionSingleHopWithServerGroupDUnitTest.class,
- "getFromPartitionedRegions", new Object[] {});
+ member2.invoke(() -> PartitionedRegionSingleHopWithServerGroupDUnitTest.getFromPartitionedRegions());
try {
verifyMetadata(4, 2);
- member2.invoke(PartitionedRegionSingleHopWithServerGroupDUnitTest.class,
- "verifyMetadata", new Object[] {new Integer(4),new Integer(1)});
+ member2.invoke(() -> PartitionedRegionSingleHopWithServerGroupDUnitTest.verifyMetadata(new Integer(4),new Integer(1)));
} finally {
resetHonourServerGroupsInPRSingleHop();
- member2.invoke(PartitionedRegionSingleHopWithServerGroupDUnitTest.class,
- "resetHonourServerGroupsInPRSingleHop", new Object[] {});
+ member2.invoke(() -> PartitionedRegionSingleHopWithServerGroupDUnitTest.resetHonourServerGroupsInPRSingleHop());
}
} finally {
- member3.invoke(PartitionedRegionSingleHopWithServerGroupDUnitTest.class,
- "stopLocator");
+ member3.invoke(() -> PartitionedRegionSingleHopWithServerGroupDUnitTest.stopLocator());
}
}
@@ -461,43 +421,33 @@ public class PartitionedRegionSingleHopWithServerGroupDUnitTest extends CacheTes
int port3 = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
final String host0 = NetworkUtils.getServerHostName(member3.getHost());
final String locator = host0 + "[" + port3 + "]";
- member3.invoke(PartitionedRegionSingleHopWithServerGroupDUnitTest.class,
- "startLocatorInVM", new Object[] { port3 });
+ member3.invoke(() -> PartitionedRegionSingleHopWithServerGroupDUnitTest.startLocatorInVM( port3 ));
try {
- member0.invoke(PartitionedRegionSingleHopWithServerGroupDUnitTest.class,
- "createServerWithLocatorAndServerGroup", new Object[] { locator, 100,2, 8, "group1,group2" });
- member1.invoke(PartitionedRegionSingleHopWithServerGroupDUnitTest.class,
- "createServerWithLocatorAndServerGroup", new Object[] { locator, 100,2, 8, "group2" });
+ member0.invoke(() -> PartitionedRegionSingleHopWithServerGroupDUnitTest.createServerWithLocatorAndServerGroup( locator, 100,2, 8, "group1,group2" ));
+ member1.invoke(() -> PartitionedRegionSingleHopWithServerGroupDUnitTest.createServerWithLocatorAndServerGroup( locator, 100,2, 8, "group2" ));
- member2.invoke(PartitionedRegionSingleHopWithServerGroupDUnitTest.class,
- "setHonourServerGroupsInPRSingleHop", new Object[] {});
+ member2.invoke(() -> PartitionedRegionSingleHopWithServerGroupDUnitTest.setHonourServerGroupsInPRSingleHop());
- member2.invoke(PartitionedRegionSingleHopWithServerGroupDUnitTest.class,
- "createClientWithLocator", new Object[] {host0,port3,"group1"});
+ member2.invoke(() -> PartitionedRegionSingleHopWithServerGroupDUnitTest.createClientWithLocator(host0,port3,"group1"));
setHonourServerGroupsInPRSingleHop();
createClientWithLocator(host0, port3, "group2");
- member2.invoke(PartitionedRegionSingleHopWithServerGroupDUnitTest.class,
- "putIntoPartitionedRegions", new Object[] {});
+ member2.invoke(() -> PartitionedRegionSingleHopWithServerGroupDUnitTest.putIntoPartitionedRegions());
putIntoPartitionedRegions();
- member2.invoke(PartitionedRegionSingleHopWithServerGroupDUnitTest.class,
- "getFromPartitionedRegions", new Object[] {});
+ member2.invoke(() -> PartitionedRegionSingleHopWithServerGroupDUnitTest.getFromPartitionedRegions());
getFromPartitionedRegions();
try {
verifyMetadata(4, 2);
- member2.invoke(PartitionedRegionSingleHopWithServerGroupDUnitTest.class,
- "verifyMetadata", new Object[] {new Integer(4),new Integer(1)});
+ member2.invoke(() -> PartitionedRegionSingleHopWithServerGroupDUnitTest.verifyMetadata(new Integer(4),new Integer(1)));
} finally {
resetHonourServerGroupsInPRSingleHop();
- member2.invoke(PartitionedRegionSingleHopWithServerGroupDUnitTest.class,
- "resetHonourServerGroupsInPRSingleHop", new Object[] {});
+ member2.invoke(() -> PartitionedRegionSingleHopWithServerGroupDUnitTest.resetHonourServerGroupsInPRSingleHop());
}
} finally {
- member3.invoke(PartitionedRegionSingleHopWithServerGroupDUnitTest.class,
- "stopLocator");
+ member3.invoke(() -> PartitionedRegionSingleHopWithServerGroupDUnitTest.stopLocator());
}
}
@@ -505,38 +455,30 @@ public class PartitionedRegionSingleHopWithServerGroupDUnitTest extends CacheTes
int port3 = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
final String host0 = NetworkUtils.getServerHostName(member3.getHost());
final String locator = host0 + "[" + port3 + "]";
- member3.invoke(PartitionedRegionSingleHopWithServerGroupDUnitTest.class,
- "startLocatorInVM", new Object[] { port3 });
+ member3.invoke(() -> PartitionedRegionSingleHopWithServerGroupDUnitTest.startLocatorInVM( port3 ));
try {
- member0.invoke(PartitionedRegionSingleHopWithServerGroupDUnitTest.class,
- "createServerWithLocatorAndServerGroup", new Object[] { locator, 100,2, 8, "group1,group2" });
- member1.invoke(PartitionedRegionSingleHopWithServerGroupDUnitTest.class,
- "createServerWithLocatorAndServerGroup", new Object[] { locator, 100,2, 8, "group2" });
+ member0.invoke(() -> PartitionedRegionSingleHopWithServerGroupDUnitTest.createServerWithLocatorAndServerGroup( locator, 100,2, 8, "group1,group2" ));
+ member1.invoke(() -> PartitionedRegionSingleHopWithServerGroupDUnitTest.createServerWithLocatorAndServerGroup( locator, 100,2, 8, "group2" ));
- member2.invoke(PartitionedRegionSingleHopWithServerGroupDUnitTest.class,
- "createClientWithLocator", new Object[] {host0,port3,"group1"});
+ member2.invoke(() -> PartitionedRegionSingleHopWithServerGroupDUnitTest.createClientWithLocator(host0,port3,"group1"));
setHonourServerGroupsInPRSingleHop();
createClientWithLocator(host0, port3, "group2");
- member2.invoke(PartitionedRegionSingleHopWithServerGroupDUnitTest.class,
- "putIntoPartitionedRegions", new Object[] {});
+ member2.invoke(() -> PartitionedRegionSingleHopWithServerGroupDUnitTest.putIntoPartitionedRegions());
putIntoPartitionedRegions();
- member2.invoke(PartitionedRegionSingleHopWithServerGroupDUnitTest.class,
- "getFromPartitionedRegions", new Object[] {});
+ member2.invoke(() -> PartitionedRegionSingleHopWithServerGroupDUnitTest.getFromPartitionedRegions());
getFromPartitionedRegions();
try {
verifyMetadata(4, 2);
- member2.invoke(PartitionedRegionSingleHopWithServerGroupDUnitTest.class,
- "verifyMetadata", new Object[] {new Integer(4),new Integer(2)});
+ member2.invoke(() -> PartitionedRegionSingleHopWithServerGroupDUnitTest.verifyMetadata(new Integer(4),new Integer(2)));
} finally {
resetHonourServerGroupsInPRSingleHop();
}
} finally {
- member3.invoke(PartitionedRegionSingleHopWithServerGroupDUnitTest.class,
- "stopLocator");
+ member3.invoke(() -> PartitionedRegionSingleHopWithServerGroupDUnitTest.stopLocator());
}
}
@@ -544,43 +486,33 @@ public class PartitionedRegionSingleHopWithServerGroupDUnitTest extends CacheTes
int port3 = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
final String host0 = NetworkUtils.getServerHostName(member3.getHost());
final String locator = host0 + "[" + port3 + "]";
- member3.invoke(PartitionedRegionSingleHopWithServerGroupDUnitTest.class,
- "startLocatorInVM", new Object[] { port3 });
+ member3.invoke(() -> PartitionedRegionSingleHopWithServerGroupDUnitTest.startLocatorInVM( port3 ));
try {
- member0.invoke(PartitionedRegionSingleHopWithServerGroupDUnitTest.class,
- "createServerWithLocatorAndServerGroup2Regions", new Object[] { locator, 100,2, 8, "group1,group2" });
- member1.invoke(PartitionedRegionSingleHopWithServerGroupDUnitTest.class,
- "createServerWithLocatorAndServerGroup2Regions", new Object[] { locator, 100,2, 8, "group2" });
+ member0.invoke(() -> PartitionedRegionSingleHopWithServerGroupDUnitTest.createServerWithLocatorAndServerGroup2Regions( locator, 100,2, 8, "group1,group2" ));
+ member1.invoke(() -> PartitionedRegionSingleHopWithServerGroupDUnitTest.createServerWithLocatorAndServerGroup2Regions( locator, 100,2, 8, "group2" ));
- member2.invoke(PartitionedRegionSingleHopWithServerGroupDUnitTest.class,
- "setHonourServerGroupsInPRSingleHop", new Object[] {});
+ member2.invoke(() -> PartitionedRegionSingleHopWithServerGroupDUnitTest.setHonourServerGroupsInPRSingleHop());
- member2.invoke(PartitionedRegionSingleHopWithServerGroupDUnitTest.class,
- "create2ClientWithLocator", new Object[] {host0,port3,"group1",""});
+ member2.invoke(() -> PartitionedRegionSingleHopWithServerGroupDUnitTest.create2ClientWithLocator(host0,port3,"group1",""));
setHonourServerGroupsInPRSingleHop();
create2ClientWithLocator(host0, port3, "group2","group1");
- member2.invoke(PartitionedRegionSingleHopWithServerGroupDUnitTest.class,
- "putIntoPartitionedRegions2Client", new Object[] {});
+ member2.invoke(() -> PartitionedRegionSingleHopWithServerGroupDUnitTest.putIntoPartitionedRegions2Client());
putIntoPartitionedRegions2Client();
- member2.invoke(PartitionedRegionSingleHopWithServerGroupDUnitTest.class,
- "getFromPartitionedRegions2Client", new Object[] {});
+ member2.invoke(() -> PartitionedRegionSingleHopWithServerGroupDUnitTest.getFromPartitionedRegions2Client());
getFromPartitionedRegions2Client();
try {
verifyMetadataFor2ClientsInOneVM(8, 2, 1);
- member2.invoke(PartitionedRegionSingleHopWithServerGroupDUnitTest.class,
- "verifyMetadataFor2ClientsInOneVM", new Object[] {new Integer(8),new Integer(1), new Integer(2)});
+ member2.invoke(() -> PartitionedRegionSingleHopWithServerGroupDUnitTest.verifyMetadataFor2ClientsInOneVM(new Integer(8),new Integer(1), new Integer(2)));
} finally {
resetHonourServerGroupsInPRSingleHop();
- member2.invoke(PartitionedRegionSingleHopWithServerGroupDUnitTest.class,
- "resetHonourServerGroupsInPRSingleHop", new Object[] {});
+ member2.invoke(() -> PartitionedRegionSingleHopWithServerGroupDUnitTest.resetHonourServerGroupsInPRSingleHop());
}
} finally {
- member3.invoke(PartitionedRegionSingleHopWithServerGroupDUnitTest.class,
- "stopLocator");
+ member3.invoke(() -> PartitionedRegionSingleHopWithServerGroupDUnitTest.stopLocator());
}
}
@@ -588,18 +520,14 @@ public class PartitionedRegionSingleHopWithServerGroupDUnitTest extends CacheTes
int port3 = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
final String host0 = NetworkUtils.getServerHostName(member3.getHost());
final String locator = host0 + "[" + port3 + "]";
- member3.invoke(PartitionedRegionSingleHopWithServerGroupDUnitTest.class,
- "startLocatorInVM", new Object[] { port3 });
+ member3.invoke(() -> PartitionedRegionSingleHopWithServerGroupDUnitTest.startLocatorInVM( port3 ));
try {
- member0.invoke(PartitionedRegionSingleHopWithServerGroupDUnitTest.class,
- "createServerWithLocatorAndServerGroup", new Object[] { locator, 100,2, 8, "group1,group2" });
+ member0.invoke(() -> PartitionedRegionSingleHopWithServerGroupDUnitTest.createServerWithLocatorAndServerGroup( locator, 100,2, 8, "group1,group2" ));
- member1.invoke(PartitionedRegionSingleHopWithServerGroupDUnitTest.class,
- "createServerWithLocatorAndServerGroup", new Object[] { locator, 100,2, 8, "group2" });
+ member1.invoke(() -> PartitionedRegionSingleHopWithServerGroupDUnitTest.createServerWithLocatorAndServerGroup( locator, 100,2, 8, "group2" ));
- member2.invoke(PartitionedRegionSingleHopWithServerGroupDUnitTest.class,
- "createServerWithLocatorAndServerGroup", new Object[] { locator, 100,2, 8, "group3" });
+ member2.invoke(() -> PartitionedRegionSingleHopWithServerGroupDUnitTest.createServerWithLocatorAndServerGroup( locator, 100,2, 8, "group3" ));
setHonourServerGroupsInPRSingleHop();
createClientWith3PoolLocator(host0, port3, "group2","group1","");
@@ -612,8 +540,7 @@ public class PartitionedRegionSingleHopWithServerGroupDUnitTest extends CacheTes
resetHonourServerGroupsInPRSingleHop();
}
} finally {
- member3.invoke(PartitionedRegionSingleHopWithServerGroupDUnitTest.class,
- "stopLocator");
+ member3.invoke(() -> PartitionedRegionSingleHopWithServerGroupDUnitTest.stopLocator());
}
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/69024aa9/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PutAllDAckDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PutAllDAckDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PutAllDAckDUnitTest.java
index 7fd0c16..ba8fd66 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PutAllDAckDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PutAllDAckDUnitTest.java
@@ -71,8 +71,8 @@ public class PutAllDAckDUnitTest extends DistributedTestCase {
Host host = Host.getHost(0);
VM vm0 = host.getVM(0);
VM vm1 = host.getVM(1);
- vm0.invoke(PutAllDAckDUnitTest.class, "createCacheForVM0");
- vm1.invoke(PutAllDAckDUnitTest.class, "createCacheForVM1");
+ vm0.invoke(() -> PutAllDAckDUnitTest.createCacheForVM0());
+ vm1.invoke(() -> PutAllDAckDUnitTest.createCacheForVM1());
LogWriterUtils.getLogWriter().fine("Cache created successfully");
}
@@ -81,8 +81,8 @@ public class PutAllDAckDUnitTest extends DistributedTestCase {
Host host = Host.getHost(0);
VM vm0 = host.getVM(0);
VM vm1 = host.getVM(1);
- vm0.invoke(PutAllDAckDUnitTest.class, "closeCache");
- vm1.invoke(PutAllDAckDUnitTest.class, "closeCache");
+ vm0.invoke(() -> PutAllDAckDUnitTest.closeCache());
+ vm1.invoke(() -> PutAllDAckDUnitTest.closeCache());
}
public static void createCacheForVM0() throws Exception {
@@ -124,8 +124,8 @@ public class PutAllDAckDUnitTest extends DistributedTestCase {
objArr[0] = ""+i;
vm0.invoke(PutAllDAckDUnitTest.class, "putMethod", objArr);
}
- vm0.invoke(PutAllDAckDUnitTest.class, "putAllMethod");
- flag = vm1.invokeBoolean(PutAllDAckDUnitTest.class,"getFlagVM1");
+ vm0.invoke(() -> PutAllDAckDUnitTest.putAllMethod());
+ flag = vm1.invoke(() -> PutAllDAckDUnitTest.getFlagVM1());
vm1.invoke(new CacheSerializableRunnable("temp1"){
public void run2() throws CacheException{
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/69024aa9/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PutAllGlobalDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PutAllGlobalDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PutAllGlobalDUnitTest.java
index c8f0d39..8326ec5 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PutAllGlobalDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PutAllGlobalDUnitTest.java
@@ -87,8 +87,8 @@ public class PutAllGlobalDUnitTest extends DistributedTestCase {
Host host = Host.getHost(0);
VM vm0 = host.getVM(0);
VM vm1 = host.getVM(1);
- vm0.invoke(PutAllGlobalDUnitTest.class, "createCacheForVM0");
- vm1.invoke(PutAllGlobalDUnitTest.class, "createCacheForVM1");
+ vm0.invoke(() -> PutAllGlobalDUnitTest.createCacheForVM0());
+ vm1.invoke(() -> PutAllGlobalDUnitTest.createCacheForVM1());
LogWriterUtils.getLogWriter().fine("Cache created successfully");
}
@@ -97,8 +97,8 @@ public class PutAllGlobalDUnitTest extends DistributedTestCase {
Host host = Host.getHost(0);
VM vm0 = host.getVM(0);
VM vm1 = host.getVM(1);
- vm0.invoke(PutAllGlobalDUnitTest.class, "closeCache");
- vm1.invoke(PutAllGlobalDUnitTest.class, "closeCache");
+ vm0.invoke(() -> PutAllGlobalDUnitTest.closeCache());
+ vm1.invoke(() -> PutAllGlobalDUnitTest.closeCache());
cache = null;
Invoke.invokeInEveryVM(new SerializableRunnable() { public void run() { cache = null; } });
}
@@ -156,9 +156,9 @@ public class PutAllGlobalDUnitTest extends DistributedTestCase {
VM vm0 = host.getVM(0);
VM vm1 = host.getVM(1);
- final int socketPort = vm0.invokeInt(this.getClass(), "openSocket");
+ final int socketPort = vm0.invoke(() -> this.openSocket());
- AsyncInvocation async1 = vm0.invokeAsync(this.getClass(),"putAllMethod");
+ AsyncInvocation async1 = vm0.invokeAsync(() -> this.putAllMethod());
AsyncInvocation async2 = vm1.invokeAsync( new CacheSerializableRunnable("put from another vm") {
public void run2() throws CacheException {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/69024aa9/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/RemoveAllDAckDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/RemoveAllDAckDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/RemoveAllDAckDUnitTest.java
index 9184d94..5f51cbd 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/RemoveAllDAckDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/RemoveAllDAckDUnitTest.java
@@ -68,8 +68,8 @@ public class RemoveAllDAckDUnitTest extends DistributedTestCase {
Host host = Host.getHost(0);
VM vm0 = host.getVM(0);
VM vm1 = host.getVM(1);
- vm0.invoke(RemoveAllDAckDUnitTest.class, "createCacheForVM0");
- vm1.invoke(RemoveAllDAckDUnitTest.class, "createCacheForVM1");
+ vm0.invoke(() -> RemoveAllDAckDUnitTest.createCacheForVM0());
+ vm1.invoke(() -> RemoveAllDAckDUnitTest.createCacheForVM1());
LogWriterUtils.getLogWriter().fine("Cache created successfully");
}
@@ -78,8 +78,8 @@ public class RemoveAllDAckDUnitTest extends DistributedTestCase {
Host host = Host.getHost(0);
VM vm0 = host.getVM(0);
VM vm1 = host.getVM(1);
- vm0.invoke(RemoveAllDAckDUnitTest.class, "closeCache");
- vm1.invoke(RemoveAllDAckDUnitTest.class, "closeCache");
+ vm0.invoke(() -> RemoveAllDAckDUnitTest.closeCache());
+ vm1.invoke(() -> RemoveAllDAckDUnitTest.closeCache());
}
public static void createCacheForVM0() throws Exception {
@@ -121,8 +121,8 @@ public class RemoveAllDAckDUnitTest extends DistributedTestCase {
objArr[0] = ""+i;
vm0.invoke(RemoveAllDAckDUnitTest.class, "putMethod", objArr);
}
- vm0.invoke(RemoveAllDAckDUnitTest.class, "removeAllMethod");
- flag = vm1.invokeBoolean(RemoveAllDAckDUnitTest.class,"getFlagVM1");
+ vm0.invoke(() -> RemoveAllDAckDUnitTest.removeAllMethod());
+ flag = vm1.invoke(() -> RemoveAllDAckDUnitTest.getFlagVM1());
assertEquals(true, flag);
vm1.invoke(new CacheSerializableRunnable("temp1"){
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/69024aa9/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/RemoveDAckDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/RemoveDAckDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/RemoveDAckDUnitTest.java
index 4b92161..5f60779 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/RemoveDAckDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/RemoveDAckDUnitTest.java
@@ -64,8 +64,8 @@ public class RemoveDAckDUnitTest extends DistributedTestCase {
Host host = Host.getHost(0);
VM vm0 = host.getVM(0);
VM vm1 = host.getVM(1);
- vm0.invoke(RemoveDAckDUnitTest.class, "createCacheVM0");
- vm1.invoke(RemoveDAckDUnitTest.class, "createCacheVM1");
+ vm0.invoke(() -> RemoveDAckDUnitTest.createCacheVM0());
+ vm1.invoke(() -> RemoveDAckDUnitTest.createCacheVM1());
LogWriterUtils.getLogWriter().fine("Cache created in successfully");
}
@@ -74,8 +74,8 @@ public class RemoveDAckDUnitTest extends DistributedTestCase {
Host host = Host.getHost(0);
VM vm0 = host.getVM(0);
VM vm1 = host.getVM(1);
- vm0.invoke(RemoveDAckDUnitTest.class, "closeCache");
- vm1.invoke(RemoveDAckDUnitTest.class, "closeCache");
+ vm0.invoke(() -> RemoveDAckDUnitTest.closeCache());
+ vm1.invoke(() -> RemoveDAckDUnitTest.closeCache());
}
public static void createCacheVM0(){
@@ -141,7 +141,7 @@ public class RemoveDAckDUnitTest extends DistributedTestCase {
objArr[0] = new Integer(i);
vm0.invoke(RemoveDAckDUnitTest.class,"removeMethod", objArr);
- int Regsize = vm1.invokeInt(RemoveDAckDUnitTest.class, "sizeMethod");
+ int Regsize = vm1.invoke(() -> RemoveDAckDUnitTest.sizeMethod());
assertEquals(3, Regsize);
}//end of test case
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/69024aa9/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/RemoveGlobalDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/RemoveGlobalDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/RemoveGlobalDUnitTest.java
index 5d6131c..c25c24d 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/RemoveGlobalDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/RemoveGlobalDUnitTest.java
@@ -69,16 +69,16 @@ public class RemoveGlobalDUnitTest extends DistributedTestCase {
Host host = Host.getHost(0);
vm0 = host.getVM(0);
vm1 = host.getVM(1);
- vm0.invoke(RemoveGlobalDUnitTest.class, "createCache");
- vm1.invoke(RemoveGlobalDUnitTest.class, "createCache");
+ vm0.invoke(() -> RemoveGlobalDUnitTest.createCache());
+ vm1.invoke(() -> RemoveGlobalDUnitTest.createCache());
}
@Override
protected final void preTearDown() throws Exception {
- vm0.invoke(RemoveGlobalDUnitTest.class, "resetFlag");
- vm1.invoke(RemoveGlobalDUnitTest.class, "resetFlag");
- vm0.invoke(RemoveGlobalDUnitTest.class, "closeCache");
- vm1.invoke(RemoveGlobalDUnitTest.class, "closeCache");
+ vm0.invoke(() -> RemoveGlobalDUnitTest.resetFlag());
+ vm1.invoke(() -> RemoveGlobalDUnitTest.resetFlag());
+ vm0.invoke(() -> RemoveGlobalDUnitTest.closeCache());
+ vm1.invoke(() -> RemoveGlobalDUnitTest.closeCache());
}
public static void resetFlag()
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/69024aa9/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/SingleHopStatsDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/SingleHopStatsDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/SingleHopStatsDUnitTest.java
index 4b016a4..01522bf 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/SingleHopStatsDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/SingleHopStatsDUnitTest.java
@@ -114,10 +114,10 @@ public class SingleHopStatsDUnitTest extends CacheTestCase{
@Override
protected final void preTearDownCacheTestCase() throws Exception {
// close the clients first
- member0.invoke(SingleHopStatsDUnitTest.class, "closeCache");
- member1.invoke(SingleHopStatsDUnitTest.class, "closeCache");
- member2.invoke(SingleHopStatsDUnitTest.class, "closeCache");
- member3.invoke(SingleHopStatsDUnitTest.class, "closeCache");
+ member0.invoke(() -> SingleHopStatsDUnitTest.closeCache());
+ member1.invoke(() -> SingleHopStatsDUnitTest.closeCache());
+ member2.invoke(() -> SingleHopStatsDUnitTest.closeCache());
+ member3.invoke(() -> SingleHopStatsDUnitTest.closeCache());
closeCache();
}
@@ -150,34 +150,20 @@ public class SingleHopStatsDUnitTest extends CacheTestCase{
VM server3 = member2;
VM client1 = member3;
- Integer port0 = (Integer)member0.invoke(
- SingleHopStatsDUnitTest.class, "createServerForStats",
- new Object[] { 0, 113,"No_Colocation"});
- Integer port1 = (Integer)member1.invoke(
- SingleHopStatsDUnitTest.class, "createServerForStats",
- new Object[] { 0, 113,"No_Colocation"});
- Integer port2 = (Integer)member2.invoke(
- SingleHopStatsDUnitTest.class, "createServerForStats",
- new Object[] { 0, 113,"No_Colocation"});
- client1.invoke(
- SingleHopStatsDUnitTest.class, "createClient",
- new Object[] {port0, port1, port2,"No_Colocation"});
+ Integer port0 = (Integer)member0.invoke(() -> SingleHopStatsDUnitTest.createServerForStats( 0, 113,"No_Colocation"));
+ Integer port1 = (Integer)member1.invoke(() -> SingleHopStatsDUnitTest.createServerForStats( 0, 113,"No_Colocation"));
+ Integer port2 = (Integer)member2.invoke(() -> SingleHopStatsDUnitTest.createServerForStats( 0, 113,"No_Colocation"));
+ client1.invoke(() -> SingleHopStatsDUnitTest.createClient(port0, port1, port2,"No_Colocation"));
createClient(port0, port1, port2, "No_Colocation");
- client1.invoke(
- SingleHopStatsDUnitTest.class, "createPR",
- new Object[] {"FirstClient", "No_Colocation"});
+ client1.invoke(() -> SingleHopStatsDUnitTest.createPR("FirstClient", "No_Colocation"));
createPR("SecondClient", "No_Colocation");
- client1.invoke(
- SingleHopStatsDUnitTest.class, "getPR",
- new Object[] {"FirstClient", "No_Colocation"});
+ client1.invoke(() -> SingleHopStatsDUnitTest.getPR("FirstClient", "No_Colocation"));
getPR("SecondClient", "No_Colocation");
- client1.invoke(
- SingleHopStatsDUnitTest.class, "updatePR",
- new Object[] {"FirstClient", "No_Colocation"});
+ client1.invoke(() -> SingleHopStatsDUnitTest.updatePR("FirstClient", "No_Colocation"));
}
public void testClientStatsColocationPR(){
@@ -186,27 +172,15 @@ public class SingleHopStatsDUnitTest extends CacheTestCase{
VM server3 = member2;
VM client1 = member3;
- Integer port0 = (Integer)member0.invoke(
- SingleHopStatsDUnitTest.class, "createServerForStats",
- new Object[] { 0, 4, "Colocation" });
- Integer port1 = (Integer)member1.invoke(
- SingleHopStatsDUnitTest.class, "createServerForStats",
- new Object[] { 0, 4, "Colocation" });
- Integer port2 = (Integer)member2.invoke(
- SingleHopStatsDUnitTest.class, "createServerForStats",
- new Object[] { 0, 4, "Colocation"});
- client1.invoke(
- SingleHopStatsDUnitTest.class, "createClient",
- new Object[] {port0, port1, port2, "Colocation"});
+ Integer port0 = (Integer)member0.invoke(() -> SingleHopStatsDUnitTest.createServerForStats( 0, 4, "Colocation" ));
+ Integer port1 = (Integer)member1.invoke(() -> SingleHopStatsDUnitTest.createServerForStats( 0, 4, "Colocation" ));
+ Integer port2 = (Integer)member2.invoke(() -> SingleHopStatsDUnitTest.createServerForStats( 0, 4, "Colocation"));
+ client1.invoke(() -> SingleHopStatsDUnitTest.createClient(port0, port1, port2, "Colocation"));
createClient(port0, port1, port2, "Colocation");
- client1.invoke(
- SingleHopStatsDUnitTest.class, "createPR",
- new Object[] {"FirstClient", "Colocation"});
+ client1.invoke(() -> SingleHopStatsDUnitTest.createPR("FirstClient", "Colocation"));
- client1.invoke(
- SingleHopStatsDUnitTest.class, "getPR",
- new Object[] {"FirstClient", "Colocation"});
+ client1.invoke(() -> SingleHopStatsDUnitTest.getPR("FirstClient", "Colocation"));
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/69024aa9/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/SystemFailureDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/SystemFailureDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/SystemFailureDUnitTest.java
index e47892e..43fc6a5 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/SystemFailureDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/SystemFailureDUnitTest.java
@@ -392,7 +392,7 @@ public class SystemFailureDUnitTest extends DistributedCacheTestCase {
private boolean doVerifyConnected() {
Host host = Host.getHost(0);
VM vm = host.getVM(0);
- Object o = vm.invoke(this.getClass(), "verifyConnected");
+ Object o = vm.invoke(() -> this.verifyConnected());
return ((Boolean)o).booleanValue();
}
@@ -424,7 +424,7 @@ public class SystemFailureDUnitTest extends DistributedCacheTestCase {
private boolean doVerifyDisconnected() {
Host host = Host.getHost(0);
VM vm = host.getVM(0);
- return ((Boolean)vm.invoke(this.getClass(), "verifyDisconnected"))
+ return ((Boolean)vm.invoke(() -> this.verifyDisconnected()))
.booleanValue();
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/69024aa9/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/Bug51193DUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/Bug51193DUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/Bug51193DUnitTest.java
index 74f5e7f..8a83417 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/Bug51193DUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/Bug51193DUnitTest.java
@@ -73,8 +73,8 @@ public class Bug51193DUnitTest extends DistributedTestCase {
@Override
protected final void preTearDown() throws Exception {
closeCache();
- server0.invoke(Bug51193DUnitTest.class, "closeCache");
- client0.invoke(Bug51193DUnitTest.class, "closeCache");
+ server0.invoke(() -> Bug51193DUnitTest.closeCache());
+ client0.invoke(() -> Bug51193DUnitTest.closeCache());
}
public static void closeCache() {
@@ -172,17 +172,15 @@ public class Bug51193DUnitTest extends DistributedTestCase {
public void doTest(boolean createPR, int timeout, String mode)
throws Throwable {
// start server
- int port = (Integer) server0.invoke(Bug51193DUnitTest.class,
- "createServerCache", new Object[] { createPR });
+ int port = (Integer) server0.invoke(() -> Bug51193DUnitTest.createServerCache( createPR ));
// start client
- client0.invoke(Bug51193DUnitTest.class, "createClientCache", new Object[] {
- client0.getHost().getHostName(), port, timeout });
+ client0.invoke(() -> Bug51193DUnitTest.createClientCache(
+ client0.getHost().getHostName(), port, timeout ));
// do puts and get
server0
- .invoke(Bug51193DUnitTest.class, "doPutsAndGet", new Object[] { 10 });
+ .invoke(() -> Bug51193DUnitTest.doPutsAndGet( 10 ));
// execute function & verify timeout has been received at server.
- client0.invoke(Bug51193DUnitTest.class,
- "executeFunction", new Object[] { mode, timeout });
+ client0.invoke(() -> Bug51193DUnitTest.executeFunction( mode, timeout ));
}
public void testExecuteFunctionReadsDefaultTimeout() throws Throwable {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/69024aa9/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/ClientServerFunctionExecutionDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/ClientServerFunctionExecutionDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/ClientServerFunctionExecutionDUnitTest.java
index 3890498..800b33b 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/ClientServerFunctionExecutionDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/ClientServerFunctionExecutionDUnitTest.java
@@ -72,8 +72,7 @@ public class ClientServerFunctionExecutionDUnitTest extends PRClientServerTestBa
throws InterruptedException {
createScenario();
try {
- client.invoke(ClientServerFunctionExecutionDUnitTest.class,
- "executeRegisteredFunction");
+ client.invoke(() -> ClientServerFunctionExecutionDUnitTest.executeRegisteredFunction());
}
catch (Exception e) {
assertEquals(true, (e.getCause() instanceof ServerOperationException));
@@ -86,8 +85,7 @@ public class ClientServerFunctionExecutionDUnitTest extends PRClientServerTestBa
createScenario();
Function function = new TestFunction(true, TestFunction.TEST_FUNCTION1);
registerFunctionAtServer(function);
- client.invoke(ClientServerFunctionExecutionDUnitTest.class,
- "executeRegisteredFunction");
+ client.invoke(() -> ClientServerFunctionExecutionDUnitTest.executeRegisteredFunction());
}
/*
@@ -103,10 +101,8 @@ public class ClientServerFunctionExecutionDUnitTest extends PRClientServerTestBa
isByName = new Boolean(true);
toRegister = new Boolean(true);
LogWriterUtils.getLogWriter().info("ClientServerFFunctionExecutionDUnitTest#testServerSingleKeyExecution_byName : Starting test");
- client.invoke(ClientServerFunctionExecutionDUnitTest.class,
- "serverExecution", new Object[] { isByName, function, toRegister});
- client.invoke(ClientServerFunctionExecutionDUnitTest.class,
- "allServerExecution", new Object[] { isByName, function, toRegister});
+ client.invoke(() -> ClientServerFunctionExecutionDUnitTest.serverExecution( isByName, function, toRegister));
+ client.invoke(() -> ClientServerFunctionExecutionDUnitTest.allServerExecution( isByName, function, toRegister));
}
@@ -120,10 +116,8 @@ public class ClientServerFunctionExecutionDUnitTest extends PRClientServerTestBa
isByName = new Boolean(true);
toRegister = new Boolean(true);
LogWriterUtils.getLogWriter().info("ClientServerFFunctionExecutionDUnitTest#testServerSingleKeyExecution_byName : Starting test");
- client.invoke(ClientServerFunctionExecutionDUnitTest.class,
- "serverExecution_SendException", new Object[] { isByName, function, toRegister});
- client.invoke(ClientServerFunctionExecutionDUnitTest.class,
- "allServerExecution_SendException", new Object[] { isByName, function, toRegister});
+ client.invoke(() -> ClientServerFunctionExecutionDUnitTest.serverExecution_SendException( isByName, function, toRegister));
+ client.invoke(() -> ClientServerFunctionExecutionDUnitTest.allServerExecution_SendException( isByName, function, toRegister));
}
/*
@@ -139,10 +133,8 @@ public class ClientServerFunctionExecutionDUnitTest extends PRClientServerTestBa
isByName = new Boolean(true);
toRegister = new Boolean(true);
LogWriterUtils.getLogWriter().info("ClientServerFFunctionExecutionDUnitTest#testServerSingleKeyExecution_byName : Starting test");
- client.invoke(ClientServerFunctionExecutionDUnitTest.class,
- "serverExecution_NoLastResult", new Object[] { isByName, function, toRegister});
- client.invoke(ClientServerFunctionExecutionDUnitTest.class,
- "allServerExecution_NoLastResult", new Object[] { isByName, function, toRegister});
+ client.invoke(() -> ClientServerFunctionExecutionDUnitTest.serverExecution_NoLastResult( isByName, function, toRegister));
+ client.invoke(() -> ClientServerFunctionExecutionDUnitTest.allServerExecution_NoLastResult( isByName, function, toRegister));
}
public void testServerExecution_byName_WithoutRegister() {
@@ -155,10 +147,8 @@ public class ClientServerFunctionExecutionDUnitTest extends PRClientServerTestBa
isByName = new Boolean(true);
toRegister = new Boolean(false);
LogWriterUtils.getLogWriter().info("ClientServerFFunctionExecutionDUnitTest#testServerSingleKeyExecution_byName : Starting test");
- client.invoke(ClientServerFunctionExecutionDUnitTest.class,
- "serverExecution", new Object[] { isByName, function, toRegister});
- client.invoke(ClientServerFunctionExecutionDUnitTest.class,
- "allServerExecution", new Object[] { isByName, function, toRegister});
+ client.invoke(() -> ClientServerFunctionExecutionDUnitTest.serverExecution( isByName, function, toRegister));
+ client.invoke(() -> ClientServerFunctionExecutionDUnitTest.allServerExecution( isByName, function, toRegister));
}
/*
* Execution of the inline function on server
@@ -166,10 +156,8 @@ public class ClientServerFunctionExecutionDUnitTest extends PRClientServerTestBa
public void testServerExecution_byInlineFunction() {
createScenario();
LogWriterUtils.getLogWriter().info("ClientServerFunctionExecutionDUnitTest#testServerSingleKeyExecution_byName : Starting test");
- client.invoke(ClientServerFunctionExecutionDUnitTest.class,
- "serverExecution_Inline");
- client.invoke(ClientServerFunctionExecutionDUnitTest.class,
- "allServerExecution_Inline");
+ client.invoke(() -> ClientServerFunctionExecutionDUnitTest.serverExecution_Inline());
+ client.invoke(() -> ClientServerFunctionExecutionDUnitTest.allServerExecution_Inline());
}
@@ -179,8 +167,7 @@ public class ClientServerFunctionExecutionDUnitTest extends PRClientServerTestBa
public void testServerExecution_byInlineFunction_InvalidAttrbiutes() {
createScenario();
LogWriterUtils.getLogWriter().info("ClientServerFunctionExecutionDUnitTest#testServerSingleKeyExecution_byName : Starting test");
- client.invoke(ClientServerFunctionExecutionDUnitTest.class,
- "serverExecution_Inline_InvalidAttributes");
+ client.invoke(() -> ClientServerFunctionExecutionDUnitTest.serverExecution_Inline_InvalidAttributes());
}
/*
@@ -192,16 +179,11 @@ public class ClientServerFunctionExecutionDUnitTest extends PRClientServerTestBa
.info(
"ClientServerFunctionExecutionDUnitTest#testBug40714 : Starting test");
- server1.invoke(ClientServerFunctionExecutionDUnitTest.class,
- "registerFunction");
- server1.invoke(ClientServerFunctionExecutionDUnitTest.class,
- "registerFunction");
- server1.invoke(ClientServerFunctionExecutionDUnitTest.class,
- "registerFunction");
- client.invoke(ClientServerFunctionExecutionDUnitTest.class,
- "registerFunction");
- client.invoke(ClientServerFunctionExecutionDUnitTest.class,
- "FunctionExecution_Inline_Bug40714");
+ server1.invoke(() -> ClientServerFunctionExecutionDUnitTest.registerFunction());
+ server1.invoke(() -> ClientServerFunctionExecutionDUnitTest.registerFunction());
+ server1.invoke(() -> ClientServerFunctionExecutionDUnitTest.registerFunction());
+ client.invoke(() -> ClientServerFunctionExecutionDUnitTest.registerFunction());
+ client.invoke(() -> ClientServerFunctionExecutionDUnitTest.FunctionExecution_Inline_Bug40714());
}
@@ -274,10 +256,8 @@ public class ClientServerFunctionExecutionDUnitTest extends PRClientServerTestBa
isByName = new Boolean(true);
toRegister = new Boolean(true);
LogWriterUtils.getLogWriter().info("ClientServerFFunctionExecutionDUnitTest#testServerSingleKeyExecution_byName : Starting test");
- client.invoke(ClientServerFunctionExecutionDUnitTest.class,
- "serverExecution", new Object[] { isByName, function, toRegister});
- client.invoke(ClientServerFunctionExecutionDUnitTest.class,
- "allServerExecution", new Object[] { isByName, function, toRegister});
+ client.invoke(() -> ClientServerFunctionExecutionDUnitTest.serverExecution( isByName, function, toRegister));
+ client.invoke(() -> ClientServerFunctionExecutionDUnitTest.allServerExecution( isByName, function, toRegister));
}
public void testServerExecution_SocketTimeOut_WithoutRegister() {
@@ -288,10 +268,8 @@ public class ClientServerFunctionExecutionDUnitTest extends PRClientServerTestBa
isByName = new Boolean(true);
toRegister = new Boolean(false);
LogWriterUtils.getLogWriter().info("ClientServerFFunctionExecutionDUnitTest#testServerSingleKeyExecution_byName : Starting test");
- client.invoke(ClientServerFunctionExecutionDUnitTest.class,
- "serverExecution", new Object[] { isByName, function, toRegister});
- client.invoke(ClientServerFunctionExecutionDUnitTest.class,
- "allServerExecution", new Object[] { isByName, function, toRegister});
+ client.invoke(() -> ClientServerFunctionExecutionDUnitTest.serverExecution( isByName, function, toRegister));
+ client.invoke(() -> ClientServerFunctionExecutionDUnitTest.allServerExecution( isByName, function, toRegister));
}
@@ -308,32 +286,20 @@ public class ClientServerFunctionExecutionDUnitTest extends PRClientServerTestBa
IgnoredException.addIgnoredException("did not send last result");
createScenario();
- server1.invoke(
- ClientServerFunctionExecutionDUnitTest.class,
- "createReplicatedRegion");
+ server1.invoke(() -> ClientServerFunctionExecutionDUnitTest.createReplicatedRegion());
- server2.invoke(
- ClientServerFunctionExecutionDUnitTest.class,
- "createReplicatedRegion");
+ server2.invoke(() -> ClientServerFunctionExecutionDUnitTest.createReplicatedRegion());
- server3.invoke(
- ClientServerFunctionExecutionDUnitTest.class,
- "createReplicatedRegion");
+ server3.invoke(() -> ClientServerFunctionExecutionDUnitTest.createReplicatedRegion());
- client.invoke(ClientServerFunctionExecutionDUnitTest.class,
- "createProxyRegion",
- new Object[] { NetworkUtils.getServerHostName(server1.getHost()) });
+ client.invoke(() -> ClientServerFunctionExecutionDUnitTest.createProxyRegion( NetworkUtils.getServerHostName(server1.getHost()) ));
function = new TestFunction(true, TestFunction.TEST_FUNCTION_HA_SERVER);
registerFunctionAtServer(function);
- client.invoke(
- ClientServerFunctionExecutionDUnitTest.class,
- "serverExecutionHAOneServerDown", new Object[]{Boolean.FALSE,function,Boolean.FALSE});
+ client.invoke(() -> ClientServerFunctionExecutionDUnitTest.serverExecutionHAOneServerDown(Boolean.FALSE,function,Boolean.FALSE));
- client.invoke(
- ClientServerFunctionExecutionDUnitTest.class,
- "verifyMetaData",new Object[]{new Integer(1), new Integer(1)});
+ client.invoke(() -> ClientServerFunctionExecutionDUnitTest.verifyMetaData(new Integer(1), new Integer(1)));
}
@SuppressWarnings("rawtypes")
@@ -346,32 +312,20 @@ public class ClientServerFunctionExecutionDUnitTest extends PRClientServerTestBa
IgnoredException.addIgnoredException("did not send last result");
createScenario();
- server1.invoke(
- ClientServerFunctionExecutionDUnitTest.class,
- "createReplicatedRegion");
+ server1.invoke(() -> ClientServerFunctionExecutionDUnitTest.createReplicatedRegion());
- server2.invoke(
- ClientServerFunctionExecutionDUnitTest.class,
- "createReplicatedRegion");
+ server2.invoke(() -> ClientServerFunctionExecutionDUnitTest.createReplicatedRegion());
- server3.invoke(
- ClientServerFunctionExecutionDUnitTest.class,
- "createReplicatedRegion");
+ server3.invoke(() -> ClientServerFunctionExecutionDUnitTest.createReplicatedRegion());
- client.invoke(ClientServerFunctionExecutionDUnitTest.class,
- "createProxyRegion",
- new Object[] { NetworkUtils.getServerHostName(server1.getHost()) });
+ client.invoke(() -> ClientServerFunctionExecutionDUnitTest.createProxyRegion( NetworkUtils.getServerHostName(server1.getHost()) ));
function = new TestFunction(true, TestFunction.TEST_FUNCTION_HA_SERVER);
registerFunctionAtServer(function);
- client.invoke(
- ClientServerFunctionExecutionDUnitTest.class,
- "serverExecutionHATwoServerDown", new Object[]{Boolean.FALSE,function,Boolean.FALSE});
+ client.invoke(() -> ClientServerFunctionExecutionDUnitTest.serverExecutionHATwoServerDown(Boolean.FALSE,function,Boolean.FALSE));
- client.invoke(
- ClientServerFunctionExecutionDUnitTest.class,
- "verifyMetaData",new Object[]{new Integer(2), new Integer(0)});
+ client.invoke(() -> ClientServerFunctionExecutionDUnitTest.verifyMetaData(new Integer(2), new Integer(0)));
}
@@ -386,31 +340,19 @@ public class ClientServerFunctionExecutionDUnitTest extends PRClientServerTestBa
//last result;
IgnoredException.addIgnoredException("did not send last result");
createScenario();
- server1.invoke(
- ClientServerFunctionExecutionDUnitTest.class,
- "createReplicatedRegion");
+ server1.invoke(() -> ClientServerFunctionExecutionDUnitTest.createReplicatedRegion());
- server2.invoke(
- ClientServerFunctionExecutionDUnitTest.class,
- "createReplicatedRegion");
+ server2.invoke(() -> ClientServerFunctionExecutionDUnitTest.createReplicatedRegion());
- server3.invoke(
- ClientServerFunctionExecutionDUnitTest.class,
- "createReplicatedRegion");
+ server3.invoke(() -> ClientServerFunctionExecutionDUnitTest.createReplicatedRegion());
- client.invoke(ClientServerFunctionExecutionDUnitTest.class,
- "createProxyRegion",
- new Object[] { NetworkUtils.getServerHostName(server1.getHost()) });
+ client.invoke(() -> ClientServerFunctionExecutionDUnitTest.createProxyRegion( NetworkUtils.getServerHostName(server1.getHost()) ));
function = new TestFunction(true, TestFunction.TEST_FUNCTION_NONHA_SERVER);
registerFunctionAtServer(function);
- client.invoke(
- ClientServerFunctionExecutionDUnitTest.class,
- "serverExecutionNonHA", new Object[]{Boolean.FALSE,function,Boolean.FALSE});
- client.invoke(
- ClientServerFunctionExecutionDUnitTest.class,
- "verifyMetaData",new Object[]{new Integer(1), new Integer(0)});
+ client.invoke(() -> ClientServerFunctionExecutionDUnitTest.serverExecutionNonHA(Boolean.FALSE,function,Boolean.FALSE));
+ client.invoke(() -> ClientServerFunctionExecutionDUnitTest.verifyMetaData(new Integer(1), new Integer(0)));
}
@@ -424,9 +366,7 @@ public class ClientServerFunctionExecutionDUnitTest extends PRClientServerTestBa
function = new TestFunction(true, TestFunction.TEST_FUNCTION_ONSERVER_REEXECUTE_EXCEPTION);
registerFunctionAtServer(function);
- client.invoke(ClientServerFunctionExecutionDUnitTest.class,
- "serverFunctionExecution_FunctionInvocationTargetException",
- new Object[] { Boolean.FALSE, function, Boolean.FALSE });
+ client.invoke(() -> ClientServerFunctionExecutionDUnitTest.serverFunctionExecution_FunctionInvocationTargetException( Boolean.FALSE, function, Boolean.FALSE ));
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/69024aa9/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/ColocationFailoverDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/ColocationFailoverDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/ColocationFailoverDUnitTest.java
index 2ae358d..089c301 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/ColocationFailoverDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/ColocationFailoverDUnitTest.java
@@ -93,7 +93,7 @@ public class ColocationFailoverDUnitTest extends DistributedTestCase {
createShipmentPR();
putInPRs();
verifyColocationInAllVms();
- dataStore1.invoke(ColocationFailoverDUnitTest.class, "closeCache");
+ dataStore1.invoke(() -> ColocationFailoverDUnitTest.closeCache());
verifyPrimaryColocationAfterFailover();
}
@@ -104,34 +104,31 @@ public class ColocationFailoverDUnitTest extends DistributedTestCase {
createShipmentPR();
putInPRs();
verifyColocationInAllVms();
- dataStore1.invoke(ColocationFailoverDUnitTest.class, "closeCache");
+ dataStore1.invoke(() -> ColocationFailoverDUnitTest.closeCache());
Wait.pause(5000); //wait for volunteering primary
verifyColocationAfterFailover();
}
private void verifyColocationInAllVms() {
verifyColocation();
- dataStore1.invoke(ColocationFailoverDUnitTest.class, "verifyColocation");
- dataStore2.invoke(ColocationFailoverDUnitTest.class, "verifyColocation");
- dataStore3.invoke(ColocationFailoverDUnitTest.class, "verifyColocation");
- dataStore4.invoke(ColocationFailoverDUnitTest.class, "verifyColocation");
+ dataStore1.invoke(() -> ColocationFailoverDUnitTest.verifyColocation());
+ dataStore2.invoke(() -> ColocationFailoverDUnitTest.verifyColocation());
+ dataStore3.invoke(() -> ColocationFailoverDUnitTest.verifyColocation());
+ dataStore4.invoke(() -> ColocationFailoverDUnitTest.verifyColocation());
}
private void verifyPrimaryColocationAfterFailover() {
verifyPrimaryColocation();
- dataStore2.invoke(ColocationFailoverDUnitTest.class,
- "verifyPrimaryColocation");
- dataStore3.invoke(ColocationFailoverDUnitTest.class,
- "verifyPrimaryColocation");
- dataStore4.invoke(ColocationFailoverDUnitTest.class,
- "verifyPrimaryColocation");
+ dataStore2.invoke(() -> ColocationFailoverDUnitTest.verifyPrimaryColocation());
+ dataStore3.invoke(() -> ColocationFailoverDUnitTest.verifyPrimaryColocation());
+ dataStore4.invoke(() -> ColocationFailoverDUnitTest.verifyPrimaryColocation());
}
private void verifyColocationAfterFailover() {
verifyColocation();
- dataStore2.invoke(ColocationFailoverDUnitTest.class, "verifyColocation");
- dataStore3.invoke(ColocationFailoverDUnitTest.class, "verifyColocation");
- dataStore4.invoke(ColocationFailoverDUnitTest.class, "verifyColocation");
+ dataStore2.invoke(() -> ColocationFailoverDUnitTest.verifyColocation());
+ dataStore3.invoke(() -> ColocationFailoverDUnitTest.verifyColocation());
+ dataStore4.invoke(() -> ColocationFailoverDUnitTest.verifyColocation());
}
public static void closeCache() {
@@ -358,10 +355,10 @@ public class ColocationFailoverDUnitTest extends DistributedTestCase {
public static void createCacheInAllVms() {
createCacheInVm();
- dataStore1.invoke(ColocationFailoverDUnitTest.class, "createCacheInVm");
- dataStore2.invoke(ColocationFailoverDUnitTest.class, "createCacheInVm");
- dataStore3.invoke(ColocationFailoverDUnitTest.class, "createCacheInVm");
- dataStore4.invoke(ColocationFailoverDUnitTest.class, "createCacheInVm");
+ dataStore1.invoke(() -> ColocationFailoverDUnitTest.createCacheInVm());
+ dataStore2.invoke(() -> ColocationFailoverDUnitTest.createCacheInVm());
+ dataStore3.invoke(() -> ColocationFailoverDUnitTest.createCacheInVm());
+ dataStore4.invoke(() -> ColocationFailoverDUnitTest.createCacheInVm());
}
public static void createCacheInVm() {
@@ -457,10 +454,10 @@ public class ColocationFailoverDUnitTest extends DistributedTestCase {
private static void putInPRs() {
put();
- dataStore1.invoke(ColocationFailoverDUnitTest.class, "put");
- dataStore2.invoke(ColocationFailoverDUnitTest.class, "put");
- dataStore3.invoke(ColocationFailoverDUnitTest.class, "put");
- dataStore4.invoke(ColocationFailoverDUnitTest.class, "put");
+ dataStore1.invoke(() -> ColocationFailoverDUnitTest.put());
+ dataStore2.invoke(() -> ColocationFailoverDUnitTest.put());
+ dataStore3.invoke(() -> ColocationFailoverDUnitTest.put());
+ dataStore4.invoke(() -> ColocationFailoverDUnitTest.put());
}
public static void put() {