Tomcat上的Cobertura [英] Cobertura on Tomcat

查看:142
本文介绍了Tomcat上的Cobertura的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用Cobertura应用代码覆盖率。该应用程序是在Tomcat 5中部署的
,但是当我检测.class文件时,
应用程序停止工作。



这是我的步骤:




  • 编译应用程序(在tomcat中运行)

  • 检测类文件。

      D:\ test\cobertura-1.9.4.1 \ cobertura-instrument.bat --destination D:\ test \instrument D:\ src \ path_to_app \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ 

    使用<$中的已检测类文件覆盖 D:\ src \ path_to_app \ main \ target &\\webapp
    的类文件c $ c> D:\ test\instrument


  • 通过Catalina conf或war文件在Tomcat中部署应用程序。 (
    应用不起作用)



有人在Tomcat中有正确部署应用的正确步骤
与Cobertura指导的课程?



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



我正在使用cobertura-1.9.4.1

解决方案

正确的步骤是:




  • 编译应用程序

  • 检测类文件。
    D:\ test\cobertura-1.9.4.1 \ cobertura-instrument.bat --destination D:\\\trument D:\ src \ path_to_app \ main\target\webapp (创建了一个cobertura.ser)


  • 覆盖 D:\ src\path_to_app\main\target\webapp
    ,带有中的已检测类文件D:\ test\instrument


  • 将cobertura.jar复制到WEB-INF / lib

  • 直接在Tomcat中部署应用程序或者通过war文件。

  • 将cobertura.ser复制到tomcat的当前目录(tomcat / bin或system32,否则你会看到错误日志中的路径)

  • 使用该应用程序,并停止tomcat服务器。

  • 使用更新的cobertura.ser构建报告(在system32或...中)(至少为我,尺寸没有变化)



参考:
- http:// cobertura.sourceforge.net/faq.html
- JB Nizet回答


I'm trying to apply code coverage using Cobertura. The app is deployed in Tomcat 5, but when I instrument the .class files, the app stops working.

This are my steps:

  • Compile the app (This run in tomcat)
  • Instrument the class files.

    D:\test\cobertura-1.9.4.1\cobertura-instrument.bat --destination D:\test\instrument D:\src\path_to_app\main\target\webapp
    

  • Overwrite the class files of D:\src\path_to_app\main\target\webapp with the instrumented class files in D:\test\instrument.

  • Deploy the app in Tomcat via Catalina conf or by a war file. (The app does not work)

Does someone have the correct steps for correctly deploying an app in Tomcat with the classes instrumented by Cobertura?

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

I'm using cobertura-1.9.4.1

解决方案

The correct steps were:

  • Compile the app
  • Instrument the class files. D:\test\cobertura-1.9.4.1\cobertura-instrument.bat --destination D:\test\instrument D:\src\path_to_app\main\target\webapp (a cobertura.ser its created)

  • Overwrite the class files of D:\src\path_to_app\main\target\webapp with the instrumented class files in D:\test\instrument.

  • Copy the cobertura.jar to WEB-INF/lib
  • Deploy the app in Tomcat directly or by a war file.
  • Copy the cobertura.ser to the current dir of tomcat (tomcat/bin or system32, or else you will see the path in the error logs)
  • Use the app, and stop the tomcat server.
  • Build the report with the updated cobertura.ser(in system32 or ...) (at least for me, the size does not change)

Reference: - http://cobertura.sourceforge.net/faq.html - JB Nizet answer

这篇关于Tomcat上的Cobertura的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆