On Wed, 16 Nov 2022 00:21:53 GMT, Kevin Rushforth <[email protected]> wrote:
>> 1. Introduced the following utility methods:
>> - Util.launch
>> - Util.shutdown
>> - Util.waitForLatch
>> 2. Fixed the out-of order calls to Stage.hide() and Platform.exit() in many
>> tests' shutdowns.
>> 3. Replaced local waitForLatch copies with Util.waitForLatch
>
> tests/system/src/test/java/test/util/Util.java line 338:
>
>> 336: public static void shutdown(Stage... stages) {
>> 337: // why isn't runAndWait() exposed as a public API?
>> 338: PlatformImpl.runAndWait(() -> {
>
> Not providing a public `runAndWait` was a deliberate choice. In any case,
> tests or utilities that need to wait should use the `runAndWait` method in
> this Util class in preference to `PlatformImpl`. For one thing it will throw
> exceptions back to the caller where as the `PlatformImpl` method will not.
>
> I think `Platform.runLater` should be sufficient here, but as long as the
> tests are still stable when using `runAndWait`, I don't have a strong
> objection.
Will change the code to use Util.runAndWait, I think we should let the test
code run its course in @AfterClass than to risk the test framework killing the
process unexpectedly.
Thank you for clarification, @kevinrushforth !
-------------
PR: https://git.openjdk.org/jfx/pull/950