You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cactus-user@jakarta.apache.org by SainTiss <sa...@gmx.net> on 2002/12/10 17:44:53 UTC

how to test an exception?

Hi,

I thought there'd be an assertXXX method to test that an exception
should be thrown, but I can't find any...

Or is there another "nice" way to test it?

I mean, I can do this:

try{
	// codeThatShouldThrowException
}
catch(exception) {}

fail();

But that doesn't look very pretty to me, does it?

I noticed that there is an ExceptionTestCase in JUnit, but I'm not sure
if this is available in Cactus as well?

Thanks

Hans