assertEquals(false, cache2.containsKey("key"));
}
public void testResurrectEntry() throws Exception {
AdvancedCache cache1 = cache(0,"invalidation").getAdvancedCache();
AdvancedCache cache2 = cache(1,"invalidation").getAdvancedCache();
replListener(cache2).expect(InvalidateCommand.class);
cache1.put("key", "value");
replListener(cache2).waitForRpc();
assertEquals("value", cache1.get("key"));
assertEquals(null, cache2.get("key"));
replListener(cache2).expect(InvalidateCommand.class);
cache1.put("key", "newValue");
replListener(cache2).waitForRpc();
assertEquals("newValue", cache1.get("key"));
assertEquals(null, cache2.get("key"));
replListener(cache2).expect(InvalidateCommand.class);
assertEquals("newValue", cache1.remove("key"));
replListener(cache2).waitForRpc();
assertEquals(null, cache1.get("key"));
assertEquals(null, cache2.get("key"));
// Restore locally
replListener(cache2).expect(InvalidateCommand.class);
cache1.put("key", "value");
replListener(cache2).waitForRpc();
assertEquals("value", cache1.get("key"));
assertEquals(null, cache2.get("key"));
replListener(cache1).expect(InvalidateCommand.class);
cache2.put("key", "value2");
replListener(cache1).waitForRpc();
assertEquals("value2", cache2.get("key"));
assertEquals(null, cache1.get("key"));
}