Add test with default configuration for ExecutableStatementCountCheck, issue #1129.
This commit is contained in:
parent
aa90bcf588
commit
79a4b0fc33
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue