Closed PreciousChicken closed 4 years ago
Sorry this was indeed my fault, you need to run the file as:
java -jar junit-platform-console-standalone-1.6.0.jar --class-path .:system-rules-1.19.0.jar -c MyTest
which produces:
hello world
Thanks for using JUnit! Support its development at https://junit.org/sponsoring
╷
├─ JUnit Jupiter ✔
└─ JUnit Vintage ✔
└─ MyTest ✔
└─ writesTextToSystemOut ✔
Test run finished after 46 ms
[ 3 containers found ]
[ 0 containers skipped ]
[ 3 containers started ]
[ 0 containers aborted ]
[ 3 containers successful ]
[ 0 containers failed ]
[ 1 tests found ]
[ 0 tests skipped ]
[ 1 tests started ]
[ 0 tests aborted ]
[ 1 tests successful ]
[ 0 tests failed ]
Every day is a learning day!
NB - As an aide-memoire I've also put this solution in blog form at System Rules on the Command Line.
I have downloaded files
junit-platform-console-standalone-1.6.0.jar
andsystem-rules-1.19.0.jar
to my working directory.Within this directory I create a file MyTest.java with the following content:
I compile the file without errors with the following command:
javac -cp .:junit-platform-console-standalone-1.6.0.jar:system-rules-1.19.0.jar MyTest.java
I run the file with:
java -jar junit-platform-console-standalone-1.6.0.jar --class-path . -c MyTest
and get the following error:
Is this a faulty configuration on my part (probably), or an issue with system-rules?
Appreciate any help.
NB - My OS is Ubuntu 18.04.4 LTS and I'm using OpenJDK version 11.0.6.