org.gmetrics.metric.cyclomatic
Class CyclomaticComplexityMetric_MethodTest

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.cyclomatic.CyclomaticComplexityMetric_MethodTest
All Implemented Interfaces:
groovy.lang.GroovyObject, junit.framework.Test

public class CyclomaticComplexityMetric_MethodTest
extends AbstractMetricTestCase
implements groovy.lang.GroovyObject


Field Summary
 
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
CyclomaticComplexityMetric_MethodTest()
           
 
Method Summary
 groovy.lang.MetaClass getMetaClass()
           
static java.lang.Object getMetricClass()
           
 java.lang.Object getProperty(java.lang.String property)
           
 java.lang.Object invokeMethod(java.lang.String method, java.lang.Object arguments)
           
 void setMetaClass(groovy.lang.MetaClass mc)
           
static void setMetricClass(java.lang.Object value)
           
 void setProperty(java.lang.String property, java.lang.Object value)
           
 void testApplyToMethod()
           
 void testCalculate_CountsForConstructor()
           
 void testCalculate_IncrementsForEach_And_Or()
           
 void testCalculate_IncrementsForEach_Case()
           
 void testCalculate_IncrementsForEach_Catch()
           
 void testCalculate_IncrementsForEach_ClassicForLoop()
           
 void testCalculate_IncrementsForEach_ElvisOperator()
           
 void testCalculate_IncrementsForEach_ForInLoop()
           
 void testCalculate_IncrementsForEach_If()
           
 void testCalculate_IncrementsForEach_JavaStyleForEachLoop()
           
 void testCalculate_IncrementsForEach_NullCheckOperator()
           
 void testCalculate_IncrementsForEach_TernaryOperator()
           
 void testCalculate_IncrementsForEach_While()
           
 void testCalculate_MethodContainingNestedClosure()
           
 void testCalculate_ProperCount_Combination()
           
 void testCalculate_ReturnsNullForAbstractMethodDeclaration()
           
 void testCalculate_ReturnsNullForSyntheticMethod()
           
 void testCalculate_ReturnsOne_ForEmptyMethod()
           
 
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, setUp, 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
 

Constructor Detail

CyclomaticComplexityMetric_MethodTest

public CyclomaticComplexityMetric_MethodTest()
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

getMetricClass

public static java.lang.Object getMetricClass()

setMetricClass

public static void setMetricClass(java.lang.Object value)

testApplyToMethod

public void testApplyToMethod()

testCalculate_ReturnsOne_ForEmptyMethod

public void testCalculate_ReturnsOne_ForEmptyMethod()

testCalculate_ReturnsNullForAbstractMethodDeclaration

public void testCalculate_ReturnsNullForAbstractMethodDeclaration()

testCalculate_ReturnsNullForSyntheticMethod

public void testCalculate_ReturnsNullForSyntheticMethod()

testCalculate_CountsForConstructor

public void testCalculate_CountsForConstructor()

testCalculate_IncrementsForEach_If

public void testCalculate_IncrementsForEach_If()

testCalculate_IncrementsForEach_While

public void testCalculate_IncrementsForEach_While()

testCalculate_IncrementsForEach_ClassicForLoop

public void testCalculate_IncrementsForEach_ClassicForLoop()

testCalculate_IncrementsForEach_ForInLoop

public void testCalculate_IncrementsForEach_ForInLoop()

testCalculate_IncrementsForEach_JavaStyleForEachLoop

public void testCalculate_IncrementsForEach_JavaStyleForEachLoop()

testCalculate_IncrementsForEach_Case

public void testCalculate_IncrementsForEach_Case()

testCalculate_IncrementsForEach_Catch

public void testCalculate_IncrementsForEach_Catch()

testCalculate_IncrementsForEach_And_Or

public void testCalculate_IncrementsForEach_And_Or()

testCalculate_IncrementsForEach_TernaryOperator

public void testCalculate_IncrementsForEach_TernaryOperator()

testCalculate_IncrementsForEach_ElvisOperator

public void testCalculate_IncrementsForEach_ElvisOperator()

testCalculate_IncrementsForEach_NullCheckOperator

public void testCalculate_IncrementsForEach_NullCheckOperator()

testCalculate_ProperCount_Combination

public void testCalculate_ProperCount_Combination()

testCalculate_MethodContainingNestedClosure

public void testCalculate_MethodContainingNestedClosure()


Copyright © 2012. All Rights Reserved.