KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > puppycrawl > tools > checkstyle > checks > coding > DeclarationOrderCheckTest


1 package com.puppycrawl.tools.checkstyle.checks.coding;
2
3 import com.puppycrawl.tools.checkstyle.BaseCheckTestCase;
4 import com.puppycrawl.tools.checkstyle.DefaultConfiguration;
5
6 public class DeclarationOrderCheckTest
7     extends BaseCheckTestCase
8 {
9     public void testDefault() throws Exception JavaDoc
10     {
11         final DefaultConfiguration checkConfig =
12             createCheckConfig(DeclarationOrderCheck.class);
13         
14         final String JavaDoc[] expected = {
15             "8:5: Variable access definition in wrong order.",
16             "13:5: Variable access definition in wrong order.",
17             "18:5: Variable access definition in wrong order.",
18             "21:5: Variable access definition in wrong order.",
19             "27:5: Static variable definition in wrong order.",
20             "27:5: Variable access definition in wrong order.",
21             "34:9: Variable access definition in wrong order.",
22             "45:9: Static variable definition in wrong order.",
23             "45:9: Variable access definition in wrong order.",
24             "54:5: Constructor definition in wrong order.",
25             "80:5: Instance variable definition in wrong order.",
26
27             "92:9: Variable access definition in wrong order.",
28             "100:9: Static variable definition in wrong order.",
29             "100:9: Variable access definition in wrong order.",
30             "106:5: Variable access definition in wrong order.",
31             "111:5: Variable access definition in wrong order.",
32             "116:5: Variable access definition in wrong order.",
33             "119:5: Variable access definition in wrong order.",
34             "125:5: Static variable definition in wrong order.",
35             "125:5: Variable access definition in wrong order.",
36             "132:9: Variable access definition in wrong order.",
37             "143:9: Static variable definition in wrong order.",
38             "143:9: Variable access definition in wrong order.",
39             "152:5: Constructor definition in wrong order.",
40             "178:5: Instance variable definition in wrong order.",
41         };
42         verify(checkConfig, getPath("coding/InputDeclarationOrder.java"), expected);
43     }
44 }
45
Popular Tags