From: Steven C. <ste...@re...> - 2011-07-08 23:57:51
|
Steve, My comments are below. This time it worked :-) That's super awesome! If you add this custom code to your "logout" routine, will it work then? try { String className = "net.sourceforge.cobertura.coveragedata.ProjectData"; String methodName = "saveGlobalProjectData"; Class saveClass = Class.forName(className); java.lang.reflect.Method saveMethod = saveClass.getDeclaredMethod(methodName, new Class[0]); saveMethod.invoke(null,new Object[0]); } catch (Throwable t) { } Yes, this time the coverage report is showing the results. The above code fixed this ? Yes, because this is essentially forcing cobertura to flush the data to the .ser file. http://cobertura.sourceforge.net/faq.html see the last item on the page. I don't know too much about tomcat, but I believe in your web.xml can't you do a call to class? I could be 100% wrong on this though. There should be some method to execute a class, or a static method. |<web-app> <!-- Usual stuff here--> <listener> <listener-class>net.sourceforge.cobertura.coverageData.ProjectData</listener-class> </listener> </web-app> | On 7/8/2011 5:25 PM, Shivakumar Patil wrote: > Steve, > My comments are below. This time it worked :-) > > ------------------------------------------------------------------------ > *From:* Steven Christou [mailto:ste...@re...] > *Sent:* Friday, July 08, 2011 1:31 PM > *To:* Shivakumar Patil > *Cc:* 'John W. Lewis'; cob...@li... > *Subject:* Re: [Cobertura-devel] Coverage reoprts show 0% coverage > > Few Questions: > While instrumentation, do you get any type of warnings/errors? > Microsoft Windows XP [Version 5.1.2600] > (C) Copyright 1985-2001 Microsoft Corp. > C:\>cd C:\Cobertura\cobertura-1.9.4.1\90 > C:\Cobertura\cobertura-1.9.4.1\90>build.bat > C:\Cobertura\cobertura-1.9.4.1\90>SET ANT_HOME=C:\apache-ant-1.8.2 > C:\Cobertura\cobertura-1.9.4.1\90>SET JAVA_HOME=C:\Program > Files\Java\jdk1.6.0_2 > 5 > C:\Cobertura\cobertura-1.9.4.1\90>SET PATH=C:\Program > Files\Java\jdk1.6.0_25\bin > ;.;C:\Perl\site\bin;C:\Perl\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System > 32\Wbem;c:\Program Files\Microsoft SQL > Server\100\Tools\Binn\;c:\Program Files\M > icrosoft SQL > Server\100\DTS\Binn\;C:\ACE+TAO+CIAO\ACE_wrappers\lib;C:\ACE+TAO+CI > AO\ACE_wrappers\bin;C:\Program Files\doxygen\bin;C:\Program > Files\Graphviz2.26.3 > \bin;C:\Program > Files\Java\jdk1.6.0_25\bin;C:\eClinicalWorks\mysql\bin;C:\apache > -ant-1.8.2\bin;C:\Sun\AppServer\bin; > C:\Cobertura\cobertura-1.9.4.1\90>SET > CLASSPATH=C:\Cobertura\cobertura-1.9.4.1\9 > 0\WEB-INF\classes > C:\Cobertura\cobertura-1.9.4.1\90>C:\apache-ant-1.8.2\bin\ant > Buildfile: C:\Cobertura\cobertura-1.9.4.1\90\build.xml > init: > [mkdir] Created dir: C:\Cobertura\cobertura-1.9.4.1\90\instrumented > [mkdir] Created dir: > C:\Cobertura\cobertura-1.9.4.1\90\reports\junit-xml > [mkdir] Created dir: > C:\Cobertura\cobertura-1.9.4.1\90\reports\junit-html > removeclassesfolders: > instrument: > [delete] Deleting: C:\Cobertura\cobertura-1.9.4.1\90\cobertura.ser > [delete] Deleting directory > C:\Cobertura\cobertura-1.9.4.1\90\instrumented > [cobertura-instrument] Cobertura 1.9.4.1 - GNU GPL License (NO > WARRANTY) - See C > OPYRIGHT file > [cobertura-instrument] Instrumenting 2517 files to > C:\Cobertura\cobertura-1.9.4. > 1\90\instrumented > [cobertura-instrument] WARN visitEnd, No line number information > found for cla > ss catalog.MigrateICD$1. Perhaps you need to compile with debug=true? > [cobertura-instrument] WARN visitEnd, No line number information > found for cla > ss catalog.NEU_Email$1. Perhaps you need to compile with debug=true? > [cobertura-instrument] WARN visitEnd, No line number information > found for cla > ss catalog.PatientDemographic$1. Perhaps you need to compile with > debug=true? > [cobertura-instrument] WARN visitEnd, No line number information > found for cla > ss catalog.PatientSchedule$1. Perhaps you need to compile with > debug=true? > [cobertura-instrument] WARN visitEnd, No line number information > found for cla > ss catalog.ePtStmnt$1. Perhaps you need to compile with debug=true? > [cobertura-instrument] WARN visitEnd, No line number information > found for cla > ss corrections.PrintPrescription$1. Perhaps you need to compile with > debug=true > ? > [cobertura-instrument] WARN visitEnd, No line number information > found for cla > ss empi.dashboard.CCRDashboardHelper$1. Perhaps you need to compile > with debug= > true? > [cobertura-instrument] WARN visitEnd, No line number information > found for cla > ss empi.objects.PtReconHelper$1. Perhaps you need to compile with > debug=true? > [cobertura-instrument] WARN visitEnd, No line number information > found for cla > ss empi.util.SendMails$1. Perhaps you need to compile with debug=true? > [cobertura-instrument] WARN visitEnd, No line number information > found for cla > ss json.JSONObject$1. Perhaps you need to compile with debug=true? > [cobertura-instrument] WARN visitEnd, No line number information > found for cla > ss migration.EcwVisitStatus$1. Perhaps you need to compile with > debug=true? > [cobertura-instrument] Cobertura: Saved information on 2517 classes. > [cobertura-instrument] Instrument time: 40328ms > coverage: > BUILD SUCCESSFUL > Total time: 42 seconds > C:\Cobertura\cobertura-1.9.4.1\90> > > How does your tomcat6 service java argument look like? > -Dcatalina.base=E:\eClinicalWorks\tomcat6 > -Dcatalina.home=E:\eClinicalWorks\tomcat6 > -Djava.endorsed.dirs=E:\eClinicalWorks\tomcat6\endorsed > -Djava.io.tmpdir=E:\eClinicalWorks\tomcat6\temp > -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager > -Djava.util.logging.config.file=E:\eClinicalWorks\tomcat6\conf\logging.properties > -Dcom.sun.management.jmxremote > -Dcom.sun.management.jmxremote.port=8999 > -Dcom.sun.management.jmxremote.ssl=false > -Dcom.sun.management.jmxremote.authenticate=false > -Dnet.sourceforge.cobertura.datafile=E:\eClinicalWorks\tomcat6\bin\cobertura.ser > -XX:+HeapDumpOnOutOfMemoryError > -XX:MaxPermSize=512M > -XX:HeapDumpPath=E:\eClinicalWorks\tomcat6\logs > > Are you adding any type of custom shutdown hooks? > no > > If you add this custom code to your "logout" routine, will it work then? > try { > String className = "net.sourceforge.cobertura.coveragedata.ProjectData"; > String methodName = "saveGlobalProjectData"; > Class saveClass = Class.forName(className); > java.lang.reflect.Method saveMethod = saveClass.getDeclaredMethod(methodName, new Class[0]); > saveMethod.invoke(null,new Object[0]); > } catch (Throwable t) { > } > > Yes, this time the coverage report is showing the results. The above > code fixed this ? > > > > On 7/8/2011 9:02 AM, Shivakumar Patil wrote: >> John/Steve, >> Just wanted to followup on the below issue. >> >> ------------------------------------------------------------------------ >> *From:* Shivakumar Patil [mailto:sh...@ec...] >> *Sent:* Wednesday, July 06, 2011 2:35 PM >> *To:* 'John W. Lewis'; 'Steven Christou' >> *Cc:* 'cob...@li...' >> *Subject:* RE: [Cobertura-devel] Coverage reoprts show 0% coverage >> >> when I followed the steps 1) to 6) mentioned below, the coverage >> report shows 0% . >> I have definately put the cobertura.ser file under tomcat6\bin directory. >> I instrumented the class files and generated the cobertura.ser file >> on a different system than test system. Steps 3-6 are being done on >> teh test system with tomcat and the application. >> >> ------------------------------------------------------------------------ >> *From:* John W. Lewis [mailto:Joh...@sa...] >> *Sent:* Wednesday, July 06, 2011 2:14 PM >> *To:* Shivakumar Patil; 'Steven Christou' >> *Cc:* cob...@li... >> *Subject:* RE: [Cobertura-devel] Coverage reoprts show 0% coverage >> >> Are you absolutely certain you are putting the cobertura.ser file in >> the E:\eClinicalWorks\tomcat6\bin dir before starting tomcat? You >> could specify datafile="E:/eClinicalWorks/tomcat6/bin" in the >> cobertura-instrument command. >> >> John >> >> *From:*Shivakumar Patil [mailto:sh...@ec...] >> *Sent:* Wednesday, July 06, 2011 12:17 PM >> *To:* 'Steven Christou' >> *Cc:* cob...@li... >> *Subject:* Re: [Cobertura-devel] Coverage reoprts show 0% coverage >> >> It created the cobertura.ser file under tomcat6\bin directory. The >> size was 1KB. It did not create file either under system32 or syswow64 . >> >> The tomcat6 stdout log had the following entry.... >> >> Flushing results... >> Flushing results done >> Cobertura: Coverage data file >> E:\eClinicalWorks\tomcat6\bin\cobertura.ser either does not exist or >> is not readable. Creating a new data file. >> Cobertura: Saved information on 0 classes. >> >> ------------------------------------------------------------------------ >> >> *From:*Steven Christou [mailto:ste...@re...] >> *Sent:* Wednesday, July 06, 2011 11:59 AM >> *To:* Shivakumar Patil >> *Cc:* cob...@li... >> *Subject:* Re: [Cobertura-devel] Coverage reoprts show 0% coverage >> >> Also, can you check your system32, or syswow64 directory for a >> cobertura.ser. If you don't place the cobertura.ser file in that >> directory, will it create one automatically? >> >> On 7/6/2011 9:38 AM, Shivakumar Patil wrote: >> >> Hi, >> >> 1-> Using Cobertura 1.9.4.1 and tomcat6. >> >> 2-> Instrumented the class files except 3rd party JAR files. >> >> 3-> Placed Cobertura.ser under tomcat6 bin directory and copied >> the instrumented class files to WEB-INF\classes folder. >> >> 4-> Started tomcat6 and tested the application manually without >> using JUNIT test classes and ant task. >> >> 5-> Stopped tomcat6 and generated the coverage report, >> everything shows 0% coverage. >> >> 6-> Also added the below java option to tomcat6 service -> >> >> >> -Dnet.sourceforge.cobertura.datafile=E:\eClinicalWorks\tomcat6\bin\cobertura.ser >> >> Any thing wrong in what is being done here. >> >> CONFIDENTIALITY NOTICE TO RECIPIENT: This transmission contains >> confidential information belonging to the sender that is legally >> privileged and proprietary and may be subject to protection under the >> law, including the Health Insurance Portability and Accountability >> Act (HIPAA). If you are not the intended recipient of this e-mail, >> you are prohibited from sharing, copying, or otherwise using or >> disclosing its contents. If you have received this e-mail in error, >> please notify the sender immediately by reply e-mail and permanently >> delete this e-mail and any attachments without reading, forwarding or >> saving them. Thank you. >> >> >> ------------------------------------------------------------------------------ >> All of the data generated in your IT infrastructure is seriously valuable. >> Why? It contains a definitive record of application performance, security >> threats, fraudulent activity, and more. Splunk takes this data and makes >> sense of it. IT sense. And common sense. >> http://p.sf.net/sfu/splunk-d2d-c2 >> >> _______________________________________________ >> Cobertura-devel mailing list >> Cob...@li... <mailto:Cob...@li...> >> https://lists.sourceforge.net/lists/listinfo/cobertura-devel >> Email Disclaimer: >> http://www.redprairie..com/emaildisclaimer/ <http://www.redprairie.com/emaildisclaimer/> >> >> CONFIDENTIALITY NOTICE TO RECIPIENT: This transmission contains >> confidential information belonging to the sender that is legally >> privileged and proprietary and may be subject to protection under the >> law, including the Health Insurance Portability and Accountability >> Act (HIPAA). If you are not the intended recipient of this e-mail, >> you are prohibited from sharing, copying, or otherwise using or >> disclosing its contents. If you have received this e-mail in error, >> please notify the sender immediately by reply e-mail and permanently >> delete this e-mail and any attachments without reading, forwarding or >> saving them. Thank you. >> >> CONFIDENTIALITY NOTICE TO RECIPIENT: This transmission contains >> confidential information belonging to the sender that is legally >> privileged and proprietary and may be subject to protection under the >> law, including the Health Insurance Portability and Accountability >> Act (HIPAA). If you are not the intended recipient of this e-mail, >> you are prohibited from sharing, copying, or otherwise using or >> disclosing its contents. If you have received this e-mail in error, >> please notify the sender immediately by reply e-mail and permanently >> delete this e-mail and any attachments without reading, forwarding or >> saving them. Thank you. > Email Disclaimer: > http://www.redprairie.com/emaildisclaimer/ > CONFIDENTIALITY NOTICE TO RECIPIENT: This transmission contains > confidential information belonging to the sender that is legally > privileged and proprietary and may be subject to protection under the > law, including the Health Insurance Portability and Accountability Act > (HIPAA). If you are not the intended recipient of this e-mail, you are > prohibited from sharing, copying, or otherwise using or disclosing its > contents. If you have received this e-mail in error, please notify the > sender immediately by reply e-mail and permanently delete this e-mail > and any attachments without reading, forwarding or saving them. Thank > you. Email Disclaimer: http://www.redprairie.com/emaildisclaimer/ |