org.gmetrics.metric.coverage
Class AbstractCoberturaMetricTestCase

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by groovy.util.GroovyTestCase
              extended by org.gmetrics.test.AbstractTestCase
                  extended by org.gmetrics.metric.AbstractMetricTestCase
                      extended by org.gmetrics.metric.coverage.AbstractCoberturaMetricTestCase
All Implemented Interfaces:
groovy.lang.GroovyObject, junit.framework.Test
Direct Known Subclasses:
CoberturaBranchCoverageMetricTest, CoberturaLineCoverageMetricTest

public abstract class AbstractCoberturaMetricTestCase
extends AbstractMetricTestCase
implements groovy.lang.GroovyObject


Field Summary
protected static java.lang.Object CLASS_METRIC_RESULT
           
protected static java.lang.Object COBERTURA_XML_BAD_DTD
           
protected static java.lang.Object COBERTURA_XML_CLASSPATH_PREFIX
           
protected static java.lang.Object COBERTURA_XML_FILE_PREFIX
           
protected static java.lang.Object COBERTURA_XML_FILENAME
           
protected static java.lang.Object COBERTURA_XML_RELATIVE_PATH
           
protected static java.lang.Object COBERTURA_XML_RELATIVE_TO_CLASSPATH
           
protected static java.lang.Object PACKAGE_METRIC_RESULT
           
 
Fields inherited from class org.gmetrics.metric.AbstractMetricTestCase
CONSTRUCTOR_NAME, DEFAULT_CONSTRUCTOR, metric, RUN_METHOD, sourceCode
 
Fields inherited from class groovy.util.GroovyTestCase
log, TEST_SCRIPT_NAME_PREFIX
 
Constructor Summary
AbstractCoberturaMetricTestCase()
           
 
Method Summary
protected  void assertRatio(org.gmetrics.metric.coverage.Ratio ratio, int numerator, int denominator)
           
 groovy.lang.MetaClass getMetaClass()
           
 java.lang.Object getProperty(java.lang.String property)
           
protected abstract  BigDecimal getRootPackageValue()
           
protected abstract  BigDecimal getServicePackageValue()
           
 java.lang.Object invokeMethod(java.lang.String method, java.lang.Object arguments)
           
 void setMetaClass(groovy.lang.MetaClass mc)
           
 void setProperty(java.lang.String property, java.lang.Object value)
           
 void setUp()
           
 void testApplyToClass_CoberturaFileNotSet_ThrowsException()
           
 void testApplyToClass_Enum_DoesNotLogWarningForMissingImplicitConstructorCoverageInformation()
           
 void testApplyToClass_ReturnNullForInterface()
           
 void testApplyToClosure_ThrowsUnsupportedOperationException()
           
 void testApplyToPackage_AllowsWhitespaceAroundPackageNamePrefixes()
           
 void testApplyToPackage_DoesNotMatchPackageNamePrefixes()
           
 void testApplyToPackage_MultiplePrefixes_MatchesPackageNamePrefixes()
           
 void testApplyToPackage_NoCoverageInformation_ForPackageWithClasses_LogsWarning()
           
 void testApplyToPackage_NoCoverageInformation_ForPackageWithNoClasses_DoesNotLogWarning()
           
 void testApplyToPackage_NoCoverageInformation()
           
 void testApplyToPackage_NullPath_ReturnsOverallValue()
           
 void testApplyToPackage_PackagePath()
           
 void testApplyToPackage_PrefixHasTrailingSeparator_MatchesPackageNamePrefixes()
           
 void testApplyToPackage_SinglePrefix_MatchesPackageNamePrefixes()
           
 void testApplyToPackage()
           
 void testBaseLevelIsMethod()
           
 void testCalculate_EmptyMethodThatHasNoCoverageInformation_DoesNotLogWarning()
           
 void testCalculate_NonEmptyMethodThatHasNoCoverageInformation_LogsWarning()
           
 void testCanLoadCoberturaFileWithDTDSpecifyingUnreachableURI()
           
 void testImplementsMethodMetricInterface()
           
 void testLoadCoberturaFile_ClassPathResource()
           
 void testLoadCoberturaFile_FileResource()
           
 
Methods inherited from class org.gmetrics.metric.AbstractMetricTestCase
applyToClass, applyToClosure, applyToClosureValue, applyToMethod, applyToMethodValue, assertApplyToClass, assertApplyToClass, assertApplyToClass, assertApplyToPackage, assertApplyToPackage, assertApplyToPackage, assertCalculateForMethodReturnsNull, assertMetricForMetricResult, calculate, calculateForClosureField, calculateForConstructor, calculateForMethod, findFirstClosureExpression, findFirstField, findFirstMethod, findSyntheticMethod, metricResult, metricResultForClass, metricResultForPackage, parseClass, valueFromMetricResult
 
Methods inherited from class org.gmetrics.test.AbstractTestCase
assertBothAreFalseOrElseNeitherIs, assertContainsAll, assertContainsAllInOrder, assertEqualSets, captureLog4JMessages, captureSystemOut, classResultsNode, classResultsNode, containsAll, isNotGroovy15, log, methodResultsNode, packageResultsNode, packageResultsNode, scale, scale, shouldFailWithMessageContaining
 
Methods inherited from class groovy.util.GroovyTestCase
assertArrayEquals, assertContains, assertContains, assertEquals, assertEquals, assertEquals, assertInspect, assertLength, assertLength, assertLength, assertScript, assertToString, fixEOLs, getMethodName, getName, getTestClassName, notYetImplemented, notYetImplemented, shouldFail, shouldFail, shouldFailWithCause
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, run, run, runBare, runTest, setName, tearDown, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

COBERTURA_XML_FILENAME

protected static java.lang.Object COBERTURA_XML_FILENAME

COBERTURA_XML_RELATIVE_PATH

protected static java.lang.Object COBERTURA_XML_RELATIVE_PATH

COBERTURA_XML_RELATIVE_TO_CLASSPATH

protected static java.lang.Object COBERTURA_XML_RELATIVE_TO_CLASSPATH

COBERTURA_XML_FILE_PREFIX

protected static java.lang.Object COBERTURA_XML_FILE_PREFIX

COBERTURA_XML_CLASSPATH_PREFIX

protected static java.lang.Object COBERTURA_XML_CLASSPATH_PREFIX

COBERTURA_XML_BAD_DTD

protected static java.lang.Object COBERTURA_XML_BAD_DTD

CLASS_METRIC_RESULT

protected static java.lang.Object CLASS_METRIC_RESULT

PACKAGE_METRIC_RESULT

protected static java.lang.Object PACKAGE_METRIC_RESULT
Constructor Detail

AbstractCoberturaMetricTestCase

public AbstractCoberturaMetricTestCase()
Method Detail

getMetaClass

public groovy.lang.MetaClass getMetaClass()
Specified by:
getMetaClass in interface groovy.lang.GroovyObject
Overrides:
getMetaClass in class AbstractMetricTestCase

setMetaClass

public void setMetaClass(groovy.lang.MetaClass mc)
Specified by:
setMetaClass in interface groovy.lang.GroovyObject
Overrides:
setMetaClass in class AbstractMetricTestCase

invokeMethod

public java.lang.Object invokeMethod(java.lang.String method,
                                     java.lang.Object arguments)
Specified by:
invokeMethod in interface groovy.lang.GroovyObject
Overrides:
invokeMethod in class AbstractMetricTestCase

getProperty

public java.lang.Object getProperty(java.lang.String property)
Specified by:
getProperty in interface groovy.lang.GroovyObject
Overrides:
getProperty in class AbstractMetricTestCase

setProperty

public void setProperty(java.lang.String property,
                        java.lang.Object value)
Specified by:
setProperty in interface groovy.lang.GroovyObject
Overrides:
setProperty in class AbstractMetricTestCase

getRootPackageValue

protected abstract BigDecimal getRootPackageValue()

getServicePackageValue

protected abstract BigDecimal getServicePackageValue()

testBaseLevelIsMethod

public void testBaseLevelIsMethod()

testImplementsMethodMetricInterface

public void testImplementsMethodMetricInterface()

testCanLoadCoberturaFileWithDTDSpecifyingUnreachableURI

public void testCanLoadCoberturaFileWithDTDSpecifyingUnreachableURI()

testApplyToClosure_ThrowsUnsupportedOperationException

public void testApplyToClosure_ThrowsUnsupportedOperationException()

testCalculate_NonEmptyMethodThatHasNoCoverageInformation_LogsWarning

public void testCalculate_NonEmptyMethodThatHasNoCoverageInformation_LogsWarning()

testCalculate_EmptyMethodThatHasNoCoverageInformation_DoesNotLogWarning

public void testCalculate_EmptyMethodThatHasNoCoverageInformation_DoesNotLogWarning()

testApplyToClass_ReturnNullForInterface

public void testApplyToClass_ReturnNullForInterface()

testApplyToClass_CoberturaFileNotSet_ThrowsException

public void testApplyToClass_CoberturaFileNotSet_ThrowsException()

testApplyToClass_Enum_DoesNotLogWarningForMissingImplicitConstructorCoverageInformation

public void testApplyToClass_Enum_DoesNotLogWarningForMissingImplicitConstructorCoverageInformation()

testApplyToPackage

public void testApplyToPackage()

testApplyToPackage_PackagePath

public void testApplyToPackage_PackagePath()

testApplyToPackage_NullPath_ReturnsOverallValue

public void testApplyToPackage_NullPath_ReturnsOverallValue()

testApplyToPackage_SinglePrefix_MatchesPackageNamePrefixes

public void testApplyToPackage_SinglePrefix_MatchesPackageNamePrefixes()

testApplyToPackage_MultiplePrefixes_MatchesPackageNamePrefixes

public void testApplyToPackage_MultiplePrefixes_MatchesPackageNamePrefixes()

testApplyToPackage_AllowsWhitespaceAroundPackageNamePrefixes

public void testApplyToPackage_AllowsWhitespaceAroundPackageNamePrefixes()

testApplyToPackage_PrefixHasTrailingSeparator_MatchesPackageNamePrefixes

public void testApplyToPackage_PrefixHasTrailingSeparator_MatchesPackageNamePrefixes()

testApplyToPackage_DoesNotMatchPackageNamePrefixes

public void testApplyToPackage_DoesNotMatchPackageNamePrefixes()

testApplyToPackage_NoCoverageInformation_ForPackageWithNoClasses_DoesNotLogWarning

public void testApplyToPackage_NoCoverageInformation_ForPackageWithNoClasses_DoesNotLogWarning()

testApplyToPackage_NoCoverageInformation_ForPackageWithClasses_LogsWarning

public void testApplyToPackage_NoCoverageInformation_ForPackageWithClasses_LogsWarning()

testApplyToPackage_NoCoverageInformation

public void testApplyToPackage_NoCoverageInformation()

testLoadCoberturaFile_ClassPathResource

public void testLoadCoberturaFile_ClassPathResource()

testLoadCoberturaFile_FileResource

public void testLoadCoberturaFile_FileResource()

setUp

public void setUp()
Overrides:
setUp in class AbstractMetricTestCase

assertRatio

protected void assertRatio(org.gmetrics.metric.coverage.Ratio ratio,
                           int numerator,
                           int denominator)


Copyright © 2012. All Rights Reserved.