On Wednesday, March 26, 2003, at 11:46 AM, Nathaniel Spurling wrote:
>
> Regarding suiterunner vs JUnit, I prefer the suiterunner API:
>
> test methods can throw Exceptions, also assertion failures
> generate Exceptions so you can put one catch(Exception) at the bottom
> of your method and print out any useful info before throwing the
> exception on, rather than separate ones for AssertionFailedError and
> Exception which looks very messy. Alternatively you can leave out the
> try/catch altogether - saves typing if you just want the stacktrace
> -- I Don't find the failures/exceptions distinction useful in JUnit.
I often simply have my JUnit testXXX throw Exception since that is
unexpected and a test failure/error. I don't quite get how SuiteRunner
is different here.
say you've got a method which goes:
testXXX() throws Exception{
//generate random data
try{
//do testing
} catch(Exception e){
//print data used
throw e;
}
}
in JUnit you need an extra catch(AssertionFailedError) clause in the event of
an assertion being untrue - not a big difference, but if all your tests are the
same format it's preferable.
--
This e-mail may contain confidential and/or privileged information. If you are
not the intended recipient (or have received this e-mail in error) please
notify the sender immediately and destroy this e-mail. Any unauthorized
copying, disclosure or distribution of the material in this e-mail is strictly
forbidden.