Index: src/java/org/apache/jdo/tck/JDO_Test.java
===================================================================
--- src/java/org/apache/jdo/tck/JDO_Test.java (Revision 385042)
+++ src/java/org/apache/jdo/tck/JDO_Test.java (Arbeitskopie)
@@ -160,7 +160,7 @@
protected static Properties PMFPropertiesObject;
/** The PersistenceManagerFactory. */
- protected PersistenceManagerFactory pmf;
+ protected static PersistenceManagerFactory pmf;
/** The PersistenceManager. */
protected PersistenceManager pm;
@@ -261,7 +261,10 @@
* That exception is thrown as a nested exception of JDOFatalException
* if and only if the testcase executed successful.
* Otherwise that exception is logged using fatal log level.
- * All other exceptions are logged using fatal log level, always.
+ * All other exceptions are logged using fatal log level, always.
+ * + * Note:Method tearDown does not close the pmf. This is done at the + * end of each configuration. */ protected final void tearDown() { try { @@ -287,13 +290,6 @@ setTearDownThrowable("localTearDown", t); } - try { - closePMF(); - } - catch (Throwable t) { - setTearDownThrowable("closePMF", t); - } - if (this.tearDownThrowable != null) { Throwable t = this.tearDownThrowable; this.tearDownThrowable = null; @@ -473,7 +469,7 @@ } /** Closes the pmf stored in this instance. */ - protected void closePMF() { + public static void closePMF() { JDOException failure = null; while (pmf != null) { try { @@ -499,7 +495,7 @@ } /** */ - protected PersistenceManager[] getFailedPersistenceManagers( + protected static PersistenceManager[] getFailedPersistenceManagers( String assertionFailure, JDOException ex) { Throwable[] nesteds = ex.getNestedExceptions(); int numberOfExceptions = nesteds==null ? 0 : nesteds.length; @@ -510,7 +506,7 @@ if (exc.getFailedObject() instanceof PersistenceManager) { result[i] = (PersistenceManager)failedObject; } else { - fail(assertionFailure, + throw new JDOFatalException(assertionFailure, "Unexpected failed object of type: " + failedObject.getClass().getName()); } Index: src/java/org/apache/jdo/tck/util/BatchTestRunner.java =================================================================== --- src/java/org/apache/jdo/tck/util/BatchTestRunner.java (Revision 385042) +++ src/java/org/apache/jdo/tck/util/BatchTestRunner.java (Arbeitskopie) @@ -32,6 +32,8 @@ import javax.jdo.JDOFatalException; +import org.apache.jdo.tck.JDO_Test; + /** * TestRunner class for running a single test or a test suite in batch * mode. The format of the test output is specified by the result printer @@ -85,6 +87,13 @@ new BatchTestRunner().doRun(suite, true); } + /** Runs the specified test and close the pmf. */ + public TestResult doRun(Test test) { + TestResult result = doRun(test, false); + JDO_Test.closePMF(); + return result; + } + /** * Runs in batch mode and sets an exit code. If the specified String * array includes a single fully qualified class name, this test class