Class TagFilter
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.
- Since:
- 1.0
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static PostDiscoveryFilter
excludeMatching
(List<String> tagExpressions) static PostDiscoveryFilter
excludeTags
(String... tagExpressions) Create an exclude filter based on the supplied tag expressions.static PostDiscoveryFilter
excludeTags
(List<String> tagExpressions) Create an exclude filter based on the supplied tag expressions.private static String
exclusionReasonExpressionNotSatisfy
(List<String> tagExpressions) private static String
exclusionReasonExpressionSatisfy
(List<String> tagExpressions) private static String
formatToString
(List<String> tagExpressions) private static PostDiscoveryFilter
includeMatching
(List<String> tagExpressions) static PostDiscoveryFilter
includeTags
(String... tagExpressions) Create an include filter based on the supplied tag expressions.static PostDiscoveryFilter
includeTags
(List<String> tagExpressions) Create an include filter based on the supplied tag expressions.private static String
inclusionReasonExpressionNotSatisfy
(List<String> tagExpressions) private static String
inclusionReasonExpressionSatisfy
(List<String> tagExpressions) private static TagExpression
private static List
<TagExpression>
-
Constructor Details
-
TagFilter
private TagFilter()
-
-
Method Details
-
includeTags
public static PostDiscoveryFilter includeTags(String... tagExpressions) throws org.junit.platform.commons.PreconditionViolationException Create an include filter based on the supplied tag expressions.Containers and tests will only be executed if their tags match at least one of the supplied included tag expressions.
- Parameters:
tagExpressions
- the included tag expressions; nevernull
or empty- Throws:
org.junit.platform.commons.PreconditionViolationException
- if the supplied tag expressions array isnull
or empty, or if any individual tag expression is not syntactically valid- See Also:
-
includeTags
public static PostDiscoveryFilter includeTags(List<String> tagExpressions) throws org.junit.platform.commons.PreconditionViolationException Create an include filter based on the supplied tag expressions.Containers and tests will only be executed if their tags match at least one of the supplied included tag expressions.
- Parameters:
tagExpressions
- the included tag expressions; nevernull
or empty- Throws:
org.junit.platform.commons.PreconditionViolationException
- if the supplied tag expressions array isnull
or empty, or if any individual tag expression is not syntactically valid- See Also:
-
excludeTags
public static PostDiscoveryFilter excludeTags(String... tagExpressions) throws org.junit.platform.commons.PreconditionViolationException Create an exclude filter based on the supplied tag expressions.Containers and tests will only be executed if their tags do not match any of the supplied excluded tag expressions.
- Parameters:
tagExpressions
- the excluded tag expressions; nevernull
or empty- Throws:
org.junit.platform.commons.PreconditionViolationException
- if the supplied tag expressions array isnull
or empty, or if any individual tag expression is not syntactically valid- See Also:
-
excludeTags
public static PostDiscoveryFilter excludeTags(List<String> tagExpressions) throws org.junit.platform.commons.PreconditionViolationException Create an exclude filter based on the supplied tag expressions.Containers and tests will only be executed if their tags do not match any of the supplied excluded tag expressions.
- Parameters:
tagExpressions
- the excluded tag expressions; nevernull
or empty- Throws:
org.junit.platform.commons.PreconditionViolationException
- if the supplied tag expressions array isnull
or empty, or if any individual tag expression is not syntactically valid- See Also:
-
includeMatching
-
inclusionReasonExpressionSatisfy
-
exclusionReasonExpressionNotSatisfy
-
excludeMatching
-
inclusionReasonExpressionNotSatisfy
-
exclusionReasonExpressionSatisfy
-
formatToString
-
parseAll
-
parse
-