Class BaseXYPointTestCase


  • public abstract class BaseXYPointTestCase
    extends LuceneTestCase
    Abstract class to do basic tests for a xy spatial impl (high level fields and queries)
    • Constructor Detail

      • BaseXYPointTestCase

        public BaseXYPointTestCase()
    • Method Detail

      • nextX

        protected float nextX()
      • nextY

        protected float nextY()
      • nextPolygon

        protected XYPolygon nextPolygon()
      • nextGeometry

        protected XYGeometry[] 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

        public void testBoxBasics()
                           throws Exception
        Add a single point and search for it in a box
        Throws:
        Exception
      • testBoxNull

        public void testBoxNull()
        null field name not allowed
      • testBoxInvalidCoordinates

        public void testBoxInvalidCoordinates()
                                       throws Exception
        Throws:
        Exception
      • testDistanceBasics

        public void testDistanceBasics()
                                throws Exception
        test we can search for a point
        Throws:
        Exception
      • testDistanceNull

        public void testDistanceNull()
        null field name not allowed
      • testDistanceIllegal

        public void testDistanceIllegal()
                                 throws Exception
        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

        public void testPolygonBasics()
                               throws Exception
        test we can search for a polygon
        Throws:
        Exception
      • testPolygonHole

        public void testPolygonHole()
                             throws Exception
        test we can search for a polygon with a hole (but still includes the doc)
        Throws:
        Exception
      • testPolygonHoleExcludes

        public void testPolygonHoleExcludes()
                                     throws Exception
        test we can search for a polygon with a hole (that excludes the doc)
        Throws:
        Exception
      • testMultiPolygonBasics

        public void testMultiPolygonBasics()
                                    throws Exception
        test we can search for a multi-polygon
        Throws:
        Exception
      • testPolygonNullField

        public void testPolygonNullField()
        null field name not allowed
      • testSamePointManyTimes

        public void testSamePointManyTimes()
                                    throws Exception
        Throws:
        Exception
      • testLowCardinality

        public void testLowCardinality()
                                throws Exception
        Throws:
        Exception
      • addPointToDoc

        protected abstract void addPointToDoc​(String field,
                                              Document doc,
                                              float x,
                                              float y)
      • newRectQuery

        protected abstract Query newRectQuery​(String field,
                                              float minX,
                                              float maxX,
                                              float minY,
                                              float maxY)
      • newDistanceQuery

        protected abstract Query newDistanceQuery​(String field,
                                                  float centerX,
                                                  float centerY,
                                                  float radius)
      • newPolygonQuery

        protected abstract Query newPolygonQuery​(String field,
                                                 XYPolygon... polygon)
      • newGeometryQuery

        protected abstract Query newGeometryQuery​(String field,
                                                  XYGeometry... geometries)
      • verifyRandomRectangles

        protected void verifyRandomRectangles​(float[] xs,
                                              float[] ys)
                                       throws Exception
        Throws:
        Exception
      • verifyRandomDistances

        protected void verifyRandomDistances​(float[] xs,
                                             float[] ys)
                                      throws Exception
        Throws:
        Exception
      • verifyRandomPolygons

        protected void verifyRandomPolygons​(float[] xs,
                                            float[] ys)
                                     throws Exception
        Throws:
        Exception
      • verifyRandomGeometries

        protected void verifyRandomGeometries​(float[] xs,
                                              float[] ys)
                                       throws Exception
        Throws:
        Exception
      • testRectBoundariesAreInclusive

        public void testRectBoundariesAreInclusive()
                                            throws Exception
        Throws:
        Exception
      • testRandomDistance

        public void testRandomDistance()
                                throws Exception
        Run a few iterations with just 10 docs, hopefully easy to debug
        Throws:
        Exception
      • testRandomDistanceHuge

        @Nightly
        public void testRandomDistanceHuge()
                                    throws Exception
        Runs with thousands of docs
        Throws:
        Exception
      • testEquals

        public void testEquals()
      • testSmallSetMultiValued

        public void testSmallSetMultiValued()
                                     throws Exception
        Throws:
        Exception
      • testSmallSetWholeSpace

        public void testSmallSetWholeSpace()
                                    throws Exception
        Throws:
        Exception
      • testSmallSetPolyWholeSpace

        public void testSmallSetPolyWholeSpace()
                                        throws Exception
        Throws:
        Exception
      • testSmallSetDistance

        public void testSmallSetDistance()
                                  throws Exception
        Throws:
        Exception
      • testSmallSetTinyDistance

        public void testSmallSetTinyDistance()
                                      throws Exception
        Throws:
        Exception
      • testSmallSetHugeDistance

        public void testSmallSetHugeDistance()
                                      throws Exception
        Explicitly large
        Throws:
        Exception