简体   繁体   中英

Running a Windows service, and cobertura

I'm trying to run a windows service with cobertura. The only problem is cobertura reports results when the shutdown hook is executed. I am unable to directly modify the code for these results, so I was wondering if it is possible to run a java application as a windows service and still gather cobertura results. I instrument the code, add it to the classpath, but when reporting, I get nothing. When viewing a trace file, it fails to load/save any cobertura information. This leads me to believe that shutdown hooks never get executed, otherwise I would get results.

Thanks for the assistance!

You might want to look at Emma instead, it allows you to instrument in advance.

http://emma.sourceforge.net/

When using Cobertura, do you get a .ser file at all?

I assume that you can't tweak the code to force an export, as shown at the bottom of this FAQ?

http://cobertura.sourceforge.net/faq.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM