// Get the table model
TableModel<CustomRowValue> tableModel = getTableModel(false);
// Request some rows without sorting
TestCallback<CustomRowValue> callback1 = new TestCallback<CustomRowValue>(10, 20, null);
Request request1 = new Request(10, 20);
tableModel.requestRows(request1, callback1);
assertTrue(callback1.isExecuted());
assertFalse(callback1.isFailed());
// Request some rows with sorting
ColumnSortList sortList = new ColumnSortList();
sortList.add(new ColumnSortInfo(5, true));
TestCallback<CustomRowValue> callback2 = new TestCallback<CustomRowValue>(5, 6, sortList);
Request request2 = new Request(5, 6, sortList);
tableModel.requestRows(request2, callback2);
assertTrue(callback2.isExecuted());
assertFalse(callback2.isFailed());
// Request some rows with sorting descending
sortList.add(new ColumnSortInfo(5, false));
TestCallback<CustomRowValue> callback3 = new TestCallback<CustomRowValue>(5, 6, sortList);
Request request3 = new Request(5, 6, sortList);
tableModel.requestRows(request3, callback3);
assertTrue(callback3.isExecuted());
assertFalse(callback3.isFailed());
// Request some rows and fail to return them
TableModel<CustomRowValue> failureModel = getTableModel(true);
TestCallback<CustomRowValue> callback4 = new TestCallback<CustomRowValue>(-1, -1, null);
Request request4 = new Request(5, 6, sortList);
failureModel.requestRows(request4, callback4);
assertFalse(callback4.isExecuted());
assertTrue(callback4.isFailed());
}