HBASE-10547 TestFixedLengthWrapper#testReadWrite occasionally fails with the IBM JDK
git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1570744 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
e541b46b63
commit
0039de35c8
|
@ -17,10 +17,8 @@
|
||||||
*/
|
*/
|
||||||
package org.apache.hadoop.hbase.types;
|
package org.apache.hadoop.hbase.types;
|
||||||
|
|
||||||
import static org.junit.Assert.assertArrayEquals;
|
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
|
import static org.junit.Assert.assertTrue;
|
||||||
import java.util.Arrays;
|
|
||||||
|
|
||||||
import org.apache.hadoop.hbase.SmallTests;
|
import org.apache.hadoop.hbase.SmallTests;
|
||||||
import org.apache.hadoop.hbase.util.Bytes;
|
import org.apache.hadoop.hbase.util.Bytes;
|
||||||
|
@ -54,10 +52,10 @@ public class TestFixedLengthWrapper {
|
||||||
buff.setPosition(0);
|
buff.setPosition(0);
|
||||||
DataType<byte[]> type = new FixedLengthWrapper<byte[]>(new RawBytes(ord), limit);
|
DataType<byte[]> type = new FixedLengthWrapper<byte[]>(new RawBytes(ord), limit);
|
||||||
assertEquals(limit, type.encode(buff, val));
|
assertEquals(limit, type.encode(buff, val));
|
||||||
byte[] expected = Arrays.copyOf(val, limit);
|
|
||||||
buff.setPosition(0);
|
buff.setPosition(0);
|
||||||
byte[] actual = type.decode(buff);
|
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);
|
buff.setPosition(0);
|
||||||
assertEquals(limit, type.skip(buff));
|
assertEquals(limit, type.skip(buff));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue