YARN-4684. TestYarnCLI#testGetContainers failing in CN locale. Contributed by Bibin A Chundatt.
(cherry picked from commit 74e9d17a813baeb4e610eb5fdd8e289660346782)
This commit is contained in:
parent
488e6cbe16
commit
dcead143fe
@ -145,6 +145,9 @@ Release 2.9.0 - UNRELEASED
|
|||||||
YARN-4629. Distributed shell breaks under strong security.
|
YARN-4629. Distributed shell breaks under strong security.
|
||||||
(Daniel Templeton via stevel)
|
(Daniel Templeton via stevel)
|
||||||
|
|
||||||
|
YARN-4684. TestYarnCLI#testGetContainers failing in CN locale.
|
||||||
|
(Bibin A Chundatt via vvasudev)
|
||||||
|
|
||||||
Release 2.8.0 - UNRELEASED
|
Release 2.8.0 - UNRELEASED
|
||||||
|
|
||||||
INCOMPATIBLE CHANGES
|
INCOMPATIBLE CHANGES
|
||||||
|
@ -31,6 +31,7 @@
|
|||||||
|
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.io.OutputStreamWriter;
|
||||||
import java.io.PrintStream;
|
import java.io.PrintStream;
|
||||||
import java.io.PrintWriter;
|
import java.io.PrintWriter;
|
||||||
import java.io.UnsupportedEncodingException;
|
import java.io.UnsupportedEncodingException;
|
||||||
@ -307,7 +308,9 @@ public void testGetContainers() throws Exception {
|
|||||||
assertEquals(0, result);
|
assertEquals(0, result);
|
||||||
verify(client).getContainers(attemptId);
|
verify(client).getContainers(attemptId);
|
||||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
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.println("Total number of containers :3");
|
||||||
pw.print(" Container-Id");
|
pw.print(" Container-Id");
|
||||||
pw.print("\t Start Time");
|
pw.print("\t Start Time");
|
||||||
@ -342,9 +345,9 @@ public void testGetContainers() throws Exception {
|
|||||||
Log.info("ExpectedOutput");
|
Log.info("ExpectedOutput");
|
||||||
Log.info("["+appReportStr+"]");
|
Log.info("["+appReportStr+"]");
|
||||||
Log.info("OutputFrom command");
|
Log.info("OutputFrom command");
|
||||||
String actualOutput = sysOutStream.toString();
|
String actualOutput = sysOutStream.toString("UTF-8");
|
||||||
Log.info("["+actualOutput+"]");
|
Log.info("["+actualOutput+"]");
|
||||||
Assert.assertEquals(appReportStr, sysOutStream.toString());
|
Assert.assertEquals(appReportStr, actualOutput);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
Loading…
x
Reference in New Issue
Block a user