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=EXPERIMENTAL, since="1.5") public class EngineDiscoveryRequestResolver<T extends TestDescriptor> extends Object
Configurable test discovery implementation based onSelectorResolver
andTestDescriptor.Visitor
that can be reused by differentTestEngines
.- Since:
- 1.5
- See Also:
builder()
,resolve(EngineDiscoveryRequest, TestDescriptor)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
EngineDiscoveryRequestResolver.Builder<T extends TestDescriptor>
Builder forEngineDiscoveryRequestResolver
.static interface
EngineDiscoveryRequestResolver.InitializationContext<T extends TestDescriptor>
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
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <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 Detail
-
resolve
public void resolve(EngineDiscoveryRequest request, T engineDescriptor)
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:
SelectorResolver
,TestDescriptor.Visitor
-
builder
public static <T extends TestDescriptor> EngineDiscoveryRequestResolver.Builder<T> builder()
Create a newEngineDiscoveryRequestResolver.Builder
for creating aEngineDiscoveryRequestResolver
.- Type Parameters:
T
- the type of the engine's descriptor- Returns:
- a new builder; never
null
-
-