This is the mail archive of the mauve-patches@sources.redhat.com mailing list for the Mauve project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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);
}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]