java.lang.Object
org.junit.platform.engine.TestTag
- All Implemented Interfaces:
Serializable
Immutable value object for a tag that is assigned to a test or
container.
- Since:
- 1.0
- See Also:
isValid(String)
,create(String)
, Serialized Form
-
Field Summary
Modifier and TypeFieldDescriptionReserved characters that are not permissible as part of a tag name. -
Method Summary
-
Field Details
-
RESERVED_CHARACTERS
Reserved characters that are not permissible as part of a tag name.,
: comma(
: left parenthesis)
: right parenthesis&
: ampersand|
: vertical bar!
: exclamation point
-
-
Method Details
-
isValid
Determine if the supplied tag name is valid with regard to the supported syntax for tags.Syntax Rules for Tags
- A tag must not be
null
. - A tag must not be blank.
- A trimmed tag must not contain whitespace.
- A trimmed tag must not contain ISO control characters.
- A trimmed tag must not contain reserved characters.
If this method returns
true
for a given name, it is then a valid candidate for thecreate()
factory method.- Parameters:
name
- the name of the tag to validate; may benull
or blank- Returns:
true
if the supplied tag name conforms to the supported syntax for tags- See Also:
StringUtils.isNotBlank(String)
,String.trim()
,StringUtils.doesNotContainWhitespace(String)
,StringUtils.doesNotContainIsoControlCharacter(String)
,RESERVED_CHARACTERS
,create(String)
- A tag must not be
-
create
Create aTestTag
from the suppliedname
.Consider checking whether the syntax of the supplied
name
is valid before attempting to create aTestTag
using this factory method.Note: the supplied
name
will be trimmed.- Parameters:
name
- the name of the tag; must be syntactically valid- Throws:
PreconditionViolationException
- if the supplied tag name is not syntactically valid- See Also:
isValid(String)
-
getName
Get the name of this tag.- Returns:
- the name of this tag; never
null
or blank
-
equals
-
hashCode
public int hashCode() -
toString
-