Java Code Examples for com.gemstone.gemfire.cache.Region#create()

The following examples show how to use com.gemstone.gemfire.cache.Region#create() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: RedundancyLevelTestBase.java    From gemfirexd-oss with Apache License 2.0 6 votes vote down vote up
public static void createEntriesK1andK2()
{
  try {
    Region r1 = cache.getRegion(Region.SEPARATOR + REGION_NAME);
    assertNotNull(r1);
    if (!r1.containsKey(k1)) {
      r1.create(k1, k1);
    }
    if (!r1.containsKey(k2)) {
      r1.create(k2, k2);
    }
    assertEquals(r1.getEntry(k1).getValue(), k1);
    assertEquals(r1.getEntry(k2).getValue(), k2);
  }
  catch (Exception ex) {
    fail("failed while createEntries()", ex);
  }
}
 
Example 2
Source File: ConsoleDistributionManagerTest.java    From gemfirexd-oss with Apache License 2.0 6 votes vote down vote up
/**
 * Puts (or creates) a value in a region named <code>regionName</code>
 * named <code>entryName</code>.
 */
protected void remoteCreateEntry(String regionName,
                                        String entryName,
                                        Object value)
  throws CacheException {
  
  Region root = getRootRegion();
  Region region = root.getSubregion(regionName);
  region.create(entryName, value);
  
  
  getLogWriter().info("Put value " + value + " in entry " +
                      entryName + " in region '" +
                      region.getFullPath() +"'");
  
}
 
Example 3
Source File: DurableClientStatsDUnitTest.java    From gemfirexd-oss with Apache License 2.0 6 votes vote down vote up
private static void putValue(String key, String value) {
  try {
    Region r = CacheServerTestUtil.getCache().getRegion(
        DurableClientStatsDUnitTest.class.getName() + "_region");
    // Region r = CacheServerTestUtil.getCache().getRegion(regionName);
    assertNotNull(r);
    if (r.getEntry(key) != null) {
      r.put(key, value);
    }
    else {
      r.create(key, value);
    }
    assertEquals(value, r.getEntry(key).getValue());
  }
  catch (Exception e) {

    fail("Put in Server has some fight");

  }
}
 
Example 4
Source File: DurableClientStatsDUnitTest.java    From gemfirexd-oss with Apache License 2.0 6 votes vote down vote up
private static void putValue(String key, String value) {
  try {
    Region r = CacheServerTestUtil.getCache().getRegion(
        DurableClientStatsDUnitTest.class.getName() + "_region");
    // Region r = CacheServerTestUtil.getCache().getRegion(regionName);
    assertNotNull(r);
    if (r.getEntry(key) != null) {
      r.put(key, value);
    }
    else {
      r.create(key, value);
    }
    assertEquals(value, r.getEntry(key).getValue());
  }
  catch (Exception e) {

    fail("Put in Server has some fight");

  }
}
 
Example 5
Source File: QueryAndJtaTest.java    From gemfirexd-oss with Apache License 2.0 6 votes vote down vote up
public void testIndexOnCommitForDestroy() throws Exception {
  AttributesFactory af = new AttributesFactory();
  af.setDataPolicy(DataPolicy.REPLICATE);
  Region region = cache.createRegion("sample", af.create());
  qs.createIndex("foo", IndexType.FUNCTIONAL, "age", "/sample");
  Context ctx = cache.getJNDIContext();
  UserTransaction utx = (UserTransaction)ctx.lookup("java:/UserTransaction");
  Integer x = new Integer(0);
  utx.begin();
  region.create(x, new Person("xyz", 45));
  utx.commit();
  Query q = qs.newQuery("select * from /sample where age < 50");
  assertEquals(1, ((SelectResults)q.execute()).size());
  Person dsample = (Person)CopyHelper.copy(region.get(x));
  dsample.setAge(55);
  utx.begin();
  region.destroy(x);
  utx.commit();
  System.out.println((region.get(x)));
  assertEquals(0, ((SelectResults) q.execute()).size());
}
 
Example 6
Source File: InterestListDUnitTest.java    From gemfirexd-oss with Apache License 2.0 6 votes vote down vote up
public static void createEntriesK1andK2()
{
  try {
    Region r = cache.getRegion(Region.SEPARATOR + REGION_NAME);
    assertNotNull(r);
    if (!r.containsKey(key1)) {
      r.create(key1, key1_originalValue);
    }
    if (!r.containsKey(key2)) {
      r.create(key2, key2_originalValue);
    }
    // Verify that no invalidates occurred to this region
    assertEquals(r.getEntry(key1).getValue(), key1_originalValue);
    assertEquals(r.getEntry(key2).getValue(), key2_originalValue);
  }
  catch (Exception ex) {
    fail("failed while createEntries()", ex);
  }
}
 
Example 7
Source File: HAInterestBaseTest.java    From gemfirexd-oss with Apache License 2.0 6 votes vote down vote up
public static void createEntriesK1andK2OnServer()
{
  try {
    Region r1 = cache.getRegion(Region.SEPARATOR+ REGION_NAME);
    assertNotNull(r1);
    if (!r1.containsKey(k1)) {
      r1.create(k1, server_k1);
    }
    if (!r1.containsKey(k2)) {
      r1.create(k2, server_k2);
    }
    assertEquals(r1.getEntry(k1).getValue(), server_k1);
    assertEquals(r1.getEntry(k2).getValue(), server_k2);
  }
  catch (Exception ex) {
    fail("failed while createEntries()", ex);
  }
}
 
Example 8
Source File: DiskRegionJUnitTest.java    From gemfirexd-oss with Apache License 2.0 6 votes vote down vote up
/**
 * 
 * If IOException occurs while creating an entry in a persist only synch mode,
 *  DiskAccessException should occur & region should be destroyed
 * 
 * @throws Exception
 */
private void entryCreateInSynchPersistTypeForIOExceptionCase(Region region)
    throws Exception {
  
  try {
    // Get the oplog handle & hence the underlying file & close it
    FileChannel oplogFileChannel = ((LocalRegion)region).getDiskRegion()
        .testHook_getChild().getFileChannel();
    oplogFileChannel.close();
    try {
      region.create("key1", "value1");
      fail("Should have encountered DiskAccessException");
    }
    catch (DiskAccessException dae) {
      // OK
    }
    assertTrue(region.isDestroyed());
    region = null;
  }
  finally {
    if (region != null) {
      region.destroyRegion();
    }
  }
}
 
Example 9
Source File: HASlowReceiverDUnitTest.java    From gemfirexd-oss with Apache License 2.0 5 votes vote down vote up
public static void createEntries(Long num) {
  try {
    Region r = cache.getRegion("/" + regionName);
    assertNotNull(r);
    for (long i = 0; i < num.longValue(); i++) {
      r.create("k" + i, "v" + i);
    }
  }
  catch (Exception ex) {
    fail("failed in createEntries(Long)", ex);
  }
}
 
Example 10
Source File: ReliableMessagingDUnitTest.java    From gemfirexd-oss with Apache License 2.0 5 votes vote down vote up
public static void createEntries() throws Exception
{
  creationTime = 0;
  Region r1 = cache.getRegion(Region.SEPARATOR + REGION_NAME);
  String keyPrefix = "server-";
  for (int i = 0; i < 5; i++) {
    r1.create(keyPrefix + i,"val");
  }  
}
 
Example 11
Source File: HAGIIDUnitTest.java    From gemfirexd-oss with Apache License 2.0 5 votes vote down vote up
public static void createEntries()
{
  try {
    Region r = cache.getRegion("/"+ REGION_NAME);
    assertNotNull(r);
    r.create("key-1", "key-1");
    r.create("key-2", "key-2");
    r.create("key-3", "key-3");

  }
  catch (Exception ex) {
    fail("failed while createEntries()", ex);
  }
}
 
Example 12
Source File: DeltaTest.java    From gemfirexd-oss with Apache License 2.0 5 votes vote down vote up
/** Add a new entry to the given region.
 *
 *  @param aRegion The region to use for adding a new entry.
 *
 *  @returns The key that was added.
 */
protected Object addEntry(Region aReg)  {
   Object key = getNewKey();
   DeltaObject anObj = new DeltaObject(
       NameFactory.getCounterForName(key), DeltaObject.EQUAL_VALUES, 0, 1);
   anObj.extra = key;
   String callback = createCallbackPrefix + ProcessMgr.getProcessId();
   try {
      Log.getLogWriter().info("operation for " + key + ", addEntry: calling create for key " + key + ", object " +
         anObj.toStringFull() + " cacheWriterParam is " + callback + ", region is " + 
         aReg.getFullPath());
      aReg.create(key, anObj, callback);
      logPRMembers(aReg, key);
      Log.getLogWriter().info("operation for " + key + ", addEntry: done creating key " + key);
   } catch (EntryExistsException e) {
      if (isSerialExecution || uniqueKeys) { 
         // cannot get this exception; nobody else can have this key
         throw new TestException(TestHelper.getStackTrace(e));
      } else {
         Log.getLogWriter().info("Caught " + e + " (expected with concurrent execution); continuing with test");
         // in concurrent execution, somebody could have updated this key causing it to exist
      }
   }

   // validation
   if (isSerialExecution || uniqueKeys) {
      // record the current state
      regionSnapshot.put(key, anObj.copy());
   }
   return key;
}
 
Example 13
Source File: UpdateVersionJUnitTest.java    From gemfirexd-oss with Apache License 2.0 4 votes vote down vote up
public void testUpdateVersionAfterUpdate() {
  Cache cache = new CacheFactory().create();
  Region region = cache.createRegionFactory(RegionShortcut.REPLICATE).create(regionName);

  try {
    region.create("key-1", "value-1");
    try {
      Thread.sleep(10);
    } catch (InterruptedException e) { }
    region.put("key-1", "value-2");

    Entry entry = region.getEntry("key-1");
    assertTrue(entry instanceof NonTXEntry);
    RegionEntry regionEntry = ((NonTXEntry)entry).getRegionEntry();

    VersionStamp stamp = regionEntry.getVersionStamp();

    // Create a duplicate entry version tag from stamp with newer time-stamp.
    VersionTag tag = VersionTag.create(stamp.getMemberID());

    int entryVersion = stamp.getEntryVersion();
    VersionSource member = stamp.getMemberID();
    int dsid = stamp.getDistributedSystemId();
    long time = System.currentTimeMillis() + 1; // Just in case if clock hasn't ticked.
    
    tag.setEntryVersion(entryVersion);
    tag.setDistributedSystemId(dsid);
    tag.setVersionTimeStamp(time);
    tag.setIsGatewayTag(true);
    
    assertTrue(region instanceof LocalRegion);
    
    EntryEventImpl event = createNewEvent((LocalRegion)region, tag, entry.getKey());
    
    ((LocalRegion)region).basicUpdateEntryVersion(event);

    // Verify the new stamp
    entry = region.getEntry("key-1");
    assertTrue(entry instanceof NonTXEntry);
    regionEntry = ((NonTXEntry)entry).getRegionEntry();

    stamp = regionEntry.getVersionStamp();
    assertEquals(
        "Time stamp did NOT get updated by UPDATE_VERSION operation on LocalRegion",
        time, stamp.getVersionTimeStamp());
    assertEquals(++entryVersion, stamp.getEntryVersion());
    assertEquals(member, stamp.getMemberID());
    assertEquals(dsid, stamp.getDistributedSystemId());
  } finally {
    region.destroyRegion();
    cache.close();
  }
}
 
Example 14
Source File: DeltaPropagationStatsDUnitTest.java    From gemfirexd-oss with Apache License 2.0 4 votes vote down vote up
public static void putLastKey() {
  Region r = cache.getRegion(REGION_NAME);
  r.create(LAST_KEY, "LAST_VALUE");
}
 
Example 15
Source File: WANOperationsClient.java    From gemfirexd-oss with Apache License 2.0 4 votes vote down vote up
/**
 * Add a new entry to the given region.
 * 
 * @param aRegion
 *          The region to use for adding a new entry.
 * 
 */
protected void addEntry(Region aRegion) {
  Object key = getNewKey();
  BaseValueHolder anObj = getValueForKey(key);
  String callback = createCallbackPrefix + ProcessMgr.getProcessId();
  Object val = aRegion.get(key);
  if (val == null) { // use a create call
    if (TestConfig.tab().getRandGen().nextBoolean()) { // use a create call
      // with cacheWriter arg
      Log.getLogWriter().info(
          "addEntry: calling create for key " + key + ", object "
              + TestHelper.toString(anObj) + " cacheWriterParam is "
              + callback + ", region is " + aRegion.getFullPath());
      aRegion.create(key, anObj, callback);
      Log.getLogWriter().info("addEntry: done creating key " + key);
    }
    else { // use create with no cacheWriter arg
      Log.getLogWriter().info(
          "addEntry: calling create for key " + key + ", object "
              + TestHelper.toString(anObj) + ", region is "
              + aRegion.getFullPath());
      aRegion.create(key, anObj);
      Log.getLogWriter().info("addEntry: done creating key " + key);
    }
  }
  else { // use a put call
    if (TestConfig.tab().getRandGen().nextBoolean()) { // use a put call with
      // callback arg
      Log.getLogWriter().info(
          "addEntry: calling put for key " + key + ", object "
              + TestHelper.toString(anObj) + " callback is " + callback
              + ", region is " + aRegion.getFullPath());
      aRegion.put(key, anObj, callback);
      Log.getLogWriter().info("addEntry: done putting key " + key);
    }
    else {
      Log.getLogWriter().info(
          "addEntry: calling put for key " + key + ", object "
              + TestHelper.toString(anObj) + ", region is "
              + aRegion.getFullPath());
      aRegion.put(key, anObj);
      Log.getLogWriter().info("addEntry: done putting key " + key);
    }
  }

  if (useUniqueKeyPerThread) {
    updateBlackboardSnapshot(aRegion, key, anObj, false);
  }
}
 
Example 16
Source File: UpdateVersionJUnitTest.java    From gemfirexd-oss with Apache License 2.0 4 votes vote down vote up
public void testUpdateVersionAfterUpdate() {
  Cache cache = new CacheFactory().create();
  Region region = cache.createRegionFactory(RegionShortcut.REPLICATE).create(regionName);

  try {
    region.create("key-1", "value-1");
    try {
      Thread.sleep(10);
    } catch (InterruptedException e) { }
    region.put("key-1", "value-2");

    Entry entry = region.getEntry("key-1");
    assertTrue(entry instanceof NonTXEntry);
    RegionEntry regionEntry = ((NonTXEntry)entry).getRegionEntry();

    VersionStamp stamp = regionEntry.getVersionStamp();

    // Create a duplicate entry version tag from stamp with newer time-stamp.
    VersionTag tag = VersionTag.create(stamp.getMemberID());

    int entryVersion = stamp.getEntryVersion();
    VersionSource member = stamp.getMemberID();
    int dsid = stamp.getDistributedSystemId();
    long time = System.currentTimeMillis() + 1; // Just in case if clock hasn't ticked.
    
    tag.setEntryVersion(entryVersion);
    tag.setDistributedSystemId(dsid);
    tag.setVersionTimeStamp(time);
    tag.setIsGatewayTag(true);
    
    assertTrue(region instanceof LocalRegion);
    
    EntryEventImpl event = createNewEvent((LocalRegion)region, tag, entry.getKey());
    
    ((LocalRegion)region).basicUpdateEntryVersion(event);

    // Verify the new stamp
    entry = region.getEntry("key-1");
    assertTrue(entry instanceof NonTXEntry);
    regionEntry = ((NonTXEntry)entry).getRegionEntry();

    stamp = regionEntry.getVersionStamp();
    assertEquals(
        "Time stamp did NOT get updated by UPDATE_VERSION operation on LocalRegion",
        time, stamp.getVersionTimeStamp());
    assertEquals(++entryVersion, stamp.getEntryVersion());
    assertEquals(member, stamp.getMemberID());
    assertEquals(dsid, stamp.getDistributedSystemId());
  } finally {
    region.destroyRegion();
    cache.close();
  }
}
 
Example 17
Source File: P2PDeltaPropagationDUnitTest.java    From gemfirexd-oss with Apache License 2.0 4 votes vote down vote up
public static void createServerCache(Boolean flag, DataPolicy policy,
    Scope scope, Boolean listener, Boolean interestPolicyAll,
    Integer port) throws Exception {
  P2PDeltaPropagationDUnitTest test = new P2PDeltaPropagationDUnitTest("temp");
  Properties props = new Properties();
  if (!flag) {
    props.setProperty(DistributionConfig.DELTA_PROPAGATION_PROP_NAME, "false");
  }    
  cache = test.createCache(props);
  AttributesFactory factory = new AttributesFactory();
  factory.setScope(scope);
  factory.setDataPolicy(policy);
  if (policy == DataPolicy.EMPTY && interestPolicyAll) {
    factory.setSubscriptionAttributes(new SubscriptionAttributes(
        InterestPolicy.ALL));
  }

  if (listener) {
    factory.addCacheListener(new CacheListenerAdapter() {
      @Override
      @SuppressWarnings("synthetic-access")
      public void afterUpdate(EntryEvent event) {
        numOfUpdates++;
        cache.getLoggerI18n().fine(
            "afterUpdate(): numOfUpdates = " + numOfUpdates);
        cache.getLoggerI18n().fine(
            "(key, val): " + event.getKey() + ", " + event.getNewValue());
        if (event.getOldValue() != null) {
          if (event.getOldValue() == event.getNewValue()) {
            check = Boolean.TRUE;
          }
        }
        if (((EntryEventImpl)event).getDeltaBytes() != null) {
          cache.getLoggerI18n().fine("delta bytes received. " + hasDeltaBytes);
          assertTrue("No full value received for event " + event,
              ((EntryEventImpl)event).getNewValue() != null);
          hasDeltaBytes++;
        } else {
          cache.getLoggerI18n().fine("delta bytes not received.");
        }
      }
    });
  }
  
  Region region = cache.createRegion(REGION_NAME, factory.create());
  if (!policy.isReplicate()) {
    region.create("KEY", "KEY");
  }
  if (port != null) {
    CacheServer server1 = cache.addCacheServer();
    server1.setPort(port);
    server1.start();
  }
}
 
Example 18
Source File: WANOperationsClient.java    From gemfirexd-oss with Apache License 2.0 4 votes vote down vote up
/**
 * Add a new entry to the given region.
 * 
 * @param aRegion
 *          The region to use for adding a new entry.
 * 
 */
protected void addEntry(Region aRegion) {
  Object key = getNewKey();
  BaseValueHolder anObj = getValueForKey(key);
  String callback = createCallbackPrefix + ProcessMgr.getProcessId();
  Object val = aRegion.get(key);
  if (val == null) { // use a create call
    if (TestConfig.tab().getRandGen().nextBoolean()) { // use a create call
      // with cacheWriter arg
      Log.getLogWriter().info(
          "addEntry: calling create for key " + key + ", object "
              + TestHelper.toString(anObj) + " cacheWriterParam is "
              + callback + ", region is " + aRegion.getFullPath());
      aRegion.create(key, anObj, callback);
      Log.getLogWriter().info("addEntry: done creating key " + key);
    }
    else { // use create with no cacheWriter arg
      Log.getLogWriter().info(
          "addEntry: calling create for key " + key + ", object "
              + TestHelper.toString(anObj) + ", region is "
              + aRegion.getFullPath());
      aRegion.create(key, anObj);
      Log.getLogWriter().info("addEntry: done creating key " + key);
    }
  }
  else { // use a put call
    if (TestConfig.tab().getRandGen().nextBoolean()) { // use a put call with
      // callback arg
      Log.getLogWriter().info(
          "addEntry: calling put for key " + key + ", object "
              + TestHelper.toString(anObj) + " callback is " + callback
              + ", region is " + aRegion.getFullPath());
      aRegion.put(key, anObj, callback);
      Log.getLogWriter().info("addEntry: done putting key " + key);
    }
    else {
      Log.getLogWriter().info(
          "addEntry: calling put for key " + key + ", object "
              + TestHelper.toString(anObj) + ", region is "
              + aRegion.getFullPath());
      aRegion.put(key, anObj);
      Log.getLogWriter().info("addEntry: done putting key " + key);
    }
  }

  if (useUniqueKeyPerThread) {
    updateBlackboardSnapshot(aRegion, key, anObj, false);
  }
}
 
Example 19
Source File: DiskRegionJUnitTest.java    From gemfirexd-oss with Apache License 2.0 4 votes vote down vote up
/**
   * Similar test in case of 'update'
   */
  public void testClearInteractionWithUpdateOperation_Bug37606()
  {
    DiskRegionProperties props = new DiskRegionProperties();
    props.setOverflow(false);
    props.setRolling(false);
    props.setDiskDirs(dirs);
    props.setPersistBackup(true);
    props.setRegionName("IGNORE_EXCEPTION_testClearInteractionWithUpdateOperation_Bug37606");
    final Region region = DiskRegionHelperFactory.getSyncPersistOnlyRegion(
        cache, props, Scope.LOCAL);
    region.create("key1", "value1");
    LocalRegion.ISSUE_CALLBACKS_TO_CACHE_OBSERVER = true;
    final Thread th = new Thread(new Runnable() {
      public void run()
      {
        region.put("key1", "value2");
      }
    });
    CacheObserver old = CacheObserverHolder
        .setInstance(new CacheObserverAdapter() {
          public void beforeDiskClear()
          {
         	LocalRegion.ISSUE_CALLBACKS_TO_CACHE_OBSERVER = false;
            th.start();
            System.out.println("FIXME: this thread (2) does not terminate--EVER!");
            DistributedTestCase.staticPause(10 * 1000);
//            try {	
//              DistributedTestCase.join(th, 10 * 1000, null);
//            }
//            catch (Exception e) {
//              DiskRegionJUnitTest.this.exceptionOccured = true;
//              DiskRegionJUnitTest.this.failureCause = e.toString();
//            }
          }
        });
    try {
      region.clear();
      DistributedTestCase.join(th, 30 * 1000, null);
      assertFalse(this.failureCause, this.exceptionOccured);
      //We expect 1 entry to exist, because the clear was triggered before
      //the update
      assertEquals(1,region.size());
      region.close();
      assertEquals(1,DiskRegionHelperFactory.getSyncPersistOnlyRegion(cache,
          props, Scope.LOCAL).size());
    }
    catch (Exception e) {
      fail("Exception not expected but did occur due to " + e);
    }
    finally {
      CacheObserverHolder.setInstance(old);
      LocalRegion.ISSUE_CALLBACKS_TO_CACHE_OBSERVER = false;
    }
  }
 
Example 20
Source File: DeltaPropagationDUnitTest.java    From gemfirexd-oss with Apache License 2.0 4 votes vote down vote up
/**
 * Tests that an update on a server with full Delta object causes distribution
 * of the full Delta instance, and not its delta bits, to other peers, even if
 * that instance's <code>hasDelta()</code> returns true.
 * 
 * @throws Exception
 */
public void testC2S2SDeltaPropagation() throws Exception {
  prepareDeltas();
  VM0.invoke(DeltaPropagationDUnitTest.class, "prepareDeltas");
  VM1.invoke(DeltaPropagationDUnitTest.class, "prepareDeltas");

  DeltaTestImpl val = deltaPut[1];
  VM0.invoke(DeltaPropagationDUnitTest.class, "closeCache");

  PORT1 = ((Integer)VM0.invoke(DeltaPropagationDUnitTest.class,
      "createServerCache", new Object[] {
          HARegionQueue.HA_EVICTION_POLICY_MEMORY, new Integer(1),
          new Integer(C2S2S_SERVER_LISTENER) })).intValue();
  PORT2 = ((Integer)VM1.invoke(DeltaPropagationDUnitTest.class,
      "createServerCache", new Object[] {
          HARegionQueue.HA_EVICTION_POLICY_MEMORY, new Integer(1),
          new Integer(C2S2S_SERVER_LISTENER) })).intValue();

  createClientCache(new Integer(PORT1), new Integer(-1), "0", new Integer(
      NO_LISTENER));

  Region r = cache.getRegion("/" + regionName);
  assertNotNull(r);

  r.create(DELTA_KEY, deltaPut[0]);

  // Invalidate the value at both the servers.
  VM0.invoke(DeltaPropagationDUnitTest.class, "doLocalOp", new Object[] {
      INVALIDATE, regionName, DELTA_KEY });
  VM1.invoke(DeltaPropagationDUnitTest.class, "doLocalOp", new Object[] {
      INVALIDATE, regionName, DELTA_KEY });

  VM0.invoke(DeltaPropagationDUnitTest.class, "assertOp", new Object[] {
      INVALIDATE, new Integer(1) });
  VM1.invoke(DeltaPropagationDUnitTest.class, "assertOp", new Object[] {
      INVALIDATE, new Integer(1) });

  r.put(DELTA_KEY, val);
  Thread.sleep(5000);

  // Assert that VM0 distributed val as full value to VM1.
  VM1.invoke(DeltaPropagationDUnitTest.class, "assertValue", new Object[] {
      regionName, DELTA_KEY, val });

  assertTrue("Delta Propagation feature used.", !((Boolean)VM0.invoke(
      DeltaTestImpl.class, "deltaFeatureUsed")).booleanValue());
  assertTrue("Delta Propagation feature used.", !((Boolean)VM1.invoke(
      DeltaTestImpl.class, "deltaFeatureUsed")).booleanValue());
  assertTrue("Delta Propagation feature NOT used.", DeltaTestImpl
      .deltaFeatureUsed());
}