use of com.puppycrawl.tools.checkstyle.DefaultConfiguration in project checkstyle by checkstyle.
the class JavadocStyleCheckTest method testDefaultSettings.
@Test
public void testDefaultSettings() throws Exception {
final DefaultConfiguration checkConfig = createCheckConfig(JavadocStyleCheck.class);
final String[] expected = { "20: " + getCheckMessage(MSG_NO_PERIOD), "53: " + getCheckMessage(MSG_NO_PERIOD), "63:11: " + getCheckMessage(MSG_UNCLOSED_HTML, "<b>This guy is missing end of bold tag"), "66:7: " + getCheckMessage(MSG_EXTRA_HTML, "</td>Extra tag shouldn't be here"), "68:19: " + getCheckMessage(MSG_UNCLOSED_HTML, "<code>dummy."), "74: " + getCheckMessage(MSG_NO_PERIOD), "75:23: " + getCheckMessage(MSG_UNCLOSED_HTML, "<b>should fail"), "81: " + getCheckMessage(MSG_NO_PERIOD), "82:31: " + getCheckMessage(MSG_UNCLOSED_HTML, "<b>should fail"), "88: " + getCheckMessage(MSG_NO_PERIOD), "89:31: " + getCheckMessage(MSG_EXTRA_HTML, "</code>"), "90: " + getCheckMessage(MSG_INCOMPLETE_TAG, " * should fail <"), "109:39: " + getCheckMessage(MSG_EXTRA_HTML, "</img>"), "186:8: " + getCheckMessage(MSG_UNCLOSED_HTML, "<blockquote>"), "193: " + getCheckMessage(MSG_NO_PERIOD), "238: " + getCheckMessage(MSG_NO_PERIOD), "335:33: " + getCheckMessage(MSG_EXTRA_HTML, "</string>"), "361:37: " + getCheckMessage(MSG_UNCLOSED_HTML, "<code>"), "372: " + getCheckMessage(MSG_NO_PERIOD), "378:15: " + getCheckMessage(MSG_UNCLOSED_HTML, "<b>Note:<b> it's unterminated tag.</p>"), "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);
}
use of com.puppycrawl.tools.checkstyle.DefaultConfiguration in project checkstyle by checkstyle.
the class JavadocStyleCheckTest method testRestrictedTokenSet.
@Test
public void testRestrictedTokenSet() throws Exception {
final DefaultConfiguration checkConfig = createCheckConfig(JavadocStyleCheck.class);
checkConfig.addAttribute("tokens", "METHOD_DEF");
checkConfig.addAttribute("scope", "public");
checkConfig.addAttribute("checkFirstSentence", "true");
checkConfig.addAttribute("checkEmptyJavadoc", "false");
checkConfig.addAttribute("checkHtml", "false");
final String[] expected = { "88: " + 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 JavadocTypeCheckTest method testTags.
@Test
public void testTags() throws Exception {
final DefaultConfiguration checkConfig = createCheckConfig(JavadocTypeCheck.class);
final String[] expected = { "8: " + getCheckMessage(MSG_JAVADOC_MISSING), "302: " + getCheckMessage(MSG_JAVADOC_MISSING), "327: " + getCheckMessage(MSG_JAVADOC_MISSING) };
verify(checkConfig, getPath("InputTags.java"), expected);
}
use of com.puppycrawl.tools.checkstyle.DefaultConfiguration in project checkstyle by checkstyle.
the class JavadocTypeCheckTest method testAuthorRegularEx.
@Test
public void testAuthorRegularEx() throws Exception {
final DefaultConfiguration checkConfig = createCheckConfig(JavadocTypeCheck.class);
checkConfig.addAttribute("authorFormat", "0*");
final String[] expected = { "22: " + getCheckMessage(MSG_MISSING_TAG, "@author"), "58: " + getCheckMessage(MSG_MISSING_TAG, "@author"), "94: " + getCheckMessage(MSG_MISSING_TAG, "@author") };
verify(checkConfig, getPath("InputJavadoc.java"), expected);
}
use of com.puppycrawl.tools.checkstyle.DefaultConfiguration in project checkstyle by checkstyle.
the class JavadocTypeCheckTest method testBadTagSuppress.
@Test
public void testBadTagSuppress() throws Exception {
final DefaultConfiguration checkConfig = createCheckConfig(JavadocTypeCheck.class);
checkConfig.addAttribute("allowUnknownTags", "true");
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
verify(checkConfig, getPath("InputBadTag.java"), expected);
}
Aggregations