Package org.gmetrics.metric.coverage
Class AbstractCoberturaCoverageMetric
java.lang.Object
org.gmetrics.metric.AbstractMetric
org.gmetrics.metric.coverage.AbstractCoberturaCoverageMetric
- All Implemented Interfaces:
groovy.lang.GroovyObject
,MethodMetric
,Metric
- Direct Known Subclasses:
CoberturaBranchCoverageMetric
,CoberturaLineCoverageMetric
public abstract class AbstractCoberturaCoverageMetric
extends AbstractMetric
implements MethodMetric
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final Object
protected static final int
protected static final int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionapplyToClosure
(org.codehaus.groovy.ast.expr.ClosureExpression closureExpression, SourceCode sourceCode) applyToMethod
(org.codehaus.groovy.ast.MethodNode methodNode, SourceCode sourceCode) calculate
(org.codehaus.groovy.ast.MethodNode methodNode, SourceCode sourceCode) protected ClassMetricResult
calculateForClass
(org.codehaus.groovy.ast.ClassNode classNode, SourceCode sourceCode) protected MetricResult
calculateForPackage
(String packagePath, String packageName, Collection<MetricResult> childMetricResults) protected SingleNumberMetricResult
calculateMethodResult
(org.codehaus.groovy.ast.MethodNode methodNode, groovy.util.slurpersupport.GPathResult classXmlElement) protected groovy.util.slurpersupport.GPathResult
findMethodElement
(org.codehaus.groovy.ast.MethodNode methodNode, groovy.util.slurpersupport.GPathResult classXmlElement) protected abstract String
final MetricLevel
protected Ratio
getCoverageRatioForClass
(String className) protected abstract Ratio
getCoverageRatioForSingleClass
(Object matchingClassElement) groovy.lang.MetaClass
getProperty
(String property) invokeMethod
(String method, Object arguments) void
setCoberturaFile
(String value) void
setMetaClass
(groovy.lang.MetaClass mc) void
setProperty
(String property, Object value) Methods inherited from class org.gmetrics.metric.AbstractMetric
applyToClass, applyToPackage, createAggregateMetricResult, createAggregateMetricResult, getEnabled, getFunctions, isEnabled, isNotAnInterface, setEnabled, setFunctions
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.gmetrics.metric.Metric
applyToClass, applyToPackage, getFunctions, getName, isEnabled
-
Field Details
-
SCALE
protected static final int SCALE- See Also:
-
ROUNDING_MODE
protected static final int ROUNDING_MODE -
LOG
-
-
Constructor Details
-
AbstractCoberturaCoverageMetric
public AbstractCoberturaCoverageMetric()
-
-
Method Details
-
getMetaClass
public groovy.lang.MetaClass getMetaClass()- Specified by:
getMetaClass
in interfacegroovy.lang.GroovyObject
- Overrides:
getMetaClass
in classAbstractMetric
-
setMetaClass
public void setMetaClass(groovy.lang.MetaClass mc) - Specified by:
setMetaClass
in interfacegroovy.lang.GroovyObject
- Overrides:
setMetaClass
in classAbstractMetric
-
invokeMethod
- Specified by:
invokeMethod
in interfacegroovy.lang.GroovyObject
- Overrides:
invokeMethod
in classAbstractMetric
-
getProperty
- Specified by:
getProperty
in interfacegroovy.lang.GroovyObject
- Overrides:
getProperty
in classAbstractMetric
-
setProperty
- Specified by:
setProperty
in interfacegroovy.lang.GroovyObject
- Overrides:
setProperty
in classAbstractMetric
-
getBaseLevel
- Specified by:
getBaseLevel
in interfaceMetric
-
getCoberturaFile
-
setCoberturaFile
-
getAttributeName
-
getCoverageRatioForSingleClass
-
applyToMethod
public MetricResult applyToMethod(org.codehaus.groovy.ast.MethodNode methodNode, SourceCode sourceCode) - Specified by:
applyToMethod
in interfaceMethodMetric
-
applyToClosure
public MetricResult applyToClosure(org.codehaus.groovy.ast.expr.ClosureExpression closureExpression, SourceCode sourceCode) - Specified by:
applyToClosure
in interfaceMethodMetric
-
calculateForClass
protected ClassMetricResult calculateForClass(org.codehaus.groovy.ast.ClassNode classNode, SourceCode sourceCode) - Specified by:
calculateForClass
in classAbstractMetric
-
calculateForPackage
protected MetricResult calculateForPackage(String packagePath, String packageName, Collection<MetricResult> childMetricResults) - Overrides:
calculateForPackage
in classAbstractMetric
-
calculate
-
getCoverageRatioForClass
-
calculateMethodResult
protected SingleNumberMetricResult calculateMethodResult(org.codehaus.groovy.ast.MethodNode methodNode, groovy.util.slurpersupport.GPathResult classXmlElement) -
findMethodElement
protected groovy.util.slurpersupport.GPathResult findMethodElement(org.codehaus.groovy.ast.MethodNode methodNode, groovy.util.slurpersupport.GPathResult classXmlElement)
-