Package org.apache.lucene.tests.geo
Class BaseXYPointTestCase
java.lang.Object
org.junit.Assert
org.apache.lucene.tests.util.LuceneTestCase
org.apache.lucene.tests.geo.BaseXYPointTestCase
Abstract class to do basic tests for a xy spatial impl (high level fields and queries)
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.lucene.tests.util.LuceneTestCase
LuceneTestCase.AwaitsFix, LuceneTestCase.BadApple, LuceneTestCase.Monster, LuceneTestCase.Nightly, LuceneTestCase.Slow, LuceneTestCase.SuppressCodecs, LuceneTestCase.SuppressFileSystems, LuceneTestCase.SuppressFsync, LuceneTestCase.SuppressReproduceLine, LuceneTestCase.SuppressSysoutChecks, LuceneTestCase.SuppressTempFileChecks, LuceneTestCase.ThrowingConsumer<T>, LuceneTestCase.ThrowingRunnable, LuceneTestCase.Weekly
-
Field Summary
Fields inherited from class org.apache.lucene.tests.util.LuceneTestCase
assertsAreEnabled, classRules, DEFAULT_LINE_DOCS_FILE, INFOSTREAM, JENKINS_LARGE_LINE_DOCS_FILE, LEAVE_TEMPORARY, MAYBE_CACHE_POLICY, RANDOM_MULTIPLIER, ruleChain, suiteFailureMarker, SYSPROP_AWAITSFIX, SYSPROP_BADAPPLES, SYSPROP_FAILFAST, SYSPROP_MAXFAILURES, SYSPROP_MONSTER, SYSPROP_NIGHTLY, SYSPROP_SLOW, SYSPROP_WEEKLY, TEST_ASSERTS_ENABLED, TEST_AWAITSFIX, TEST_BADAPPLES, TEST_CODEC, TEST_DIRECTORY, TEST_DOCVALUESFORMAT, TEST_LINE_DOCS_FILE, TEST_MONSTER, TEST_NIGHTLY, TEST_POSTINGSFORMAT, TEST_SLOW, TEST_THROTTLING, TEST_WEEKLY, VERBOSE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected abstract void
addPointToDoc
(String field, Document doc, float x, float y) protected abstract Query
newDistanceQuery
(String field, float centerX, float centerY, float radius) protected abstract Query
newGeometryQuery
(String field, XYGeometry... geometries) protected abstract Query
newPolygonQuery
(String field, XYPolygon... polygon) protected abstract Query
newRectQuery
(String field, float minX, float maxX, float minY, float maxY) protected XYRectangle
nextBox()
protected XYGeometry[]
protected XYPolygon
protected float
nextX()
protected float
nextY()
void
void
void
Add a single point and search for it in a boxvoid
void
null field name not allowedvoid
test we can search for a pointvoid
distance query should not accept invalid x/y as originvoid
Inf distance queries are not allowedvoid
NaN distance queries are not allowedvoid
negative distance queries are not allowedvoid
null field name not allowedvoid
void
Valid values that should not cause exceptionvoid
Inf: illegalvoid
NaN: illegalvoid
void
test we can search for a multi-polygonvoid
void
test we can search for a polygonvoid
test we can search for a polygon with a hole (but still includes the doc)void
test we can search for a polygon with a hole (that excludes the doc)void
null field name not allowedvoid
void
Run a few iterations with just 10 docs, hopefully easy to debugvoid
Runs with thousands of docsvoid
void
void
void
void
void
Explicitly largevoid
void
void
void
void
void
void
protected void
verifyRandomDistances
(float[] xs, float[] ys) protected void
verifyRandomGeometries
(float[] xs, float[] ys) protected void
verifyRandomPolygons
(float[] xs, float[] ys) protected void
verifyRandomRectangles
(float[] xs, float[] ys) Methods inherited from class org.apache.lucene.tests.util.LuceneTestCase
addVirusChecker, assertDeletedDocsEquals, assertDocsAndPositionsEnumEquals, assertDocsEnumEquals, assertDocsSkippingEquals, assertDocValuesEquals, assertDocValuesEquals, assertFieldInfosEquals, assertNormsEquals, assertPointsEquals, assertPositionsSkippingEquals, assertReaderEquals, assertReaderStatisticsEquals, assertStoredFieldEquals, assertStoredFieldsEquals, assertTermsEnumEquals, assertTermsEquals, assertTermsEquals, assertTermsStatisticsEquals, assertTermStatsEquals, assertTermVectorsEquals, asSet, assumeFalse, assumeNoException, assumeTrue, assumeWorkingMMapOnWindows, atLeast, atLeast, callStackContains, callStackContains, callStackContainsAnyOf, closeAfterSuite, closeAfterTest, collate, createTempDir, createTempDir, createTempFile, createTempFile, dumpArray, dumpIterator, ensureSaneIWCOnNightly, expectThrows, expectThrows, expectThrows, expectThrowsAnyOf, expectThrowsAnyOf, getDataInputStream, getDataPath, getOnlyLeafReader, getTestClass, getTestName, hasWorkingMMapOnWindows, isTestThread, localeForLanguageTag, maybeChangeLiveIndexWriterConfig, maybeWrapReader, newAlcoholicMergePolicy, newAlcoholicMergePolicy, newBytesRef, newBytesRef, newBytesRef, newBytesRef, newBytesRef, newBytesRef, newDirectory, newDirectory, newDirectory, newDirectory, newDirectory, newField, newField, newFSDirectory, newFSDirectory, newIndexWriterConfig, newIndexWriterConfig, newIndexWriterConfig, newIOContext, newIOContext, newLogMergePolicy, newLogMergePolicy, newLogMergePolicy, newLogMergePolicy, newLogMergePolicy, newMaybeVirusCheckingDirectory, newMaybeVirusCheckingFSDirectory, newMergePolicy, newMergePolicy, newMergePolicy, newMockDirectory, newMockDirectory, newMockDirectory, newMockFSDirectory, newMockFSDirectory, newSearcher, newSearcher, newSearcher, newSearcher, newStringField, newStringField, newStringField, newStringField, newTextField, newTextField, newTieredMergePolicy, newTieredMergePolicy, overrideDefaultQueryCache, overrideTestDefaultQueryCache, random, randomLocale, randomTimeZone, rarely, rarely, replaceMaxFailureRule, resetDefaultQueryCache, restoreCPUCoreCount, restoreIndexWriterMaxDocs, runWithRestrictedPermissions, setIndexWriterMaxDocs, setUp, setupCPUCoreCount, slowFileExists, tearDown, usually, usually, wrapReader
Methods inherited from class org.junit.Assert
assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotEquals, assertNotEquals, assertNotEquals, assertNotEquals, assertNotEquals, assertNotEquals, assertNotEquals, assertNotEquals, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertThat, assertThat, assertThrows, assertThrows, assertTrue, assertTrue, fail, fail
-
Field Details
-
FIELD_NAME
- See Also:
-
-
Constructor Details
-
BaseXYPointTestCase
public BaseXYPointTestCase()
-
-
Method Details
-
nextX
protected float nextX() -
nextY
protected float nextY() -
nextBox
-
nextPolygon
-
nextGeometry
-
testIndexExtremeValues
public void testIndexExtremeValues()Valid values that should not cause exception -
testIndexNaNValues
public void testIndexNaNValues()NaN: illegal -
testIndexInfValues
public void testIndexInfValues()Inf: illegal -
testBoxBasics
Add a single point and search for it in a box- Throws:
Exception
-
testBoxNull
public void testBoxNull()null field name not allowed -
testBoxInvalidCoordinates
- Throws:
Exception
-
testDistanceBasics
test we can search for a point- Throws:
Exception
-
testDistanceNull
public void testDistanceNull()null field name not allowed -
testDistanceIllegal
distance query should not accept invalid x/y as origin- Throws:
Exception
-
testDistanceNegative
public void testDistanceNegative()negative distance queries are not allowed -
testDistanceNaN
public void testDistanceNaN()NaN distance queries are not allowed -
testDistanceInf
public void testDistanceInf()Inf distance queries are not allowed -
testPolygonBasics
test we can search for a polygon- Throws:
Exception
-
testPolygonHole
test we can search for a polygon with a hole (but still includes the doc)- Throws:
Exception
-
testPolygonHoleExcludes
test we can search for a polygon with a hole (that excludes the doc)- Throws:
Exception
-
testMultiPolygonBasics
test we can search for a multi-polygon- Throws:
Exception
-
testPolygonNullField
public void testPolygonNullField()null field name not allowed -
testSamePointManyTimes
- Throws:
Exception
-
testLowCardinality
- Throws:
Exception
-
testAllYEqual
- Throws:
Exception
-
testAllXEqual
- Throws:
Exception
-
testMultiValued
- Throws:
Exception
-
testRandomTiny
- Throws:
Exception
-
testRandomMedium
- Throws:
Exception
-
testRandomBig
- Throws:
Exception
-
addPointToDoc
-
newRectQuery
-
newDistanceQuery
-
newPolygonQuery
-
newGeometryQuery
-
verifyRandomRectangles
- Throws:
Exception
-
verifyRandomDistances
- Throws:
Exception
-
verifyRandomPolygons
- Throws:
Exception
-
verifyRandomGeometries
- Throws:
Exception
-
testRectBoundariesAreInclusive
- Throws:
Exception
-
testRandomDistance
Run a few iterations with just 10 docs, hopefully easy to debug- Throws:
Exception
-
testRandomDistanceHuge
Runs with thousands of docs- Throws:
Exception
-
testEquals
public void testEquals() -
testSmallSetRect
- Throws:
Exception
-
testSmallSetRect2
- Throws:
Exception
-
testSmallSetMultiValued
- Throws:
Exception
-
testSmallSetWholeSpace
- Throws:
Exception
-
testSmallSetPoly
- Throws:
Exception
-
testSmallSetPolyWholeSpace
- Throws:
Exception
-
testSmallSetDistance
- Throws:
Exception
-
testSmallSetTinyDistance
- Throws:
Exception
-
testSmallSetHugeDistance
Explicitly large- Throws:
Exception
-