RFR: 8372844: Improve usage of test/jdk/java/text/testlib/TestUtils.java locale methods

Justin Lu jlu at openjdk.org
Mon Dec 1 23:57:01 UTC 2025


This PR updates the call sites of `TestUtils::usesGregorianCalendar`, `TestUtils::usesAsciiDigits`, and `TestUtils::hasSpecialVariant` to use `Assumptions` to properly abort the test.

The existing usage of these methods involve printing to output and returning when locale conditions are not met. Some of these tests do lots of printing, so identifying when a test is skipped due to inadequate locale conditions may not be obvious. Instead of simply printing to output, it would be better for test diagnostics to abort the tests, which is easy to identify in the Jtreg output. E.g.

> [ JUnit Tests: found 1189, started 1189, succeeded 1185, failed 0, aborted 4, skipped 0]

As a result of this change, Bug4407042, Bug4845901, Bug6530336, and LocaleCategory were converted to JUnit based tests. (I could have decided to throw jtreg.SkippedException for those tests, but decided to just convert as well.)

-------------

Commit messages:
 - init

Changes: https://git.openjdk.org/jdk/pull/28590/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=28590&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8372844
  Stats: 223 lines in 12 files changed: 45 ins; 90 del; 88 mod
  Patch: https://git.openjdk.org/jdk/pull/28590.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/28590/head:pull/28590

PR: https://git.openjdk.org/jdk/pull/28590


More information about the core-libs-dev mailing list