HIVE-10939 : Make TestFileDump robust (Ashutosh Chauhan via Gunther Hagleitner)


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

Branch: refs/heads/llap
Commit: cbeee7820945c322475b4d9a399cf0966877a56e
Parents: 4f8de20
Author: Ashutosh Chauhan <[email protected]>
Authored: Sat Jun 6 14:29:18 2015 -0700
Committer: Ashutosh Chauhan <[email protected]>
Committed: Sat Jun 6 14:29:18 2015 -0700

----------------------------------------------------------------------
 .../test/org/apache/hadoop/hive/ql/io/orc/TestFileDump.java   | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/cbeee782/ql/src/test/org/apache/hadoop/hive/ql/io/orc/TestFileDump.java
----------------------------------------------------------------------
diff --git a/ql/src/test/org/apache/hadoop/hive/ql/io/orc/TestFileDump.java 
b/ql/src/test/org/apache/hadoop/hive/ql/io/orc/TestFileDump.java
index 5b200f1..e77e24d 100644
--- a/ql/src/test/org/apache/hadoop/hive/ql/io/orc/TestFileDump.java
+++ b/ql/src/test/org/apache/hadoop/hive/ql/io/orc/TestFileDump.java
@@ -130,16 +130,19 @@ public class TestFileDump {
         new BufferedReader(new 
FileReader(HiveTestUtils.getFileFromClasspath(expected)));
     BufferedReader aStream =
         new BufferedReader(new FileReader(actual));
-    String expectedLine = eStream.readLine();
+    String expectedLine = eStream.readLine().trim();
     while (expectedLine != null) {
-      String actualLine = aStream.readLine();
+      String actualLine = aStream.readLine().trim();
       System.out.println("actual:   " + actualLine);
       System.out.println("expected: " + expectedLine);
       assertEquals(expectedLine, actualLine);
       expectedLine = eStream.readLine();
+      expectedLine = expectedLine == null ? null : expectedLine.trim();
     }
     assertNull(eStream.readLine());
     assertNull(aStream.readLine());
+    eStream.close();
+    aStream.close();
   }
 
   @Test

Reply via email to