use of org.apache.flink.graph.drivers.transform.GraphKeyTypeTransform.UnsignedByteToLongValueWithProperHashCode in project flink by apache.
the class GraphKeyTypeTransformTest method testFromByte.
@Test
public void testFromByte() throws Exception {
TranslateFunction<Byte, LongValueWithProperHashCode> translator = new UnsignedByteToLongValueWithProperHashCode();
Assert.assertEquals(new LongValueWithProperHashCode(0L), translator.translate((byte) 0, longValueWithProperHashCode));
Assert.assertEquals(new LongValueWithProperHashCode(Byte.MAX_VALUE + 1), translator.translate(Byte.MIN_VALUE, longValueWithProperHashCode));
Assert.assertEquals(new LongValueWithProperHashCode(LongValueToUnsignedByte.MAX_VERTEX_COUNT - 1), translator.translate((byte) -1, longValueWithProperHashCode));
}
Aggregations