0

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!

ismail
  • 46,010
  • 9
  • 86
  • 95
Steve
  • 1,145
  • 1
  • 11
  • 25

1 Answers1

0

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

Will Iverson
  • 2,009
  • 12
  • 22
  • I am able to generate the .ser file, and all the code gets instrumented correctly. The only problem is when I do sc start MYSERVICE and once I do a few items, and finally do sc stop MYSERVICE it will end, but it will fail to save any information. I was looking into sending a control character using SC control, but don't know how to do that. I am also unable to force an export. :(. Do you know of any other way I can force this export, or force results without making modifications to my code? – Steve Dec 29 '10 at 00:15