Hi, I am using jacoco agent and I would like to take dump on code coverage 
without having ant dump task which is take dump on VM exit.


I have configured jacocoagent like this below:
-javaagent:/lib/jacocoagent.jar=destfile=/current/jacoco.exec,output=tcpserver,address=ipaddress,port=36003,includes=com.abc.*:com.def.gh.*,dumponexit=true

So, I start my server, jacocoagent is active ...stop my server but no 
jacoco.exe file is created after shutting down the server

I change output=file in the above jacocoagent, jacoco.exec file is created on 
shutting down the server but no codecoverge is there.

I dont understand why jacoco.exec is not created while i have output=tcpserver.
I was reading the jacoco documentation. And it says
dumponexit      If set to true coverage data will be written on VM shutdown. 
The dump can only be written if either file is specified or the output is 
tcpserver/tcpclient and a connection is open at the time when the VM terminates.

What does it mean by connection is open at the time when the VM terminates???


On Thursday, May 16, 2013 10:12:45 AM UTC-7, [email protected] wrote:
> On Thursday, May 16, 2013 10:55:29 AM UTC-4, Marc R. Hoffmann wrote:
> 
> > > I would like to have report generatation like I had > for my ant tasks 
> > > and nice details up to method level. In this case you will need to create 
> > > the report e.g. with the Ant task as I described in my previous answer. 
> > > The agent itself cannot create a report. Best regards, -marc On 
> > > 2013-05-16 15:33, [email protected] wrote: > On Thursday, May 16, 2013 
> > > 2:25:12 AM UTC-4, Marc R. Hoffmann wrote: >> Hi, please see documentation 
> > > for the Ant tasts you need to perform >> the remote dump and create the 
> > > report: >> http://www.eclemma.org/jacoco/trunk/doc/ant.html#dump >> 
> > > http://www.eclemma.org/jacoco/trunk/doc/ant.html#report And yes, you >> 
> > > need the original class files from your web application locally on the >> 
> > > machine where the report is generated. The report task will also work >> 
> > > on WAR/EAR files. If you want to get source highlighting in your >> 
> > > reports you will also need to supply the Java source files to the >> 
> > > report task. Best regards, -marc On 2013-05-15 20:27, >> 
> > > [email protected] wrote: > Hi > > I have given the following java >> 
> > > option in commandlinf unix, and > rather editing the startup. > export >> 
> > > JAVA_OPTIONS="$JAVA_OPTIONS > > >> 
> > > -javaagent:/home/../../../jacocoagent.jar=output=tcpserver,port=8030,address=localhost"
> > >  >> > > This run on a Unix system > > My webapplication runs on top of >> 
> > > this weblogic server. > > Now I need to conduct my testing and >> 
> > > generate reports. ( As it's set > to listen to port 8030, what type of >> 
> > > request should I make to > generate > report) > How do I get generated >> 
> > > report files? > > > DO I have to use to ant build file? ( > > ant >> 
> > > -Djacocoagent.server.host=<my server> > -Djacocoagent.server.port=8030 >> 
> > > > for this option ant wants to have the class file location in the ant >> 
> > > > build script?can i give a network path to find the class fiels in > >> 
> > > web-inf in Unix system? Assuming ant run on another windows machine > >> 
> > > and work as a clien to make this call? > > ) > Appreciate your support >> 
> > > > Thanks > Kanchana > > Thanks Marc > Got the Ant stuff working. Now my 
> > > plans are different:). I have > weblogic configured sucussefully and 
> > > jacoco agents runs with no > issues > to test a webapplication and 
> > > generate reports as I test through the > applicatio. I have given the 
> > > JAVA_OPTIONS to run > > 
> > > javaagent:/home/../../jacocoagent.jar=output=tcpserver,destfile=jacoco.exec,includes=com.*,dumponexit=true,port=8010,classdumpdir=/../../dump,address=*"
> > >  > So I see the classdump which Agent scans through and dumps while I > 
> > > navigate through my web application.I would like to have report > 
> > > generatation like I had for my ant tasks and nice details up to > method 
> > > > level. > Appreciate your input how to get it done in this set up. > 
> > > Thanks > Kanchana
> 
> 
> 
> hi Marc,
> 
> 
> 
> Appreciate your reply. Please assume that my ant runs on a windows box and 
> and webapp on top of logic runs on a seperate Unix box.
> 
> In this case my class files are in the Unix box. 
> 
> If I'm using jacoco:agent and try to generate reports .. in Ant scripts 
> should I give the network path of the webapp/classes in unix system.Or what 
> if i give the classdumpdir?
> 
>  
> 
> 
> 
> <target name="dump" depends="configure">
> 
>       <echo>Running agent for jacoco results to ${result.exec.file}</echo>
> 
>       <jacoco:agent property="agentvmparam" 
> address="${jacocoagent.server.host}" port="${jacocoagent.server.port}" 
> destfile="${result.exec.file}" />
> 
> </target>
> 
> 
> 
> <target name="report">
> 
>  <jacoco:report>
> 
>       <executiondata1>
> 
>         <file file="${result.exec.it.file}" />
> 
>       </executiondata1>
> 
>       <structure name="report">
> 
>         <group name="IT Code Coverage">
> 
>               <classfiles>
> 
>                                                                               
>             <fileset dir="...................." />
> 
>               </classfiles>
> 
>         </group>
> 
>        </structure>
> 
>       <html destdir="${result.report.dir}" />
> 
>               </jacoco:report>
> 
>       </target>

-- 
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].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to