1
--------------------------------------------------
2
GMetrics - CoberturaLineCoverage Metric
3
--------------------------------------------------
5
CoberturaLineCoverage Metric
6
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
8
Metric that measures the code coverage of source lines based on a
9
{{{http://cobertura.sourceforge.net/}Cobertura}} coverage XML file.
11
Implemented by the <<<org.gmetrics.metric.coverage.CoberturaLineCoverageMetric>>> class.
17
The following properties can be configured for this metric within a <MetricSet>. See
18
{{{./gmetrics-creating-metricset.html}Creating a MetricSet}} for information on the syntax of
19
setting a metric property.
21
*-----------------+--------------------------------------------------------------------+------------------------+
22
| <<Property>> | <<Description>> | <<Default Value>> |
23
*-----------------+--------------------------------------------------------------------+------------------------+
24
| enabled | This <<<boolean>>> property controls whether the metric is | <<<true>>> |
25
| | <enabled>. If set to <<<false>>>, then the metric is not included | |
26
| | as part of the results or the output reports. | |
27
*-----------------+--------------------------------------------------------------------+------------------------+
28
| functions | This <<<List\<String\>>>> property contains the names of the functions| <<<["total","average"]>>>|
29
| | to be calculated at the <class> and <package> levels and | |
30
| | (potentially) included within the report(s). Valid values are: | |
35
*-----------------+--------------------------------------------------------------------+------------------------+
36
| coberturaFile | The path to the <<Cobertura>> XML file. By default, the path is | <<<N/A>>> |
37
| | relative to the classpath. But the path may be optionally prefixed | |
38
| | by any of the valid java.net.URL prefixes, such as "file:" (to load| |
39
| | from a relative or absolute path on the filesystem), or "http:". | |
40
| | This property is REQUIRED. | |
41
*-----------------+--------------------------------------------------------------------+------------------------+
42
| packageNamePrefixes | Optional, comma-separated list of prefixes that should be | <<<null>>> |
43
| | stripped from full path names before checking the <<Cobertura>> | |
44
| | XML file for matching coverage information. For instance, if the | |
45
| | <<GMetrics>> Ant task is configured to pull in all *.groovy files | |
46
| | from "src/main/groovy/**", then all of the package paths will be | |
47
| | prefixed with "src/main/groovy", which is not part of the actual | |
48
| | package name recorded in the <<Cobertura>> XML file. In that case, | |
49
| | set the <packageNamePrefixes> property to "src/main/groovy". | |
50
*-----------------+--------------------------------------------------------------------+------------------------+
56
* {{{http://cobertura.sourceforge.net/}Cobertura}} -- <Cobertura is a free Java tool that calculates the percentage
57
of code accessed by tests. It can be used to identify which parts of your Java program are lacking test coverage.>