// TODO: Script tests, should fail with defaultValuesSourceType disabled.
public void testEmpty() throws IOException {
        final MappedFieldType ft = new NumberFieldMapper.NumberFieldType("field", NumberType.LONG);
        testCase(
            stats("_name").field(ft.name()),
            iw -> {},
            stats -> {
                assertEquals(0d, stats.getCount(), 0);
                assertEquals(0d, stats.getSum(), 0);
                assertEquals(Float.NaN, stats.getAvg(), 0);
                assertEquals(Double.POSITIVE_INFINITY, stats.getMin(), 0);
                assertEquals(Double.NEGATIVE_INFINITY, stats.getMax(), 0);
                assertFalse(AggregationInspectionHelper.hasValue(stats));
            },
            singleton(ft)
        );
    }
public void testEmpty() throws IOException {
final MappedFieldType ft = new NumberFieldMapper.NumberFieldType("field", NumberType.LONG);
testCase(
stats("_name").field(ft.name()),
iw -> {},
stats -> {
assertEquals(0d, stats.getCount(), 0);
assertEquals(0d, stats.getSum(), 0);
assertEquals(Float.NaN, stats.getAvg(), 0);
assertEquals(Double.POSITIVE_INFINITY, stats.getMin(), 0);
assertEquals(Double.NEGATIVE_INFINITY, stats.getMax(), 0);
assertFalse(AggregationInspectionHelper.hasValue(stats));
},
singleton(ft)
);
}
public void testEmpty() throws IOException {
final MappedFieldType ft = new NumberFieldMapper.NumberFieldType("field", NumberType.LONG);
testCase(
stats("_name").field(ft.name()),
iw -> {},
stats -> {
assertEquals(0d, stats.getCount(), 0);
assertEquals(0d, stats.getSum(), 0);
assertEquals(Float.NaN, stats.getAvg(), 0);
assertEquals(Double.POSITIVE_INFINITY, stats.getMin(), 0);
assertEquals(Double.NEGATIVE_INFINITY, stats.getMax(), 0);
assertFalse(AggregationInspectionHelper.hasValue(stats));
},
singleton(ft)
);
}
public void testEmpty() throws IOException {
final MappedFieldType ft = new NumberFieldMapper.NumberFieldType("field", NumberType.LONG);
testCase(
stats("_name").field(ft.name()),
iw -> {},
stats -> {
assertEquals(0d, stats.getCount(), 0);
assertEquals(0d, stats.getSum(), 0);
assertEquals(Float.NaN, stats.getAvg(), 0);
assertEquals(Double.POSITIVE_INFINITY, stats.getMin(), 0);
assertEquals(Double.NEGATIVE_INFINITY, stats.getMax(), 0);
assertFalse(AggregationInspectionHelper.hasValue(stats));
},
singleton(ft)
);
}