ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <Jan.Mate...@rzf.fin-nrw.de>
Subject AW: Broken Junit targets
Date Wed, 15 Feb 2006 08:31:41 GMT
>  <!-- Suggested by Stephen McConnell -->
>  <target name="setup-path" depends="init">
>    <path id="project.main.path">
>      <pathelement location="${ant.jar}"/>
>      <pathelement location="${build.dir}/classes"/>
>    </path>
>    <path id="project.test.path">
>      <path refid="project.main.path"/>
>      <pathelement location="${ant-junit.jar}"/>
>      <pathelement location="${junit.jar}"/>
>    </path>
>  </target>

ok, now your test classes should find Ant´s junit task.


>  <!--  refid changed from test.classpath to setup-path -->
>  <target name="test" depends="test-compile">
>    <junit printsummary="true"

But could Ant find it itself?
While taskdef´ing Ant needs to know
- the implementation class of the task
- all needed external libraries

<junit> is taskdef´ed during the core initialisation (oata/taskdefs/default.properties).
The implementation class in ANT_HOME\lib\ant-junit.jar and the needed archive is junit.jar.

So junit.jar has to be in Ant´s classpath during Ant´s start: in ANT_HOME\lib, ANT_HOME\lib\optional,
USER_HOME\.ant\lib or in the directory provided via -lib.


Or you taskdef´ it a second time with another name

  <target name="setup-path" depends="init">
      ...
      <taskdef name="my.junit" classname="..." classpathref="project.test.path"/>
  </target>




Jan

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


Mime
View raw message