Class DefaultLauncher

java.lang.Object
org.junit.platform.launcher.core.DefaultLauncher
All Implemented Interfaces:
Launcher

class DefaultLauncher extends Object implements Launcher
Default implementation of the Launcher API.

External clients can obtain an instance by invoking LauncherFactory.create().

Since:
1.0
See Also:
  • Field Details

  • Constructor Details

    • DefaultLauncher

      DefaultLauncher(Iterable<TestEngine> testEngines, Collection<PostDiscoveryFilter> filters)
      Construct a new DefaultLauncher with the supplied test engines.
      Parameters:
      testEngines - the test engines to delegate to; never null or empty
      filters - the additional post discovery filters for discovery requests; never null
  • Method Details

    • registerTestExecutionListeners

      public void registerTestExecutionListeners(TestExecutionListener... listeners)
      Description copied from interface: Launcher
      Register one or more listeners for test execution.
      Specified by:
      registerTestExecutionListeners in interface Launcher
      Parameters:
      listeners - the listeners to be notified of test execution events; never null or empty
    • discover

      public TestPlan discover(LauncherDiscoveryRequest discoveryRequest)
      Description copied from interface: Launcher
      Discover tests and build a TestPlan according to the supplied LauncherDiscoveryRequest by querying all registered engines and collecting their results.
      Specified by:
      discover in interface Launcher
      Parameters:
      discoveryRequest - the launcher discovery request; never null
      Returns:
      an unmodifiable TestPlan that contains all resolved identifiers from all registered engines
    • execute

      public void execute(LauncherDiscoveryRequest discoveryRequest, TestExecutionListener... listeners)
      Description copied from interface: Launcher
      Execute a TestPlan which is built according to the supplied LauncherDiscoveryRequest by querying all registered engines and collecting their results, and notify registered listeners about the progress and results of the execution.

      Supplied test execution listeners are registered in addition to already registered listeners but only for the supplied launcher discovery request.

      Specified by:
      execute in interface Launcher
      Parameters:
      discoveryRequest - the launcher discovery request; never null
      listeners - additional test execution listeners; never null
    • execute

      public void execute(TestPlan testPlan, TestExecutionListener... listeners)
      Description copied from interface: Launcher
      Execute the supplied TestPlan and notify registered listeners about the progress and results of the execution.

      Supplied test execution listeners are registered in addition to already registered listeners but only for the execution of the supplied test plan.

      Specified by:
      execute in interface Launcher
      Parameters:
      testPlan - the test plan to execute; never null
      listeners - additional test execution listeners; never null
    • getTestExecutionListenerRegistry

      TestExecutionListenerRegistry getTestExecutionListenerRegistry()
    • discover

      private LauncherDiscoveryResult discover(LauncherDiscoveryRequest discoveryRequest, String phase)
    • execute

      private void execute(InternalTestPlan internalTestPlan, TestExecutionListener[] listeners)