public void testRegisterContextBeforeRequest() throws Exception {
EventContext ctx = new EventContextImpl();
RequestScopeContext scope = new RequestScopeContext(ctx);
scope.registerFactories(createConfigurations());
scope.registerFactory(createConfiguration("NewTestService"));
scope.start();
RequestScopeComponent comp1 = (RequestScopeComponent) scope.getContext("TestService1").getInstance(null);
Assert.assertNotNull(comp1);
RequestScopeComponent comp2 = (RequestScopeComponent) scope.getContext("NewTestService").getInstance(null);
Assert.assertNotNull(comp2);
Object id = new Object();