public void testRegisterContextAfterRequest() throws Exception {
EventContext ctx = new EventContextImpl();
StatelessScopeContext scope = new StatelessScopeContext(ctx);
scope.registerFactories(createConfigurations());
scope.start();
StatelessComponent comp1 = (StatelessComponent) scope.getContext("TestService1").getInstance(null);
Assert.assertNotNull(comp1);
scope.registerFactory(createConfiguration("NewTestService"));
StatelessComponent comp2 = (StatelessComponent) scope.getContext("NewTestService").getInstance(null);
Assert.assertNotNull(comp2);
scope.stop();
}