Interface SelectorResolver
-
@API(status=EXPERIMENTAL, since="1.5") public interface SelectorResolver
A resolver that supports resolving one or multiple types ofDiscoverySelectors
.An implementation of a
resolve()
method is typically comprised of the following steps:-
Check whether the selector is applicable for the current
TestEngine
and 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 multipleTestDescriptors
to the designated parent (seeContext
for details) and return a match or multiple matches. Alternatively, convert the supplied selector into one or multiple other selectors (e.g. aPackageSelector
into a set ofClassSelectors
). Otherwise, returnunresolved()
.
- Since:
- 1.5
-
Check whether the selector is applicable for the current
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
SelectorResolver.Context
The context for resolving aDiscoverySelector
and adding it to the test tree.static class
SelectorResolver.Match
An exact or partial match for resolving aDiscoverySelector
into aTestDescriptor
.static class
SelectorResolver.Resolution
The result of an attempt to resolve aDiscoverySelector
.
-
Method Summary
-
-
-
Method Detail
-
resolve
default SelectorResolver.Resolution resolve(ClasspathResourceSelector selector, SelectorResolver.Context context)
Resolve the suppliedClasspathResourceSelector
using the suppliedContext
.The default implementation simply delegates to
resolve(DiscoverySelector, Context)
.- Parameters:
selector
- the selector to be resolved; nevernull
context
- the context to be used for resolving the selector; nevernull
- Returns:
- a
Resolution
ofunresolved()
,selectors()
, ormatches()
; nevernull
- See Also:
resolve(DiscoverySelector, Context)
-
resolve
default SelectorResolver.Resolution resolve(ClasspathRootSelector selector, SelectorResolver.Context context)
Resolve the suppliedClasspathRootSelector
using the suppliedContext
.The default implementation simply delegates to
resolve(DiscoverySelector, Context)
.- Parameters:
selector
- the selector to be resolved; nevernull
context
- the context to be used for resolving the selector; nevernull
- Returns:
- a
Resolution
ofunresolved()
,selectors()
, ormatches()
; nevernull
- See Also:
resolve(DiscoverySelector, Context)
-
resolve
default SelectorResolver.Resolution resolve(ClassSelector selector, SelectorResolver.Context context)
Resolve the suppliedClassSelector
using the suppliedContext
.The default implementation simply delegates to
resolve(DiscoverySelector, Context)
.- Parameters:
selector
- the selector to be resolved; nevernull
context
- the context to be used for resolving the selector; nevernull
- Returns:
- a
Resolution
ofunresolved()
,selectors()
, ormatches()
; nevernull
- See Also:
resolve(DiscoverySelector, Context)
-
resolve
default SelectorResolver.Resolution resolve(DirectorySelector selector, SelectorResolver.Context context)
Resolve the suppliedDirectorySelector
using the suppliedContext
.The default implementation simply delegates to
resolve(DiscoverySelector, Context)
.- Parameters:
selector
- the selector to be resolved; nevernull
context
- the context to be used for resolving the selector; nevernull
- Returns:
- a
Resolution
ofunresolved()
,selectors()
, ormatches()
; nevernull
- See Also:
resolve(DiscoverySelector, Context)
-
resolve
default SelectorResolver.Resolution resolve(FileSelector selector, SelectorResolver.Context context)
Resolve the suppliedFileSelector
using the suppliedContext
.The default implementation simply delegates to
resolve(DiscoverySelector, Context)
.- Parameters:
selector
- the selector to be resolved; nevernull
context
- the context to be used for resolving the selector; nevernull
- Returns:
- a
Resolution
ofunresolved()
,selectors()
, ormatches()
; nevernull
- See Also:
resolve(DiscoverySelector, Context)
-
resolve
default SelectorResolver.Resolution resolve(MethodSelector selector, SelectorResolver.Context context)
Resolve the suppliedMethodSelector
using the suppliedContext
.The default implementation simply delegates to
resolve(DiscoverySelector, Context)
.- Parameters:
selector
- the selector to be resolved; nevernull
context
- the context to be used for resolving the selector; nevernull
- Returns:
- a
Resolution
ofunresolved()
,selectors()
, ormatches()
; nevernull
- See Also:
resolve(DiscoverySelector, Context)
-
resolve
default SelectorResolver.Resolution resolve(ModuleSelector selector, SelectorResolver.Context context)
Resolve the suppliedModuleSelector
using the suppliedContext
.The default implementation simply delegates to
resolve(DiscoverySelector, Context)
.- Parameters:
selector
- the selector to be resolved; nevernull
context
- the context to be used for resolving the selector; nevernull
- Returns:
- a
Resolution
ofunresolved()
,selectors()
, ormatches()
; nevernull
- See Also:
resolve(DiscoverySelector, Context)
-
resolve
default SelectorResolver.Resolution resolve(PackageSelector selector, SelectorResolver.Context context)
Resolve the suppliedPackageSelector
using the suppliedContext
.The default implementation simply delegates to
resolve(DiscoverySelector, Context)
.- Parameters:
selector
- the selector to be resolved; nevernull
context
- the context to be used for resolving the selector; nevernull
- Returns:
- a
Resolution
ofunresolved()
,selectors()
, ormatches()
; nevernull
- See Also:
resolve(DiscoverySelector, Context)
-
resolve
default SelectorResolver.Resolution resolve(UniqueIdSelector selector, SelectorResolver.Context context)
Resolve the suppliedUniqueIdSelector
using the suppliedContext
.The default implementation simply delegates to
resolve(DiscoverySelector, Context)
.- Parameters:
selector
- the selector to be resolved; nevernull
context
- the context to be used for resolving the selector; nevernull
- Returns:
- a
Resolution
ofunresolved()
,selectors()
, ormatches()
; nevernull
- See Also:
resolve(DiscoverySelector, Context)
-
resolve
default SelectorResolver.Resolution resolve(UriSelector selector, SelectorResolver.Context context)
Resolve the suppliedUriSelector
using the suppliedContext
.The default implementation simply delegates to
resolve(DiscoverySelector, Context)
.- Parameters:
selector
- the selector to be resolved; nevernull
context
- the context to be used for resolving the selector; nevernull
- Returns:
- a
Resolution
ofunresolved()
,selectors()
, ormatches()
; nevernull
- See Also:
resolve(DiscoverySelector, Context)
-
resolve
default SelectorResolver.Resolution resolve(DiscoverySelector selector, SelectorResolver.Context context)
Resolve the suppliedDiscoverySelector
using 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; nevernull
context
- the context to be used for resolving the selector; nevernull
- Returns:
- a
Resolution
ofunresolved()
,selectors()
, ormatches()
; nevernull
- See Also:
SelectorResolver.Context
-
-