@Test
  public void testCallbacksClosed() throws CacheException {
    {
      List callbacks = new ArrayList();

      // create a root region with callbacks
      Region r = createRootRegion(createAtts(callbacks));

      // create a sub region with callbacks
      r.createSubregion("testCallbacksClosed", createAtts(callbacks));

      closeCache();

      // make sure all callbacks called
      for (final Object callback : callbacks) {
        TestCacheCallback listener = (TestCacheCallback) callback;
        assertTrue("listener not invoked: " + listener, listener.isClosed());
      }
    }

    // now recreate the cache and root region so they can be destroyed
    // during teardown
    {
      AttributesFactory factory = new AttributesFactory();
      createRootRegion(factory.create());
    }
  }
Test to make sure cache close is working.

@since GemFire 3.0
geode-core/src/distributedTest/java/org/apache/geode/cache30/CacheCloseDUnitTest.java