use of com.hazelcast.jet.accumulator.LongLongAccumulator in project hazelcast by hazelcast.
the class AggregateOperationsTest method when_averagingLong_tooManyItems_then_exception.
@Test
public void when_averagingLong_tooManyItems_then_exception() {
// Given
AggregateOperation1<Long, LongLongAccumulator, Double> aggrOp = averagingLong(Long::longValue);
LongLongAccumulator acc = new LongLongAccumulator(Long.MAX_VALUE, 0L);
// Then
exception.expect(ArithmeticException.class);
// When
aggrOp.accumulateFn().accept(acc, 0L);
}
use of com.hazelcast.jet.accumulator.LongLongAccumulator in project hazelcast-jet by hazelcast.
the class AggregateOperationsTest method when_averagingLongOverflow_thenException.
@Test
public void when_averagingLongOverflow_thenException() {
// Given
AggregateOperation1<Long, LongLongAccumulator, Double> aggrOp = averagingLong(Long::longValue);
LongLongAccumulator acc = new LongLongAccumulator(Long.MAX_VALUE, 0L);
// When and Then
exception.expect(ArithmeticException.class);
aggrOp.accumulateFn().accept(acc, 0L);
}
Aggregations