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

This commit is contained in:
Andrei Selkin 2015-07-22 02:24:42 +03:00 committed by Roman Ivanov
parent aa90bcf588
commit 79a4b0fc33
1 changed files with 18 additions and 0 deletions

View File

@ -20,6 +20,7 @@
package com.puppycrawl.tools.checkstyle.checks.sizes;
import static com.puppycrawl.tools.checkstyle.checks.sizes.ExecutableStatementCountCheck.MSG_KEY;
import static org.junit.Assert.fail;
import antlr.CommonHiddenStreamToken;
import com.puppycrawl.tools.checkstyle.BaseCheckTestSupport;
@ -138,4 +139,21 @@ public class ExecutableStatementCountCheckTest
new CommonHiddenStreamToken(TokenTypes.ENUM, "ENUM"));
checkObj.leaveToken(ast);
}
@Test
public void testDefaultConfiguration() throws Exception {
DefaultConfiguration checkConfig =
createCheckConfig(ExecutableStatementCountCheck.class);
String[] expected = {
};
try {
createChecker(checkConfig);
verify(checkConfig, getPath("ExecutableStatementCountInput.java"), expected);
}
catch (Exception ex) {
//Exception is not expected
fail();
}
}
}