summaryrefslogtreecommitdiff
path: root/dbaccess
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2017-11-16 08:30:07 +0100
committerStephan Bergmann <sbergman@redhat.com>2017-11-16 18:28:36 +0100
commit84e1a01e2d1964a143f5b01fa0b70d9570dcb834 (patch)
tree8ad422dd417f3e41b02742effb44b661a7c25fee /dbaccess
parent20f6242b2c50876754368eeadcdc8902cf76e79a (diff)
Delete test*.odb files
...that are created in java.io.tmpdir (e.g., /tmp on Linux) by connectivity.tools.HsqlDatabase.createDBDocument() during e.g. JunitTest_dbaccess_complex. This revealed that connectivity.tools.AbstractDatabase.delete() (even if it would have been called by the test) would have been non-effective at deleting the file, as the java.io.File constructor used takes a pathname not a file URL as argument, so the call to java.io.File.delete() would not have deleted the relevant file (and returned false, rather). Change-Id: I268e1d1732ac7a0db9ccde7d4ac4f09aa3811e11 Reviewed-on: https://gerrit.libreoffice.org/44801 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'dbaccess')
-rw-r--r--dbaccess/qa/complex/dbaccess/RowSet.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/dbaccess/qa/complex/dbaccess/RowSet.java b/dbaccess/qa/complex/dbaccess/RowSet.java
index e617d2546525..4c5fcc6da793 100644
--- a/dbaccess/qa/complex/dbaccess/RowSet.java
+++ b/dbaccess/qa/complex/dbaccess/RowSet.java
@@ -47,6 +47,7 @@ import java.lang.reflect.Method;
import java.util.Random;
// ---------- junit imports -----------------
+import org.junit.After;
import org.junit.Test;
import static org.junit.Assert.*;
@@ -127,6 +128,11 @@ public class RowSet extends TestCase
}
}
+ @After public final void closeAndDeleteDatabase() {
+ if (m_database != null) {
+ m_database.closeAndDelete();
+ }
+ }
/** creates a com.sun.star.sdb.RowSet to use during the test
* @param command