Class BasePostingsFormatTestCase


public abstract class BasePostingsFormatTestCase extends BaseIndexFileFormatTestCase
Abstract class to do basic tests for a postings format. NOTE: This test focuses on the postings (docs/freqs/positions/payloads/offsets) impl, not the terms dict. The [stretch] goal is for this test to be so thorough in testing a new PostingsFormat that if this test passes, then all Lucene tests should also pass. Ie, if there is some bug in a given PostingsFormat that this test fails to catch then this test needs to be improved!
  • Constructor Details

    • BasePostingsFormatTestCase

      public BasePostingsFormatTestCase()
  • Method Details

    • createPostings

      public static void createPostings() throws IOException
      Throws:
      IOException
    • afterClass

      public static void afterClass() throws Exception
      Throws:
      Exception
    • testDocsOnly

      public void testDocsOnly() throws Exception
      Throws:
      Exception
    • testDocsAndFreqs

      public void testDocsAndFreqs() throws Exception
      Throws:
      Exception
    • testDocsAndFreqsAndPositions

      public void testDocsAndFreqsAndPositions() throws Exception
      Throws:
      Exception
    • testDocsAndFreqsAndPositionsAndPayloads

      public void testDocsAndFreqsAndPositionsAndPayloads() throws Exception
      Throws:
      Exception
    • testDocsAndFreqsAndPositionsAndOffsets

      public void testDocsAndFreqsAndPositionsAndOffsets() throws Exception
      Throws:
      Exception
    • testDocsAndFreqsAndPositionsAndOffsetsAndPayloads

      public void testDocsAndFreqsAndPositionsAndOffsetsAndPayloads() throws Exception
      Throws:
      Exception
    • testRandom

      public void testRandom() throws Exception
      Throws:
      Exception
    • isPostingsEnumReuseImplemented

      protected boolean isPostingsEnumReuseImplemented()
    • testPostingsEnumReuse

      public void testPostingsEnumReuse() throws Exception
      Throws:
      Exception
    • checkReuse

      protected static void checkReuse(TermsEnum termsEnum, int firstFlags, int secondFlags, boolean shouldReuse) throws IOException
      Throws:
      IOException
    • testJustEmptyField

      public void testJustEmptyField() throws Exception
      Throws:
      Exception
    • testEmptyFieldAndEmptyTerm

      public void testEmptyFieldAndEmptyTerm() throws Exception
      Throws:
      Exception
    • testDidntWantFreqsButAskedAnyway

      public void testDidntWantFreqsButAskedAnyway() throws Exception
      Throws:
      Exception
    • testAskForPositionsWhenNotThere

      public void testAskForPositionsWhenNotThere() throws Exception
      Throws:
      Exception
    • testGhosts

      public void testGhosts() throws Exception
      Throws:
      Exception
    • testDisorder

      public void testDisorder() throws Exception
      Throws:
      Exception
    • subCheckBinarySearch

      protected void subCheckBinarySearch(TermsEnum termsEnum) throws Exception
      Throws:
      Exception
    • testBinarySearchTermLeaf

      public void testBinarySearchTermLeaf() throws Exception
      Throws:
      Exception
    • testLevel2Ghosts

      public void testLevel2Ghosts() throws Exception
      Throws:
      Exception
    • testInvertedWrite

      public void testInvertedWrite() throws Exception
      Throws:
      Exception
    • assertReused

      protected void assertReused(String field, PostingsEnum p1, PostingsEnum p2)
    • testPostingsEnumDocsOnly

      public void testPostingsEnumDocsOnly() throws Exception
      Throws:
      Exception
    • testPostingsEnumFreqs

      public void testPostingsEnumFreqs() throws Exception
      Throws:
      Exception
    • testPostingsEnumPositions

      public void testPostingsEnumPositions() throws Exception
      Throws:
      Exception
    • testPostingsEnumOffsets

      public void testPostingsEnumOffsets() throws Exception
      Throws:
      Exception
    • testPostingsEnumPayloads

      public void testPostingsEnumPayloads() throws Exception
      Throws:
      Exception
    • testPostingsEnumAll

      public void testPostingsEnumAll() throws Exception
      Throws:
      Exception
    • addRandomFields

      protected void addRandomFields(Document doc)
      Description copied from class: BaseIndexFileFormatTestCase
      Add random fields to the provided document.
      Specified by:
      addRandomFields in class BaseIndexFileFormatTestCase
    • testLineFileDocs

      @Nightly public void testLineFileDocs() throws IOException
      Test realistic data, which is often better at uncovering real bugs.
      Throws:
      IOException