HADOOP-6479. TestUTF8 assertions could fail with better text. Contributed by Steve Loughran.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@896691 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Thomas White 2010-01-06 22:03:33 +00:00
parent 889528e387
commit dec4c1614e
2 changed files with 6 additions and 3 deletions

View File

@ -91,6 +91,9 @@ Trunk (unreleased changes)
HADOOP-3205. Read multiple chunks directly from FSInputChecker subclass HADOOP-3205. Read multiple chunks directly from FSInputChecker subclass
into user buffers. (Todd Lipcon via tomwhite) into user buffers. (Todd Lipcon via tomwhite)
HADOOP-6479. TestUTF8 assertions could fail with better text.
(Steve Loughran via tomwhite)
OPTIMIZATIONS OPTIMIZATIONS
BUG FIXES BUG FIXES

View File

@ -68,16 +68,16 @@ public void testIO() throws Exception {
// test that it reads correctly // test that it reads correctly
in.reset(out.getData(), out.getLength()); in.reset(out.getData(), out.getLength());
String after = UTF8.readString(in); String after = UTF8.readString(in);
assertTrue(before.equals(after)); assertEquals(before, after);
// test that it reads correctly with DataInput // test that it reads correctly with DataInput
in.reset(out.getData(), out.getLength()); in.reset(out.getData(), out.getLength());
String after2 = in.readUTF(); String after2 = in.readUTF();
assertTrue(before.equals(after2)); assertEquals(before, after2);
// test that it is compatible with Java's other decoder // test that it is compatible with Java's other decoder
String after3 = new String(out.getData(), 2, out.getLength()-2, "UTF-8"); String after3 = new String(out.getData(), 2, out.getLength()-2, "UTF-8");
assertTrue(before.equals(after3)); assertEquals(before, after3);
} }