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

Listener System.out.printf is written as multiple lines

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 3.0.0-M4, 3.0.0-M5
    • Fix Version/s: 3.0.0-M6
    • Component/s: Maven Surefire Plugin
    • Labels:
      None

      Description

      Our project has a listener that writes progress information using ANSI escape codes. Perhaps in order to avoid the output being captured by Surefire, it saves System.out to a field in its constructor, and uses the saved System.out reference to output progress information.

      Since 3.0.0-M4, surefire has started replacing System.out earlier, so now it also captures the output of the listener. This wouldn't be a problem, except the listener's printf() calls are now written across multiple lines. E.g.

      System.out.printf("a%2sb", "1");
      

      prints this during a test:

      a 1b
      

      and this in the listener constructor:

      a
       
      1
      b
      
      

      I believe this is related to the POM using <parallel>classes</parallel> and <forkCount>1</forkCount>.

      Here is a small project reproducing the issue:
      https://github.com/danberindei/surefire-out-print-test

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              dan.berindei Dan Berindei
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: