Skip to content
Open
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 @@ -594,25 +594,33 @@ public void verifyTextNotInLog(String text) throws VerificationException, IOExce
}

public static void verifyTextNotInLog(List<String> lines, String text) throws VerificationException {
if (textOccurencesInLog(lines, text) > 0) {
if (textOccurrencesInLog(lines, text) > 0) {
throw new VerificationException("Text found in log: " + text);
}
}

public static void verifyTextInLog(List<String> lines, String text) throws VerificationException {
if (textOccurencesInLog(lines, text) <= 0) {
if (textOccurrencesInLog(lines, text) <= 0) {
throw new VerificationException("Text not found in log: " + text);
}
}

public long textOccurrencesInLog(String text) throws IOException {
return textOccurencesInLog(loadLogLines(), text);
return textOccurrencesInLog(loadLogLines(), text);
}

public static long textOccurencesInLog(List<String> lines, String text) {
public static long textOccurrencesInLog(List<String> lines, String text) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a public method. Not sure we can just rename it. Might have to deprecate and replace depending on when it was added

return lines.stream().filter(line -> stripAnsi(line).contains(text)).count();
}

/**
* @deprecated Use {@link #textOccurrencesInLog(List, String)} instead
*/
@Deprecated
public static long textOccurencesInLog(List<String> lines, String text) {
return textOccurrencesInLog(lines, text);
}

/**
* Checks whether the specified line is just an error message from Velocity. Especially old versions of Doxia employ
* a very noisy Velocity instance.
Expand Down