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