OdsDataSource implements IDataSource { @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.") public void setSheet(String index) { checkIfMayAlterConfiguration(); try { int currentSheetIndex = Integer.parseInt(index) - 1; if (currentSheetIndex < 0) { throw new IllegalArgumentException( "Sheet Index must be a positive number but was " + currentSheetIndex); } this.sheetIndex = currentSheetIndex; } catch (Exception e) { throw new IllegalArgumentException( "Sheet Index must be a positive number", e); } }  @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 = IllegalArgumentException.class) public void testInvalidSheetNumber() throws Exception { ds.setSheet("A"); }