Class AbstractRuleTestCase<T extends Rule>

  • All Implemented Interfaces:
    groovy.lang.GroovyObject

    public abstract class AbstractRuleTestCase<T extends Rule>
    extends AbstractTestCase
    implements groovy.lang.GroovyObject
    • Field Detail

      • CONSTRUCTOR_METHOD_NAME

        protected static final Object CONSTRUCTOR_METHOD_NAME
      • DEFAULT_TEST_FILES

        protected static final Object DEFAULT_TEST_FILES
      • DEFAULT_TEST_CLASS_NAMES

        protected static final Object DEFAULT_TEST_CLASS_NAMES
      • rule

        protected T extends Rule rule
      • sourceCodeName

        protected String sourceCodeName
      • sourceCodePath

        protected String sourceCodePath
    • Constructor Detail

      • AbstractRuleTestCase

        public AbstractRuleTestCase()
    • Method Detail

      • assertSingleViolation

        protected void assertSingleViolation​(String source,
                                             Integer lineNumber,
                                             String sourceLineText)
      • assertSingleViolation

        protected void assertSingleViolation​(String source,
                                             Integer lineNumber)
      • assertSingleViolation

        protected void assertSingleViolation​(String source)
      • assertViolation

        protected void assertViolation​(Violation violation,
                                       Integer lineNumber,
                                       String sourceLineText)
      • getMetaClass

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

        public void setMetaClass​(groovy.lang.MetaClass mc)
        Specified by:
        setMetaClass in interface groovy.lang.GroovyObject
        Overrides:
        setMetaClass in class AbstractTestCase
      • testThatUnrelatedCodeHasNoViolations

        public void testThatUnrelatedCodeHasNoViolations()
      • testThatInvalidCodeHasNoViolations

        public void testThatInvalidCodeHasNoViolations()
      • testThatApplyToFilesMatchingValuesAreValidRegex

        public void testThatApplyToFilesMatchingValuesAreValidRegex()
      • createRule

        protected abstract T createRule()
      • assertTwoViolations

        protected void assertTwoViolations​(String source,
                                           Integer lineNumber1,
                                           String sourceLineText1,
                                           Integer lineNumber2,
                                           String sourceLineText2)
      • assertInlineViolations

        protected void assertInlineViolations​(String annotatedSource)
      • inlineViolation

        protected static String inlineViolation​(String violationMessage)
      • removeInlineViolations

        protected static String removeInlineViolations​(String annotatedSource)
      • assertViolations

        protected void assertViolations​(String source,
                                        Map... violationMaps)
      • assertSingleViolation

        protected void assertSingleViolation​(String source,
                                             Integer lineNumber,
                                             String sourceLineText,
                                             Object messageText)
      • assertSingleViolation

        protected void assertSingleViolation​(String source,
                                             groovy.lang.Closure closure)
      • assertNoViolations

        protected void assertNoViolations​(String source)
      • assertViolation

        protected void assertViolation​(Violation violation,
                                       Integer lineNumber,
                                       String sourceLineText,
                                       Object messageText)
      • applyRuleTo

        protected List applyRuleTo​(String source)
      • manuallyApplyRule

        protected List manuallyApplyRule​(String source)
      • setUpAbstractRuleTestCase

        public void setUpAbstractRuleTestCase()