RFR: 8265828: [TestBug] Save and restore the default Locale in javafx.base unit test LocalDateTimeStringConverterTest [v3]
Lukasz Kostyra
duke at openjdk.org
Mon Nov 28 14:44:17 UTC 2022
> The change moves Locale setting in the test to `@BeforeClass` and `@AfterClass` calls. `@BeforeClass` method call stores current default VM locale and applies Locale.US, while `@AfterClass` method restores old VM locale after all tests are completed.
>
> I tested it both on Mac and Windows, in both cases Locale is changed, restored properly and tests pass.
Lukasz Kostyra has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains four commits:
- Merge branch 'master' of https://git.openjdk.org/jfx into JDK-8265828-locale
- Refactor remaining LocalStringConverter tests
Treatment done in this commit is similar to the previous change.
- LocalDateTimeStringConverterTest: Refactor test to properly utilize Locale
* Locale initialization was moved to @BeforeClass method.
* DateTimeFormatter objects are allocated after Locale initialization
* Since LocalDateTimeStringConverter depends on DateTimeFormatter and on VM's Locale,
creation of it was moved to @Before method.
- 8265828: [TestBug] Save and restore the default Locale in javafx.base unit test LocalDateTimeStringConverterTest
-------------
Changes: https://git.openjdk.org/jfx/pull/954/files
Webrev: https://webrevs.openjdk.org/?repo=jfx&pr=954&range=02
Stats: 268 lines in 3 files changed: 207 ins; 21 del; 40 mod
Patch: https://git.openjdk.org/jfx/pull/954.diff
Fetch: git fetch https://git.openjdk.org/jfx pull/954/head:pull/954
PR: https://git.openjdk.org/jfx/pull/954
More information about the openjfx-dev
mailing list