Reputation: 1
I'm trying to run tests using the --select-directory
option in junit-platform-console-standalone
but tests aren't being discovered. The docs don't have examples for this so I'm a bit lost.
My project looks like this
/home/me/
source/com/mypackage/MyClass.java
unit-tests/com/mypackage/MyClassTest.java
integ-tests/com/mypackage/MyClassIntegTest.java
eclipse-bin/com/mypackage/
MyClass.class
MyClassTest.class
MyClassIntegTest.class
I can run tests with java -jar junit-platform-console-standalone.jar -cp $JUNIT_CLASS_PATH -c com.mypackage.MyClassTest
succesfully.
I'm trying to run just the tests under unit-tests
only. So far I've tried:
java -jar junit-platform-console-standalone.jar -cp $JUNIT_CLASS_PATH -d /home/me/unit-tests
java -jar junit-platform-console-standalone.jar -cp $JUNIT_CLASS_PATH -d /home/me/eclipse-bin
I even tried to discover them by file
java -jar junit-platform-console-standalone.jar -cp $JUNIT_CLASS_PATH -f /home/me/eclipse-bin/com/mypackage/MyClassTest.class
java -jar junit-platform-console-standalone.jar -cp $JUNIT_CLASS_PATH -f file:///home/me/eclipse-bin/com/mypackage/MyClassTest.class
But none of those discover any tests. How are we supposed to use the -d
and -f
switches?
Upvotes: 0
Views: 737
Reputation: 9059
Try
java -jar junit-platform-console-standalone.jar --class-path unit-tests:eclipse-bin --scan-class-path
after getting rid of all *Test.class
files under eclipse-bin/
.
Upvotes: 2