Skip to content

Commit

Permalink
Verify reported violations in HeaderCheck tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikail Bagishov committed May 10, 2024
1 parent 9b3606d commit 74aab50
Showing 1 changed file with 28 additions and 7 deletions.
Expand Up @@ -459,23 +459,44 @@ void allowsOnlyProperlyOrderedAtClauses() throws Exception {
* @throws Exception If something wrong happens inside
*/
@Test
@Disabled
void passesWindowsEndsOfLineWithoutException() throws Exception {
this.validate("WindowsEol.java", false, "LICENSE found:");
final String file = "WindowsEol.java";
final Collection<Violation> results = this.runValidation(file, false);
MatcherAssert.assertThat(
"violation should be reported correctly",
results,
Matchers.contains(
new ViolationMatcher(
"Line does not match expected header line of ' */'.",
file,
"3",
"HeaderCheck"
)
)
);
}

/**
* Fail validation with Windows-style formatting of the license and
* Linux-style formatting of the sources.
* @throws Exception If something wrong happens inside
* @todo #61:30min This test and passesWindowsEndsOfLineWithoutException
* should be refactored to gather log4j logs and validate that they work
* correctly. (see changes done in #61)
*/
@Test
@Disabled
void testWindowsEndsOfLineWithLinuxSources() throws Exception {
this.runValidation("WindowsEolLinux.java", false);
final String file = "WindowsEolLinux.java";
final Collection<Violation> results = this.runValidation(file, false);
MatcherAssert.assertThat(
"violation should be reported correctly",
results,
Matchers.contains(
new ViolationMatcher(
"Line does not match expected header line of ' * Hello.'.",
file,
"2",
"HeaderCheck"
)
)
);
}

/**
Expand Down

0 comments on commit 74aab50

Please sign in to comment.