org.apache.lucene.util
Class BaseDocIdSetTestCase<T extends DocIdSet>

java.lang.Object
  extended by org.junit.Assert
      extended by org.apache.lucene.util.LuceneTestCase
          extended by org.apache.lucene.util.BaseDocIdSetTestCase<T>

public abstract class BaseDocIdSetTestCase<T extends DocIdSet>
extends LuceneTestCase

Base test class for DocIdSets.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.lucene.util.LuceneTestCase
LuceneTestCase.AwaitsFix, LuceneTestCase.BadApple, LuceneTestCase.Nightly, LuceneTestCase.Slow, LuceneTestCase.SuppressCodecs, LuceneTestCase.Weekly
 
Field Summary
 
Fields inherited from class org.apache.lucene.util.LuceneTestCase
classRules, DEFAULT_LINE_DOCS_FILE, doesntSupportOffsets, INFOSTREAM, JENKINS_LARGE_LINE_DOCS_FILE, OLD_FORMAT_IMPERSONATION_IS_ACTIVE, PREFLEX_IMPERSONATION_IS_ACTIVE, RANDOM_MULTIPLIER, ruleChain, suiteFailureMarker, SYSPROP_AWAITSFIX, SYSPROP_BADAPPLES, SYSPROP_FAILFAST, SYSPROP_MAXFAILURES, SYSPROP_NIGHTLY, SYSPROP_SLOW, SYSPROP_WEEKLY, TEMP_DIR, TEST_AWAITSFIX, TEST_CODEC, TEST_DIRECTORY, TEST_DOCVALUESFORMAT, TEST_LINE_DOCS_FILE, TEST_NIGHTLY, TEST_POSTINGSFORMAT, TEST_SLOW, TEST_THROTTLING, TEST_VERSION_CURRENT, TEST_WEEKLY, VERBOSE
 
Constructor Summary
BaseDocIdSetTestCase()
           
 
Method Summary
 void assertEquals(int numBits, BitSet ds1, T ds2)
          Assert that the content of the DocIdSet is the same as the content of the BitSet.
abstract  T copyOf(BitSet bs, int length)
          Create a copy of the given BitSet which has length bits.
protected static BitSet randomSet(int numBits, float percentSet)
          Same as randomSet(int, int) but given a load factor.
protected static BitSet randomSet(int numBits, int numBitsSet)
          Create a random set which has numBitsSet of its numBits bits set.
 void test1Bit()
          Test length=1.
 void test2Bits()
          Test length=2.
 void testAgainstBitSet()
          Compare the content of the set against a BitSet.
 void testNoBit()
          Test length=0.
 
Methods inherited from class org.apache.lucene.util.LuceneTestCase
assertDeletedDocsEquals, assertDocsAndPositionsEnumEquals, assertDocsEnumEquals, assertDocsSkippingEquals, assertDocValuesEquals, assertDocValuesEquals, assertFieldInfosEquals, assertFieldsEquals, assertFieldStatisticsEquals, assertNormsEquals, assertPositionsSkippingEquals, assertReaderEquals, assertReaderStatisticsEquals, assertSaneFieldCaches, assertStoredFieldEquals, assertStoredFieldsEquals, assertTermsEnumEquals, assertTermsEquals, assertTermsStatisticsEquals, assertTermStatsEquals, assertTermVectorsEquals, asSet, assumeFalse, assumeNoException, assumeTrue, atLeast, atLeast, closeAfterSuite, closeAfterTest, defaultCodecSupportsDocsWithField, defaultCodecSupportsDocValues, defaultCodecSupportsSortedSet, dumpArray, dumpIterator, getDataFile, getOnlySegmentReader, getTestClass, getTestName, isTestThread, localeForName, maybeWrapReader, newAlcoholicMergePolicy, newAlcoholicMergePolicy, newDirectory, newDirectory, newDirectory, newDirectory, newField, newField, newFSDirectory, newFSDirectory, newIndexWriterConfig, newIndexWriterConfig, newIOContext, newIOContext, newLogMergePolicy, newLogMergePolicy, newLogMergePolicy, newLogMergePolicy, newLogMergePolicy, newMergePolicy, newMergePolicy, newMockDirectory, newMockDirectory, newMockFSDirectory, newSearcher, newSearcher, newStringField, newStringField, newTextField, newTextField, newTieredMergePolicy, newTieredMergePolicy, random, randomLocale, randomTimeZone, rarely, rarely, replaceMaxFailureRule, setUp, tearDown, usually, usually
 
Methods inherited from class org.junit.Assert
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, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertThat, assertThat, assertTrue, assertTrue, fail, fail
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BaseDocIdSetTestCase

public BaseDocIdSetTestCase()
Method Detail

copyOf

public abstract T copyOf(BitSet bs,
                         int length)
                                   throws IOException
Create a copy of the given BitSet which has length bits.

Throws:
IOException

randomSet

protected static BitSet randomSet(int numBits,
                                  int numBitsSet)
Create a random set which has numBitsSet of its numBits bits set.


randomSet

protected static BitSet randomSet(int numBits,
                                  float percentSet)
Same as randomSet(int, int) but given a load factor.


testNoBit

public void testNoBit()
               throws IOException
Test length=0.

Throws:
IOException

test1Bit

public void test1Bit()
              throws IOException
Test length=1.

Throws:
IOException

test2Bits

public void test2Bits()
               throws IOException
Test length=2.

Throws:
IOException

testAgainstBitSet

public void testAgainstBitSet()
                       throws IOException
Compare the content of the set against a BitSet.

Throws:
IOException

assertEquals

public void assertEquals(int numBits,
                         BitSet ds1,
                         T ds2)
                  throws IOException
Assert that the content of the DocIdSet is the same as the content of the BitSet.

Throws:
IOException


Copyright © 2000-2013 Apache Software Foundation. All Rights Reserved.