use of com.puppycrawl.tools.checkstyle.checks.whitespace.OperatorWrapCheck in project checkstyle by checkstyle.
the class OperatorWrapTest method operatorWrapTest.
@Test
public void operatorWrapTest() throws Exception {
final Class<OperatorWrapCheck> clazz = OperatorWrapCheck.class;
final String messageKey = "line.new";
final String[] expected = { "11:27: " + getCheckMessage(clazz, messageKey, "+"), "12:28: " + getCheckMessage(clazz, messageKey, "-"), "20:27: " + getCheckMessage(clazz, messageKey, "&&"), "62:42: " + getCheckMessage(clazz, messageKey, "?"), "66:27: " + getCheckMessage(clazz, messageKey, "!="), "72:30: " + getCheckMessage(clazz, messageKey, "=="), "78:27: " + getCheckMessage(clazz, messageKey, ">"), "84:35: " + getCheckMessage(clazz, messageKey, "||"), "107:46: " + getCheckMessage(clazz, messageKey, "?"), "111:31: " + getCheckMessage(clazz, messageKey, "!="), "117:34: " + getCheckMessage(clazz, messageKey, "=="), "123:31: " + getCheckMessage(clazz, messageKey, ">"), "129:39: " + getCheckMessage(clazz, messageKey, "||"), "153:46: " + getCheckMessage(clazz, messageKey, "?"), "157:31: " + getCheckMessage(clazz, messageKey, "!="), "163:34: " + getCheckMessage(clazz, messageKey, "=="), "169:31: " + getCheckMessage(clazz, messageKey, ">"), "175:39: " + getCheckMessage(clazz, messageKey, "||"), "194:38: " + getCheckMessage(clazz, messageKey, "?") };
final Configuration checkConfig = getCheckConfig("OperatorWrap");
final String filePath = getPath("InputOperatorWrap.java");
final Integer[] warnList = getLinesWithWarn(filePath);
verify(checkConfig, filePath, expected, warnList);
}
use of com.puppycrawl.tools.checkstyle.checks.whitespace.OperatorWrapCheck in project checkstyle by checkstyle.
the class OperatorWrapTest method testOperatorWrap.
@Test
public void testOperatorWrap() throws Exception {
final Class<OperatorWrapCheck> clazz = OperatorWrapCheck.class;
final String messageKey = "line.new";
final String[] expected = { "11:27: " + getCheckMessage(clazz, messageKey, "+"), "12:28: " + getCheckMessage(clazz, messageKey, "-"), "20:27: " + getCheckMessage(clazz, messageKey, "&&"), "28:33: " + getCheckMessage(clazz, messageKey, "::"), "43:35: " + getCheckMessage(clazz, messageKey, "&"), "62:42: " + getCheckMessage(clazz, messageKey, "?"), "66:27: " + getCheckMessage(clazz, messageKey, "!="), "72:30: " + getCheckMessage(clazz, messageKey, "=="), "78:27: " + getCheckMessage(clazz, messageKey, ">"), "84:35: " + getCheckMessage(clazz, messageKey, "||"), "107:46: " + getCheckMessage(clazz, messageKey, "?"), "111:31: " + getCheckMessage(clazz, messageKey, "!="), "117:34: " + getCheckMessage(clazz, messageKey, "=="), "123:31: " + getCheckMessage(clazz, messageKey, ">"), "129:39: " + getCheckMessage(clazz, messageKey, "||"), "153:46: " + getCheckMessage(clazz, messageKey, "?"), "157:31: " + getCheckMessage(clazz, messageKey, "!="), "163:34: " + getCheckMessage(clazz, messageKey, "=="), "169:31: " + getCheckMessage(clazz, messageKey, ">"), "175:39: " + getCheckMessage(clazz, messageKey, "||"), "194:38: " + getCheckMessage(clazz, messageKey, "?") };
final Configuration checkConfig = getModuleConfig("OperatorWrap");
final String filePath = getPath("InputOperatorWrap.java");
final Integer[] warnList = getLinesWithWarn(filePath);
verify(checkConfig, filePath, expected, warnList);
}
Aggregations