use of org.apache.flink.graph.drivers.transform.GraphKeyTypeTransform.DoubleToLongValueWithProperHashCode in project flink by apache.
the class GraphKeyTypeTransformTest method testFromDouble.
@Test
public void testFromDouble() throws Exception {
TranslateFunction<Double, LongValueWithProperHashCode> translator = new DoubleToLongValueWithProperHashCode();
Assert.assertEquals(new LongValueWithProperHashCode(0L), translator.translate(Double.longBitsToDouble(0L), longValueWithProperHashCode));
Assert.assertEquals(new LongValueWithProperHashCode(Long.MIN_VALUE), translator.translate(Double.longBitsToDouble(Long.MIN_VALUE), longValueWithProperHashCode));
Assert.assertEquals(new LongValueWithProperHashCode(Long.MAX_VALUE), translator.translate(Double.longBitsToDouble(Long.MAX_VALUE), longValueWithProperHashCode));
}
Aggregations