use of org.apache.geode.cache.persistence.RevokeFailedException in project geode by apache.
the class PersistentPartitionedRegionDUnitTest method testRevokeBeforeStartup.
// GEODE-974: async actions, time sensitive, 65 second timeouts
@Category(FlakyTest.class)
@Test
public void testRevokeBeforeStartup() throws Throwable {
IgnoredException.addIgnoredException("RevokeFailedException");
Host host = Host.getHost(0);
VM vm0 = host.getVM(0);
VM vm1 = host.getVM(1);
VM vm2 = host.getVM(2);
int numBuckets = 50;
createPR(vm0, 1);
createPR(vm1, 1);
createData(vm0, 0, numBuckets, "a");
Set<Integer> vm0Buckets = getBucketList(vm0);
Set<Integer> vm1Buckets = getBucketList(vm1);
assertEquals(vm0Buckets, vm1Buckets);
// This should fail with a revocation failed message
try {
revokeAllMembers(vm2);
fail("The revoke should have failed, because members are running");
} catch (RMIException e) {
if (!(e.getCause() instanceof ReplyException && e.getCause().getCause() instanceof RevokeFailedException)) {
throw e;
}
}
closeCache(vm0);
createData(vm1, 0, numBuckets, "b");
File vm1Directory = getDiskDirectory(vm1);
closeCache(vm1);
vm0.invoke(new SerializableRunnable("get cache") {
public void run() {
getCache();
}
});
revokeMember(vm2, vm1Directory);
AsyncInvocation a1 = createPRAsync(vm0, 1);
a1.getResult(MAX_WAIT);
assertEquals(vm0Buckets, getBucketList(vm0));
checkData(vm0, 0, numBuckets, "a");
createData(vm0, numBuckets, 113, "b");
checkData(vm0, numBuckets, 113, "b");
IgnoredException ex = IgnoredException.addIgnoredException(RevokedPersistentDataException.class.getName(), vm1);
try {
createPR(vm1, 1);
fail("Should have recieved a SplitDistributedSystemException");
} catch (RMIException e) {
// We revoked this member.
if (!(e.getCause() instanceof RevokedPersistentDataException)) {
throw e;
}
}
ex.remove();
}
Aggregations