openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dwo...@apache.org
Subject svn commit: r1027663 - in /openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/query: TestQueryParameters.java results/TestJPQLMultiSelectTypedResults.java
Date Tue, 26 Oct 2010 17:38:17 GMT
Author: dwoods
Date: Tue Oct 26 17:38:16 2010
New Revision: 1027663

URL: http://svn.apache.org/viewvc?rev=1027663&view=rev
Log:
tests need to cleanup EMFs

Modified:
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/query/TestQueryParameters.java
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/query/results/TestJPQLMultiSelectTypedResults.java

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/query/TestQueryParameters.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/query/TestQueryParameters.java?rev=1027663&r1=1027662&r2=1027663&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/query/TestQueryParameters.java
(original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/query/TestQueryParameters.java
Tue Oct 26 17:38:16 2010
@@ -45,18 +45,27 @@ import org.apache.openjpa.persistence.te
  */
 public class TestQueryParameters extends SingleEMFTestCase {
     private static OpenJPAEntityManagerFactorySPI oemf;
+    private static int TEST_COUNT = 0;
     private EntityManager em;
     
+    @Override
     public void setUp() {
         if (oemf == null) {
             super.setUp(SimpleEntity.class, "openjpa.DynamicEnhancementAgent", "false");
             oemf = (OpenJPAEntityManagerFactorySPI)OpenJPAPersistence.cast(emf);
         }
         em = oemf.createEntityManager();
+        TEST_COUNT++;
     }
     
-    public void tearDown() {
-        // do not close the factory
+    @Override
+    public void tearDown() throws Exception {
+        // do not close the factory until done
+        if (TEST_COUNT >= 20) {
+            closeEMF(oemf);
+            oemf = null;
+            super.tearDown();
+        }
     }
     
     public void testNamedParameterUsingReservedWord() {

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/query/results/TestJPQLMultiSelectTypedResults.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/query/results/TestJPQLMultiSelectTypedResults.java?rev=1027663&r1=1027662&r2=1027663&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/query/results/TestJPQLMultiSelectTypedResults.java
(original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/query/results/TestJPQLMultiSelectTypedResults.java
Tue Oct 26 17:38:16 2010
@@ -52,7 +52,7 @@ public class TestJPQLMultiSelectTypedRes
     public void setUp() throws Exception {
         setUp(CLEAR_TABLES, Order.class, Item.class, Shop.class, Producer.class,
               Person.class, Foo.class, Bar.class,
-             "openjpa.DynamicEnhancerAgent", "false");
+             "openjpa.DynamicEnhancementAgent", "false");
         populate();
     }
 



Mime
View raw message