diff tests/ConnectionTests.java @ 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 b25d838b4bcf
children aeb268156580
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;