From 8510080d45539355c3629405c1bea720f246bf13 Mon Sep 17 00:00:00 2001 From: Donald Woods Date: Tue, 26 Oct 2010 16:40:30 +0000 Subject: [PATCH] test cleanup git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@1027638 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/openjpa/persistence/datacache/CacheLoadTest.java | 1 + .../persistence/datacache/TestDataCacheBehavesIdentical.java | 2 ++ .../openjpa/persistence/datacache/TestEntitiesAsKeys.java | 1 + .../apache/openjpa/persistence/datacache/TestJPQL2Queries.java | 1 + .../persistence/datacache/TestJPQL2ResultsAndResultClasses.java | 2 +- .../persistence/datacache/TestJPQLRelationProjections.java | 2 +- .../openjpa/persistence/datacache/TestMutableParameters.java | 1 + .../apache/openjpa/persistence/datacache/TestResultShapes.java | 2 +- 8 files changed, 9 insertions(+), 3 deletions(-) diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/datacache/CacheLoadTest.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/datacache/CacheLoadTest.java index 083f78685..f02589d73 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/datacache/CacheLoadTest.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/datacache/CacheLoadTest.java @@ -65,6 +65,7 @@ public class CacheLoadTest @Override public void tearDown() throws Exception { closeEMF(emf); + emf = null; super.tearDown(); } diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/datacache/TestDataCacheBehavesIdentical.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/datacache/TestDataCacheBehavesIdentical.java index 3a19cad03..971142cab 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/datacache/TestDataCacheBehavesIdentical.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/datacache/TestDataCacheBehavesIdentical.java @@ -106,7 +106,9 @@ public class TestDataCacheBehavesIdentical extends AbstractTestCase { // HACK - need to manually close EMFs after all tests have run if (TEST_COUNT >= 21) { closeEMF(emfWithDataCache); + emfWithDataCache = null; closeEMF(emfWithoutDataCache); + emfWithoutDataCache = null; super.tearDown(); } } diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/datacache/TestEntitiesAsKeys.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/datacache/TestEntitiesAsKeys.java index c2ae29ae4..db47c3b80 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/datacache/TestEntitiesAsKeys.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/datacache/TestEntitiesAsKeys.java @@ -42,6 +42,7 @@ public class TestEntitiesAsKeys extends AbstractPersistenceTestCase { public void tearDown() throws Exception { closeEMF(emf); emf = null; + super.tearDown(); } public void populate() { diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/datacache/TestJPQL2Queries.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/datacache/TestJPQL2Queries.java index 1dda8124c..5a4d5d827 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/datacache/TestJPQL2Queries.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/datacache/TestJPQL2Queries.java @@ -68,6 +68,7 @@ public class TestJPQL2Queries throws Exception { try { _factory.close(); + _factory = null; } catch (Exception e) { } diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/datacache/TestJPQL2ResultsAndResultClasses.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/datacache/TestJPQL2ResultsAndResultClasses.java index 77d29c182..a50188111 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/datacache/TestJPQL2ResultsAndResultClasses.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/datacache/TestJPQL2ResultsAndResultClasses.java @@ -106,7 +106,7 @@ public class TestJPQL2ResultsAndResultClasses public void tearDown() throws Exception { _factory.close(); - + _factory = null; super.tearDown(); } diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/datacache/TestJPQLRelationProjections.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/datacache/TestJPQLRelationProjections.java index 5b1528a63..85c2918d5 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/datacache/TestJPQLRelationProjections.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/datacache/TestJPQLRelationProjections.java @@ -95,7 +95,7 @@ public class TestJPQLRelationProjections public void tearDown() throws Exception { _factory.close(); - + _factory = null; super.tearDown(); } diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/datacache/TestMutableParameters.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/datacache/TestMutableParameters.java index 0d51591e9..f68639d24 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/datacache/TestMutableParameters.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/datacache/TestMutableParameters.java @@ -80,6 +80,7 @@ public class TestMutableParameters throws Exception { try { _factory.close(); + _factory = null; } catch (Exception e) { } diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/datacache/TestResultShapes.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/datacache/TestResultShapes.java index 28641fe86..e1df38e36 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/datacache/TestResultShapes.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/datacache/TestResultShapes.java @@ -69,7 +69,7 @@ public class TestResultShapes extends AbstractTestCase { public void tearDown() throws Exception { _broker.close(); - + _broker = null; super.tearDown(); }