org.apache.lucene.index
Class ThreadedIndexingAndSearchingTestCase

java.lang.Object
  extended by org.junit.Assert
      extended by org.apache.lucene.util.LuceneTestCase
          extended by 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  Directory dir
           
protected  AtomicBoolean failed
           
protected  AtomicInteger packCount
           
protected  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(Term id, Document doc)
           
protected  void addDocuments(Term id, Collection<Document> 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, Document doc)
           
protected  void updateDocuments(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, 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
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,
                               Collection<Document> docs)
                        throws Exception
Throws:
Exception

addDocuments

protected void addDocuments(Term id,
                            Collection<Document> docs)
                     throws Exception
Throws:
Exception

addDocument

protected void addDocument(Term id,
                           Document doc)
                    throws Exception
Throws:
Exception

updateDocument

protected void updateDocument(Term term,
                              Document 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