Class QueryParserTestBase


  • public abstract class QueryParserTestBase
    extends LuceneTestCase
    Base Test class for QueryParser subclasses
    • Field Detail

      • qpAnalyzer

        public static org.apache.lucene.analysis.Analyzer qpAnalyzer
    • Constructor Detail

      • QueryParserTestBase

        public QueryParserTestBase()
    • Method Detail

      • getParser

        public abstract org.apache.lucene.queryParser.QueryParser getParser​(org.apache.lucene.analysis.Analyzer a)
                                                                     throws Exception
        Throws:
        Exception
      • getQuery

        public org.apache.lucene.search.Query getQuery​(String query,
                                                       org.apache.lucene.analysis.Analyzer a)
                                                throws Exception
        Throws:
        Exception
      • assertQueryEquals

        public void assertQueryEquals​(String query,
                                      org.apache.lucene.analysis.Analyzer a,
                                      String result)
                               throws Exception
        Throws:
        Exception
      • assertQueryEquals

        public void assertQueryEquals​(org.apache.lucene.queryParser.QueryParser qp,
                                      String field,
                                      String query,
                                      String result)
                               throws Exception
        Throws:
        Exception
      • assertEscapedQueryEquals

        public void assertEscapedQueryEquals​(String query,
                                             org.apache.lucene.analysis.Analyzer a,
                                             String result)
                                      throws Exception
        Throws:
        Exception
      • assertWildcardQueryEquals

        public void assertWildcardQueryEquals​(String query,
                                              boolean lowercase,
                                              String result,
                                              boolean allowLeadingWildcard)
                                       throws Exception
        Throws:
        Exception
      • assertWildcardQueryEquals

        public void assertWildcardQueryEquals​(String query,
                                              boolean lowercase,
                                              String result)
                                       throws Exception
        Throws:
        Exception
      • getQueryDOA

        public org.apache.lucene.search.Query getQueryDOA​(String query,
                                                          org.apache.lucene.analysis.Analyzer a)
                                                   throws Exception
        Throws:
        Exception
      • assertQueryEqualsDOA

        public void assertQueryEqualsDOA​(String query,
                                         org.apache.lucene.analysis.Analyzer a,
                                         String result)
                                  throws Exception
        Throws:
        Exception
      • testCJKBoostedTerm

        public void testCJKBoostedTerm()
                                throws Exception
        Throws:
        Exception
      • testCJKBoostedPhrase

        public void testCJKBoostedPhrase()
                                  throws Exception
        Throws:
        Exception
      • testCJKSloppyPhrase

        public void testCJKSloppyPhrase()
                                 throws Exception
        Throws:
        Exception
      • testAutoGeneratePhraseQueriesOn

        public void testAutoGeneratePhraseQueriesOn()
                                             throws Exception
        Throws:
        Exception
      • testLeadingWildcardType

        public void testLeadingWildcardType()
                                     throws Exception
        Throws:
        Exception
      • testFarsiRangeCollating

        public void testFarsiRangeCollating()
                                     throws Exception
        Throws:
        Exception
      • testLegacyDateRange

        public void testLegacyDateRange()
                                 throws Exception
        for testing legacy DateField support
        Throws:
        Exception
      • assertDateRangeQueryEquals

        public void assertDateRangeQueryEquals​(org.apache.lucene.queryParser.QueryParser qp,
                                               String field,
                                               String startDate,
                                               String endDate,
                                               Date endDateInclusive,
                                               org.apache.lucene.document.DateTools.Resolution resolution)
                                        throws Exception
        Throws:
        Exception
      • testQueryStringEscaping

        public void testQueryStringEscaping()
                                     throws Exception
        Throws:
        Exception
      • testTabNewlineCarriageReturn

        public void testTabNewlineCarriageReturn()
                                          throws Exception
        Throws:
        Exception
      • testCustomQueryParserWildcard

        public void testCustomQueryParserWildcard()
      • testCustomQueryParserFuzzy

        public void testCustomQueryParserFuzzy()
                                        throws Exception
        Throws:
        Exception
      • testPrecedence

        public void testPrecedence()
                            throws Exception
        This test differs from TestPrecedenceQueryParser
        Throws:
        Exception
      • testLocalDateFormat

        public void testLocalDateFormat()
                                 throws IOException,
                                        org.apache.lucene.queryParser.ParseException
        Throws:
        IOException
        org.apache.lucene.queryParser.ParseException
      • testPositionIncrement

        public void testPositionIncrement()
                                   throws Exception
        Throws:
        Exception
      • testPositionIncrements

        public void testPositionIncrements()
                                    throws Exception
        Throws:
        Exception
      • testProtectedCtors

        public void testProtectedCtors()
                                throws Exception
        Throws:
        Exception