Top Inners Fields Constructors Methods
org.junit.platform.engine.support.discovery

pack-priv Class EngineDiscoveryRequestResolution

extends Object
Class Inheritance
Static Imports
java.util.Objects.requireNonNullElse, java.util.stream.Collectors.joining, org.junit.platform.commons.util.CollectionUtils.getOnlyElement, org.junit.platform.engine.SelectorResolutionResult.failed, .SelectorResolutionResult.resolved, .SelectorResolutionResult.unresolved

Since
1.5

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class

Field Summary

Modifier and TypeField and Description
private final Map<DiscoverySelector, SelectorResolver.Context>
private final SelectorResolver.Context
private final TestDescriptor
private final Queue<DiscoverySelector>
private final EngineDiscoveryRequest
private final Map<DiscoverySelector, SelectorResolver.Resolution>
private final Map<UniqueId, SelectorResolver.Match>
private final List<SelectorResolver>
private final List<TestDescriptor.Visitor>

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
private void
private SelectorResolver.Context
private Optional<SelectorResolver.Resolution>
private Optional<SelectorResolver.Resolution>
private void
private Optional<SelectorResolver.Resolution>
pack-priv void
run()

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

contextBySelectorback to summary
private final Map<DiscoverySelector, SelectorResolver.Context> contextBySelector
defaultContextback to summary
private final SelectorResolver.Context defaultContext
engineDescriptorback to summary
private final TestDescriptor engineDescriptor
remainingSelectorsback to summary
private final Queue<DiscoverySelector> remainingSelectors
requestback to summary
private final EngineDiscoveryRequest request
resolvedSelectorsback to summary
private final Map<DiscoverySelector, SelectorResolver.Resolution> resolvedSelectors
resolvedUniqueIdsback to summary
private final Map<UniqueId, SelectorResolver.Match> resolvedUniqueIds
resolversback to summary
private final List<SelectorResolver> resolvers
visitorsback to summary
private final List<TestDescriptor.Visitor> visitors

Constructor Detail

EngineDiscoveryRequestResolutionback to summary
pack-priv EngineDiscoveryRequestResolution(EngineDiscoveryRequest request, TestDescriptor engineDescriptor, List<SelectorResolver> resolvers, List<TestDescriptor.Visitor> visitors)

Method Detail

enqueueAdditionalSelectorsback to summary
private void enqueueAdditionalSelectors(SelectorResolver.Resolution resolution)
getContextback to summary
private SelectorResolver.Context getContext(DiscoverySelector selector)
resolveback to summary
private Optional<SelectorResolver.Resolution> resolve(DiscoverySelector selector)
resolveback to summary
private Optional<SelectorResolver.Resolution> resolve(DiscoverySelector selector, Function<SelectorResolver, SelectorResolver.Resolution> resolutionFunction)
resolveCompletelyback to summary
private void resolveCompletely(DiscoverySelector selector)
resolveUniqueIdback to summary
private Optional<SelectorResolver.Resolution> resolveUniqueId(UniqueIdSelector selector)
runback to summary
pack-priv void run()
org.junit.platform.engine.support.discovery back to summary

private Class EngineDiscoveryRequestResolution.DefaultContext

extends Object
implements Context
Class Inheritance
  • java.lang.Object
  • org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.DefaultContext
All Implemented Interfaces
org.junit.platform.engine.support.discovery.SelectorResolver.Context

Field Summary

Modifier and TypeField and Description
private final @Nullable TestDescriptor

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public <T extends TestDescriptor> Optional<T>
addToParent(Function<TestDescriptor, Optional<T>> creator)

Implements org.junit.platform.engine.support.discovery.SelectorResolver.Context.addToParent.

Add a TestDescriptor to an unspecified parent, usually the engine descriptor, by applying the supplied Function to the new parent.

public <T extends TestDescriptor> Optional<T>
addToParent(Supplier<DiscoverySelector> parentSelectorSupplier, Function<TestDescriptor, Optional<T>> creator)

Implements org.junit.platform.engine.support.discovery.SelectorResolver.Context.addToParent.

Add a TestDescriptor to a parent, specified by the DiscoverySelector returned by the supplied Supplier, by applying the supplied Function to the new parent.

private <T extends TestDescriptor> Optional<T>
public Optional<TestDescriptor>
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

parentback to summary
private final @Nullable TestDescriptor parent

Constructor Detail

DefaultContextback to summary
pack-priv DefaultContext(@Nullable TestDescriptor parent)

Method Detail

addToParentback to summary
public <T extends TestDescriptor> Optional<T> addToParent(Function<TestDescriptor, Optional<T>> creator)

Implements org.junit.platform.engine.support.discovery.SelectorResolver.Context.addToParent.

Doc from org.junit.platform.engine.support.discovery.SelectorResolver.Context.addToParent.

Add a TestDescriptor to an unspecified parent, usually the engine descriptor, by applying the supplied Function to the new parent.

The parent will be the engine descriptor unless another parent has already been determined, i.e. if the selector that is being resolved is the result of expanding a Match.

If the result of applying the Function is present, it will be added as a child of the parent TestDescriptor unless a descriptor with the same unique ID was added earlier.

Annotations
@Override
addToParentback to summary
public <T extends TestDescriptor> Optional<T> addToParent(Supplier<DiscoverySelector> parentSelectorSupplier, Function<TestDescriptor, Optional<T>> creator)

Implements org.junit.platform.engine.support.discovery.SelectorResolver.Context.addToParent.

Doc from org.junit.platform.engine.support.discovery.SelectorResolver.Context.addToParent.

Add a TestDescriptor to a parent, specified by the DiscoverySelector returned by the supplied Supplier, by applying the supplied Function to the new parent.

Unless another parent has already been determined, i.e. if the selector that is being resolved is the result of expanding a Match, the DiscoverySelector returned by the supplied Supplier will be used to determine the parent. If no parent is found, the supplied Function will not be called. If there are multiple potential parents, an exception will be thrown. Otherwise, the resolved TestDescriptor will be used as the parent and passed to the supplied Function.

If the result of applying the Function is present, it will be added as a child of the parent TestDescriptor unless a descriptor with the same unique ID was added earlier.

Annotations
@Override
createAndAddback to summary
private <T extends TestDescriptor> Optional<T> createAndAdd(TestDescriptor parent, Function<TestDescriptor, Optional<T>> creator)
Annotations
@SuppressWarnings:unchecked
resolveback to summary
public Optional<TestDescriptor> resolve(DiscoverySelector selector)

Implements org.junit.platform.engine.support.discovery.SelectorResolver.Context.resolve.

Doc from org.junit.platform.engine.support.discovery.SelectorResolver.Context.resolve.

Resolve the supplied TestDescriptor, if possible.

Calling this method has the same effect as returning a partial match from a SelectorResolver: the children of the resulting TestDescriptor will only be resolved if a subsequent resolution finds an exact match that contains a TestDescriptor with the same unique ID.

Annotations
@Override