Repository: hbase Updated Branches: refs/heads/branch-1 bda31bbf6 -> f6e93520b refs/heads/branch-1.4 7b2d856be -> 0f888cbcf
http://git-wip-us.apache.org/repos/asf/hbase/blob/2d579a41/hbase-common/src/test/java/org/apache/hadoop/hbase/util/TestOrderedBytes.java ---------------------------------------------------------------------- diff --git a/hbase-common/src/test/java/org/apache/hadoop/hbase/util/TestOrderedBytes.java b/hbase-common/src/test/java/org/apache/hadoop/hbase/util/TestOrderedBytes.java index 8f213b7..c5d661f 100644 --- a/hbase-common/src/test/java/org/apache/hadoop/hbase/util/TestOrderedBytes.java +++ b/hbase-common/src/test/java/org/apache/hadoop/hbase/util/TestOrderedBytes.java @@ -22,6 +22,7 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.fail; import java.math.BigDecimal; +import java.nio.charset.StandardCharsets; import java.util.Arrays; import java.util.Collections; @@ -871,7 +872,9 @@ public class TestOrderedBytes { @Test public void testBlobVar() { byte[][] vals = - { "".getBytes(), "foo".getBytes(), "foobarbazbub".getBytes(), + { "".getBytes(StandardCharsets.UTF_8), + "foo".getBytes(StandardCharsets.UTF_8), + "foobarbazbub".getBytes(StandardCharsets.UTF_8), { (byte) 0xaa, (byte) 0xaa, (byte) 0xaa, (byte) 0xaa, (byte) 0xaa, (byte) 0xaa, (byte) 0xaa, /* 7 bytes of alternating bits; testing around HBASE-9893 */ }, { (byte) 0xaa, (byte) 0xaa, (byte) 0xaa, (byte) 0xaa, (byte) 0xaa, (byte) 0xaa, @@ -886,8 +889,14 @@ public class TestOrderedBytes { { (byte) 0x55, (byte) 0x55, (byte) 0x55, (byte) 0x55, (byte) 0x55, (byte) 0x55, (byte) 0x55, (byte) 0x55, (byte) 0x55, (byte) 0x55, (byte) 0x55, (byte) 0x55, (byte) 0x55, (byte) 0x55, /* 14 bytes of alternating bits; testing around HBASE-9893 */ }, - "1".getBytes(), "22".getBytes(), "333".getBytes(), "4444".getBytes(), - "55555".getBytes(), "666666".getBytes(), "7777777".getBytes(), "88888888".getBytes() + "1".getBytes(StandardCharsets.UTF_8), + "22".getBytes(StandardCharsets.UTF_8), + "333".getBytes(StandardCharsets.UTF_8), + "4444".getBytes(StandardCharsets.UTF_8), + "55555".getBytes(StandardCharsets.UTF_8), + "666666".getBytes(StandardCharsets.UTF_8), + "7777777".getBytes(StandardCharsets.UTF_8), + "88888888".getBytes(StandardCharsets.UTF_8) }; /* @@ -958,7 +967,9 @@ public class TestOrderedBytes { @Test public void testBlobCopy() { byte[][] vals = - { "".getBytes(), "foo".getBytes(), "foobarbazbub".getBytes(), + { "".getBytes(StandardCharsets.UTF_8), + "foo".getBytes(StandardCharsets.UTF_8), + "foobarbazbub".getBytes(StandardCharsets.UTF_8), { (byte) 0xaa, (byte) 0xaa, (byte) 0xaa, (byte) 0xaa, (byte) 0xaa, (byte) 0xaa, (byte) 0xaa, (byte) 0xaa, (byte) 0xaa, (byte) 0xaa, (byte) 0xaa, (byte) 0xaa }, { (byte) 0x55, (byte) 0x55, (byte) 0x55, (byte) 0x55, (byte) 0x55, (byte) 0x55, @@ -1033,9 +1044,9 @@ public class TestOrderedBytes { byte[] a = new byte[3 + (Order.ASCENDING == ord ? 1 : 2) + 2]; PositionedByteRange buf = new SimplePositionedMutableByteRange(a, 1, 3 + (Order.ASCENDING == ord ? 1 : 2)); - OrderedBytes.encodeBlobCopy(buf, "foobarbaz".getBytes(), 3, 3, ord); + OrderedBytes.encodeBlobCopy(buf, "foobarbaz".getBytes(StandardCharsets.UTF_8), 3, 3, ord); buf.setPosition(0); - assertArrayEquals("bar".getBytes(), OrderedBytes.decodeBlobCopy(buf)); + assertArrayEquals("bar".getBytes(StandardCharsets.UTF_8), OrderedBytes.decodeBlobCopy(buf)); } } @@ -1239,7 +1250,7 @@ public class TestOrderedBytes { buff.setPosition(0); assertEquals(OrderedBytes.length(buff), cnt); for (int i = 0; i < cnt; i++) { - assertEquals(OrderedBytes.isEncodedValue(buff), true); + assertEquals(true, OrderedBytes.isEncodedValue(buff)); OrderedBytes.skip(buff); } }
