How to set up jacoco for QA testing

2,812 views
Skip to first unread message

kanc...@gmail.com

unread,
Mar 22, 2013, 11:38:28 AM3/22/13
to jac...@googlegroups.com
Hi,

I'm trying to understand the steps to set up an run jacoco in my loca to let the QA to run Jacoco

I'm following the following documentation for it whichI got with the distribution.

C:\..\jacoco\jacoco-0.6.3-20130301.191522-6\doc\build.html

I can't find the following dicrectory in the distribution I downloaded. It's a binary distribution.
./org.jacoco.build/

appreciate you help to figure out to set up this in my local

cheers
Kanchana

Marc R. Hoffmann

unread,
Mar 22, 2013, 1:22:34 PM3/22/13
to jac...@googlegroups.com
Hi Kanchana,

unless you want to hack on JaCoCo itself you can ignore this chapter. If
you want to *use* JaCoCo you should focus on the chapters "Using JaCoCo"
from the TOC (http://www.eclemma.org/jacoco/trunk/doc/).

Best regards,
-marc

kanc...@gmail.com

unread,
Mar 26, 2013, 1:20:53 PM3/26/13
to jac...@googlegroups.com
On Friday, March 22, 2013 1:22:34 PM UTC-4, Marc R. Hoffmann wrote:
> Hi Kanchana, unless you want to hack on JaCoCo itself you can ignore this chapter. If you want to *use* JaCoCo you should focus on the chapters "Using JaCoCo" from the TOC (http://www.eclemma.org/jacoco/trunk/doc/). Best regards, -marc On 22.03.13 16:38, kanc...@gmail.com wrote: > Hi, > > I'm trying to understand the steps to set up an run jacoco in my loca to let the QA to run Jacoco > > I'm following the following documentation for it whichI got with the distribution. > > C:\..\jacoco\jacoco-0.6.3-20130301.191522-6\doc\build.html > > I can't find the following dicrectory in the distribution I downloaded. It's a binary distribution. > ./org.jacoco.build/ > > appreciate you help to figure out to set up this in my local > > cheers > Kanchana >

Hi Marc
Appreciate your you input.
I got done the work. I will contribute to the project on some documentation just like a quick start and share with you.

As I have stated I could sucessfully generate reports for examples given. Now I have better idea of jacoco and how it works.
Now I'm trying to configure the weblogic to generate reports for the applicaition I have hosted in weblogic using jacoco agent.In that caseI have modified the weblogic startupconfig as follows.

set JAVA_OPTION = -javaagent:/prd/products/jacoco/latest/jacocoagent.jar=output=tcpserver,port=8010,includes=<weblogic>web_inf\com.*,address=*

includes=<weblogic>web_inf\com.* are my classes files copied in the weblogic
The server up and runs.
Where should I see the generated reports and how ?Appreciate your input
cheers
Kanchana

Marc Hoffmann

unread,
Mar 26, 2013, 1:29:10 PM3/26/13
to jac...@googlegroups.com
Hi Kanchana,

1) Agent configuration: Probably there is an error with the includes
attribute. It describes the class name, not the location, e.g.
includes=com.yourcompany.*
2) Exec Dump: If you run run the agent in tcpserver mode, it will not
create exec dumps on its own. You will need a client to connect to it
and retrieve the date. We have an Ant task for this, see documentation:
http://www.eclemma.org/jacoco/trunk/doc/ant.html#dump
3) The report is generated afterwards from the exec file, the class
files and optionally source files. You can create the report with
another Ant task:
http://www.eclemma.org/jacoco/trunk/doc/ant.html#report

Best regards,
-marc

kanc...@gmail.com

unread,
Mar 26, 2013, 1:51:42 PM3/26/13
to jac...@googlegroups.com
On Tuesday, March 26, 2013 1:29:10 PM UTC-4, Marc R. Hoffmann wrote:
> Hi Kanchana, 1) Agent configuration: Probably there is an error with the includes attribute. It describes the class name, not the location, e.g. includes=com.yourcompany.*
I should try with class package names? with out the location?
So How the the JVM pics up classes so?

2) Exec Dump: If you run run the agent in tcpserver mode, it will not create exec dumps on its own. You will need a client to connect to it and retrieve the date. We have an Ant task for this, see documentation: http://www.eclemma.org/jacoco/trunk/doc/ant.html#dump

This is my understanding now. You need to have that set java_option in weblogic start up and it's required to have an ant file to dump the execution files?
So what is the path the ant file should be executing .. and when .. I don't understand how dose the weblogic(any application server )and the ant tasks are comunicating.

3) The report is generated afterwards from the exec file, the class files and optionally source files. You can create the report with another Ant task: http://www.eclemma.org/jacoco/trunk/doc/ant.html#report

So it's required to have ant taks running for if you configure an application server such as weblogic server in order to see the report ?How do we automate this ?My Understanding was that jacoco agent is independant from ant or maven build.
Appreciate your comments

Thanks
Kanchana

Marc Hoffmann

unread,
Mar 28, 2013, 8:14:22 AM3/28/13
to jac...@googlegroups.com
Hi,

the JaCoCo agent only transforms classes which are loaded by the JVM
through its regular class loading mechanisms. Therefore the agent does
not need to know the physical location of class files.

Do you have a specific requirements to use tcpserver moder for the
JaCoCo agent. If you simply stay with the default (file) the agent
writes execution data to disk as soon as the JVM terminates.

Best regards,
-marc

kanc...@gmail.com

unread,
Mar 28, 2013, 10:58:59 AM3/28/13
to jac...@googlegroups.com

Hi March,
I got done the configuration with jacoco host with web logic and
runing the client with ant tasks as generated reports.
Now my problem is how to use jacoco for QA funtional/ itegration testing and in side the engine how dose it work to repot statistics.

For example if a QA Test on Business scenario -1 in a up and run web application and follow the flow to test each function . How dose the JVM work to capture each testing and produce reports.

Appreciate you help.
If I come up with some docs where should I post it . Do you have a confulence ?

Cheers
Kanchana


On Thursday, March 28, 2013 8:14:22 AM UTC-4, Marc R. Hoffmann wrote:
> Hi, the JaCoCo agent only transforms classes which are loaded by the JVM through its regular class loading mechanisms. Therefore the agent does not need to know the physical location of class files. Do you have a specific requirements to use tcpserver moder for the JaCoCo agent. If you simply stay with the default (file) the agent writes execution data to disk as soon as the JVM terminates. Best regards, -marc On 2013-03-26 18:51, kanc...@gmail.com wrote: > On Tuesday, March 26, 2013 1:29:10 PM UTC-4, Marc R. Hoffmann wrote: >> Hi Kanchana, 1) Agent configuration: Probably there is an error with >> the includes attribute. It describes the class name, not the location, >> e.g. includes=com.yourcompany.* > I should try with class package names? with out the location? > So How the the JVM pics up classes so? > > 2) Exec Dump: If you run run the agent in tcpserver mode, it will not > create exec dumps on its own. You will need a client to connect to it > and retrieve the date. We have an Ant task for this, see > documentation: http://www.eclemma.org/jacoco/trunk/doc/ant.html#dump > > This is my understanding now. You need to have that set java_option > in weblogic start up and it's required to have an ant file to dump > the > execution files? > So what is the path the ant file should be executing .. and when .. I > don't understand how dose the weblogic(any application server )and > the > ant tasks are comunicating. > > 3) The report is generated afterwards from the exec file, the class > files and optionally source files. You can create the report with > another Ant task: > http://www.eclemma.org/jacoco/trunk/doc/ant.html#report > > So it's required to have ant taks running for if you configure an > application server such as weblogic server in order to see the report > ?How do we automate this ?My Understanding was that jacoco agent is > independant from ant or maven build. > Appreciate your comments > > Thanks > Kanchana > > > Best regards, -marc On 2013-03-26 18:20, kanc...@gmail.com wrote: > > On Friday, March 22, 2013 1:22:34 PM UTC-4, Marc R. Hoffmann wrote: > >> Hi Kanchana, unless you want to hack on JaCoCo itself you can > ignore >> this chapter. If you want to *use* JaCoCo you should focus > on the >> chapters "Using JaCoCo" from the TOC >> > (http://www.eclemma.org/jacoco/trunk/doc/). Best regards, -marc On >> > 22.03.13 16:38, kanc...@gmail.com wrote: > Hi, > > I'm trying to >> > understand the steps to set up an run jacoco in my loca to let the QA > >> to run Jacoco > > I'm following the following documentation for it > >> whichI got with the distribution. > > >> > C:\..\jacoco\jacoco-0.6.3-20130301.191522-6\doc\build.html > > I > can't > >> find the following dicrectory in the distribution I downloaded. > It's a >> binary distribution. > ./org.jacoco.build/ > > appreciate > you help to >> figure out to set up this in my local > > cheers > > Kanchana > > > Hi Marc > Appreciate your you input.
Hi

Marc Hoffmann

unread,
Mar 28, 2013, 11:35:23 AM3/28/13
to jac...@googlegroups.com
Hi Kanchana,

you need to trigger a execution data dump after each szenarion and
reset the execution data. There are two options for this:

1) Shutdown the appserver after each test scenario
2) Run the agent with output=tcpserver and request execution data e.g.
with an Ant script after each scenario.

With both setups you can dump a separate *.exec file for each scenario
and create a separate report.

We don't use confuence here, the dev infrastructure is based on github.
If you want to publish some documents there you can open a github
account and store the data a repository.

Best regards,
-marc

kanc...@gmail.com

unread,
Apr 3, 2013, 9:40:56 AM4/3/13
to jac...@googlegroups.com
On Thursday, March 28, 2013 11:35:23 AM UTC-4, Marc R. Hoffmann wrote:
> Hi Kanchana, you need to trigger a execution data dump after each szenarion and reset the execution data. There are two options for this: 1) Shutdown the appserver after each test scenario 2) Run the agent with output=tcpserver and request execution data e.g. with an Ant script after each scenario. With both setups you can dump a separate *.exec file for each scenario and create a separate report. We don't use confuence here, the dev infrastructure is based on github. If you want to publish some documents there you can open a github account and store the data a repository. Best regards, -marc On 2013-03-28 15:58, kanc...@gmail.com wrote: > Hi March, > I got done the configuration with jacoco host with web logic and > runing the client with ant tasks as generated reports. > Now my problem is how to use jacoco for QA funtional/ itegration > testing and in side the engine how dose it work to repot statistics. > > For example if a QA Test on Business scenario -1 in a up and run web > application and follow the flow to test each function . How dose the > JVM work to capture each testing and produce reports. > > Appreciate you help. > If I come up with some docs where should I post it . Do you have a > confulence ? > > Cheers > Kanchana > > > On Thursday, March 28, 2013 8:14:22 AM UTC-4, Marc R. Hoffmann wrote: >> Hi, the JaCoCo agent only transforms classes which are loaded by the >> JVM through its regular class loading mechanisms. Therefore the agent >> does not need to know the physical location of class files. Do you >> have a specific requirements to use tcpserver moder for the JaCoCo >> agent. If you simply stay with the default (file) the agent writes >> execution data to disk as soon as the JVM terminates. Best regards, >> -marc On 2013-03-26 18:51, kanc...@gmail.com wrote: > On Tuesday, >> March 26, 2013 1:29:10 PM UTC-4, Marc R. Hoffmann wrote: >> Hi >> Kanchana, 1) Agent configuration: Probably there is an error with >> >> the includes attribute. It describes the class name, not the location, >> >> e.g. includes=com.yourcompany.* > I should try with class package >> names? with out the location? > So How the the JVM pics up classes so? >> > > 2) Exec Dump: If you run run the agent in tcpserver mode, it will >> not > create exec dumps on its own. You will need a client to connect >> to it > and retrieve the date. We have an Ant task for this, see > >> documentation: http://www.eclemma.org/jacoco/trunk/doc/ant.html#dump > >> > This is my understanding now. You need to have that set java_option >> > in weblogic start up and it's required to have an ant file to dump > >> the > execution files? > So what is the path the ant file should be >> executing .. and when .. I > don't understand how dose the >> weblogic(any application server )and > the > ant tasks are >> comunicating. > > 3) The report is generated afterwards from the exec >> file, the class > files and optionally source files. You can create >> the report with > another Ant task: > >> http://www.eclemma.org/jacoco/trunk/doc/ant.html#report > > So it's >> required to have ant taks running for if you configure an > >> application server such as weblogic server in order to see the report >> > ?How do we automate this ?My Understanding was that jacoco agent is >> > independant from ant or maven build. > Appreciate your comments > > >> Thanks > Kanchana > > > Best regards, -marc On 2013-03-26 18:20, >> kanc...@gmail.com wrote: > > On Friday, March 22, 2013 1:22:34 PM >> UTC-4, Marc R. Hoffmann wrote: > >> Hi Kanchana, unless you want to >> hack on JaCoCo itself you can > ignore >> this chapter. If you want to >> *use* JaCoCo you should focus > on the >> chapters "Using JaCoCo" from >> the TOC >> > (http://www.eclemma.org/jacoco/trunk/doc/). Best regards, >> -marc On >> > 22.03.13 16:38, kanc...@gmail.com wrote: > Hi, > > I'm >> trying to >> > understand the steps to set up an run jacoco in my loca >> to let the QA > >> to run Jacoco > > I'm following the following >> documentation for it > >> whichI got with the distribution. > > >> > >> C:\..\jacoco\jacoco-0.6.3-20130301.191522-6\doc\build.html > > I > >> can't > >> find the following dicrectory in the distribution I >> downloaded. > It's a >> binary distribution. > ./org.jacoco.build/ > > >> appreciate > you help to >> figure out to set up this in my local > > >> cheers > > Kanchana > > > Hi Marc > Appreciate your you input. > Hi > >> I got done the > work. I will contribute to the project on some > >> documentation just > like a quick start and share with you. > > As I >> have stated I could > sucessfully generate reports for examples > >> given. Now I have better > idea of jacoco and how it works. > Now I'm >> trying to configure the > weblogic to generate reports for the > >> applicaition I have hosted in > weblogic using jacoco agent.In that > >> caseI have modified the > weblogic > startupconfig as follows. > > set >> JAVA_OPTION = > > > > >> -javaagent:/prd/products/jacoco/latest/jacocoagent.jar=output=tcpserver,port=8010,includes=<weblogic>web_inf\com.*,address=* >> > > > includes=<weblogic>web_inf\com.* are my classes files copied in >> > the > weblogic > The server up and runs. > Where should I see the > >> generated reports and how ?Appreciate your > input > cheers > > >> Kanchana

Hi Marc
Thanks again for your information.
I follow the steps exactly which you have given to UI testing.But still I didn't see the of the % of coverage has been changed for different scenarios
What could be the reason ?In the test scenario if it execute the same class for in each click of testing, it wouldn't reflect in the coverage is it?
Appreciate your input
Cheers
Kanchana

Marc R. Hoffmann

unread,
Apr 4, 2013, 3:06:49 PM4/4/13
to jac...@googlegroups.com
Hi Kanchana,

are you sure you create a *separate* exec file for each scenario? By
default the JaCoCo agent simply appends execution data to an existing
file. So what you then see is the coverage resulting from all your tests.

To avoid this you can either

1) Specify a separate exec file name for every test run
2) Move the exec file after every test run
3) Or set the agent property append=false so execution data will be
overwritten.

Best regards,
-marc

shi...@gmail.com

unread,
Mar 1, 2014, 6:00:23 AM3/1/14
to jac...@googlegroups.com, kanc...@gmail.com

Hi Kanchana,

You achieves this stuff,because i need help from you.

I'm working on this stuff but not yet done.

please reply for this.

Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages