__matthewHawthorne wrote:

One trick that may work is to call Digester.setLogger() with your own org.apache.commons.logging.Log implementation that does nothing.

Or you can use org.apache.commons.logging.impl.NoOpLog, which does the same thing.

Another approach would be to modify the build.xml file so that it deliberately selects the SimpleLog logger implementation, and configures it for error-level output only. This can easily be done by passing <sysproperty> elements inside the <java> elements that fire each test.


I'd certainly be interested in a patch to make this sort of behavior permanent; I agree that the deliberately induced messages can be misleading/annoying.

Craig





Simon Kitching wrote:

Hi,

Currently the Digester unit tests include some tests which deliberately
trigger failures.

This is fine - error handling should also be tested.
Unfortunately, when an error occurs, Digester calls log.warn or
log.error, which gets printed out in the middle of the junit output.
Yecch.

I also want to add some plugins unit tests which test error conditions,
and have the same problem.

Does anyone know of a nice way to temporarily disable logging when
running certain tests, given that we don't know which underlying logging
implementation commons-logging has discovered at runtime?

FYI, the main problem line of code is:
  Digester.java: 1273

Thanks,

Simon




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




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



Reply via email to