On Thu, 22 Apr 2021 10:36:40 GMT, Ajit Ghaisas <[email protected]> wrote:

> This PR fixes controls unit test failures that are observed with German 
> locale.
> 
> Fix :
> Code added to use US locale while running SpinnerTest and DatePicker test & 
> restore locale to default after these tests are executed.
> 
> test.javafx.scene.control.ControlTest.testRT18097 fails for DatePicker 
> control. Fixing DatePickerTest fixes this. This reveals the fact that our 
> unit tests run in a single VM and any test that changes the Locale setting 
> should restore it to the default at the end.

This looks good. Saving and restoring global state in this manner represents a 
best practice. Two questions:

1. In the description you said that 
`test.javafx.scene.control.ControlTest.testRT18097` fails without your fix and 
passes with this fix. This suggests that something in that test only works with 
the "out of the box" default Locale. Do you know why?
2. We have one test in `javafx.base` where we set the default Locale. Can you 
file a follow-on testbug to save and restore the Locale there, too?

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

Marked as reviewed by kcr (Lead).

PR: https://git.openjdk.java.net/jfx/pull/476

Reply via email to