Top Description Inners Fields Constructors Methods
org.junit.platform.launcher

public Class EngineFilter

extends Object
implements Filter<TestEngine>
Class Inheritance
All Implemented Interfaces
org.junit.platform.engine.Filter
Annotations
@API
status:STABLE
since:1.0
Static Imports
org.apiguardian.api.API.Status.INTERNAL, .API.Status.STABLE, org.junit.platform.engine.FilterResult.includedIf

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

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static enum

Field Summary

Modifier and TypeField and Description
private final List<String>
private final EngineFilter.Type

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public FilterResult
apply(TestEngine testEngine)

Implements org.junit.platform.engine.Filter.apply.

Apply this filter to the supplied object.

public static EngineFilter
excludeEngines(String...
the list of engine IDs to match against; never null or empty; individual IDs must also not be null or blank
engineIds
)

Create a new exclude EngineFilter based on the supplied engine IDs.

public static EngineFilter
excludeEngines(List<String>
the list of engine IDs to match against; never null or empty; individual IDs must also not be null or blank
engineIds
)

Create a new exclude EngineFilter based on the supplied engine IDs.

public List<String>
public static EngineFilter
includeEngines(String...
the list of engine IDs to match against; never null or empty; individual IDs must also not be null or blank
engineIds
)

Create a new include EngineFilter based on the supplied engine IDs.

public static EngineFilter
includeEngines(List<String>
the list of engine IDs to match against; never null or empty; individual IDs must also not be null or blank
engineIds
)

Create a new include EngineFilter based on the supplied engine IDs.

public boolean
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

private static List<String>
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

engineIdsback to summary
private final List<String> engineIds
typeback to summary
private final EngineFilter.Type type

Constructor Detail

EngineFilterback to summary
private EngineFilter(List<String> engineIds, EngineFilter.Type type)

Method Detail

applyback to summary
public FilterResult apply(TestEngine testEngine)

Implements org.junit.platform.engine.Filter.apply.

Doc from org.junit.platform.engine.Filter.apply.

Apply this filter to the supplied object.

Annotations
@Override
excludeEnginesback to summary
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:String[]

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)
excludeEnginesback to summary
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:List<String>

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...)
getEngineIdsback to summary
public List<String> getEngineIds()
Annotations
@API
status:INTERNAL
since:1.9
includeEnginesback to summary
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:String[]

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...)
includeEnginesback to summary
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:List<String>

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...)
isIncludeFilterback to summary
public boolean isIncludeFilter()
Annotations
@API
status:INTERNAL
since:1.9
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Annotations
@Override
validateAndTrimback to summary
private static List<String> validateAndTrim(List<String> engineIds)
org.junit.platform.launcher back to summary

private final Enum EngineFilter.Type

extends Enum<EngineFilter.Type>
Class Inheritance

Field Summary

Modifier and TypeField and Description
public static final EngineFilter.Type
public static final EngineFilter.Type
private final String

Constructor Summary

AccessConstructor and Description
private
Type(String verb)

Method Summary

Modifier and TypeMethod and Description
public static EngineFilter.Type
public static EngineFilter.Type[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

EXCLUDEback to summary
public static final EngineFilter.Type EXCLUDE
INCLUDEback to summary
public static final EngineFilter.Type INCLUDE
verbback to summary
private final String verb

Constructor Detail

Typeback to summary
private Type(String verb)

Method Detail

valueOfback to summary
public static EngineFilter.Type valueOf(String name)
valuesback to summary
public static EngineFilter.Type[] values()