ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <>
Subject Re: unit testing with ant
Date Tue, 04 Mar 2003 23:45:26 GMT

First - thanks for your support!  I'm continually humbled and pleased 
with the reception we've gotten with our book.

And yes, ${junit.jar} is a property that is set by the example build 
file that Steve and I used.  Its not something Ant sets itself.  I 
usually do it this way:


in a file that gets loaded by the main build file.  
${ant.home} is automatically set by Ant.

To help answer both your e-mails, please download the JavaDevWithAnt 
project I've created based on the project Steve and I created for the 
book.  Its not quite the same as the sample code from the book, but its 
quite close.  Its been streamlined to have a very simple build process 
and not cluttered by those late night hacks we did in the heat of book 
production deadlines.  Its available here:

You can see how all the classpaths get set up and there is an 
explanation of it in the documentation you'll find there as well.  Let 
me know if there are any questions, problems, or even suggestions.


On Tuesday, March 4, 2003, at 05:34  PM, Erik Price wrote:
> I'm using ant to compile my project, I really like it a lot.  I'm 
> learning to use ant from "Java Development with Ant", it's a great 
> book.  I notice that it gets mentioned here often, so I was wondering 
> if anyone could clarify something for me.  Please bear in mind that 
> I'm new to ant when it comes to anything beyond basic source 
> compilation.  (I just anted up my first executable JAR file today.)
> On page 96, it is explained that compiling and running JUnit test 
> requires a different classpath than the classpath used for building 
> the production code.  The text gives the following example path to > use:
> <path id="test.classpath">
>   <path refid="compile.classpath"/>
>   <pathelement location="${junit.jar}"/>
>   <pathelement location="${build.dir}/classes"/>
>   <pathelement location="${build.dir}/test"/>
> </path>
> Now, I'm basing my own build file off of the one used in the book.  I 
> have the "compile.classpath" property set (it is the path I use to 
> compile my project code).  I have the "build.dir" property set, per 
> the instructions in the book.  But I haven't set the "junit.jar" 
> property --  AFAICT, the book doesn't discuss setting this property.  
> So I'm wondering if this property is inherited from the Ant 
> environment somehow?
> As per the suggestion in the book, I have put junit.jar into 
> ANT_HOME/lib (actually I symlinked it).  So does that mean that the 
> "junit.jar" property in my build file will automatically know that 
> it's there?  Sorry if this is an obvious question but I'm a little 
> confused.
> Thanks,
> Erik
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

View raw message