Search in sources :

Example 1 with EmptyLineSeparatorCheck

use of com.puppycrawl.tools.checkstyle.checks.whitespace.EmptyLineSeparatorCheck in project checkstyle by checkstyle.

the class EmptyLineSeparatorTest method emptyLineSeparatorTest.

@Test
public void emptyLineSeparatorTest() throws Exception {
    final Class<EmptyLineSeparatorCheck> clazz = EmptyLineSeparatorCheck.class;
    final String messageKey = "empty.line.separator";
    final String[] expected = { "19: " + getCheckMessage(clazz, messageKey, "package"), "20: " + getCheckMessage(clazz, messageKey, "import"), "33: " + getCheckMessage(clazz, messageKey, "CLASS_DEF"), "37: " + getCheckMessage(clazz, messageKey, "STATIC_INIT"), "66: " + getCheckMessage(clazz, messageKey, "METHOD_DEF"), "75: " + getCheckMessage(clazz, messageKey, "INTERFACE_DEF"), "82: " + getCheckMessage(clazz, messageKey, "INSTANCE_INIT"), "113: " + getCheckMessage(clazz, messageKey, "CLASS_DEF"), "119: " + getCheckMessage(clazz, messageKey, "VARIABLE_DEF") };
    final Configuration checkConfig = getCheckConfig("EmptyLineSeparator");
    final String filePath = getPath("InputEmptyLineSeparator.java");
    final Integer[] warnList = getLinesWithWarn(filePath);
    verify(checkConfig, filePath, expected, warnList);
}
Also used : Configuration(com.puppycrawl.tools.checkstyle.api.Configuration) EmptyLineSeparatorCheck(com.puppycrawl.tools.checkstyle.checks.whitespace.EmptyLineSeparatorCheck) Test(org.junit.Test)

Example 2 with EmptyLineSeparatorCheck

use of com.puppycrawl.tools.checkstyle.checks.whitespace.EmptyLineSeparatorCheck in project checkstyle by checkstyle.

the class EmptyLineSeparatorTest method emptyLineSeparatorTest.

@Test
public void emptyLineSeparatorTest() throws Exception {
    final Class<EmptyLineSeparatorCheck> clazz = EmptyLineSeparatorCheck.class;
    final String messageKey = "empty.line.separator";
    final String[] expected = { "19: " + getCheckMessage(clazz, messageKey, "package"), "20: " + getCheckMessage(clazz, messageKey, "import"), "33: " + getCheckMessage(clazz, messageKey, "CLASS_DEF"), "37: " + getCheckMessage(clazz, messageKey, "STATIC_INIT"), "66: " + getCheckMessage(clazz, messageKey, "METHOD_DEF"), "75: " + getCheckMessage(clazz, messageKey, "INTERFACE_DEF"), "82: " + getCheckMessage(clazz, messageKey, "INSTANCE_INIT"), "113: " + getCheckMessage(clazz, messageKey, "CLASS_DEF"), "119: " + getCheckMessage(clazz, messageKey, "VARIABLE_DEF") };
    final Configuration checkConfig = getCheckConfig("EmptyLineSeparator");
    final String filePath = getPath("InputEmptyLineSeparator.java");
    final Integer[] warnList = getLinesWithWarn(filePath);
    verify(checkConfig, filePath, expected, warnList);
}
Also used : Configuration(com.puppycrawl.tools.checkstyle.api.Configuration) EmptyLineSeparatorCheck(com.puppycrawl.tools.checkstyle.checks.whitespace.EmptyLineSeparatorCheck) Test(org.junit.Test)

Aggregations

Configuration (com.puppycrawl.tools.checkstyle.api.Configuration)2 EmptyLineSeparatorCheck (com.puppycrawl.tools.checkstyle.checks.whitespace.EmptyLineSeparatorCheck)2 Test (org.junit.Test)2