OdsDataSource implements IDataSource { @Override public void loadFromStream(InputStream data) throws DataSourceException { OdfDocument ods; try { ods = OdfSpreadsheetDocument.loadDocument(data); } catch (Exception e) { throw new DataSourceException( "Error while reading the ODS data source", e); } table = ods.getTableList().get(sheetIndex); extractFieldNames(); calculateRowCount(); }  @ConfigurationOption(defaultValue = "" + DEFAULT_SHEET_INDEX, description = "The number of the sheet in which the test data reside. Counting starts with 1 for the first sheet.") void setSheet(String index); @Override void close(); @Override String[] getFieldNames(); @Override String getValueFor(String fieldName); @Override void setRow(int index); @Override void loadFromStream(InputStream data); @Override int getNumberOfRows();  }
@Test(expected = DataSourceException.class) public void testEmptySheet() throws Exception { ds.loadFromStream(getStream("empty")); }