Package org.junit.runner
Class Description
- java.lang.Object
-
- org.junit.runner.Description
-
- All Implemented Interfaces:
Serializable
public class Description extends Object implements Serializable
Exists so that we can exclude junit 4 from our dependencies and still use testcontainers.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static Description
EMPTY
static Description
TEST_MECHANISM
-
Method Summary
-
-
-
Field Detail
-
EMPTY
public static final Description EMPTY
-
TEST_MECHANISM
public static final Description TEST_MECHANISM
-
-
Method Detail
-
createSuiteDescription
public static Description createSuiteDescription(String name, Annotation... annotations)
-
createSuiteDescription
public static Description createSuiteDescription(String name, Serializable uniqueId, Annotation... annotations)
-
createTestDescription
public static Description createTestDescription(String className, String name, Annotation... annotations)
-
createTestDescription
public static Description createTestDescription(Class<?> clazz, String name, Annotation... annotations)
-
createTestDescription
public static Description createTestDescription(Class<?> clazz, String name)
-
createTestDescription
public static Description createTestDescription(String className, String name, Serializable uniqueId)
-
createSuiteDescription
public static Description createSuiteDescription(Class<?> testClass)
-
createSuiteDescription
public static Description createSuiteDescription(Class<?> testClass, Annotation... annotations)
-
getDisplayName
public String getDisplayName()
- Returns:
- a user-understandable label
-
addChild
public void addChild(Description description)
AddDescription
as a child of the receiver.- Parameters:
description
- the soon-to-be child.
-
getChildren
public ArrayList<Description> getChildren()
Gets the copy of the children of thisDescription
. Returns an empty list if there are no children.
-
isSuite
public boolean isSuite()
- Returns:
true
if the receiver is a suite
-
isTest
public boolean isTest()
- Returns:
true
if the receiver is an atomic test
-
testCount
public int testCount()
- Returns:
- the total number of atomic tests in the receiver
-
isEmpty
public boolean isEmpty()
- Returns:
- true if this is a description of a Runner that runs no tests
-
childlessCopy
public Description childlessCopy()
- Returns:
- a copy of this description, with no children (on the assumption that some of the children will be added back)
-
getAnnotation
public <T extends Annotation> T getAnnotation(Class<T> annotationType)
- Returns:
- the annotation of type annotationType that is attached to this description node, or null if none exists
-
getAnnotations
public Collection<Annotation> getAnnotations()
- Returns:
- all of the annotations attached to this description node
-
getTestClass
public Class<?> getTestClass()
- Returns:
- If this describes a method invocation, the class of the test instance.
-
getClassName
public String getClassName()
- Returns:
- If this describes a method invocation, the name of the class of the test instance
-
getMethodName
public String getMethodName()
- Returns:
- If this describes a method invocation, the name of the method (or null if not)
-
-