3131import java .util .Date ;
3232import java .util .List ;
3333import java .util .Locale ;
34+ import java .util .Map ;
35+ import java .util .Map .Entry ;
3436import java .util .Objects ;
37+ import java .util .Set ;
3538import java .util .TimeZone ;
3639import java .util .concurrent .atomic .AtomicInteger ;
3740
4144import org .apache .commons .lang3 .LocaleUtils ;
4245import org .apache .commons .lang3 .SystemUtils ;
4346import org .junit .jupiter .api .AfterAll ;
47+ import org .junit .jupiter .api .Disabled ;
4448import org .junit .jupiter .api .Test ;
4549import org .junit .jupiter .params .ParameterizedTest ;
4650import org .junit .jupiter .params .provider .MethodSource ;
@@ -73,6 +77,10 @@ public static void afterAll() {
7377 }
7478 }
7579
80+ static Set <Entry <String , String >> getZoneIdStream () {
81+ return ZoneId .SHORT_IDS .entrySet ();
82+ }
83+
7684 private String [][] getZoneStringsSorted (final Locale locale ) {
7785 return ArraySorter .sort (DateFormatSymbols .getInstance (locale ).getZoneStrings (), Comparator .comparing (array -> array [0 ]));
7886 }
@@ -81,7 +89,7 @@ private String[][] getZoneStringsSorted(final Locale locale) {
8189 * Tests that known short {@link ZoneId}s still parse since all short IDs are deprecated starting in Java 25, but are not removed.
8290 *
8391 * TODO: Why don't all short IDs parse, even on Java 8?
84- *
92+ *
8593 * @throws ParseException Thrown on test failure.
8694 */
8795 @ ParameterizedTest
@@ -95,6 +103,23 @@ void testJava25DeprecatedZoneId(final String shortId) throws ParseException {
95103 assertEquals (2014 , date1 .getYear () + 1900 );
96104 }
97105
106+ /**
107+ * Tests that {@link ZoneId#SHORT_IDS} keys and values still works as they are deprecated starting in Java 25, but not removed yet.
108+ *
109+ * TODO: Why don't all short IDs parse, even on Java 8?
110+ *
111+ * @throws ParseException Thrown on test failure.
112+ */
113+ @ Disabled
114+ @ ParameterizedTest
115+ @ MethodSource ("getZoneIdStream" )
116+ void testJava25DeprecatedZoneIds (final Map .Entry <String , String > entry ) throws ParseException {
117+ final FastDateParser parser = new FastDateParser ("dd.MM.yyyy HH:mm:ss z" , TimeZone .getDefault (), Locale .GERMAN );
118+ final Date date1 = parser .parse ("26.10.2014 02:00:00 " + entry .getKey ());
119+ final Date date2 = parser .parse ("26.10.2014 02:00:00 " + entry .getValue ());
120+ assertNotEquals (date1 .getTime (), date2 .getTime ());
121+ }
122+
98123 @ Test
99124 void testLang1219 () throws ParseException {
100125 final FastDateParser parser = new FastDateParser ("dd.MM.yyyy HH:mm:ss z" , TimeZone .getDefault (), Locale .GERMAN );
0 commit comments