labs-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simo...@apache.org
Subject svn commit: r741818 - in /labs/magma/trunk/database-junit-pack/src/main/java/org/apache/magma/database: junitpack/ openjpa/ openjpa/RollbackAfterTeardown.aj
Date Sat, 07 Feb 2009 02:16:34 GMT
Author: simoneg
Date: Sat Feb  7 02:16:34 2009
New Revision: 741818

URL: http://svn.apache.org/viewvc?rev=741818&view=rev
Log:
LABS-162 : adapted to jpa refactoring

Added:
    labs/magma/trunk/database-junit-pack/src/main/java/org/apache/magma/database/openjpa/
  (props changed)
      - copied from r735585, labs/magma/trunk/database-junit-pack/src/main/java/org/apache/magma/database/junitpack/
Removed:
    labs/magma/trunk/database-junit-pack/src/main/java/org/apache/magma/database/junitpack/
Modified:
    labs/magma/trunk/database-junit-pack/src/main/java/org/apache/magma/database/openjpa/RollbackAfterTeardown.aj

Propchange: labs/magma/trunk/database-junit-pack/src/main/java/org/apache/magma/database/openjpa/
------------------------------------------------------------------------------
    svn:mergeinfo = 

Modified: labs/magma/trunk/database-junit-pack/src/main/java/org/apache/magma/database/openjpa/RollbackAfterTeardown.aj
URL: http://svn.apache.org/viewvc/labs/magma/trunk/database-junit-pack/src/main/java/org/apache/magma/database/openjpa/RollbackAfterTeardown.aj?rev=741818&r1=735585&r2=741818&view=diff
==============================================================================
--- labs/magma/trunk/database-junit-pack/src/main/java/org/apache/magma/database/openjpa/RollbackAfterTeardown.aj
(original)
+++ labs/magma/trunk/database-junit-pack/src/main/java/org/apache/magma/database/openjpa/RollbackAfterTeardown.aj
Sat Feb  7 02:16:34 2009
@@ -14,10 +14,10 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.magma.database.junitpack;
+package org.apache.magma.database.openjpa;
 
+import org.apache.magma.basics.startup.Cycle;
 import org.apache.magma.database.openjpa.JPADatabase;
-import org.apache.magma.database.openjpa.JPADatabasesRegistry;
 
 import java.util.Set;
 
@@ -27,17 +27,12 @@
 
 	pointcut tearDown() : execution(* TestCase.tearDown());
 	
-	
 	after() : tearDown() {
-		Set<JPADatabase> dbs = JPADatabasesRegistry.get();
-		if (dbs == null) return;
-		for (JPADatabase db : dbs) {
-			try {
-				db.rollback();
-			} finally {
-				JPADatabasesRegistry.remove(db);
-			}
-		}		
+		Cycle cycle = Cycle.get();
+		if (cycle.currentDb != null) {
+			cycle.currentDb.rollback();
+		}
+		cycle.currentDb = null;
 	}
 	
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@labs.apache.org
For additional commands, e-mail: commits-help@labs.apache.org


Mime
View raw message