Hi,

when you open the HTML report:

1) Are your packages and classes listed (even with 0% coverage) or is the report empty? 2) Click on the "Sessions" link on the top right. Are your classes under test listed? Do they have links?

In case of 0% coverage you'll find some background information here: http://www.eclemma.org/jacoco/trunk/doc/classids.html

Regards,
-marc

On 12.03.15 09:55, Krishantha Samaraweera wrote:
Hi Marc,

Thanks for your prompt reply.

I'm trying to use ant task as below by giving path to server side jar files directory. However jacoco doesn't generate the coverage report correctly. The generated xml report has zero coverage data. Note that jacoco.exec file is not empty and its size is around 414K. Let me know whether my jacoco-report ant task is valid ? do I need to point valid project structure name here for "structure name". Since I'm trying to generate server side code coverage my project has only test classes to call server side APIs.

<jacoco-report>
        <executiondata>
            <file file="${project.basedir}/target/jacoco.exec"/>
        </executiondata>
        <structure name="Minerva">
            <classfiles>
            <fileset dir="/path/to/jar/directory/in/my/extracted/server/">
                <include name="**/*.jar"/>
            </fileset>
            </classfiles>
        </structure>
        <html destdir="${project.basedir}/target/jacoco/report"/>
<xml destfile="${project.basedir}/target/jacoco/report/jacoco.xml"/>
    </jacoco-report>


Your feedback really appreciated.

Thanks,
Krishantha.

On Tue, Mar 10, 2015 at 9:05 PM, Marc R. Hoffmann <[email protected] <mailto:[email protected]>> wrote:

    Where do you "extract all JAR files" from?

    Note that by default the JaCoCo reporting Ant task or Maven goal
    will recursively search EAR/WAR/JAR files for class files.

    Regards,
    -marc


    On 10.03.15 11:17, [email protected]
    <mailto:[email protected]> wrote:

        Hi all,

        Can I use Jacoco for jar instrumentation without using Maven
        or ant tasks provided.

        I know that adding agent jar as JVM option to my server
        startup script will generate jcoco.exec file. However as per
        the documentation, to generate coverage report, I need to
        point class files. Since I don't have source files or class
        files, only option left is to extract all jar files and put
        class files to temp directory, and point them at report
        generation. Is there any better alternative for this ?

        Thanks,
        Krishantha.


--
You received this message because you are subscribed to the Google Groups "JaCoCo 
and EclEmma Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jacoco/5501EADE.30901%40mountainminds.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to