Overview
As can be seen below, org.junit.platform.engine.reporting.OutputDirectoryProvider causes cycles between the platform.engine and platform.engine.reporting packages in junit-platform-engine.
Cycle detected: Slice platform.engine ->
Slice platform.engine.reporting ->
Slice platform.engine
1. Dependencies of Slice platform.engine
- Constructor <org.junit.platform.engine.ExecutionRequest.<init>(org.junit.platform.engine.TestDescriptor, org.junit.platform.engine.EngineExecutionListener, org.junit.platform.engine.ConfigurationParameters, org.junit.platform.engine.reporting.OutputDirectoryProvider, org.junit.platform.engine.support.store.NamespacedHierarchicalStore, org.junit.platform.engine.CancellationToken)> has parameter of type <org.junit.platform.engine.reporting.OutputDirectoryProvider> in (ExecutionRequest.java:0)
- Field <org.junit.platform.engine.ExecutionRequest.outputDirectoryProvider> has type <org.junit.platform.engine.reporting.OutputDirectoryProvider> in (ExecutionRequest.java:0)
- Method <org.junit.platform.engine.EngineDiscoveryRequest.getOutputDirectoryProvider()> has return type <org.junit.platform.engine.reporting.OutputDirectoryProvider> in (EngineDiscoveryRequest.java:0)
- Method <org.junit.platform.engine.EngineExecutionListener.fileEntryPublished(org.junit.platform.engine.TestDescriptor, org.junit.platform.engine.reporting.FileEntry)> has parameter of type <org.junit.platform.engine.reporting.FileEntry> in (EngineExecutionListener.java:0)
- Method <org.junit.platform.engine.EngineExecutionListener.reportingEntryPublished(org.junit.platform.engine.TestDescriptor, org.junit.platform.engine.reporting.ReportEntry)> has parameter of type <org.junit.platform.engine.reporting.ReportEntry> in (EngineExecutionListener.java:0)
- Method <org.junit.platform.engine.ExecutionRequest.create(org.junit.platform.engine.TestDescriptor, org.junit.platform.engine.EngineExecutionListener, org.junit.platform.engine.ConfigurationParameters, org.junit.platform.engine.reporting.OutputDirectoryProvider, org.junit.platform.engine.support.store.NamespacedHierarchicalStore, org.junit.platform.engine.CancellationToken)> has parameter of type <org.junit.platform.engine.reporting.OutputDirectoryProvider> in (ExecutionRequest.java:0)
- Method <org.junit.platform.engine.ExecutionRequest.getOutputDirectoryProvider()> has return type <org.junit.platform.engine.reporting.OutputDirectoryProvider> in (ExecutionRequest.java:0)
2. Dependencies of Slice platform.engine.reporting
- Method <org.junit.platform.engine.reporting.OutputDirectoryProvider.createOutputDirectory(org.junit.platform.engine.TestDescriptor)> has parameter of type <org.junit.platform.engine.TestDescriptor> in (OutputDirectoryProvider.java:0)
Since the junit-platform-engine artifact is part of the public API for JUnit Platform, we have traditionally not allowed package cycles within that artifact.
Thus, in order to reduce package cycles and improve the quality of the code base, we should deprecate OutputDirectoryProvider and introduce a new OutputDirectoryCreator in the org.junit.platform.engine package. The new name is necessary because OutputDirectoryProvider has a getOutputDirectoryProvider() method.
Specifically, I am proposing the following.
- Introduce
org.junit.platform.engine.OutputDirectoryCreator as a copy of org.junit.platform.engine.reporting.OutputDirectoryProvider.
- Have
org.junit.platform.engine.reporting.OutputDirectoryProvider extend org.junit.platform.engine.OutputDirectoryCreator.
- Deprecate
org.junit.platform.engine.reporting.OutputDirectoryProvider for removal.
- Introduce new APIs that reference
org.junit.platform.engine.OutputDirectoryCreator instead of org.junit.platform.engine.reporting.OutputDirectoryProvider.
Related Issues
Overview
As can be seen below,
org.junit.platform.engine.reporting.OutputDirectoryProvidercauses cycles between theplatform.engineandplatform.engine.reportingpackages injunit-platform-engine.Since the
junit-platform-engineartifact is part of the public API for JUnit Platform, we have traditionally not allowed package cycles within that artifact.Thus, in order to reduce package cycles and improve the quality of the code base, we should deprecate
OutputDirectoryProviderand introduce a newOutputDirectoryCreatorin theorg.junit.platform.enginepackage. The new name is necessary becauseOutputDirectoryProviderhas agetOutputDirectoryProvider()method.Specifically, I am proposing the following.
org.junit.platform.engine.OutputDirectoryCreatoras a copy oforg.junit.platform.engine.reporting.OutputDirectoryProvider.org.junit.platform.engine.reporting.OutputDirectoryProviderextendorg.junit.platform.engine.OutputDirectoryCreator.org.junit.platform.engine.reporting.OutputDirectoryProviderfor removal.org.junit.platform.engine.OutputDirectoryCreatorinstead oforg.junit.platform.engine.reporting.OutputDirectoryProvider.Related Issues
Resourcetocommons.iopackage and deprecate existing interface #4885MediaTypetojupiter.apipackage and deprecate existing class #4886ParameterInfotoparamspackage and deprecate old interface #4920