.extensions(
TestObserverOne.class,
TestObserverTwo.class,
TestObserverTree.class).create();
SuiteContext context = manager.getContext(SuiteContext.class);
try
{
context.activate();
context.getObjectStore().add(Object.class, new Object());
manager.fire("some string event");
Assert.assertTrue(manager.getExtension(TestObserverOne.class).wasCalled);
Assert.assertTrue(manager.getExtension(TestObserverTwo.class).wasCalled);
Assert.assertTrue(manager.getExtension(TestObserverTree.class).wasCalled);
Assert.assertNotNull(
"Verify instance was bound to context",
context.getObjectStore().get(Object.class));
ContainerContext containerContext = manager.getContext(ContainerContext.class);
Assert.assertFalse(containerContext.isActive());
containerContext.activate("");
try
{
Assert.assertNotNull(
"Should have set a Double in container scope",
containerContext.getObjectStore().get(Double.class));
}
finally
{
containerContext.deactivate();
containerContext.destroy("");
}
}
finally
{
context.deactivate();
context.destroy();
}
}