From 892826578a7cefb901b8fe2e304aa1ce7470267a Mon Sep 17 00:00:00 2001 From: Gary Gregory Date: Wed, 24 Apr 2024 18:20:53 -0400 Subject: [PATCH] Add SystemUtils.IS_JAVA_22 - Add JavaVersion.JAVA_22 - Add missing test assertions --- src/changes/changes.xml | 3 +- .../org/apache/commons/lang3/JavaVersion.java | 9 + .../org/apache/commons/lang3/SystemUtils.java | 13 + .../apache/commons/lang3/JavaVersionTest.java | 69 +- .../apache/commons/lang3/SystemUtilsTest.java | 984 +++++++++++++++--- 5 files changed, 869 insertions(+), 209 deletions(-) diff --git a/src/changes/changes.xml b/src/changes/changes.xml index f56258941..730e50a54 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -58,7 +58,8 @@ The type attribute can be add,update,fix,remove. Add ArrayUtils.nullTo(T[], T[]). Add T ArrayUtils.arraycopy(T, int, T, int, int) fluent style. Add T ArrayUtils.arraycopy(T, int, int, int, Function) fluent style. - Add T ArrayUtils.arraycopy(T, int, int, int, Supplier) fluent style. + Add SystemUtils.IS_JAVA_22. + Add JavaVersion.JAVA_22. Improve Javadoc in ExceptionUtils #1136. Fixed two non-deterministic tests in EnumUtilsTest.java #1131. diff --git a/src/main/java/org/apache/commons/lang3/JavaVersion.java b/src/main/java/org/apache/commons/lang3/JavaVersion.java index 4c7831fc6..892df6c88 100644 --- a/src/main/java/org/apache/commons/lang3/JavaVersion.java +++ b/src/main/java/org/apache/commons/lang3/JavaVersion.java @@ -171,6 +171,13 @@ public enum JavaVersion { */ JAVA_21(21, "21"), + /** + * Java 22. + * + * @since 3.15.0 + */ + JAVA_22(22, "22"), + /** * The most recent Java version. Mainly introduced to avoid to break when a new version of Java is used. */ @@ -234,6 +241,8 @@ public enum JavaVersion { return JAVA_20; case "21": return JAVA_21; + case "22": + return JAVA_22; default: final float v = toFloatVersion(versionStr); if (v - 1. < 1.) { // then we need to check decimals > .9 diff --git a/src/main/java/org/apache/commons/lang3/SystemUtils.java b/src/main/java/org/apache/commons/lang3/SystemUtils.java index 1a98e7238..9844b0615 100644 --- a/src/main/java/org/apache/commons/lang3/SystemUtils.java +++ b/src/main/java/org/apache/commons/lang3/SystemUtils.java @@ -1110,6 +1110,19 @@ public class SystemUtils { */ public static final boolean IS_JAVA_21 = getJavaVersionMatches("21"); + /** + * Is {@code true} if this is Java version 22 (also 22.x versions). + *

+ * The field will return {@code false} if {@link #JAVA_VERSION} is {@code null}. + *

+ *

+ * This value is initialized when the class is loaded. + *

+ * + * @since 3.15.0 + */ + public static final boolean IS_JAVA_22 = getJavaVersionMatches("22"); + // Operating system checks // ----------------------------------------------------------------------- // These MUST be declared after those above as they depend on the diff --git a/src/test/java/org/apache/commons/lang3/JavaVersionTest.java b/src/test/java/org/apache/commons/lang3/JavaVersionTest.java index 0db6956ea..17c460290 100644 --- a/src/test/java/org/apache/commons/lang3/JavaVersionTest.java +++ b/src/test/java/org/apache/commons/lang3/JavaVersionTest.java @@ -18,18 +18,6 @@ */ package org.apache.commons.lang3; -import static org.apache.commons.lang3.JavaVersion.JAVA_0_9; -import static org.apache.commons.lang3.JavaVersion.JAVA_1_1; -import static org.apache.commons.lang3.JavaVersion.JAVA_1_2; -import static org.apache.commons.lang3.JavaVersion.JAVA_1_3; -import static org.apache.commons.lang3.JavaVersion.JAVA_1_4; -import static org.apache.commons.lang3.JavaVersion.JAVA_1_5; -import static org.apache.commons.lang3.JavaVersion.JAVA_1_6; -import static org.apache.commons.lang3.JavaVersion.JAVA_1_7; -import static org.apache.commons.lang3.JavaVersion.JAVA_1_8; -import static org.apache.commons.lang3.JavaVersion.JAVA_RECENT; -import static org.apache.commons.lang3.JavaVersion.get; -import static org.apache.commons.lang3.JavaVersion.getJavaVersion; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; @@ -43,40 +31,49 @@ public class JavaVersionTest extends AbstractLangTest { @Test public void testAtLeast() { - assertFalse(JAVA_1_2.atLeast(JAVA_1_5), "1.2 at least 1.5 passed"); - assertTrue(JAVA_1_5.atLeast(JAVA_1_2), "1.5 at least 1.2 failed"); - assertFalse(JAVA_1_6.atLeast(JAVA_1_7), "1.6 at least 1.7 passed"); + assertFalse(JavaVersion.JAVA_1_2.atLeast(JavaVersion.JAVA_1_5), "1.2 at least 1.5 passed"); + assertTrue(JavaVersion.JAVA_1_5.atLeast(JavaVersion.JAVA_1_2), "1.5 at least 1.2 failed"); + assertFalse(JavaVersion.JAVA_1_6.atLeast(JavaVersion.JAVA_1_7), "1.6 at least 1.7 passed"); - assertTrue(JAVA_0_9.atLeast(JAVA_1_5), "0.9 at least 1.5 failed"); - assertFalse(JAVA_0_9.atLeast(JAVA_1_6), "0.9 at least 1.6 passed"); + assertTrue(JavaVersion.JAVA_0_9.atLeast(JavaVersion.JAVA_1_5), "0.9 at least 1.5 failed"); + assertFalse(JavaVersion.JAVA_0_9.atLeast(JavaVersion.JAVA_1_6), "0.9 at least 1.6 passed"); } @Test public void testGetJavaVersion() throws Exception { - assertEquals(JAVA_0_9, get("0.9"), "0.9 failed"); - assertEquals(JAVA_1_1, get("1.1"), "1.1 failed"); - assertEquals(JAVA_1_2, get("1.2"), "1.2 failed"); - assertEquals(JAVA_1_3, get("1.3"), "1.3 failed"); - assertEquals(JAVA_1_4, get("1.4"), "1.4 failed"); - assertEquals(JAVA_1_5, get("1.5"), "1.5 failed"); - assertEquals(JAVA_1_6, get("1.6"), "1.6 failed"); - assertEquals(JAVA_1_7, get("1.7"), "1.7 failed"); - assertEquals(JAVA_1_8, get("1.8"), "1.8 failed"); + assertEquals(JavaVersion.JAVA_0_9, JavaVersion.get("0.9"), "0.9 failed"); + assertEquals(JavaVersion.JAVA_1_1, JavaVersion.get("1.1"), "1.1 failed"); + assertEquals(JavaVersion.JAVA_1_2, JavaVersion.get("1.2"), "1.2 failed"); + assertEquals(JavaVersion.JAVA_1_3, JavaVersion.get("1.3"), "1.3 failed"); + assertEquals(JavaVersion.JAVA_1_4, JavaVersion.get("1.4"), "1.4 failed"); + assertEquals(JavaVersion.JAVA_1_5, JavaVersion.get("1.5"), "1.5 failed"); + assertEquals(JavaVersion.JAVA_1_6, JavaVersion.get("1.6"), "1.6 failed"); + assertEquals(JavaVersion.JAVA_1_7, JavaVersion.get("1.7"), "1.7 failed"); + assertEquals(JavaVersion.JAVA_1_8, JavaVersion.get("1.8"), "1.8 failed"); + assertEquals(JavaVersion.JAVA_9, JavaVersion.get("9")); + assertEquals(JavaVersion.JAVA_10, JavaVersion.get("10")); + assertEquals(JavaVersion.JAVA_11, JavaVersion.get("11")); + assertEquals(JavaVersion.JAVA_12, JavaVersion.get("12")); + assertEquals(JavaVersion.JAVA_13, JavaVersion.get("13")); + assertEquals(JavaVersion.JAVA_14, JavaVersion.get("14")); + assertEquals(JavaVersion.JAVA_15, JavaVersion.get("15")); + assertEquals(JavaVersion.JAVA_16, JavaVersion.get("16")); + assertEquals(JavaVersion.JAVA_17, JavaVersion.get("17")); + assertEquals(JavaVersion.JAVA_18, JavaVersion.get("18")); + assertEquals(JavaVersion.JAVA_19, JavaVersion.get("19")); + assertEquals(JavaVersion.JAVA_20, JavaVersion.get("20")); + assertEquals(JavaVersion.JAVA_21, JavaVersion.get("21")); + assertEquals(JavaVersion.JAVA_22, JavaVersion.get("22")); - final int lastSupportedVersion = Integer.parseInt(JavaVersion.values()[JavaVersion.values().length - 2].toString()); - for (int i = 9; i <= lastSupportedVersion; i++) { - assertEquals(JavaVersion.class.getField("JAVA_" + i).get(null), get("" + i), i + " failed"); - } - - assertEquals(JAVA_RECENT, get("1.10"), "1.10 failed"); - // assertNull("2.10 unexpectedly worked", get("2.10")); - assertEquals(get("1.5"), getJavaVersion("1.5"), "Wrapper method failed"); - assertEquals(JAVA_RECENT, get("22"), "Unhandled"); // LANG-1384 + assertEquals(JavaVersion.JAVA_RECENT, JavaVersion.get("1.10"), "1.10 failed"); + // assertNull("2.10 unexpectedly worked", JavaVersion.get("2.10")); + assertEquals(JavaVersion.get("1.5"), JavaVersion.getJavaVersion("1.5"), "Wrapper method failed"); + assertEquals(JavaVersion.JAVA_RECENT, JavaVersion.get("23"), "Unhandled"); // LANG-1384 } @Test public void testToString() { - assertEquals("1.2", JAVA_1_2.toString()); + assertEquals("1.2", JavaVersion.JAVA_1_2.toString()); } } diff --git a/src/test/java/org/apache/commons/lang3/SystemUtilsTest.java b/src/test/java/org/apache/commons/lang3/SystemUtilsTest.java index 7713b34d1..d269222dd 100644 --- a/src/test/java/org/apache/commons/lang3/SystemUtilsTest.java +++ b/src/test/java/org/apache/commons/lang3/SystemUtilsTest.java @@ -19,19 +19,6 @@ package org.apache.commons.lang3; -import static org.apache.commons.lang3.JavaVersion.JAVA_10; -import static org.apache.commons.lang3.JavaVersion.JAVA_11; -import static org.apache.commons.lang3.JavaVersion.JAVA_12; -import static org.apache.commons.lang3.JavaVersion.JAVA_13; -import static org.apache.commons.lang3.JavaVersion.JAVA_1_1; -import static org.apache.commons.lang3.JavaVersion.JAVA_1_2; -import static org.apache.commons.lang3.JavaVersion.JAVA_1_3; -import static org.apache.commons.lang3.JavaVersion.JAVA_1_4; -import static org.apache.commons.lang3.JavaVersion.JAVA_1_5; -import static org.apache.commons.lang3.JavaVersion.JAVA_1_6; -import static org.apache.commons.lang3.JavaVersion.JAVA_1_7; -import static org.apache.commons.lang3.JavaVersion.JAVA_1_8; -import static org.apache.commons.lang3.JavaVersion.JAVA_9; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertNotNull; @@ -80,7 +67,6 @@ public class SystemUtilsTest extends AbstractLangTest { public void test_IS_JAVA() throws Exception { final String javaVersion = SystemUtils.JAVA_VERSION; final int lastSupportedVersion = getLastSupportedJavaVersion(); - if (javaVersion == null) { assertFalse(SystemUtils.IS_JAVA_1_1); assertFalse(SystemUtils.IS_JAVA_1_2); @@ -91,11 +77,22 @@ public class SystemUtilsTest extends AbstractLangTest { assertFalse(SystemUtils.IS_JAVA_1_7); assertFalse(SystemUtils.IS_JAVA_1_8); assertFalse(SystemUtils.IS_JAVA_1_9); - + assertFalse(SystemUtils.IS_JAVA_10); + assertFalse(SystemUtils.IS_JAVA_11); + assertFalse(SystemUtils.IS_JAVA_12); + assertFalse(SystemUtils.IS_JAVA_13); + assertFalse(SystemUtils.IS_JAVA_14); + assertFalse(SystemUtils.IS_JAVA_15); + assertFalse(SystemUtils.IS_JAVA_16); + assertFalse(SystemUtils.IS_JAVA_17); + assertFalse(SystemUtils.IS_JAVA_18); + assertFalse(SystemUtils.IS_JAVA_19); + assertFalse(SystemUtils.IS_JAVA_20); + assertFalse(SystemUtils.IS_JAVA_21); + assertFalse(SystemUtils.IS_JAVA_22); for (int version = 9; version <= lastSupportedVersion; version++) { assertFalse(getIS_JAVA(version)); } - } else if (javaVersion.startsWith("1.8")) { assertFalse(SystemUtils.IS_JAVA_1_1); assertFalse(SystemUtils.IS_JAVA_1_2); @@ -106,6 +103,19 @@ public class SystemUtilsTest extends AbstractLangTest { assertFalse(SystemUtils.IS_JAVA_1_7); assertTrue(SystemUtils.IS_JAVA_1_8); assertFalse(SystemUtils.IS_JAVA_1_9); + assertFalse(SystemUtils.IS_JAVA_10); + assertFalse(SystemUtils.IS_JAVA_11); + assertFalse(SystemUtils.IS_JAVA_12); + assertFalse(SystemUtils.IS_JAVA_13); + assertFalse(SystemUtils.IS_JAVA_14); + assertFalse(SystemUtils.IS_JAVA_15); + assertFalse(SystemUtils.IS_JAVA_16); + assertFalse(SystemUtils.IS_JAVA_17); + assertFalse(SystemUtils.IS_JAVA_18); + assertFalse(SystemUtils.IS_JAVA_19); + assertFalse(SystemUtils.IS_JAVA_20); + assertFalse(SystemUtils.IS_JAVA_21); + assertFalse(SystemUtils.IS_JAVA_22); for (int version = 9; version <= lastSupportedVersion; version++) { assertFalse(getIS_JAVA(version)); @@ -278,178 +288,493 @@ public class SystemUtilsTest extends AbstractLangTest { @Test public void testIsJavaVersionAtLeast() { if (SystemUtils.IS_JAVA_1_8) { - assertTrue(SystemUtils.isJavaVersionAtLeast(JAVA_1_1)); - assertTrue(SystemUtils.isJavaVersionAtLeast(JAVA_1_2)); - assertTrue(SystemUtils.isJavaVersionAtLeast(JAVA_1_3)); - assertTrue(SystemUtils.isJavaVersionAtLeast(JAVA_1_4)); - assertTrue(SystemUtils.isJavaVersionAtLeast(JAVA_1_5)); - assertTrue(SystemUtils.isJavaVersionAtLeast(JAVA_1_6)); - assertTrue(SystemUtils.isJavaVersionAtLeast(JAVA_1_7)); - assertTrue(SystemUtils.isJavaVersionAtLeast(JAVA_1_8)); - assertFalse(SystemUtils.isJavaVersionAtLeast(JAVA_9)); - assertFalse(SystemUtils.isJavaVersionAtLeast(JAVA_10)); - assertFalse(SystemUtils.isJavaVersionAtLeast(JAVA_11)); - assertFalse(SystemUtils.isJavaVersionAtLeast(JAVA_12)); - assertFalse(SystemUtils.isJavaVersionAtLeast(JAVA_13)); + assertTrue(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_1_1)); + assertTrue(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_1_2)); + assertTrue(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_1_3)); + assertTrue(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_1_4)); + assertTrue(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_1_5)); + assertTrue(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_1_6)); + assertTrue(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_1_7)); + assertTrue(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_1_8)); + assertFalse(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_9)); + assertFalse(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_10)); + assertFalse(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_11)); + assertFalse(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_12)); + assertFalse(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_13)); + assertFalse(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_14)); + assertFalse(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_15)); + assertFalse(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_16)); + assertFalse(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_17)); + assertFalse(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_18)); + assertFalse(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_19)); + assertFalse(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_20)); + assertFalse(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_21)); + assertFalse(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_22)); } else if (SystemUtils.IS_JAVA_9) { - assertTrue(SystemUtils.isJavaVersionAtLeast(JAVA_1_1)); - assertTrue(SystemUtils.isJavaVersionAtLeast(JAVA_1_2)); - assertTrue(SystemUtils.isJavaVersionAtLeast(JAVA_1_3)); - assertTrue(SystemUtils.isJavaVersionAtLeast(JAVA_1_4)); - assertTrue(SystemUtils.isJavaVersionAtLeast(JAVA_1_5)); - assertTrue(SystemUtils.isJavaVersionAtLeast(JAVA_1_6)); - assertTrue(SystemUtils.isJavaVersionAtLeast(JAVA_1_7)); - assertTrue(SystemUtils.isJavaVersionAtLeast(JAVA_1_8)); - assertTrue(SystemUtils.isJavaVersionAtLeast(JAVA_9)); - assertFalse(SystemUtils.isJavaVersionAtLeast(JAVA_10)); - assertFalse(SystemUtils.isJavaVersionAtLeast(JAVA_11)); - assertFalse(SystemUtils.isJavaVersionAtLeast(JAVA_12)); - assertFalse(SystemUtils.isJavaVersionAtLeast(JAVA_13)); + assertTrue(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_1_1)); + assertTrue(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_1_2)); + assertTrue(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_1_3)); + assertTrue(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_1_4)); + assertTrue(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_1_5)); + assertTrue(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_1_6)); + assertTrue(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_1_7)); + assertTrue(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_1_8)); + assertTrue(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_9)); + assertFalse(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_10)); + assertFalse(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_11)); + assertFalse(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_12)); + assertFalse(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_13)); + assertFalse(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_14)); + assertFalse(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_15)); + assertFalse(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_16)); + assertFalse(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_17)); + assertFalse(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_18)); + assertFalse(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_19)); + assertFalse(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_20)); + assertFalse(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_21)); + assertFalse(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_22)); } else if (SystemUtils.IS_JAVA_10) { - assertTrue(SystemUtils.isJavaVersionAtLeast(JAVA_1_1)); - assertTrue(SystemUtils.isJavaVersionAtLeast(JAVA_1_2)); - assertTrue(SystemUtils.isJavaVersionAtLeast(JAVA_1_3)); - assertTrue(SystemUtils.isJavaVersionAtLeast(JAVA_1_4)); - assertTrue(SystemUtils.isJavaVersionAtLeast(JAVA_1_5)); - assertTrue(SystemUtils.isJavaVersionAtLeast(JAVA_1_6)); - assertTrue(SystemUtils.isJavaVersionAtLeast(JAVA_1_7)); - assertTrue(SystemUtils.isJavaVersionAtLeast(JAVA_1_8)); - assertTrue(SystemUtils.isJavaVersionAtLeast(JAVA_9)); - assertTrue(SystemUtils.isJavaVersionAtLeast(JAVA_10)); - assertFalse(SystemUtils.isJavaVersionAtLeast(JAVA_11)); - assertFalse(SystemUtils.isJavaVersionAtLeast(JAVA_12)); - assertFalse(SystemUtils.isJavaVersionAtLeast(JAVA_13)); + assertTrue(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_1_1)); + assertTrue(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_1_2)); + assertTrue(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_1_3)); + assertTrue(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_1_4)); + assertTrue(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_1_5)); + assertTrue(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_1_6)); + assertTrue(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_1_7)); + assertTrue(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_1_8)); + assertTrue(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_9)); + assertTrue(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_10)); + assertFalse(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_11)); + assertFalse(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_12)); + assertFalse(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_13)); + assertFalse(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_14)); + assertFalse(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_15)); + assertFalse(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_16)); + assertFalse(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_17)); + assertFalse(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_18)); + assertFalse(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_19)); + assertFalse(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_20)); + assertFalse(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_21)); + assertFalse(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_22)); } else if (SystemUtils.IS_JAVA_11) { - assertTrue(SystemUtils.isJavaVersionAtLeast(JAVA_1_1)); - assertTrue(SystemUtils.isJavaVersionAtLeast(JAVA_1_2)); - assertTrue(SystemUtils.isJavaVersionAtLeast(JAVA_1_3)); - assertTrue(SystemUtils.isJavaVersionAtLeast(JAVA_1_4)); - assertTrue(SystemUtils.isJavaVersionAtLeast(JAVA_1_5)); - assertTrue(SystemUtils.isJavaVersionAtLeast(JAVA_1_6)); - assertTrue(SystemUtils.isJavaVersionAtLeast(JAVA_1_7)); - assertTrue(SystemUtils.isJavaVersionAtLeast(JAVA_1_8)); - assertTrue(SystemUtils.isJavaVersionAtLeast(JAVA_9)); - assertTrue(SystemUtils.isJavaVersionAtLeast(JAVA_10)); - assertTrue(SystemUtils.isJavaVersionAtLeast(JAVA_11)); - assertFalse(SystemUtils.isJavaVersionAtLeast(JAVA_12)); - assertFalse(SystemUtils.isJavaVersionAtLeast(JAVA_13)); + assertTrue(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_1_1)); + assertTrue(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_1_2)); + assertTrue(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_1_3)); + assertTrue(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_1_4)); + assertTrue(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_1_5)); + assertTrue(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_1_6)); + assertTrue(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_1_7)); + assertTrue(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_1_8)); + assertTrue(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_9)); + assertTrue(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_10)); + assertTrue(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_11)); + assertFalse(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_12)); + assertFalse(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_13)); + assertFalse(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_14)); + assertFalse(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_15)); + assertFalse(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_16)); + assertFalse(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_17)); + assertFalse(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_18)); + assertFalse(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_19)); + assertFalse(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_20)); + assertFalse(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_21)); + assertFalse(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_22)); } else if (SystemUtils.IS_JAVA_12) { - assertTrue(SystemUtils.isJavaVersionAtLeast(JAVA_1_1)); - assertTrue(SystemUtils.isJavaVersionAtLeast(JAVA_1_2)); - assertTrue(SystemUtils.isJavaVersionAtLeast(JAVA_1_3)); - assertTrue(SystemUtils.isJavaVersionAtLeast(JAVA_1_4)); - assertTrue(SystemUtils.isJavaVersionAtLeast(JAVA_1_5)); - assertTrue(SystemUtils.isJavaVersionAtLeast(JAVA_1_6)); - assertTrue(SystemUtils.isJavaVersionAtLeast(JAVA_1_7)); - assertTrue(SystemUtils.isJavaVersionAtLeast(JAVA_1_8)); - assertTrue(SystemUtils.isJavaVersionAtLeast(JAVA_9)); - assertTrue(SystemUtils.isJavaVersionAtLeast(JAVA_10)); - assertTrue(SystemUtils.isJavaVersionAtLeast(JAVA_11)); - assertTrue(SystemUtils.isJavaVersionAtLeast(JAVA_12)); - assertFalse(SystemUtils.isJavaVersionAtLeast(JAVA_13)); + assertTrue(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_1_1)); + assertTrue(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_1_2)); + assertTrue(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_1_3)); + assertTrue(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_1_4)); + assertTrue(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_1_5)); + assertTrue(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_1_6)); + assertTrue(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_1_7)); + assertTrue(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_1_8)); + assertTrue(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_9)); + assertTrue(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_10)); + assertTrue(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_11)); + assertTrue(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_12)); + assertFalse(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_13)); + assertFalse(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_14)); + assertFalse(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_15)); + assertFalse(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_16)); + assertFalse(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_17)); + assertFalse(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_18)); + assertFalse(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_19)); + assertFalse(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_20)); + assertFalse(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_21)); + assertFalse(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_22)); } else if (SystemUtils.IS_JAVA_13) { - assertTrue(SystemUtils.isJavaVersionAtLeast(JAVA_1_1)); - assertTrue(SystemUtils.isJavaVersionAtLeast(JAVA_1_2)); - assertTrue(SystemUtils.isJavaVersionAtLeast(JAVA_1_3)); - assertTrue(SystemUtils.isJavaVersionAtLeast(JAVA_1_4)); - assertTrue(SystemUtils.isJavaVersionAtLeast(JAVA_1_5)); - assertTrue(SystemUtils.isJavaVersionAtLeast(JAVA_1_6)); - assertTrue(SystemUtils.isJavaVersionAtLeast(JAVA_1_7)); - assertTrue(SystemUtils.isJavaVersionAtLeast(JAVA_1_8)); - assertTrue(SystemUtils.isJavaVersionAtLeast(JAVA_9)); - assertTrue(SystemUtils.isJavaVersionAtLeast(JAVA_10)); - assertTrue(SystemUtils.isJavaVersionAtLeast(JAVA_11)); - assertTrue(SystemUtils.isJavaVersionAtLeast(JAVA_12)); - assertTrue(SystemUtils.isJavaVersionAtLeast(JAVA_13)); + assertTrue(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_1_1)); + assertTrue(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_1_2)); + assertTrue(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_1_3)); + assertTrue(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_1_4)); + assertTrue(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_1_5)); + assertTrue(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_1_6)); + assertTrue(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_1_7)); + assertTrue(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_1_8)); + assertTrue(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_9)); + assertTrue(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_10)); + assertTrue(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_11)); + assertTrue(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_12)); + assertTrue(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_13)); + assertFalse(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_14)); + assertFalse(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_15)); + assertFalse(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_16)); + assertFalse(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_17)); + assertFalse(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_18)); + assertFalse(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_19)); + assertFalse(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_20)); + assertFalse(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_21)); + assertFalse(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_22)); } } @Test public void testIsJavaVersionAtMost() { if (SystemUtils.IS_JAVA_1_8) { - assertFalse(SystemUtils.isJavaVersionAtMost(JAVA_1_1)); - assertFalse(SystemUtils.isJavaVersionAtMost(JAVA_1_2)); - assertFalse(SystemUtils.isJavaVersionAtMost(JAVA_1_3)); - assertFalse(SystemUtils.isJavaVersionAtMost(JAVA_1_4)); - assertFalse(SystemUtils.isJavaVersionAtMost(JAVA_1_5)); - assertFalse(SystemUtils.isJavaVersionAtMost(JAVA_1_6)); - assertFalse(SystemUtils.isJavaVersionAtMost(JAVA_1_7)); - assertTrue(SystemUtils.isJavaVersionAtMost(JAVA_1_8)); - assertTrue(SystemUtils.isJavaVersionAtMost(JAVA_9)); - assertTrue(SystemUtils.isJavaVersionAtMost(JAVA_10)); - assertTrue(SystemUtils.isJavaVersionAtMost(JAVA_11)); - assertTrue(SystemUtils.isJavaVersionAtMost(JAVA_12)); - assertTrue(SystemUtils.isJavaVersionAtMost(JAVA_13)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_1)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_2)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_3)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_4)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_5)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_6)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_7)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_8)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_9)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_10)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_11)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_12)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_13)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_14)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_15)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_16)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_17)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_18)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_19)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_20)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_21)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_22)); } else if (SystemUtils.IS_JAVA_9) { - assertFalse(SystemUtils.isJavaVersionAtMost(JAVA_1_1)); - assertFalse(SystemUtils.isJavaVersionAtMost(JAVA_1_2)); - assertFalse(SystemUtils.isJavaVersionAtMost(JAVA_1_3)); - assertFalse(SystemUtils.isJavaVersionAtMost(JAVA_1_4)); - assertFalse(SystemUtils.isJavaVersionAtMost(JAVA_1_5)); - assertFalse(SystemUtils.isJavaVersionAtMost(JAVA_1_6)); - assertFalse(SystemUtils.isJavaVersionAtMost(JAVA_1_7)); - assertFalse(SystemUtils.isJavaVersionAtMost(JAVA_1_8)); - assertTrue(SystemUtils.isJavaVersionAtMost(JAVA_9)); - assertTrue(SystemUtils.isJavaVersionAtMost(JAVA_10)); - assertTrue(SystemUtils.isJavaVersionAtMost(JAVA_11)); - assertTrue(SystemUtils.isJavaVersionAtMost(JAVA_12)); - assertTrue(SystemUtils.isJavaVersionAtMost(JAVA_13)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_1)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_2)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_3)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_4)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_5)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_6)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_7)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_8)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_9)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_10)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_11)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_12)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_13)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_14)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_15)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_16)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_17)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_18)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_19)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_20)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_21)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_22)); } else if (SystemUtils.IS_JAVA_10) { - assertFalse(SystemUtils.isJavaVersionAtMost(JAVA_1_1)); - assertFalse(SystemUtils.isJavaVersionAtMost(JAVA_1_2)); - assertFalse(SystemUtils.isJavaVersionAtMost(JAVA_1_3)); - assertFalse(SystemUtils.isJavaVersionAtMost(JAVA_1_4)); - assertFalse(SystemUtils.isJavaVersionAtMost(JAVA_1_5)); - assertFalse(SystemUtils.isJavaVersionAtMost(JAVA_1_6)); - assertFalse(SystemUtils.isJavaVersionAtMost(JAVA_1_7)); - assertFalse(SystemUtils.isJavaVersionAtMost(JAVA_1_8)); - assertFalse(SystemUtils.isJavaVersionAtMost(JAVA_9)); - assertTrue(SystemUtils.isJavaVersionAtMost(JAVA_10)); - assertTrue(SystemUtils.isJavaVersionAtMost(JAVA_11)); - assertTrue(SystemUtils.isJavaVersionAtMost(JAVA_12)); - assertTrue(SystemUtils.isJavaVersionAtMost(JAVA_13)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_1)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_2)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_3)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_4)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_5)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_6)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_7)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_8)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_9)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_10)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_11)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_12)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_13)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_14)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_15)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_16)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_17)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_18)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_19)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_20)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_21)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_22)); } else if (SystemUtils.IS_JAVA_11) { - assertFalse(SystemUtils.isJavaVersionAtMost(JAVA_1_1)); - assertFalse(SystemUtils.isJavaVersionAtMost(JAVA_1_2)); - assertFalse(SystemUtils.isJavaVersionAtMost(JAVA_1_3)); - assertFalse(SystemUtils.isJavaVersionAtMost(JAVA_1_4)); - assertFalse(SystemUtils.isJavaVersionAtMost(JAVA_1_5)); - assertFalse(SystemUtils.isJavaVersionAtMost(JAVA_1_6)); - assertFalse(SystemUtils.isJavaVersionAtMost(JAVA_1_7)); - assertFalse(SystemUtils.isJavaVersionAtMost(JAVA_1_8)); - assertFalse(SystemUtils.isJavaVersionAtMost(JAVA_9)); - assertFalse(SystemUtils.isJavaVersionAtMost(JAVA_10)); - assertTrue(SystemUtils.isJavaVersionAtMost(JAVA_11)); - assertTrue(SystemUtils.isJavaVersionAtMost(JAVA_12)); - assertTrue(SystemUtils.isJavaVersionAtMost(JAVA_13)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_1)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_2)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_3)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_4)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_5)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_6)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_7)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_8)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_9)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_10)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_11)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_12)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_13)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_14)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_15)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_16)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_17)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_18)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_19)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_20)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_21)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_22)); } else if (SystemUtils.IS_JAVA_12) { - assertFalse(SystemUtils.isJavaVersionAtMost(JAVA_1_1)); - assertFalse(SystemUtils.isJavaVersionAtMost(JAVA_1_2)); - assertFalse(SystemUtils.isJavaVersionAtMost(JAVA_1_3)); - assertFalse(SystemUtils.isJavaVersionAtMost(JAVA_1_4)); - assertFalse(SystemUtils.isJavaVersionAtMost(JAVA_1_5)); - assertFalse(SystemUtils.isJavaVersionAtMost(JAVA_1_6)); - assertFalse(SystemUtils.isJavaVersionAtMost(JAVA_1_7)); - assertFalse(SystemUtils.isJavaVersionAtMost(JAVA_1_8)); - assertFalse(SystemUtils.isJavaVersionAtMost(JAVA_9)); - assertFalse(SystemUtils.isJavaVersionAtMost(JAVA_10)); - assertFalse(SystemUtils.isJavaVersionAtMost(JAVA_11)); - assertTrue(SystemUtils.isJavaVersionAtMost(JAVA_12)); - assertTrue(SystemUtils.isJavaVersionAtMost(JAVA_13)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_1)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_2)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_3)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_4)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_5)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_6)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_7)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_8)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_9)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_10)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_11)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_12)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_13)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_14)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_15)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_16)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_17)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_18)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_19)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_20)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_21)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_22)); } else if (SystemUtils.IS_JAVA_13) { - assertFalse(SystemUtils.isJavaVersionAtMost(JAVA_1_1)); - assertFalse(SystemUtils.isJavaVersionAtMost(JAVA_1_2)); - assertFalse(SystemUtils.isJavaVersionAtMost(JAVA_1_3)); - assertFalse(SystemUtils.isJavaVersionAtMost(JAVA_1_4)); - assertFalse(SystemUtils.isJavaVersionAtMost(JAVA_1_5)); - assertFalse(SystemUtils.isJavaVersionAtMost(JAVA_1_6)); - assertFalse(SystemUtils.isJavaVersionAtMost(JAVA_1_7)); - assertFalse(SystemUtils.isJavaVersionAtMost(JAVA_1_8)); - assertFalse(SystemUtils.isJavaVersionAtMost(JAVA_9)); - assertFalse(SystemUtils.isJavaVersionAtMost(JAVA_10)); - assertFalse(SystemUtils.isJavaVersionAtMost(JAVA_11)); - assertFalse(SystemUtils.isJavaVersionAtMost(JAVA_12)); - assertTrue(SystemUtils.isJavaVersionAtMost(JAVA_13)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_1)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_2)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_3)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_4)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_5)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_6)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_7)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_8)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_9)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_10)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_11)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_12)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_13)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_14)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_15)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_16)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_17)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_18)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_19)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_20)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_21)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_22)); + } else if (SystemUtils.IS_JAVA_14) { + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_1)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_2)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_3)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_4)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_5)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_6)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_7)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_8)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_9)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_10)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_11)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_12)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_13)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_14)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_15)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_16)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_17)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_18)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_19)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_20)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_21)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_22)); + } else if (SystemUtils.IS_JAVA_15) { + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_1)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_2)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_3)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_4)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_5)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_6)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_7)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_8)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_9)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_10)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_11)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_12)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_13)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_14)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_15)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_16)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_17)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_18)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_19)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_20)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_21)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_22)); + } else if (SystemUtils.IS_JAVA_16) { + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_1)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_2)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_3)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_4)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_5)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_6)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_7)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_8)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_9)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_10)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_11)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_12)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_13)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_14)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_15)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_16)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_17)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_18)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_19)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_20)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_21)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_22)); + } else if (SystemUtils.IS_JAVA_17) { + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_1)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_2)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_3)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_4)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_5)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_6)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_7)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_8)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_9)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_10)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_11)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_12)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_13)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_14)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_15)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_16)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_17)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_18)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_19)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_20)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_21)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_22)); + } else if (SystemUtils.IS_JAVA_18) { + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_1)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_2)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_3)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_4)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_5)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_6)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_7)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_8)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_9)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_10)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_11)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_12)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_13)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_14)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_15)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_16)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_17)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_18)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_19)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_20)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_21)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_22)); + } else if (SystemUtils.IS_JAVA_19) { + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_1)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_2)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_3)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_4)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_5)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_6)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_7)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_8)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_9)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_10)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_11)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_12)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_13)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_14)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_15)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_16)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_17)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_18)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_19)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_20)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_21)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_22)); + } else if (SystemUtils.IS_JAVA_20) { + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_1)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_2)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_3)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_4)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_5)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_6)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_7)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_8)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_9)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_10)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_11)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_12)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_13)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_14)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_15)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_16)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_17)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_18)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_19)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_20)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_21)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_22)); + } else if (SystemUtils.IS_JAVA_21) { + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_1)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_2)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_3)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_4)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_5)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_6)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_7)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_8)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_9)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_10)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_11)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_12)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_13)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_14)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_15)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_16)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_17)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_18)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_19)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_20)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_21)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_22)); + } else if (SystemUtils.IS_JAVA_22) { + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_1)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_2)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_3)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_4)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_5)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_6)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_7)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_8)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_9)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_10)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_11)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_12)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_13)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_14)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_15)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_16)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_17)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_18)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_19)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_20)); + assertFalse(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_21)); + assertTrue(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_22)); } } @@ -479,6 +804,19 @@ public class SystemUtilsTest extends AbstractLangTest { assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "1.7")); assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "1.8")); assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "9")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "10")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "11")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "12")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "13")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "14")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "15")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "16")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "17")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "18")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "19")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "20")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "21")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "22")); javaVersion = ""; assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "1.0")); assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "1.1")); @@ -490,6 +828,19 @@ public class SystemUtilsTest extends AbstractLangTest { assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "1.7")); assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "1.8")); assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "9")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "10")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "11")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "12")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "13")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "14")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "15")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "16")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "17")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "18")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "19")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "20")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "21")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "22")); javaVersion = "1.0"; assertTrue(SystemUtils.isJavaVersionMatch(javaVersion, "1.0")); assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "1.1")); @@ -501,6 +852,19 @@ public class SystemUtilsTest extends AbstractLangTest { assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "1.7")); assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "1.8")); assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "9")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "10")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "11")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "12")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "13")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "14")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "15")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "16")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "17")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "18")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "19")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "20")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "21")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "22")); javaVersion = "1.1"; assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "1.0")); assertTrue(SystemUtils.isJavaVersionMatch(javaVersion, "1.1")); @@ -512,6 +876,19 @@ public class SystemUtilsTest extends AbstractLangTest { assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "1.7")); assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "1.8")); assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "9")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "10")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "11")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "12")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "13")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "14")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "15")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "16")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "17")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "18")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "19")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "20")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "21")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "22")); javaVersion = "1.2"; assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "1.0")); assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "1.1")); @@ -523,6 +900,19 @@ public class SystemUtilsTest extends AbstractLangTest { assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "1.7")); assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "1.8")); assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "9")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "10")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "11")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "12")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "13")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "14")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "15")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "16")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "17")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "18")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "19")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "20")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "21")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "22")); javaVersion = "1.3.0"; assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "1.0")); assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "1.1")); @@ -534,6 +924,19 @@ public class SystemUtilsTest extends AbstractLangTest { assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "1.7")); assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "1.8")); assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "9")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "10")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "11")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "12")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "13")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "14")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "15")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "16")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "17")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "18")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "19")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "20")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "21")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "22")); javaVersion = "1.3.1"; assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "1.0")); assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "1.1")); @@ -545,6 +948,19 @@ public class SystemUtilsTest extends AbstractLangTest { assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "1.7")); assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "1.8")); assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "9")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "10")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "11")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "12")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "13")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "14")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "15")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "16")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "17")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "18")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "19")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "20")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "21")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "22")); javaVersion = "1.4.0"; assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "1.0")); assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "1.1")); @@ -556,6 +972,19 @@ public class SystemUtilsTest extends AbstractLangTest { assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "1.7")); assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "1.8")); assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "9")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "10")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "11")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "12")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "13")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "14")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "15")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "16")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "17")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "18")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "19")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "20")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "21")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "22")); javaVersion = "1.4.1"; assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "1.0")); assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "1.1")); @@ -567,6 +996,19 @@ public class SystemUtilsTest extends AbstractLangTest { assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "1.7")); assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "1.8")); assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "9")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "10")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "11")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "12")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "13")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "14")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "15")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "16")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "17")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "18")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "19")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "20")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "21")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "22")); javaVersion = "1.4.2"; assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "1.0")); assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "1.1")); @@ -578,6 +1020,19 @@ public class SystemUtilsTest extends AbstractLangTest { assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "1.7")); assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "1.8")); assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "9")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "10")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "11")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "12")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "13")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "14")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "15")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "16")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "17")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "18")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "19")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "20")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "21")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "22")); javaVersion = "1.5.0"; assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "1.0")); assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "1.1")); @@ -589,6 +1044,19 @@ public class SystemUtilsTest extends AbstractLangTest { assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "1.7")); assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "1.8")); assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "9")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "10")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "11")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "12")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "13")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "14")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "15")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "16")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "17")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "18")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "19")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "20")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "21")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "22")); javaVersion = "1.6.0"; assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "1.0")); assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "1.1")); @@ -600,6 +1068,19 @@ public class SystemUtilsTest extends AbstractLangTest { assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "1.7")); assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "1.8")); assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "9")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "10")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "11")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "12")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "13")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "14")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "15")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "16")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "17")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "18")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "19")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "20")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "21")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "22")); javaVersion = "1.7.0"; assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "1.0")); assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "1.1")); @@ -611,6 +1092,19 @@ public class SystemUtilsTest extends AbstractLangTest { assertTrue(SystemUtils.isJavaVersionMatch(javaVersion, "1.7")); assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "1.8")); assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "9")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "10")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "11")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "12")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "13")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "14")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "15")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "16")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "17")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "18")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "19")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "20")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "21")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "22")); javaVersion = "1.8.0"; assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "1.0")); assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "1.1")); @@ -622,6 +1116,19 @@ public class SystemUtilsTest extends AbstractLangTest { assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "1.7")); assertTrue(SystemUtils.isJavaVersionMatch(javaVersion, "1.8")); assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "9")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "10")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "11")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "12")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "13")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "14")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "15")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "16")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "17")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "18")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "19")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "20")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "21")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "22")); javaVersion = "9"; assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "1.0")); assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "1.1")); @@ -633,6 +1140,139 @@ public class SystemUtilsTest extends AbstractLangTest { assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "1.7")); assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "1.8")); assertTrue(SystemUtils.isJavaVersionMatch(javaVersion, "9")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "10")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "11")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "12")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "13")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "14")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "15")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "16")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "17")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "18")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "19")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "20")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "21")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "22")); + javaVersion = "10"; + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "1.0")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "1.1")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "1.2")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "1.3")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "1.4")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "1.5")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "1.6")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "1.7")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "1.8")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "9")); + assertTrue(SystemUtils.isJavaVersionMatch(javaVersion, "10")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "11")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "12")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "13")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "14")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "15")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "16")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "17")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "18")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "19")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "20")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "21")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "22")); + javaVersion = "11"; // LTS + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "1.0")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "1.1")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "1.2")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "1.3")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "1.4")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "1.5")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "1.6")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "1.7")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "1.8")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "9")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "10")); + assertTrue(SystemUtils.isJavaVersionMatch(javaVersion, "11")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "12")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "13")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "14")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "15")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "16")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "17")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "18")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "19")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "20")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "21")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "22")); + javaVersion = "17"; // LTS + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "1.0")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "1.1")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "1.2")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "1.3")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "1.4")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "1.5")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "1.6")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "1.7")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "1.8")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "9")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "10")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "11")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "12")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "13")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "14")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "15")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "16")); + assertTrue(SystemUtils.isJavaVersionMatch(javaVersion, "17")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "18")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "19")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "20")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "21")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "22")); + javaVersion = "21"; // LTS + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "1.0")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "1.1")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "1.2")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "1.3")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "1.4")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "1.5")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "1.6")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "1.7")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "1.8")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "9")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "10")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "11")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "12")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "13")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "14")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "15")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "16")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "17")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "18")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "19")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "20")); + assertTrue(SystemUtils.isJavaVersionMatch(javaVersion, "21")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "22")); + javaVersion = "22"; // Current + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "1.0")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "1.1")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "1.2")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "1.3")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "1.4")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "1.5")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "1.6")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "1.7")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "1.8")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "9")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "10")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "11")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "12")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "13")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "14")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "15")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "16")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "17")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "18")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "19")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "20")); + assertFalse(SystemUtils.isJavaVersionMatch(javaVersion, "21")); + assertTrue(SystemUtils.isJavaVersionMatch(javaVersion, "22")); } @Test