Simplify TestTranslations run now there is only the CLDR provider and one set of data (JDK-8174269)

Related: RHEL-188883
This commit is contained in:
Andrew Hughes 2026-07-16 22:44:03 +01:00
parent d58af87d52
commit a9e65481d5
2 changed files with 10 additions and 23 deletions

View File

@ -60,11 +60,6 @@ public class TestTranslations {
public static void main(String[] args) {
if (args.length < 1) {
System.err.println("Test must be started with the name of the locale provider.");
System.exit(1);
}
System.out.println("Checking sanity of full zone string set...");
boolean invalid = Arrays.stream(Locale.getAvailableLocales())
.peek(l -> System.out.println("Locale: " + l))
@ -79,14 +74,13 @@ public class TestTranslations {
System.exit(2);
}
String localeProvider = args[0];
testZone(localeProvider, KYIV,
testZone(KYIV,
new String[] { "Europe/Kiev", "Europe/Kyiv", "Europe/Uzhgorod", "Europe/Zaporozhye" });
testZone(localeProvider, CIUDAD_JUAREZ,
testZone(CIUDAD_JUAREZ,
new String[] { "America/Cambridge_Bay", "America/Ciudad_Juarez" });
}
private static void testZone(String localeProvider, Map<Locale,String[]> exp, String[] ids) {
private static void testZone(Map<Locale,String[]> exp, String[] ids) {
for (Locale l : exp.keySet()) {
String[] expected = exp.get(l);
System.out.printf("Expected values for %s are %s\n", l, Arrays.toString(expected));
@ -97,16 +91,11 @@ public class TestTranslations {
System.out.printf("Checking locale %s for %s...\n", l, id);
if ("JRE".equals(localeProvider) || "CLDR".equals(localeProvider)) {
expectedShortStd = expected[2];
expectedShortDST = expected[5];
expectedShortGen = expected[8];
} else {
System.err.printf("Invalid locale provider %s\n", localeProvider);
System.exit(3);
}
System.out.printf("Locale Provider is %s, using short values %s, %s and %s\n",
localeProvider, expectedShortStd, expectedShortDST, expectedShortGen);
expectedShortStd = expected[2];
expectedShortDST = expected[5];
expectedShortGen = expected[8];
System.out.printf("Using short values %s, %s and %s\n",
expectedShortStd, expectedShortDST, expectedShortGen);
String longStd = TimeZone.getTimeZone(id).getDisplayName(false, TimeZone.LONG, l);
String shortStd = TimeZone.getTimeZone(id).getDisplayName(false, TimeZone.SHORT, l);

View File

@ -2100,10 +2100,7 @@ $JAVA_HOME/bin/java -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -versi
# Check translations are available for new timezones (during flatpak builds, the
# tzdb.dat used by this test is not where the test expects it, so this is
# disabled for flatpak builds)
# Disable test until we are on the latest JDK
$JAVA_HOME/bin/javac -d . %{SOURCE18}
$JAVA_HOME/bin/java $(echo $(basename %{SOURCE18})|sed "s|\.java||") JRE
$JAVA_HOME/bin/java -Djava.locale.providers=CLDR $(echo $(basename %{SOURCE18})|sed "s|\.java||") CLDR
$JAVA_HOME/bin/java %{SOURCE18}
%endif
# Check src.zip has all sources. See RHBZ#1130490
@ -2610,6 +2607,7 @@ exit 0
- Drop local copy of JDK-8375294 EOPNOTSUPP patch
- Obsolete old RHEL releases (9.7.0-z, 10.1-z)
- Revert fr_FR and de_DE changes made in d43f0e6186370fdeb0ca2f3594f39783e20eef1c now JDK-8382020 is fixed
- Simplify TestTranslations run now there is only the CLDR provider and one set of data (JDK-8174269)
- ** This tarball is embargoed until 2026-07-21 @ 1pm PT. **
- Resolves: RHEL-188883
- Resolves: RHEL-212294