|
50 | 50 | import org.junit.jupiter.api.BeforeEach; |
51 | 51 | import org.junit.jupiter.api.Disabled; |
52 | 52 | import org.junit.jupiter.api.Test; |
| 53 | +import org.junit.jupiter.api.condition.EnabledOnOs; |
| 54 | +import org.junit.jupiter.api.condition.OS; |
53 | 55 |
|
54 | 56 | /** |
55 | 57 | * Test case for {@link CheckstyleValidator} class. |
@@ -467,15 +469,15 @@ void prohibitWindowsEndsOfLine() throws Exception { |
467 | 469 | * @throws Exception If something wrong happens inside |
468 | 470 | */ |
469 | 471 | @Test |
| 472 | + @EnabledOnOs(OS.WINDOWS) |
470 | 473 | void testWindowsEndsOfLineWithLinuxSources() throws Exception { |
471 | 474 | final String file = "WindowsEolLinux.java"; |
472 | 475 | final Environment.Mock mock = new Environment.Mock(); |
473 | 476 | final File license = this.createLicense(mock, "\r\n", "Hello.", "World."); |
474 | 477 | final Environment env = this.configureEnvironment(mock, license, file); |
475 | | - final Collection<Violation> results = |
476 | | - new CheckstyleValidator(env).validate( |
477 | | - env.files(file) |
478 | | - ); |
| 478 | + final Collection<Violation> results = new CheckstyleValidator(env).validate( |
| 479 | + env.files(file) |
| 480 | + ); |
479 | 481 | final String message = "Line does not match expected header line of ' *'"; |
480 | 482 | final String name = "HeaderCheck"; |
481 | 483 | MatcherAssert.assertThat( |
@@ -905,8 +907,7 @@ private File createLicense(final Environment env, final String eol, final String |
905 | 907 | throws IOException { |
906 | 908 | return this.rule.savePackageInfo( |
907 | 909 | new File(env.basedir(), CheckstyleValidatorTest.DIRECTORY) |
908 | | - ).withLines(lines) |
909 | | - .withEol(eol).file(); |
| 910 | + ).withLines(lines).withEol(eol).file(); |
910 | 911 | } |
911 | 912 |
|
912 | 913 | /** |
|
0 commit comments