changeset 681:32e7ac7b979e

Tests should always cleanup their created objects, so added cleanup() method.
author Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
date Thu, 03 Nov 2022 22:29:30 +0100 (2022-11-03)
parents 238d6a3a6469
children 78253fdb3c3f
files tests/ConnectionTests.java
diffstat 1 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/tests/ConnectionTests.java
+++ b/tests/ConnectionTests.java
@@ -77,6 +77,8 @@ public class ConnectionTests {
 		tester.withProp("autocommit", "false").checkAutoCommit(false);
 
 		tester.testTimeZone();
+
+		tester.cleanup();
 	}
 
 	Connection connect() throws SQLException {
@@ -159,6 +161,13 @@ public class ConnectionTests {
 		}
 	}
 
+	private void cleanup() throws SQLException {
+		try (Connection conn = connect(); Statement stmt = conn.createStatement()) {
+			stmt.execute("DROP TABLE IF EXISTS connectiontests");
+			stmt.execute("DROP TABLE IF EXISTS connectiontests_ts");
+		}
+	}
+
 	public class Failure extends Exception {
 		private static final long serialVersionUID = 1L;