--- Begin Message ---
- From: David Gilbert <david dot gilbert at object-refinery dot com>
- To: Stephen Crawley <crawley at dstc dot edu dot au>
- Date: Wed, 17 Nov 2004 23:37:48 +0000
- Subject: Re: javax.swing.SwingUtilities - new tests
- References: <200411172327.iAHNR1iZ022817@piglet.dstc.edu.au>
On Wed, 2004-11-17 at 23:27, Stephen Crawley wrote:
> david.gilbert@object-refinery.com said:
> > Perhaps someone can think of a more compact way to test for an
> > expected exception...
>
> I cannot.
>
> My two cents worth is that if a testcase is explicitly catching
> unexpected exceptions it should at least tell us what exception it
> has caught! For example:
>
> ....
> }
> catch (Exception e) {
> harness.check(false, "Caught an unexpected exception");
> harness.debug(e);
> }
In a perfect world, yes. But where do you draw the line between (a) the
test output describing everything about the test and (b) finding that
out by looking at the source code when a test actually fails. I settle
for (b) if it reduces the pain of writing tests (which it does for me).
Regards,
Dave.
--- End Message ---