ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Prashant Reddy <prash...@pramati.com>
Subject Re: JUnit Report (Please help me, i am trying this from past two weeks)
Date Fri, 12 Dec 2008 10:43:29 GMT
How about :

1. Rename xalan.jar from ANT/lib (Rename to something like xalan.jar1)
2. Run ANT with JDK 1.6 set in the path.

My guess is that the Xalan that ANT ships is giving you problem, and by 
following the above steps Xalan shipped with Sun JDK will be picked up.

But obviously this solution is not scalable, if you want your build.xml 
to run on other machines..

-Prashant

Phani Kumar wrote:
> Hi,
>
> 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
> thodError:org.apache.tools. 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
> ant-1.7.1
>
> <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 -->
>     <tstamp/>
>     <!-- 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>
>
>   <target name="compile" depends="init"
>         description="compile the source " >
>     <!-- Compile the java code from ${src} into ${build} -->
>     <javac srcdir="${src}" destdir="${build}"/>
>   </target>
>
> <target name="test" depends="compile"
>         description="runs all junit test cases" >
> <!-- Runs .class files from ${build} -->
>     <junit printsummary="yes" haltonfailure="yes">
>   <classpath>
>     <pathelement location="${build}"/>
>     <pathelement path="${c:\junit4.5\junit-4.5.jar}"/>
>   </classpath>
>   <formatter type="plain" usefile="false"/>
>    <test name="NewTest" haltonfailure="no" outfile="result"
> todir="${reports}">
>     <formatter type="xml"/>
>   </test>
>
>    <!-- <batchtest fork="yes" todir="${build}">
>     <fileset dir="${build}">
>       <include name="*Test.class"/>
>    <exclude name="**/AllTests.class"/>
>      </fileset>
>   </batchtest> -->
>
> </junit>
> </target>
>
> <target name="report" depends="test"
>         description="Generates JUnit HTML report" >
> <!-- <taskdef name="myjars" classname=".\build.xml">
>   <classpath>
>         <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}"/>
>   </classpath>
> </taskdef> -->
>         <junitreport todir="${reports}">
>         <fileset dir="${reports}">
>             <include name="*Test-*.xml"/>
>         </fileset>
>       <report todir="${html}"/>
>     </junitreport>
>     </target>
>
>
>   <target name="clean"
>         description="clean up" >
>     <!-- Delete the ${build} and ${dist} directory trees -->
>     <delete dir="${build}"/>
>     <delete dir="${dist}"/>
>   </target>
> </project>
>
>
>
> Thanks,
> Venkata Phani
>
>   


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


Mime
View raw message