Make zone string debug output optional in TestTranslations

Resolves: RHEL-212318
This commit is contained in:
Andrew Hughes 2026-07-16 23:15:41 +01:00
parent 30a5982bfe
commit af05c4d0d4
2 changed files with 23 additions and 8 deletions

View File

@ -1,5 +1,5 @@
/* TestTranslations -- Ensure translations are available for new timezones
Copyright (C) 2022 Red Hat, Inc.
Copyright (C) 2026 Red Hat, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
@ -60,15 +60,34 @@ public class TestTranslations {
public static void main(String[] args) {
boolean debug = false;
if (args.length < 1) {
System.err.println("Test must be started with the name of the locale provider.");
System.exit(1);
}
if (args.length > 1) {
debug = Boolean.parseBoolean(args[1]);
}
System.err.printf("Debugging: %s\n", debug);
testZoneStrings(debug);
String localeProvider = args[0];
testZone(localeProvider, KYIV,
new String[] { "Europe/Kiev", "Europe/Kyiv", "Europe/Uzhgorod", "Europe/Zaporozhye" });
testZone(localeProvider, CIUDAD_JUAREZ,
new String[] { "America/Cambridge_Bay", "America/Ciudad_Juarez" });
}
private static void testZoneStrings(final boolean debug) {
System.out.println("Checking sanity of full zone string set...");
boolean invalid = Arrays.stream(Locale.getAvailableLocales())
.peek(l -> System.out.println("Locale: " + l))
.peek(l -> System.out.printf(debug ? "Locale: %s\n" : "", l))
.map(l -> DateFormatSymbols.getInstance(l).getZoneStrings())
.peek(df -> System.out.printf(debug ? "Zone string size: %s\n" : "", df.length))
.flatMap(zs -> Arrays.stream(zs))
.flatMap(names -> Arrays.stream(names))
.filter(name -> Objects.isNull(name) || name.isEmpty())
@ -78,12 +97,6 @@ public class TestTranslations {
System.err.println("Zone string for a locale returned null or empty string");
System.exit(2);
}
String localeProvider = args[0];
testZone(localeProvider, KYIV,
new String[] { "Europe/Kiev", "Europe/Kyiv", "Europe/Uzhgorod", "Europe/Zaporozhye" });
testZone(localeProvider, CIUDAD_JUAREZ,
new String[] { "America/Cambridge_Bay", "America/Ciudad_Juarez" });
}
private static void testZone(String localeProvider, Map<Locale,String[]> exp, String[] ids) {

View File

@ -2971,12 +2971,14 @@ cjc.mainProgram(args)
- Move version information and core NVR definitions back towards the top of the file
- Explictly define supported architectures
- Specify portablerelease and rpmrelease (always 0 for portables) in the Release field
- Make zone string debug output optional in TestTranslations
- Sync the copy of the portable specfile with the latest update
- ** This tarball is embargoed until 2026-07-21 @ 1pm PT. **
- Resolves: RHEL-212095
- Resolves: RHEL-188852
- Resolves: RHEL-149784
- Resolves: RHEL-212316
- Resolves: RHEL-212318
* Mon Apr 20 2026 Andrew Hughes <gnu.andrew@redhat.com> - 1:1.8.0.492.b09-2
- Bump release for PQC build