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 ; 7 8 public class ClassFanOutComplexityCheckTest extends BaseCheckTestCase { 9 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 20 verify(checkConfig, getPath("metrics" + File.separator +"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 31 verify(checkConfig, getPath("Input15Extensions.java"), expected); 32 } 33 } 34 | Popular Tags |