CE-1955 - Add rowNo to BulkLoadFileRow, set by FileToRowsInterface objects

This commit is contained in:
2024-11-27 11:46:24 -06:00
parent 6672f95987
commit 17fc976877
8 changed files with 65 additions and 11 deletions

View File

@ -52,8 +52,8 @@ class CsvFileToRowsTest extends BaseTest
BulkLoadFileRow headerRow = fileToRowsInterface.next();
BulkLoadFileRow bodyRow = fileToRowsInterface.next();
assertEquals(new BulkLoadFileRow(new String[] { "one", "two", "three" }), headerRow);
assertEquals(new BulkLoadFileRow(new String[] { "1", "2", "3", "4" }), bodyRow);
assertEquals(new BulkLoadFileRow(new String[] { "one", "two", "three" }, 1), headerRow);
assertEquals(new BulkLoadFileRow(new String[] { "1", "2", "3", "4" }, 2), bodyRow);
assertFalse(fileToRowsInterface.hasNext());
}

View File

@ -81,6 +81,6 @@ public class TestFileToRows extends AbstractIteratorBasedFileToRows<Serializable
@Override
public BulkLoadFileRow makeRow(Serializable[] values)
{
return (new BulkLoadFileRow(values));
return (new BulkLoadFileRow(values, getRowNo()));
}
}

View File

@ -66,8 +66,8 @@ class XlsxFileToRowsTest extends BaseTest
BulkLoadFileRow headerRow = fileToRowsInterface.next();
BulkLoadFileRow bodyRow = fileToRowsInterface.next();
assertEquals(new BulkLoadFileRow(new String[] {"Id", "First Name", "Last Name", "Birth Date"}), headerRow);
assertEquals(new BulkLoadFileRow(new Serializable[] {1, "Darin", "Jonson", LocalDateTime.of(1980, Month.JANUARY, 31, 0, 0)}), bodyRow);
assertEquals(new BulkLoadFileRow(new String[] {"Id", "First Name", "Last Name", "Birth Date"}, 1), headerRow);
assertEquals(new BulkLoadFileRow(new Serializable[] {1, "Darin", "Jonson", LocalDateTime.of(1980, Month.JANUARY, 31, 0, 0)}, 2), bodyRow);
///////////////////////////////////////////////////////////////////////////////////////
// make sure there's at least a limit (less than 20) to how many more rows there are //