I'm using Jacoco code coverage in my Ant build and build is success after using instrument for my junit classes as they have powermockito in it.
I'm getting errors in the junit classes when i ran through the ant and tests failed but build success.
I'm comipiling the src and test classes using WAS server jars from another build.xml and placed the class files in the dir.build folder. This folder is given as input for the instrument task to give me the instrumented classes. When the junit task is started it is saying that errors occured in the test classes and test failed. I used the printsummary ="on" and tried to generate logs using verbose.
I want to know what are the errors occuring while running the junit. Can somebody please tell me how can i see the errors in the Test classes.
<?xml version="1.0" encoding="UTF-8"?>
<project name = "JunitIntegration" default = "report" xmlns:jacoco="antlib:org.jacoco.ant">
    <taskdef uri="antlib:org.jacoco.ant" resource="org/jacoco/ant/antlib.xml">
        <classpath path="./ant/lib/jacocoant.jar"/>
    </taskdef>
    <property name= "project.name" value = "Services"/>
    <property name= "source.dir" value = "C:\\Thejesh\\Workspaces\\firstSetup\\Services"/>
    <property name= "dir.build" value = "C:\\Thejesh\\Workspaces\\edpm_firstSetup\\build\\Services-classes"/>
    <!-- Code coverage report -->
    <property name= "result.dir" value = "C:\\Thejesh\\Workspaces\\edpm_firstSetup\\junitResults"/>
    <property name= "result.classes.instr.dir" value = "${result.dir}/classes-instr"/>
    <property name= "result.report.dir" value = "${result.dir}/site/jacoco"/>
    <property name= "result.exec.file" value = "${result.dir}/jacoco.exec"/>
    <import file="build-utils.xml"/>    
    <target name ="cleanL">
        <delete dir ="${result.dir}"/>
    </target>
    <target name ="createL">
        <mkdir dir ="${result.dir}"/>
        <mkdir dir ="${result.classes.instr.dir}"/>
    </target>
    <target name ="instrument" depends = "cleanL, createL">
        <jacoco:instrument destdir="${result.classes.instr.dir}">
            <fileset dir="${dir.build}"/>
        </jacoco:instrument>
    </target>
    <target name ="test" depends = "instrument">
        <record name="${result.dir}/loggerinfo.log" loglevel="verbose" action="start"/>
        <jacoco:coverage destfile="${result.exec.file}" xmlns:jacoco="antlib:org.jacoco.ant"
            exclclassloader = "sun.reflect.DelegatingClassLoader">
            <junit fork="true" forkmode="once" printsummary="on">
                <formatter type= "xml"/>
                <classpath>
                    <pathelement path="${dir.build}" />
                    <pathelement path="./ant/lib/jacocoagent.jar" />
                    <fileset dir ="C:\\Thejesh\\PIF\\Jars\\Common">
                        <include name ="*.jar*" />
                    </fileset>
                </classpath> 
                <batchtest todir ="${result.dir}">
                    <fileset dir= "${result.classes.instr.dir}">
                        <include name ="**/*Test.class*"/>
                    </fileset>
                </batchtest>
            </junit>
        </jacoco:coverage>
        <record name="${result.dir}/loggerinfo.log" loglevel="verbose" action="stop"/>
    </target>
    <!-- Generating code coverage reports -->
    <target name ="report" depends ="test">
        <jacoco:report>
            <executiondata>
                <file file="${result.exec.file}"/>
            </executiondata>
            <structure name="JUnit intergration report">
                <classfiles>
                    <fileset dir="${dir.build}"/>
                </classfiles>
                <sourcefiles encoding="UTF-8">
                    <fileset dir="${source.dir}"/>
                </sourcefiles>
            </structure>
            <html destdir="${result.report.dir}"/>
            <xml destfile ="${result.report.dir}/report.xml"/>
        </jacoco:report>
    </target>
    <target name ="compiler" >
        <junit.compile
            projectdir="${source.dir}"
            destfile="${dir.build}"
        />
    </target>
</project>