Java Code Coverage
using IDE
This article is an effort to improve the JUnit Test code
coverage. Following snapshots covers the steps to integrate code coverage tools
with IDE on local machine.IntelliJ
- Make sure coverage plugin is installed in IntelliJ
- And the Coverage view is enabled
- Configure the Junit in run configuration
- Following is an example for hraction module
- Configuration tab
- Code coverage tab, You
may select the coverage runner from dropdown. Options are Jacoco and
IntelliJ IDEA
- Click on run with coverage
- To see the coverage results select the class file on
which code coverage is to be run and execute the below command:
Eclipse
- Install Jacoco Code coverage plugin
- Open the Coverage configuration
- Configure the details as per your need
- Select the project and run coverage from tool window
- You get the coverage data in below format
No comments:
Post a Comment