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