ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From AjayaSa...@TDWaterhouse.com
Subject RE: junitreport task error
Date Fri, 10 Dec 2004 20:20:18 GMT
It works like a charm...Thanks a lot. :)

ajaya

-----Original Message-----
From: Sadaf_Choudhry [mailto:Sadaf_Choudhry@infosys.com] 
Sent: Friday, December 10, 2004 3:11 PM
To: Ant Users List
Subject: RE: junitreport task error

This is what I use:


    <path id="junit.path">
            <fileset dir="../lib">
                <include name="junit.jar"/>
                <include name="ant-junit.jar"/>
                <include name="ant-trax.jar"/>
            </fileset>
    </path>

    <taskdef name="junitreport" classpathref="junit.path"
classname="org.apache.tools.ant.taskdefs.optional.junit.XMLResultAggrega
tor">
    </taskdef>

Sadaf

-----Original Message-----
From: AjayaSahoo@TDWaterhouse.com [mailto:AjayaSahoo@TDWaterhouse.com] 
Sent: Saturday, December 11, 2004 1:38 AM
To: user@ant.apache.org
Subject: RE: junitreport task error

How do I define a junitreport task?

-----Original Message-----
From: Sadaf_Choudhry [mailto:Sadaf_Choudhry@infosys.com] 
Sent: Friday, December 10, 2004 3:05 PM
To: Ant Users List
Subject: RE: junitreport task error

Ok,
I see from your build file that you have not defined the junitreport
task itself. You need to do that, unless you have ant-trax.jar and
junit.jar in the same directory.

Sadaf


-----Original Message-----
From: AjayaSahoo@TDWaterhouse.com [mailto:AjayaSahoo@TDWaterhouse.com] 
Sent: Saturday, December 11, 2004 1:10 AM
To: user@ant.apache.org
Subject: RE: junitreport task error

I have ant-trax.jar under apache-ant-1.6.2\lib directory.

Ajaya

-----Original Message-----
From: Sadaf_Choudhry [mailto:Sadaf_Choudhry@infosys.com] 
Sent: Friday, December 10, 2004 2:01 PM
To: Ant Users List
Subject: RE: junitreport task error

Hi,
You might not have ant-trax.jar

Sadaf

-----Original Message-----
From: Antoine Levy-Lambert [mailto:antoine@gmx.de] 
Sent: Saturday, December 11, 2004 12:28 AM
To: Ant Users List
Subject: Re: junitreport task error

Hello,
you might need to put xalan.jar under $JAVA_HOME/jre/lib/endorsed or to 
make sure the java command starting ant has a 
-Djava.endorsed.dirs=path.of.xalan
not sure, just a guess.

Antoine

AjayaSahoo@TDWaterhouse.com wrote:

>I am running ant1.6.2. I have downloaded xalan-j_2_6_0-bin.zip.
Extracted
>xalan.jar into apache-ant-1.6.2\lib directory. I am running the
following
>script:
>
><project name="sampling" default="test">
>
>  <property name="src.dir" location="src"/>
>  <property name="src.java.dir" location="${src.dir}/java"/>
>  <property name="src.test.dir" location="${src.dir}/test"/>
>
>  <property name="target.dir" location="target"/>
>  <property name="target.classes.java.dir" 
>      location="${target.dir}/classes/java"/>
>  <property name="target.classes.test.dir" 
>      location="${target.dir}/classes/test"/>
>
>  <property name="target.report.dir" 
>      location="${target.dir}/report"/>
>
>  <property name="junit.jar"
>location="C:\java_lib\junit3.8.1/lib/junit.jar"/>
>  <property name="junit.dir" location="C:\java_lib\junit3.8.1/lib"/>
>
>  <target name="compile.java">
>    <mkdir dir="${target.classes.java.dir}"/>
>    <javac destdir="${target.classes.java.dir}">
>      <src path="${src.java.dir}"/>
>    </javac>
>  </target>
>
>  <target name="compile.test" depends="compile.java">
>    <mkdir dir="${target.classes.test.dir}"/>
>    <javac destdir="${target.classes.test.dir}">
>      <src path="${src.test.dir}"/>
>      <classpath>
>        <pathelement location="${target.classes.java.dir}"/>
>        <pathelement location="${junit.jar}"/>
>      </classpath>
>    </javac>
>  </target>
>
>  <target name="compile" depends="compile.java,compile.test"/>
>
><path id="junit.cp">
>   <fileset dir="${junit.dir}">
>      <include name="junit.jar"/>	
>   </fileset>
>   <fileset dir="${junit.dir}">
>      <include name="ant-junit.jar"/>	
>   </fileset>
>
></path>
>
><taskdef name="junit" 	
>classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTask"
>classpathref="junit.cp"/>
>
>  <target name="test" depends="compile">
>    <mkdir dir="${target.report.dir}"/>
>    <property name="tests" value="TestAccount"/>
>    <junit printsummary="yes" haltonerror="yes" haltonfailure="yes"
>fork="yes">
>      <!-- formatter type="plain" usefile="false"/ -->
>      <formatter type="xml"/>
>      <batchtest todir="${target.report.dir}">
>        <fileset dir="${src.test.dir}">
>          <include name="**/${tests}.java"/>
>          <exclude name="**/Test*All.java"/>
>        </fileset>
>      </batchtest>
>      <classpath>
>        <pathelement location="${target.classes.java.dir}"/>
>        <pathelement location="${target.classes.test.dir}"/>
>        <!-- pathelement path="${ant.home}/lib/clover.jar"/ -->
>        <pathelement location="${junit.jar}"/>
>      </classpath>
>    </junit>
>  </target>
>
>  <target name="report" depends="test">
>    <mkdir dir="${target.report.dir}/html"/>
>    <junitreport todir="${target.report.dir}">
>      <fileset dir="${target.report.dir}">
>        <include name="TEST-*.xml"/>
>      </fileset>
>      <report todir="${target.report.dir}/html"/>
>    </junitreport>
>  </target>
>
>  <target name="clean">
>    <delete dir="${target.dir}"/>
>  </target>
></project>
>
>For report task I am getting the following error:
>
>Buildfile: build.xml
>Trying to override old definition of datatype junit
>
>compile.java:
>
>compile.test:
>
>compile:
>
>test:
>    [junit] Running TestAccount
>    [junit] Tests run: 2, Failures: 0, Errors: 0, Time elapsed: 0.375
sec
>
>report:
>
>BUILD FAILED
>C:\junitdemo\build.xml:76: Could not create task or type of type:
>junitreport.
>
>  
>



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



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

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



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

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



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

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


Mime
View raw message