Package org.jboss.test.jbossts.recovery

Examples of org.jboss.test.jbossts.recovery.TestASRecoveryWithJPA


   public String testXA(String testEntityPK, boolean reverseOrder, ASFailureSpec... specs)
   {
      log.info("BMT testXA called with " + specs.length + " specs and testEntityPK=" + testEntityPK + " reverseOrder=" + reverseOrder);

      TestASRecoveryWithJPA xatest = new TestASRecoveryWithJPA();
      String txStatus = getStatus(context.getUserTransaction());

      if (txStatus != null)
         log.info("BMT testXA called with tx status: " + txStatus);

      xatest.setTestEntityPK(testEntityPK);
      xatest.setReverseOrder(reverseOrder);
     
      for (ASFailureSpec spec : specs)
         xatest.addResource(spec);

      return xatest.startTest() ? "Passed" : "Failed";
   }
View Full Code Here


   @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
   public String testXA(String testEntityPK, boolean reverseOrder, ASFailureSpec... specs)
   {
      log.info("CMT testXA called with " + specs.length + " specs and testEntityPK=" + testEntityPK + " reverseOrder=" + reverseOrder);

      TestASRecoveryWithJPA xatest = new TestASRecoveryWithJPA();
      Transaction tx;

      try
      {
         tx = com.arjuna.ats.jta.TransactionManager.transactionManager().getTransaction();
      }
      catch (javax.transaction.SystemException e)
      {
         tx = null;
      }

      if (tx == null)
      {
         log.error("CMT testXA called without a transaction");

         return "Failed";
      }
      else
      {
         xatest.setTestEntityPK(testEntityPK);
         xatest.setReverseOrder(reverseOrder);
        
         for (ASFailureSpec spec : specs)
            xatest.addResource(spec);

         xatest.startTest(tx);

         return "Passed";
      }
   }
View Full Code Here

TOP

Related Classes of org.jboss.test.jbossts.recovery.TestASRecoveryWithJPA

Copyright © 2018 www.massapicom. 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.