View Javadoc
1   ///////////////////////////////////////////////////////////////////////////////////////////////
2   // checkstyle: Checks Java source code and other text files for adherence to a set of rules.
3   // Copyright (C) 2001-2024 the original author or authors.
4   //
5   // This library is free software; you can redistribute it and/or
6   // modify it under the terms of the GNU Lesser General Public
7   // License as published by the Free Software Foundation; either
8   // version 2.1 of the License, or (at your option) any later version.
9   //
10  // This library is distributed in the hope that it will be useful,
11  // but WITHOUT ANY WARRANTY; without even the implied warranty of
12  // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  // Lesser General Public License for more details.
14  //
15  // You should have received a copy of the GNU Lesser General Public
16  // License along with this library; if not, write to the Free Software
17  // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18  ///////////////////////////////////////////////////////////////////////////////////////////////
19  
20  package com.google.checkstyle.test.chapter3filestructure.rule333orderingandspacing;
21  
22  import org.junit.jupiter.api.Test;
23  
24  import com.google.checkstyle.test.base.AbstractGoogleModuleTestSupport;
25  
26  public class OrderingAndSpacingTest extends AbstractGoogleModuleTestSupport {
27      @Override
28      protected String getPackageLocation() {
29          return "com/google/checkstyle/test/chapter3filestructure/rule333orderingandspacing";
30      }
31  
32      @Test
33      public void testCustomImport1() throws Exception {
34          verifyWithWholeConfig(getPath("InputOrderingAndSpacing1.java"));
35      }
36  
37      @Test
38      public void testCustomImport1Formatted() throws Exception {
39          verifyWithWholeConfig(getPath("InputFormattedOrderingAndSpacing1.java"));
40      }
41  
42      @Test
43      public void testCustomImport2() throws Exception {
44          verifyWithWholeConfig(getPath("InputOrderingAndSpacing2.java"));
45      }
46  
47      @Test
48      public void testCustomImport2Formatted() throws Exception {
49          verifyWithWholeConfig(getPath("InputFormattedOrderingAndSpacing2.java"));
50      }
51  
52      @Test
53      public void testCustomImport3() throws Exception {
54          verifyWithWholeConfig(getPath("InputOrderingAndSpacing3.java"));
55      }
56  
57      @Test
58      public void testCustomImport3Formatted() throws Exception {
59          verifyWithWholeConfig(getPath("InputFormattedOrderingAndSpacing3.java"));
60      }
61  
62      @Test
63      public void testCustomImport4() throws Exception {
64          verifyWithWholeConfig(getPath("InputOrderingAndSpacing4.java"));
65      }
66  
67      @Test
68      public void testCustomImport4Formatted() throws Exception {
69          verifyWithWholeConfig(getPath("InputFormattedOrderingAndSpacing4.java"));
70      }
71  
72      @Test
73      public void testCustomImport5() throws Exception {
74          verifyWithWholeConfig(getPath("InputOrderingAndSpacing5.java"));
75      }
76  
77      @Test
78      public void testCustomImport5Formatted() throws Exception {
79          verifyWithWholeConfig(getPath("InputFormattedOrderingAndSpacing5.java"));
80      }
81  
82      @Test
83      public void testValid() throws Exception {
84          verifyWithWholeConfig(getPath("InputOrderingAndSpacingValid.java"));
85      }
86  
87      @Test
88      public void testValidFormatted() throws Exception {
89          verifyWithWholeConfig(getPath("InputFormattedOrderingAndSpacingValid.java"));
90      }
91  
92      @Test
93      public void testValid2() throws Exception {
94          verifyWithWholeConfig(getPath("InputOrderingAndSpacingValid2.java"));
95      }
96  
97      @Test
98      public void testValid2Formatted() throws Exception {
99          verifyWithWholeConfig(getPath("InputFormattedOrderingAndSpacingValid2.java"));
100     }
101 
102     @Test
103     public void testValidGoogleStyleOrderOfImports() throws Exception {
104         verifyWithWholeConfig(getPath("InputOrderingAndSpacingNoImports.java"));
105     }
106 
107     @Test
108     public void testValidGoogleStyleOrderOfImportsFormatted() throws Exception {
109         verifyWithWholeConfig(getPath("InputFormattedOrderingAndSpacingNoImports.java"));
110     }
111 
112 }