On Thu, 17 Apr 2025 00:15:47 GMT, Naoto Sato <na...@openjdk.org> wrote:
>> Please review this PR which improves the _ValidateISO4217_ Currency test by >> adding testing of future currencies after the transition date. >> >> This is done by creating a patched version of Currency that replaces >> `System.currentTimeMillis()` calls with a mocked value equivalent to >> `Long.MAX_VALUE`. A module patch is then applied to supply the new Currency >> class files. >> >> The mocked time behavior is tested by using the `currency.properties` >> override in a separate invocation. > >> As the test tracks the ISO 4217 data, manual testing of this change can be >> done by modifying the cut-over year from 2025 to 2026 for the >> `CW=ANG;2025-04-01-04-00-00;XCG` entry for both the JDK and test data. > > Would it be possible to use `currency.properties` file to provide a test > transition, and use this logic test the validity, so that it is not a manual > testing? Still it is not 100% same with the data from `currency.data`, but at > least provides the transition logic validity, possibly for both simple and > special currencies. @naotoj Thanks for the idea. The latest [commit](https://github.com/openjdk/jdk/pull/24701/commits/8ab7897315294acd1777cce010bd9b037f66ef3d) supplies a custom entry in the properties file override. In the year 3000, `PK` uses the custom currency `JPZ`. Another invocation, (the second one), is added with the override passed via command line, which checks that `PK` is correctly returning `JPZ`. This indicates we have successfully mocked the time and the module patch has been applied. We do this separately from the third invocation as to not conflict with the golden ISO data. Thus the invocations behave as follows, 1 - Test ISO data with current time + Build module patch with mocked time 2 - Check that the module patch and mocked time function correctly. (NO tests are ran). 3 - Test ISO data with mocked time ------------- PR Comment: https://git.openjdk.org/jdk/pull/24701#issuecomment-2813977463