Package org.jboss.test.jbossts.recovery

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


   // Dedicated for the first call of the propagation tests.
   public String testXA(ASFailureSpec[] fSpecsNode, ASFailureSpec[] fSpecsRemoteNode, String testEntityPK, String testEntityPKRemoteNode, String remoteHost, boolean expectFailureOnRemoteNode, boolean useOTS, int remoteJndiPort, int remoteCorbaPort)
   {
      log.info("CMT testXA called with " + fSpecsNode.length + "(this node) and " + fSpecsRemoteNode.length + "(remote node) specs and testEntityPK=" + testEntityPK + ", testEntityPKRemoteNode=" + testEntityPKRemoteNode + ", remoteHost=" + remoteHost + ", expectFailureOnRemoteNode=" + expectFailureOnRemoteNode + ", useOTS=" + useOTS);

      TestASRecoveryWithJTSPropagation xatest = new TestASRecoveryWithJTSPropagation();
      Transaction tx;

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

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

         return "Failed";
      }
      else
      {
         xatest.setTestEntityPK(testEntityPK);
         xatest.setRemoteHost(remoteHost);
         xatest.setfSpecsRemoteNode(fSpecsRemoteNode);
         xatest.setTestEntityPKRemoteNode(testEntityPKRemoteNode);
         xatest.setExpectFailureOnRemoteNode(expectFailureOnRemoteNode);
         xatest.setRemoteJndiPort(remoteJndiPort);
         xatest.setRemoteCorbaPort(remoteCorbaPort);
         xatest.setUseEJB3(false);
         xatest.setUseOTS(useOTS);     

         for (ASFailureSpec spec : fSpecsNode)
            xatest.addResource(spec);

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


   // Dedicated for the second call (remote side) of the propagation tests, i.e. it expects to be run within an existing transaction.
   public String testXA(ASFailureSpec[] fSpecsNode, String testEntityPK)
   {
      log.info("CMT testXA called with " + fSpecsNode.length + " specs and testEntityPK=" + testEntityPK);

      TestASRecoveryWithJTSPropagation xatest = new TestASRecoveryWithJTSPropagation();
      Transaction tx;

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

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

         return "Failed";
      }
      else
      {
         xatest.setTestEntityPK(testEntityPK);

         for (ASFailureSpec spec : fSpecsNode)
            xatest.addResource(spec);

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

   @TransactionAttribute(TransactionAttributeType.REQUIRED)
   public String testXA(ASFailureSpec[] fSpecsNode, ASFailureSpec[] fSpecsRemoteNode, String testEntityPK, String testEntityPKRemoteNode, String remoteHost, boolean expectFailureOnRemoteNode, boolean useOTS, int remoteJndiPort, int remoteCorbaPort)
   {
      log.info("CMT testXA called with " + fSpecsNode.length + "(this node) and " + fSpecsRemoteNode.length + "(remote node) specs and testEntityPK=" + testEntityPK + ", testEntityPKRemoteNode=" + testEntityPKRemoteNode + ", remoteHost=" + remoteHost + ", expectFailureOnRemoteNode=" + expectFailureOnRemoteNode + ", useOTS=" + useOTS);

      TestASRecoveryWithJTSPropagation xatest = new TestASRecoveryWithJTSPropagation();
      Transaction tx;

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

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

         return "Failed";
      }
      else
      {
         xatest.setTestEntityPK(testEntityPK);
         xatest.setRemoteHost(remoteHost);
         xatest.setfSpecsRemoteNode(fSpecsRemoteNode);
         xatest.setTestEntityPKRemoteNode(testEntityPKRemoteNode);
         xatest.setExpectFailureOnRemoteNode(expectFailureOnRemoteNode);
         xatest.setRemoteJndiPort(remoteJndiPort);
         xatest.setRemoteCorbaPort(remoteCorbaPort);
         xatest.setUseEJB3(true);
         xatest.setUseOTS(useOTS);     

         for (ASFailureSpec spec : fSpecsNode)
            xatest.addResource(spec);

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

   @TransactionAttribute(TransactionAttributeType.MANDATORY)
   public String testXA(ASFailureSpec[] fSpecsNode, String testEntityPK)
   {
      log.info("CMT testXA called with " + fSpecsNode.length + " specs and testEntityPK=" + testEntityPK);

      TestASRecoveryWithJTSPropagation xatest = new TestASRecoveryWithJTSPropagation();
      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);

         for (ASFailureSpec spec : fSpecsNode)
            xatest.addResource(spec);

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

TOP

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

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.