use of com.puppycrawl.tools.checkstyle.api.Configuration in project checkstyle by checkstyle.
the class WhitespaceAroundTest method whitespaceAroundEmptyTypesCyclesTest.
@Test
public void whitespaceAroundEmptyTypesCyclesTest() throws Exception {
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
final Configuration checkConfig = getCheckConfig("WhitespaceAround");
final String filePath = getPath("InputWhitespaceAroundEmptyTypesAndCycles.java");
final Integer[] warnList = getLinesWithWarn(filePath);
verify(checkConfig, filePath, expected, warnList);
}
use of com.puppycrawl.tools.checkstyle.api.Configuration in project checkstyle by checkstyle.
the class VariableDeclarationUsageDistanceTest method arrayTypeStyleTest.
@Test
public void arrayTypeStyleTest() throws Exception {
final String msgExt = "variable.declaration.usage.distance.extend";
final Class<VariableDeclarationUsageDistanceCheck> clazz = VariableDeclarationUsageDistanceCheck.class;
final String[] expected = { "71: " + getCheckMessage(clazz, msgExt, "count", 4, 3), "219: " + getCheckMessage(clazz, msgExt, "t", 5, 3), "479: " + getCheckMessage(clazz, msgExt, "myOption", 7, 3), "491: " + getCheckMessage(clazz, msgExt, "myOption", 6, 3) };
final Configuration checkConfig = getCheckConfig("VariableDeclarationUsageDistance");
final String filePath = getPath("InputVariableDeclarationUsageDistanceCheck.java");
final Integer[] warnList = getLinesWithWarn(filePath);
verify(checkConfig, filePath, expected, warnList);
}
use of com.puppycrawl.tools.checkstyle.api.Configuration in project checkstyle by checkstyle.
the class ArrayTypeStyleTest method arrayTypeStyleTest.
@Test
public void arrayTypeStyleTest() throws Exception {
final String[] expected = { "9:23: " + getCheckMessage(ArrayTypeStyleCheck.class, MSG_KEY), "15:44: " + getCheckMessage(ArrayTypeStyleCheck.class, MSG_KEY), "21:20: " + getCheckMessage(ArrayTypeStyleCheck.class, MSG_KEY), "22:23: " + getCheckMessage(ArrayTypeStyleCheck.class, MSG_KEY), "41:16: " + getCheckMessage(ArrayTypeStyleCheck.class, MSG_KEY), "42:19: " + getCheckMessage(ArrayTypeStyleCheck.class, MSG_KEY) };
final Configuration checkConfig = getCheckConfig("ArrayTypeStyle");
final String filePath = getPath("InputArrayTypeStyle.java");
final Integer[] warnList = getLinesWithWarn(filePath);
verify(checkConfig, filePath, expected, warnList);
}
use of com.puppycrawl.tools.checkstyle.api.Configuration in project checkstyle by checkstyle.
the class EmptyBlockTest method emptyBlockTestCatch.
@Test
public void emptyBlockTestCatch() throws Exception {
final String[] expected = { "29:17: " + getCheckMessage(EmptyBlockCheck.class, "block.empty", "finally"), "50:21: " + getCheckMessage(EmptyBlockCheck.class, "block.empty", "finally"), "72:21: " + getCheckMessage(EmptyBlockCheck.class, "block.empty", "finally") };
final Configuration checkConfig = getCheckConfig("EmptyBlock");
final String filePath = getPath("InputEmptyBlock.java");
final Integer[] warnList = getLinesWithWarn(filePath);
verify(checkConfig, filePath, expected, warnList);
}
use of com.puppycrawl.tools.checkstyle.api.Configuration in project checkstyle by checkstyle.
the class EmptyBlockTest method emptyBlockTest.
@Test
public void emptyBlockTest() throws Exception {
final String[] expected = { "19:21: " + getCheckMessage(EmptyBlockCheck.class, "block.empty", "if"), "22:34: " + getCheckMessage(EmptyBlockCheck.class, "block.empty", "if"), "26:21: " + getCheckMessage(EmptyBlockCheck.class, "block.empty", "if"), "28:20: " + getCheckMessage(EmptyBlockCheck.class, "block.empty", "switch"), "68:25: " + getCheckMessage(EmptyBlockCheck.class, "block.empty", "if"), "71:38: " + getCheckMessage(EmptyBlockCheck.class, "block.empty", "if"), "75:25: " + getCheckMessage(EmptyBlockCheck.class, "block.empty", "if"), "77:24: " + getCheckMessage(EmptyBlockCheck.class, "block.empty", "switch"), "98:29: " + getCheckMessage(EmptyBlockCheck.class, "block.empty", "if"), "101:42: " + getCheckMessage(EmptyBlockCheck.class, "block.empty", "if"), "105:29: " + getCheckMessage(EmptyBlockCheck.class, "block.empty", "if"), "107:28: " + getCheckMessage(EmptyBlockCheck.class, "block.empty", "switch"), "126:16: " + getCheckMessage(EmptyBlockCheck.class, "block.empty", "else"), "172:28: " + getCheckMessage(EmptyBlockCheck.class, "block.empty", "if"), "173:14: " + getCheckMessage(EmptyBlockCheck.class, "block.empty", "else"), "175:21: " + getCheckMessage(EmptyBlockCheck.class, "block.empty", "if"), "179:14: " + getCheckMessage(EmptyBlockCheck.class, "block.empty", "else"), "181:21: " + getCheckMessage(EmptyBlockCheck.class, "block.empty", "if"), "182:26: " + getCheckMessage(EmptyBlockCheck.class, "block.empty", "if"), "195:20: " + getCheckMessage(EmptyBlockCheck.class, "block.empty", "else"), "241:32: " + getCheckMessage(EmptyBlockCheck.class, "block.empty", "if"), "242:18: " + getCheckMessage(EmptyBlockCheck.class, "block.empty", "else"), "244:25: " + getCheckMessage(EmptyBlockCheck.class, "block.empty", "if"), "248:18: " + getCheckMessage(EmptyBlockCheck.class, "block.empty", "else"), "250:25: " + getCheckMessage(EmptyBlockCheck.class, "block.empty", "if"), "251:30: " + getCheckMessage(EmptyBlockCheck.class, "block.empty", "if"), "264:24: " + getCheckMessage(EmptyBlockCheck.class, "block.empty", "else"), "310:36: " + getCheckMessage(EmptyBlockCheck.class, "block.empty", "if"), "311:22: " + getCheckMessage(EmptyBlockCheck.class, "block.empty", "else"), "313:29: " + getCheckMessage(EmptyBlockCheck.class, "block.empty", "if"), "317:22: " + getCheckMessage(EmptyBlockCheck.class, "block.empty", "else"), "319:29: " + getCheckMessage(EmptyBlockCheck.class, "block.empty", "if"), "320:34: " + getCheckMessage(EmptyBlockCheck.class, "block.empty", "if") };
final Configuration checkConfig = getCheckConfig("EmptyBlock");
final String filePath = getPath("InputEmptyBlockBasic.java");
final Integer[] warnList = getLinesWithWarn(filePath);
verify(checkConfig, filePath, expected, warnList);
}
Aggregations