You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@jakarta.apache.org by "Vladimir R. Bossicard" <vl...@bossicard.com> on 2003/03/03 23:07:36 UTC
Re: Another unused import statement report is out...
> >assertTrue("Whoa, doSomething returned a non-Fred type!", doSomething()
> >instanceof Fred);
When the test fails, you don't have a lot of information (like the class
returned by doSomething) to debug your code.
<ads>
Using JUnit-addons, you would code your assertion:
ObjectAssert.assertInstanceOf(Fred, doSomething());
The error message will be something like:
"expected instance of class:<Fred> but was of class <WHATEVER>"
at least you have something to start your debug session.
</ads>
-Vladimir
PS: junit-addons.sf.net
--
Vladimir R. Bossicard
www.bossicard.com
---------------------------------------------------------------------
To unsubscribe, e-mail: general-unsubscribe@jakarta.apache.org
For additional commands, e-mail: general-help@jakarta.apache.org