RFR: 8265828: [TestBug] Save and restore the default Locale in javafx.base unit test LocalDateTimeStringConverterTest

Marius Hanl mhanl at openjdk.org
Fri Nov 18 17:12:27 UTC 2022


On Fri, 18 Nov 2022 17:00:08 GMT, Lukasz Kostyra <duke at openjdk.org> wrote:

>> This is a good point. Moving the initialization of those two fields to the `setupBeforeAll` method seems safest.
>
> That is a fair point.
> 
> I'll have to change the code a bit, as `implementations()` method is called before a `@BeforeClass`-tagged method (which is probably why originally `Locale.setDefault()` was called there) and `aFormatter`/`aParser` are already used there, expected to be initialized.

Maybe JUnit5 can help you here. 
You can check out my recently merged PR for an example for the usage of the parameterized api introduced in JUnit5.
https://github.com/openjdk/jfx/pull/936

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

PR: https://git.openjdk.org/jfx/pull/954


More information about the openjfx-dev mailing list