junit5 icon indicating copy to clipboard operation
junit5 copied to clipboard

FileSource ArgumentsProvider

Open asarkar opened this issue 8 months ago • 1 comments

Problems with CsvFileSource:

  1. Long arguments either have to be on the same line separated by delimiter, or indented manually using quoteCharacter. Neither option is very legible.
  2. No way to set delimiter as OS-specific newline. Even if delimiter is hard coded as \n, the CsvFileArgumentsProvider fails to parse the file such that Arguments.get.length matches the number of formal parameters in the test method.

Deliverables

  • [ ] A FileSource that delimits arguments by any newline character/string, same as BufferedReader.readLine(). I've implemented one for a personal project, and can make a PR.
  • [ ] Alternatively, make CsvFileSource.delimiter read n lines into Arguments each time, where n is the the number of formal parameters in the test method.

asarkar avatar Apr 24 '25 12:04 asarkar

Sample test data file.

1152.txt

asarkar avatar May 04 '25 23:05 asarkar