Examples of JuEmUtil


Examples of ch.inftec.ju.db.JuEmUtil

  @Override
  public void runPostTestActionsInEjbContext(TestRunnerAnnotationHandler handler) throws Exception {
    // Run post server annotations in an own annotation so any changed made there is available in the export / verifying phase
    try (TxHandler txHandler = new TxHandler(this.tx, true)) {
      // Execute post test annotations (dataset exporting, data verifying)
      handler.executePostServerCode(new JuEmUtil(this.em));
      txHandler.commit(); // Commit after data verifying / exporting
    }
   
    // Run post test annotations (export, verify)
    try (TxHandler txHandler = new TxHandler(this.tx, true)) {
      // Execute post test annotations (dataset exporting, data verifying)
      handler.executePostTestAnnotations(new JuEmUtil(this.em));
      txHandler.commit(); // Commit after data verifying / exporting
    }
  }
View Full Code Here

Examples of ch.inftec.ju.db.JuEmUtil

  @Override
  public final void init() {
    this.serviceLocator = ServiceLocatorBuilder.buildLocal().createServiceLocator();
    this.em = this.serviceLocator.cdi(EntityManager.class);
    this.emUtil = new JuEmUtil(this.em);
   
    this.doInit();
  }
View Full Code Here

Examples of ch.inftec.ju.db.JuEmUtil

   * Create a new DbDataUtil that will use the specified EntityManager to get
   * a raw connection to the DB and execute SQL queries.
   * @param em EntityManager instance to execute SQL in a JDBC connection
   */
  public DbDataUtil(EntityManager em) {
    this(new JuEmUtil(em));
  }
View Full Code Here

Examples of ch.inftec.ju.db.JuEmUtil

    try (ContainerTestContextSetter s = handler.new ContainerTestContextSetter()) {
      SystemPropertyTempSetter tempSetter = handler.initContainerTestEnv();

      try (TxHandler txHandler = new TxHandler(this.tx, true)) {
        // Execute post test annotations (dataset exporting, data verifying)
        handler.executePreTestAnnotations(new JuEmUtil(this.em));
        txHandler.commit(); // Commit after data verifying / exporting
      } catch (Exception ex) {
        // Reset properties in case of an exception
        tempSetter.close();
        throw ex;
View Full Code Here

Examples of ch.inftec.ju.db.JuEmUtil

  public void runPostTestActionsInEjbContext(TestRunnerAnnotationHandler handler) throws Exception {
    try (ContainerTestContextSetter s = handler.new ContainerTestContextSetter()) {
      // Run post server annotations in an own annotation so any changed made there is available in the export / verifying phase
      try (TxHandler txHandler = new TxHandler(this.tx, true)) {
        // Execute post test annotations (dataset exporting, data verifying)
        handler.executePostServerCode(new JuEmUtil(this.em));
        txHandler.commit(); // Commit after data verifying / exporting
      }

      // Run post test annotations (export, verify)
      try (TxHandler txHandler = new TxHandler(this.tx, true)) {
        // Execute post test annotations (dataset exporting, data verifying)
        handler.executePostTestAnnotations(new JuEmUtil(this.em));
        txHandler.commit(); // Commit after data verifying / exporting
      }
    }
  }
View Full Code Here

Examples of ch.inftec.ju.db.JuEmUtil

 
  @Override
  public final void init() {
    this.serviceLocator = ServiceLocatorBuilder.buildLocal().createServiceLocator();
    this.em = this.serviceLocator.cdi(EntityManager.class);
    this.emUtil = new JuEmUtil(this.em);
   
    this.doInit();
  }
View Full Code Here

Examples of ch.inftec.ju.db.JuEmUtil

 
  @Override
  public void runPreTestActionsInEjbContext(TestRunnerAnnotationHandler handler) throws Exception {
    try (TxHandler txHandler = new TxHandler(this.tx, true)) {
      // Execute post test annotations (dataset exporting, data verifying)
      handler.executePreTestAnnotations(new JuEmUtil(this.em));
      txHandler.commit(); // Commit after data verifying / exporting
    }
  }
View Full Code Here

Examples of ch.inftec.ju.db.JuEmUtil

  @Override
  public void runPostTestActionsInEjbContext(TestRunnerAnnotationHandler handler) throws Exception {
    // Run post server annotations in an own annotation so any changed made there is available in the export / verifying phase
    try (TxHandler txHandler = new TxHandler(this.tx, true)) {
      // Execute post test annotations (dataset exporting, data verifying)
      handler.executePostServerCode(new JuEmUtil(this.em));
      txHandler.commit(); // Commit after data verifying / exporting
    }
   
    // Run post test annotations (export, verify)
    try (TxHandler txHandler = new TxHandler(this.tx, true)) {
      // Execute post test annotations (dataset exporting, data verifying)
      handler.executePostTestAnnotations(new JuEmUtil(this.em));
      txHandler.commit(); // Commit after data verifying / exporting
    } finally {
      if (JuUtils.getJuPropertyChain().get("ju-testing-ee.clearPropertyChainAfterEachTest", Boolean.class, "false")) {
        JuUtils.clearPropertyChain();
      }
View Full Code Here

Examples of ch.inftec.ju.db.JuEmUtil

    this.setName(this.emJtaDb2, id2, name2);
    if (rollback) throw new RuntimeException("Rollback");
  }
 
  private String getName(EntityManager em, Long testingEntityId) {
    TestingEntityRepo teRepo = new JuEmUtil(em).getJpaRepository(TestingEntityRepo.class);
    return teRepo.findOne(testingEntityId).getName();
  }
View Full Code Here

Examples of ch.inftec.ju.db.JuEmUtil

    TestingEntityRepo teRepo = new JuEmUtil(em).getJpaRepository(TestingEntityRepo.class);
    return teRepo.findOne(testingEntityId).getName();
  }
 
  private void setName(EntityManager em, Long testingEntityId, String name) {
    TestingEntityRepo teRepo = new JuEmUtil(em).getJpaRepository(TestingEntityRepo.class);
    teRepo.findOne(testingEntityId).setName(name);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.