cbeust/testng — pull request #135 by lukasj (2011-11-24 14:38:40+00:00)
Title: Provide better info while logging test invocations/runs from TestNG/TestNGAntTask

Motivation:

* mainly - see what TestNG Ant task is doing (which test is being executed) when Ant is run in verbose mode using 'ant -v'
* see execution status of configuration methods

Current state:
TestNG logging itself is currently based on the value of 'verbose' parameter passed to the runner. The parameter can be set to integer from 0 (no logging at all) to 10 (most detailed logging) and each internal part of TestNG logs messages in different level. This makes it hard for the user to find the best verbosity level for him to find out what's happening if something doesn't work as he would expect.
The best candidate for this would be level '2' which logs (using TextReporter) info about particular tests but there are some problems with this logger:

* info about configuration methods is not being logged, unless they fail
* logged message is of form '$status $testMethodName' and there's no way to easily find out in which package/class this method is (if one $testMethodName appears in more classes)
* messages are printed after all tests were run - continuous logging would be IMO more useful

This request:

* contains a fix for Issue #124
* adds new listener VerboseListener to TestNG. It is mostly copy and rewrite of TextReporter to overcome its current limitations outlined above, so the new reporter could eventually replace current TextReporter if it will be found more useful).

Differences between TextReporter and VerboseReporter:

* for TestNGAntTask - VerboseReporter is always enabled but its output is printed out depending on the verbosity level set by the user. Basically, by default, all messages are printed out in verbose mode only (user must run ant with '-v' option to see the messages). This applies also for all TestNGAntTask's verbose levels lower than '5'. For levels >= 5, everything is printed out at Ant's INFO level, hence everything becomes visible to the user
* for TestNG - VerboseReporter is enabled only in case if usedefaultlisteners='true' && verbose >= 5
* VerboseLogger prints out also info about status of configuration methods
* logged message was changed from form "$status $testMethodName" to "$status: $suiteName - $fqn.$testMethodName($parameters) ($actualParameters) finished in X ms"

Any feedback is welcome.