Bug#1003439: junit5: unable to handle @CsvFileSource

Andrius Merkys merkys at debian.org
Mon Jan 10 07:41:39 GMT 2022


Package: junit5
Version: 5.3.2-4

Hello,

A package I am working on, opsin v2.6.0, has some junit5 test cases
using @CsvFileSource construction, and these fail with the following
exception:

java.lang.NoClassDefFoundError: com/univocity/parsers/csv/CsvParser
Caused by: java.lang.ClassNotFoundException:
com.univocity.parsers.csv.CsvParser

AFAIU, @CsvFileSource construction is used to parameterize tests using
CSV files [1]. The failure seems to be caused by missing CSV parser.
Installing libunivocity-parsers-java manually does not solve the issue.
My guess is that the JAR of this package is not placed in the CLASSPATH
during the execution of tests. I believe adding it to POM of
junit-jupiter-params artifact might work, but I did not try this.

It would be great if someone with more knowledge of the matter could
give it a look. To debug one may use opsin source from salsa, git commit
5c96c9fb827113ab8c526f6a52c5cff5d29543f5 from master, having
remove-tests-with-CsvParser.patch removed.

[1]
https://junit.org/junit5/docs/current/user-guide/#writing-tests-parameterized-tests-sources-CsvFileSource

Andrius



More information about the pkg-java-maintainers mailing list