From 147a08a21fbbe2e2447e8efef3a75be51232e128 Mon Sep 17 00:00:00 2001 From: rusher Date: Thu, 14 Nov 2024 20:46:43 +0100 Subject: [PATCH] [misc] parsec SSL fingerprint test correction --- .../java/org/mariadb/jdbc/integration/Common.java | 13 +++++++++++++ .../java/org/mariadb/jdbc/integration/SslTest.java | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/test/java/org/mariadb/jdbc/integration/Common.java b/src/test/java/org/mariadb/jdbc/integration/Common.java index 7f4828fa7..cf7a1681e 100644 --- a/src/test/java/org/mariadb/jdbc/integration/Common.java +++ b/src/test/java/org/mariadb/jdbc/integration/Common.java @@ -289,6 +289,19 @@ public boolean isWindows() { return System.getProperty("os.name").toLowerCase().contains("win"); } + public int getJavaVersion() { + String version = System.getProperty("java.version"); + if (version.startsWith("1.")) { + version = version.substring(2, 3); + } else { + int dot = version.indexOf("."); + if (dot != -1) { + version = version.substring(0, dot); + } + } + return Integer.parseInt(version); + } + public void cancelForVersion(int major, int minor) { String dbVersion = sharedConn.getMetaData().getDatabaseProductVersion(); Assumptions.assumeFalse(dbVersion.startsWith(major + "." + minor)); diff --git a/src/test/java/org/mariadb/jdbc/integration/SslTest.java b/src/test/java/org/mariadb/jdbc/integration/SslTest.java index 26cb5bf43..c76a3cebb 100644 --- a/src/test/java/org/mariadb/jdbc/integration/SslTest.java +++ b/src/test/java/org/mariadb/jdbc/integration/SslTest.java @@ -242,7 +242,7 @@ public void mandatoryEphemeralSsled25519() throws SQLException { @Test public void mandatoryEphemeralSslParsec() throws SQLException { Assumptions.assumeTrue(!"maxscale".equals(System.getenv("srv"))); - Assumptions.assumeTrue(isMariaDBServer() && minVersion(11, 6, 1)); + Assumptions.assumeTrue(isMariaDBServer() && minVersion(11, 6, 1) && getJavaVersion() >= 15); Statement stmt = sharedConn.createStatement(); try {