About this task
In the Java™ code
coverage preferences page, you can configure the indicators themselves.
Procedure
- To open the Java code
coverage preference page, click .
- In the Code Coverage Indicators box, select one or more
indicators for coverage of packages, source files, types (a concrete
class or enumeration), and methods.
If you choose more
than one, the hierarchy is type, method, block, and line, in the order
shown in the box. Please note that the definition of a block is code
(portion of a line, a single line, or multiple lines) that cannot
be branched into or branched out of. All of the code in a block is
executed as a single group of instructions. Blocks are terminated
with a branch in or branch out (for example calling a method, throwing
an exception, or returning).
Note: Clearing the Show colored
indicators in the views check box will remove the colored
decorations from the Package Explorer and views (such as the Outline
view) while preserving the display of code coverage percentages (without
color).
- Click .
Example
In the following example, only block indicators are selected: Therefore, the Package
Explorer and views show only block code coverage:
Instead, if both block
and method coverage indicators are selected, the Package Explorer
shows method coverage before block coverage: