Class AbstractRuleTestCase<T extends Rule>
java.lang.Object
org.codenarc.test.AbstractTestCase
org.codenarc.rule.AbstractRuleTestCase<T>
- All Implemented Interfaces:
groovy.lang.GroovyObject
public abstract class AbstractRuleTestCase<T extends Rule>
extends AbstractTestCase
implements groovy.lang.GroovyObject
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final Objectprotected static final Objectprotected static final Objectprotected Tprotected Stringprotected StringFields inherited from class AbstractTestCase
CODENARC_PROPERTIES_FILE_PROP, LOG, testName -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected ListapplyRuleTo(String source) protected voidassertInlineViolations(String annotatedSource) protected voidassertNoViolations(String source) protected voidassertSingleViolation(String source) protected voidassertSingleViolation(String source, groovy.lang.Closure closure) protected voidassertSingleViolation(String source, Integer lineNumber) protected voidassertSingleViolation(String source, Integer lineNumber, String sourceLineText) protected voidassertSingleViolation(String source, Integer lineNumber, String sourceLineText, Object messageText) protected voidassertTwoViolations(String source, Integer lineNumber1, String sourceLineText1, Integer lineNumber2, String sourceLineText2) protected voidassertTwoViolations(String source, Integer lineNumber1, String sourceLineText1, Object msg1, Integer lineNumber2, String sourceLineText2, Object msg2) protected voidassertViolation(Violation violation, Integer lineNumber, String sourceLineText) protected voidassertViolation(Violation violation, Integer lineNumber, String sourceLineText, Object messageText) protected voidassertViolations(String source, Map... violationMaps) protected abstract Tgroovy.lang.MetaClassgetProperty(String property) protected static StringinlineViolation(String violationMessage) invokeMethod(String method, Object arguments) protected ListmanuallyApplyRule(String source) protected static StringremoveInlineViolations(String annotatedSource) voidsetMetaClass(groovy.lang.MetaClass mc) voidsetProperty(String property, Object value) voidvoidvoidvoidMethods inherited from class AbstractTestCase
getName, log, setUpAbstractTestCase
-
Field Details
-
CONSTRUCTOR_METHOD_NAME
-
DEFAULT_TEST_FILES
-
DEFAULT_TEST_CLASS_NAMES
-
rule
-
sourceCodeName
-
sourceCodePath
-
-
Constructor Details
-
AbstractRuleTestCase
public AbstractRuleTestCase()
-
-
Method Details
-
assertSingleViolation
-
assertSingleViolation
-
assertSingleViolation
-
assertViolation
-
getMetaClass
public groovy.lang.MetaClass getMetaClass()- Specified by:
getMetaClassin interfacegroovy.lang.GroovyObject- Overrides:
getMetaClassin classAbstractTestCase
-
setMetaClass
public void setMetaClass(groovy.lang.MetaClass mc) - Specified by:
setMetaClassin interfacegroovy.lang.GroovyObject- Overrides:
setMetaClassin classAbstractTestCase
-
invokeMethod
- Specified by:
invokeMethodin interfacegroovy.lang.GroovyObject- Overrides:
invokeMethodin classAbstractTestCase
-
getProperty
- Specified by:
getPropertyin interfacegroovy.lang.GroovyObject- Overrides:
getPropertyin classAbstractTestCase
-
setProperty
- Specified by:
setPropertyin interfacegroovy.lang.GroovyObject- Overrides:
setPropertyin classAbstractTestCase
-
testThatInvalidCodeHasNoViolations
public void testThatInvalidCodeHasNoViolations() -
testThatApplyToFilesMatchingValuesAreValidRegex
public void testThatApplyToFilesMatchingValuesAreValidRegex() -
createRule
-
assertTwoViolations
-
assertInlineViolations
-
inlineViolation
-
removeInlineViolations
-
assertViolations
-
assertTwoViolations
-
assertSingleViolation
-
assertSingleViolation
-
assertNoViolations
-
assertViolation
-
applyRuleTo
-
manuallyApplyRule
-
setUpAbstractRuleTestCase
public void setUpAbstractRuleTestCase()
-