This is the mail archive of the
mauve-patches@sources.redhat.com
mailing list for the Mauve project.
Re: javax.swing.SwingUtilities - new tests
- From: Stephen Crawley <crawley at dstc dot edu dot au>
- To: David Gilbert <david dot gilbert at object-refinery dot com>
- Cc: mauve-patches at sources dot redhat dot com
- Date: Thu, 18 Nov 2004 09:27:28 +1000
- Subject: Re: javax.swing.SwingUtilities - new tests
david.gilbert@object-refinery.com said:
> try {
> // something that should throw a NullPointerException
> harness.check(false);
> }
> catch (NullPointerException e) {
> harness.check(true);
> }
> catch (Exception e) {
> harness.check(false);
> }
>
> 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);
}