use of org.apache.flink.graph.drivers.transform.GraphKeyTypeTransform.LongValueToUnsignedShortValue in project flink by apache.
the class GraphKeyTypeTransformTest method testToShortValue.
// ShortValue
@Test
public void testToShortValue() throws Exception {
TranslateFunction<LongValue, ShortValue> translator = new LongValueToUnsignedShortValue();
Assert.assertEquals(new ShortValue((short) 0), translator.translate(new LongValue(0L), shortValue));
Assert.assertEquals(new ShortValue(Short.MIN_VALUE), translator.translate(new LongValue((long) Short.MAX_VALUE + 1), shortValue));
Assert.assertEquals(new ShortValue((short) -1), translator.translate(new LongValue(LongValueToUnsignedShortValue.MAX_VERTEX_COUNT - 1), shortValue));
}
Aggregations