简体   繁体   English

如何在 netbeans 中测试 java web 应用程序的代码覆盖率?

[英]How to test the code coverage of a java web application in netbeans?

I have a java web application and I use Netbeans6.9.1 to develop it.我有一个 java web 应用程序,我使用 Netbeans6.9.1 开发它。
I wrote some Junit test class of some DAO classes, but I failed to run code coverage test.我写了一些 DAO 类的 Junit 测试 class ,但我未能运行代码覆盖率测试。
It seems NetBeans Code Coverage Plugin does not support java web application code coverage,似乎NetBeans 代码覆盖率插件不支持 java web 应用程序代码覆盖率,
and I can not activate coverage collection as the Tutorial .而且我无法像教程一样激活覆盖收集。
Any ideas?有任何想法吗?

Cobertura is a good code coverage tool, and there's a plugin for NetBeans, too. Cobertura 是一个很好的代码覆盖工具,NetBeans 也有一个插件。

I can confirm that the Codecoverage plug-in works in Netbeans 7.2.我可以确认Codecoverage插件在 Netbeans 7.2 中有效。 However in web projects the Coverage menu option is NOT active:-(但是在 web 项目中,覆盖菜单选项未激活:-(

If you're writing unit tests of DAOs, none of the code will run on the app server yet (since the DAOs should be instantiated in the same JVM as the test class), so you should be able to do code coverage.如果您正在编写 DAO 的单元测试,那么任何代码都不会在应用服务器上运行(因为 DAO 应该在与测试类相同的 JVM 中实例化),因此您应该能够进行代码覆盖。 What exact errors are you getting?你得到了什么确切的错误?

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

相关问题 如何获得 Java 代码覆盖率的全面覆盖? Junit 测试用例 - How to get full coverage for Java Code Coverage? Junit test cases 如何在Netbeans中调试Java Web应用程序? - How to debug Java Web Application in Netbeans? 通过Java Web应用程序中的黑盒测试来测量代码覆盖率 - Measure Code Coverage through Black Box testing in java Web application 如何使用JaCoCo代理测量Java Web Start(JNLP)应用程序的代码覆盖率? - How to measure code coverage with the JaCoCo agent for a Java Web Start (JNLP) application? 如何计算关于Web应用程序代码的selenium测试的代码覆盖率 - How to calculate code coverage of selenium tests with respect to web application code Netbeans 7中Java应用程序中的Web服务 - Web Services in java Application in Netbeans 7 如何衡量每个开发人员的Java代码单元测试覆盖率? - How to measure Java code unit test coverage per developer? 如何使用 Java EE 7 在 netbeans 中创建 Java Web 应用程序? - How to create a java Web application in netbeans with Java EE 7? 如何在Java Web应用程序(NetBeans)中显示jFrame表单 - how to display jFrame Form in a Java web application (NetBeans) 在Netbeans中更新Java Web Application的网页 - Updating a web page of Java Web Application in Netbeans
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM