code coverage using emma plugin in hudson - ant

I am able to get instrumented classes, but I could not find my runtime coverage data. I'm getting the output in hudson using build.xml(ant). Can anyone please help me out...The following is my build.xml file...
<path id="classpath.test">
<pathelement location="${dir.dest}/test.jar"/>
<fileset dir="C:\Program Files\Java\jre7\lib\ext">
<include name="**/*.jar"/>
</fileset>
</path>
<path id="emma.lib">
<pathelement location="C:\Program Files\Java\jre7\lib\ext\emma-2.0.5312.jar" />
<pathelement location="C:\Program Files\Java\jre7\lib\ext\emma_ant-2.0.5312.jar" />
</path>
<taskdef resource="emma_ant.properties" classpathref="emma.lib" />
<target name="compile" depends="init,prepare" >
<javac classpathref="classpath.test" debug="on" srcdir="${src.dir}" destdir="${out.dir}" />
<emma enabled="${emma.enabled}" >
<instr instrpathref="run.classpath" destdir="${out.instr.dir}" metadatafile="${coverage.dir}/coverage.emma" merge="true">
<filter excludes="*Test*"/>
</instr>
</emma>
</target>
<target name="run" depends="jar">
<java classpathref="classpath.test" classname="MainArea" fork="true"/>
</target>
<target name="junit" depends="run">
<junit fork="true" haltonfailure="false" printsummary="yes" failureproperty="test.failed">
<classpath refid="classpath.test"/>
<classpath>
<pathelement location="${basedir}/src" />
<pathelement location="${out.instr.dir}" />
<pathelement location="C:\Program Files\Java\jre7\lib\ext\junit-4.10.jar" />
<pathelement location="C:\Program Files\Java\jre7\lib\ext\emma-2.0.5312.jar" />
<pathelement location="C:\Program Files\Java\jre7\lib\ext\emma_ant-2.0.5312.jar" />
</classpath>
<formatter type="brief" usefile="false"/>
<formatter type="xml"/>
<batchtest todir=".">
<fileset dir="./workspace">
<include name = "MainAreaTest.java"/>
</fileset>
</batchtest>
<jvmarg value="-Demma.coverage.out.file=${coverage.dir}/coverage.emma"/>
<jvmarg value="-Demma.coverage.out.merge=true"/>
</junit>
</target>
<target name="emma.report" depends="junit">
<emma enabled="${emma.enabled}" verbosity="verbose">
<report sourcepath="./workspace" >
<fileset dir="${coverage.dir}" >
<include name="*.emma" />
</fileset>
<txt outfile="${coverage.dir}/coverage.txt"/>
<html outfile="${coverage.dir}/coverage.html"/>
<xml outfile="${coverage.dir}/coverage.xml"/>
</report>
</emma>
</target>
</project>
I got output like this....
compile:
[javac] Compiling 5 source files to C:\Users\.hudson\jobs\Code_Coverage\out
[instr] processing instrumentation path ...
[instr] instrumentation path processed in 78 ms
[instr] [7 class(es) instrumented, 0 resource(s) copied]
[instr] metadata merged into [C:\Users\.hudson\jobs\Code_Coverage\coverage\coverage.emma] {in 0 ms}
emma.report:
[echo] emma
[report] [EMMA v2.0, build 5312 (2005/06/12 19:32:43)]
[report] input data path:
[report] {
[report] C:\Users\.hudson\jobs\Code_Coverage\coverage\coverage.emma
[report] }
[report] source path:
[report] {
[report] C:\Users\.hudson\jobs\Code_Coverage\workspace
[report] }
[report] processing input file [C:\Users\.hudson\jobs\Code_Coverage\coverage\coverage.emma] ...
[report] loaded 7 metadata entries
[report] 1 file(s) read and merged in 0 ms
[report] nothing to do: no runtime coverage data found in any of the data files

You also need to include the .ec file to generate your report.
<emma enabled="${emma.enabled}" verbosity="verbose">
<report sourcepath="./workspace" >
<fileset dir="${coverage.dir}" >
<include name="*.emma" />
<include name="*.ec" />
</fileset>
<txt outfile="${coverage.dir}/coverage.txt"/>
<html outfile="${coverage.dir}/coverage.html"/>
<xml outfile="${coverage.dir}/coverage.xml"/>
</report>

Related

Jacoco coverage with Ant throws java.lang.instrument.IllegalClassFormatException: Error while instrumenting class

I integrated Jacoco with my Ant build. When I run the build, the test case is executed successfully followed by the below exception in my TEST-com.worker.ManagerTest.xml.
When I add excludes="*" the error is not thrown. But the jacoco.exec is generated with 1kb size and when I run the report nothing is generated. Can someone let me know what am I missing?
Exception:
<![CDATA[java.lang.instrument.IllegalClassFormatException: Error while instrumenting class com/dataaccess/GenericDao.
at org.jacoco.agent.rt_6qyg3i.CoverageTransformer.transform(CoverageTransformer.java:69)
Below is the jacoco build script.
<target name="test" depends="test-compile">
<mkdir dir="${report.dir}" />
<jacoco:coverage destfile="${report.dir}/jacoco.exec" xmlns:jacoco="antlib:org.jacoco.ant" exclclassloader="sun.reflect.DelegatingClassLoader:javassist.Loader">
<junit fork="true" forkmode="once" printsummary="on">
<classpath>
<!--<pathelement location="${basedir}/../../../build/lib/aspectjtools.jar"/>
<pathelement location="${basedir}/../../../build/lib/aspectjrt.jar"/>-->
<pathelement path="${test.path}" />
<pathelement path="${dist.dir}/test/unittest-manager.jar" />
</classpath>
<formatter type="xml" />
<batchtest todir="${report.dir}" fork="yes">
<fileset dir="test">
<include name="**/*Test*" />
</fileset>
</batchtest>
</junit>
</jacoco:coverage>
</target>
<target name="report" depends="test">
<echo message="Generating Jacoco reports..." />
<property name="report.dir.file" value="${report.dir}/jacoco.exec"/>
<jacoco:report>
<executiondata>
<file file="${report.dir.file}"/>
</executiondata>
<structure name="JaCoCo Reports">
<classfiles>
<fileset dir="${dist.dir}/applications/lib/manager.jar">
<include name="**/*.class"/>
</fileset>
</classfiles>
<sourcefiles encoding="UTF-8">
<fileset dir="${src.dir}">
<include name="**/*.java"/>
</fileset>
</sourcefiles>
</structure>
<html destdir="${report.dir}/coverage"/>
</jacoco:report>
</target>
This is the empty report I get.
Regards,
Sat
I used the latest version 0.8.7 and it worked.

BUILD FAILED and didn't generate report when executing junit test cases through ANT

I am trying to use ant to run junit tests and generate reports. Its give the error "BUILD FAILED" and didn't generate the report. the junit report folder is empty.
What am I doing wrong ?
This is my build.xml :
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- WARNING: Eclipse auto-generated file.
Any modifications will be overwritten.
To include a user specific buildfile here, simply create one in the same
directory with the processing instruction <?eclipse.ant.import?>
as the first entry and export the buildfile again. --><project basedir="." default="build" name="SeleniumProject">
<property environment="env"/>
<property name="ECLIPSE_HOME" value="../../../../eclipse-jee-indigo-SR2-win32-x86_64/eclipse"/>
<property name="junit.output.dir" value="junit"/>
<property name="debuglevel" value="source,lines,vars"/>
<property name="target" value="1.7"/>
<property name="source" value="1.7"/>
<path id="JUnit 4.libraryclasspath">
<pathelement location="${ECLIPSE_HOME}/plugins/org.junit_4.8.2.v4_8_2_v20110321-1705/junit.jar"/>
<pathelement location="${ECLIPSE_HOME}/plugins/org.hamcrest.core_1.1.0.v20090501071000.jar"/>
</path>
<path id="SeleniumProject.classpath">
<pathelement location="bin"/>
<path refid="JUnit 4.libraryclasspath"/>
<pathelement location="../../../../selenium-java-2.41.0/selenium-2.41.0/selenium-java-2.41.0.jar"/>
<pathelement location="../../../../selenium-java-2.41.0/selenium-2.41.0/selenium-java-2.41.0-srcs.jar"/>
<pathelement location="../../../../selenium-java-2.41.0/selenium-2.41.0/selenium-server-standalone-2.41.0.jar"/>
<pathelement location="../../../../selenium-java-2.41.0/selenium-2.41.0/libs/apache-mime4j-0.6.jar"/>
<pathelement location="../../../../selenium-java-2.41.0/selenium-2.41.0/libs/bsh-1.3.0.jar"/>
<pathelement location="../../../../selenium-java-2.41.0/selenium-2.41.0/libs/cglib-nodep-2.1_3.jar"/>
<pathelement location="../../../../selenium-java-2.41.0/selenium-2.41.0/libs/commons-codec-1.8.jar"/>
<pathelement location="../../../../selenium-java-2.41.0/selenium-2.41.0/libs/commons-collections-3.2.1.jar"/>
<pathelement location="../../../../selenium-java-2.41.0/selenium-2.41.0/libs/commons-exec-1.1.jar"/>
<pathelement location="../../../../selenium-java-2.41.0/selenium-2.41.0/libs/commons-io-2.2.jar"/>
<pathelement location="../../../../selenium-java-2.41.0/selenium-2.41.0/libs/commons-jxpath-1.3.jar"/>
<pathelement location="../../../../selenium-java-2.41.0/selenium-2.41.0/libs/commons-lang3-3.1.jar"/>
<pathelement location="../../../../selenium-java-2.41.0/selenium-2.41.0/libs/commons-logging-1.1.1.jar"/>
<pathelement location="../../../../selenium-java-2.41.0/selenium-2.41.0/libs/cssparser-0.9.11.jar"/>
<pathelement location="../../../../selenium-java-2.41.0/selenium-2.41.0/libs/guava-15.0.jar"/>
<pathelement location="../../../../selenium-java-2.41.0/selenium-2.41.0/libs/hamcrest-core-1.3.jar"/>
<pathelement location="../../../../selenium-java-2.41.0/selenium-2.41.0/libs/hamcrest-library-1.3.jar"/>
<pathelement location="../../../../selenium-java-2.41.0/selenium-2.41.0/libs/htmlunit-2.13.jar"/>
<pathelement location="../../../../selenium-java-2.41.0/selenium-2.41.0/libs/htmlunit-core-js-2.13.jar"/>
<pathelement location="../../../../selenium-java-2.41.0/selenium-2.41.0/libs/httpclient-4.3.1.jar"/>
<pathelement location="../../../../selenium-java-2.41.0/selenium-2.41.0/libs/httpcore-4.3.jar"/>
<pathelement location="../../../../selenium-java-2.41.0/selenium-2.41.0/libs/httpmime-4.3.1.jar"/>
<pathelement location="../../../../selenium-java-2.41.0/selenium-2.41.0/libs/ini4j-0.5.2.jar"/>
<pathelement location="../../../../selenium-java-2.41.0/selenium-2.41.0/libs/jcommander-1.29.jar"/>
<pathelement location="../../../../selenium-java-2.41.0/selenium-2.41.0/libs/jetty-websocket-8.1.8.jar"/>
<pathelement location="../../../../selenium-java-2.41.0/selenium-2.41.0/libs/jna-3.4.0.jar"/>
<pathelement location="../../../../selenium-java-2.41.0/selenium-2.41.0/libs/jna-platform-3.4.0.jar"/>
<pathelement location="../../../../selenium-java-2.41.0/selenium-2.41.0/libs/json-20080701.jar"/>
<pathelement location="../../../../selenium-java-2.41.0/selenium-2.41.0/libs/junit-dep-4.11.jar"/>
<pathelement location="../../../../selenium-java-2.41.0/selenium-2.41.0/libs/nekohtml-1.9.19.jar"/>
<pathelement location="../../../../selenium-java-2.41.0/selenium-2.41.0/libs/netty-3.5.7.Final.jar"/>
<pathelement location="../../../../selenium-java-2.41.0/selenium-2.41.0/libs/operadriver-1.5.jar"/>
<pathelement location="../../../../selenium-java-2.41.0/selenium-2.41.0/libs/phantomjsdriver-1.1.0.jar"/>
<pathelement location="../../../../selenium-java-2.41.0/selenium-2.41.0/libs/protobuf-java-2.4.1.jar"/>
<pathelement location="../../../../selenium-java-2.41.0/selenium-2.41.0/libs/sac-1.3.jar"/>
<pathelement location="../../../../selenium-java-2.41.0/selenium-2.41.0/libs/serializer-2.7.1.jar"/>
<pathelement location="../../../../selenium-java-2.41.0/selenium-2.41.0/libs/testng-6.8.5.jar"/>
<pathelement location="../../../../selenium-java-2.41.0/selenium-2.41.0/libs/xalan-2.7.1.jar"/>
<pathelement location="../../../../selenium-java-2.41.0/selenium-2.41.0/libs/xercesImpl-2.10.0.jar"/>
<pathelement location="../../../../selenium-java-2.41.0/selenium-2.41.0/libs/xml-apis-1.4.01.jar"/>
</path>
<target name="init">
<mkdir dir="bin"/>
<copy includeemptydirs="false" todir="bin">
<fileset dir="src">
<exclude name="**/*.launch"/>
<exclude name="**/*.java"/>
</fileset>
</copy>
</target>
<target name="clean">
<delete dir="bin"/>
</target>
<target depends="clean" name="cleanall"/>
<target depends="build-subprojects,build-project" name="build"/>
<target name="build-subprojects"/>
<target depends="init" name="build-project">
<echo message="${ant.project.name}: ${ant.file}"/>
<javac debug="true" debuglevel="${debuglevel}" destdir="bin" source="${source}" target="${target}">
<src path="src"/>
<classpath refid="SeleniumProject.classpath"/>
</javac>
</target>
<target description="Build all projects which reference this project. Useful to propagate changes." name="build-refprojects"/>
<target description="copy Eclipse compiler jars to ant lib directory" name="init-eclipse-compiler">
<copy todir="${ant.library.dir}">
<fileset dir="${ECLIPSE_HOME}/plugins" includes="org.eclipse.jdt.core_*.jar"/>
</copy>
<unzip dest="${ant.library.dir}">
<patternset includes="jdtCompilerAdapter.jar"/>
<fileset dir="${ECLIPSE_HOME}/plugins" includes="org.eclipse.jdt.core_*.jar"/>
</unzip>
</target>
<target description="compile project with Eclipse compiler" name="build-eclipse-compiler">
<property name="build.compiler" value="org.eclipse.jdt.core.JDTCompilerAdapter"/>
<antcall target="build"/>
</target>
<target name="absolutexpath (1)">
<mkdir dir="${junit.output.dir}"/>
<junit fork="yes" printsummary="withOutAndErr">
<formatter type="xml"/>
<test name="absolutexpath" todir="${junit.output.dir}"/>
<classpath refid="SeleniumProject.classpath"/>
</junit>
</target>
<target name="dropdown">
<java classname="DropDown" failonerror="true" fork="yes">
<classpath refid="SeleniumProject.classpath"/>
</java>
</target>
<target name="relativexpath (1)">
<mkdir dir="${junit.output.dir}"/>
<junit fork="yes" printsummary="withOutAndErr">
<formatter type="xml"/>
<test name="relativexpath" todir="${junit.output.dir}"/>
<classpath refid="SeleniumProject.classpath"/>
</junit>
</target>
<target name="verifytextbycss">
<mkdir dir="${junit.output.dir}"/>
<junit fork="yes" printsummary="withOutAndErr">
<formatter type="xml"/>
<test name="Verifytextbycss" todir="${junit.output.dir}"/>
<classpath refid="SeleniumProject.classpath"/>
</junit>
</target>
<target name="Verifytextbyid (1)">
<mkdir dir="${junit.output.dir}"/>
<junit fork="yes" printsummary="withOutAndErr">
<formatter type="xml"/>
<test name="Verifytextbyid" todir="${junit.output.dir}"/>
<classpath refid="SeleniumProject.classpath"/>
</junit>
</target>
<target name="verifytitle (1)">
<mkdir dir="${junit.output.dir}"/>
<junit fork="yes" printsummary="withOutAndErr">
<formatter type="xml"/>
<test name="verifytitle" todir="${junit.output.dir}"/>
<classpath refid="SeleniumProject.classpath"/>
</junit>
</target>
<target name="junitreport">
<junitreport todir="${junit.output.dir}">
<fileset dir="${junit.output.dir}">
<include name="TEST-*.xml"/>
</fileset>
<report format="frames" todir="${junit.output.dir}"/>
</junitreport>
</target>
AND THIS IS THE OUTPUT OF THE CONSOLE:
Buildfile: C:\Users\Roshan\workspace\SeleniumProject\build.xml
build-subprojects:
init:
build-project:
[echo] SeleniumProject: C:\Users\Roshan\workspace\SeleniumProject\build.xml
[javac] C:\Users\Roshan\workspace\SeleniumProject\build.xml:78: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
build:
junitreport:
[junitreport] Processing C:\Users\Roshan\workspace\SeleniumProject\junit\TESTS-TestSuites.xml to C:\Windows\null231041511
[junitreport] Loading stylesheet jar:file:/C:/apache-ant-1.9.4-bin/apache-ant-1.9.4/lib/ant-junit.jar!/org/apache/tools/ant/taskdefs/optional/junit/xsl/junit-frames.xsl
[junitreport] Failed to process C:\Users\Roshan\workspace\SeleniumProject\junit\TESTS-TestSuites.xml
BUILD FAILED
C:\Users\Roshan\workspace\SeleniumProject\build.xml:143: Errors while applying transformations: java.io.FileNotFoundException: C:\Windows\null231041511 (Access is denied)
Total time: 942 milliseconds
The Junit tests are run in the absolutexpath and relativexpath targets. i don't see either of those in "depends" attributes. Your output implies they aren't run either.
Also, you get the message:
C:\Windows\null231041511 (Access is denied)
Can you point to a directory that you have read and write access to like c:\temp?

Groovy-TestNG-Ant running error

I've faced with next problem.
Trying to create pilot test-project using Groovy, TestNG, ant.
If I run tests from my IDE (Eclipse) - all is ok.
But when I try run tests using ant - not easy for me problem. Could you help me?
build.xml is present below.
Compile target - pass ok, but on runTest target I see problem:
"Exception in thread "main" java.lang.NoClassDefFoundError: groovy/lang/GroovyObject"
<project basedir="." default="runTest" name="Ant file for TestNG">
<property name="src" location="src" />
<property name="build" location="build" />
<property name="libs" location="lib" />
<path id="class.path">
<pathelement location="${libs}/testng.jar" />
<pathelement location="lib/testng.jar"/>
<pathelement location="${build}" />
</path>
<taskdef name="testng" classname="org.testng.TestNGAntTask">
<classpath>
<pathelement location="lib/groovy-all.jar"/>
<pathelement location="lib/testng.jar"/>
</classpath>
</taskdef>
<target name="runTest" depends="compile">
<mkdir dir="testng_output"/><!-- Create the output directory. -->
<testng outputdir="testng_output" classpathref="class.path">
<xmlfileset dir="." includes="testng.xml"/>
</testng>
</target>
<target name="compile">
<delete dir="build"/>
<mkdir dir="build"/>
<taskdef name="groovyc" classname="org.codehaus.groovy.ant.Groovyc" classpath="lib/groovy-all.jar"/>
<groovyc srcdir="src" destdir="./build">
<classpath>
<pathelement path="lib/groovy-all.jar"/>
<pathelement path="lib/testng.jar"/>
</classpath>
<javac source="1.7" target="1.7" debug="off" />
</groovyc>
</target>
</project>
And this is testng.xml
<suite name="My Test Suite" parallel="methods" thread-count="5">
<test name="My Test">
<classes>
<class name="test1" />
</classes>
</test>
</suite>

having several directories for libs in ant

How can I show Ant that libraries exist in two different directories?
Right now I have
<property name="lib" value="C:/apache-ant-1.8.4/lib" />
<target name="compile" depends="init">
<javac source="1.6" srcdir="${src}" fork="true" destdir="${bin}" encoding="UTF-8" >
<classpath>
<pathelement path="${bin}">
</pathelement>
<fileset dir="${lib}">
<include name="**/*.jar" />
</fileset>
</classpath>
</javac>
</target>
It's fine if I copy all the libs to the ant \lib folder. How can I show Ant that there are two directories with libraries?
Just add another fileset:
<property name="lib" value="C:/apache-ant-1.8.4/lib" />
<property name="otherLib" value="C:/somePath/lib" />
<target name="compile" depends="init">
<javac source="1.6" srcdir="${src}" fork="true" destdir="${bin}" encoding="UTF-8" >
<classpath>
<pathelement path="${bin}" />
<fileset dir="${lib}">
<include name="**/*.jar" />
</fileset>
<fileset dir="${otherLib}">
<include name="**/*.jar" />
</fileset>
</classpath>
</javac>
</target>

Ant is not recognizing Log4j.properties file

I have been struck in this issue for past two days.Please help me in this. I am running my JUNIT scripts by using ANT. Reports are being generated, but ANT is not able to locate my log4j.properites file. When I am running through eclipse, logs are being generated. My problem here is I want logs when I am running through ANT.DO I need to set any properties.
What is the mistake I am doing?
Please help me.
My Log:
#Application Logs
#log4j.logger.devpinoyLogger
log4j.rootLogger=DEBUG, dest1
log4j.appender.dest1=org.apache.log4j.RollingFileAppender
log4j.appender.dest1.maxFileSize=5000KB
log4j.appender.dest1.maxBackupIndex=3
log4j.appender.dest1.layout=org.apache.log4j.PatternLayout
log4j.appender.dest1.layout.ConversionPattern=%d{dd/MM/yyyy HH:mm:ss} %c %m%n
log4j.appender.dest1.File=/Users/Application.log
#do not append the old file. Create a new log file everytime
log4j.appender.dest1.Append=false
build.xml
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE project [
]>
<project name="Module_Junit_Ant" default="usage" basedir=".">
<!-- ========== Initialize Properties =================================== -->
<property environment="env"/>
<property name="ws.home" value="${basedir}"/>
<property name="ws.jars" value="${ws.home}/jars"/>
<property name="test.dest" value="${ws.home}/build"/>
<property name="test.src" value="${ws.home}/src"/>
<property name="test.reportsDir" value="${ws.home}/reports"/>
<path id="testcase.path">
<pathelement location="${test.dest}"/>
<fileset dir="${ws.jars}">
<include name="*.jar"/>
</fileset>
</path>
<!--target name="start-selenium-server">
<java jar="${ws.home}/lib/selenium-server.jar"/>
</target-->
<target name="setClassPath" unless="test.classpath">
<path id="classpath_jars">
<fileset dir="${ws.jars}" includes="*.jar"/>
<fileset dir="${test.src}" includes="*.properties"/>
</path>
<pathconvert pathsep=":"
property="test.classpath"
refid="classpath_jars"/>
</target>
<target name="init" depends="setClassPath">
<tstamp>
<format property="start.time" pattern="MM/dd/yyyy hh:mm aa" />
</tstamp>
<condition property="ANT"
value="${env.ANT_HOME}/bin/ant.bat"
else="${env.ANT_HOME}/bin/ant">
<os family="windows" />
</condition>
</target>
<!-- all -->
<target name="all">
</target>
<!-- clean -->
<target name="clean">
<delete dir="${test.dest}"/>
</target>
<!-- compile -->
<target name="compile" depends="init, clean" >
<delete includeemptydirs="true" quiet="true">
<fileset dir="${test.dest}" includes="**/*"/>
</delete>
<echo message="making directory..."/>
<mkdir dir="${test.dest}"/>
<echo message="classpath------: ${test.classpath}"/>
<echo message="compiling..."/>
<javac
debug="true"
destdir="${test.dest}"
srcdir="${test.src}"
target="1.5"
classpath="${test.classpath}"
>
</javac>
</target>
<!-- build -->
<target name="build" depends="init">
</target>
<target name="usage">
<echo>
ant run will execute the test
</echo>
</target>
<path id="test.c">
<fileset dir="${ws.jars}" includes="*.jar"/>
</path>
<target name="run" >
<delete includeemptydirs="true" quiet="true">
<fileset dir="${test.reportsDir}" includes="**/*"/>
</delete>
<java jar="${ws.jars}" fork="true" spawn="true" />
<junit fork="yes" haltonfailure="no" printsummary="yes">
<classpath refid="testcase.path" />
<!-- <classpath ="${test.classpath}"/> -->
<batchtest todir="${test.reportsDir}" fork="true">
<fileset dir="${test.dest}">
<include name="LogTest.class" />
<!--include name="tests/suite1/FirstSuiteRunner.class" />
<include name="tests/suite1/FirstSuiteRunner.class" /-->
</fileset>
</batchtest>
<formatter type="xml" />
<classpath refid="testcase.path" />
</junit>
<junitreport todir="${test.reportsDir}">
<fileset dir="${test.reportsDir}">
<include name="TEST-*.xml" />
</fileset>
<report todir="${test.reportsDir}" />
</junitreport>
</target>
<target name="email" >
<java classname="util.SendMail" classpath="${test.dest}" classpathref="testcase.path" />
</target>
</project>
Where are your log4j.properties located ?
What works for me it to put a
< pathelement location="x/y/z"/>
inside the
< path id="testcase.path">
which points to a folder which contains a log4j.properties!
So in this example your log4j.properties should be inside the 'z' folder!

Resources