Add test with default configuration for ClassDataAbstractionCouplingCheck, issue #1129.
This commit is contained in:
parent
2661faec4c
commit
a3a23a2695
|
|
@ -26,6 +26,7 @@ import org.junit.Test;
|
|||
|
||||
import static com.puppycrawl.tools.checkstyle.checks.metrics.ClassDataAbstractionCouplingCheck
|
||||
.MSG_KEY;
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
public class ClassDataAbstractionCouplingCheckTest extends BaseCheckTestSupport {
|
||||
@Test
|
||||
|
|
@ -46,4 +47,23 @@ public class ClassDataAbstractionCouplingCheckTest extends BaseCheckTestSupport
|
|||
getPath("metrics" + File.separator + "ClassCouplingCheckTestInput.java"),
|
||||
expected);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDefaultConfiguration() throws Exception {
|
||||
DefaultConfiguration checkConfig =
|
||||
createCheckConfig(ClassDataAbstractionCouplingCheck.class);
|
||||
String[] expected = {
|
||||
};
|
||||
|
||||
try {
|
||||
createChecker(checkConfig);
|
||||
verify(checkConfig,
|
||||
getPath("metrics" + File.separator + "ClassCouplingCheckTestInput.java"),
|
||||
expected);
|
||||
}
|
||||
catch (Exception ex) {
|
||||
//Exception is not expected
|
||||
fail();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue