public abstract class AbstractRuleTestCase extends AbstractTestCase
| Modifier and Type | Field and Description |
|---|---|
protected static Object |
CONSTRUCTOR_METHOD_NAME |
protected static Object |
DEFAULT_TEST_CLASS_NAMES |
protected static Object |
DEFAULT_TEST_FILES |
protected Rule |
rule |
protected String |
sourceCodeName |
protected String |
sourceCodePath |
CODENARC_PROPERTIES_FILE_PROP, LOG, testName| Constructor and Description |
|---|
AbstractRuleTestCase() |
| Modifier and Type | Method and Description |
|---|---|
protected List |
applyRuleTo(String source) |
protected void |
assertInlineViolations(String annotatedSource) |
protected void |
assertNoViolations(String source) |
protected void |
assertSingleViolation(String source) |
protected void |
assertSingleViolation(String source,
groovy.lang.Closure closure) |
protected void |
assertSingleViolation(String source,
Integer lineNumber) |
protected void |
assertSingleViolation(String source,
Integer lineNumber,
String sourceLineText) |
protected void |
assertSingleViolation(String source,
Integer lineNumber,
String sourceLineText,
Object messageText) |
protected void |
assertTwoViolations(String source,
Integer lineNumber1,
String sourceLineText1,
Integer lineNumber2,
String sourceLineText2) |
protected void |
assertTwoViolations(String source,
Integer lineNumber1,
String sourceLineText1,
Object msg1,
Integer lineNumber2,
String sourceLineText2,
Object msg2) |
protected void |
assertViolation(Violation violation,
Integer lineNumber,
String sourceLineText) |
protected void |
assertViolation(Violation violation,
Integer lineNumber,
String sourceLineText,
Object messageText) |
protected void |
assertViolations(String source,
Map... violationMaps) |
protected abstract Rule |
createRule() |
groovy.lang.MetaClass |
getMetaClass() |
Object |
getProperty(String property) |
protected static String |
inlineViolation(String violationMessage) |
Object |
invokeMethod(String method,
Object arguments) |
protected List |
manuallyApplyRule(String source) |
protected static String |
removeInlineViolations(String annotatedSource) |
void |
setMetaClass(groovy.lang.MetaClass mc) |
void |
setProperty(String property,
Object value) |
void |
setUpAbstractRuleTestCase() |
void |
testThatApplyToFilesMatchingValuesAreValidRegex() |
void |
testThatInvalidCodeHasNoViolations() |
void |
testThatUnrelatedCodeHasNoViolations() |
getName, log, setUpAbstractTestCaseprotected static final Object CONSTRUCTOR_METHOD_NAME
protected static final Object DEFAULT_TEST_FILES
protected static final Object DEFAULT_TEST_CLASS_NAMES
protected Rule rule
protected String sourceCodeName
protected String sourceCodePath
protected void assertSingleViolation(String source, Integer lineNumber, String sourceLineText)
protected void assertSingleViolation(String source)
protected void assertViolation(Violation violation, Integer lineNumber, String sourceLineText)
public groovy.lang.MetaClass getMetaClass()
getMetaClass in interface groovy.lang.GroovyObjectgetMetaClass in class AbstractTestCasepublic void setMetaClass(groovy.lang.MetaClass mc)
setMetaClass in interface groovy.lang.GroovyObjectsetMetaClass in class AbstractTestCasepublic Object invokeMethod(String method, Object arguments)
invokeMethod in interface groovy.lang.GroovyObjectinvokeMethod in class AbstractTestCasepublic Object getProperty(String property)
getProperty in interface groovy.lang.GroovyObjectgetProperty in class AbstractTestCasepublic void setProperty(String property, Object value)
setProperty in interface groovy.lang.GroovyObjectsetProperty in class AbstractTestCasepublic void testThatUnrelatedCodeHasNoViolations()
public void testThatInvalidCodeHasNoViolations()
public void testThatApplyToFilesMatchingValuesAreValidRegex()
protected abstract Rule createRule()
protected void assertTwoViolations(String source, Integer lineNumber1, String sourceLineText1, Integer lineNumber2, String sourceLineText2)
protected void assertInlineViolations(String annotatedSource)
protected void assertTwoViolations(String source, Integer lineNumber1, String sourceLineText1, Object msg1, Integer lineNumber2, String sourceLineText2, Object msg2)
protected void assertSingleViolation(String source, Integer lineNumber, String sourceLineText, Object messageText)
protected void assertSingleViolation(String source, groovy.lang.Closure closure)
protected void assertNoViolations(String source)
protected void assertViolation(Violation violation, Integer lineNumber, String sourceLineText, Object messageText)
public void setUpAbstractRuleTestCase()
Copyright © 2021. All rights reserved.