Return-Path: Delivered-To: apmail-ant-dev-archive@www.apache.org Received: (qmail 85451 invoked from network); 18 Aug 2006 22:07:50 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 18 Aug 2006 22:07:50 -0000 Received: (qmail 25150 invoked by uid 500); 18 Aug 2006 22:07:50 -0000 Delivered-To: apmail-ant-dev-archive@ant.apache.org Received: (qmail 24846 invoked by uid 500); 18 Aug 2006 22:07:49 -0000 Mailing-List: contact dev-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Ant Developers List" Reply-To: "Ant Developers List" Delivered-To: mailing list dev@ant.apache.org Received: (qmail 24835 invoked by uid 99); 18 Aug 2006 22:07:49 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 18 Aug 2006 15:07:49 -0700 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.198] (HELO brutus.apache.org) (209.237.227.198) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 18 Aug 2006 15:07:48 -0700 Received: by brutus.apache.org (Postfix, from userid 33) id D29FD7142E8; Fri, 18 Aug 2006 22:04:49 +0000 (GMT) From: bugzilla@apache.org To: dev@ant.apache.org Subject: DO NOT REPLY [Bug 40289] New: - The JUnit optional task does not support JUnit 4.1 (JDK 1.5) Message-ID: X-Bugzilla-Reason: AssignedTo Date: Fri, 18 Aug 2006 22:04:49 +0000 (GMT) X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG� RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT . ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND� INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=40289 Summary: The JUnit optional task does not support JUnit 4.1 (JDK 1.5) Product: Ant Version: 1.6.5 Platform: All OS/Version: other Status: NEW Keywords: JDK1.5 Severity: normal Priority: P2 Component: Optional Tasks AssignedTo: dev@ant.apache.org ReportedBy: sonya_quist@yahoo.com JUnit task (JUnitVersionHelper.java) does not support new annotated test cased support in JUnit 4.1. Here is the corrected code: public static String getTestCaseName(Test t) { if (t instanceof TestCase && testCaseName != null) { try { return (String) testCaseName.invoke(t, new Object[0]); } catch (Throwable e) { // ignore } } else { try { Method getNameMethod = null; try { getNameMethod = t.getClass().getMethod("getName", new Class [0]); } catch (NoSuchMethodException e) { try { getNameMethod = t.getClass().getMethod("name", new Class [0]); } catch (NoSuchMethodException e2) { // support Junit 4.1 getNameMethod = t.getClass().getMethod("toString", new Class [0]); } } if (getNameMethod != null && getNameMethod.getReturnType() == String.class) { return (String) getNameMethod.invoke(t, new Object[0]); } } catch (Throwable e) { // ignore } } return "unknown"; } -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org For additional commands, e-mail: dev-help@ant.apache.org