HDFS-13619. TestAuditLoggerWithCommands fails on Windows. Contributed by Anbang Hu.
Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/13d25289 Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/13d25289 Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/13d25289 Branch: refs/heads/HDDS-48 Commit: 13d25289076b39daf481fb1ee15939dbfe4a6b23 Parents: 8733012 Author: Inigo Goiri <inigo...@apache.org> Authored: Fri May 25 13:32:34 2018 -0700 Committer: Inigo Goiri <inigo...@apache.org> Committed: Fri May 25 13:32:34 2018 -0700 ---------------------------------------------------------------------- .../hdfs/server/namenode/TestAuditLoggerWithCommands.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hadoop/blob/13d25289/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestAuditLoggerWithCommands.java ---------------------------------------------------------------------- diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestAuditLoggerWithCommands.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestAuditLoggerWithCommands.java index 41ee03f..222a1de 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestAuditLoggerWithCommands.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestAuditLoggerWithCommands.java @@ -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; } --------------------------------------------------------------------- To unsubscribe, e-mail: common-commits-unsubscr...@hadoop.apache.org For additional commands, e-mail: common-commits-h...@hadoop.apache.org