@Test
  public void testSetValue() {
    Properties props = new Properties();
    props.setProperty(MCAST_PORT, "0");
    props.setProperty(LOCATORS, "");
    DistributedSystem ds = DistributedSystem.connect(props);
    Cache cache = null;

    AttributesFactory factory = null;
    try {
      cache = CacheFactory.create(ds);
      factory = new AttributesFactory();
      factory.setScope(Scope.LOCAL);
      factory.setCacheWriter(new CacheWriterAdapter() {

        @Override
        public void beforeUpdate(EntryEvent event) throws CacheWriterException {
          synchronized (this) {
            notify();
            counter++;
            hasBeenNotified = true;
          }
        }

      });
      region2 = cache.createRegion("testingRegion", factory.create());
      region2.put(2, 2);
      hasBeenNotified = false;
      DoesPut doesPut = new DoesPut();
      new Thread(doesPut).start();
      synchronized (this) {
        if (!hasBeenNotified) {
          wait(3000);
        }
      }
      if (!hasBeenNotified) {
        fail(" beforeCreate call back did not come");
      }

      assertEquals(counter, 1);
    } catch (Exception e) {
      throw new AssertionError(" failed due to ", e);
    }
  }
Make sure putAll works on Scope.LOCAL (see bug 35087)
geode-core/src/integrationTest/java/org/apache/geode/internal/cache/MapInterfaceJUnitTest.java