@API(status=EXPERIMENTAL,
since="1.5")
public static class SelectorResolver.Match
extends java.lang.Object
DiscoverySelector into
a TestDescriptor.
A match is exact if the DiscoverySelector directly
represents the resulting TestDescriptor, e.g. if a
ClassSelector was resolved into the TestDescriptor that
represents the test class. It is partial if the matching
TestDescriptor does not directly correspond to the resolved
DiscoverySelector, e.g. when resolving a UniqueIdSelector
that represents a dynamic child of the resolved TestDescriptor.
In addition to the TestDescriptor, a match may contain a
Supplier of DiscoverySelectors that may
be used to discover the children of the TestDescriptor. The
algorithm implemented by EngineDiscoveryRequestResolver
expands all exact matches immediately, i.e. it
resolves all of their children. Partial matches will only be expanded in
case a subsequent resolution finds an exact match that contains a TestDescriptor with the same unique ID.
SelectorResolver,
Resolution#match(Match),
SelectorResolver.Resolution.matches(Set)| Modifier and Type | Class and Description |
|---|---|
private static class |
SelectorResolver.Match.Type |
| Modifier and Type | Field and Description |
|---|---|
private java.util.function.Supplier<java.util.Set<? extends DiscoverySelector>> |
childSelectorsSupplier |
private TestDescriptor |
testDescriptor |
private SelectorResolver.Match.Type |
type |
| Modifier | Constructor and Description |
|---|---|
private |
Match(TestDescriptor testDescriptor,
java.util.function.Supplier<java.util.Set<? extends DiscoverySelector>> childSelectorsSupplier,
SelectorResolver.Match.Type type) |
| Modifier and Type | Method and Description |
|---|---|
static SelectorResolver.Match |
exact(TestDescriptor testDescriptor)
Factory for creating an exact match without any children.
|
static SelectorResolver.Match |
exact(TestDescriptor testDescriptor,
java.util.function.Supplier<java.util.Set<? extends DiscoverySelector>> childSelectorsSupplier)
Factory for creating an exact match with potential children.
|
java.util.Set<? extends DiscoverySelector> |
expand()
Expand this match in order to resolve the children of the contained
TestDescriptor. |
TestDescriptor |
getTestDescriptor()
Get the contained
TestDescriptor. |
boolean |
isExact()
Whether this match is exact.
|
static SelectorResolver.Match |
partial(TestDescriptor testDescriptor)
Factory for creating a partial match without any children.
|
static SelectorResolver.Match |
partial(TestDescriptor testDescriptor,
java.util.function.Supplier<java.util.Set<? extends DiscoverySelector>> childSelectorsSupplier)
Factory for creating a partial match with potential children.
|
private final TestDescriptor testDescriptor
private final java.util.function.Supplier<java.util.Set<? extends DiscoverySelector>> childSelectorsSupplier
private final SelectorResolver.Match.Type type
private Match(TestDescriptor testDescriptor, java.util.function.Supplier<java.util.Set<? extends DiscoverySelector>> childSelectorsSupplier, SelectorResolver.Match.Type type)
public static SelectorResolver.Match exact(TestDescriptor testDescriptor)
testDescriptor - the resolved TestDescriptor; never
nullTestDescriptor;
never nullpublic static SelectorResolver.Match exact(TestDescriptor testDescriptor, java.util.function.Supplier<java.util.Set<? extends DiscoverySelector>> childSelectorsSupplier)
testDescriptor - the resolved TestDescriptor; never
nullchildSelectorsSupplier - a Supplier of children
selectors that will be resolved when this match is expanded; never
nullTestDescriptor;
never nullpublic static SelectorResolver.Match partial(TestDescriptor testDescriptor)
testDescriptor - the resolved TestDescriptor; never
nullTestDescriptor;
never nullpublic static SelectorResolver.Match partial(TestDescriptor testDescriptor, java.util.function.Supplier<java.util.Set<? extends DiscoverySelector>> childSelectorsSupplier)
testDescriptor - the resolved TestDescriptor; never
nullchildSelectorsSupplier - a Supplier of children
selectors that will be resolved when this match is expanded; never
nullTestDescriptor;
never nullpublic boolean isExact()
true if this match is exact; false if it's
partialpublic TestDescriptor getTestDescriptor()
TestDescriptor.TestDescriptor; never nullpublic java.util.Set<? extends DiscoverySelector> expand()
TestDescriptor.DiscoverySelectors that represent the
children of the contained TestDescriptor; never null