Interface SelectorResolver
DiscoverySelectors.
An implementation of a resolve() method is typically comprised
of the following steps:
-
Check whether the selector is applicable for the current
TestEngineand the currentEngineDiscoveryRequest(e.g. for a test class: is it relevant for the current engine and does it pass all filters in the request?). -
If so, use the supplied
Context, to add one or multipleTestDescriptorsto the designated parent (seeContextfor details) and return a match or multiple matches. Alternatively, convert the supplied selector into one or multiple other selectors (e.g. aPackageSelectorinto a set ofClassSelectors). Otherwise, returnunresolved().
- Since:
- 1.5
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceThe context for resolving aDiscoverySelectorand adding it to the test tree.static classAn exact or partial match for resolving aDiscoverySelectorinto aTestDescriptor.static classThe result of an attempt to resolve aDiscoverySelector. -
Method Summary
Modifier and TypeMethodDescriptiondefault SelectorResolver.Resolutionresolve(ClasspathResourceSelector selector, SelectorResolver.Context context) Resolve the suppliedClasspathResourceSelectorusing the suppliedContext.default SelectorResolver.Resolutionresolve(ClasspathRootSelector selector, SelectorResolver.Context context) Resolve the suppliedClasspathRootSelectorusing the suppliedContext.default SelectorResolver.Resolutionresolve(ClassSelector selector, SelectorResolver.Context context) Resolve the suppliedClassSelectorusing the suppliedContext.default SelectorResolver.Resolutionresolve(DirectorySelector selector, SelectorResolver.Context context) Resolve the suppliedDirectorySelectorusing the suppliedContext.default SelectorResolver.Resolutionresolve(FileSelector selector, SelectorResolver.Context context) Resolve the suppliedFileSelectorusing the suppliedContext.default SelectorResolver.Resolutionresolve(IterationSelector selector, SelectorResolver.Context context) Resolve the suppliedIterationSelectorusing the suppliedContext.default SelectorResolver.Resolutionresolve(MethodSelector selector, SelectorResolver.Context context) Resolve the suppliedMethodSelectorusing the suppliedContext.default SelectorResolver.Resolutionresolve(ModuleSelector selector, SelectorResolver.Context context) Resolve the suppliedModuleSelectorusing the suppliedContext.default SelectorResolver.Resolutionresolve(NestedClassSelector selector, SelectorResolver.Context context) Resolve the suppliedNestedClassSelectorusing the suppliedContext.default SelectorResolver.Resolutionresolve(NestedMethodSelector selector, SelectorResolver.Context context) Resolve the suppliedNestedMethodSelectorusing the suppliedContext.default SelectorResolver.Resolutionresolve(PackageSelector selector, SelectorResolver.Context context) Resolve the suppliedPackageSelectorusing the suppliedContext.default SelectorResolver.Resolutionresolve(UniqueIdSelector selector, SelectorResolver.Context context) Resolve the suppliedUniqueIdSelectorusing the suppliedContext.default SelectorResolver.Resolutionresolve(UriSelector selector, SelectorResolver.Context context) Resolve the suppliedUriSelectorusing the suppliedContext.default SelectorResolver.Resolutionresolve(DiscoverySelector selector, SelectorResolver.Context context) Resolve the suppliedDiscoverySelectorusing the suppliedContext.
-
Method Details
-
resolve
default SelectorResolver.Resolution resolve(ClasspathResourceSelector selector, SelectorResolver.Context context) Resolve the suppliedClasspathResourceSelectorusing the suppliedContext.The default implementation delegates to
resolve(DiscoverySelector, Context).- Parameters:
selector- the selector to be resolved; nevernullcontext- the context to be used for resolving the selector; nevernull- Returns:
- a
Resolutionofunresolved(),selectors(), ormatches(); nevernull - See Also:
-
resolve
default SelectorResolver.Resolution resolve(ClasspathRootSelector selector, SelectorResolver.Context context) Resolve the suppliedClasspathRootSelectorusing the suppliedContext.The default implementation delegates to
resolve(DiscoverySelector, Context).- Parameters:
selector- the selector to be resolved; nevernullcontext- the context to be used for resolving the selector; nevernull- Returns:
- a
Resolutionofunresolved(),selectors(), ormatches(); nevernull - See Also:
-
resolve
default SelectorResolver.Resolution resolve(ClassSelector selector, SelectorResolver.Context context) Resolve the suppliedClassSelectorusing the suppliedContext.The default implementation delegates to
resolve(DiscoverySelector, Context).- Parameters:
selector- the selector to be resolved; nevernullcontext- the context to be used for resolving the selector; nevernull- Returns:
- a
Resolutionofunresolved(),selectors(), ormatches(); nevernull - See Also:
-
resolve
default SelectorResolver.Resolution resolve(NestedClassSelector selector, SelectorResolver.Context context) Resolve the suppliedNestedClassSelectorusing the suppliedContext.The default implementation delegates to
resolve(DiscoverySelector, Context).- Parameters:
selector- the selector to be resolved; nevernullcontext- the context to be used for resolving the selector; nevernull- Returns:
- a
Resolutionofunresolved(),selectors(), ormatches(); nevernull - See Also:
-
resolve
default SelectorResolver.Resolution resolve(DirectorySelector selector, SelectorResolver.Context context) Resolve the suppliedDirectorySelectorusing the suppliedContext.The default implementation delegates to
resolve(DiscoverySelector, Context).- Parameters:
selector- the selector to be resolved; nevernullcontext- the context to be used for resolving the selector; nevernull- Returns:
- a
Resolutionofunresolved(),selectors(), ormatches(); nevernull - See Also:
-
resolve
default SelectorResolver.Resolution resolve(FileSelector selector, SelectorResolver.Context context) Resolve the suppliedFileSelectorusing the suppliedContext.The default implementation delegates to
resolve(DiscoverySelector, Context).- Parameters:
selector- the selector to be resolved; nevernullcontext- the context to be used for resolving the selector; nevernull- Returns:
- a
Resolutionofunresolved(),selectors(), ormatches(); nevernull - See Also:
-
resolve
default SelectorResolver.Resolution resolve(MethodSelector selector, SelectorResolver.Context context) Resolve the suppliedMethodSelectorusing the suppliedContext.The default implementation delegates to
resolve(DiscoverySelector, Context).- Parameters:
selector- the selector to be resolved; nevernullcontext- the context to be used for resolving the selector; nevernull- Returns:
- a
Resolutionofunresolved(),selectors(), ormatches(); nevernull - See Also:
-
resolve
default SelectorResolver.Resolution resolve(NestedMethodSelector selector, SelectorResolver.Context context) Resolve the suppliedNestedMethodSelectorusing the suppliedContext.The default implementation delegates to
resolve(DiscoverySelector, Context).- Parameters:
selector- the selector to be resolved; nevernullcontext- the context to be used for resolving the selector; nevernull- Returns:
- a
Resolutionofunresolved(),selectors(), ormatches(); nevernull - See Also:
-
resolve
default SelectorResolver.Resolution resolve(ModuleSelector selector, SelectorResolver.Context context) Resolve the suppliedModuleSelectorusing the suppliedContext.The default implementation delegates to
resolve(DiscoverySelector, Context).- Parameters:
selector- the selector to be resolved; nevernullcontext- the context to be used for resolving the selector; nevernull- Returns:
- a
Resolutionofunresolved(),selectors(), ormatches(); nevernull - See Also:
-
resolve
default SelectorResolver.Resolution resolve(PackageSelector selector, SelectorResolver.Context context) Resolve the suppliedPackageSelectorusing the suppliedContext.The default implementation delegates to
resolve(DiscoverySelector, Context).- Parameters:
selector- the selector to be resolved; nevernullcontext- the context to be used for resolving the selector; nevernull- Returns:
- a
Resolutionofunresolved(),selectors(), ormatches(); nevernull - See Also:
-
resolve
default SelectorResolver.Resolution resolve(UniqueIdSelector selector, SelectorResolver.Context context) Resolve the suppliedUniqueIdSelectorusing the suppliedContext.The default implementation delegates to
resolve(DiscoverySelector, Context).- Parameters:
selector- the selector to be resolved; nevernullcontext- the context to be used for resolving the selector; nevernull- Returns:
- a
Resolutionofunresolved(),selectors(), ormatches(); nevernull - See Also:
-
resolve
Resolve the suppliedUriSelectorusing the suppliedContext.The default implementation delegates to
resolve(DiscoverySelector, Context).- Parameters:
selector- the selector to be resolved; nevernullcontext- the context to be used for resolving the selector; nevernull- Returns:
- a
Resolutionofunresolved(),selectors(), ormatches(); nevernull - See Also:
-
resolve
@API(status=EXPERIMENTAL, since="1.9") default SelectorResolver.Resolution resolve(IterationSelector selector, SelectorResolver.Context context) Resolve the suppliedIterationSelectorusing the suppliedContext.The default implementation delegates to
resolve(DiscoverySelector, Context).- Parameters:
selector- the selector to be resolved; nevernullcontext- the context to be used for resolving the selector; nevernull- Returns:
- a
Resolutionofunresolved(),selectors(), ormatches(); nevernull - See Also:
-
resolve
default SelectorResolver.Resolution resolve(DiscoverySelector selector, SelectorResolver.Context context) Resolve the suppliedDiscoverySelectorusing the suppliedContext.This method is only called if none of the overloaded variants match.
The default implementation returns
unresolved().- Parameters:
selector- the selector to be resolved; nevernullcontext- the context to be used for resolving the selector; nevernull- Returns:
- a
Resolutionofunresolved(),selectors(), ormatches(); nevernull - See Also:
-