Skip to content

Relocate OutputDirectoryProvider to org.junit.platform.engine package and deprecate existing interface #4923

@marcphilipp

Description

@marcphilipp

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.

  1. Introduce org.junit.platform.engine.OutputDirectoryCreator as a copy of org.junit.platform.engine.reporting.OutputDirectoryProvider.
  2. Have org.junit.platform.engine.reporting.OutputDirectoryProvider extend org.junit.platform.engine.OutputDirectoryCreator.
  3. Deprecate org.junit.platform.engine.reporting.OutputDirectoryProvider for removal.
  4. Introduce new APIs that reference org.junit.platform.engine.OutputDirectoryCreator instead of org.junit.platform.engine.reporting.OutputDirectoryProvider.

Related Issues

Metadata

Metadata

Assignees

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions