From ff361e7c319e3520be1a1c53b0a6ce6682690064 Mon Sep 17 00:00:00 2001 From: cnauroth Date: Mon, 3 Nov 2014 19:59:52 -0800 Subject: [PATCH] HDFS-7328. TestTraceAdmin assumes Unix line endings. Contributed by Chris Nauroth. (cherry picked from commit 2bb327eb939f57626d3dac10f7016ed634375d94) (cherry picked from commit 5720cc9d2d4076ea67400ee337b0ad8cbad6cbe7) Conflicts: hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/tracing/TestTraceAdmin.java --- hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt | 2 ++ .../java/org/apache/hadoop/tracing/TestTraceAdmin.java | 9 +++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index f2f83de58b4..17718ba86df 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -1074,6 +1074,8 @@ Release 2.6.0 - UNRELEASED HDFS-7274. Disable SSLv3 in HttpFS. (Robert Kanter via kasha) + HDFS-7328. TestTraceAdmin assumes Unix line endings. (cnauroth) + Release 2.5.1 - 2014-09-05 INCOMPATIBLE CHANGES diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/tracing/TestTraceAdmin.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/tracing/TestTraceAdmin.java index 455e64fcb42..74f51c04896 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/tracing/TestTraceAdmin.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/tracing/TestTraceAdmin.java @@ -28,6 +28,7 @@ import java.io.File; import java.io.PrintStream; public class TestTraceAdmin { + private static final String NEWLINE = System.getProperty("line.separator"); private String runTraceCommand(TraceAdmin trace, String... cmd) throws Exception { @@ -66,10 +67,10 @@ public class TestTraceAdmin { try { TraceAdmin trace = new TraceAdmin(); trace.setConf(conf); - Assert.assertEquals("ret:0, [no span receivers found]\n", + Assert.assertEquals("ret:0, [no span receivers found]" + NEWLINE, runTraceCommand(trace, "-list", "-host", getHostPortForNN(cluster))); Assert.assertEquals("ret:0, Added trace span receiver 1 with " + - "configuration local-file-span-receiver.path = " + tracePath + "\n", + "configuration local-file-span-receiver.path = " + tracePath + NEWLINE, runTraceCommand(trace, "-add", "-host", getHostPortForNN(cluster), "-class", "org.htrace.impl.LocalFileSpanReceiver", "-Clocal-file-span-receiver.path=" + tracePath)); @@ -77,10 +78,10 @@ public class TestTraceAdmin { runTraceCommand(trace, "-list", "-host", getHostPortForNN(cluster)); Assert.assertTrue(list.startsWith("ret:0")); Assert.assertTrue(list.contains("1 org.htrace.impl.LocalFileSpanReceiver")); - Assert.assertEquals("ret:0, Removed trace span receiver 1\n", + Assert.assertEquals("ret:0, Removed trace span receiver 1" + NEWLINE, runTraceCommand(trace, "-remove", "1", "-host", getHostPortForNN(cluster))); - Assert.assertEquals("ret:0, [no span receivers found]\n", + Assert.assertEquals("ret:0, [no span receivers found]" + NEWLINE, runTraceCommand(trace, "-list", "-host", getHostPortForNN(cluster))); } finally { cluster.shutdown();