@Override
      public void beforeRegionDestroy2(RegionEvent event) throws CacheWriterException {

        assertEquals(name, event.getRegion().getName());
        // this should be a distributed destroy unless the region
        // is local scope
        assertTrue(event.getOperation().isRegionDestroy());
        assertFalse(event.getOperation().isExpiration());
        assertFalse(event.isOriginRemote());

        Object argument = event.getCallbackArgument();
        if (argument != null) {
          if (argument.equals(exception)) {
            String s = "Test CacheWriterException";
            throw new CacheWriterException(s);

          } else {
            assertEquals(arg, argument);
          }
        }

        destroyed = true;
      }
Tests that the <code>CacheWriter</code> is called before a region is destroyed.

@see CacheWriter#beforeRegionDestroy
@see CacheWriter#close
geode-core/src/distributedTest/java/org/apache/geode/cache30/CacheWriterTestCase.java