[jboss-cvs] JBossAS SVN: r57138 - branches/Branch_4_0/testsuite/src/main/org/jboss/test/jca/adapter

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon Sep 25 12:21:15 EDT 2006


Author: weston.price at jboss.com
Date: 2006-09-25 12:21:14 -0400 (Mon, 25 Sep 2006)
New Revision: 57138

Modified:
   branches/Branch_4_0/testsuite/src/main/org/jboss/test/jca/adapter/TestManagedConnection.java
Log:
[JBAS-3693] Added failInEnd behavior to test adapter. 

Modified: branches/Branch_4_0/testsuite/src/main/org/jboss/test/jca/adapter/TestManagedConnection.java
===================================================================
--- branches/Branch_4_0/testsuite/src/main/org/jboss/test/jca/adapter/TestManagedConnection.java	2006-09-25 16:20:00 UTC (rev 57137)
+++ branches/Branch_4_0/testsuite/src/main/org/jboss/test/jca/adapter/TestManagedConnection.java	2006-09-25 16:21:14 UTC (rev 57138)
@@ -79,11 +79,19 @@
    private boolean failInPrepare = false;
    private boolean failInCommit = false;
    private static boolean failInStart = false;
+   private static boolean failInEnd = false;
    
    private static int xaCode;
    
    private String localState = LOCAL_NONE;
    
+   public static void setFailInEnd(boolean fie, int xa)
+   {
+     failInEnd = fie;
+     xaCode = xa;
+     
+   }
+
    public static void setFailInStart(boolean fis, int xa)
    {
       failInStart = fis;
@@ -244,6 +252,11 @@
 
    public void end(final Xid xid, final int flags) throws XAException
    {
+      if(failInEnd)
+      {
+         throw new XAException(xaCode);
+      }
+
       long sleepInEnd = mcf.getSleepInEnd();
       if (flags != TMSUCCESS && sleepInEnd != 0)
          doSleep(sleepInEnd);




More information about the jboss-cvs-commits mailing list