Add test with default configuration for SummaryJavadocCheck, issue #1129.

This commit is contained in:
Andrei Selkin 2015-07-22 02:25:46 +03:00 committed by Roman Ivanov
parent 3f765e389d
commit 39ccb4c6fe
1 changed files with 20 additions and 0 deletions

View File

@ -27,6 +27,7 @@ import org.junit.Test;
import static com.puppycrawl.tools.checkstyle.checks.javadoc.SummaryJavadocCheck
.SUMMARY_FIRST_SENTENCE;
import static com.puppycrawl.tools.checkstyle.checks.javadoc.SummaryJavadocCheck.SUMMARY_JAVADOC;
import static org.junit.Assert.fail;
public class SummaryJavadocCheckTest extends BaseCheckTestSupport {
private DefaultConfiguration checkConfig;
@ -81,4 +82,23 @@ public class SummaryJavadocCheckTest extends BaseCheckTestSupport {
verify(checkConfig, getPath("javadoc/InputSummaryJavadocCheckNoPeriod.java"), expected);
}
@Test
public void testDefaultConfiguration() throws Exception {
final String[] expected = {
"14: " + getCheckMessage(SUMMARY_FIRST_SENTENCE),
"37: " + getCheckMessage(SUMMARY_FIRST_SENTENCE),
"69: " + getCheckMessage(SUMMARY_FIRST_SENTENCE),
"103: " + getCheckMessage(SUMMARY_FIRST_SENTENCE),
};
try {
createChecker(checkConfig);
verify(checkConfig, getPath("javadoc/InputIncorrectSummaryJavaDocCheck.java"), expected);
}
catch (Exception ex) {
//Exception is not expected
fail();
}
}
}