Uploaded image for project: 'Maven Surefire'
  1. Maven Surefire
  2. SUREFIRE-2011

Updated abstractions which helps associating standard out/err with a test

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    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 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. This way we will fix pending issues (a problem with parallel logs in junit5 tests, and simplify the listeners in surefire-junit47 provider) in the future. So I am going to split the work in several Jiras.

      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.

      Attachments

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            tibordigana Tibor Digana
            tibordigana Tibor Digana
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment