KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > puppycrawl > tools > checkstyle > checks > metrics > ClassFanOutComplexityCheckTest


1 package com.puppycrawl.tools.checkstyle.checks.metrics;
2
3 import com.puppycrawl.tools.checkstyle.BaseCheckTestCase;
4 import com.puppycrawl.tools.checkstyle.DefaultConfiguration;
5
6 import java.io.File JavaDoc;
7
8 public class ClassFanOutComplexityCheckTest extends BaseCheckTestCase {
9     public void test() throws Exception JavaDoc {
10         DefaultConfiguration checkConfig = createCheckConfig(ClassFanOutComplexityCheck.class);
11
12         checkConfig.addAttribute("max", "0");
13
14         String JavaDoc[] 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
20         verify(checkConfig, getPath("metrics" + File.separator +"ClassCouplingCheckTestInput.java"), expected);
21     }
22
23     public void test15() throws Exception JavaDoc {
24         DefaultConfiguration checkConfig = createCheckConfig(ClassFanOutComplexityCheck.class);
25
26         checkConfig.addAttribute("max", "0");
27
28         String JavaDoc[] expected = {
29         };
30
31         verify(checkConfig, getPath("Input15Extensions.java"), expected);
32     }
33 }
34
Popular Tags