public void testRegisterContextAfterStart() throws Exception {
EventContext ctx = new EventContextImpl();
ModuleScopeContext scope = new ModuleScopeContext(ctx);
scope.start();
scope.registerFactory(createConfiguration("NewTestService"));
scope.onEvent(new ModuleStart(this));
scope.registerFactories(createConfigurations());
ModuleScopeInitDestroyComponent comp2 = (ModuleScopeInitDestroyComponent) scope.getContext("NewTestService").getInstance(null);
Assert.assertNotNull(comp2);
Assert.assertTrue(comp2.isInitialized());
scope.onEvent(new ModuleStop(this));