assertEquals(5000, rowModel.getRow(0).getValidatedTrailingSize(1));
}
public void testPruneMiddle()
{
final SeparateRowModel rowModel = new SeparateRowModel();
rowModel.addRow();
rowModel.addRow();
rowModel.addRow();
rowModel.addRow();
rowModel.addRow();
rowModel.addRow();
updateTableRow(rowModel, 0, 1000);
updateTableRow(rowModel, 1, 1000, 2000);
updateTableRow(rowModel, 2, 1000);
updateTableRow(rowModel, 3, 1000, 0, 2000);
updateTableRow(rowModel, 4, 1000);
updateTableRow(rowModel, 5, 1000);
rowModel.validateActualSizes();
assertEquals(3, rowModel.getRow(3).getMaximumRowSpan());
assertEquals(1000, rowModel.getRow(3).getPreferredSize(1));
assertEquals(1000, rowModel.getRow(3).getValidatedTrailingSize(1));
assertEquals(0, rowModel.getRow(3).getPreferredSize(2));
assertEquals(0, rowModel.getRow(3).getValidatedTrailingSize(2));
assertEquals(2000, rowModel.getRow(3).getPreferredSize(3));
assertEquals(2000, rowModel.getRow(3).getValidatedTrailingSize(3));
rowModel.prune(2);
// assert that nothing has been done. This model is actually not breakable after the second row, as this
// row spans further into the third row.
assertEquals(6, rowModel.getRowCount());
rowModel.prune(3);
assertEquals(4, rowModel.getRowCount());
assertEquals(1, rowModel.getRow(0).getMaximumRowSpan());
assertEquals(3000, rowModel.getRow(0).getPreferredSize(1));
assertEquals(3000, rowModel.getRow(0).getValidatedTrailingSize(1));
assertEquals(3, rowModel.getRow(1).getMaximumRowSpan());
assertEquals(1000, rowModel.getRow(1).getPreferredSize(1));
assertEquals(1000, rowModel.getRow(1).getValidatedTrailingSize(1));
assertEquals(0, rowModel.getRow(1).getPreferredSize(2));
assertEquals(0, rowModel.getRow(1).getValidatedTrailingSize(2));
assertEquals(2000, rowModel.getRow(1).getPreferredSize(3));
assertEquals(2000, rowModel.getRow(1).getValidatedTrailingSize(3));
}