* Integration test
*/
@Test
public void scrollAndHideTheLastRow() throws Exception {
// Total rows in fixture - 20 (index 0 - 19)
NatTableFixture natTable = new NatTableFixture(new Shell(),
new DummyGridLayerStack() {
@Override
protected void init(IUniqueIndexLayer bodyDataLayer,
IUniqueIndexLayer columnHeaderDataLayer,
IUniqueIndexLayer rowHeaderDataLayer,
IUniqueIndexLayer cornerDataLayer) {
RowHideShowLayer rowHideShowLayer = new RowHideShowLayer(
bodyDataLayer);
super.init(rowHideShowLayer, columnHeaderDataLayer,
rowHeaderDataLayer, cornerDataLayer);
}
}, 600, 120);
LayerListenerFixture natTableListener = new LayerListenerFixture();
natTable.addLayerListener(natTableListener);
// Scroll to position 15 in grid/15 in body
natTable.scrollToRow(15);
assertEquals(15, natTable.getRowIndexByPosition(1));
// Hide last row - position 5/index 19
assertEquals(19, natTable.getRowIndexByPosition(5));
natTable.doCommand(new RowHideCommand(natTable, 5));
// Assert event received
assertNotNull(natTableListener
.getReceivedEvent(HideRowPositionsEvent.class));
HideRowPositionsEvent hideEvent = (HideRowPositionsEvent) natTableListener