use of com.puppycrawl.tools.checkstyle.DefaultConfiguration in project checkstyle by checkstyle.
the class ExplicitInitializationCheckTest method testDefault.
@Test
public void testDefault() throws Exception {
final DefaultConfiguration checkConfig = createCheckConfig(ExplicitInitializationCheck.class);
final String[] expected = { "4:17: " + getCheckMessage(MSG_KEY, "x", 0), "5:20: " + getCheckMessage(MSG_KEY, "bar", "null"), "9:18: " + getCheckMessage(MSG_KEY, "y4", 0), "10:21: " + getCheckMessage(MSG_KEY, "b1", "false"), "14:22: " + getCheckMessage(MSG_KEY, "str1", "null"), "14:35: " + getCheckMessage(MSG_KEY, "str3", "null"), "15:9: " + getCheckMessage(MSG_KEY, "ar1", "null"), "18:11: " + getCheckMessage(MSG_KEY, "f1", 0), "19:12: " + getCheckMessage(MSG_KEY, "d1", 0), "22:17: " + getCheckMessage(MSG_KEY, "ch1", "\\0"), "23:17: " + getCheckMessage(MSG_KEY, "ch2", "\\0"), "39:25: " + getCheckMessage(MSG_KEY, "bar", "null"), "40:27: " + getCheckMessage(MSG_KEY, "barArray", "null"), "47:21: " + getCheckMessage(MSG_KEY, "x", 0), "48:29: " + getCheckMessage(MSG_KEY, "bar", "null"), "49:31: " + getCheckMessage(MSG_KEY, "barArray", "null"), "52:17: " + getCheckMessage(MSG_KEY, "x", 0), "53:25: " + getCheckMessage(MSG_KEY, "bar", "null"), "54:27: " + getCheckMessage(MSG_KEY, "barArray", "null") };
verify(checkConfig, getPath("InputExplicitInit.java"), expected);
}
use of com.puppycrawl.tools.checkstyle.DefaultConfiguration in project checkstyle by checkstyle.
the class FallThroughCheckTest method testFallThroughNoElse.
@Test
public void testFallThroughNoElse() throws Exception {
final DefaultConfiguration checkConfig = createCheckConfig(FallThroughCheck.class);
final String[] expected = { "20:13: " + getCheckMessage(MSG_FALL_THROUGH), "35:13: " + getCheckMessage(MSG_FALL_THROUGH), "39:13: " + getCheckMessage(MSG_FALL_THROUGH), "46:13: " + getCheckMessage(MSG_FALL_THROUGH), "60:13: " + getCheckMessage(MSG_FALL_THROUGH), "67:13: " + getCheckMessage(MSG_FALL_THROUGH), "80:21: " + getCheckMessage(MSG_FALL_THROUGH), "86:13: " + getCheckMessage(MSG_FALL_THROUGH), "88:13: " + getCheckMessage(MSG_FALL_THROUGH) };
verify(checkConfig, getPath("InputFallThrough2.java"), expected);
}
use of com.puppycrawl.tools.checkstyle.DefaultConfiguration in project checkstyle by checkstyle.
the class FallThroughCheckTest method testDefault.
@Test
public void testDefault() throws Exception {
final DefaultConfiguration checkConfig = createCheckConfig(FallThroughCheck.class);
final String[] expected = { "14:13: " + getCheckMessage(MSG_FALL_THROUGH), "38:13: " + getCheckMessage(MSG_FALL_THROUGH), "47:13: " + getCheckMessage(MSG_FALL_THROUGH), "53:13: " + getCheckMessage(MSG_FALL_THROUGH), "70:13: " + getCheckMessage(MSG_FALL_THROUGH), "87:13: " + getCheckMessage(MSG_FALL_THROUGH), "123:13: " + getCheckMessage(MSG_FALL_THROUGH), "179:11: " + getCheckMessage(MSG_FALL_THROUGH), "369:11: " + getCheckMessage(MSG_FALL_THROUGH), "372:11: " + getCheckMessage(MSG_FALL_THROUGH), "374:40: " + getCheckMessage(MSG_FALL_THROUGH), "416:13: " + getCheckMessage(MSG_FALL_THROUGH), "424:9: " + getCheckMessage(MSG_FALL_THROUGH), "436:9: " + getCheckMessage(MSG_FALL_THROUGH), "446:9: " + getCheckMessage(MSG_FALL_THROUGH) };
verify(checkConfig, getPath("InputFallThrough.java"), expected);
}
use of com.puppycrawl.tools.checkstyle.DefaultConfiguration in project checkstyle by checkstyle.
the class FallThroughCheckTest method testLastCaseGroup.
@Test
public void testLastCaseGroup() throws Exception {
final DefaultConfiguration checkConfig = createCheckConfig(FallThroughCheck.class);
checkConfig.addAttribute("checkLastCaseGroup", "true");
final String[] expected = { "14:13: " + getCheckMessage(MSG_FALL_THROUGH), "38:13: " + getCheckMessage(MSG_FALL_THROUGH), "47:13: " + getCheckMessage(MSG_FALL_THROUGH), "53:13: " + getCheckMessage(MSG_FALL_THROUGH), "70:13: " + getCheckMessage(MSG_FALL_THROUGH), "87:13: " + getCheckMessage(MSG_FALL_THROUGH), "123:13: " + getCheckMessage(MSG_FALL_THROUGH), "123:13: " + getCheckMessage(MSG_FALL_THROUGH_LAST), "179:11: " + getCheckMessage(MSG_FALL_THROUGH), "369:11: " + getCheckMessage(MSG_FALL_THROUGH), "372:11: " + getCheckMessage(MSG_FALL_THROUGH), "374:40: " + getCheckMessage(MSG_FALL_THROUGH), "376:11: " + getCheckMessage(MSG_FALL_THROUGH_LAST), "416:13: " + getCheckMessage(MSG_FALL_THROUGH), "424:9: " + getCheckMessage(MSG_FALL_THROUGH), "436:9: " + getCheckMessage(MSG_FALL_THROUGH), "446:9: " + getCheckMessage(MSG_FALL_THROUGH) };
verify(checkConfig, getPath("InputFallThrough.java"), expected);
}
use of com.puppycrawl.tools.checkstyle.DefaultConfiguration in project checkstyle by checkstyle.
the class FallThroughCheckTest method testOwnPattern.
@Test
public void testOwnPattern() throws Exception {
final String ownPattern = "Continue with next case";
final DefaultConfiguration checkConfig = createCheckConfig(FallThroughCheck.class);
checkConfig.addAttribute("reliefPattern", ownPattern);
final String[] expected = { "14:13: " + getCheckMessage(MSG_FALL_THROUGH), "38:13: " + getCheckMessage(MSG_FALL_THROUGH), "47:13: " + getCheckMessage(MSG_FALL_THROUGH), "53:13: " + getCheckMessage(MSG_FALL_THROUGH), "70:13: " + getCheckMessage(MSG_FALL_THROUGH), "87:13: " + getCheckMessage(MSG_FALL_THROUGH), "123:13: " + getCheckMessage(MSG_FALL_THROUGH), "145:11: " + getCheckMessage(MSG_FALL_THROUGH), "170:11: " + getCheckMessage(MSG_FALL_THROUGH), "179:11: " + getCheckMessage(MSG_FALL_THROUGH), "186:11: " + getCheckMessage(MSG_FALL_THROUGH), "204:11: " + getCheckMessage(MSG_FALL_THROUGH), "222:11: " + getCheckMessage(MSG_FALL_THROUGH), "252:26: " + getCheckMessage(MSG_FALL_THROUGH), "266:11: " + getCheckMessage(MSG_FALL_THROUGH), "281:11: " + getCheckMessage(MSG_FALL_THROUGH), "284:11: " + getCheckMessage(MSG_FALL_THROUGH), "288:11: " + getCheckMessage(MSG_FALL_THROUGH), "290:25: " + getCheckMessage(MSG_FALL_THROUGH), "306:11: " + getCheckMessage(MSG_FALL_THROUGH), "309:11: " + getCheckMessage(MSG_FALL_THROUGH), "311:25: " + getCheckMessage(MSG_FALL_THROUGH), "327:11: " + getCheckMessage(MSG_FALL_THROUGH), "330:11: " + getCheckMessage(MSG_FALL_THROUGH), "332:23: " + getCheckMessage(MSG_FALL_THROUGH), "348:11: " + getCheckMessage(MSG_FALL_THROUGH), "351:11: " + getCheckMessage(MSG_FALL_THROUGH), "353:30: " + getCheckMessage(MSG_FALL_THROUGH), "416:13: " + getCheckMessage(MSG_FALL_THROUGH), "424:9: " + getCheckMessage(MSG_FALL_THROUGH), "436:9: " + getCheckMessage(MSG_FALL_THROUGH), "446:9: " + getCheckMessage(MSG_FALL_THROUGH), "491:9: " + getCheckMessage(MSG_FALL_THROUGH), "495:9: " + getCheckMessage(MSG_FALL_THROUGH), "501:9: " + getCheckMessage(MSG_FALL_THROUGH), "507:9: " + getCheckMessage(MSG_FALL_THROUGH), "514:9: " + getCheckMessage(MSG_FALL_THROUGH) };
verify(checkConfig, getPath("InputFallThrough.java"), expected);
}
Aggregations