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 org.apache.lucene.store.Directorydirprotected AtomicBooleanfailedprotected AtomicIntegerpackCountprotected org.apache.lucene.index.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(org.apache.lucene.index.Term id, org.apache.lucene.document.Document doc)protected voidaddDocuments(org.apache.lucene.index.Term id, Collection<org.apache.lucene.document.Document> docs)protected voiddeleteDocuments(org.apache.lucene.index.Term term)protected voiddoAfterIndexingThreadDone()protected voiddoAfterWriter(ExecutorService es)protected voiddoClose()protected abstract voiddoSearching(ExecutorService es, long stopTime)protected abstract org.apache.lucene.search.IndexSearchergetCurrentSearcher()protected org.apache.lucene.store.DirectorygetDirectory(org.apache.lucene.store.Directory in)protected abstract org.apache.lucene.search.IndexSearchergetFinalSearcher()protected voidreleaseSearcher(org.apache.lucene.search.IndexSearcher s)protected voidrunSearchThreads(long stopTimeMS)voidrunTest(String testName)protected voidsmokeTestSearcher(org.apache.lucene.search.IndexSearcher s)protected voidupdateDocument(org.apache.lucene.index.Term term, org.apache.lucene.document.Document doc)protected voidupdateDocuments(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, 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 org.apache.lucene.store.Directory dir
-
writer
protected org.apache.lucene.index.IndexWriter writer
-
-
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
-
-