ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "HENRY Nicolas" <nicolas.he...@wwr-planet.net>
Subject Task style from ANT
Date Fri, 12 Jan 2001 10:17:55 GMT
Hi all,
we're using a ANT makefile in order to build, generate doc
& integrate our JUnit tests.
So after compil & javadoc generation we invoke Junit using Junit task, then we use the
task style in order to get pretty HTML reports...But this last step fails!!!!
It seems that the XSL Liaison class required is not found...
This is the stack trace :

compiletests:

buildreport:
    [junit] Running DummyTestSuite
    [junit] Tests run: 2, Failures: 1, Errors: 0, Time elapsed: 0,11 sec
    [junit] TEST DummyTestSuite FAILED
    [junit] Running DummyClassTest
    [junit] Tests run: 1, Failures: 1, Errors: 0, Time elapsed: 0,02 sec
    [junit] TEST DummyClassTest FAILED
    [junit] Running DummyTestSuite
    [junit] Tests run: 2, Failures: 1, Errors: 0, Time elapsed: 0,02 sec
    [junit] TEST DummyTestSuite FAILED

makehtml:
trying xalan

BUILD FAILED

E:\DEV\tests\build.xml:75: java.lang.ClassNotFoundException: org.apache.tools.an
t.taskdefs.optional.XalanLiaison
java.lang.ClassNotFoundException: org.apache.tools.ant.taskdefs.optional.XalanLi
aison


This is our build.xml file :

<project name="TEST" default="compile" basedir=".">
<property name="app.name" value="sample" />
<property name="build.dir" value="build/classes" />
<property name="report.dir" value="doc/report" />
<taskdef name="junit" classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTask"
/>
<taskdef name="style" classname="org.apache.tools.ant.taskdefs.XSLTProcess" />


<target name="JUNIT">
 <available property="junit.present" classname="junit.framework.TestCase" />
</target>

<target name="compile" depends="JUNIT">
 <mkdir dir="${build.dir}"/>
 <javac srcdir="./" destdir="${build.dir}"  >
  <include name="**/*.java"/>
 </javac>
</target>

<target name="jar" depends="compile">
 <mkdir dir="build/lib"/>
 <jar jarfile="build/lib/${app.name}.jar"
  basedir="${build.dir}" includes="**" />
</target>

<target name="compiletests" depends="jar">
 <mkdir dir="build/testcases" />
 <javac srcdir="." destdir="build/testcases">
  <classpath>
   <pathelement location="build/lib/${app.name}.jar" />
   <pathelement path="" />
  </classpath>
  <include name="**/*.java" />
 </javac>
</target>

<target name="runtests" depends="compiletests" if="junit.present">
 <java fork="yes" classname="junit.textui.TestRunner"
  taskname="junit" failonerror="true">
  <arg value="DummyTestSuite" />
  <classpath>
   <pathelement location="build/lib/${app.name}.jar" />
   <pathelement location="build/testcases" />
   <pathelement path="" />
   <pathelement path="${java.class.path}" />
  </classpath>
 </java>
</target>

<target name="buildreport" depends="compiletests" if="junit.present">
 <mkdir dir="${report.dir}"/>
 <junit printsummary="yes" haltonfailure="no">
  <classpath>
      <pathelement location="${build.dir}" />
      <pathelement path="${java.class.path}" />
  </classpath>

  <formatter type="plain" />

    <test name="DummyTestSuite" haltonfailure="no" outfile="${report.dir}/result" >
     <formatter type="xml" />
    </test>

    <batchtest fork="yes">
      <fileset dir="./">
         <include name="**/*Test*.java" />
         <exclude name="**/AllTests.java" />
      </fileset>
    </batchtest>
  </junit>
</target>

<target name="makehtml" depends="buildreport" if="junit.present">
 <style basedir="${report.dir}" destdir="${report.dir}"
  processor="xalan"
  extension="html" style="style/apache.xml"/>
</target>

</project>


We use ANT 1.2,  Xalan 2 & Junit 3.4....


Any clues welcomed....

Sorry for this a little bit large post....

Cheers

Mime
View raw message