You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by ap...@apache.org on 2014/02/22 00:00:41 UTC
svn commit: r1570745 -
/hbase/branches/0.98/hbase-common/src/test/java/org/apache/hadoop/hbase/types/TestFixedLengthWrapper.java
Author: apurtell
Date: Fri Feb 21 23:00:40 2014
New Revision: 1570745
URL: http://svn.apache.org/r1570745
Log:
HBASE-10547 TestFixedLengthWrapper#testReadWrite occasionally fails with the IBM JDK
Modified:
hbase/branches/0.98/hbase-common/src/test/java/org/apache/hadoop/hbase/types/TestFixedLengthWrapper.java
Modified: hbase/branches/0.98/hbase-common/src/test/java/org/apache/hadoop/hbase/types/TestFixedLengthWrapper.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.98/hbase-common/src/test/java/org/apache/hadoop/hbase/types/TestFixedLengthWrapper.java?rev=1570745&r1=1570744&r2=1570745&view=diff
==============================================================================
--- hbase/branches/0.98/hbase-common/src/test/java/org/apache/hadoop/hbase/types/TestFixedLengthWrapper.java (original)
+++ hbase/branches/0.98/hbase-common/src/test/java/org/apache/hadoop/hbase/types/TestFixedLengthWrapper.java Fri Feb 21 23:00:40 2014
@@ -17,10 +17,8 @@
*/
package org.apache.hadoop.hbase.types;
-import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
-
-import java.util.Arrays;
+import static org.junit.Assert.assertTrue;
import org.apache.hadoop.hbase.SmallTests;
import org.apache.hadoop.hbase.util.Bytes;
@@ -54,10 +52,10 @@ public class TestFixedLengthWrapper {
buff.setPosition(0);
DataType<byte[]> type = new FixedLengthWrapper<byte[]>(new RawBytes(ord), limit);
assertEquals(limit, type.encode(buff, val));
- byte[] expected = Arrays.copyOf(val, limit);
buff.setPosition(0);
byte[] actual = type.decode(buff);
- assertArrayEquals(expected, actual);
+ assertTrue("Decoding output differs from expected",
+ Bytes.equals(val, 0, val.length, actual, 0, val.length));
buff.setPosition(0);
assertEquals(limit, type.skip(buff));
}