问题 What do you use for writing data-driven tests in jUnit? (My definition of) a data-driven test is a test that reads data from some external source (file, database, ...), executes one test per line/file/whatever, and displays the results in a test runner as if you had separate tests - the result of each run is displayed separately, not in one huge aggregate. 回答1: In JUnit4 you can use the Parameterized testrunner to do data driven tests. It's not terribly well documented, but the basic idea is