public void testInitDestroy() throws Exception {
WorkContext ctx = new WorkContextImpl();
RequestScopeContainer scope = new RequestScopeContainer(ctx);
scope.start();
SystemAtomicComponent initDestroyContext = MockFactory
.createAtomicComponent("InitDestroy", scope, RequestScopeInitDestroyComponent.class);
initDestroyContext.start();
SystemAtomicComponent initOnlyContext =
MockFactory.createAtomicComponent("InitOnly", scope, RequestScopeInitOnlyComponent.class);
initOnlyContext.start();
SystemAtomicComponent destroyOnlyContext = MockFactory
.createAtomicComponent("DestroyOnly", scope, RequestScopeDestroyOnlyComponent.class);
destroyOnlyContext.start();
scope.onEvent(new RequestStart(this));
RequestScopeInitDestroyComponent initDestroy =
(RequestScopeInitDestroyComponent) scope.getInstance(initDestroyContext);
Assert.assertNotNull(initDestroy);