ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 23696] New: - JUnitTestRunner masks exceptions
Date Thu, 09 Oct 2003 12:20:53 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=23696>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=23696

JUnitTestRunner masks exceptions

           Summary: JUnitTestRunner masks exceptions
           Product: Ant
           Version: 1.5.4
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Enhancement
          Priority: Other
         Component: Optional Tasks
        AssignedTo: dev@ant.apache.org
        ReportedBy: ssegers@kiala.com


In JUnitTestRunner there is this code that finds methods:

            try {
                // check if there is a suite method
                suiteMethod = testClass.getMethod("suite", new Class[0]);
            } catch (Exception e) {
                // no appropriate suite method found. We don't report any
                // error here since it might be perfectly normal. We don't
                // know exactly what is the cause, but we're doing exactly
                // the same as JUnit TestRunner do. We swallow the exceptions.
            }

the catch also catches an java.lang.ExceptionInInitializerError, which is just
trashed. When the class is accessed again later on in TestSuite, you get a
NoClassDefFoundError, leaving you completely in the dark about the cause of the
problem. I think the catch should just catch NoSuchMethodError, and let other
Exceptions propagate.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message