RFR: 8264952: [TestBug] Controls unit tests - ControlTest and SpinnerTest fail for non US Locale
Ajit Ghaisas
aghaisas at openjdk.java.net
Fri Apr 23 06:57:24 UTC 2021
On Thu, 22 Apr 2021 16:45:15 GMT, Kevin Rushforth <kcr at openjdk.org> wrote:
> 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?
>
`DatePickerTest` was not restoring the Locale to the system specific locale at the end of it. `ControlsTest` is run after `DatePickerTest` in our test run.
`test.javafx.scene.control.ControlTest.testRT18097` creates a DatePicker control and tests its properties. It fails for `showWeekNumbersProperty`. This property is initialized from the resource bundle for country specific value. Hence, the test fails if we set Locale to US (which expects `showWeekNumbersProperty` to be false) and System locale is GB or DE (which sets `showWeekNumbersProperty` to true from the resource bundle)
> 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?
I have filed [JDK-8265828](https://bugs.openjdk.java.net/browse/JDK-8265828) for this.
-------------
PR: https://git.openjdk.java.net/jfx/pull/476
More information about the openjfx-dev
mailing list