ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Phani Kumar" <>
Subject JUnit Report (Please help me, i am trying this from past two weeks)
Date Fri, 12 Dec 2008 09:10:03 GMT

I am trying to generate html report through ant build.xml file, in that
process i am able to run my test successfully but it fails to generate html
report and it giving me error "java.lang.NoSuchMe ant.types. resources. Resources.
dieOnCircularRef erence()V"

i am giving my build.xml file below.. please let me know where did i went
wrong..and with what changes it works successfully

I am using apache-ant-1.7.1, and did not find optinal.jar in ant\lib, could
you please let me know what is the replacement of optional.jar file in

<project name="MyProject" default="report" basedir=".">
  <description> simple example build file </description>
  <!-- set global properties for this build -->
  <property name="src" location="src"/>
  <property name="build" location="build"/>
  <property name="reports" location="reports"/>
  <property name="html" location="${reports}/html"/>
  <property name="jreports" location="${reports}/jreports"/>

    <target name="init">
    <!-- Create the time stamp -->
    <!-- Create the build directory structure used by compile -->
    <mkdir dir="${build}"/>
    <mkdir dir="${src}"/>
    <mkdir dir="${reports}"/>
    <mkdir dir="${reports}/html"/>
    <mkdir dir="${reports}/jreports"/>

  <target name="compile" depends="init"
        description="compile the source " >
    <!-- Compile the java code from ${src} into ${build} -->
    <javac srcdir="${src}" destdir="${build}"/>

<target name="test" depends="compile"
        description="runs all junit test cases" >
<!-- Runs .class files from ${build} -->
    <junit printsummary="yes" haltonfailure="yes">
    <pathelement location="${build}"/>
    <pathelement path="${c:\junit4.5\junit-4.5.jar}"/>
  <formatter type="plain" usefile="false"/>
   <test name="NewTest" haltonfailure="no" outfile="result"
    <formatter type="xml"/>

   <!-- <batchtest fork="yes" todir="${build}">
    <fileset dir="${build}">
      <include name="*Test.class"/>
   <exclude name="**/AllTests.class"/>
  </batchtest> -->


<target name="report" depends="test"
        description="Generates JUnit HTML report" >
<!-- <taskdef name="myjars" classname=".\build.xml">
        <pathelement path="${C:\apache-ant-1.7.1\lib\junit-4.5.jar}"/>
        <pathelement path="${C:\apache-ant-1.7.1\lib\ant-junit.jar}"/>
</taskdef> -->
        <junitreport todir="${reports}">
        <fileset dir="${reports}">
            <include name="*Test-*.xml"/>
      <report todir="${html}"/>

  <target name="clean"
        description="clean up" >
    <!-- Delete the ${build} and ${dist} directory trees -->
    <delete dir="${build}"/>
    <delete dir="${dist}"/>

Venkata Phani

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message