Get code coverage when integration testing performed on application.

39 views
Skip to first unread message

nag....@gmail.com

unread,
Aug 14, 2020, 9:37:47 AM8/14/20
to JaCoCo and EclEmma Users
Hi,
We have a desktop application where we will not be able to write junints for complete application due to the architecture ( pretty old application). With the limited Junints we could see only 30% code coverage. Our idea is to know code coverage by running the application. It means we will perform some manual testing and at the end of the testing we would like to know the code coverage. This way, we will try to get the coverage details without the Junints. I am little knew to this area. Can anyone help me please? Additional information is that we are using ant to make the build. We are not using maven.

Thanks
Nagaraju

Marc Hoffmann

unread,
Aug 14, 2020, 9:56:05 AM8/14/20
to jac...@googlegroups.com
Hi Nagaraju,

the JaCoCo agent can collect execution data for any Java application, also manually tested desktop applications. All you need to do is to configure the JaCoCo agent for the JVM running your application. See documentation: https://www.jacoco.org/jacoco/trunk/doc/agent.html

When the application terminates a *.exec files is written. You can use Ant to create a report from it as you do it today.

Regards,
-marc




--
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 jacoco+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jacoco/338b6c8a-d5ab-4191-ad26-f60d263e6eeeo%40googlegroups.com.

nag....@gmail.com

unread,
Aug 14, 2020, 12:40:53 PM8/14/20
to JaCoCo and EclEmma Users
Hi Mark,
Thank you so much. Can I request you to provide you the command that I can use in batch file to run jacoco on test.jar file.

Regards
Nagaraju

Evgeny Mandrikov

unread,
Aug 15, 2020, 1:52:29 AM8/15/20
to JaCoCo and EclEmma Users

nag....@gmail.com

unread,
Aug 17, 2020, 5:37:22 AM8/17/20
to JaCoCo and EclEmma Users
Hi, 
    I tried the following command but it did not return anything related to coverage. Can you please suggest if I am doing anything wrong?

java -jar test.jar -javaagent:C:/jacoco-0.8.5/lib/jacocoagent.jar=output=file


Thanks
Nagaraju

On Saturday, 15 August 2020 11:22:29 UTC+5:30, Evgeny Mandrikov wrote:

nag....@gmail.com

unread,
Aug 17, 2020, 6:33:05 AM8/17/20
to JaCoCo and EclEmma Users
Hi, 
    I am able to generate the report. Thanks. 

Issue was the order of javaagent in the command.

Regards
Nagaraju
Reply all
Reply to author
Forward
0 new messages