Class VintageTestDescriptor
- java.lang.Object
-
- org.junit.platform.engine.support.descriptor.AbstractTestDescriptor
-
- org.junit.vintage.engine.descriptor.VintageTestDescriptor
-
- All Implemented Interfaces:
TestDescriptor
- Direct Known Subclasses:
RunnerTestDescriptor
@API(status=INTERNAL, since="4.12") public class VintageTestDescriptor extends AbstractTestDescriptor- Since:
- 4.12
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.junit.platform.engine.TestDescriptor
TestDescriptor.Type, TestDescriptor.Visitor
-
-
Field Summary
Fields Modifier and Type Field Description protected org.junit.runner.Descriptiondescriptionstatic java.lang.StringENGINE_IDstatic java.lang.StringSEGMENT_TYPE_DYNAMICstatic java.lang.StringSEGMENT_TYPE_RUNNERstatic java.lang.StringSEGMENT_TYPE_TEST-
Fields inherited from class org.junit.platform.engine.support.descriptor.AbstractTestDescriptor
children
-
-
Constructor Summary
Constructors Constructor Description VintageTestDescriptor(UniqueId uniqueId, org.junit.runner.Description description, java.lang.String displayName, TestSource source)VintageTestDescriptor(UniqueId uniqueId, org.junit.runner.Description description, TestSource source)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidaddCategoriesAsTags(java.util.Set<TestTag> tags)private voidaddTagsFromParent(java.util.Set<TestTag> tags)protected booleancanBeRemovedFromHierarchy()private static java.lang.StringgenerateDisplayName(org.junit.runner.Description description)org.junit.runner.DescriptiongetDescription()java.lang.StringgetLegacyReportingName()Get the name of this descriptor in a format that is suitable for legacy reporting infrastructure — for example, for reporting systems built on the Ant-based XML reporting format for JUnit 4.java.util.Set<TestTag>getTags()Get the set of tags associated with this descriptor.TestDescriptor.TypegetType()Determine theTestDescriptor.Typeof this descriptor.(package private) voidpruneDescriptorsForObsoleteDescriptions(java.util.List<org.junit.runner.Description> newSiblingDescriptions)voidremoveFromHierarchy()Remove this non-root descriptor from its parent and remove all the children from this descriptor.protected booleantryToExcludeFromRunner(org.junit.runner.Description description)-
Methods inherited from class org.junit.platform.engine.support.descriptor.AbstractTestDescriptor
addChild, equals, findByUniqueId, getChildren, getDisplayName, getParent, getSource, getUniqueId, hashCode, orderChildren, removeChild, setParent, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.junit.platform.engine.TestDescriptor
accept, getAncestors, getDescendants, isContainer, isRoot, isTest, mayRegisterTests, prune
-
-
-
-
Field Detail
-
ENGINE_ID
public static final java.lang.String ENGINE_ID
- See Also:
- Constant Field Values
-
SEGMENT_TYPE_RUNNER
public static final java.lang.String SEGMENT_TYPE_RUNNER
- See Also:
- Constant Field Values
-
SEGMENT_TYPE_TEST
public static final java.lang.String SEGMENT_TYPE_TEST
- See Also:
- Constant Field Values
-
SEGMENT_TYPE_DYNAMIC
public static final java.lang.String SEGMENT_TYPE_DYNAMIC
- See Also:
- Constant Field Values
-
description
protected org.junit.runner.Description description
-
-
Constructor Detail
-
VintageTestDescriptor
public VintageTestDescriptor(UniqueId uniqueId, org.junit.runner.Description description, TestSource source)
-
VintageTestDescriptor
VintageTestDescriptor(UniqueId uniqueId, org.junit.runner.Description description, java.lang.String displayName, TestSource source)
-
-
Method Detail
-
generateDisplayName
private static java.lang.String generateDisplayName(org.junit.runner.Description description)
-
getDescription
public org.junit.runner.Description getDescription()
-
getLegacyReportingName
public java.lang.String getLegacyReportingName()
Description copied from interface:TestDescriptorGet the name of this descriptor in a format that is suitable for legacy reporting infrastructure — for example, for reporting systems built on the Ant-based XML reporting format for JUnit 4.The default implementation delegates to
TestDescriptor.getDisplayName().- Returns:
- the legacy reporting name; never
nullor blank
-
getType
public TestDescriptor.Type getType()
Description copied from interface:TestDescriptorDetermine theTestDescriptor.Typeof this descriptor.- Returns:
- the descriptor type; never
null. - See Also:
TestDescriptor.isContainer(),TestDescriptor.isTest()
-
getTags
public java.util.Set<TestTag> getTags()
Description copied from interface:TestDescriptorGet the set of tags associated with this descriptor.- Specified by:
getTagsin interfaceTestDescriptor- Overrides:
getTagsin classAbstractTestDescriptor- Returns:
- the set of tags associated with this descriptor; never
nullbut potentially empty - See Also:
TestTag
-
removeFromHierarchy
public void removeFromHierarchy()
Description copied from interface:TestDescriptorRemove this non-root descriptor from its parent and remove all the children from this descriptor.If this method is invoked on a root descriptor, this method must throw a
JUnitExceptionexplaining that a root cannot be removed from the hierarchy.- Specified by:
removeFromHierarchyin interfaceTestDescriptor- Overrides:
removeFromHierarchyin classAbstractTestDescriptor
-
canBeRemovedFromHierarchy
protected boolean canBeRemovedFromHierarchy()
-
tryToExcludeFromRunner
protected boolean tryToExcludeFromRunner(org.junit.runner.Description description)
-
pruneDescriptorsForObsoleteDescriptions
void pruneDescriptorsForObsoleteDescriptions(java.util.List<org.junit.runner.Description> newSiblingDescriptions)
-
addTagsFromParent
private void addTagsFromParent(java.util.Set<TestTag> tags)
-
addCategoriesAsTags
private void addCategoriesAsTags(java.util.Set<TestTag> tags)
-
-