ModuleScopeContext scope = new ModuleScopeContext(ctx);
scope.registerFactories(createConfigurations());
scope.start();
// first request
scope.onEvent(new ModuleStart(this));
ModuleScopeComponentImpl comp1 = (ModuleScopeComponentImpl) scope.getContext("TestService1").getInstance(null);
Assert.assertNotNull(comp1);
// second request
ModuleScopeComponentImpl comp2 = (ModuleScopeComponentImpl) scope.getContext("TestService1").getInstance(null);
Assert.assertNotNull(comp2);
Assert.assertSame(comp1, comp2);
scope.onEvent(new ModuleStop(this));
scope.stop();
}