@API(status=STABLE,
since="1.0")
public final class TagFilter
extends java.lang.Object
PostDiscoveryFilters
based on included and excluded tags or tag expressions.
Tag expressions are boolean expressions with the following allowed
operators: !
(not), &
(and), and |
(or). Parentheses
can be used to adjust for operator precedence. Please refer to the
JUnit 5 User Guide
for usage examples.
Please note that a tag name is a valid tag expression. Thus, wherever a tag expression can be used, a single tag name can also be used.
includeTags(String...)
,
excludeTags(String...)
,
TestTag
Modifier | Constructor and Description |
---|---|
private |
TagFilter() |
Modifier and Type | Method and Description |
---|---|
static PostDiscoveryFilter |
excludeTags(java.util.List<java.lang.String> tagExpressions)
Create an exclude filter based on the supplied tag expressions.
|
static PostDiscoveryFilter |
excludeTags(java.lang.String... tagExpressions)
Create an exclude filter based on the supplied tag expressions.
|
private static PostDiscoveryFilter |
includeMatching(java.util.List<java.lang.String> tagExpressions,
java.util.function.BiPredicate<java.util.stream.Stream<TagExpression>,java.util.function.Predicate<TagExpression>> matcher) |
static PostDiscoveryFilter |
includeTags(java.util.List<java.lang.String> tagExpressions)
Create an include filter based on the supplied tag expressions.
|
static PostDiscoveryFilter |
includeTags(java.lang.String... tagExpressions)
Create an include filter based on the supplied tag expressions.
|
private static TagExpression |
parse(java.lang.String tagExpression) |
private static java.util.List<TagExpression> |
parseAll(java.util.List<java.lang.String> tagExpressions) |
public static PostDiscoveryFilter includeTags(java.lang.String... tagExpressions) throws PreconditionViolationException
Containers and tests will only be executed if their tags match at least one of the supplied included tag expressions.
tagExpressions
- the included tag expressions; never null
or
emptyPreconditionViolationException
- if the supplied tag expressions
array is null
or empty, or if any individual tag expression is
not syntactically validincludeTags(List)
,
TestTag.isValid(String)
public static PostDiscoveryFilter includeTags(java.util.List<java.lang.String> tagExpressions) throws PreconditionViolationException
Containers and tests will only be executed if their tags match at least one of the supplied included tag expressions.
tagExpressions
- the included tag expressions; never null
or
emptyPreconditionViolationException
- if the supplied tag expressions
array is null
or empty, or if any individual tag expression is
not syntactically validincludeTags(String...)
,
TestTag.isValid(String)
public static PostDiscoveryFilter excludeTags(java.lang.String... tagExpressions) throws PreconditionViolationException
Containers and tests will only be executed if their tags do not match any of the supplied excluded tag expressions.
tagExpressions
- the excluded tag expressions; never null
or
emptyPreconditionViolationException
- if the supplied tag expressions
array is null
or empty, or if any individual tag expression is
not syntactically validexcludeTags(List)
,
TestTag.isValid(String)
public static PostDiscoveryFilter excludeTags(java.util.List<java.lang.String> tagExpressions) throws PreconditionViolationException
Containers and tests will only be executed if their tags do not match any of the supplied excluded tag expressions.
tagExpressions
- the excluded tag expressions; never null
or
emptyPreconditionViolationException
- if the supplied tag expressions
array is null
or empty, or if any individual tag expression is
not syntactically validexcludeTags(String...)
,
TestTag.isValid(String)
private static PostDiscoveryFilter includeMatching(java.util.List<java.lang.String> tagExpressions, java.util.function.BiPredicate<java.util.stream.Stream<TagExpression>,java.util.function.Predicate<TagExpression>> matcher)
private static java.util.List<TagExpression> parseAll(java.util.List<java.lang.String> tagExpressions)
private static TagExpression parse(java.lang.String tagExpression)