简体   繁体   中英

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.
I wrote some Junit test class of some DAO classes, but I failed to run code coverage test.
It seems NetBeans Code Coverage Plugin does not support java web application code coverage,
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.

I can confirm that the Codecoverage plug-in works in Netbeans 7.2. However in web projects the Coverage menu option is NOT active:-(

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. What exact errors are you getting?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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