1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 package com.google.checkstyle.test.chapter4formatting.rule4841indentation;
21
22 import org.junit.jupiter.api.Test;
23
24 import com.google.checkstyle.test.base.AbstractIndentationTestSupport;
25
26 public class IndentationTest extends AbstractIndentationTestSupport {
27
28 @Override
29 protected String getPackageLocation() {
30 return "com/google/checkstyle/test/chapter4formatting/rule4841indentation";
31 }
32
33 @Test
34 public void testCorrectClass() throws Exception {
35 verifyWithWholeConfig(getPath("InputIndentationCorrectClass.java"));
36 }
37
38 @Test
39 public void testCorrectField() throws Exception {
40 verifyWithWholeConfig(getPath("InputIndentationCorrectFieldAndParameter.java"));
41 }
42
43 @Test
44 public void testCorrectFor() throws Exception {
45 verifyWithWholeConfig(getPath("InputIndentationCorrectForAndParameter.java"));
46 }
47
48 @Test
49 public void testCorrectIf() throws Exception {
50 verifyWithWholeConfig(getPath("InputIndentationCorrectIfAndParameter.java"));
51 }
52
53 @Test
54 public void testCorrectNewKeyword() throws Exception {
55 verifyWithWholeConfig(getPath("InputIndentationCorrectNewChildren.java"));
56 }
57
58 @Test
59 public void testCorrect() throws Exception {
60 verifyWithWholeConfig(getPath("InputIndentationCorrect.java"));
61 }
62
63 @Test
64 public void testCorrectReturn() throws Exception {
65 verifyWithWholeConfig(getPath("InputIndentationCorrectReturnAndParameter.java"));
66 }
67
68 @Test
69 public void testCorrectWhile() throws Exception {
70 verifyWithWholeConfig(getPath("InputIndentationCorrectWhileDoWhileAndParameter.java"));
71 }
72
73 @Test
74 public void testCorrectChained() throws Exception {
75 verifyWithWholeConfig(getPath("InputClassWithChainedMethodsCorrect.java"));
76 }
77
78 @Test
79 public void testWarnChained() throws Exception {
80 verifyWithWholeConfig(getPath("InputClassWithChainedMethods.java"));
81 }
82
83 @Test
84 public void testWarnChainedFormatted() throws Exception {
85 verifyWithWholeConfig(getPath("InputFormattedClassWithChainedMethods.java"));
86 }
87
88 @Test
89 public void testCorrectAnnotationArrayInit() throws Exception {
90 verifyWithWholeConfig(getPath("InputIndentationCorrectAnnotationArrayInit.java"));
91 }
92
93 @Test
94 public void testFastMatcher() throws Exception {
95 verifyWithWholeConfig(getPath("InputFastMatcher.java"));
96 }
97
98 @Test
99 public void testSwitchOnTheStartOfTheLine() throws Exception {
100 verifyWithWholeConfig(getNonCompilablePath("InputSwitchOnStartOfTheLine.java"));
101 }
102
103 @Test
104 public void testSingleSwitchStatementWithoutCurly() throws Exception {
105 verifyWithWholeConfig(getNonCompilablePath("InputSingleSwitchStatementWithoutCurly.java"));
106 }
107
108 @Test
109 public void testSwitchWrappingIndentation() throws Exception {
110 verifyWithWholeConfig(getNonCompilablePath("InputSwitchWrappingIndentation.java"));
111 }
112
113 @Test
114 public void testMultilineParameters() throws Exception {
115 verifyWithWholeConfig(getNonCompilablePath("InputCatchParametersOnNewLine.java"));
116 }
117
118 @Test
119 public void testLambdaChild() throws Exception {
120 verifyWithWholeConfig(getNonCompilablePath("InputLambdaChild.java"));
121 }
122 }