use of java.util.function.LongSupplier in project lucene-solr by apache.
the class BaseNormsFormatTestCase method testFullLongRange.
public void testFullLongRange() throws Exception {
int iterations = atLeast(1);
final Random r = random();
for (int i = 0; i < iterations; i++) {
doTestNormsVersusDocValues(1, new LongSupplier() {
@Override
public long getAsLong() {
int thingToDo = r.nextInt(3);
switch(thingToDo) {
case 0:
return Long.MIN_VALUE;
case 1:
return Long.MAX_VALUE;
default:
return TestUtil.nextLong(r, Long.MIN_VALUE, Long.MAX_VALUE);
}
}
});
}
}
use of java.util.function.LongSupplier in project lucene-solr by apache.
the class BaseNormsFormatTestCase method testMostZeros.
public void testMostZeros() throws Exception {
int iterations = atLeast(1);
final Random r = random();
for (int i = 0; i < iterations; i++) {
doTestNormsVersusDocValues(1, new LongSupplier() {
@Override
public long getAsLong() {
return r.nextInt(100) == 0 ? TestUtil.nextLong(r, Byte.MIN_VALUE, Byte.MAX_VALUE) : 0;
}
});
}
}
use of java.util.function.LongSupplier in project lucene-solr by apache.
the class BaseNormsFormatTestCase method testFewSparseValues.
public void testFewSparseValues() throws Exception {
assumeTrue("Requires sparse norms support", codecSupportsSparsity());
int iterations = atLeast(1);
final Random r = random();
for (int i = 0; i < iterations; i++) {
doTestNormsVersusDocValues(random().nextDouble(), new LongSupplier() {
@Override
public long getAsLong() {
return r.nextBoolean() ? 20 : 3;
}
});
}
}
use of java.util.function.LongSupplier in project lucene-solr by apache.
the class BaseNormsFormatTestCase method testSparseByteRange.
public void testSparseByteRange() throws Exception {
assumeTrue("Requires sparse norms support", codecSupportsSparsity());
int iterations = atLeast(1);
final Random r = random();
for (int i = 0; i < iterations; i++) {
doTestNormsVersusDocValues(random().nextDouble(), new LongSupplier() {
@Override
public long getAsLong() {
return TestUtil.nextLong(r, Byte.MIN_VALUE, Byte.MAX_VALUE);
}
});
}
}
use of java.util.function.LongSupplier in project lucene-solr by apache.
the class BaseNormsFormatTestCase method testFewLargeValues.
public void testFewLargeValues() throws Exception {
int iterations = atLeast(1);
final Random r = random();
for (int i = 0; i < iterations; i++) {
doTestNormsVersusDocValues(1, new LongSupplier() {
@Override
public long getAsLong() {
return r.nextBoolean() ? 1000000L : -5000;
}
});
}
}
Aggregations