diff options
Diffstat (limited to 'connectivity')
-rw-r--r-- | connectivity/Jar_ConnectivityTools.mk | 4 | ||||
-rw-r--r-- | connectivity/qa/connectivity/tools/AbstractDatabase.java | 16 |
2 files changed, 19 insertions, 1 deletions
diff --git a/connectivity/Jar_ConnectivityTools.mk b/connectivity/Jar_ConnectivityTools.mk index e398d7372ef0..fc8a861f2b8a 100644 --- a/connectivity/Jar_ConnectivityTools.mk +++ b/connectivity/Jar_ConnectivityTools.mk @@ -19,6 +19,10 @@ $(eval $(call gb_Jar_use_jars,ConnectivityTools,\ OOoRunner \ )) +$(eval $(call gb_Jar_use_system_jars,ConnectivityTools, \ + $(OOO_JUNIT_JAR) \ +)) + $(eval $(call gb_Jar_set_packageroot,ConnectivityTools,connectivity)) $(eval $(call gb_Jar_add_sourcefiles,ConnectivityTools,\ diff --git a/connectivity/qa/connectivity/tools/AbstractDatabase.java b/connectivity/qa/connectivity/tools/AbstractDatabase.java index 3207dafcd6e8..f7295d948517 100644 --- a/connectivity/qa/connectivity/tools/AbstractDatabase.java +++ b/connectivity/qa/connectivity/tools/AbstractDatabase.java @@ -31,6 +31,7 @@ import com.sun.star.uno.UnoRuntime; import com.sun.star.util.CloseVetoException; import connectivity.tools.sdb.Connection; import java.io.File; +import static org.junit.Assert.*; public abstract class AbstractDatabase implements DatabaseAccess { @@ -120,7 +121,11 @@ public abstract class AbstractDatabase implements DatabaseAccess public void closeAndDelete() { close(); + delete(); + } + private void delete() + { if (m_databaseDocumentFile != null) { final File file = new File(m_databaseDocumentFile); @@ -184,7 +189,16 @@ public abstract class AbstractDatabase implements DatabaseAccess @Override protected void finalize() throws Throwable { - closeAndDelete(); + // Cannot call close() here, as it accesses UNO objects (that may + // already have been finalized): + assertNull( + "missing call to connectivity.tools.AbstractDatabase.close", + m_connection); + assertNull( + "missing call to connectivity.tools.AbstractDatabase.close", + m_databaseDocument); + + delete(); super.finalize(); } |