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: [EMAIL PROTECTED] |
+ | Reported By: [EMAIL PROTECTED]
|
+ | 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