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=5947>.
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=5947

JUnit Classpath property doesn't set the classpath for non-fork tests.

           Summary: JUnit Classpath property doesn't set the classpath for
                    non-fork tests.
           Product: Ant
           Version: 1.4.1
          Platform: All
        OS/Version: All
            Status: UNCONFIRMED
          Severity: Normal
          Priority: Other
         Component: Optional Tasks
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]
                CC: [EMAIL PROTECTED]


Problem: In the JUnit optional task, the <classpath> nested tag does not have
the desired effect for JUnit with fork="no" (the default).  Instead of coming
from the tag, JUnit's classpath comes from the $CLASSPATH system environment
variable.

Workaround: use the fork="yes" option or set the $CLASSPATH environment
variable.

Another user report follows, detailing the same problem and another workaround.
(He and I are using the same versions of software, but I'm running on Solaris.)

--

From: [EMAIL PROTECTED] (Tim Rapp)
Newsgroups: comp.lang.java
Subject: Re: JUnit 3.7 with Ant 1.4 Property definitions - doesn't work
Date: 26 Oct 2001 12:23:25 -0700
Organization: http://groups.google.com/
Lines: 33
Message-ID: <[EMAIL PROTECTED]>
References: <[EMAIL PROTECTED]>
NNTP-Posting-Host: 208.243.87.205
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: posting.google.com 1004124205 15024 127.0.0.1 (26 Oct 2001 19:23:25
GMT)
X-Complaints-To: [EMAIL PROTECTED]
NNTP-Posting-Date: 26 Oct 2001 19:23:25 GMT


[EMAIL PROTECTED] (christopher) wrote in message
news:<[EMAIL PROTECTED]>...
> My Ant JUnits always fail with an Ant Property defined CLASSPATH.
>
> The error is 'cannot find the optional.jar' - 
> which is on the Property defined CLASSPATH.  These
> same Property definitions converted to env vars work great!  I have
> also tried some <systemproperty> and <classpath> overrides in the
> JUnit task itself to no avail.

Thanks Christopher, I had the same problem.  To fix, I added
"set CLASSPATH=C:\myproject\lib\junit.jar" to my NT script that calls Ant.  
I still have a <classpath> tag in my <junit> task.  Excerpts from my
build.xml file (unnecessary details replaced with ...) are below:

<path id="test.classpath" >
        <pathelement location="${lib}/junit.jar" />
        <pathelement location="${lib}/httpunit.jar" />
        <pathelement location="${lib}/parser.jar" />
        <pathelement location="${classes}" />
        <path refid="tomcat.classpath" />
        <path refid="mysql.classpath" />
</path>
...
<junit ... >
        <classpath>
                <path refid="test.classpath" />
        </classpath>
        ...
</junit>

Seems like this should be added to the Ant documentation for the 
<junit> task.  FYI, I'm running Ant 1.4.1, JUnit 3.7, Win2k Pro, 
and JDK 1.3.1.

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to