ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Price <>
Subject unit testing with ant
Date Tue, 04 Mar 2003 22:34:54 GMT
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 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.



View raw message