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 EngineDiscoveryResultValidatorprivate final ListenerRegistry<LauncherDiscoveryListener>private static final Loggerprivate 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 voidacceptInAllTestEngines(Map<TestEngine, TestDescriptor> testEngineDescriptors, TestDescriptor.Visitor visitor) private voidapplyPostDiscoveryFilters(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 TestDescriptordiscoverEngineRoot(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) LauncherDiscoveryListenergetLauncherDiscoveryListener(LauncherDiscoveryRequest discoveryRequest) private booleanisExcluded(TestDescriptor descriptor, FilterResult filterResult) private voidlogTestDescriptorExclusionReasons(Map<String, List<TestDescriptor>> excludedTestDescriptorsByReason) private voidpopulateExclusionReasonInMap(Optional<String> reason, TestDescriptor testDescriptor, Map<String, List<TestDescriptor>> excludedTestDescriptorsByReason) private voidprune(Map<TestEngine, TestDescriptor> testEngineDescriptors) Prune all branches in the tree ofTestDescriptorsthat do not have executable tests.private Map<TestEngine,TestDescriptor> pruneEngines(Map<TestEngine, TestDescriptor> result)
-
Field Details
-
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) -
pruneEngines
-
prune
Prune all branches in the tree ofTestDescriptorsthat do not have executable tests.If a
TestEngineends up with noTestDescriptorsafter pruning, it will not be removed. -
isExcluded
-
acceptInAllTestEngines
private void acceptInAllTestEngines(Map<TestEngine, TestDescriptor> testEngineDescriptors, TestDescriptor.Visitor visitor)
-