Groovy Documentation

org.codenarc.rule.junit
[Groovy] Class JUnitTestMethodWithoutAssertRule

java.lang.Object
  org.codenarc.rule.AbstractRule
      org.codenarc.rule.AbstractAstVisitorRule
          org.codenarc.rule.junit.JUnitTestMethodWithoutAssertRule

class JUnitTestMethodWithoutAssertRule
extends AbstractAstVisitorRule

This rule searches for test methods that do not contain assert statements. Either the test method is missing assert statements, which is an error, or the test method contains custom assert statements that do not follow a proper assert naming convention. Test methods are defined as public void methods that begin with the work test or have a

Test:
annotation. By default this rule applies to the default test class names, but this can be changed using the rule's applyToClassNames property.
Authors:
Hamlet D'Arcy
Version:
\$Revision: 604 \$ - \$Date: 2011-02-09 15:53:52 -0500 (Wed, 09 Feb 2011) \$


Field Summary
 
Fields inherited from class AbstractAstVisitorRule
DEFAULT_CONST_NAME, DEFAULT_FIELD_NAME, DEFAULT_TEST_CLASS_NAMES, DEFAULT_TEST_FILES, DEFAULT_VAR_NAME
 
Property Summary
String applyToClassNames

String assertMethodPatterns

String name

int priority

 
Method Summary
AstVisitor getAstVisitor()

 
Methods inherited from class AbstractAstVisitorRule
applyTo, getAstVisitor, shouldApplyThisRuleTo
 
Methods inherited from class AbstractRule
applyTo, applyTo, createViolation, createViolation, createViolationForImport, createViolationForImport, getImportsSortedByLineNumber, getName, getPriority, isReady, packageNameForImport, setName, setPriority, sourceLineAndNumberForImport, sourceLineAndNumberForImport, toString, validate
 

Property Detail

applyToClassNames

String applyToClassNames


assertMethodPatterns

String assertMethodPatterns


name

String name


priority

int priority


 
Method Detail

getAstVisitor

@Override
AstVisitor getAstVisitor()


 

Groovy Documentation