## 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.Nightly`

Field Summary
`protected AtomicInteger` `addCount`
`protected AtomicInteger` `delCount`
`protected org.apache.lucene.store.Directory` `dir`
`protected AtomicBoolean` `failed`
`protected AtomicInteger` `packCount`
`protected org.apache.lucene.index.IndexWriter` `writer`

Fields inherited from class org.apache.lucene.util.LuceneTestCase
`classRules, random, RANDOM_MULTIPLIER, ruleChain, stores, TEMP_DIR, TEST_CLEAN_THREADS, TEST_DIRECTORY, TEST_ITER, TEST_ITER_MIN, TEST_LINE_DOCS_FILE, TEST_LOCALE, TEST_NIGHTLY, TEST_SEED, TEST_TIMEZONE, TEST_VERSION_CURRENT, testsFailed, VERBOSE`

Constructor Summary
`ThreadedIndexingAndSearchingTestCase()`

Method Summary
`protected void` `addDocument(org.apache.lucene.index.Term id, org.apache.lucene.document.Document doc)`
`protected void` `addDocuments(org.apache.lucene.index.Term id, Collection<org.apache.lucene.document.Document> docs)`
`protected void` `deleteDocuments(org.apache.lucene.index.Term term)`
`protected void` `doAfterIndexingThreadDone()`
`protected void` `doAfterWriter(ExecutorService es)`
`protected void` `doClose()`
`protected abstract void` `doSearching(ExecutorService es, long stopTime)`
`protected abstract org.apache.lucene.search.IndexSearcher` `getCurrentSearcher()`
`protected org.apache.lucene.store.Directory` `getDirectory(org.apache.lucene.store.Directory in)`
`protected abstract org.apache.lucene.search.IndexSearcher` `getFinalSearcher()`
`protected void` `releaseSearcher(org.apache.lucene.search.IndexSearcher s)`
`protected void` `runSearchThreads(long stopTimeMS)`
`void` `runTest(String testName)`
`protected void` `smokeTestSearcher(org.apache.lucene.search.IndexSearcher s)`
`protected void` `updateDocument(org.apache.lucene.index.Term term, org.apache.lucene.document.Document doc)`
`protected void` `updateDocuments(org.apache.lucene.index.Term id, Collection<org.apache.lucene.document.Document> docs)`

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

`afterClassLuceneTestCaseJ4, alwaysIgnoredTestMethod, assertEquals, assertEquals, assertEquals, assertEquals, assertSaneFieldCaches, asSet, assumeFalse, assumeNoException, assumeTrue, atLeast, atLeast, beforeClassLuceneTestCaseJ4, dumpArray, dumpIterator, getDataFile, getName, getTestClass, getTestLabel, isTestThread, localeForName, newDirectory, newDirectory, newDirectory, newDirectory, newField, newField, newField, newField, newField, newField, newFSDirectory, newFSDirectory, newIndexWriterConfig, newIndexWriterConfig, newLogMergePolicy, newLogMergePolicy, newLogMergePolicy, newLogMergePolicy, newLogMergePolicy, newSearcher, newSearcher, newTieredMergePolicy, newTieredMergePolicy, purgeFieldCache, randomDirectory, randomLocale, randomTimeZone, rarely, rarely, reportAdditionalFailureInfo, reportPartialFailureInfo, setMergeFactor, setUp, setUseCompoundFile, 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, 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 org.apache.lucene.store.Directory dir

### writer

    protected org.apache.lucene.index.IndexWriter writer

Constructor Detail

### ThreadedIndexingAndSearchingTestCase

    public ThreadedIndexingAndSearchingTestCase()

Method Detail

### getCurrentSearcher

    protected abstract org.apache.lucene.search.IndexSearcher getCurrentSearcher()
                                                                          throws Exception

  Throws:
    `Exception`

### getFinalSearcher

    protected abstract org.apache.lucene.search.IndexSearcher getFinalSearcher()
                                                                        throws Exception

  Throws:
    `Exception`

### releaseSearcher

    protected void releaseSearcher(org.apache.lucene.search.IndexSearcher s)
                            throws Exception

  Throws:
    `Exception`

### doSearching

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

  Throws:
    `Exception`

### getDirectory

    protected org.apache.lucene.store.Directory getDirectory(org.apache.lucene.store.Directory in)

### updateDocuments

    protected void updateDocuments(org.apache.lucene.index.Term id,
                                   Collection<org.apache.lucene.document.Document> docs)
                            throws Exception

  Throws:
    `Exception`

### addDocuments

    protected void addDocuments(org.apache.lucene.index.Term id,
                                Collection<org.apache.lucene.document.Document> docs)
                         throws Exception

  Throws:
    `Exception`

### addDocument

    protected void addDocument(org.apache.lucene.index.Term id,
                               org.apache.lucene.document.Document doc)
                        throws Exception

  Throws:
    `Exception`

### updateDocument

    protected void updateDocument(org.apache.lucene.index.Term term,
                                  org.apache.lucene.document.Document doc)
                           throws Exception

  Throws:
    `Exception`

### deleteDocuments

    protected void deleteDocuments(org.apache.lucene.index.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(org.apache.lucene.search.IndexSearcher s)
                              throws Exception

  Throws:
    `Exception`