ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 639] New - JUnitTestRunner masks exceptions
Date Mon, 19 Feb 2001 17:11:41 GMT
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=639

*** shadow/639	Mon Feb 19 09:11:41 2001
--- shadow/639.tmp.8703	Mon Feb 19 09:11:41 2001
***************
*** 0 ****
--- 1,43 ----
+ +============================================================================+
+ | JUnitTestRunner masks exceptions                                           |
+ +----------------------------------------------------------------------------+
+ |        Bug #: 639                         Product: Ant                     |
+ |       Status: NEW                         Version: Nightly build           |
+ |   Resolution:                            Platform: All                     |
+ |     Severity: Normal                   OS/Version: All                     |
+ |     Priority:                           Component: Optional Tasks          |
+ +----------------------------------------------------------------------------+
+ |  Assigned To: ant-dev@jakarta.apache.org                                   |
+ |  Reported By: dem@techapp.com                                              |
+ |      CC list: Cc:                                                          |
+ +----------------------------------------------------------------------------+
+ |          URL:                                                              |
+ +============================================================================+
+ |                              DESCRIPTION                                   |
+ This exception handling code in JUnitTestRunner makes it difficult to track 
+ down bugs in code that is being tested:
+             try {
+                 Method suiteMethod= testClass.getMethod("suite", new Class[0]);
+                 suite = (Test)suiteMethod.invoke(null, new Class[0]);
+             } catch(NoSuchMethodException e) {
+             } catch(InvocationTargetException e) {
+             } catch(IllegalAccessException e) {
+             }
+ 
+ A crude way to improve this would be:
+             try {
+                 Method suiteMethod= testClass.getMethod("suite", new Class[0]);
+                 suite = (Test)suiteMethod.invoke(null, new Class[0]);
+             } catch(NoSuchMethodException e) {
+ 	        e.printStackTrace( System.out );
+             } catch(InvocationTargetException e) {
+ 		e.printStackTrace( System.out );
+             } catch(IllegalAccessException e) {
+ 		e.printStackTrace( System.out );
+             }
+ 
+ As an example, I had a class loading problem that was obscured by this 
+ exception handling logic.
+ 
+ Thanks
+ -David McNeil

Mime
View raw message