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
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final EngineDiscoveryResultValidatorprivate final ListenerRegistry<LauncherDiscoveryListener> private static final org.junit.platform.commons.logging.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, LauncherDiscoveryResult.EngineResultInfo> testEngineResults, TestDescriptor.Visitor visitor) private voidapplyPostDiscoveryFilters(Map<TestEngine, LauncherDiscoveryResult.EngineResultInfo> testEngineDescriptors, List<PostDiscoveryFilter> filters) discover(LauncherDiscoveryRequest request) Discovers tests for the supplied request using the configured test engines.private LauncherDiscoveryResultdiscover(LauncherDiscoveryRequest request, Optional<LauncherPhase> phase, Function<String, UniqueId> uniqueIdCreator) discover(LauncherDiscoveryRequest request, UniqueId parentId) Discovers tests for the supplied request in the supplied phase using the configured test engines to be used by the suite engine.(package private) LauncherDiscoveryResultdiscover(LauncherDiscoveryRequest request, LauncherPhase phase) discoverEngineRoot(TestEngine testEngine, LauncherDiscoveryRequest request, DiscoveryIssueCollector issueCollector, Function<String, UniqueId> uniqueIdCreator) discoverSafely(LauncherDiscoveryRequest request, Optional<LauncherPhase> phase, DiscoveryIssueCollector issueCollector, Function<String, UniqueId> uniqueIdCreator) (package private) LauncherDiscoveryListenergetLauncherDiscoveryListener(LauncherDiscoveryRequest discoveryRequest, DiscoveryIssueCollector issueCollector) 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, LauncherDiscoveryResult.EngineResultInfo> testEngineResults) Prune all branches in the tree ofTestDescriptorsthat do not have executable tests.private static voidreportDiscoveryIssues(LauncherDiscoveryResult discoveryResult) private static booleanshouldReportDiscoveryIssues(LauncherDiscoveryRequest request, Optional<LauncherPhase> phase)
-
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
Discovers tests for the supplied request using the configured test engines.Applies engine filters and post-discovery filters and prunes the resulting test tree.
-
discover
-
discover
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
EngineExecutionOrchestratorwill not emit start or emit events for engines without tests. -
discover
private LauncherDiscoveryResult discover(LauncherDiscoveryRequest request, Optional<LauncherPhase> phase, Function<String, UniqueId> uniqueIdCreator) -
shouldReportDiscoveryIssues
private static boolean shouldReportDiscoveryIssues(LauncherDiscoveryRequest request, Optional<LauncherPhase> phase) -
reportDiscoveryIssues
-
discoverSafely
private Map<TestEngine, LauncherDiscoveryResult.EngineResultInfo> discoverSafely(LauncherDiscoveryRequest request, Optional<LauncherPhase> phase, DiscoveryIssueCollector issueCollector, Function<String, UniqueId> uniqueIdCreator) -
discoverEngineRoot
private LauncherDiscoveryResult.EngineResultInfo discoverEngineRoot(TestEngine testEngine, LauncherDiscoveryRequest request, DiscoveryIssueCollector issueCollector, Function<String, UniqueId> uniqueIdCreator) -
getLauncherDiscoveryListener
LauncherDiscoveryListener getLauncherDiscoveryListener(LauncherDiscoveryRequest discoveryRequest, DiscoveryIssueCollector issueCollector) -
applyPostDiscoveryFilters
private void applyPostDiscoveryFilters(Map<TestEngine, LauncherDiscoveryResult.EngineResultInfo> 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 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, LauncherDiscoveryResult.EngineResultInfo> testEngineResults, TestDescriptor.Visitor visitor)
-