Explorar o código

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
Thomas White %!s(int64=15) %!d(string=hai) anos
pai
achega
dec4c1614e
Modificáronse 2 ficheiros con 6 adicións e 3 borrados
  1. 3 0
      CHANGES.txt
  2. 3 3
      src/test/core/org/apache/hadoop/io/TestUTF8.java

+ 3 - 0
CHANGES.txt

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

+ 3 - 3
src/test/core/org/apache/hadoop/io/TestUTF8.java

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