Fqn fqn = Fqn.fromString("/a/b/c");
MethodCall mc = MethodCallFactory.create(MethodDeclarations.putDataMethodLocal, new Object[]{null, fqn, data, Boolean.FALSE});
interceptor.invoke(mc);
Region region = regionManager.getRegion(fqn.toString());
EvictedEventNode event = region.takeLastEventNode();
assertEquals(EvictedEventNode.ADD_NODE_EVENT, event.getEvent());
assertEquals(fqn, event.getFqn());
assertEquals(100, event.getElementDifference());
assertNull(region.takeLastEventNode());
mc = MethodCallFactory.create(MethodDeclarations.getNodeMethodLocal,
new Object[]{fqn});
interceptor.invoke(mc);
event = region.takeLastEventNode();
assertEquals(EvictedEventNode.VISIT_NODE_EVENT, event.getEvent());
assertEquals(fqn, event.getFqn());
assertNull(region.takeLastEventNode());
mc = MethodCallFactory.create(MethodDeclarations.removeNodeMethodLocal, new Object[]{
null, fqn, Boolean.FALSE
});
interceptor.invoke(mc);
assertNull(cache.get(fqn));
event = region.takeLastEventNode();
assertEquals(EvictedEventNode.REMOVE_NODE_EVENT, event.getEvent());
assertEquals(fqn, event.getFqn());
assertNull(region.takeLastEventNode());
Object key = "key";
Object value = "value";
mc = MethodCallFactory.create(MethodDeclarations.putFailFastKeyValueMethodLocal,
new Object[]{null, fqn, key, value, Boolean.FALSE, new Long(1000)});
interceptor.invoke(mc);
assertEquals("value", cache.get(fqn, key));
event = region.takeLastEventNode();
assertEquals(EvictedEventNode.ADD_ELEMENT_EVENT, event.getEvent());
assertEquals(1, event.getElementDifference());
assertEquals(fqn, event.getFqn());
assertEquals("value", cache.get(fqn, key));
assertNull(region.takeLastEventNode());
mc = MethodCallFactory.create(MethodDeclarations.getKeyValueMethodLocal, new Object[]{fqn, key, Boolean.FALSE});
interceptor.invoke(mc);
region = regionManager.getRegion(fqn.toString());
event = region.takeLastEventNode();
assertEquals(EvictedEventNode.VISIT_NODE_EVENT, event.getEvent());
assertEquals(fqn, event.getFqn());
assertNull(region.takeLastEventNode());
mc = MethodCallFactory.create(MethodDeclarations.removeKeyMethodLocal,
new Object[]{null, fqn, key, Boolean.FALSE});
interceptor.invoke(mc);
assertNull(cache.get(fqn, key));
event = region.takeLastEventNode();
assertEquals(EvictedEventNode.REMOVE_ELEMENT_EVENT, event.getEvent());
assertEquals(fqn, event.getFqn());
assertEquals(1, event.getElementDifference());
assertNull(region.takeLastEventNode());
}