[jboss-svn-commits] JBL Code SVN: r37670 - in labs/jbosstm/trunk: ArjunaJTA/jta/tests/classes/com/hp/mwtests/ts/jta/nested and 2 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Tue Oct 25 12:29:37 EDT 2011
Author: tomjenkinson
Date: 2011-10-25 12:29:37 -0400 (Tue, 25 Oct 2011)
New Revision: 37670
Added:
labs/jbosstm/trunk/ArjunaJTA/jta/tests/classes/com/hp/mwtests/ts/jta/nested/SimpleNestedDisabledTest.java
labs/jbosstm/trunk/ArjunaJTS/jtax/tests/classes/com/hp/mwtests/ts/jta/jts/nested/SimpleNestedDisabledTest.java
Modified:
labs/jbosstm/trunk/ArjunaJTA/jta/classes/com/arjuna/ats/internal/jta/transaction/arjunacore/BaseTransaction.java
labs/jbosstm/trunk/ArjunaJTA/jta/tests/classes/com/hp/mwtests/ts/jta/nested/SimpleNestedTest.java
labs/jbosstm/trunk/ArjunaJTS/jtax/classes/com/arjuna/ats/internal/jta/transaction/jts/BaseTransaction.java
labs/jbosstm/trunk/ArjunaJTS/jtax/tests/classes/com/hp/mwtests/ts/jta/jts/nested/SimpleNestedTest.java
Log:
JBTM-929 backport from branch
Modified: labs/jbosstm/trunk/ArjunaJTA/jta/classes/com/arjuna/ats/internal/jta/transaction/arjunacore/BaseTransaction.java
===================================================================
--- labs/jbosstm/trunk/ArjunaJTA/jta/classes/com/arjuna/ats/internal/jta/transaction/arjunacore/BaseTransaction.java 2011-10-25 11:27:19 UTC (rev 37669)
+++ labs/jbosstm/trunk/ArjunaJTA/jta/classes/com/arjuna/ats/internal/jta/transaction/arjunacore/BaseTransaction.java 2011-10-25 16:29:37 UTC (rev 37670)
@@ -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/trunk/ArjunaJTA/jta/tests/classes/com/hp/mwtests/ts/jta/nested/SimpleNestedDisabledTest.java
===================================================================
--- labs/jbosstm/trunk/ArjunaJTA/jta/tests/classes/com/hp/mwtests/ts/jta/nested/SimpleNestedDisabledTest.java (rev 0)
+++ labs/jbosstm/trunk/ArjunaJTA/jta/tests/classes/com/hp/mwtests/ts/jta/nested/SimpleNestedDisabledTest.java 2011-10-25 16:29:37 UTC (rev 37670)
@@ -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/trunk/ArjunaJTA/jta/tests/classes/com/hp/mwtests/ts/jta/nested/SimpleNestedTest.java
===================================================================
--- labs/jbosstm/trunk/ArjunaJTA/jta/tests/classes/com/hp/mwtests/ts/jta/nested/SimpleNestedTest.java 2011-10-25 11:27:19 UTC (rev 37669)
+++ labs/jbosstm/trunk/ArjunaJTA/jta/tests/classes/com/hp/mwtests/ts/jta/nested/SimpleNestedTest.java 2011-10-25 16:29:37 UTC (rev 37670)
@@ -66,26 +66,5 @@
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/trunk/ArjunaJTS/jtax/classes/com/arjuna/ats/internal/jta/transaction/jts/BaseTransaction.java
===================================================================
--- labs/jbosstm/trunk/ArjunaJTS/jtax/classes/com/arjuna/ats/internal/jta/transaction/jts/BaseTransaction.java 2011-10-25 11:27:19 UTC (rev 37669)
+++ labs/jbosstm/trunk/ArjunaJTS/jtax/classes/com/arjuna/ats/internal/jta/transaction/jts/BaseTransaction.java 2011-10-25 16:29:37 UTC (rev 37670)
@@ -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/trunk/ArjunaJTS/jtax/tests/classes/com/hp/mwtests/ts/jta/jts/nested/SimpleNestedDisabledTest.java
===================================================================
--- labs/jbosstm/trunk/ArjunaJTS/jtax/tests/classes/com/hp/mwtests/ts/jta/jts/nested/SimpleNestedDisabledTest.java (rev 0)
+++ labs/jbosstm/trunk/ArjunaJTS/jtax/tests/classes/com/hp/mwtests/ts/jta/jts/nested/SimpleNestedDisabledTest.java 2011-10-25 16:29:37 UTC (rev 37670)
@@ -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/trunk/ArjunaJTS/jtax/tests/classes/com/hp/mwtests/ts/jta/jts/nested/SimpleNestedTest.java
===================================================================
--- labs/jbosstm/trunk/ArjunaJTS/jtax/tests/classes/com/hp/mwtests/ts/jta/jts/nested/SimpleNestedTest.java 2011-10-25 11:27:19 UTC (rev 37669)
+++ labs/jbosstm/trunk/ArjunaJTS/jtax/tests/classes/com/hp/mwtests/ts/jta/jts/nested/SimpleNestedTest.java 2011-10-25 16:29:37 UTC (rev 37670)
@@ -78,43 +78,5 @@
}
- @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