use of com.puppycrawl.tools.checkstyle.DefaultConfiguration in project checkstyle by checkstyle.
the class JavadocPackageCheckTest method testMissingWithAllowLegacy.
@Test
public void testMissingWithAllowLegacy() throws Exception {
final DefaultConfiguration checkConfig = createCheckConfig(JavadocPackageCheck.class);
checkConfig.addAttribute("allowLegacy", "true");
final String[] expected = { "0: " + getCheckMessage(MSG_PACKAGE_INFO) };
verify(createChecker(checkConfig), getPath("InputBadCls.java"), getPath("InputBadCls.java"), expected);
}
use of com.puppycrawl.tools.checkstyle.DefaultConfiguration in project checkstyle by checkstyle.
the class JavadocStyleCheckTest method packageInfoMissing.
@Test
public void packageInfoMissing() throws Exception {
final DefaultConfiguration checkConfig = createCheckConfig(JavadocStyleCheck.class);
final String[] expected = { "1: " + getCheckMessage(MSG_JAVADOC_MISSING) };
verify(createChecker(checkConfig), getPath("bothfiles" + File.separator + "package-info.java"), expected);
}
use of com.puppycrawl.tools.checkstyle.DefaultConfiguration in project checkstyle by checkstyle.
the class JavadocStyleCheckTest method packageInfoAnnotation.
@Test
public void packageInfoAnnotation() throws Exception {
final DefaultConfiguration checkConfig = createCheckConfig(JavadocStyleCheck.class);
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
verify(createChecker(checkConfig), getPath("pkginfo" + File.separator + "annotation" + File.separator + "package-info.java"), expected);
}
use of com.puppycrawl.tools.checkstyle.DefaultConfiguration in project checkstyle by checkstyle.
the class JavadocStyleCheckTest method testScopePublic.
@Test
public void testScopePublic() throws Exception {
final DefaultConfiguration checkConfig = createCheckConfig(JavadocStyleCheck.class);
checkConfig.addAttribute("checkFirstSentence", "true");
checkConfig.addAttribute("checkHtml", "true");
checkConfig.addAttribute("checkEmptyJavadoc", "true");
checkConfig.addAttribute("scope", "public");
final String[] expected = { "88: " + getCheckMessage(MSG_NO_PERIOD), "89:31: " + getCheckMessage(MSG_EXTRA_HTML, "</code>"), "90: " + getCheckMessage(MSG_INCOMPLETE_TAG, " * should fail <"), "205: " + getCheckMessage(MSG_EMPTY), "230: " + getCheckMessage(MSG_EMPTY), "238: " + getCheckMessage(MSG_NO_PERIOD), "335:33: " + getCheckMessage(MSG_EXTRA_HTML, "</string>"), "382: " + getCheckMessage(MSG_NO_PERIOD), "386: " + getCheckMessage(MSG_NO_PERIOD), "418: " + getCheckMessage(MSG_NO_PERIOD) };
verify(checkConfig, getPath("InputJavadocStyle.java"), expected);
}
use of com.puppycrawl.tools.checkstyle.DefaultConfiguration in project checkstyle by checkstyle.
the class JavadocStyleCheckTest method testFirstSentence.
@Test
public void testFirstSentence() throws Exception {
final DefaultConfiguration checkConfig = createCheckConfig(JavadocStyleCheck.class);
checkConfig.addAttribute("checkFirstSentence", "true");
checkConfig.addAttribute("checkHtml", "false");
final String[] expected = { "20: " + getCheckMessage(MSG_NO_PERIOD), "53: " + getCheckMessage(MSG_NO_PERIOD), "74: " + getCheckMessage(MSG_NO_PERIOD), "81: " + getCheckMessage(MSG_NO_PERIOD), "88: " + getCheckMessage(MSG_NO_PERIOD), "193: " + getCheckMessage(MSG_NO_PERIOD), "238: " + getCheckMessage(MSG_NO_PERIOD), "372: " + getCheckMessage(MSG_NO_PERIOD), "382: " + getCheckMessage(MSG_NO_PERIOD), "386: " + getCheckMessage(MSG_NO_PERIOD), "393: " + getCheckMessage(MSG_NO_PERIOD), "405: " + getCheckMessage(MSG_NO_PERIOD), "418: " + getCheckMessage(MSG_NO_PERIOD) };
verify(checkConfig, getPath("InputJavadocStyle.java"), expected);
}
Aggregations