PlanetJava
Custom Search

java-junit-user
[Top] [All Lists]

Test cases that are inconclusive

Subject: Test cases that are inconclusive
Date: Sun, 23 Feb 2003 08:37:14 +0100
How do I signal to the JUnit framework that the result of the test is
inconclusive?
In the application I am working with (ArgoUML) we have a set of JUnit
test cases. The application is normally run as a desktop application and
the classes within rely on the availability of the window system in order
to become created and do what they normally do. 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. Is there a way
to do this? I mean it is important that the inconclusive tests show up in
the summary as inconclusive so noone thinks that they passed and it is
likewise important that they don't show up as failed because they have
not detected any error.
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.
        /Linus
------------------------ Yahoo! Groups Sponsor ---------------------~-->
Get 128 Bit SSL Encryption!
http://us.click.yahoo.com/FpY02D/vN2EAA/xGHJAA/5cFolB/TM
---------------------------------------------------------------------~->
To unsubscribe from this group, send an email to:
[email protected]
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 
msgmiddle
<Prev in Thread] Current Thread [Next in Thread>
Current Sitemap | © 2012 planetjava | Contact | Privacy Policy