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