Issue
We can run junit batchtest with tests picked from a jar file.
<zipfileset src="tests-only.jar" includes="**/*Test.class"/>
This runs all matching tests picked from test-only.jar
How to do similar thing with gradle. The testClassesDir only takes actual directory.
Solution
Gradle doesn't have a built-in feature for running test classes contained in a Jar file. (Feel free to submit a feature request at http://forums.gradle.org .) What should work is unpacking the Jar (as a separate task) and then setting testClassesDir
accordingly. Note that the test classes will also need to be present on the test task's classpath
(but it might be good enough to use the Jar for this).
Answered By - Peter Niederwieser
Answer Checked By - Terry (JavaFixing Volunteer)