ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jim Allers" <>
Subject RE: unit testing with ant
Date Tue, 04 Mar 2003 23:10:16 GMT
Unless this magic property is hidden deep, I don't think the jars in the
lib directory get listed as properties by their file name.

I think you're gonna need to set the "junit.jar" property in the build
file. Have you looked at the "junit" task?

-----Original Message-----
From: Erik Price [] 
Sent: Tuesday, March 04, 2003 4:35 PM
To: Ant Users List
Subject: unit testing with ant

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"/>

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

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.



To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message