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