On Tue, 30 Aug 2022 09:32:39 GMT, Jose Pereda <jper...@openjdk.org> wrote:

>> modules/javafx.controls/src/test/java/test/javafx/scene/control/TableViewTest.java
>>  line 5883:
>> 
>>> 5881:         assertTrue(thumbMaxX < cornerMinX);
>>> 5882: 
>>> 5883:         sl.dispose();
>> 
>> may be in try/finally to dispose of the StageLoader if test throws an 
>> exception?
>
> There are no exceptions expected to happen in these new tests and I don't see 
> that we use try-finally with `StageLoader` by default, is this change really 
> required?

What we usually do is to add a global variable like this:
`private StageLoader stageLoader;`
and in the junit after method something like this:
`if (stageLoader != null) stageLoader.dispose();`

So tests are free to init and use the `stageLoader` and it will always call 
`dispose()` after the test, no matter if it failed or not.

cc @kleopatra 
see for example: `TableCellTest`

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

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

Reply via email to