HDFS-13619. TestAuditLoggerWithCommands fails on Windows. Contributed by Anbang Hu.
(cherry picked from commit 13d2528907
)
This commit is contained in:
parent
1c0ee35662
commit
71ab85adce
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue