use of com.puppycrawl.tools.checkstyle.DefaultConfiguration in project checkstyle by checkstyle.
the class BooleanExpressionComplexityCheckTest method testNoBitwise.
@Test
public void testNoBitwise() throws Exception {
final DefaultConfiguration checkConfig = createCheckConfig(BooleanExpressionComplexityCheck.class);
checkConfig.addAttribute("max", "5");
checkConfig.addAttribute("tokens", "BXOR,LAND,LOR");
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
verify(checkConfig, getPath("InputBooleanExpressionComplexity.java"), expected);
}
use of com.puppycrawl.tools.checkstyle.DefaultConfiguration in project checkstyle by checkstyle.
the class ClassDataAbstractionCouplingCheckTest method test.
@Test
public void test() throws Exception {
final DefaultConfiguration checkConfig = createCheckConfig(ClassDataAbstractionCouplingCheck.class);
checkConfig.addAttribute("max", "0");
checkConfig.addAttribute("excludedClasses", "InnerClass");
final String[] expected = { "6:1: " + getCheckMessage(MSG_KEY, 4, 0, "[AnotherInnerClass, HashMap, HashSet, int]"), "7:5: " + getCheckMessage(MSG_KEY, 1, 0, "[ArrayList]"), "27:1: " + getCheckMessage(MSG_KEY, 2, 0, "[HashMap, HashSet]") };
verify(checkConfig, getPath("InputClassCoupling.java"), expected);
}
use of com.puppycrawl.tools.checkstyle.DefaultConfiguration in project checkstyle by checkstyle.
the class ClassFanOutComplexityCheckTest method testDefaultConfiguration.
@Test
public void testDefaultConfiguration() throws Exception {
final DefaultConfiguration checkConfig = createCheckConfig(ClassFanOutComplexityCheck.class);
createChecker(checkConfig);
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
verify(checkConfig, getPath("InputClassCoupling.java"), expected);
}
use of com.puppycrawl.tools.checkstyle.DefaultConfiguration in project checkstyle by checkstyle.
the class JavadocPackageCheckTest method testHtmlAllowed.
@Test
public void testHtmlAllowed() throws Exception {
final DefaultConfiguration checkConfig = createCheckConfig(JavadocPackageCheck.class);
checkConfig.addAttribute("allowLegacy", "true");
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
verify(createChecker(checkConfig), getPath("pkghtml" + File.separator + "InputIgnored.java"), getPath("pkghtml" + File.separator + "package-info.java"), expected);
}
use of com.puppycrawl.tools.checkstyle.DefaultConfiguration in project checkstyle by checkstyle.
the class JavadocPackageCheckTest method testMissingWithAllowLegacy.
@Test
public void testMissingWithAllowLegacy() throws Exception {
final DefaultConfiguration checkConfig = createCheckConfig(JavadocPackageCheck.class);
checkConfig.addAttribute("allowLegacy", "true");
final String[] expected = { "0: " + getCheckMessage(MSG_PACKAGE_INFO) };
verify(createChecker(checkConfig), getPath("InputBadCls.java"), getPath("InputBadCls.java"), expected);
}
Aggregations