assertEquals(0,source.getNumberInstantiated());
scope.stop();
}
public void testInitDestroyOrderSessionScope() throws Exception {
EventContext ctx = new EventContextImpl();
SessionScopeContext scope = new SessionScopeContext(ctx);
scope.registerFactories(MockContextFactory.createWiredContexts(Scope.SESSION,scope));
scope.start();
Object session = new Object();
ctx.setIdentifier(HttpSessionEvent.HTTP_IDENTIFIER,session);
scope.onEvent(new HttpSessionBound(this,session));
OrderedDependentPojo source = (OrderedDependentPojo) scope.getContext("source").getInstance(null);
assertNotNull(source.getPojo());
// expire module
assertEquals(2,source.getNumberInstantiated());