运行 Windows 服务和 cobertura
我正在尝试使用 cobertura 运行 Windows 服务。唯一的问题是执行关闭挂钩时 cobertura 会报告结果。我无法直接修改这些结果的代码,所以我想知道是否可以将 java 应用程序作为 Windows 服务运行并仍然收集 cobertura 结果。我检测代码,将其添加到类路径中,但是在报告时,我什么也没得到。查看跟踪文件时,无法加载/保存任何 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!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可能想看看 Emma,它可以让您提前进行检测。
http://emma.sourceforge.net/
使用 Cobertura 时,您是否获得 .ser 文件?
我假设您无法调整代码以强制导出,如本常见问题解答底部所示?
http://cobertura.sourceforge.net/faq.html
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