Package org.junit.platform.launcher.core
Class EngineDiscoveryOrchestrator
java.lang.Object
org.junit.platform.launcher.core.EngineDiscoveryOrchestrator
@API(status=INTERNAL,
since="1.7",
consumers={"org.junit.platform.testkit","org.junit.platform.suite.engine"})
public class EngineDiscoveryOrchestrator
extends Object
Orchestrates test discovery using the configured test engines.
- Since:
- 1.7
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final EngineDiscoveryResultValidator
private final ListenerRegistry
<LauncherDiscoveryListener> private static final org.junit.platform.commons.logging.Logger
private final Collection
<PostDiscoveryFilter> private final Iterable
<TestEngine> -
Constructor Summary
ConstructorsConstructorDescriptionEngineDiscoveryOrchestrator
(Iterable<TestEngine> testEngines, Collection<PostDiscoveryFilter> postDiscoveryFilters) EngineDiscoveryOrchestrator
(Iterable<TestEngine> testEngines, Collection<PostDiscoveryFilter> postDiscoveryFilters, ListenerRegistry<LauncherDiscoveryListener> launcherDiscoveryListenerRegistry) -
Method Summary
Modifier and TypeMethodDescriptionprivate void
acceptInAllTestEngines
(Map<TestEngine, TestDescriptor> testEngineDescriptors, TestDescriptor.Visitor visitor) private void
applyPostDiscoveryFilters
(Map<TestEngine, TestDescriptor> testEngineDescriptors, List<PostDiscoveryFilter> filters) discover
(LauncherDiscoveryRequest request, EngineDiscoveryOrchestrator.Phase phase) Discovers tests for the supplied request in the supplied phase using the configured test engines.private Map
<TestEngine, TestDescriptor> discover
(LauncherDiscoveryRequest request, EngineDiscoveryOrchestrator.Phase phase, Function<String, UniqueId> uniqueIdCreator) discover
(LauncherDiscoveryRequest request, EngineDiscoveryOrchestrator.Phase phase, UniqueId parentId) Discovers tests for the supplied request in the supplied phase using the configured test engines to be used by the suite engine.private TestDescriptor
discoverEngineRoot
(TestEngine testEngine, LauncherDiscoveryRequest request, LauncherDiscoveryListener listener, Function<String, UniqueId> uniqueIdCreator) private Map
<TestEngine, TestDescriptor> discoverSafely
(LauncherDiscoveryRequest request, EngineDiscoveryOrchestrator.Phase phase, LauncherDiscoveryListener listener, Function<String, UniqueId> uniqueIdCreator) (package private) LauncherDiscoveryListener
getLauncherDiscoveryListener
(LauncherDiscoveryRequest discoveryRequest) private boolean
isExcluded
(TestDescriptor descriptor, FilterResult filterResult) private void
logTestDescriptorExclusionReasons
(Map<String, List<TestDescriptor>> excludedTestDescriptorsByReason) private void
populateExclusionReasonInMap
(Optional<String> reason, TestDescriptor testDescriptor, Map<String, List<TestDescriptor>> excludedTestDescriptorsByReason) private void
prune
(Map<TestEngine, TestDescriptor> testEngineDescriptors) Prune all branches in the tree ofTestDescriptors
that do not have executable tests.
-
Field Details
-
logger
private static final org.junit.platform.commons.logging.Logger logger -
discoveryResultValidator
-
testEngines
-
postDiscoveryFilters
-
launcherDiscoveryListenerRegistry
-
-
Constructor Details
-
EngineDiscoveryOrchestrator
public EngineDiscoveryOrchestrator(Iterable<TestEngine> testEngines, Collection<PostDiscoveryFilter> postDiscoveryFilters) -
EngineDiscoveryOrchestrator
EngineDiscoveryOrchestrator(Iterable<TestEngine> testEngines, Collection<PostDiscoveryFilter> postDiscoveryFilters, ListenerRegistry<LauncherDiscoveryListener> launcherDiscoveryListenerRegistry)
-
-
Method Details
-
discover
public LauncherDiscoveryResult discover(LauncherDiscoveryRequest request, EngineDiscoveryOrchestrator.Phase phase) Discovers tests for the supplied request in the supplied phase using the configured test engines.Applies engine filters and post-discovery filters and prunes the resulting test tree.
-
discover
public LauncherDiscoveryResult discover(LauncherDiscoveryRequest request, EngineDiscoveryOrchestrator.Phase phase, UniqueId parentId) Discovers tests for the supplied request in the supplied phase using the configured test engines to be used by the suite engine.Applies engine filters and post-discovery filters and prunes the resulting test tree. Note: The test descriptors in the discovery result can safely be used as non-root descriptors. Engine-test descriptor entries are pruned from the returned result. As such execution by
EngineExecutionOrchestrator.execute(LauncherDiscoveryResult, EngineExecutionListener)
will not emit start or emit events for engines without tests. -
discover
private Map<TestEngine,TestDescriptor> discover(LauncherDiscoveryRequest request, EngineDiscoveryOrchestrator.Phase phase, Function<String, UniqueId> uniqueIdCreator) -
discoverSafely
private Map<TestEngine,TestDescriptor> discoverSafely(LauncherDiscoveryRequest request, EngineDiscoveryOrchestrator.Phase phase, LauncherDiscoveryListener listener, Function<String, UniqueId> uniqueIdCreator) -
discoverEngineRoot
private TestDescriptor discoverEngineRoot(TestEngine testEngine, LauncherDiscoveryRequest request, LauncherDiscoveryListener listener, Function<String, UniqueId> uniqueIdCreator) -
getLauncherDiscoveryListener
-
applyPostDiscoveryFilters
private void applyPostDiscoveryFilters(Map<TestEngine, TestDescriptor> testEngineDescriptors, List<PostDiscoveryFilter> filters) -
populateExclusionReasonInMap
private void populateExclusionReasonInMap(Optional<String> reason, TestDescriptor testDescriptor, Map<String, List<TestDescriptor>> excludedTestDescriptorsByReason) -
logTestDescriptorExclusionReasons
private void logTestDescriptorExclusionReasons(Map<String, List<TestDescriptor>> excludedTestDescriptorsByReason) -
prune
Prune all branches in the tree ofTestDescriptors
that do not have executable tests.If a
TestEngine
ends up with noTestDescriptors
after pruning, it will not be removed. -
isExcluded
-
acceptInAllTestEngines
private void acceptInAllTestEngines(Map<TestEngine, TestDescriptor> testEngineDescriptors, TestDescriptor.Visitor visitor)
-