MAPREDUCE-7102. Fix TestJavaSerialization for Windows due a mismatch line separator. Contributed by Giovanni Matteo Fumarola.
This commit is contained in:
parent
8f83b9abf9
commit
a804b7c9d2
@ -91,6 +91,8 @@ private void cleanAndCreateInput(FileSystem fs) throws IOException {
|
||||
wr.write("b a\n");
|
||||
wr.close();
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
@Test
|
||||
public void testMapReduceJob() throws Exception {
|
||||
|
||||
@ -131,16 +133,17 @@ public void testMapReduceJob() throws Exception {
|
||||
FileUtil.stat2Paths(fs.listStatus(OUTPUT_DIR,
|
||||
new Utils.OutputFileUtils.OutputFilesFilter()));
|
||||
assertEquals(1, outputFiles.length);
|
||||
InputStream is = fs.open(outputFiles[0]);
|
||||
try (InputStream is = fs.open(outputFiles[0])) {
|
||||
String reduceOutput = org.apache.commons.io.IOUtils.toString(is);
|
||||
String[] lines = reduceOutput.split(System.getProperty("line.separator"));
|
||||
String[] lines = reduceOutput.split("\n");
|
||||
assertEquals("Unexpected output; received output '" + reduceOutput + "'",
|
||||
"a\t1", lines[0]);
|
||||
assertEquals("Unexpected output; received output '" + reduceOutput + "'",
|
||||
"b\t1", lines[1]);
|
||||
assertEquals("Reduce output has extra lines; output is '" + reduceOutput
|
||||
+ "'", 2, lines.length);
|
||||
is.close();
|
||||
assertEquals(
|
||||
"Reduce output has extra lines; output is '" + reduceOutput + "'", 2,
|
||||
lines.length);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user