-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue #14937: Migrated section 3.2 Package Statement to follow chapte…
…r wise testing
- Loading branch information
Showing
13 changed files
with
123 additions
and
353 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
...le/checkstyle/test/chapter3filestructure/rule32packagestatement/PackageStatementTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/////////////////////////////////////////////////////////////////////////////////////////////// | ||
// checkstyle: Checks Java source code and other text files for adherence to a set of rules. | ||
// Copyright (C) 2001-2024 the original author or authors. | ||
// | ||
// This library is free software; you can redistribute it and/or | ||
// modify it under the terms of the GNU Lesser General Public | ||
// License as published by the Free Software Foundation; either | ||
// version 2.1 of the License, or (at your option) any later version. | ||
// | ||
// This library is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
// Lesser General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU Lesser General Public | ||
// License along with this library; if not, write to the Free Software | ||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
/////////////////////////////////////////////////////////////////////////////////////////////// | ||
|
||
package com.google.checkstyle.test.chapter3filestructure.rule32packagestatement; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
import com.google.checkstyle.test.base.AbstractGoogleModuleTestSupport; | ||
|
||
public class PackageStatementTest extends AbstractGoogleModuleTestSupport { | ||
|
||
@Override | ||
protected String getPackageLocation() { | ||
return "com/google/checkstyle/test/chapter3filestructure/rule32packagestatement"; | ||
} | ||
|
||
@Test | ||
public void testPackageStatement() throws Exception { | ||
final String filePath = getPath("InputPackageStatement.java"); | ||
|
||
final String[] listOfModules = { | ||
"LineLength", | ||
"NoLineWrap", | ||
}; | ||
|
||
verifyWithGoogleConfigParser(listOfModules, filePath); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
...3filestructure/toolongpackagetotestcoveragegooglesjavastylerule/PackageStatementTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/////////////////////////////////////////////////////////////////////////////////////////////// | ||
// checkstyle: Checks Java source code and other text files for adherence to a set of rules. | ||
// Copyright (C) 2001-2024 the original author or authors. | ||
// | ||
// This library is free software; you can redistribute it and/or | ||
// modify it under the terms of the GNU Lesser General Public | ||
// License as published by the Free Software Foundation; either | ||
// version 2.1 of the License, or (at your option) any later version. | ||
// | ||
// This library is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
// Lesser General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU Lesser General Public | ||
// License along with this library; if not, write to the Free Software | ||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
/////////////////////////////////////////////////////////////////////////////////////////////// | ||
|
||
package com.google.checkstyle.test.chapter3filestructure.toolongpackagetotestcoveragegooglesjavastylerule; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
import com.google.checkstyle.test.base.AbstractGoogleModuleTestSupport; | ||
|
||
public class PackageStatementTest extends AbstractGoogleModuleTestSupport { | ||
|
||
@Override | ||
protected String getPackageLocation() { | ||
return "com/google/checkstyle/test/chapter3filestructure/" | ||
+ "toolongpackagetotestcoveragegooglesjavastylerule"; | ||
} | ||
|
||
@Test | ||
public void testPackageStatement() throws Exception { | ||
final String filePath = getPath("InputPackageStatementLongName.java"); | ||
|
||
final String[] listOfModules = { | ||
"LineLength", | ||
"NoLineWrap", | ||
}; | ||
|
||
verifyWithGoogleConfigParser(listOfModules, filePath); | ||
} | ||
} |
77 changes: 0 additions & 77 deletions
77
.../com/google/checkstyle/test/chapter3filestructure/rule32packagestate/InputLineLength.java
This file was deleted.
Oops, something went wrong.
10 changes: 10 additions & 0 deletions
10
...e/checkstyle/test/chapter3filestructure/rule32packagestatement/InputPackageStatement.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package com.google.checkstyle.test. // violation 'package statement should not be line-wrapped.' | ||
chapter3filestructure.rule32packagestatement; | ||
|
||
public class InputPackageStatement { | ||
// Long line ---------------------------------------------------------------------------------------- | ||
// violation above 'Line is longer than 100 characters (found 103).' | ||
|
||
private int[] mInts = new int[] {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24}; | ||
// violation above 'Line is longer than 100 characters (found 174).' | ||
} |
Oops, something went wrong.