From: Steve C. <sch...@gm...> - 2012-12-12 17:58:30
|
Take look at the FAQ page (http://cobertura.sourceforge.net/faq.html) the section about Using cobertura with web application. I have found that deploying web applications, sometimes if it can't find the cobertura.ser file it will generate the report on another part of the machine if you never set -Dnet.sourceforge.cobertura.datafile= for all the jvms. If you want to verify, make sure while you're running your junits, open process explorer and make sure that variable is being set. Thanks, Steve. On Wed, Dec 12, 2012 at 12:06 AM, Himani Khanna <him...@gm...>wrote: > Hi, > > I have an automation test project using JUNIT to construct api's and > sends request to the app deployed in tomcat. While executing the test > cases i wanted to check for the code coverage/code hit during the > execution of test cases. I followed the following steps but my reports > are not showing any coverage details and tomcat logs show > > Cobertura: Loaded information on 189 classes. > Cobertura: Saved information on 189 classes. > > No prints for flushing data. > > Steps used : > 1) Compile the app folder > 2) Instrument the class files, and cobertura.ser is created in present > working directory > 3) Create jar's and wars with instrumented files and deploy it in tomcat > 4) Copy the cobertura.jar to the WEB-INF/lib of app > 5) Tomcat shows : Cobertura Loaded information on X files > 6) Run the test case which invokes the api and response is generated > in app and handled by test case > 7) Shutdown the tomcat server > 8) Generate reports by using present working directories cobertura.ser > file - 0% coverage shown > > Could the reason be a race condition between cobertura shutdown and > tomcat server shutdown? > On restart of tomcat server with same cobertura.ser will the data not > be flushed for previous tests coverage as cleanup of cobertura.ser is > not done ? > > Please help me understand above issues cause > > Regards > Himani Khanna > > > ------------------------------------------------------------------------------ > LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial > Remotely access PCs and mobile devices and provide instant support > Improve your efficiency, and focus on delivering more value-add services > Discover what IT Professionals Know. Rescue delivers > http://p.sf.net/sfu/logmein_12329d2d > _______________________________________________ > Cobertura-devel mailing list > Cob...@li... > https://lists.sourceforge.net/lists/listinfo/cobertura-devel > |