org.apache.lucene.index

## Class ThreadedIndexingAndSearchingTestCase

- java.lang.Object
- - org.junit.Assert
  - - org.apache.lucene.util.LuceneTestCase
    - - org.apache.lucene.index.ThreadedIndexingAndSearchingTestCase

    public abstract class ThreadedIndexingAndSearchingTestCase
    extends LuceneTestCase

Utility class that spawns multiple indexing and searching threads.

### 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
`protected AtomicInteger` `addCount`
`protected boolean` `assertMergedSegmentsWarmed`
`protected AtomicInteger` `delCount`
`protected MockDirectoryWrapper` `dir`
`protected AtomicBoolean` `failed`
`protected AtomicInteger` `packCount`
`protected IndexWriter` `writer`

### Fields inherited from class org.apache.lucene.util.LuceneTestCase

`classRules, DEFAULT_LINE_DOCS_FILE, doesntSupportOffsets, INFOSTREAM, JENKINS_LARGE_LINE_DOCS_FILE, PREFLEX_IMPERSONATION_IS_ACTIVE, RANDOM_MULTIPLIER, ruleChain, suiteFailureMarker, SYSPROP_AWAITSFIX, SYSPROP_BADAPPLES, 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

Constructors
Constructor and Description
`ThreadedIndexingAndSearchingTestCase()`

### Method Summary

Methods
`protected void` `addDocument(Term id, Iterable<? extends IndexableField> doc)`
`protected void` `addDocuments(Term id, List<? extends Iterable<? extends IndexableField>> docs)`
`protected void` `deleteDocuments(Term term)`
`protected void` `doAfterIndexingThreadDone()`
`protected void` `doAfterWriter(ExecutorService es)`
`protected void` `doClose()`
`protected abstract void` `doSearching(ExecutorService es, long stopTime)`
`protected abstract IndexSearcher` `getCurrentSearcher()`
`protected Directory` `getDirectory(Directory in)`
`protected abstract IndexSearcher` `getFinalSearcher()`
`protected void` `releaseSearcher(IndexSearcher s)`
`protected void` `runSearchThreads(long stopTimeMS)`
`void` `runTest(String testName)`
`protected void` `smokeTestSearcher(IndexSearcher s)`
`protected void` `updateDocument(Term term, Iterable<? extends IndexableField> doc)`
`protected void` `updateDocuments(Term id, List<? extends Iterable<? extends IndexableField>> docs)`

### Methods inherited from class org.apache.lucene.util.LuceneTestCase

`assertSaneFieldCaches, asSet, assumeFalse, assumeNoException, assumeTrue, atLeast, atLeast, closeAfterSuite, closeAfterTest, 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, newMockDirectory, newMockDirectory, newMockFSDirectory, newSearcher, newSearcher, newStringField, newStringField, newTextField, newTextField, newTieredMergePolicy, newTieredMergePolicy, random, randomLocale, randomTimeZone, rarely, rarely, 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`

### Field Detail

#### failed

    protected final AtomicBoolean failed

#### addCount

    protected final AtomicInteger addCount

#### delCount

    protected final AtomicInteger delCount

#### packCount

    protected final AtomicInteger packCount

#### dir

    protected MockDirectoryWrapper dir

#### writer

    protected IndexWriter writer

#### assertMergedSegmentsWarmed

    protected boolean assertMergedSegmentsWarmed

### Constructor Detail

#### ThreadedIndexingAndSearchingTestCase

    public ThreadedIndexingAndSearchingTestCase()

### Method Detail

#### getCurrentSearcher

    protected abstract IndexSearcher getCurrentSearcher()
                                                 throws Exception

Throws:
  `Exception`

#### getFinalSearcher

    protected abstract IndexSearcher getFinalSearcher()
                                               throws Exception

Throws:
  `Exception`

#### releaseSearcher

    protected void releaseSearcher(IndexSearcher s)
                            throws Exception

Throws:
  `Exception`

#### doSearching

    protected abstract void doSearching(ExecutorService es,
                   long stopTime)
                                 throws Exception

Throws:
  `Exception`

#### getDirectory

    protected Directory getDirectory(Directory in)

#### updateDocuments

    protected void updateDocuments(Term id,
                       List<? extends Iterable<? extends IndexableField>> docs)
                            throws Exception

Throws:
  `Exception`

#### addDocuments

    protected void addDocuments(Term id,
                    List<? extends Iterable<? extends IndexableField>> docs)
                         throws Exception

Throws:
  `Exception`

#### addDocument

    protected void addDocument(Term id,
                   Iterable<? extends IndexableField> doc)
                        throws Exception

Throws:
  `Exception`

#### updateDocument

    protected void updateDocument(Term term,
                      Iterable<? extends IndexableField> doc)
                           throws Exception

Throws:
  `Exception`

#### deleteDocuments

    protected void deleteDocuments(Term term)
                            throws Exception

Throws:
  `Exception`

#### doAfterIndexingThreadDone

    protected void doAfterIndexingThreadDone()

#### runSearchThreads

    protected void runSearchThreads(long stopTimeMS)
                             throws Exception

Throws:
  `Exception`

#### doAfterWriter

    protected void doAfterWriter(ExecutorService es)
                          throws Exception

Throws:
  `Exception`

#### doClose

    protected void doClose()
                    throws Exception

Throws:
  `Exception`

#### runTest

    public void runTest(String testName)
                 throws Exception

Throws:
  `Exception`

#### smokeTestSearcher

    protected void smokeTestSearcher(IndexSearcher s)
                              throws Exception

Throws:
  `Exception`