public class Description
The description gives the full path to a class TestCase.
It contains the name of every parent, with the root at index 0. And it includes the name of the test case it represents.
This is useful when you want to write generic extensions and you need to be able to filter on certain tests only.
class TestCase| Modifier and Type | Class and Description |
|---|---|
static class |
Description.Companion |
| Modifier and Type | Field and Description |
|---|---|
static Description.Companion |
Companion |
| Constructor and Description |
|---|
Description(java.util.List<java.lang.String> parents,
java.lang.String name)
The description gives the full path to a
class TestCase. |
| Modifier and Type | Method and Description |
|---|---|
Description |
append(java.lang.String name) |
java.util.List<java.lang.String> |
component1()
each parent test case
|
java.lang.String |
component2()
the name of this test case
|
Description |
copy(java.util.List<java.lang.String> parents,
java.lang.String name)
The description gives the full path to a
class TestCase. |
int |
depth() |
boolean |
equals(java.lang.Object p) |
java.lang.String |
fullName() |
java.lang.String |
getName()
the name of this test case
|
java.util.List<java.lang.String> |
getParents()
each parent test case
|
boolean |
hasParent(Description description) |
int |
hashCode() |
java.lang.String |
id()
Returns a String version of this description, which is
the parents + this name concatenated with slashes.
|
boolean |
isAncestorOf(Description description)
Returns true if this instance is an ancestor of the supplied argument.
|
boolean |
isParentOf(Description description)
Returns true if this instance is the immediate parent of the supplied argument.
|
boolean |
isSpec() |
boolean |
isTopLevel()
Returns true if this test is a top level test. In other words, if the
test has no parents other than the spec itself.
|
java.util.List<java.lang.String> |
names() |
Description |
parent() |
Description |
spec() |
Description |
tail() |
java.lang.String |
toString() |
public static Description.Companion Companion
public Description(java.util.List<java.lang.String> parents,
java.lang.String name)
The description gives the full path to a class TestCase.
It contains the name of every parent, with the root at index 0. And it includes the name of the test case it represents.
This is useful when you want to write generic extensions and you need to be able to filter on certain tests only.
parents - each parent test casename - the name of this test caseparents - each parent test casename - the name of this test caseclass TestCasepublic Description append(java.lang.String name)
public boolean hasParent(Description description)
public Description parent()
public boolean isSpec()
public Description spec()
public Description tail()
public java.lang.String fullName()
public java.lang.String id()
Returns a String version of this description, which is the parents + this name concatenated with slashes.
public java.util.List<java.lang.String> names()
public int depth()
public boolean isParentOf(Description description)
Returns true if this instance is the immediate parent of the supplied argument.
public boolean isAncestorOf(Description description)
Returns true if this instance is an ancestor of the supplied argument.
public boolean isTopLevel()
Returns true if this test is a top level test. In other words, if the test has no parents other than the spec itself.
public java.util.List<java.lang.String> getParents()
each parent test case
public java.lang.String getName()
the name of this test case
public java.util.List<java.lang.String> component1()
each parent test case
public java.lang.String component2()
the name of this test case
public Description copy(java.util.List<java.lang.String> parents, java.lang.String name)
The description gives the full path to a class TestCase.
It contains the name of every parent, with the root at index 0. And it includes the name of the test case it represents.
This is useful when you want to write generic extensions and you need to be able to filter on certain tests only.
parents - each parent test casename - the name of this test caseclass TestCasepublic java.lang.String toString()
public int hashCode()
public boolean equals(java.lang.Object p)