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.Monster, LuceneTestCase.Nightly, LuceneTestCase.Slow, LuceneTestCase.SuppressCodecs, LuceneTestCase.SuppressFileSystems, LuceneTestCase.SuppressFsync, LuceneTestCase.SuppressReproduceLine, LuceneTestCase.SuppressSysoutChecks, LuceneTestCase.SuppressTempFileChecks, LuceneTestCase.ThrowingRunnable, LuceneTestCase.Weekly`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected AtomicInteger` | `addCount`
    `protected boolean` | `assertMergedSegmentsWarmed`
    `protected AtomicInteger` | `delCount`
    `protected Directory` | `dir`
    `protected AtomicBoolean` | `failed`
    `protected AtomicInteger` | `packCount`
    `protected IndexWriter` | `writer`

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

      `assertsAreEnabled, classRules, DEFAULT_LINE_DOCS_FILE, INFOSTREAM, JENKINS_LARGE_LINE_DOCS_FILE, LEAVE_TEMPORARY, MAYBE_CACHE_POLICY, RANDOM_MULTIPLIER, ruleChain, suiteFailureMarker, SYSPROP_AWAITSFIX, SYSPROP_BADAPPLES, SYSPROP_FAILFAST, SYSPROP_MAXFAILURES, SYSPROP_MONSTER, SYSPROP_NIGHTLY, SYSPROP_SLOW, SYSPROP_WEEKLY, TEST_ASSERTS_ENABLED, TEST_AWAITSFIX, TEST_BADAPPLES, TEST_CODEC, TEST_DIRECTORY, TEST_DOCVALUESFORMAT, TEST_LINE_DOCS_FILE, TEST_MONSTER, TEST_NIGHTLY, TEST_POSTINGSFORMAT, TEST_SLOW, TEST_THROTTLING, TEST_WEEKLY, VERBOSE`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ThreadedIndexingAndSearchingTestCase()`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `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

      `addVirusChecker, assertDeletedDocsEquals, assertDocsAndPositionsEnumEquals, assertDocsEnumEquals, assertDocsSkippingEquals, assertDocValuesEquals, assertDocValuesEquals, assertFieldInfosEquals, assertFieldsEquals, assertFieldStatisticsEquals, assertNormsEquals, assertPointsEquals, assertPositionsSkippingEquals, assertReaderEquals, assertReaderStatisticsEquals, assertStoredFieldEquals, assertStoredFieldsEquals, assertTermsEnumEquals, assertTermsEquals, assertTermsStatisticsEquals, assertTermStatsEquals, assertTermVectorsEquals, asSet, assumeFalse, assumeNoException, assumeTrue, assumeWorkingMMapOnWindows, atLeast, atLeast, closeAfterSuite, closeAfterTest, collate, createTempDir, createTempDir, createTempFile, createTempFile, dumpArray, dumpIterator, expectThrows, expectThrows, getBaseTempDirForTestClass, getDataInputStream, getDataPath, getOnlyLeafReader, getTestClass, getTestName, hasWorkingMMapOnWindows, isTestThread, localeForLanguageTag, maybeChangeLiveIndexWriterConfig, maybeWrapReader, newAlcoholicMergePolicy, newAlcoholicMergePolicy, newDirectory, newDirectory, newDirectory, newDirectory, newDirectory, newField, newField, newFSDirectory, newFSDirectory, newIndexWriterConfig, newIndexWriterConfig, newIndexWriterConfig, newIOContext, newIOContext, newLogMergePolicy, newLogMergePolicy, newLogMergePolicy, newLogMergePolicy, newLogMergePolicy, newMaybeVirusCheckingDirectory, newMaybeVirusCheckingFSDirectory, newMergePolicy, newMergePolicy, newMockDirectory, newMockDirectory, newMockDirectory, newMockFSDirectory, newMockFSDirectory, newSearcher, newSearcher, newSearcher, newStringField, newStringField, newStringField, newStringField, newTextField, newTextField, newTieredMergePolicy, newTieredMergePolicy, overrideDefaultQueryCache, overrideTestDefaultQueryCache, random, randomLocale, randomTimeZone, rarely, rarely, replaceMaxFailureRule, resetDefaultQueryCache, restoreCPUCoreCount, restoreIndexWriterMaxDocs, restoreSpins, runWithRestrictedPermissions, setIndexWriterMaxDocs, setUp, setupCPUCoreCount, setupSpins, slowFileExists, tearDown, usually, usually, wrapReader`

    - ### 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 Directory 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`

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