Jason Chaffee wrote:

I am pretty familiar with testng code, so I would like to look into this further. Is it a correct statement to say that the output we are seeing on the console is coming directly from testng?

No...  Console output in Surefire is a bit strange. :-)

By default, Surefire forks a single Java process to run all tests and begins gathering console output from that process.

If you configure Surefire's output using redirectTestOutputToFile, we'll print it all out to a file, UNLESS the line begins with a special marker indicating that the console output is intended for Surefire, in which case we'll display it in the clear on the console.

Hence, TestNG can print out "foo" and that will go to the file, but Surefire itself can print out "Tests run: 1, Failures: 0, Errors: 0 [...]".

If you don't redirectTestOutputToFile, console messages from the forked process appear directly on the console, but we also take extra steps to strip out the special markers.

Currently, Surefire only knows to log when TestNG calls us back. We register as an org.testng.IResultListener, so we get notifications when the run starts and finishes, and when an individual method starts and finishes, but not when the entire class starts and finishes. If TestNG notified us at the right time, we could log the right stuff.

But I think this won't be an easy fix on the TestNG side, because TestNG runs stuff in a crazy order, by design.

-Dan

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to