KickJava   Java API By Example, From Geeks To Geeks.

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


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 ClassDataAbstractionCouplingCheckTest extends BaseCheckTestCase
9 {
10     public void test() throws Exception JavaDoc {
11         DefaultConfiguration checkConfig =
12             createCheckConfig(ClassDataAbstractionCouplingCheck.class);
13
14         checkConfig.addAttribute("max", "0");
15
16         String JavaDoc[] expected = {
17             "6:1: Class Data Abstraction Coupling is 4 (max allowed is 0) classes [AnotherInnerClass, InnerClass, HashSet, HashMap].",
18             "7:5: Class Data Abstraction Coupling is 1 (max allowed is 0) classes [ArrayList].",
19             "27:1: Class Data Abstraction Coupling is 2 (max allowed is 0) classes [HashSet, HashMap].",
20         };
21
22         verify(checkConfig,
23                getPath("metrics" + File.separator + "ClassCouplingCheckTestInput.java"),
24                expected);
25     }
26 }
27
Popular Tags