Skip to content

Commit

Permalink
Added support for JDK 22 and 23
Browse files Browse the repository at this point in the history
  • Loading branch information
phax committed Oct 30, 2024
1 parent bfebdb8 commit ca2a573
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ public enum EJavaVersion
JDK_18 (62.0, 63.0, false),
JDK_19 (63.0, 64.0, false),
JDK_20 (64.0, 65.0, false),
JDK_21 (65.0, 66.0, true);
JDK_21 (65.0, 66.0, true),
JDK_22 (66.0, 67.0, false),
JDK_23 (67.0, 68.0, false);

/** The current version. */
private static final EJavaVersion INSTANCE;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ public void testBasic ()
assertEquals (EJavaVersion.JDK_19, EJavaVersion.getFromVersionNumber (63.0));
assertEquals (EJavaVersion.JDK_20, EJavaVersion.getFromVersionNumber (64.0));
assertEquals (EJavaVersion.JDK_21, EJavaVersion.getFromVersionNumber (65.0));
assertEquals (EJavaVersion.UNKNOWN, EJavaVersion.getFromVersionNumber (66.0));
assertEquals (EJavaVersion.JDK_22, EJavaVersion.getFromVersionNumber (66.0));
assertEquals (EJavaVersion.JDK_23, EJavaVersion.getFromVersionNumber (67.0));
assertEquals (EJavaVersion.UNKNOWN, EJavaVersion.getFromVersionNumber (68.0));

for (final EJavaVersion e : EJavaVersion.values ())
if (e.isOlderOrEqualsThan (EJavaVersion.JDK_11))
Expand Down Expand Up @@ -115,6 +117,8 @@ public void testIsOlderOrEqualsThan ()
assertTrue (EJavaVersion.JDK_1_7.isOlderOrEqualsThan (EJavaVersion.JDK_19));
assertTrue (EJavaVersion.JDK_1_7.isOlderOrEqualsThan (EJavaVersion.JDK_20));
assertTrue (EJavaVersion.JDK_1_7.isOlderOrEqualsThan (EJavaVersion.JDK_21));
assertTrue (EJavaVersion.JDK_1_7.isOlderOrEqualsThan (EJavaVersion.JDK_22));
assertTrue (EJavaVersion.JDK_1_7.isOlderOrEqualsThan (EJavaVersion.JDK_23));
}

@Test
Expand All @@ -141,6 +145,8 @@ public void testIsNewerOrEqualsThan ()
assertFalse (EJavaVersion.JDK_1_7.isNewerOrEqualsThan (EJavaVersion.JDK_19));
assertFalse (EJavaVersion.JDK_1_7.isNewerOrEqualsThan (EJavaVersion.JDK_20));
assertFalse (EJavaVersion.JDK_1_7.isNewerOrEqualsThan (EJavaVersion.JDK_21));
assertFalse (EJavaVersion.JDK_1_7.isNewerOrEqualsThan (EJavaVersion.JDK_22));
assertFalse (EJavaVersion.JDK_1_7.isNewerOrEqualsThan (EJavaVersion.JDK_23));
}

@Test
Expand All @@ -167,5 +173,7 @@ public void testIsLTS ()
assertFalse (EJavaVersion.JDK_19.isLTS ());
assertFalse (EJavaVersion.JDK_20.isLTS ());
assertTrue (EJavaVersion.JDK_21.isLTS ());
assertFalse (EJavaVersion.JDK_22.isLTS ());
assertFalse (EJavaVersion.JDK_23.isLTS ());
}
}

0 comments on commit ca2a573

Please sign in to comment.