The ConsoleLauncher

The ConsoleLauncher is a command-line Java application that allows launching the JUnit Platform from the console. For example, it can be used to run Vintage and Jupiter tests from the command line.

An executable JAR with all dependencies included is published in the central Maven repository under the junit-platform-console-standalone artifact. The standalone Console Launcher can be executed as follows:

java -jar junit-platform-console-standalone-version.jar <Options>

The example GitHub repository junit5-console-launcher contains a simple example for the use of the Console Launcher. As depicted in the following picture, a run configuration entry has been created in Eclipse, running the main class, org.junit.platform.console.ConsoleLauncher. Then, the test class name is passed as an argument using the option --select-class and the qualified class name (in this example, io.github.bonigarcia.EmptyTest). After that, we can run the application, obtaining the test result in the integrated console of Eclipse:

Example of ConsoleLauncher in Eclipse
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.118.139.224