}
@Test
public void export_offsetsLimits() throws TableException, IOException
{
TupleTable tableModel = mock(TupleTable.class);
when(tableModel.getColOffset()).thenReturn(2);
when(tableModel.getColLimit()).thenReturn(3);
when(tableModel.getOffset()).thenReturn(1);
when(tableModel.getLimit()).thenReturn(2);
// verify that offsets and limits are ignored during export
Field field1 = when(mock(Field.class).getName()).thenReturn("col1").getMock();
Field field2 = when(mock(Field.class).getName()).thenReturn("col2").getMock();
Field field3 = when(mock(Field.class).getName()).thenReturn("col3").getMock();
when(tableModel.getColumns()).thenReturn(Arrays.asList(field1, field2, field3));
WritableTuple row1 = new KeyValueTuple();
row1.set("col1", "val1.1");
row1.set("col2", "val1.2");
row1.set("col3", "val1.3");
WritableTuple row2 = new KeyValueTuple();
row2.set("col1", "val2.1");
row2.set("col2", "val2.2");
row2.set("col3", "val2.3");
when(tableModel.iterator()).thenReturn(Arrays.<Tuple> asList(row1, row2).iterator());
ExcelExporter excelExporter = new ExcelExporter(tableModel);
File xlsFile = File.createTempFile("table", ".xls");
try
{