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