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