Class EngineFilter

java.lang.Object
org.junit.platform.launcher.EngineFilter
All Implemented Interfaces:
Filter<TestEngine>

@API(status=STABLE, since="1.0") public class EngineFilter extends Object implements Filter<TestEngine>
An EngineFilter is applied to all TestEngines before they are used.

Warning: be cautious when registering multiple competing include EngineFilters or multiple competing exclude EngineFilters for the same discovery request since doing so will likely lead to undesirable results (i.e., zero engines being active).

Since:
1.0
See Also:
includeEngines(String...), excludeEngines(String...), LauncherDiscoveryRequest
  • Method Details

    • includeEngines

      public static EngineFilter includeEngines(String... engineIds)
      Create a new include EngineFilter based on the supplied engine IDs.

      Only TestEngines with matching engine IDs will be included within the test discovery and execution.

      Parameters:
      engineIds - the list of engine IDs to match against; never null or empty; individual IDs must also not be null or blank
      See Also:
      includeEngines(String...)
    • includeEngines

      public static EngineFilter includeEngines(List<String> engineIds)
      Create a new include EngineFilter based on the supplied engine IDs.

      Only TestEngines with matching engine IDs will be included within the test discovery and execution.

      Parameters:
      engineIds - the list of engine IDs to match against; never null or empty; individual IDs must also not be null or blank
      See Also:
      includeEngines(String...)
    • excludeEngines

      public static EngineFilter excludeEngines(String... engineIds)
      Create a new exclude EngineFilter based on the supplied engine IDs.

      TestEngines with matching engine IDs will be excluded from test discovery and execution.

      Parameters:
      engineIds - the list of engine IDs to match against; never null or empty; individual IDs must also not be null or blank
      See Also:
      excludeEngines(List)
    • excludeEngines

      public static EngineFilter excludeEngines(List<String> engineIds)
      Create a new exclude EngineFilter based on the supplied engine IDs.

      TestEngines with matching engine IDs will be excluded from test discovery and execution.

      Parameters:
      engineIds - the list of engine IDs to match against; never null or empty; individual IDs must also not be null or blank
      See Also:
      includeEngines(String...)
    • apply

      public FilterResult apply(TestEngine testEngine)
      Description copied from interface: Filter
      Apply this filter to the supplied object.
      Specified by:
      apply in interface Filter<TestEngine>
    • toString

      public String toString()
      Overrides:
      toString in class Object