Can i use jacoco for web application...if can...?please tell me the steps

93 views
Skip to first unread message

Alex Revanth

unread,
Sep 13, 2018, 5:53:07 AM9/13/18
to JaCoCo and EclEmma Users
i am searching to code coverage for my web application written in java.I need to do the coverage by running my application. Is it possible...?by using jacoco with ant..?

Marc Hoffmann

unread,
Sep 14, 2018, 6:31:41 AM9/14/18
to jac...@googlegroups.com

You can create code coverage for any program with runs on a JVM.

See our Ant documentation how to run Java programs with JaCoCo:

https://www.jacoco.org/jacoco/trunk/doc/ant.html


Cheers,
-marc




On 2018-09-13 11:53, Alex Revanth wrote:

i am searching to code coverage for my web application written in java.I need to do the coverage by running my application. Is it possible...?by using jacoco with ant..?


--
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/30cb01fa-9073-42f8-9456-a38e9d417a04%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Message has been deleted

alexrev...@gmail.com

unread,
Sep 17, 2018, 9:51:46 AM9/17/18
to JaCoCo and EclEmma Users
Thank you sir,..i used java agent in my tomcat server to coverage my code by starting the tomcat but....in that can i start and stop the coverage whenever i needed is there any way to do it ...?

Marc Hoffmann

unread,
Sep 18, 2018, 1:29:06 AM9/18/18
to jac...@googlegroups.com
You can either enable JaCoCo’s JMX interface or use a remote output mode like tcp server. See documentation:


Both allow collecting execution data at any point in time. Also the coverage status can be reset.

Regards,
-marc


alexrev...@gmail.com

unread,
Sep 18, 2018, 4:19:23 AM9/18/18
to JaCoCo and EclEmma Users
Thank you sir..
But when we need to use tcp server and tcp client....?can you explain me....?

alexrev...@gmail.com

unread,
Sep 19, 2018, 9:24:09 AM9/19/18
to JaCoCo and EclEmma Users
is there any way to start the java agent listening to start code coverage in the middle of the running server and to stop ....?

And how the coverage executes inside the server....?does..it makes more memory...to take the coverage...?and what is the working process of the jacoco agent in the tomcat server,....?can you explain this...? I am struggling a lot..of how it is working...

Henrik Horneber

unread,
Sep 19, 2018, 12:59:05 PM9/19/18
to jac...@googlegroups.com
The agent starts together with the vm and will collect coverage from then on while the vm is running. 

You can tell the agent to reset collected coverage while it's running though. In other words, a workable approach is to start the server if not running, deploy your application if not yet deployed--then reset the agent, run your tests and then ask the agent for coverage info. 

Coverage info will consume some memory obviously. 

Your additional questions go too deep into the internals for me to answer. 

Basically all information given here is also covered by the documentation. 

alexrev...@gmail.com

unread,
Sep 20, 2018, 1:03:51 AM9/20/18
to JaCoCo and EclEmma Users
Thank you Henrik,

But i need to know how this works and how the coverage works because i am going to add the agent too my tomcat server ....I doesn't to get coverage all the time,I get whenever i needed so if i added the agent to my server ,it runs always to get the coverage this will makes an unwanted memory or unwanted server running in the server....is there any way to solve this problem....?
For this problem i need to know how it works and how much of memory does it takes to run the process of coverage..?
Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages