hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vvasu...@apache.org
Subject [1/2] hadoop git commit: YARN-4684. TestYarnCLI#testGetContainers failing in CN locale. Contributed by Bibin A Chundatt.
Date Fri, 12 Feb 2016 06:41:12 GMT
Repository: hadoop
Updated Branches:
  refs/heads/branch-2 488e6cbe1 -> dcead143f
  refs/heads/trunk c78740a97 -> 2fb423e19


YARN-4684. TestYarnCLI#testGetContainers failing in CN locale. Contributed by Bibin A Chundatt.


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/2fb423e1
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/2fb423e1
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/2fb423e1

Branch: refs/heads/trunk
Commit: 2fb423e195fb1d525304c40ff93966525efb640d
Parents: c78740a
Author: Varun Vasudev <vvasudev@apache.org>
Authored: Fri Feb 12 12:01:54 2016 +0530
Committer: Varun Vasudev <vvasudev@apache.org>
Committed: Fri Feb 12 12:06:55 2016 +0530

----------------------------------------------------------------------
 hadoop-yarn-project/CHANGES.txt                             | 3 +++
 .../java/org/apache/hadoop/yarn/client/cli/TestYarnCLI.java | 9 ++++++---
 2 files changed, 9 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/2fb423e1/hadoop-yarn-project/CHANGES.txt
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/CHANGES.txt b/hadoop-yarn-project/CHANGES.txt
index c63a74c..fb685ba 100644
--- a/hadoop-yarn-project/CHANGES.txt
+++ b/hadoop-yarn-project/CHANGES.txt
@@ -203,6 +203,9 @@ Release 2.9.0 - UNRELEASED
     YARN-4629. Distributed shell breaks under strong security.
     (Daniel Templeton via stevel)
 
+    YARN-4684. TestYarnCLI#testGetContainers failing in CN locale.
+    (Bibin A Chundatt via vvasudev)
+
 Release 2.8.0 - UNRELEASED
 
   INCOMPATIBLE CHANGES

http://git-wip-us.apache.org/repos/asf/hadoop/blob/2fb423e1/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/cli/TestYarnCLI.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/cli/TestYarnCLI.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/cli/TestYarnCLI.java
index 3783aac..5bef691 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/cli/TestYarnCLI.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/cli/TestYarnCLI.java
@@ -31,6 +31,7 @@ import static org.mockito.Mockito.when;
 
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
+import java.io.OutputStreamWriter;
 import java.io.PrintStream;
 import java.io.PrintWriter;
 import java.io.UnsupportedEncodingException;
@@ -307,7 +308,9 @@ public class TestYarnCLI {
     assertEquals(0, result);
     verify(client).getContainers(attemptId);
     ByteArrayOutputStream baos = new ByteArrayOutputStream();
-    PrintWriter pw = new PrintWriter(baos);
+    OutputStreamWriter stream =
+        new OutputStreamWriter(baos, "UTF-8");
+    PrintWriter pw = new PrintWriter(stream);
     pw.println("Total number of containers :3");
     pw.print("                  Container-Id");
     pw.print("\t          Start Time");
@@ -342,9 +345,9 @@ public class TestYarnCLI {
     Log.info("ExpectedOutput");
     Log.info("["+appReportStr+"]");
     Log.info("OutputFrom command");
-    String actualOutput = sysOutStream.toString();
+    String actualOutput = sysOutStream.toString("UTF-8");
     Log.info("["+actualOutput+"]");
-    Assert.assertEquals(appReportStr, sysOutStream.toString());
+    Assert.assertEquals(appReportStr, actualOutput);
   }
   
   @Test


Mime
View raw message