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.
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
testClassesDiraccordingly. Note that the test classes will also need to be present on the test task’sclasspath(but it might be good enough to use the Jar for this).