ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yoshimitsu, Stacy D." <SYOSHIMI...@northropgrumman.com>
Subject Running junit in Ant
Date Thu, 08 May 2003 23:00:45 GMT
Hello,

I'm trying to implement junit test into my build.xml file.  I didn't want to
copy the junit.jar file over to Ant/lib directory because I'm doing 2-3
projects build and each maybe using a different version of junit.  I've
looked at Ant's document and it saids:  

Note: You must have junit.jar and the class files for the <junit> task in
the same classpath. You can do one of: 
	Put both junit.jar and the optional tasks jar file in ANT_HOME/lib. 
	Do not put either in ANT_HOME/lib, and instead include their
locations in your CLASSPATH environment variable. 
	Do neither of the above, and instead, specify their locations using
a <classpath> element in the build file. See the FAQ <../../faq.html> for
details. 


So, I've looked at option 3 (to remove junit class files from optional.jar).
I first extracted optional.jar --> remove all junit class files --> jar up
optional.jar file and places it in Ant/lib directory --> run build.xml and
got the following message:

_____________________________________________________________
Invalid implementation version between Ant core and Ant optional tasks.
 core    : 1.5.1
 optional: null
______________________________________________________________

Does anyone know how I can fix that errors?  How is everyone doing w/ their
junit test in Ant?  What can I do if I don't want to copy junit.jar file to
Ant/lib directory?  This is what I have in the build.xml file:

____________________________________________________________
<target name="run.junit.test" depends="init" description="Run JUnit test" >
    <junit printsummary="off" 
	   haltonfailure="true"
	   showoutput="yes" 
	   fork="true" >

	<classpath>
	    <fileset dir="${libs.dir}" >
	  	<include name="*.jar" />
	    </fileset>
	    <fileset dir="${classes.dir}" >
	  	<include name="*.xml" />
	    </fileset>
	</classpath>
	<classpath path="${classes.dir}" />

	<formatter type="brief" usefile="false" />
	<test name="com.northropgrumman.amm.test.TestSuiteMain"  />
    </junit>
</target

____________________________________________________________


Thanks,

Stacy

Mime
View raw message