use of com.puppycrawl.tools.checkstyle.DefaultConfiguration in project checkstyle by checkstyle.
the class AtclauseOrderCheckTest method testIncorrect.
@Test
public void testIncorrect() throws Exception {
final String tagOrder = "[@author, @version, @param, @return, @throws, @exception, @see," + " @since, @serial, @serialField, @serialData, @deprecated]";
final DefaultConfiguration checkConfig = createCheckConfig(AtclauseOrderCheck.class);
final String[] expected = { "9: " + getCheckMessage(MSG_KEY, tagOrder), "11: " + getCheckMessage(MSG_KEY, tagOrder), "12: " + getCheckMessage(MSG_KEY, tagOrder), "40: " + getCheckMessage(MSG_KEY, tagOrder), "50: " + getCheckMessage(MSG_KEY, tagOrder), "51: " + getCheckMessage(MSG_KEY, tagOrder), "52: " + getCheckMessage(MSG_KEY, tagOrder), "62: " + getCheckMessage(MSG_KEY, tagOrder), "69: " + getCheckMessage(MSG_KEY, tagOrder), "86: " + getCheckMessage(MSG_KEY, tagOrder), "87: " + getCheckMessage(MSG_KEY, tagOrder), "99: " + getCheckMessage(MSG_KEY, tagOrder), "100: " + getCheckMessage(MSG_KEY, tagOrder), "101: " + getCheckMessage(MSG_KEY, tagOrder), "115: " + getCheckMessage(MSG_KEY, tagOrder), "123: " + getCheckMessage(MSG_KEY, tagOrder), "124: " + getCheckMessage(MSG_KEY, tagOrder), "134: " + getCheckMessage(MSG_KEY, tagOrder), "135: " + getCheckMessage(MSG_KEY, tagOrder), "145: " + getCheckMessage(MSG_KEY, tagOrder), "146: " + getCheckMessage(MSG_KEY, tagOrder), "153: " + getCheckMessage(MSG_KEY, tagOrder), "161: " + getCheckMessage(MSG_KEY, tagOrder), "172: " + getCheckMessage(MSG_KEY, tagOrder), "183: " + getCheckMessage(MSG_KEY, tagOrder), "185: " + getCheckMessage(MSG_KEY, tagOrder), "199: " + getCheckMessage(MSG_KEY, tagOrder), "202: " + getCheckMessage(MSG_KEY, tagOrder), "213: " + getCheckMessage(MSG_KEY, tagOrder), "223: " + getCheckMessage(MSG_KEY, tagOrder), "230: " + getCheckMessage(MSG_KEY, tagOrder), "237: " + getCheckMessage(MSG_KEY, tagOrder), "247: " + getCheckMessage(MSG_KEY, tagOrder), "248: " + getCheckMessage(MSG_KEY, tagOrder), "259: " + getCheckMessage(MSG_KEY, tagOrder), "261: " + getCheckMessage(MSG_KEY, tagOrder), "275: " + getCheckMessage(MSG_KEY, tagOrder), "277: " + getCheckMessage(MSG_KEY, tagOrder), "278: " + getCheckMessage(MSG_KEY, tagOrder), "288: " + getCheckMessage(MSG_KEY, tagOrder) };
verify(checkConfig, getPath("InputIncorrectAtClauseOrder.java"), expected);
}
use of com.puppycrawl.tools.checkstyle.DefaultConfiguration in project checkstyle by checkstyle.
the class JavadocMethodCheckTest method allowedAnnotationsTest.
@Test
public void allowedAnnotationsTest() throws Exception {
final DefaultConfiguration config = createCheckConfig(JavadocMethodCheck.class);
config.addAttribute("allowedAnnotations", "Override,ThisIsOk, \t\n\t ThisIsOkToo");
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
verify(config, getPath("InputAllowedAnnotations.java"), expected);
}
use of com.puppycrawl.tools.checkstyle.DefaultConfiguration in project checkstyle by checkstyle.
the class JavadocMethodCheckTest method extendAnnotationTest.
@Test
public void extendAnnotationTest() throws Exception {
final DefaultConfiguration config = createCheckConfig(JavadocMethodCheck.class);
config.addAttribute("allowedAnnotations", "MyAnnotation, Override");
config.addAttribute("minLineCount", "2");
final String[] expected = { "44:1: " + getCheckMessage(MSG_JAVADOC_MISSING) };
verify(config, getPath("InputExtendAnnotation.java"), expected);
}
use of com.puppycrawl.tools.checkstyle.DefaultConfiguration in project checkstyle by checkstyle.
the class JavadocMethodCheckTest method newTest.
@Test
public void newTest() throws Exception {
final DefaultConfiguration config = createCheckConfig(JavadocMethodCheck.class);
config.addAttribute("allowedAnnotations", "MyAnnotation, Override");
config.addAttribute("minLineCount", "2");
final String[] expected = { "57:5: " + getCheckMessage(MSG_JAVADOC_MISSING) };
verify(config, getPath("InputJavadocMethodSmallMethods.java"), expected);
}
use of com.puppycrawl.tools.checkstyle.DefaultConfiguration in project checkstyle by checkstyle.
the class CyclomaticComplexityCheckTest method testHighMax.
@Test
public void testHighMax() throws Exception {
final DefaultConfiguration checkConfig = createCheckConfig(CyclomaticComplexityCheck.class);
checkConfig.addAttribute("max", "100");
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
verify(checkConfig, getPath("InputComplexitySwitchBlocks.java"), expected);
}
Aggregations