IntelliJ IDEA
IntelliJ IDEA coverage engine is the same engine that is used within the IntelliJ IDEA to measure code coverage. This coverage attaches to JVM as a java agent and instruments classes on the fly when they are loaded by JVM. In particular that means that classes are not changed on disk and can be safely used for distribution packages.
IntelliJ IDEA coverage engine currently supports Class, Method and Line coverage. There is no Branch/Block coverage yet.
To configure code coverage by means of IntelliJ IDEA engine, follow these steps:
While creating/editing Build Configuration, go to the Build Runner page.
Select Ant, IntelliJ IDEA Project, Gradle or Maven build runner.
Select IntelliJ IDEA as a coverage tool in the Choose coverage runner drop-down.
Set up the coverage options - find the description of the available options below.
Option
Description
Classes to instrument
Specify Java packages for wich code coverage should be gathered. Use patterns (one per line) that start with a valid package name and contain
*
. For example:org.apache.*
.Classes to exclude from instrumentation
Use regular expressions (one per line) to specify fully qualified class names which must be excluded from the coverage. Exclude patterns have higher priority than include patterns.