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 onSelectorResolverandTestDescriptor.Visitorthat 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 classEngineDiscoveryRequestResolver.Builder<T extends TestDescriptor>Builder forEngineDiscoveryRequestResolver.static interfaceEngineDiscoveryRequestResolver.InitializationContext<T extends TestDescriptor>The initialization context for creating resolvers and visitors that depend on theEngineDiscoveryRequestto 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.Builderfor creating aEngineDiscoveryRequestResolver.voidresolve(EngineDiscoveryRequest request, T engineDescriptor)Resolve the suppliedEngineDiscoveryRequestand collect the results into the suppliedTestDescriptor.
-
-
-
Method Detail
-
resolve
public void resolve(EngineDiscoveryRequest request, T engineDescriptor)
Resolve the suppliedEngineDiscoveryRequestand 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; nevernullengineDescriptor- the engine'sTestDescriptorto be used for adding direct children- See Also:
SelectorResolver,TestDescriptor.Visitor
-
builder
public static <T extends TestDescriptor> EngineDiscoveryRequestResolver.Builder<T> builder()
Create a newEngineDiscoveryRequestResolver.Builderfor creating aEngineDiscoveryRequestResolver.- Type Parameters:
T- the type of the engine's descriptor- Returns:
- a new builder; never
null
-
-