RFR: 8258663: Fixed size TableCells are not removed from sene graph when column is removed [v2]

Marius Hanl github.com+66004280+maran23 at openjdk.java.net
Tue Mar 30 15:54:38 UTC 2021


On Tue, 30 Mar 2021 13:27:21 GMT, Jeanette Winzenburg <fastegal at openjdk.org> wrote:

>> Marius Hanl has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   8258663: Using VirtualFlowTestUtils in tests now instead of own solution -> cleaner code
>
> modules/javafx.controls/src/test/java/test/javafx/scene/control/skin/TableRowSkinTest.java line 132:
> 
>> 130:         // We save the first table row to check it later.
>> 131:         AtomicReference<TableRow<Person>> tableRowRef = new AtomicReference<>();
>> 132: 
> 
> wondering a bit about this complicated test setup .. are you aware of the VirtualFlowTestUtils (in test.something.infrastructure)? Using it, a test would shrink down to something like:
> 
>     @Test
>     public void testRemoveColumnsFixed() {
>         tableView.setFixedCellSize(20);
>         tableView.getColumns().remove(0, 2);
>         Toolkit.getToolkit().firePulse();
>         assertEquals(tableView.getVisibleLeafColumns().size(), 
>                 VirtualFlowTestUtils.getCell(tableView, 0).getChildrenUnmodifiable().size());
>     }
> 
> Or what am I missing?

Nice catch! I tried it out and it works! And indeed the code looks much better now.
To be fair, I had a brief look at VirtualFlowTestUtils, as other table/cell tests uses it. Next time I should take a closer look. :P 
I pushed your suggested change.

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

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


More information about the openjfx-dev mailing list