Module org.junit.platform.engine
Class EngineDiscoveryRequestResolver<T extends TestDescriptor>
java.lang.Object
org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolver<T>
- Type Parameters:
T
- the type of the engine's descriptor
@API(status=STABLE,
since="1.10")
public class EngineDiscoveryRequestResolver<T extends TestDescriptor>
extends Object
Configurable test discovery implementation based on
SelectorResolver
and TestDescriptor.Visitor
that can be reused by different
TestEngines
.
This resolver takes care of notifying registered
EngineDiscoveryListeners
about the results of processed
DiscoverySelectors
.
- Since:
- 1.5
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Builder forEngineDiscoveryRequestResolver
.static interface
The initialization context for creating resolvers and visitors that depend on theEngineDiscoveryRequest
to be resolved or the engine descriptor that will be used to collect the results. -
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends TestDescriptor>
EngineDiscoveryRequestResolver.Builder<T> builder()
Create a newEngineDiscoveryRequestResolver.Builder
for creating aEngineDiscoveryRequestResolver
.void
resolve
(EngineDiscoveryRequest request, T engineDescriptor) Resolve the suppliedEngineDiscoveryRequest
and collect the results into the suppliedTestDescriptor
.
-
Method Details
-
resolve
Resolve the suppliedEngineDiscoveryRequest
and collect the results into the suppliedTestDescriptor
.The algorithm works as follows:
- Enqueue all selectors in the supplied request to be resolved.
-
While there are selectors to be resolved, get the next one.
Otherwise, the resolution is finished.
-
Iterate over all registered resolvers in the order they were registered in and find the
first one that returns a resolution
other than
unresolved()
. - If such a resolution exists, enqueue its selectors.
- For each exact match in the resolution, expand its children and enqueue them as well.
-
Iterate over all registered resolvers in the order they were registered in and find the
first one that returns a resolution
other than
- Iterate over all registered visitors and let the engine test descriptor accept them.
- Parameters:
request
- the request to be resolved; nevernull
engineDescriptor
- the engine'sTestDescriptor
to be used for adding direct children- See Also:
-
builder
Create a newEngineDiscoveryRequestResolver.Builder
for creating aEngineDiscoveryRequestResolver
.- Type Parameters:
T
- the type of the engine's descriptor- Returns:
- a new builder; never
null
-