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

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

View File

@ -25,6 +25,7 @@ import java.text.NumberFormat;
import org.junit.Test;
import static com.puppycrawl.tools.checkstyle.checks.metrics.NPathComplexityCheck.MSG_KEY;
import static org.junit.Assert.fail;
public class NPathComplexityCheckTest extends BaseCheckTestSupport {
@Test
@ -66,4 +67,21 @@ public class NPathComplexityCheckTest extends BaseCheckTestSupport {
verify(checkConfig, getPath("ComplexityOverflow.java"), expected);
}
@Test
public void testDefaultConfiguration() throws Exception {
DefaultConfiguration checkConfig =
createCheckConfig(NPathComplexityCheck.class);
String[] expected = {
};
try {
createChecker(checkConfig);
verify(checkConfig, getPath("ComplexityCheckTestInput.java"), expected);
}
catch (Exception ex) {
// Exception is not expected
fail();
}
}
}