jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jukka Zitting" <jukka.zitt...@gmail.com>
Subject Re: Logging in Tests
Date Tue, 26 Feb 2008 00:39:12 GMT

On Tue, Feb 26, 2008 at 12:02 AM, Alexander Klimetschek
<aklimets@day.com> wrote:
> Am 25.02.2008 um 21:02 schrieb Jukka Zitting:
>  > What's the reason for logging in test cases?
>  Why do other test cases in Jackrabbit use the logging? Why is there a
>  logger in the JUnitTest base class?

The logger is mostly used for setup and teardown code.

>  The test case is somewhat more complex as it starts an external
>  application. This setup can fail and logging helps in seeing the
>  problem.

OK, I can understand the need for complexity in setup code, though
IMHO that's still a sign of trouble. If it's something people
generally set up in client applications, you should a utility class or
something (with it's own logging) for doing that. If it's not
something people do, then the test case probably isn't needed.

Anyway, for such cases I'd just use SLF4J logging as we do everywhere else.

I don't really understand why the TCK code needs the LogPrintWriter
construct, but I guess it's there as a bridge for older code or a
pre-SLF4J attempt to avoid a fixed dependency to a specific logging
framework. Perhaps we should just refactor LogPrintWriter away.


Jukka Zitting

View raw message