assertEqualsRegistryTarget(registry.getEntry("Name1"), registry.getEntry("Name2"));
}
public void testUnregister() throws Throwable
{
KernelRegistry registry = bootstrap().getRegistry();
try
{
registry.getEntry("Name1");
fail("Expected not registered error");
}
catch (KernelRegistryEntryNotFoundException e)
{
// expected
}
try
{
registry.unregisterEntry("Name1");
fail("Expected not registered error");
}
catch (KernelRegistryEntryNotFoundException e)
{
// expected
}
KernelRegistryEntry test1 = makeEntry(new Object());
registry.registerEntry("Name1", test1);
registry.unregisterEntry("Name1");
try
{
registry.getEntry("Name1");
fail("Expected not registered error");
}
catch (KernelRegistryEntryNotFoundException e)
{
// expected
}
try
{
registry.unregisterEntry("Name1");
fail("Expected not registered error");
}
catch (KernelRegistryEntryNotFoundException e)
{
// expected
}
registry.registerEntry("Name1", test1);
assertEqualsRegistryTarget(test1, registry.getEntry("Name1"));
}