Author: dwoods
Date: Fri Oct  8 17:25:47 2010
New Revision: 1005916

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

Modified:
    
openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/xml/TestMetaDataComplete.java

Modified: 
openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/xml/TestMetaDataComplete.java
URL: 
http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/xml/TestMetaDataComplete.java?rev=1005916&r1=1005915&r2=1005916&view=diff
==============================================================================
--- 
openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/xml/TestMetaDataComplete.java
 (original)
+++ 
openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/xml/TestMetaDataComplete.java
 Fri Oct  8 17:25:47 2010
@@ -45,8 +45,8 @@ import org.apache.openjpa.persistence.te
  */
 public class TestMetaDataComplete extends SingleEMFTestCase {
        private static OpenJPAEntityManagerFactorySPI oemf;
-
        private static ClassMetaData entityA, entityB, derivedA, derivedB;
+       private static int currentTest = 0;
 
        public void setUp() throws Exception {
                if (oemf == null) {
@@ -62,10 +62,18 @@ public class TestMetaDataComplete extend
             derivedA = repos.getMetaData(DerivedA.class, null, true);
             derivedB = repos.getMetaData(DerivedB.class, null, true);
                }
+               currentTest++;
        }
 
-       public void tearDown() {
-
+       public void tearDown() throws Exception {
+           if (currentTest >= 6) {
+               super.tearDown();
+               oemf = null;
+            entityA = null;
+            entityB = null;
+            derivedA = null;
+            derivedB = null;
+           }
        }
 
        protected String getPersistenceUnitName() {


Reply via email to