MethodCall mc = MethodCallFactory.create(MethodDeclarations.putDataMethodLocal_id, null, fqn, data, false);
interceptor.invoke(InvocationContext.fromMethodCall(mc));
Region region = regionManager.getRegion(fqn.toString(), false);
EvictedEventNode event = region.takeLastEventNode();
assertEquals(NodeEventType.ADD_NODE_EVENT, event.getEventType());
assertEquals(fqn, event.getFqn());
assertEquals(100, event.getElementDifference());
assertNull(region.takeLastEventNode());
mc = MethodCallFactory.create(MethodDeclarations.getNodeMethodLocal_id,
fqn);
interceptor.invoke(InvocationContext.fromMethodCall(mc));
event = region.takeLastEventNode();
assertEquals(NodeEventType.VISIT_NODE_EVENT, event.getEventType());
assertEquals(fqn, event.getFqn());
assertNull(region.takeLastEventNode());
mc = MethodCallFactory.create(MethodDeclarations.removeNodeMethodLocal_id, null, fqn, false, false);
interceptor.invoke(InvocationContext.fromMethodCall(mc));
assertNull(cache.getNode(fqn));
event = region.takeLastEventNode();
assertEquals(NodeEventType.REMOVE_NODE_EVENT, event.getEventType());
assertEquals(fqn, event.getFqn());
assertNull(region.takeLastEventNode());
Object key = "key";
Object value = "value";
mc = MethodCallFactory.create(MethodDeclarations.putKeyValMethodLocal_id,
null, fqn, key, value, false);
interceptor.invoke(InvocationContext.fromMethodCall(mc));
assertEquals("value", cache.peek(fqn, false, false).getDirect(key));
event = region.takeLastEventNode();
assertEquals(NodeEventType.ADD_ELEMENT_EVENT, event.getEventType());
assertEquals(1, event.getElementDifference());
assertEquals(fqn, event.getFqn());
assertEquals("value", cache.peek(fqn, false, false).getDirect(key));
assertNull(region.takeLastEventNode());
mc = MethodCallFactory.create(MethodDeclarations.getKeyValueMethodLocal_id, fqn, key, false);
interceptor.invoke(InvocationContext.fromMethodCall(mc));
region = regionManager.getRegion(fqn.toString(), false);
event = region.takeLastEventNode();
assertEquals(NodeEventType.VISIT_NODE_EVENT, event.getEventType());
assertEquals(fqn, event.getFqn());
assertNull(region.takeLastEventNode());
mc = MethodCallFactory.create(MethodDeclarations.removeKeyMethodLocal_id,
null, fqn, key, false);
interceptor.invoke(InvocationContext.fromMethodCall(mc));
assertNull(cache.get(fqn, key));
event = region.takeLastEventNode();
assertEquals(NodeEventType.REMOVE_ELEMENT_EVENT, event.getEventType());
assertEquals(fqn, event.getFqn());
assertEquals(1, event.getElementDifference());
assertNull(region.takeLastEventNode());
}