byte [] cfShort = "cf-short".getBytes();
kvs.clear();
kvs.add(new KeyValue(rowKey, cfShort, Bytes.toBytes((short) 1), Bytes.toBytes((short) 1)));
result = new Result(kvs);
hbaseCellMap.init(result, cfShort, mapBinaryStorage);
ShortWritable expectedShortValue = new ShortWritable((short) 1);
lazyPrimitive =
(LazyPrimitive<?, ?>) hbaseCellMap.getMapValueElement(expectedShortValue);
assertEquals(expectedShortValue, lazyPrimitive.getWritableObject());
kvs.clear();
kvs.add(new KeyValue(rowKey, cfShort, Bytes.toBytes(Short.MIN_VALUE),
Bytes.toBytes(Short.MIN_VALUE)));
result = new Result(kvs);
hbaseCellMap.init(result, cfShort, mapBinaryStorage);
expectedShortValue = new ShortWritable(Short.MIN_VALUE);
lazyPrimitive =
(LazyPrimitive<?, ?>) hbaseCellMap.getMapValueElement(expectedShortValue);
assertEquals(expectedShortValue, lazyPrimitive.getWritableObject());
kvs.clear();
kvs.add(new KeyValue(rowKey, cfShort, Bytes.toBytes(Short.MAX_VALUE),
Bytes.toBytes(Short.MAX_VALUE)));
result = new Result(kvs);
hbaseCellMap.init(result, cfShort, mapBinaryStorage);
expectedShortValue = new ShortWritable(Short.MAX_VALUE);
lazyPrimitive =
(LazyPrimitive<?, ?>) hbaseCellMap.getMapValueElement(expectedShortValue);
assertEquals(expectedShortValue, lazyPrimitive.getWritableObject());