geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lin...@apache.org
Subject svn commit: r725423 - in /geronimo/components/txmanager/trunk/geronimo-transaction/src: main/java/org/apache/geronimo/transaction/manager/TransactionManagerImpl.java test/java/org/apache/geronimo/transaction/manager/TransactionManagerImplTest.java
Date Wed, 10 Dec 2008 20:38:32 GMT
Author: linsun
Date: Wed Dec 10 12:38:32 2008
New Revision: 725423

URL: http://svn.apache.org/viewvc?rev=725423&view=rev
Log:
enable testResume4 - related to GERONIMO-4448

Modified:
    geronimo/components/txmanager/trunk/geronimo-transaction/src/main/java/org/apache/geronimo/transaction/manager/TransactionManagerImpl.java
    geronimo/components/txmanager/trunk/geronimo-transaction/src/test/java/org/apache/geronimo/transaction/manager/TransactionManagerImplTest.java

Modified: geronimo/components/txmanager/trunk/geronimo-transaction/src/main/java/org/apache/geronimo/transaction/manager/TransactionManagerImpl.java
URL: http://svn.apache.org/viewvc/geronimo/components/txmanager/trunk/geronimo-transaction/src/main/java/org/apache/geronimo/transaction/manager/TransactionManagerImpl.java?rev=725423&r1=725422&r2=725423&view=diff
==============================================================================
--- geronimo/components/txmanager/trunk/geronimo-transaction/src/main/java/org/apache/geronimo/transaction/manager/TransactionManagerImpl.java
(original)
+++ geronimo/components/txmanager/trunk/geronimo-transaction/src/main/java/org/apache/geronimo/transaction/manager/TransactionManagerImpl.java
Wed Dec 10 12:38:32 2008
@@ -176,10 +176,10 @@
     }
 
     public void resume(Transaction tx) throws IllegalStateException, InvalidTransactionException,
SystemException {
-        if (getTransaction() != null) {
+        if (getTransaction() != null && tx != getTransaction()) {
             throw new IllegalStateException("Thread already associated with another transaction");
         }
-        if (tx != null) {
+        if (tx != null && tx != getTransaction()) {
             if (!(tx instanceof TransactionImpl)) {
                 throw new InvalidTransactionException("Cannot resume foreign transaction:
" + tx);
             }

Modified: geronimo/components/txmanager/trunk/geronimo-transaction/src/test/java/org/apache/geronimo/transaction/manager/TransactionManagerImplTest.java
URL: http://svn.apache.org/viewvc/geronimo/components/txmanager/trunk/geronimo-transaction/src/test/java/org/apache/geronimo/transaction/manager/TransactionManagerImplTest.java?rev=725423&r1=725422&r2=725423&view=diff
==============================================================================
--- geronimo/components/txmanager/trunk/geronimo-transaction/src/test/java/org/apache/geronimo/transaction/manager/TransactionManagerImplTest.java
(original)
+++ geronimo/components/txmanager/trunk/geronimo-transaction/src/test/java/org/apache/geronimo/transaction/manager/TransactionManagerImplTest.java
Wed Dec 10 12:38:32 2008
@@ -395,7 +395,7 @@
     }
     
     // resume works on any valid tx
-    /*public void testResume4() throws Exception {
+    public void testResume4() throws Exception {
         Transaction tx;
         assertEquals(Status.STATUS_NO_TRANSACTION, tm.getStatus());
         tm.begin();
@@ -409,7 +409,7 @@
             assertNotNull(tx);
             assertEquals(Status.STATUS_ACTIVE, tx.getStatus());
         } catch (InvalidTransactionException e) {
-            // null is considered valid so we don't expect InvalidTransactionException here
+            // tx is considered valid so we don't expect InvalidTransactionException here
             e.printStackTrace();
             fail();
         }   
@@ -417,5 +417,5 @@
         tm.commit();
         assertEquals(Status.STATUS_NO_TRANSACTION, tm.getStatus());
         assertNull(tm.getTransaction()); 
-    }*/
+    }
 }



Mime
View raw message