Пример #1
0
  protected void beforeRunChild() {
    TransactionManager.beginTransaction(creator);

    // So that ContainerLifeCycleTestUtil can access the activeContainer and do magic
    creator.addSingletonActiveRegistry();

    activeContainer = creator.getActiveRegister().getContainer();
  }
Пример #2
0
 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);
   }
 }
Пример #3
0
 protected void afterRunChild() {
   TransactionManager.endTransaction();
   creator.cleanActiveContainer();
 }