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