byte [] cfByte = "cf-byte".getBytes();
kvs.clear();
kvs.add(new KeyValue(rowKey, cfByte, new byte [] {(byte) 1}, new byte [] {(byte) 1}));
result = new Result(kvs);
hbaseCellMap.init(result, cfByte, mapBinaryStorage);
ByteWritable expectedByteValue = new ByteWritable((byte) 1);
lazyPrimitive =
(LazyPrimitive<?, ?>) hbaseCellMap.getMapValueElement(expectedByteValue);
assertEquals(expectedByteValue, lazyPrimitive.getWritableObject());
kvs.clear();
kvs.add(new KeyValue(rowKey, cfByte, new byte [] {Byte.MIN_VALUE},
new byte [] {Byte.MIN_VALUE}));
result = new Result(kvs);
hbaseCellMap.init(result, cfByte, mapBinaryStorage);
expectedByteValue = new ByteWritable(Byte.MIN_VALUE);
lazyPrimitive =
(LazyPrimitive<?, ?>) hbaseCellMap.getMapValueElement(expectedByteValue);
assertEquals(expectedByteValue, lazyPrimitive.getWritableObject());
kvs.clear();
kvs.add(new KeyValue(rowKey, cfByte, new byte [] {Byte.MAX_VALUE},
new byte [] {Byte.MAX_VALUE}));
result = new Result(kvs);
hbaseCellMap.init(result, cfByte, mapBinaryStorage);
expectedByteValue = new ByteWritable(Byte.MAX_VALUE);
lazyPrimitive =
(LazyPrimitive<?, ?>) hbaseCellMap.getMapValueElement(expectedByteValue);
assertEquals(expectedByteValue, lazyPrimitive.getWritableObject());