ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject DO NOT REPLY [Bug 44530] junit task with forkmode=once and xml formatter does not save all system.out
Date Thu, 17 Nov 2011 00:54:58 GMT

--- Comment #4 from Eric Anderson <> 2011-11-17 00:54:58 UTC ---
I just implemented a workaround for this bug in my own codebase by using a
formatter created for the task (a la My workaround
is for users of java.util.logging.

The code for the formatter is available at (I'll add it as an attachment as

Use it by adding an additional formatter tag to your build.xml:

  <formatter classname="JUnitLogFixFormatter" usefile="false"/>

At the beginning of each test, the code looks at the root Logger and replaces
any ConsoleHandlers it finds with a new ConsoleHandler (and copies over the
configuration). ConsoleHandler caches System.err during its constructor, so
constructing a new instance is required. After the test completes, the original
handlers are replaced back into the root Logger.

For my codebase this seems to work, but YMMV.

Configure bugmail:
------- You are receiving this mail because: -------
You are the assignee for the bug.

View raw message