Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Verify reported violations in HeaderCheck tests #1272

Merged
merged 1 commit into from
May 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
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