use of com.puppycrawl.tools.checkstyle.DefaultConfiguration in project checkstyle by checkstyle.
the class NPathComplexityCheckTest method testIntegerOverflow.
@Test
public void testIntegerOverflow() throws Exception {
final DefaultConfiguration checkConfig = createCheckConfig(NPathComplexityCheck.class);
checkConfig.addAttribute("max", "0");
final long largerThanMaxInt = 3_486_784_401L;
final String[] expected = { "9:5: " + getCheckMessage(MSG_KEY, largerThanMaxInt, 0) };
verify(checkConfig, getPath("InputComplexityOverflow.java"), expected);
}
use of com.puppycrawl.tools.checkstyle.DefaultConfiguration in project checkstyle by checkstyle.
the class ModifierOrderCheckTest method testAnnotationOnAnnotationDeclaration.
@Test
public void testAnnotationOnAnnotationDeclaration() throws Exception {
final DefaultConfiguration checkConfig = createCheckConfig(ModifierOrderCheck.class);
final String[] expected = { "3:8: " + getCheckMessage(MSG_ANNOTATION_ORDER, "@InterfaceAnnotation") };
verify(checkConfig, getPath("InputModifierOrderAnnotationDeclaration.java"), expected);
}
use of com.puppycrawl.tools.checkstyle.DefaultConfiguration in project checkstyle by checkstyle.
the class ModifierOrderCheckTest method testDefaultMethods.
@Test
public void testDefaultMethods() throws Exception {
final DefaultConfiguration checkConfig = createCheckConfig(ModifierOrderCheck.class);
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
verify(checkConfig, getPath("InputModifier2.java"), expected);
}
use of com.puppycrawl.tools.checkstyle.DefaultConfiguration in project checkstyle by checkstyle.
the class ModifierOrderCheckTest method testSkipTypeAnnotations.
@Test
public void testSkipTypeAnnotations() throws Exception {
// Type Annotations are avaliable only in Java 8
// We skip type annotations from validation
// See https://github.com/checkstyle/checkstyle/issues/903#issuecomment-172228013
final DefaultConfiguration checkConfig = createCheckConfig(ModifierOrderCheck.class);
final String[] expected = { "103:13: " + getCheckMessage(MSG_ANNOTATION_ORDER, "@MethodAnnotation") };
verify(checkConfig, getNonCompilablePath("InputTypeAnnotations.java"), expected);
}
use of com.puppycrawl.tools.checkstyle.DefaultConfiguration in project checkstyle by checkstyle.
the class RedundantModifierCheckTest method testIt.
@Test
public void testIt() throws Exception {
final DefaultConfiguration checkConfig = createCheckConfig(RedundantModifierCheck.class);
final String[] expected = { "54:12: " + getCheckMessage(MSG_KEY, "static"), "57:9: " + getCheckMessage(MSG_KEY, "public"), "63:9: " + getCheckMessage(MSG_KEY, "abstract"), "66:9: " + getCheckMessage(MSG_KEY, "public"), //"69:9: Redundant 'abstract' modifier.",
"72:9: " + getCheckMessage(MSG_KEY, "final"), "79:13: " + getCheckMessage(MSG_KEY, "final"), "88:12: " + getCheckMessage(MSG_KEY, "final"), "99:1: " + getCheckMessage(MSG_KEY, "abstract"), "116:5: " + getCheckMessage(MSG_KEY, "public"), "117:5: " + getCheckMessage(MSG_KEY, "final"), "118:5: " + getCheckMessage(MSG_KEY, "static"), "120:5: " + getCheckMessage(MSG_KEY, "public"), "121:5: " + getCheckMessage(MSG_KEY, "abstract") };
verify(checkConfig, getPath("InputModifier.java"), expected);
}
Aggregations