public void testCircularReference3() throws Exception
{
// try {Thread.sleep(10000); } catch (Exception e) {};
log.info("testCircularReference3() ...");
Link parent = new Link("parent");
Link child = new Link("child");
cache1.putObject("/link/parent", parent);
cache1.putObject("/link/child", child);
TestingUtil.sleepThread(100);
parent.setLink(child);
child.setLink(parent);
Link p1 = (Link) cache1.getObject("/link/parent");
Link c1 = (Link) cache1.getObject("/link/child");
assertEquals("parent", p1.getName());
assertEquals("child", p1.getLink().getName());
assertEquals("child", c1.getName());
assertEquals("parent", c1.getLink().getName());
Link p2 = (Link) cache1.getObject("/link/parent");
Link c2 = (Link) cache1.getObject("/link/child");
assertEquals("parent", p2.getName());
assertEquals("child", p2.getLink().getName());
assertEquals("child", c2.getName());
assertEquals("parent", c2.getLink().getName());
p2.setLink(null);
assertNull("Child should be null", p2.getLink());
Link link = (Link)cache1.removeObject("/link/parent");
assertNotNull("Link should not be null ", link);
}