improve test coverage of HeaderCheck

This commit is contained in:
Lars Kühne 2002-11-17 15:41:06 +00:00
parent dce6e0d57e
commit a8dc464f06
1 changed files with 15 additions and 0 deletions

View File

@ -12,6 +12,7 @@ public class HeaderCheckTest extends BaseCheckTestCase
final CheckConfiguration checkConfig = new CheckConfiguration();
checkConfig.setClassname(HeaderCheck.class.getName());
checkConfig.addProperty("headerFile", getPath("java.header"));
checkConfig.addProperty("ignoreLines", "");
final Checker c = createChecker(checkConfig);
final String fname = getPath("inputHeader.java");
final String[] expected = {
@ -35,6 +36,20 @@ public class HeaderCheckTest extends BaseCheckTestCase
verify(c, fname, expected);
}
public void testRegexpHeaderIgnore()
throws Exception
{
final CheckConfiguration checkConfig = new CheckConfiguration();
checkConfig.setClassname(RegexpHeaderCheck.class.getName());
checkConfig.addProperty("headerFile", getPath("regexp.header"));
checkConfig.addProperty("ignoreLines", "3,4,5");
final Checker c = createChecker(checkConfig);
final String fname = getPath("InputScopeAnonInner.java");
final String[] expected = {
};
verify(c, fname, expected);
}
public void testNoHeader()
throws Exception
{