public void testInitDestroyOrderModuleScope() throws Exception {
EventContext ctx = new EventContextImpl();
ModuleScopeContext scope = new ModuleScopeContext(ctx);
scope.registerFactories(MockContextFactory.createWiredContexts(Scope.MODULE,scope));
scope.start();
scope.onEvent(new ModuleStart(this));
OrderedDependentPojo source = (OrderedDependentPojo) scope.getContext("source").getInstance(null);
assertNotNull(source.getPojo());
// expire module
assertEquals(2,source.getNumberInstantiated());
scope.onEvent(new ModuleStop(this));
assertEquals(0,source.getNumberInstantiated());
scope.stop();
}