Search in sources :

Example 46 with InternalGemFireException

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());
}
Also used : InternalGemFireException(org.apache.geode.InternalGemFireException) VM(org.apache.geode.test.dunit.VM) Host(org.apache.geode.test.dunit.Host) CacheException(org.apache.geode.cache.CacheException) CacheLoaderException(org.apache.geode.cache.CacheLoaderException) EntryNotFoundException(org.apache.geode.cache.EntryNotFoundException) InternalGemFireException(org.apache.geode.InternalGemFireException)

Aggregations

InternalGemFireException (org.apache.geode.InternalGemFireException)46 IOException (java.io.IOException)12 RejectedExecutionException (java.util.concurrent.RejectedExecutionException)8 InternalDistributedMember (org.apache.geode.distributed.internal.membership.InternalDistributedMember)8 ExecutionException (java.util.concurrent.ExecutionException)7 UnknownHostException (java.net.UnknownHostException)6 Future (java.util.concurrent.Future)6 Method (java.lang.reflect.Method)5 ArrayList (java.util.ArrayList)4 HashMap (java.util.HashMap)4 HashSet (java.util.HashSet)4 Iterator (java.util.Iterator)4 List (java.util.List)4 CancelException (org.apache.geode.CancelException)4 CacheException (org.apache.geode.cache.CacheException)4 EntryNotFoundException (org.apache.geode.cache.EntryNotFoundException)4 ServerOperationException (org.apache.geode.cache.client.ServerOperationException)4 NoSuchElementException (java.util.NoSuchElementException)3 Set (java.util.Set)3 ExecutorService (java.util.concurrent.ExecutorService)3