Return-Path: Delivered-To: apmail-ant-dev-archive@www.apache.org Received: (qmail 18096 invoked from network); 27 Feb 2006 19:39:05 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 27 Feb 2006 19:39:05 -0000 Received: (qmail 4871 invoked by uid 500); 27 Feb 2006 19:39:02 -0000 Delivered-To: apmail-ant-dev-archive@ant.apache.org Received: (qmail 4832 invoked by uid 500); 27 Feb 2006 19:39:02 -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 4821 invoked by uid 99); 27 Feb 2006 19:39:02 -0000 X-ASF-Spam-Status: No, hits=0.6 required=10.0 tests=NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [192.87.106.226] (HELO ajax.apache.org) (192.87.106.226) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 27 Feb 2006 11:38:53 -0800 Received: by ajax.apache.org (Postfix, from userid 99) id 0BF05DC; Mon, 27 Feb 2006 20:38:25 +0100 (CET) From: bugzilla@apache.org To: dev@ant.apache.org Subject: DO NOT REPLY [Bug 38799] New: - task should work so long as junit.jar present in even if not among Ant libs Message-ID: X-Bugzilla-Reason: CC Date: Mon, 27 Feb 2006 20:38:25 +0100 (CET) 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=38799 Summary: task should work so long as junit.jar present in even if not among Ant libs Product: Ant Version: 1.3 Platform: All OS/Version: All Status: NEW Severity: major Priority: P2 Component: Optional Tasks AssignedTo: jglick@netbeans.org ReportedBy: jglick@netbeans.org CC: ant@tobiasen.dk,dev@ant.apache.org OtherBugsDependingO 6606 nThis: A general problem with has come up repeatedly, as described well here: http://issues.apache.org/bugzilla/show_bug.cgi?id=6606#c22 I am splitting this off into a separate issue as #6606 seems to have a lot of other meanings and I want to be concrete. The problem is that if you have ant-junit.jar in your Ant lib dir (the default situation if you have installed Ant) but you do not have junit.jar in your Ant lib dir or $CLASSPATH or -lib etc. (again, the default situation), the task does not work. This is true even if you have explicitly added junit.jar to the for the task (, not which cannot work on a task already in your lib dir). That doesn't make much sense and it imposes an artificial requirement on people to adjust their Ant startup classpath. That means that you cannot write a completely self-contained Ant project that runs unit tests. This patch fixes that. While I cannot find Tobias' original proposed patch, I think this accomplishes as much, and furthermore works in unforked mode. I'm not really sure how to unit-test this since the Ant unit tests assume a lot of environment is set up, and specifically they will assume that junit.jar is on the test classpath. So I'm relying on manual testing of various situations: 1. Forked mode vs. unforked mode. 2. junit.jar on system CP vs. not. 3. junit.jar in test vs. not. Desired behavior is that tests run fine if either #2 or #3 or both. (If neither, a simple error is reported.) Current behavior is that tests do not run if #3 but not #2. Compatibility: unless I made a mistake, should be fully compatible. Any build scripts which worked before should continue to work the same way: junit.jar must have been on system CP, and will behave as it did previously. The change should only affect situations where junit.jar was not on system CP, which could not have worked before. The patch is a bit icky since it needs to use some reflection to isolate the junit.jar-dependent portions of the task. The result is mostly transparent and should not harm existing code subclassing some of the classes in this package, I think, but it does add some to the complexity of this task. Perhaps someone knowledgeable could simplify it but I was afraid of breaking foreign code referring to these classes, which are all public. Note that since both "halves" of the task remain in the same source root, the compiler does not enforce the separation - a full fix would move the junit.jar-dependent classes to a separate source root, to ensure that they are not statically accessible from the main source root, and ideally even to put them in a separate JAR file at runtime. -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is. --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org For additional commands, e-mail: dev-help@ant.apache.org