// now make sure if we try to get on the node/key we just created in cache, that this DOES add a EvictedEventNode to
// the MarshRegion.
mc = MethodCallFactory.create(MethodDeclarations.getKeyValueMethodLocal_id, fqn, "wrongkey", false);
interceptor.invoke(InvocationContext.fromMethodCall(mc));
EvictedEventNode event = region.takeLastEventNode();
assertEquals(fqn, event.getFqn());
assertEquals(NodeEventType.VISIT_NODE_EVENT, event.getEventType());
assertNull(region.takeLastEventNode());
putQuietly(fqn4, key, "value");
// test on element granularity configured node.
fqn = Fqn.fromString(fqn4);
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());
fqn = Fqn.fromString("/d/e/g");
for (int i = 0; i < 100; i++)
{
key = i;
putQuietly("/d/e/g", key, "");
mc = MethodCallFactory.create(MethodDeclarations.getKeyValueMethodLocal_id, fqn, key, true);
interceptor.invoke(InvocationContext.fromMethodCall(mc));
}
region = regionManager.getRegion(fqn.toString(), false);
for (int i = 0; i < 100; i++)
{
event = region.takeLastEventNode();
assertEquals(fqn, event.getFqn());
assertEquals(NodeEventType.VISIT_NODE_EVENT, event.getEventType());
}
putQuietly("/a/b/c", key, "");
fqn = Fqn.fromString("/a/b/c");
mc = MethodCallFactory.create(MethodDeclarations.getKeyValueMethodLocal_id, fqn, key, false);
interceptor.invoke(InvocationContext.fromMethodCall(mc));
region = regionManager.getRegion(fqn.toString(), false);
event = region.takeLastEventNode();
assertNull(region.takeLastEventNode());
assertEquals(NodeEventType.VISIT_NODE_EVENT, event.getEventType());
assertEquals(fqn, event.getFqn());
for (int i = 0; i < 100; i++)
{
key = i;
putQuietly(fqn, key, "");
mc = MethodCallFactory.create(MethodDeclarations.getKeyValueMethodLocal_id, fqn, key, true);
interceptor.invoke(InvocationContext.fromMethodCall(mc));
}
for (int i = 0; i < 100; i++)
{
event = region.takeLastEventNode();
assertEquals(NodeEventType.VISIT_NODE_EVENT, event.getEventType());
assertEquals(fqn, event.getFqn());
}
assertNull(region.takeLastEventNode());
}