Package org.junit.platform.launcher
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 java.lang.Object implements Filter<TestEngine>AnEngineFilteris applied to allTestEnginesbefore they are used.Warning: be cautious when registering multiple competing
includeEngineFiltersor multiple competingexcludeEngineFiltersfor 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 Class Summary
Nested Classes Modifier and Type Class Description private static classEngineFilter.Type
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<java.lang.String>engineIdsprivate EngineFilter.Typetype
-
Constructor Summary
Constructors Modifier Constructor Description privateEngineFilter(java.util.List<java.lang.String> engineIds, EngineFilter.Type type)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description FilterResultapply(TestEngine testEngine)Apply this filter to the supplied object.static EngineFilterexcludeEngines(java.lang.String... engineIds)Create a new excludeEngineFilterbased on the supplied engine IDs.static EngineFilterexcludeEngines(java.util.List<java.lang.String> engineIds)Create a new excludeEngineFilterbased on the supplied engine IDs.java.util.List<java.lang.String>getEngineIds()static EngineFilterincludeEngines(java.lang.String... engineIds)Create a new includeEngineFilterbased on the supplied engine IDs.static EngineFilterincludeEngines(java.util.List<java.lang.String> engineIds)Create a new includeEngineFilterbased on the supplied engine IDs.booleanisIncludeFilter()java.lang.StringtoString()private static java.util.List<java.lang.String>validateAndTrim(java.util.List<java.lang.String> engineIds)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.junit.platform.engine.Filter
toPredicate
-
-
-
-
Field Detail
-
engineIds
private final java.util.List<java.lang.String> engineIds
-
type
private final EngineFilter.Type type
-
-
Constructor Detail
-
EngineFilter
private EngineFilter(java.util.List<java.lang.String> engineIds, EngineFilter.Type type)
-
-
Method Detail
-
includeEngines
public static EngineFilter includeEngines(java.lang.String... engineIds)
Create a new includeEngineFilterbased on the supplied engine IDs.Only
TestEngineswith matching engine IDs will be included within the test discovery and execution.- Parameters:
engineIds- the list of engine IDs to match against; nevernullor empty; individual IDs must also not be null or blank- See Also:
includeEngines(String...)
-
includeEngines
public static EngineFilter includeEngines(java.util.List<java.lang.String> engineIds)
Create a new includeEngineFilterbased on the supplied engine IDs.Only
TestEngineswith matching engine IDs will be included within the test discovery and execution.- Parameters:
engineIds- the list of engine IDs to match against; nevernullor empty; individual IDs must also not be null or blank- See Also:
includeEngines(String...)
-
excludeEngines
public static EngineFilter excludeEngines(java.lang.String... engineIds)
Create a new excludeEngineFilterbased on the supplied engine IDs.TestEngineswith matching engine IDs will be excluded from test discovery and execution.- Parameters:
engineIds- the list of engine IDs to match against; nevernullor empty; individual IDs must also not be null or blank- See Also:
excludeEngines(List)
-
excludeEngines
public static EngineFilter excludeEngines(java.util.List<java.lang.String> engineIds)
Create a new excludeEngineFilterbased on the supplied engine IDs.TestEngineswith matching engine IDs will be excluded from test discovery and execution.- Parameters:
engineIds- the list of engine IDs to match against; nevernullor empty; individual IDs must also not be null or blank- See Also:
includeEngines(String...)
-
getEngineIds
@API(status=INTERNAL, since="1.9") public java.util.List<java.lang.String> getEngineIds()
-
isIncludeFilter
@API(status=INTERNAL, since="1.9") public boolean isIncludeFilter()
-
apply
public FilterResult apply(TestEngine testEngine)
Description copied from interface:FilterApply this filter to the supplied object.- Specified by:
applyin interfaceFilter<TestEngine>
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
validateAndTrim
private static java.util.List<java.lang.String> validateAndTrim(java.util.List<java.lang.String> engineIds)
-
-