ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Phani Kumar" <>
Subject Re: JUnit Report (Please help me, i am trying this from past two weeks)
Date Fri, 12 Dec 2008 11:22:13 GMT
I removed <pathelement path="${c:\junit4.5\junit-4.5.jar}"/> from <JUnit>
target and test runs fine, i got result.xml file .. but could not able to
get the reports.. is there anything wrong in this report Target code?
i have put the jar file outside of Ant\lib still getting same result
i am using jdk 15 and Ant 1.7, installed xalan also

below is the result of my build.xml also u can find the latest build.xml

C:\Test1>ant -f build.xml
Buildfile: build.xml

    [mkdir] Created dir: C:\Test1\build
    [mkdir] Created dir: C:\Test1\reports
    [mkdir] Created dir: C:\Test1\reports\html

    [javac] Compiling 1 source file to C:\Test1\build

    [junit] Running NewTest
    [junit] Testsuite: NewTest
    [junit] Tests run: 1, Failures: 0, Errors: 0, Time elapsed: 67.229 sec
    [junit] Tests run: 1, Failures: 0, Errors: 0, Time elapsed: 67.229 sec

    [junit] Testcase: testNew took 66.468 sec



Total time: 1 minute 25 seconds


<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"/>

    <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"/>

  <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}"/>
  <formatter type="plain" usefile="false"/>
   <test name="NewTest" haltonfailure="no" outfile="result"
    <formatter type="xml"/>

<target name="report" depends="test"
        description="Generates JUnit HTML report" >
        <junitreport todir="${reports}">
        <fileset dir="${reports}">
            <include name="*Test-*.xml"/>
      <!-- <report format="frames" todir="${html}"/> -->
      <report format="noframes"

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

On Fri, Dec 12, 2008 at 4:25 PM, Mark Salter <>wrote:

> Phani Kumar wrote:
> > 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"
> This looks to me that you have a circular reference somewhere in your
> processing.
> >
> > i am giving my build.xml file below.. please let me know where did i went
> > wrong..and with what changes it works successfully
> Which task is failing please?
> >     <pathelement path="${c:\junit4.5\junit-4.5.jar}"/>
> Using ${ to indicate a variable when an absolute path is given looks
> very odd to me, but could it cause this problem?
> So more people can consider helping...
> ...Could you post:-
> - the full stack trace (copy/paste),
> - any messages issued by ant - there must be some?
> Also take a look at the verbose output from ant -verbose, you might find
> something useful there.
> You might also - if you have a spare second - take a quick look at :-
> As you have already spent time on this over the last two weeks, it is
> probably worth spending a bit more so you can pose a smart question,
> which may in turn get you the answer you need.
> --
> Mark
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

Phani Annadanam
ఫణి కుమార్ అన్నదానం
फणि कुमार अन्नदानम
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message