From: John W. L. <Joh...@sa...> - 2011-04-28 20:30:38
|
Are you both trying to do this at the command line? If so, then here are the instructions. Since you are trying to instrument one file, you will want to use the --basedir to specify the directory the war is in. Then, you will only need to end the command with the name of the war. Next, since Cobertura would instrument every jar in the war, and you probably would not want that since all your dependencies would end up in the report, the --includeClasses parameter is required. So, you want something like: c:\temp\cobertura-1.9.4.1\cobertura-instrument.bat --basedir c:\temp\codecoverage --includeClasses 'com.mypackage.*' provision.war The war will be instrumented in place. Any class of any jar that is in com.mypackage will be instrumented. John From: Code Code [mailto:cc...@ya...] Sent: Thursday, April 28, 2011 1:12 PM To: Fabien Bataille Cc: cob...@li... Subject: Re: [Cobertura-devel] Instrumenting war file using command line Thanks for the info. I was reading on the http://cobertura.sourceforge.net/anttaskreference.html website. I though we can also instrument a war file. "For example, if you have a war file which contains a jar file at WEB-INF/lib, Cobertura will extract the war, instrument the classes within the jar, then build a new war containing the instrumented jar. " From: Fabien Bataille <fba...@gm...> To: Code Code <cc...@ya...> Cc: "cob...@li..." <cob...@li...> Sent: Thursday, April 28, 2011 12:31 AM Subject: Re: [Cobertura-devel] Instrumenting war file using command line I am in the same case as you, what I do is first to extract the content of the war file in a temporary directory, then instrument all extracted classes, and last recreating the war (be sure to I don't think there is any existing ant target for that in the Cobertura delivery. 2011/4/28 Code Code <cc...@ya...<mailto:cc...@ya...>> Hi, I am trying to instrumenting a war file. It doen't instrument all the classes in the war file. I see only class getting instrumented. C:\temp\codecoverage>c:\temp\cobertura-1.9.4.1\cobertura-instrument.bat c:\temp\codecoverage\provision.war Picked up JAVA_TOOL_OPTIONS: -agentlib:jvmhook Picked up _JAVA_OPTIONS: -Xrunjvmhook -Xbootclasspath/a:C:\PROGRA~1\HP\QUICKT~1\ bin\JAVA_S~1\classes;C:\PROGRA~1\HP\QUICKT~1\bin\JAVA_S~1\classes\jasmine.jar Cobertura 1.9.4.1 - GNU GPL License (NO WARRANTY) - See COPYRIGHT file Cobertura: Loaded information on 1 classes. Instrumenting 1 file Am I doing anything wrong. Could you suggest me how to instrument a war file using commandline. Thanks, Parthu ------------------------------------------------------------------------------ WhatsUp Gold - Download Free Network Management Software The most intuitive, comprehensive, and cost-effective network management toolset available today. Delivers lowest initial acquisition cost and overall TCO of any competing solution. http://p.sf.net/sfu/whatsupgold-sd _______________________________________________ Cobertura-devel mailing list Cob...@li...<mailto:Cob...@li...> https://lists.sourceforge.net/lists/listinfo/cobertura-devel |