Assert.assertEquals(0, one.getNumberInstantiated());
scope.stop();
}
public void testEagerInitDestroyOrder() throws Exception {
WorkContext ctx = new WorkContextImpl();
HttpSessionScopeContainer scope = new HttpSessionScopeContainer(ctx);
scope.start();
SystemAtomicComponent oneCtx =
MockFactory.createAtomicComponent("one", scope, OrderedEagerInitPojo.class);
scope.register(oneCtx);
SystemAtomicComponent twoCtx =
MockFactory.createAtomicComponent("two", scope, OrderedEagerInitPojo.class);
scope.register(twoCtx);
SystemAtomicComponent threeCtx =
MockFactory.createAtomicComponent("three", scope, OrderedEagerInitPojo.class);
scope.register(threeCtx);
Object session = new Object();
ctx.setIdentifier(HttpSessionScopeContainer.HTTP_IDENTIFIER, session);
scope.onEvent(new HttpSessionStart(this, session));
OrderedEagerInitPojo one = (OrderedEagerInitPojo) scope.getInstance(oneCtx);
Assert.assertNotNull(one);
OrderedEagerInitPojo two = (OrderedEagerInitPojo) scope.getInstance(twoCtx);