...

/

Launcher

Launcher

Learn about the launcher in JUnit 5.

We'll cover the following...

So far, we’ve executed JUnit 5 tests using Maven. JUnit 5 has the junit-platform-launcher module to discover, filter, and execute tests. The JUnit platform can be launched using the Launcher API.

Methods of Launcher

Method

Description

TestPlan

discover(LauncherDiscoveryRequest

launcherDiscoveryRequest)

Discovers tests from the LauncherDiscoveryRequest and builds a TestPlan.

void execute(LauncherDiscoveryRequest

launcherDiscoveryRequest,

TestExecutionListener... listeners)

Executes a TestPlan built from the LauncherDiscoveryRequest and notifies TestExecutionListeners.

void

registerTestExecutionListeners(TestExecutionListener...

listeners)

Registers test execution listeners.

The LauncherDiscoveryRequest extends from EngineDiscoveryRequest and adds EngineFilters and PostDiscoveryFilters. An ...