FilterItem f1 = new FilterItem(q.getSelectClause().getItem(0), OperatorType.EQUALS_TO, 5);
FilterItem f2 = new FilterItem(q.getSelectClause().getItem(0), OperatorType.EQUALS_TO, 8);
q.where(new FilterItem(f1, f2));
DataSet dataSet = dc.executeQuery(q);
TableModel tableModel = new DataSetTableModel(dataSet);
assertEquals(4, tableModel.getColumnCount());
assertEquals(2, tableModel.getRowCount());
assertEquals("LOLLOBRIGIDA", tableModel.getValueAt(0, 2));
q.setMaxRows(1);
dataSet = dc.executeQuery(q);
tableModel = new DataSetTableModel(dataSet);
assertEquals(4, tableModel.getColumnCount());
assertEquals(1, tableModel.getRowCount());
assertEquals("LOLLOBRIGIDA", tableModel.getValueAt(0, 2));
q.setMaxRows(1);
q.setFirstRow(2);
dataSet = dc.executeQuery(q);
tableModel = new DataSetTableModel(dataSet);
assertEquals(4, tableModel.getColumnCount());
assertEquals(1, tableModel.getRowCount());
assertEquals("JOHANSSON", tableModel.getValueAt(0, 2));
q.getWhereClause().removeItems();
q.setMaxRows(25);
q.setFirstRow(1);
dataSet = dc.executeQuery(q);
tableModel = new DataSetTableModel(dataSet);
assertEquals(4, tableModel.getColumnCount());
assertEquals(25, tableModel.getRowCount());
assertEquals("GUINESS", tableModel.getValueAt(0, 2).toString());
}