try {
ds.next();
fail("Exception expected");
} catch (InconsistentRowLengthException e) {
assertEquals("Inconsistent length of row no. 3. Expected 2 columns but found 3.", e.getMessage());
Row proposedRow = e.getProposedRow();
assertEquals("[5, 6]", Arrays.toString(proposedRow.getValues()));
String[] sourceLine = e.getSourceLine();
assertEquals("[5, 6, 7]", Arrays.toString(sourceLine));
}
assertTrue(ds.next());
try {
ds.next();
fail("Exception expected");
} catch (InconsistentRowLengthException e) {
assertEquals("Inconsistent length of row no. 5. Expected 2 columns but found 1.", e.getMessage());
Row proposedRow = e.getProposedRow();
assertEquals("[10, null]", Arrays.toString(proposedRow.getValues()));
String[] sourceLine = e.getSourceLine();
assertEquals("[10]", Arrays.toString(sourceLine));
}