[jboss-svn-commits] JBL Code SVN: r37591 - in labs/jbosstm/branches/JBOSSTS_4_15_0_Final: ArjunaJTA/jta/classes/com/arjuna/ats/internal/jta/transaction/arjunacore and 4 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Tue Oct 18 10:41:05 EDT 2011
Author: jhalliday
Date: 2011-10-18 10:41:03 -0400 (Tue, 18 Oct 2011)
New Revision: 37591
Added:
labs/jbosstm/branches/JBOSSTS_4_15_0_Final/ArjunaJTA/jta/tests/classes/com/hp/mwtests/ts/jta/nested/SimpleNestedDisabledTest.java
labs/jbosstm/branches/JBOSSTS_4_15_0_Final/ArjunaJTS/jtax/tests/classes/com/hp/mwtests/ts/jta/jts/nested/SimpleNestedDisabledTest.java
Modified:
labs/jbosstm/branches/JBOSSTS_4_15_0_Final/ArjunaJTA/jta/build.xml
labs/jbosstm/branches/JBOSSTS_4_15_0_Final/ArjunaJTA/jta/classes/com/arjuna/ats/internal/jta/transaction/arjunacore/BaseTransaction.java
labs/jbosstm/branches/JBOSSTS_4_15_0_Final/ArjunaJTA/jta/tests/classes/com/hp/mwtests/ts/jta/nested/SimpleNestedTest.java
labs/jbosstm/branches/JBOSSTS_4_15_0_Final/ArjunaJTS/jtax/build.xml
labs/jbosstm/branches/JBOSSTS_4_15_0_Final/ArjunaJTS/jtax/classes/com/arjuna/ats/internal/jta/transaction/jts/BaseTransaction.java
labs/jbosstm/branches/JBOSSTS_4_15_0_Final/ArjunaJTS/jtax/tests/classes/com/hp/mwtests/ts/jta/jts/nested/SimpleNestedTest.java
Log:
reoptimize isSupportSubtransactions usage. JBTM-929
Modified: labs/jbosstm/branches/JBOSSTS_4_15_0_Final/ArjunaJTA/jta/build.xml
===================================================================
--- labs/jbosstm/branches/JBOSSTS_4_15_0_Final/ArjunaJTA/jta/build.xml 2011-10-18 11:51:25 UTC (rev 37590)
+++ labs/jbosstm/branches/JBOSSTS_4_15_0_Final/ArjunaJTA/jta/build.xml 2011-10-18 14:41:03 UTC (rev 37591)
@@ -42,8 +42,17 @@
</fileset>
</tests>
</run.tests.macro>
+
<run.tests.macro>
<tests>
+ <!-- requires non-standard property value in static init block, hence own jvm -->
+ <fileset dir="tests/classes" includes="**/SimpleNestedDisabledTest.java">
+ </fileset>
+ </tests>
+ </run.tests.macro>
+
+ <run.tests.macro>
+ <tests>
<fileset dir="tests/classes" includes="**/*.java">
<!-- exclude tests which were run above using byteman scripts -->
<exclude name="**/recovery/CrashRecovery.java"/>
@@ -53,6 +62,7 @@
<exclude name="**/DummyXARecoveryResource.java"/>
<exclude name="**/TestSynchronization.java"/>
<exclude name="**/TestXAResource.java"/>
+ <exclude name="**/SimpleNestedDisabledTest.java"/>
</fileset>
</tests>
</run.tests.macro>
@@ -62,4 +72,3 @@
</target>
</project>
-
\ No newline at end of file
Modified: labs/jbosstm/branches/JBOSSTS_4_15_0_Final/ArjunaJTA/jta/classes/com/arjuna/ats/internal/jta/transaction/arjunacore/BaseTransaction.java
===================================================================
--- labs/jbosstm/branches/JBOSSTS_4_15_0_Final/ArjunaJTA/jta/classes/com/arjuna/ats/internal/jta/transaction/arjunacore/BaseTransaction.java 2011-10-18 11:51:25 UTC (rev 37590)
+++ labs/jbosstm/branches/JBOSSTS_4_15_0_Final/ArjunaJTA/jta/classes/com/arjuna/ats/internal/jta/transaction/arjunacore/BaseTransaction.java 2011-10-18 14:41:03 UTC (rev 37591)
@@ -54,7 +54,7 @@
* programmer use them. Strict conformance will always say no.
*/
- if (!jtaPropertyManager.getJTAEnvironmentBean().isSupportSubtransactions())
+ if (!_supportSubtransactions)
{
try
{
@@ -254,7 +254,7 @@
else
{
if ((theTransaction.getStatus() != javax.transaction.Status.STATUS_NO_TRANSACTION)
- && !jtaPropertyManager.getJTAEnvironmentBean().isSupportSubtransactions())
+ && !_supportSubtransactions)
{
throw new IllegalStateException(
"BaseTransaction.checkTransactionState - "
Added: labs/jbosstm/branches/JBOSSTS_4_15_0_Final/ArjunaJTA/jta/tests/classes/com/hp/mwtests/ts/jta/nested/SimpleNestedDisabledTest.java
===================================================================
--- labs/jbosstm/branches/JBOSSTS_4_15_0_Final/ArjunaJTA/jta/tests/classes/com/hp/mwtests/ts/jta/nested/SimpleNestedDisabledTest.java (rev 0)
+++ labs/jbosstm/branches/JBOSSTS_4_15_0_Final/ArjunaJTA/jta/tests/classes/com/hp/mwtests/ts/jta/nested/SimpleNestedDisabledTest.java 2011-10-18 14:41:03 UTC (rev 37591)
@@ -0,0 +1,67 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * 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,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2001, 2002,
+ *
+ * Hewlett-Packard Arjuna Labs,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: SimpleNestedTest.java 2342 2006-03-30 13:06:17Z $
+ */
+
+package com.hp.mwtests.ts.jta.nested;
+
+import com.hp.mwtests.ts.jta.common.TestResource;
+import com.arjuna.ats.jta.common.jtaPropertyManager;
+
+import javax.transaction.NotSupportedException;
+import javax.transaction.Transaction;
+import javax.transaction.xa.XAResource;
+
+import org.junit.Test;
+import static org.junit.Assert.*;
+
+public class SimpleNestedDisabledTest
+{
+ @Test
+ public void testDisabled () throws Exception
+ {
+ jtaPropertyManager.getJTAEnvironmentBean().setSupportSubtransactions(false);
+
+ javax.transaction.TransactionManager transactionManager = com.arjuna.ats.jta.TransactionManager.transactionManager();
+
+ transactionManager.begin();
+
+ try
+ {
+ transactionManager.begin();
+
+ fail();
+ }
+ catch (final NotSupportedException ex)
+ {
+ }
+
+ transactionManager.commit();
+ }
+}
Modified: labs/jbosstm/branches/JBOSSTS_4_15_0_Final/ArjunaJTA/jta/tests/classes/com/hp/mwtests/ts/jta/nested/SimpleNestedTest.java
===================================================================
--- labs/jbosstm/branches/JBOSSTS_4_15_0_Final/ArjunaJTA/jta/tests/classes/com/hp/mwtests/ts/jta/nested/SimpleNestedTest.java 2011-10-18 11:51:25 UTC (rev 37590)
+++ labs/jbosstm/branches/JBOSSTS_4_15_0_Final/ArjunaJTA/jta/tests/classes/com/hp/mwtests/ts/jta/nested/SimpleNestedTest.java 2011-10-18 14:41:03 UTC (rev 37591)
@@ -1,20 +1,20 @@
/*
* JBoss, Home of Professional Open Source
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags.
* See the copyright.txt in the distribution for a
- * full listing of individual contributors.
+ * full listing of individual contributors.
* This copyrighted material is made available to anyone wishing to use,
* modify, copy, or redistribute it subject to the terms and conditions
* of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * 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,
* v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301, USA.
- *
+ *
* (C) 2005-2006,
* @author JBoss Inc.
*/
@@ -66,26 +66,6 @@
transactionManager.commit();
}
-
- @Test
- public void testDisabled () throws Exception
- {
- jtaPropertyManager.getJTAEnvironmentBean().setSupportSubtransactions(false);
- javax.transaction.TransactionManager transactionManager = com.arjuna.ats.jta.TransactionManager.transactionManager();
-
- transactionManager.begin();
-
- try
- {
- transactionManager.begin();
-
- fail();
- }
- catch (final NotSupportedException ex)
- {
- }
-
- transactionManager.commit();
- }
+ // testDisabled moved to its own class, as it needs separate jvm to allow different property value in static init.
}
Modified: labs/jbosstm/branches/JBOSSTS_4_15_0_Final/ArjunaJTS/jtax/build.xml
===================================================================
--- labs/jbosstm/branches/JBOSSTS_4_15_0_Final/ArjunaJTS/jtax/build.xml 2011-10-18 11:51:25 UTC (rev 37590)
+++ labs/jbosstm/branches/JBOSSTS_4_15_0_Final/ArjunaJTS/jtax/build.xml 2011-10-18 14:41:03 UTC (rev 37591)
@@ -56,11 +56,24 @@
<path refid="jacorb.classpath"/>
</additional.classpath>
<tests>
+ <!-- requires non-standard property value in static init block, hence own jvm -->
+ <fileset dir="tests/classes" includes="**/SimpleNestedDisabledTest.java">
+ </fileset>
+ </tests>
+ </run.tests.macro>
+
+
+ <run.tests.macro>
+ <additional.classpath>
+ <path refid="jacorb.classpath"/>
+ </additional.classpath>
+ <tests>
<fileset dir="tests/classes">
<exclude name="**/common/**"/>
<exclude name="**/ExampleXAResource.java"/>
<exclude name="**/JTSTestCase.java"/>
<exclude name="**/LastOnePhaseResource.java"/>
+ <exclude name="**/SimpleNestedDisabledTest.java"/>
<exclude name="**/implicit/**"/>
</fileset>
@@ -68,7 +81,7 @@
</run.tests.macro>
<emma.report.macro/>
-
+
</target>
</project>
\ No newline at end of file
Modified: labs/jbosstm/branches/JBOSSTS_4_15_0_Final/ArjunaJTS/jtax/classes/com/arjuna/ats/internal/jta/transaction/jts/BaseTransaction.java
===================================================================
--- labs/jbosstm/branches/JBOSSTS_4_15_0_Final/ArjunaJTS/jtax/classes/com/arjuna/ats/internal/jta/transaction/jts/BaseTransaction.java 2011-10-18 11:51:25 UTC (rev 37590)
+++ labs/jbosstm/branches/JBOSSTS_4_15_0_Final/ArjunaJTS/jtax/classes/com/arjuna/ats/internal/jta/transaction/jts/BaseTransaction.java 2011-10-18 14:41:03 UTC (rev 37591)
@@ -67,7 +67,7 @@
* programmer use them. Strict conformance will always say no.
*/
- if (!jtaPropertyManager.getJTAEnvironmentBean().isSupportSubtransactions())
+ if (!_supportSubtransactions)
{
try
{
@@ -265,7 +265,7 @@
if (coord != null)
{
if ((coord.get_status() == org.omg.CosTransactions.Status.StatusActive)
- && (!jtaPropertyManager.getJTAEnvironmentBean().isSupportSubtransactions()))
+ && (!_supportSubtransactions))
{
throw new IllegalStateException(
"BaseTransaction.checkTransactionState - "
Added: labs/jbosstm/branches/JBOSSTS_4_15_0_Final/ArjunaJTS/jtax/tests/classes/com/hp/mwtests/ts/jta/jts/nested/SimpleNestedDisabledTest.java
===================================================================
--- labs/jbosstm/branches/JBOSSTS_4_15_0_Final/ArjunaJTS/jtax/tests/classes/com/hp/mwtests/ts/jta/jts/nested/SimpleNestedDisabledTest.java (rev 0)
+++ labs/jbosstm/branches/JBOSSTS_4_15_0_Final/ArjunaJTS/jtax/tests/classes/com/hp/mwtests/ts/jta/jts/nested/SimpleNestedDisabledTest.java 2011-10-18 14:41:03 UTC (rev 37591)
@@ -0,0 +1,86 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags.
+ * See the copyright.txt in the distribution for a full listing
+ * of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * 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,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2001, 2002,
+ *
+ * Hewlett-Packard Arjuna Labs,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: SimpleNestedTest.java 2342 2006-03-30 13:06:17Z $
+ */
+
+package com.hp.mwtests.ts.jta.jts.nested;
+
+import com.arjuna.ats.internal.jts.ORBManager;
+
+import com.arjuna.ats.jta.common.*;
+
+import com.arjuna.orbportability.*;
+
+import javax.transaction.NotSupportedException;
+
+import org.junit.Test;
+import static org.junit.Assert.*;
+
+public class SimpleNestedDisabledTest
+{
+ @Test
+ public void testDisabled () throws Exception
+ {
+ ORB myORB = null;
+ RootOA myOA = null;
+
+ myORB = ORB.getInstance("test");
+ myOA = OA.getRootOA(myORB);
+
+ myORB.initORB(new String[] {}, null);
+ myOA.initOA();
+
+ ORBManager.setORB(myORB);
+ ORBManager.setPOA(myOA);
+
+ jtaPropertyManager.getJTAEnvironmentBean().setTransactionManagerClassName(com.arjuna.ats.internal.jta.transaction.jts.TransactionManagerImple.class.getName());
+ jtaPropertyManager.getJTAEnvironmentBean().setUserTransactionClassName(com.arjuna.ats.internal.jta.transaction.jts.UserTransactionImple.class.getName());
+ jtaPropertyManager.getJTAEnvironmentBean().setSupportSubtransactions(false);
+
+ javax.transaction.TransactionManager transactionManager = com.arjuna.ats.jta.TransactionManager.transactionManager();
+
+ transactionManager.begin();
+
+ try
+ {
+ transactionManager.begin();
+
+ fail();
+ }
+ catch (final NotSupportedException ex)
+ {
+ }
+
+ transactionManager.commit();
+
+ myOA.destroy();
+ myORB.shutdown();
+
+ }
+}
Modified: labs/jbosstm/branches/JBOSSTS_4_15_0_Final/ArjunaJTS/jtax/tests/classes/com/hp/mwtests/ts/jta/jts/nested/SimpleNestedTest.java
===================================================================
--- labs/jbosstm/branches/JBOSSTS_4_15_0_Final/ArjunaJTS/jtax/tests/classes/com/hp/mwtests/ts/jta/jts/nested/SimpleNestedTest.java 2011-10-18 11:51:25 UTC (rev 37590)
+++ labs/jbosstm/branches/JBOSSTS_4_15_0_Final/ArjunaJTS/jtax/tests/classes/com/hp/mwtests/ts/jta/jts/nested/SimpleNestedTest.java 2011-10-18 14:41:03 UTC (rev 37591)
@@ -1,8 +1,8 @@
/*
* JBoss, Home of Professional Open Source
* Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags.
- * See the copyright.txt in the distribution for a full listing
+ * as indicated by the @author tags.
+ * See the copyright.txt in the distribution for a full listing
* of individual contributors.
* This copyrighted material is made available to anyone wishing to use,
* modify, copy, or redistribute it subject to the terms and conditions
@@ -14,7 +14,7 @@
* v.2.1 along with this distribution; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301, USA.
- *
+ *
* (C) 2005-2006,
* @author JBoss Inc.
*/
@@ -68,53 +68,15 @@
transactionManager.begin();
transactionManager.begin();
-
- transactionManager.commit();
transactionManager.commit();
- myOA.destroy();
- myORB.shutdown();
-
- }
-
- @Test
- public void testDisabled () throws Exception
- {
- ORB myORB = null;
- RootOA myOA = null;
-
- myORB = ORB.getInstance("test");
- myOA = OA.getRootOA(myORB);
-
- myORB.initORB(new String[] {}, null);
- myOA.initOA();
-
- ORBManager.setORB(myORB);
- ORBManager.setPOA(myOA);
-
- jtaPropertyManager.getJTAEnvironmentBean().setTransactionManagerClassName(com.arjuna.ats.internal.jta.transaction.jts.TransactionManagerImple.class.getName());
- jtaPropertyManager.getJTAEnvironmentBean().setUserTransactionClassName(com.arjuna.ats.internal.jta.transaction.jts.UserTransactionImple.class.getName());
- jtaPropertyManager.getJTAEnvironmentBean().setSupportSubtransactions(false);
-
- javax.transaction.TransactionManager transactionManager = com.arjuna.ats.jta.TransactionManager.transactionManager();
-
- transactionManager.begin();
-
- try
- {
- transactionManager.begin();
-
- fail();
- }
- catch (final NotSupportedException ex)
- {
- }
-
transactionManager.commit();
myOA.destroy();
myORB.shutdown();
}
+
+ // testDisabled moved to its own class, as it needs separate jvm to allow different property value in static init.
}
More information about the jboss-svn-commits
mailing list