ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Roberto Juarez" <rjua...@omnilogic.es>
Subject RE: problems with <junit> task
Date Wed, 01 Sep 2004 14:40:15 GMT
Thanks Erik,

putting junit.jar in the system CLASSPATH correctly has made it work.

Roberto.

> -----Mensaje original-----
> De:	Erik Hatcher [SMTP:erik@ehatchersolutions.com]
> Enviado el:	miércoles, 01 de septiembre de 2004 15:34
> Para:	Ant Users List
> Asunto:	Re: problems with <junit> task
> 
> In your Ant 1.5.4 usage, I'm sure you had junit.jar in either your 
> CLASSPATH or ANT_HOME/lib as well.  There is no difference in this 
> respect between the two versions of Ant.... junit.jar is needed 
> regardless.
> 
> 	Erik
> 
> 
> On Sep 1, 2004, at 6:43 AM, Roberto Juarez wrote:
> 
> > Hello everyone,
> >
> > I have recently upgraded to Ant 1.6.2 and from 1.5.4 (binary 
> > distributions both). With 1.5.4 I was able to invoke Junit from within 
> > Ant by using the <junit> task as suggested in the docs. But now I am 
> > not. I have the following build.xml (unimportant content removed for 
> > clarity).
> >
> > <project name="helloworld" default="default">
> >
> > 	<!-- environment  -->
> > 	<property environment="env." />
> > 	<property name="develop.dir" value="${env.DEVELOP_HOME}" />
> >
> > 	<!-- directory mappings  -->
> > 	<property name="build.dir" location="build" />
> > 	<property name="classes.dir" location="${build.dir}/classes" />
> > 	<property name="library.dir" value="${develop.dir}/library" />
> >       ...
> >
> > 	<!-- jars  -->
> > 	<property name="junit.jar" value="${library.dir}/junit-3.8.1.jar" />
> >       ...
> >
> > 	<!-- paths -->
> > 	<path id="compile.classpath">
> > 		<pathelement location="${junit.jar}" />
> > 	</path>
> >
> > 	<path id="test.classpath">
> > 		<path refid="compile.classpath" />
> > 		<pathelement location="${classes.dir}" />
> > 	</path>
> >
> > 	<!-- targets -->
> > 	<target name="setup" description="Sets up the build system.">
> >         <!-- content removed -->
> > 	</target>
> >
> > 	<target name="compile" depends="setup" description="Compiles source 
> > code.">
> >         <!-- content removed -->
> > 	</target>
> >
> > 	<!-- here it is -->
> >       <target name="run-tests" depends="compile"  description="Runs 
> > tests.">
> > 		<junit haltonfailure="yes">
> > 			<classpath refid="test.classpath" />
> > 			<formatter type="brief" />
> > 			<batchtest>
> > 				<fileset dir="${classes.dir}" includes="**/*Test.class" />
> > 			</batchtest>
> > 		</junit>
> > 	</target>
> >
> > 	<target name="package-resources" depends="run-tests" 
> > description="Builds jar files.">
> >         <!-- content removed -->
> > 	</target>
> >
> > 	<target name="default" depends="package-resources" 
> > description="Default entry point." />
> >
> > <project/>
> >
> > This works only If I put the junit.jar file in the {ANT_HOME}/lib 
> > directory, otherwise I get the error message that says that Ant is 
> > unable to create the <junit> task.
> >
> > Somebody help me please.
> >
> > Roberto Juárez
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> > For additional commands, e-mail: user-help@ant.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message