@Test
  public void testBeforeRegionClearCallBack() {
    Properties props = new Properties();
    props.setProperty(MCAST_PORT, "0");
    props.setProperty(LOCATORS, "");
    DistributedSystem ds = DistributedSystem.connect(props);
    Cache cache = null;
    Region region = null;
    AttributesFactory factory = null;
    try {
      cache = CacheFactory.create(ds);
      factory = new AttributesFactory();
      factory.setScope(Scope.LOCAL);
      factory.setCacheWriter(new CacheWriterAdapter() {

        @Override
        public void beforeRegionClear(RegionEvent event) throws CacheWriterException {
          synchronized (this) {
            notify();
            hasBeenNotified = true;
          }
        }
      });
      region = cache.createRegion("testingRegion", factory.create());
      DoesClear doesClear = new DoesClear(region);
      new Thread(doesClear).start();
      synchronized (this) {
        if (!hasBeenNotified) {
          wait(3000);
        }
      }
      if (!hasBeenNotified) {
        fail(" beforeRegionClear call back did not come");
      }
    } catch (Exception e) {
      throw new AssertionError(" failed due to ", e);
    }
    for (int i = 0; i < 100; i++) {
      region.put(i, i);
    }
    assertEquals(50, region.get(50));
    region.localClear();
    assertEquals(null, region.get(50));
    region.close();
    factory.setScope(Scope.DISTRIBUTED_ACK);
    factory.setDataPolicy(DataPolicy.REPLICATE);
    try {
      region = cache.createRegion("testingRegion", factory.create());
    } catch (Exception e) {
      throw new AssertionError(" failed in creating region due to ", e);
    }
    boolean exceptionOccurred = false;
    try {
      region.localClear();
    } catch (UnsupportedOperationException e) {
      exceptionOccurred = true;
    }
    if (!exceptionOccurred) {
      fail(" exception did not occur when it was supposed to occur");
    }
    region.close();
    cache.close();
    ds.disconnect();
  }
Make sure putAll works on Scope.LOCAL (see bug 35087)
geode-core/src/integrationTest/java/org/apache/geode/internal/cache/MapInterfaceJUnitTest.java