Class SelectorResolver.Match
- Enclosing interface:
SelectorResolver
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.
- Since:
- 1.5
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic SelectorResolver.Matchexact(TestDescriptor testDescriptor) Factory for creating an exact match without any children.static SelectorResolver.Matchexact(TestDescriptor testDescriptor, Supplier<Set<? extends DiscoverySelector>> childSelectorsSupplier) Factory for creating an exact match with potential children.Set<? extends DiscoverySelector> expand()Expand this match in order to resolve the children of the containedTestDescriptor.Get the containedTestDescriptor.booleanisExact()Whether this match is exact.static SelectorResolver.Matchpartial(TestDescriptor testDescriptor) Factory for creating a partial match without any children.static SelectorResolver.Matchpartial(TestDescriptor testDescriptor, Supplier<Set<? extends DiscoverySelector>> childSelectorsSupplier) Factory for creating a partial match with potential children.
-
Method Details
-
exact
Factory for creating an exact match without any children.- Parameters:
testDescriptor- the resolvedTestDescriptor; nevernull- Returns:
- a match that contains the supplied
TestDescriptor; nevernull
-
exact
public static SelectorResolver.Match exact(TestDescriptor testDescriptor, Supplier<Set<? extends DiscoverySelector>> childSelectorsSupplier) Factory for creating an exact match with potential children.- Parameters:
testDescriptor- the resolvedTestDescriptor; nevernullchildSelectorsSupplier- aSupplierof children selectors that will be resolved when this match is expanded; nevernull- Returns:
- a match that contains the supplied
TestDescriptor; nevernull
-
partial
Factory for creating a partial match without any children.- Parameters:
testDescriptor- the resolvedTestDescriptor; nevernull- Returns:
- a match that contains the supplied
TestDescriptor; nevernull
-
partial
public static SelectorResolver.Match partial(TestDescriptor testDescriptor, Supplier<Set<? extends DiscoverySelector>> childSelectorsSupplier) Factory for creating a partial match with potential children.- Parameters:
testDescriptor- the resolvedTestDescriptor; nevernullchildSelectorsSupplier- aSupplierof children selectors that will be resolved when this match is expanded; nevernull- Returns:
- a match that contains the supplied
TestDescriptor; nevernull
-
isExact
public boolean isExact()Whether this match is exact.- Returns:
trueif this match is exact;falseif it's partial
-
getTestDescriptor
Get the containedTestDescriptor.- Returns:
- the contained
TestDescriptor; nevernull
-
expand
Expand this match in order to resolve the children of the containedTestDescriptor.- Returns:
- the set of
DiscoverySelectorsthat represent the children of the containedTestDescriptor; nevernull
-