Package 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
Fields Modifier and Type Field Description protected AtomicIntegeraddCountprotected AtomicIntegerdelCountprotected Directorydirprotected AtomicBooleanfailedprotected AtomicIntegerpackCountprotected IndexWriterwriter-
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
Constructors Constructor Description ThreadedIndexingAndSearchingTestCase()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voidaddDocument(Term id, Document doc)protected voidaddDocuments(Term id, Collection<Document> docs)protected voiddeleteDocuments(Term term)protected voiddoAfterIndexingThreadDone()protected voiddoAfterWriter(ExecutorService es)protected voiddoClose()protected abstract voiddoSearching(ExecutorService es, long stopTime)protected abstract IndexSearchergetCurrentSearcher()protected DirectorygetDirectory(Directory in)protected abstract IndexSearchergetFinalSearcher()protected voidreleaseSearcher(IndexSearcher s)protected voidrunSearchThreads(long stopTimeMS)voidrunTest(String testName)protected voidsmokeTestSearcher(IndexSearcher s)protected voidupdateDocument(Term term, Document doc)protected voidupdateDocuments(Term id, Collection<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, assertArrayEquals, assertArrayEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotEquals, assertNotEquals, assertNotEquals, assertNotEquals, assertNotEquals, assertNotEquals, assertNotEquals, assertNotEquals, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertThat, assertThat, assertTrue, assertTrue, fail, fail
-
-
-
-
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
-
-
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
-
updateDocuments
protected void updateDocuments(Term id, Collection<Document> docs) throws Exception
- Throws:
Exception
-
addDocuments
protected void addDocuments(Term id, Collection<Document> docs) throws Exception
- Throws:
Exception
-
updateDocument
protected void updateDocument(Term term, Document doc) 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
-
smokeTestSearcher
protected void smokeTestSearcher(IndexSearcher s) throws Exception
- Throws:
Exception
-
-