db-jdo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mcai...@apache.org
Subject svn commit: r497602 - /db/jdo/trunk/tck20/src/java/org/apache/jdo/tck/lifecycle/StateTransitions.java
Date Thu, 18 Jan 2007 22:16:14 GMT
Author: mcaisse
Date: Thu Jan 18 14:16:14 2007
New Revision: 497602

URL: http://svn.apache.org/viewvc?view=rev&rev=497602
Log:
JDO-460 Fixed test problems

Modified:
    db/jdo/trunk/tck20/src/java/org/apache/jdo/tck/lifecycle/StateTransitions.java

Modified: db/jdo/trunk/tck20/src/java/org/apache/jdo/tck/lifecycle/StateTransitions.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/tck20/src/java/org/apache/jdo/tck/lifecycle/StateTransitions.java?view=diff&rev=497602&r1=497601&r2=497602
==============================================================================
--- db/jdo/trunk/tck20/src/java/org/apache/jdo/tck/lifecycle/StateTransitions.java (original)
+++ db/jdo/trunk/tck20/src/java/org/apache/jdo/tck/lifecycle/StateTransitions.java Thu Jan
18 14:16:14 2007
@@ -447,10 +447,9 @@
 
     /** */
     public void prepareTransactionAndJDOSettings(Transaction transaction) {
-        if( scenario != NO_TX ) {
             transaction.setNontransactionalRead(false);
             transaction.setNontransactionalWrite(false);
-            
+        if( scenario != NO_TX ) {
             if( operation == COMMITNORETAINVALUES )
                 transaction.setRetainValues(false);
             if( operation == COMMITRETAINVALUES )
@@ -564,7 +563,7 @@
                                           operations[operation] +
                                           "; JDOUserException should have been thrown");
                         } else {
-                            if( new_state != current_state ){
+                            if( !compareStates(new_state, current_state) ) { 
                                 appendMessage(ASSERTION_FAILED + NL +
                                               "StateTransitions: " +
                                               scenario_string[scenario] +
@@ -587,6 +586,9 @@
                     if( transaction.isActive() ) transaction.rollback();
                 } 
                 catch(Exception unexpected_exception) {
+                    if (debug) {
+                        unexpected_exception.printStackTrace();
+                    }
                     if (transaction.isActive()) 
                         transaction.rollback();
                     appendMessage(ASSERTION_FAILED + NL +
@@ -895,6 +897,12 @@
     /** */
     public StateTransitionObj getHollowInstance()
     {
+        if ( !transaction.isActive() )
+            transaction.begin();
+        if( !transaction.isActive() )
+            if (debug)
+                logger.debug("getHollowInstance: Transaction should be active, but it is
not");
+        
         Extent extent = pm.getExtent(StateTransitionObj.class, false);
         Iterator iter = extent.iterator();
         if( !iter.hasNext() ){
@@ -905,12 +913,6 @@
         StateTransitionObj obj = (StateTransitionObj) iter.next();
         
         transaction.setRetainValues(false);
-        if ( !transaction.isActive() )
-            transaction.begin();
-        if( !transaction.isActive() )
-            if (debug)
-                logger.debug("getHollowInstance: Transaction should be active, but it is
not");
-        
         transaction.commit(); // This should put the instance in the HOLLOW state
 
         prepareTransactionAndJDOSettings(transaction);



Mime
View raw message