I compiled the tests and I am trying to run them doing the following:
> java -jar lib/junit-platform-console-standalone-1.0.0-M4.jar --class-path ./bin --select-class com.mycompany.DbTest
This throws a massive exception that starts like this:
Exception in thread "main" java.lang.NoClassDefFoundError: org/junit/platform/commons/JUnitException
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
...
But basically says it can't find the JUnitException class. If instead I let the console launcher look for the tests, it finds no tests:
> java -jar lib/junit-platform-console-standalone-1.0.0-M4.jar -p bin/
╷
├─ JUnit Jupiter ✔
└─ JUnit Vintage ✔
Test run finished after 20 ms
[ 2 containers found ]
[ 0 containers skipped ]
[ 2 containers started ]
[ 0 containers aborted ]
[ 2 containers successful ]
[ 0 containers failed ]
[ 0 tests found ]
[ 0 tests skipped ]
[ 0 tests started ]
[ 0 tests aborted ]
[ 0 tests successful ]
[ 0 tests failed ]
I am at a loss to know how can I run JUnit5 tests from the command line, without IDEs.
Update:
Using Maven to run the tests (with the Surefire plugin) gives me the same errors. I even removed all the tests but one that merely imports junit5 dependencies, and I still get the error.