testCRUD(objectRegistry);
}
@Test
public void testClearCache() {
ObjectRegistry objectRegistry = new ObjectRegistryImpl();
testCRUD(objectRegistry);
String one = "one";
String two = "two";
objectRegistry.add(ObjectLifeCycle.VERTEX, one, one);
objectRegistry.add(ObjectLifeCycle.DAG, two, two);
((ObjectRegistryImpl)objectRegistry).clearCache(ObjectLifeCycle.VERTEX);
Assert.assertNull(objectRegistry.get(one));
Assert.assertNotNull(objectRegistry.get(two));
objectRegistry.add(ObjectLifeCycle.VERTEX, one, one);
((ObjectRegistryImpl)objectRegistry).clearCache(ObjectLifeCycle.DAG);
Assert.assertNotNull(objectRegistry.get(one));
Assert.assertNull(objectRegistry.get(two));
}