Class TagFilter
- java.lang.Object
-
- org.junit.platform.launcher.TagFilter
-
@API(status=STABLE, since="1.0") public final class TagFilter extends java.lang.ObjectFactory methods for creatingPostDiscoveryFiltersbased 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:
includeTags(String...),excludeTags(String...),TestTag
-
-
Constructor Summary
Constructors Modifier Constructor Description privateTagFilter()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static PostDiscoveryFilterexcludeMatching(java.util.List<java.lang.String> tagExpressions)static PostDiscoveryFilterexcludeTags(java.lang.String... tagExpressions)Create an exclude filter based on the supplied tag expressions.static PostDiscoveryFilterexcludeTags(java.util.List<java.lang.String> tagExpressions)Create an exclude filter based on the supplied tag expressions.private static java.lang.StringexclusionReasonExpressionNotSatisfy(java.util.List<java.lang.String> tagExpressions)private static java.lang.StringexclusionReasonExpressionSatisfy(java.util.List<java.lang.String> tagExpressions)private static java.lang.StringformatToString(java.util.List<java.lang.String> tagExpressions)private static PostDiscoveryFilterincludeMatching(java.util.List<java.lang.String> tagExpressions)static PostDiscoveryFilterincludeTags(java.lang.String... tagExpressions)Create an include filter based on the supplied tag expressions.static PostDiscoveryFilterincludeTags(java.util.List<java.lang.String> tagExpressions)Create an include filter based on the supplied tag expressions.private static java.lang.StringinclusionReasonExpressionNotSatisfy(java.util.List<java.lang.String> tagExpressions)private static java.lang.StringinclusionReasonExpressionSatisfy(java.util.List<java.lang.String> tagExpressions)private static TagExpressionparse(java.lang.String tagExpression)private static java.util.List<TagExpression>parseAll(java.util.List<java.lang.String> tagExpressions)
-
-
-
Method Detail
-
includeTags
public static PostDiscoveryFilter includeTags(java.lang.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; nevernullor empty- Throws:
org.junit.platform.commons.PreconditionViolationException- if the supplied tag expressions array isnullor empty, or if any individual tag expression is not syntactically valid- See Also:
includeTags(List),TestTag.isValid(String)
-
includeTags
public static PostDiscoveryFilter includeTags(java.util.List<java.lang.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; nevernullor empty- Throws:
org.junit.platform.commons.PreconditionViolationException- if the supplied tag expressions array isnullor empty, or if any individual tag expression is not syntactically valid- See Also:
includeTags(String...),TestTag.isValid(String)
-
excludeTags
public static PostDiscoveryFilter excludeTags(java.lang.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; nevernullor empty- Throws:
org.junit.platform.commons.PreconditionViolationException- if the supplied tag expressions array isnullor empty, or if any individual tag expression is not syntactically valid- See Also:
excludeTags(List),TestTag.isValid(String)
-
excludeTags
public static PostDiscoveryFilter excludeTags(java.util.List<java.lang.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; nevernullor empty- Throws:
org.junit.platform.commons.PreconditionViolationException- if the supplied tag expressions array isnullor empty, or if any individual tag expression is not syntactically valid- See Also:
excludeTags(String...),TestTag.isValid(String)
-
includeMatching
private static PostDiscoveryFilter includeMatching(java.util.List<java.lang.String> tagExpressions)
-
inclusionReasonExpressionSatisfy
private static java.lang.String inclusionReasonExpressionSatisfy(java.util.List<java.lang.String> tagExpressions)
-
exclusionReasonExpressionNotSatisfy
private static java.lang.String exclusionReasonExpressionNotSatisfy(java.util.List<java.lang.String> tagExpressions)
-
excludeMatching
private static PostDiscoveryFilter excludeMatching(java.util.List<java.lang.String> tagExpressions)
-
inclusionReasonExpressionNotSatisfy
private static java.lang.String inclusionReasonExpressionNotSatisfy(java.util.List<java.lang.String> tagExpressions)
-
exclusionReasonExpressionSatisfy
private static java.lang.String exclusionReasonExpressionSatisfy(java.util.List<java.lang.String> tagExpressions)
-
formatToString
private static java.lang.String formatToString(java.util.List<java.lang.String> tagExpressions)
-
parseAll
private static java.util.List<TagExpression> parseAll(java.util.List<java.lang.String> tagExpressions)
-
parse
private static TagExpression parse(java.lang.String tagExpression)
-
-