Custom Search

[Top] [All Lists]

RE: Test cases that are inconclusive

Subject: RE: Test cases that are inconclusive
Date: Sun, 23 Feb 2003 14:31:09 -0500
> -----Original Message-----
> From: Linus Tolke [mailto:[email protected]]
> When I run the JUnit
> test cases in batch (from cron) I do not have a window system available
> and for that reason some classes cannot be created and tested. Currently
> some of these tests fail with the
>     [junit] Problem creating
> javax.swing.plaf.metal.MetalLookAndFeel with method
> getMenuTextFont and args { : java.lang.reflect.InvocationTargetException
> error and some of them I have "fixed" to catch that error and not fail.
> I like neither of these solutions. I would like to catch the error and
> throw an "inconclusive"-error to the JUnit framework because conceptually
> these tests have neither passed, nor found any problem.
Whoa -- what you have described is the essence of the distinction between an
error and a failure.  An error is a test that does not pass because of an
unexpected problem, like a screwed up environment.  I think your errors are
legit and you shouldn't treat them as failures.  They're legit because they
signal a problem with the test harness environment.
> The alterative solution would be to just have two set of tests, one that
> are runnable without the window system and one that is not and run them
> both when a window system is available and just the one of them when it
> is not but this is a lot more complicated since we then risk to forget
> running some of the tests some of the times.
What if you solve the environment problem by either using JDK 1.4, which
supports AWT in a windowless environment (may require a runtime setting --
see the JDK docs), or install Xvfb (X virtual frame buffer) to emulate a
running X server?  You may have Xvfb installed already.  If not, it can
easily be found via Google.
Scott Stirling
------------------------ Yahoo! Groups Sponsor ---------------------~-->
Get 128 Bit SSL Encryption!
To unsubscribe from this group, send an email to:
[email protected]
Your use of Yahoo! Groups is subject to 
<Prev in Thread] Current Thread [Next in Thread>
Current Sitemap | © 2012 planetjava | Contact | Privacy Policy