ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Roberto Juarez" <rjua...@omnilogic.es>
Subject problems with <junit> task
Date Wed, 01 Sep 2004 10:43:51 GMT
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


Mime
View raw message