}
@Test
public void shouldBeAbleToStackContextOfSameType()
{
ManagerTest2Context context = new ManagerTest2ContextImpl();
try
{
context.activate("PARENT");
context.getObjectStore().add(String.class, "test");
try
{
context.activate("CHILD");
Assert.assertNull(
"Should not be able to read from previously stacked context",
context.getObjectStore().get(String.class));
}
finally
{
context.deactivate();
}
Assert.assertTrue(
"Outer Context should still be active",
context.isActive());
}
finally
{
context.deactivate();
context.clearAll();
}
}