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

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon Sep 25 12:53:03 EDT 2006


Author: weston.price at jboss.com
Date: 2006-09-25 12:53:02 -0400 (Mon, 25 Sep 2006)
New Revision: 57141

Modified:
   branches/Branch_4_0/testsuite/src/main/org/jboss/test/jca/test/XATxConnectionManagerUnitTestCase.java
Log:
[JBAS-3693] Added failInEnd behavior to test adapter also broadcast error.
Removed invalid assertion for Tx behavior. 

Modified: branches/Branch_4_0/testsuite/src/main/org/jboss/test/jca/test/XATxConnectionManagerUnitTestCase.java
===================================================================
--- branches/Branch_4_0/testsuite/src/main/org/jboss/test/jca/test/XATxConnectionManagerUnitTestCase.java	2006-09-25 16:52:13 UTC (rev 57140)
+++ branches/Branch_4_0/testsuite/src/main/org/jboss/test/jca/test/XATxConnectionManagerUnitTestCase.java	2006-09-25 16:53:02 UTC (rev 57141)
@@ -83,6 +83,7 @@
       suite.addTest(new XATxConnectionManagerUnitTestCase("testEnlistAfterMarkRollback"));
       suite.addTest(new XATxConnectionManagerUnitTestCase("testBrokenConnectionAndTrackByTx"));
       suite.addTest(new XATxConnectionManagerUnitTestCase("testFailedStartTx"));
+      suite.addTest(new XATxConnectionManagerUnitTestCase("testFailedEndTx"));
 
       return suite;
    }
@@ -355,11 +356,15 @@
      
      assertTrue(conn2 == null);            
      assertTrue(cm.getPoolingStrategy().getConnectionCount() == 1);
+  
+     tm.rollback();
   }
 
   public void testFailedEndTx() throws Exception
   {
      TestManagedConnection.setFailInEnd(false, XAException.XAER_RMFAIL);
+     TestManagedConnection.setFailInStart(false, 0);
+
      tm.begin();
      TestConnection conn = null;
      TestConnection conn2 = null;
@@ -371,23 +376,31 @@
         
         //One should have been created
         assertTrue(cm.getPoolingStrategy().getConnectionCount() == 1);
-
+        conn.close();
+        
         TestManagedConnection.setFailInEnd(true, XAException.XAER_RMFAIL);
         
         conn2 = (TestConnection)cm.allocateConnection(mcf, cri);
+        conn2.close();
+        tm.commit();
+        fail("Should not be here!");
         
-        fail("Should not be here.");
      
      }
      catch (Throwable e)
      {
      }      
      
+     TestManagedConnection.setFailInEnd(false, 0);
+     TestManagedConnection.setFailInStart(false, 0);
+
+     tm.begin();
+     conn = (TestConnection)cm.allocateConnection(mcf, cri);
      conn.close();
+     tm.commit();
      
-     assertTrue(conn2 == null);            
-     assertTrue(cm.getPoolingStrategy().getConnectionCount() == 1);
-
+     assertTrue("Connection count" + cm.getPoolingStrategy().getConnectionCount(), cm.getPoolingStrategy().getConnectionCount() == 1);
+     
   }
 
 }




More information about the jboss-cvs-commits mailing list