for (int i = 0; i < 20; i++)
{
String str = rootStr + Integer.toString(i);
Fqn fqn = Fqn.fromString(str);
Node node = cache.getNode(fqn);
System.out.println(i + " " + node);
if (i > 9)
{
assertNull("Testing at " + i, node);
}
else
{
assertEquals(1 + i, node.getData().size());
}
}
for (int i = 0; i < 17; i++)
{
cache.put("/org/jboss/data/3", 100 + i, "value");
}
Node node = cache.getNode("/org/jboss/data/3");
assertEquals(21, node.getData().size());
assert waitForEviction(cache, 30, TimeUnit.SECONDS, Fqn.fromString("/org/jboss/data/3")) : "Eviction event not received!";
TestingUtil.sleepThread(200); // small grace period
assertNull(cache.getNode("/org/jboss/data/3"));