openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dwo...@apache.org
Subject svn commit: r1006034 - in /openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/callbacks: TestExceptionsFromCallbacks.java TestPostPersistCallback.java
Date Fri, 08 Oct 2010 21:37:48 GMT
Author: dwoods
Date: Fri Oct  8 21:37:48 2010
New Revision: 1006034

URL: http://svn.apache.org/viewvc?rev=1006034&view=rev
Log:
make sure tests cleanup EMs and EMFs

Modified:
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/callbacks/TestExceptionsFromCallbacks.java
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/callbacks/TestPostPersistCallback.java

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/callbacks/TestExceptionsFromCallbacks.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/callbacks/TestExceptionsFromCallbacks.java?rev=1006034&r1=1006033&r2=1006034&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/callbacks/TestExceptionsFromCallbacks.java
(original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/callbacks/TestExceptionsFromCallbacks.java
Fri Oct  8 21:37:48 2010
@@ -39,6 +39,7 @@ public class TestExceptionsFromCallbacks
 
     @Override
     public void setUp() {
+        super.setUp(ExceptionsFromCallbacksEntity.class, CLEAR_TABLES);
         Set needEnhancement = new HashSet();
         needEnhancement.add(
             "testPostUpdateExceptionDuringFlushWithNewInstance");
@@ -52,11 +53,10 @@ public class TestExceptionsFromCallbacks
             "testPostUpdateExceptionDuringCommitWithExistingFlushedInstance");
         if (!PersistenceCapable.class.isAssignableFrom(
             ExceptionsFromCallbacksEntity.class)
-            && needEnhancement.contains(getName()))
+            && needEnhancement.contains(getName())) {
             // actually, we really only need redef
             fail("this test method does not work without enhancement");
-
-        setUp(ExceptionsFromCallbacksEntity.class, CLEAR_TABLES);
+        }
         testRunning = true;
     }
 

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/callbacks/TestPostPersistCallback.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/callbacks/TestPostPersistCallback.java?rev=1006034&r1=1006033&r2=1006034&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/callbacks/TestPostPersistCallback.java
(original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/callbacks/TestPostPersistCallback.java
Fri Oct  8 21:37:48 2010
@@ -54,6 +54,7 @@ public class TestPostPersistCallback ext
         assertFalse(pc.getId() == 0);
         assertEquals(1, pc.postPersistCallbackCount);
         assertEquals(pc.getId(), pc.idOnCallback);
+        em.close();
     }
     
     public void testPostPersistCalledAfterCommit() {
@@ -72,6 +73,7 @@ public class TestPostPersistCallback ext
         assertFalse(pc.getId() == 0);
         assertEquals(1, pc.postPersistCallbackCount);
         assertEquals(pc.getId(), pc.idOnCallback);
+        em.close();
     }
     
     public void testPostPersistCalledAfterPersist() {
@@ -92,5 +94,6 @@ public class TestPostPersistCallback ext
         
         assertEquals(1, pc.postPersistCallbackCount);
         assertEquals(pc.getId(), pc.idOnCallback);
+        em.close();
     }
 }



Mime
View raw message