jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexander Klimetschek <aklim...@day.com>
Subject Re: Logging in Tests
Date Mon, 25 Feb 2008 22:02:12 GMT
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?

> If you're writing a
> complex test case where you need logging to follow the control flow,
> then you're probably doing something wrong. In fact a test case rarely
> should have much control flow... A sequence of operations either works
> or doesn't.

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

Otherwise the logging was helpful for developing the test cases - and  
I try to practise in all my code to keep the logging messages I wrote  
for myself because they document the code and simplify maintaining it  
later. I am just in the step of cleaning up the log code so that it  
does not fill up normal mvn test commands. The other (IMHO worse)  
solution would be to throw it all away.


Alexander Klimetschek

View raw message