use of org.apache.geode.InternalGemFireException in project geode by apache.
the class DistributedCacheTestCase method preTearDown.
/**
* Closes the cache in this VM and each remote VM
*/
@Override
public final void preTearDown() throws Exception {
StringBuffer problems = new StringBuffer();
if (cache != null) {
try {
if (remoteCloseCache()) {
problems.append("An exception occurred trying to close the cache.");
}
assertTrue(cache == null);
} catch (Exception ex) {
String s = "While closing the cache in this VM";
throw new InternalGemFireException(s, ex);
}
}
for (int h = 0; h < Host.getHostCount(); h++) {
Host host = Host.getHost(h);
for (int v = 0; v < host.getVMCount(); v++) {
VM vm = host.getVM(v);
boolean exceptionInThreads = vm.invoke(() -> this.remoteCloseCache());
if (exceptionInThreads) {
String s = "An exception occurred in GemFire system";
problems.append(s);
}
}
}
assertEquals("Problems while tearing down", "", problems.toString().trim());
}
Aggregations