Alex Rivera | Logout

Can I make JUnit more verbose?

Asked 2008-10-07T21:02:22.177
28

I'd like to have it yell hooray whenever an assert statement succeeds, or at the very least have it display the number of successful assert statements that were encountered.

I'm using JUnit4.

Any suggestions?

Edit
Report

1 Answer

4

Are you really interested in an assertion that succeeds? Normally, the only interesting assertions are ones that fail.

Being a fervent JUnit devotee myself, I try and make the output of the tests as quiet as possible because it improves the signal-to-noise ratio when something doesn't pass. The best test run is one where everything passes and there's not a peep from stdout.

You could always work on your unit test until it succeeds and run "grep Assert test.java | wc -l". :-)

answered 2008-10-08T01:14:20.670

Your Answer