简体   繁体   English

Java EE容器上的三叶草

[英]Clover on Java EE Container

I would like to run Atlassian Clover in a production environment (I don't have an issue with overhead ). 我想在生产环境中运行Atlassian Clover (我的开销没有问题)。 Does anyone have experience with this, or can you direct me how to do it? 有没有人对此有经验,或者您可以指导我该怎么做?

My goal is to get clover reports based on real users actions. 我的目标是根据实际用户的操作获取三叶草报告。 I'm using JBoss + JDK 1.5 我正在使用JBoss + JDK 1.5

You can deploy clover build (along with the coverage.db files generated during the instrumentation) to your servers, add a bunch of clover-specific java options to set it up and then collect the results, merge them using the clover merge tools and generate the reports. 您可以将三叶草构建(连同在检测期间生成的coverage.db文件一起)部署到服务器,添加一堆三叶草特定的Java选项进行设置,然后收集结果,使用三叶草合并工具将其合并并生成报告。 See Clover Wiki for detailed instructions. 有关详细说明,请参见Clover Wiki

Please note that by default, clover dumps the coverage data upon process termination - you might want to do some research on how to make it happen periodically. 请注意,默认情况下,三叶草会在流程终止时转储coverage数据-您可能需要对如何使其定期进行研究。 Look into -flushpolicy and -flushinterval options. 查看-flushpolicy-flushinterval选项。

found the answer finally , thanks all . 终于找到了答案,谢谢大家。 after I created the Clover DB ( cmd / or eclipse integration ) , while starting my App server I add the following params -Djboss.shutdown.forceHalt=false -Dclover.initstring.basedir=/coverage.db it will do the job 创建四叶草数据库(cmd /或eclipse集成)之后,在启动我的App服务器时,我添加了以下参数-Djboss.shutdown.forceHalt = false -Dclover.initstring.basedir = / coverage.db,它将完成此工作

The general strategy would be to use Clover (or Cobertura or a similar tool) when you compile your web application. 一般的策略是在编译Web应用程序时使用Clover(或Cobertura或类似的工具)。 If you use maven for doing your builds, you can use the cobertura plugin: 如果您使用Maven进行构建,则可以使用cobertura插件:

http://mojo.codehaus.org/cobertura-maven-plugin/instrument-mojo.html http://mojo.codehaus.org/cobertura-maven-plugin/instrument-mojo.html

To add this easily with the cobertura:instrument goal. 要通过cobertura:instrument目标轻松添加此功能。 You then drop the generated war into JBoss just as before. 然后像以前一样将生成的战争放入JBoss。

You'd probably also be interested in Glassbox: 您可能也会对Glassbox感兴趣:

http://www.glassbox.com/glassbox/Home.html http://www.glassbox.com/glassbox/Home.html

It doesn't generate code coverage, instead it gives you a high-level report at what's going on and can tell you where you may have bottlenecks. 它不会生成代码覆盖率,而是会为您提供正在发生的情况的高级报告,并可以告诉您可能存在瓶颈的地方。

I haven't used clover in a long time... but I do use cobertura ( http://cobertura.sourceforge.net/faq.html ) for code coverage. 我已经很长时间没有使用三叶草了……但是我确实使用cobertura( http://cobertura.sourceforge.net/faq.html )进行代码覆盖。 Looking at the FAQ for cobertura it does work with JBoss. 查看cobertura的常见问题解答,它可以与JBoss一起使用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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