01: package com.puppycrawl.tools.checkstyle.checks.metrics;
02:
03: import com.puppycrawl.tools.checkstyle.BaseCheckTestCase;
04: import com.puppycrawl.tools.checkstyle.DefaultConfiguration;
05:
06: import java.io.File;
07:
08: public class ClassFanOutComplexityCheckTest extends BaseCheckTestCase {
09: public void test() throws Exception {
10: DefaultConfiguration checkConfig = createCheckConfig(ClassFanOutComplexityCheck.class);
11:
12: checkConfig.addAttribute("max", "0");
13:
14: String[] expected = {
15: "6:1: Class Fan-Out Complexity is 7 (max allowed is 0).",
16: "7:5: Class Fan-Out Complexity is 2 (max allowed is 0).",
17: "27:1: Class Fan-Out Complexity is 4 (max allowed is 0).", };
18:
19: verify(checkConfig, getPath("metrics" + File.separator
20: + "ClassCouplingCheckTestInput.java"), expected);
21: }
22:
23: public void test15() throws Exception {
24: DefaultConfiguration checkConfig = createCheckConfig(ClassFanOutComplexityCheck.class);
25:
26: checkConfig.addAttribute("max", "0");
27:
28: String[] expected = {};
29:
30: verify(checkConfig, getPath("Input15Extensions.java"), expected);
31: }
32: }
|