HDFS-13619. TestAuditLoggerWithCommands fails on Windows. Contributed by Anbang Hu.

(cherry picked from commit 13d2528907)
This commit is contained in:
Inigo Goiri 2018-05-25 13:32:34 -07:00
parent 1c0ee35662
commit 71ab85adce
1 changed files with 3 additions and 2 deletions

View File

@ -1264,8 +1264,9 @@ public class TestAuditLoggerWithCommands {
}
private int verifyAuditLogs(String pattern) {
int length = auditlog.getOutput().split("\n").length;
String lastAudit = auditlog.getOutput().split("\n")[length - 1];
int length = auditlog.getOutput().split(System.lineSeparator()).length;
String lastAudit = auditlog.getOutput()
.split(System.lineSeparator())[length - 1];
assertTrue("Unexpected log!", lastAudit.matches(pattern));
return length;
}