Class AbstractOrderingVisitor
- java.lang.Object
-
- org.junit.jupiter.engine.discovery.AbstractOrderingVisitor
-
- All Implemented Interfaces:
TestDescriptor.Visitor
- Direct Known Subclasses:
ClassOrderingVisitor,MethodOrderingVisitor
abstract class AbstractOrderingVisitor extends java.lang.Object implements TestDescriptor.Visitor
Abstract base class for visitors that order children nodes.- Since:
- 5.8
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classAbstractOrderingVisitor.DescriptorWrapperOrderer<ORDERER,WRAPPER>protected static interfaceAbstractOrderingVisitor.MessageGenerator
-
Field Summary
Fields Modifier and Type Field Description private DiscoveryIssueReporterissueReporter
-
Constructor Summary
Constructors Constructor Description AbstractOrderingVisitor(DiscoveryIssueReporter issueReporter)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected <PARENT extends TestDescriptor>
voiddoWithMatchingDescriptor(java.lang.Class<PARENT> parentTestDescriptorType, TestDescriptor testDescriptor, java.util.function.Consumer<PARENT> action, java.util.function.Function<PARENT,java.lang.String> errorMessageBuilder)protected <CHILD extends TestDescriptor,WRAPPER extends AbstractAnnotatedDescriptorWrapper<?>>
voidorderChildrenTestDescriptors(TestDescriptor parentTestDescriptor, java.lang.Class<CHILD> matchingChildrenType, java.util.Optional<java.util.function.Consumer<CHILD>> validationAction, java.util.function.Function<CHILD,WRAPPER> descriptorWrapperFactory, AbstractOrderingVisitor.DescriptorWrapperOrderer<?,WRAPPER> descriptorWrapperOrderer)private voidreportWarning(TestDescriptor parentTestDescriptor, java.lang.String message)protected abstract booleanshouldNonMatchingDescriptorsComeBeforeOrderedOnes()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.junit.platform.engine.TestDescriptor.Visitor
visit
-
-
-
-
Field Detail
-
issueReporter
private final DiscoveryIssueReporter issueReporter
-
-
Constructor Detail
-
AbstractOrderingVisitor
AbstractOrderingVisitor(DiscoveryIssueReporter issueReporter)
-
-
Method Detail
-
doWithMatchingDescriptor
protected <PARENT extends TestDescriptor> void doWithMatchingDescriptor(java.lang.Class<PARENT> parentTestDescriptorType, TestDescriptor testDescriptor, java.util.function.Consumer<PARENT> action, java.util.function.Function<PARENT,java.lang.String> errorMessageBuilder)
- Type Parameters:
PARENT- the parent container type to search in for matching children
-
orderChildrenTestDescriptors
protected <CHILD extends TestDescriptor,WRAPPER extends AbstractAnnotatedDescriptorWrapper<?>> void orderChildrenTestDescriptors(TestDescriptor parentTestDescriptor, java.lang.Class<CHILD> matchingChildrenType, java.util.Optional<java.util.function.Consumer<CHILD>> validationAction, java.util.function.Function<CHILD,WRAPPER> descriptorWrapperFactory, AbstractOrderingVisitor.DescriptorWrapperOrderer<?,WRAPPER> descriptorWrapperOrderer)
- Type Parameters:
CHILD- the type of children (containers or tests) to order
-
reportWarning
private void reportWarning(TestDescriptor parentTestDescriptor, java.lang.String message)
-
shouldNonMatchingDescriptorsComeBeforeOrderedOnes
protected abstract boolean shouldNonMatchingDescriptorsComeBeforeOrderedOnes()
-
-