<i18n dev> RFR: 8355393: Create a Test case to have special cases coverage for currency.getInstance()
Weibing Xiao
wxiao at openjdk.org
Fri May 9 18:21:51 UTC 2025
On Tue, 6 May 2025 07:25:36 GMT, Abhishek N <duke at openjdk.org> wrote:
> Create a Test case to have special cases coverage for currency.getInstance().
>
> The test Validates that all currency codes and country-currency mappings in the input file are consistent with the Java Currency API.
>
> test results:
>
> jdk-24.0.2/bin/java -jar jtreg/lib/jtreg.jar -testjdk:jdk-24.0.2 -dir:jdk/test/jdk/ java/util/Currency/currencyEnhancedCoverage/ValidateCurrencyCoverage.java
> Directory "JTwork" not found: creating
> Directory "JTreport" not found: creating
> Test results: passed: 1
> Report written to JTreport\html\report.html
> Results written to JTwork
The root cause of the failure in https://bugs.openjdk.org/browse/JDK-8353433 was written by @coffeys in the bug. Right now It needs a test case to verify when future cut-over time is passing and the currency is going to work properly. Here is the example defined in CurrencyData.properties, "CW=ANG;2026-04-01-04-00-00;XCG". Technically it needs to overwrite the return value of System.currentTimeMillis() and make it return with future time to trigger the test for future currency.
see this line https://github.com/openjdk/jdk/blob/master/src/java.base/share/classes/java/util/Currency.java#L423.
BTW, @justin-curtis-lu made the change in the mainline of JDK at https://bugs.openjdk.org/browse/JDK-8354344. Since it is using ClassFiie API, it can not be backported to jdk with version 23 or lower.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/25057#issuecomment-2867537361
More information about the i18n-dev
mailing list