[ 
https://issues.apache.org/jira/browse/SUREFIRE-2011?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Tibor Digana updated SUREFIRE-2011:
-----------------------------------
    Description: 
After the previous refactoring of surefire-junit3, we should continue with 
updating the abstraction in order to complete SUREFIRE-1860. The changes in 
SUREFIRE-1860 are big and therefore I would like to split them to an 
abstraction in this PR, continue with another PRs regarding implementation of 
encoder/decoder, {{SimpleReportEntry}}. It would give us the opportunity to 
associate the std/out/err logs with test run id (Thread) and deterministically 
create the reports and this way fix pending issues (junit5, and simplify the 
listeners in junit4.7 provider). So I am splitting the work in several pieces.

The method {{writeTestOutput( String output, boolean newLine, boolean stdout 
)}} appeared in {{ForkingRunListener}} and {{TestSetRunListener}} and it is 
called by {{ConsoleOutputCapture}}. The signature of this method will be 
changed.

The provider listeners can be stateful but the {{ForkingRunListener}} must be 
stateless.

The meta information (testRunId and Thread) will be associated with the 
particular run of the test method in the implementation of provider's 
{{RunListener}}. So the listener should have this meta information and the 
{{ForkingRunListener}} should not have it. We will implement enum {{RunMode}}, 
{{testRunId:long}}, {{TestOutputReportEntry}} and we will introduce a new 
interface {{TestReportListener}}. Method signatures will be changed to 
{{TestOutputReceiver#writeTestOutput(TestOutputReportEntry)}} and 
{{EventChannelEncoder#testOutput(TestOutputReportEntry)}}. We will remove 
{{ConsoleStream}} interface and {{ConsoleLogger}} will be used instead. Any 
combinations of two interfaces out of three {{(RunListener, TestOutputReceiver, 
ConsoleLogger)}} are avoided and the only {{TestReportListener}} will be used. 
Simplified code around logger in {{JUnitCoreProvider}}. We will rename a 
creator method {{createReporter()}} in {{ReporterFactory}}.



> Updated abstractions which helps associating standard out/err with a test
> -------------------------------------------------------------------------
>
>                 Key: SUREFIRE-2011
>                 URL: https://issues.apache.org/jira/browse/SUREFIRE-2011
>             Project: Maven Surefire
>          Issue Type: Improvement
>          Components: JUnit 3.x support, Junit 4.7+ (parallel) support, Junit 
> 4.x support, JUnit 5.x support, Maven Failsafe Plugin, Maven Surefire Plugin, 
> process forking, TestNG support
>            Reporter: Tibor Digana
>            Assignee: Tibor Digana
>            Priority: Major
>             Fix For: 3.0.0-M6
>
>
> After the previous refactoring of surefire-junit3, we should continue with 
> updating the abstraction in order to complete SUREFIRE-1860. The changes in 
> SUREFIRE-1860 are big and therefore I would like to split them to an 
> abstraction in this PR, continue with another PRs regarding implementation of 
> encoder/decoder, {{SimpleReportEntry}}. It would give us the opportunity to 
> associate the std/out/err logs with test run id (Thread) and 
> deterministically create the reports and this way fix pending issues (junit5, 
> and simplify the listeners in junit4.7 provider). So I am splitting the work 
> in several pieces.
> The method {{writeTestOutput( String output, boolean newLine, boolean stdout 
> )}} appeared in {{ForkingRunListener}} and {{TestSetRunListener}} and it is 
> called by {{ConsoleOutputCapture}}. The signature of this method will be 
> changed.
> The provider listeners can be stateful but the {{ForkingRunListener}} must be 
> stateless.
> The meta information (testRunId and Thread) will be associated with the 
> particular run of the test method in the implementation of provider's 
> {{RunListener}}. So the listener should have this meta information and the 
> {{ForkingRunListener}} should not have it. We will implement enum 
> {{RunMode}}, {{testRunId:long}}, {{TestOutputReportEntry}} and we will 
> introduce a new interface {{TestReportListener}}. Method signatures will be 
> changed to {{TestOutputReceiver#writeTestOutput(TestOutputReportEntry)}} and 
> {{EventChannelEncoder#testOutput(TestOutputReportEntry)}}. We will remove 
> {{ConsoleStream}} interface and {{ConsoleLogger}} will be used instead. Any 
> combinations of two interfaces out of three {{(RunListener, 
> TestOutputReceiver, ConsoleLogger)}} are avoided and the only 
> {{TestReportListener}} will be used. Simplified code around logger in 
> {{JUnitCoreProvider}}. We will rename a creator method {{createReporter()}} 
> in {{ReporterFactory}}.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to