[Jboss-cvs] JBossAS SVN: r56725 - trunk/testsuite/src/main/org/jboss/test/jca/test

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon Sep 11 07:54:26 EDT 2006


Author: dimitris at jboss.org
Date: 2006-09-11 07:54:24 -0400 (Mon, 11 Sep 2006)
New Revision: 56725

Modified:
   trunk/testsuite/src/main/org/jboss/test/jca/test/XATxConnectionManagerUnitTestCase.java
Log:
JBAS-3603, the execution order of tests in this test case is important so it must be defined explicitly when running under some JVMs

Modified: trunk/testsuite/src/main/org/jboss/test/jca/test/XATxConnectionManagerUnitTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/jca/test/XATxConnectionManagerUnitTestCase.java	2006-09-11 11:53:34 UTC (rev 56724)
+++ trunk/testsuite/src/main/org/jboss/test/jca/test/XATxConnectionManagerUnitTestCase.java	2006-09-11 11:54:24 UTC (rev 56725)
@@ -1,25 +1,25 @@
 /*
-  * JBoss, Home of Professional Open Source
-  * Copyright 2005, JBoss Inc., and individual contributors as indicated
-  * by the @authors tag. See the copyright.txt in the distribution for a
-  * full listing of individual contributors.
-  *
-  * This is free software; you can redistribute it and/or modify it
-  * under the terms of the GNU Lesser General Public License as
-  * published by the Free Software Foundation; either version 2.1 of
-  * the License, or (at your option) any later version.
-  *
-  * This software is distributed in the hope that it will be useful,
-  * but WITHOUT ANY WARRANTY; without even the implied warranty of
-  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-  * Lesser General Public License for more details.
-  *
-  * You should have received a copy of the GNU Lesser General Public
-  * License along with this software; if not, write to the Free
-  * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-  * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-  */
-package org.jboss.test.jca.test; // Generated package name
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.jca.test;
 
 import java.util.HashSet;
 import java.util.Set;
@@ -29,6 +29,9 @@
 import javax.transaction.TransactionManager;
 import javax.transaction.xa.XAException;
 
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
 import org.jboss.logging.Logger;
 import org.jboss.resource.connectionmanager.CachedConnectionManager;
 import org.jboss.resource.connectionmanager.InternalManagedConnectionPool;
@@ -52,9 +55,8 @@
  * Created: Mon Jan 14 00:43:40 2002
  *
  * @author <a href="mailto:d_jencks at users.sourceforge.net">David Jencks</a>
- * @version
+ * @version $Revision$
  */
-
 public class XATxConnectionManagerUnitTestCase extends JBossTestCase
 {
    Logger poolLog = Logger.getLogger(JBossManagedConnectionPool.class);
@@ -69,6 +71,22 @@
 
    private int poolSize = 5;
 
+   public static Test suite() throws Exception
+   {
+      // JBAS-3603, the execution order of tests in this test case is important
+      // so it must be defined explicitly when running under some JVMs
+      TestSuite suite = new TestSuite();
+      suite.addTest(new XATxConnectionManagerUnitTestCase("testGetConnection"));
+      suite.addTest(new XATxConnectionManagerUnitTestCase("testEnlistInExistingTx"));
+      suite.addTest(new XATxConnectionManagerUnitTestCase("testEnlistCheckedOutConnectionInNewTx"));
+      suite.addTest(new XATxConnectionManagerUnitTestCase("testReconnectConnectionHandlesOnNotification"));
+      suite.addTest(new XATxConnectionManagerUnitTestCase("testEnlistAfterMarkRollback"));
+      suite.addTest(new XATxConnectionManagerUnitTestCase("testBrokenConnectionAndTrackByTx"));
+      suite.addTest(new XATxConnectionManagerUnitTestCase("testFailedStartTx"));
+
+      return suite;
+   }
+   
    public XATxConnectionManagerUnitTestCase (String name)
    {
       super(name);
@@ -307,7 +325,7 @@
      }
      assertTrue("Connection still enlisted in tx!", !c.isInTx());
   }
-
+  
   public void testFailedStartTx() throws Exception
   {
      TestManagedConnection.setFailInStart(false, XAException.XAER_RMFAIL);
@@ -330,18 +348,12 @@
         fail("Should not be here.");
      
      }
-     
      catch (Throwable e)
      {
      }      
-     
      conn.close();
      
      assertTrue(conn2 == null);            
      assertTrue(cm.getPoolingStrategy().getConnectionCount() == 1);
-     
-
-     
   }
-
 }




More information about the jboss-cvs-commits mailing list