protected void beforeRunChild() { TransactionManager.beginTransaction(creator); // So that ContainerLifeCycleTestUtil can access the activeContainer and do magic creator.addSingletonActiveRegistry(); activeContainer = creator.getActiveRegister().getContainer(); }
private void createContainerFromRegistration() { try { Class testClass = getTestClass().getJavaClass(); Annotation[] annotations = testClass.getAnnotations(); for (Annotation annotation : annotations) { if (annotation.annotationType() == ContainerContext.class) { ContainerContext containerContext = (ContainerContext) annotation; Class<? extends ContainerConfig> transactionClass = containerContext.value(); creator = transactionClass.newInstance(); creator.createContainer(); System.out.println("Creating creator for thread " + Thread.currentThread().toString()); } } } catch (InstantiationException e) { throw new RuntimeException(e); } catch (IllegalAccessException e) { throw new RuntimeException(e); } }
protected void afterRunChild() { TransactionManager.endTransaction(); creator.cleanActiveContainer(); }