Search in sources :

Example 1 with MethodParamPadCheck

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

the class MethodParamPadTest method operatorWrapTest.

@Test
public void operatorWrapTest() throws Exception {
    final Class<MethodParamPadCheck> clazz = MethodParamPadCheck.class;
    final String messageKeyPreceded = "ws.preceded";
    final String[] expected = { "11:32: " + getCheckMessage(clazz, messageKeyPreceded, "("), "13:15: " + getCheckMessage(clazz, messageKeyPreceded, "("), "20:24: " + getCheckMessage(clazz, messageKeyPreceded, "("), "29:39: " + getCheckMessage(clazz, messageKeyPreceded, "("), "35:16: " + getCheckMessage(clazz, messageKeyPreceded, "("), "41:21: " + getCheckMessage(clazz, messageKeyPreceded, "("), "47:18: " + getCheckMessage(clazz, messageKeyPreceded, "("), "52:36: " + getCheckMessage(clazz, messageKeyPreceded, "(") };
    final Configuration checkConfig = getCheckConfig("MethodParamPad");
    final String filePath = getPath("InputMethodParamPad.java");
    final Integer[] warnList = getLinesWithWarn(filePath);
    verify(checkConfig, filePath, expected, warnList);
}
Also used : Configuration(com.puppycrawl.tools.checkstyle.api.Configuration) MethodParamPadCheck(com.puppycrawl.tools.checkstyle.checks.whitespace.MethodParamPadCheck) Test(org.junit.Test)

Example 2 with MethodParamPadCheck

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

the class MethodParamPadTest method operatorWrapTest.

@Test
public void operatorWrapTest() throws Exception {
    final Class<MethodParamPadCheck> clazz = MethodParamPadCheck.class;
    final String messageKeyPrevious = "line.previous";
    final String messageKeyPreceded = "ws.preceded";
    final String[] expected = { "83:9: " + getCheckMessage(clazz, messageKeyPrevious, "("), "128:13: " + getCheckMessage(clazz, messageKeyPrevious, "("), "130:9: " + getCheckMessage(clazz, messageKeyPrevious, "("), "353:15: " + getCheckMessage(clazz, messageKeyPreceded, "("), "358:13: " + getCheckMessage(clazz, messageKeyPrevious, "(") };
    final Configuration checkConfig = getCheckConfig("MethodParamPad");
    final String filePath = getPath("InputMethodParamPad.java");
    final Integer[] warnList = getLinesWithWarn(filePath);
    verify(checkConfig, filePath, expected, warnList);
}
Also used : Configuration(com.puppycrawl.tools.checkstyle.api.Configuration) MethodParamPadCheck(com.puppycrawl.tools.checkstyle.checks.whitespace.MethodParamPadCheck) Test(org.junit.Test)

Aggregations

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