Top Description Inners Fields Constructors Methods
org.junit.jupiter.engine.discovery

pack-priv abstract Class AbstractOrderingVisitor

extends Object
implements Visitor
Class Inheritance
All Implemented Interfaces
org.junit.platform.engine.TestDescriptor.Visitor
Known Direct Subclasses
org.junit.jupiter.engine.discovery.ClassOrderingVisitor, org.junit.jupiter.engine.discovery.MethodOrderingVisitor
Static Imports
java.util.Comparator.comparing, .Objects.requireNonNull, java.util.stream.Collectors.toCollection

Abstract base class for visitors that order children nodes.
Since
5.8

Nested and Inner Type Summary

Modifier and TypeClass and Description
protected static class
AbstractOrderingVisitor.DescriptorWrapperOrderer<PARENT extends TestDescriptor, ORDERER,
the wrapper type for the children to order
WRAPPER
>

protected static interface
protected static interface

Field Summary

Modifier and TypeField and Description
private final DiscoveryIssueReporter

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
protected <
the parent container type to search in for matching children
PARENT extends TestDescriptor
>
void
doWithMatchingDescriptor(Class<PARENT> parentTestDescriptorType, TestDescriptor testDescriptor, Consumer<PARENT> action, Function<PARENT, String> errorMessageBuilder)

protected <PARENT extends TestDescriptor,
the type of children (containers or tests) to order
CHILD extends TestDescriptor
, WRAPPER extends AbstractAnnotatedDescriptorWrapper<?>>
void
orderChildrenTestDescriptors(PARENT parentTestDescriptor, Class<CHILD> matchingChildrenType, Optional<Consumer<CHILD>> validationAction, Function<CHILD, WRAPPER> descriptorWrapperFactory, AbstractOrderingVisitor.DescriptorWrapperOrderer<PARENT, ?, WRAPPER> descriptorWrapperOrderer)

private void
reportWarning(TestDescriptor parentTestDescriptor, String message)

protected abstract boolean
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

issueReporterback to summary
private final DiscoveryIssueReporter issueReporter

Constructor Detail

AbstractOrderingVisitorback to summary
pack-priv AbstractOrderingVisitor(DiscoveryIssueReporter issueReporter)

Method Detail

doWithMatchingDescriptorback to summary
protected <PARENT extends TestDescriptor> void doWithMatchingDescriptor(Class<PARENT> parentTestDescriptorType, TestDescriptor testDescriptor, Consumer<PARENT> action, Function<PARENT, String> errorMessageBuilder)
Parameters
<PARENT>
the parent container type to search in for matching children
Annotations
@SuppressWarnings:unchecked
orderChildrenTestDescriptorsback to summary
protected <PARENT extends TestDescriptor, CHILD extends TestDescriptor, WRAPPER extends AbstractAnnotatedDescriptorWrapper<?>> void orderChildrenTestDescriptors(PARENT parentTestDescriptor, Class<CHILD> matchingChildrenType, Optional<Consumer<CHILD>> validationAction, Function<CHILD, WRAPPER> descriptorWrapperFactory, AbstractOrderingVisitor.DescriptorWrapperOrderer<PARENT, ?, WRAPPER> descriptorWrapperOrderer)
Parameters
<CHILD>
the type of children (containers or tests) to order
reportWarningback to summary
private void reportWarning(TestDescriptor parentTestDescriptor, String message)
shouldNonMatchingDescriptorsComeBeforeOrderedOnesback to summary
protected abstract boolean shouldNonMatchingDescriptorsComeBeforeOrderedOnes()
org.junit.jupiter.engine.discovery back to summary

protected Class AbstractOrderingVisitor.DescriptorWrapperOrderer<PARENT extends TestDescriptor, ORDERER, WRAPPER>

extends Object
Class Inheritance
  • java.lang.Object
  • org.junit.jupiter.engine.discovery.AbstractOrderingVisitor.DescriptorWrapperOrderer
Type Parameters
<WRAPPER>
the wrapper type for the children to order

Field Summary

Modifier and TypeField and Description
private final AbstractOrderingVisitor.MessageGenerator<PARENT>
private final AbstractOrderingVisitor.MessageGenerator<PARENT>
private static final AbstractOrderingVisitor.DescriptorWrapperOrderer<?, ?, ?>
private final @Nullable ORDERER
private final @Nullable AbstractOrderingVisitor.OrderingAction<PARENT, WRAPPER>

Constructor Summary

AccessConstructor and Description
pack-priv
DescriptorWrapperOrderer(@Nullable ORDERER orderer, @Nullable AbstractOrderingVisitor.OrderingAction<PARENT, WRAPPER> orderingAction, AbstractOrderingVisitor.MessageGenerator<PARENT> descriptorsAddedMessageGenerator, AbstractOrderingVisitor.MessageGenerator<PARENT> descriptorsRemovedMessageGenerator)

Method Summary

Modifier and TypeMethod and Description
private boolean
private Map<Object, Integer>
pack-priv @Nullable ORDERER
pack-priv static <PARENT extends TestDescriptor, ORDERER, WRAPPER extends AbstractAnnotatedDescriptorWrapper<?>> AbstractOrderingVisitor.DescriptorWrapperOrderer<PARENT, ORDERER, WRAPPER>
noop()

private void
orderWrappers(PARENT parentTestDescriptor, List<WRAPPER> wrappers, Consumer<String> errorHandler)

private void
reportDescriptorsAddedWarning(int number, Consumer<String> errorHandler, PARENT parentTestDescriptor)

private void
reportDescriptorsRemovedWarning(int number, Consumer<String> errorHandler, PARENT parentTestDescriptor)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

descriptorsAddedMessageGeneratorback to summary
private final AbstractOrderingVisitor.MessageGenerator<PARENT> descriptorsAddedMessageGenerator
descriptorsRemovedMessageGeneratorback to summary
private final AbstractOrderingVisitor.MessageGenerator<PARENT> descriptorsRemovedMessageGenerator
NOOPback to summary
private static final AbstractOrderingVisitor.DescriptorWrapperOrderer<?, ?, ?> NOOP
ordererback to summary
private final @Nullable ORDERER orderer
orderingActionback to summary
private final @Nullable AbstractOrderingVisitor.OrderingAction<PARENT, WRAPPER> orderingAction

Constructor Detail

DescriptorWrapperOrdererback to summary
pack-priv DescriptorWrapperOrderer(@Nullable ORDERER orderer, @Nullable AbstractOrderingVisitor.OrderingAction<PARENT, WRAPPER> orderingAction, AbstractOrderingVisitor.MessageGenerator<PARENT> descriptorsAddedMessageGenerator, AbstractOrderingVisitor.MessageGenerator<PARENT> descriptorsRemovedMessageGenerator)

Method Detail

canOrderWrappersback to summary
private boolean canOrderWrappers()
distinctWrappersToIndexback to summary
private Map<Object, Integer> distinctWrappersToIndex(List<?> wrappers)
getOrdererback to summary
pack-priv @Nullable ORDERER getOrderer()
noopback to summary
pack-priv static <PARENT extends TestDescriptor, ORDERER, WRAPPER extends AbstractAnnotatedDescriptorWrapper<?>> AbstractOrderingVisitor.DescriptorWrapperOrderer<PARENT, ORDERER, WRAPPER> noop()
Annotations
@SuppressWarnings:unchecked
orderWrappersback to summary
private void orderWrappers(PARENT parentTestDescriptor, List<WRAPPER> wrappers, Consumer<String> errorHandler)
reportDescriptorsAddedWarningback to summary
private void reportDescriptorsAddedWarning(int number, Consumer<String> errorHandler, PARENT parentTestDescriptor)
reportDescriptorsRemovedWarningback to summary
private void reportDescriptorsRemovedWarning(int number, Consumer<String> errorHandler, PARENT parentTestDescriptor)
org.junit.jupiter.engine.discovery back to summary

protected Interface AbstractOrderingVisitor.MessageGenerator<PARENT extends TestDescriptor>

Annotations
@FunctionalInterface

Method Summary

Modifier and TypeMethod and Description
public String
generateMessage(PARENT testDescriptor, int number)

Method Detail

generateMessageback to summary
public String generateMessage(PARENT testDescriptor, int number)
org.junit.jupiter.engine.discovery back to summary

protected Interface AbstractOrderingVisitor.OrderingAction<PARENT extends TestDescriptor, WRAPPER>

Annotations
@FunctionalInterface

Method Summary

Modifier and TypeMethod and Description
public void
order(PARENT testDescriptor, List<WRAPPER> wrappers)

Method Detail

orderback to summary
public void order(PARENT testDescriptor, List<WRAPPER> wrappers)