openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dwo...@apache.org
Subject svn commit: r1005997 - /openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cache/jpa/
Date Fri, 08 Oct 2010 20:06:34 GMT
Author: dwoods
Date: Fri Oct  8 20:06:33 2010
New Revision: 1005997

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

Modified:
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cache/jpa/AbstractCacheTestCase.java
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cache/jpa/TestCacheModeAll.java
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cache/jpa/TestCacheModeDisableSelective.java
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cache/jpa/TestCacheModeEmpty.java
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cache/jpa/TestCacheModeEnableSelective.java
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cache/jpa/TestCacheModeInvalid.java
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cache/jpa/TestCacheModeNone.java
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cache/jpa/TestCacheModeUnspecified.java
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cache/jpa/TestPropertyCacheModeAll.java
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cache/jpa/TestPropertyCacheModeDisableSelective.java
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cache/jpa/TestPropertyCacheModeEnableSelective.java
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cache/jpa/TestPropertyCacheModeInvalid.java
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cache/jpa/TestPropertyCacheModeNone.java
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cache/jpa/TestPropertyCacheModeUnspecified.java

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cache/jpa/AbstractCacheTestCase.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cache/jpa/AbstractCacheTestCase.java?rev=1005997&r1=1005996&r2=1005997&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cache/jpa/AbstractCacheTestCase.java
(original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cache/jpa/AbstractCacheTestCase.java
Fri Oct  8 20:06:33 2010
@@ -41,6 +41,8 @@ public abstract class AbstractCacheTestC
     protected final String RETRIEVE_MODE_PROP = "javax.persistence.cache.retrieveMode";
     protected final String STORE_MODE_PROP = "javax.persistence.cache.storeMode";
     
+    protected static OpenJPAEntityManagerFactorySPI emf = null;
+
     abstract OpenJPAEntityManagerFactorySPI getEntityManagerFactory();
     abstract JDBCListener getListener();
 
@@ -87,6 +89,16 @@ public abstract class AbstractCacheTestC
         populate();
     }
     
+    @Override
+    public void tearDown() throws Exception {
+        super.tearDown();
+        if (emf != null) {
+            clear(emf);
+            closeEMF(emf);
+            emf = null;
+        }
+    }
+    
     public void cleanDatabase() throws Exception {
         EntityManager em = getEntityManagerFactory().createEntityManager();
         em.getTransaction().begin();

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cache/jpa/TestCacheModeAll.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cache/jpa/TestCacheModeAll.java?rev=1005997&r1=1005996&r2=1005997&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cache/jpa/TestCacheModeAll.java
(original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cache/jpa/TestCacheModeAll.java
Fri Oct  8 20:06:33 2010
@@ -28,7 +28,6 @@ import org.apache.openjpa.persistence.Op
 
 public class TestCacheModeAll extends AbstractCacheModeTestCase {
 
-    private static OpenJPAEntityManagerFactorySPI emf = null;
     private static Cache cache = null;
     private static List<String> sql = new ArrayList<String>();
     private static JDBCListener listener;

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cache/jpa/TestCacheModeDisableSelective.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cache/jpa/TestCacheModeDisableSelective.java?rev=1005997&r1=1005996&r2=1005997&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cache/jpa/TestCacheModeDisableSelective.java
(original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cache/jpa/TestCacheModeDisableSelective.java
Fri Oct  8 20:06:33 2010
@@ -34,7 +34,6 @@ import org.apache.openjpa.persistence.ca
 
 public class TestCacheModeDisableSelective extends AbstractCacheModeTestCase {
 
-    private static OpenJPAEntityManagerFactorySPI emf = null;
     private static Cache cache = null;
     private static List<String> sql = new ArrayList<String>();
     private static JDBCListener listener;

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cache/jpa/TestCacheModeEmpty.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cache/jpa/TestCacheModeEmpty.java?rev=1005997&r1=1005996&r2=1005997&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cache/jpa/TestCacheModeEmpty.java
(original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cache/jpa/TestCacheModeEmpty.java
Fri Oct  8 20:06:33 2010
@@ -27,7 +27,7 @@ import org.apache.openjpa.lib.jdbc.JDBCL
 import org.apache.openjpa.persistence.OpenJPAEntityManagerFactorySPI;
 
 public class TestCacheModeEmpty extends AbstractCacheModeTestCase {
-    private static OpenJPAEntityManagerFactorySPI emf = null;
+    
     private static Cache cache = null;
     private static List<String> sql = new ArrayList<String>();
     private static JDBCListener listener;

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cache/jpa/TestCacheModeEnableSelective.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cache/jpa/TestCacheModeEnableSelective.java?rev=1005997&r1=1005996&r2=1005997&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cache/jpa/TestCacheModeEnableSelective.java
(original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cache/jpa/TestCacheModeEnableSelective.java
Fri Oct  8 20:06:33 2010
@@ -34,7 +34,6 @@ import org.apache.openjpa.persistence.ca
 
 public class TestCacheModeEnableSelective extends AbstractCacheModeTestCase {
 
-    private static OpenJPAEntityManagerFactorySPI emf = null;
     private static Cache cache = null;
     private static List<String> sql = new ArrayList<String>();
     private static JDBCListener listener;

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cache/jpa/TestCacheModeInvalid.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cache/jpa/TestCacheModeInvalid.java?rev=1005997&r1=1005996&r2=1005997&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cache/jpa/TestCacheModeInvalid.java
(original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cache/jpa/TestCacheModeInvalid.java
Fri Oct  8 20:06:33 2010
@@ -25,8 +25,6 @@ import org.apache.openjpa.persistence.Op
 import org.apache.openjpa.persistence.OpenJPAPersistence;
 
 public class TestCacheModeInvalid extends AbstractCacheTestCase {
-
-    private static OpenJPAEntityManagerFactorySPI emf = null;
     
     @Override
     public void setUp() {}

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cache/jpa/TestCacheModeNone.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cache/jpa/TestCacheModeNone.java?rev=1005997&r1=1005996&r2=1005997&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cache/jpa/TestCacheModeNone.java
(original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cache/jpa/TestCacheModeNone.java
Fri Oct  8 20:06:33 2010
@@ -28,7 +28,6 @@ import org.apache.openjpa.persistence.Op
 
 public class TestCacheModeNone extends AbstractCacheModeTestCase {
 
-    private static OpenJPAEntityManagerFactorySPI emf = null;
     private static Cache cache = null;
     private static List<String> sql = new ArrayList<String>();
     private static JDBCListener listener;

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cache/jpa/TestCacheModeUnspecified.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cache/jpa/TestCacheModeUnspecified.java?rev=1005997&r1=1005996&r2=1005997&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cache/jpa/TestCacheModeUnspecified.java
(original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cache/jpa/TestCacheModeUnspecified.java
Fri Oct  8 20:06:33 2010
@@ -27,7 +27,7 @@ import org.apache.openjpa.lib.jdbc.JDBCL
 import org.apache.openjpa.persistence.OpenJPAEntityManagerFactorySPI;
 
 public class TestCacheModeUnspecified extends AbstractCacheModeTestCase {
-    private static OpenJPAEntityManagerFactorySPI emf = null;
+
     private static Cache cache = null;
     private static List<String> sql = new ArrayList<String>();
     private static JDBCListener listener;

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cache/jpa/TestPropertyCacheModeAll.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cache/jpa/TestPropertyCacheModeAll.java?rev=1005997&r1=1005996&r2=1005997&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cache/jpa/TestPropertyCacheModeAll.java
(original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cache/jpa/TestPropertyCacheModeAll.java
Fri Oct  8 20:06:33 2010
@@ -30,7 +30,6 @@ import org.apache.openjpa.persistence.Op
 
 public class TestPropertyCacheModeAll extends AbstractCacheModeTestCase {
 
-    private static OpenJPAEntityManagerFactorySPI emf = null;
     private static Cache cache = null;
     private static List<String> sql = new ArrayList<String>();
     private static JDBCListener listener;

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cache/jpa/TestPropertyCacheModeDisableSelective.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cache/jpa/TestPropertyCacheModeDisableSelective.java?rev=1005997&r1=1005996&r2=1005997&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cache/jpa/TestPropertyCacheModeDisableSelective.java
(original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cache/jpa/TestPropertyCacheModeDisableSelective.java
Fri Oct  8 20:06:33 2010
@@ -36,7 +36,6 @@ import org.apache.openjpa.persistence.ca
 
 public class TestPropertyCacheModeDisableSelective extends AbstractCacheModeTestCase {
 
-    private static OpenJPAEntityManagerFactorySPI emf = null;
     private static Cache cache = null;
     private static List<String> sql = new ArrayList<String>();
     private static JDBCListener listener;

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cache/jpa/TestPropertyCacheModeEnableSelective.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cache/jpa/TestPropertyCacheModeEnableSelective.java?rev=1005997&r1=1005996&r2=1005997&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cache/jpa/TestPropertyCacheModeEnableSelective.java
(original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cache/jpa/TestPropertyCacheModeEnableSelective.java
Fri Oct  8 20:06:33 2010
@@ -36,7 +36,6 @@ import org.apache.openjpa.persistence.ca
 
 public class TestPropertyCacheModeEnableSelective extends AbstractCacheModeTestCase {
 
-    private static OpenJPAEntityManagerFactorySPI emf = null;
     private static Cache cache = null;
     private static List<String> sql = new ArrayList<String>();
     private static JDBCListener listener;

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cache/jpa/TestPropertyCacheModeInvalid.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cache/jpa/TestPropertyCacheModeInvalid.java?rev=1005997&r1=1005996&r2=1005997&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cache/jpa/TestPropertyCacheModeInvalid.java
(original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cache/jpa/TestPropertyCacheModeInvalid.java
Fri Oct  8 20:06:33 2010
@@ -26,7 +26,6 @@ import org.apache.openjpa.persistence.Op
 
 public class TestPropertyCacheModeInvalid extends AbstractCacheTestCase {
 
-    private static OpenJPAEntityManagerFactorySPI emf = null;
     
     @Override
     public void setUp() {}

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cache/jpa/TestPropertyCacheModeNone.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cache/jpa/TestPropertyCacheModeNone.java?rev=1005997&r1=1005996&r2=1005997&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cache/jpa/TestPropertyCacheModeNone.java
(original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cache/jpa/TestPropertyCacheModeNone.java
Fri Oct  8 20:06:33 2010
@@ -30,7 +30,6 @@ import org.apache.openjpa.persistence.Op
 
 public class TestPropertyCacheModeNone extends AbstractCacheModeTestCase {
 
-    private static OpenJPAEntityManagerFactorySPI emf = null;
     private static Cache cache = null;
     private static List<String> sql = new ArrayList<String>();
     private static JDBCListener listener;

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cache/jpa/TestPropertyCacheModeUnspecified.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cache/jpa/TestPropertyCacheModeUnspecified.java?rev=1005997&r1=1005996&r2=1005997&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cache/jpa/TestPropertyCacheModeUnspecified.java
(original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cache/jpa/TestPropertyCacheModeUnspecified.java
Fri Oct  8 20:06:33 2010
@@ -29,7 +29,7 @@ import org.apache.openjpa.lib.jdbc.JDBCL
 import org.apache.openjpa.persistence.OpenJPAEntityManagerFactorySPI;
 
 public class TestPropertyCacheModeUnspecified extends AbstractCacheModeTestCase {
-    private static OpenJPAEntityManagerFactorySPI emf = null;
+    
     private static Cache cache = null;
     private static List<String> sql = new ArrayList<String>();
     private static JDBCListener listener;



Mime
View raw message