Package org.elasticsearch.test.engine
Class ThrowingLeafReaderWrapper
java.lang.Object
org.apache.lucene.index.IndexReader
org.apache.lucene.index.LeafReader
org.apache.lucene.index.FilterLeafReader
org.elasticsearch.test.engine.ThrowingLeafReaderWrapper
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
public class ThrowingLeafReaderWrapper
extends org.apache.lucene.index.FilterLeafReader
An FilterLeafReader that allows to throw exceptions if certain methods
are called on is. This allows to test parts of the system under certain
error conditions that would otherwise not be possible.
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classThrowingLeafReaderWrapper.FlagsFlags passed toThrowingLeafReaderWrapper.Thrower.maybeThrow(org.elasticsearch.test.engine.ThrowingLeafReaderWrapper.Flags)when the corresponding method is called.static interfaceThrowingLeafReaderWrapper.ThrowerA callback interface that allows to throw certain exceptions for methods called on the IndexReader that is wrapped byThrowingLeafReaderWrapperstatic classThrowingLeafReaderWrapper.ThrowingFieldsWraps a Fields but with additional assertsstatic classThrowingLeafReaderWrapper.ThrowingTermsWraps a Terms but with additional assertsNested classes/interfaces inherited from class org.apache.lucene.index.FilterLeafReader
org.apache.lucene.index.FilterLeafReader.FilterFields, org.apache.lucene.index.FilterLeafReader.FilterPostingsEnum, org.apache.lucene.index.FilterLeafReader.FilterTerms, org.apache.lucene.index.FilterLeafReader.FilterTermsEnum -
Field Summary
-
Constructor Summary
Constructors Constructor Description ThrowingLeafReaderWrapper(org.apache.lucene.index.LeafReader in, ThrowingLeafReaderWrapper.Thrower thrower) -
Method Summary
Modifier and Type Method Description org.apache.lucene.index.BinaryDocValuesgetBinaryDocValues(java.lang.String field)org.apache.lucene.index.IndexReader.CacheHelpergetCoreCacheHelper()org.apache.lucene.index.NumericDocValuesgetNormValues(java.lang.String field)org.apache.lucene.index.NumericDocValuesgetNumericDocValues(java.lang.String field)org.apache.lucene.index.IndexReader.CacheHelpergetReaderCacheHelper()org.apache.lucene.index.SortedDocValuesgetSortedDocValues(java.lang.String field)org.apache.lucene.index.SortedSetDocValuesgetSortedSetDocValues(java.lang.String field)org.apache.lucene.index.FieldsgetTermVectors(int docID)org.apache.lucene.index.Termsterms(java.lang.String field)Methods inherited from class org.apache.lucene.index.FilterLeafReader
checkIntegrity, doClose, document, getDelegate, getFieldInfos, getLiveDocs, getMetaData, getPointValues, getSortedNumericDocValues, maxDoc, numDocs, toString, unwrapMethods inherited from class org.apache.lucene.index.LeafReader
docFreq, getContext, getDocCount, getSumDocFreq, getSumTotalTermFreq, postings, postings, totalTermFreq
-
Constructor Details
-
ThrowingLeafReaderWrapper
public ThrowingLeafReaderWrapper(org.apache.lucene.index.LeafReader in, ThrowingLeafReaderWrapper.Thrower thrower)
-
-
Method Details
-
terms
public org.apache.lucene.index.Terms terms(java.lang.String field) throws java.io.IOException- Overrides:
termsin classorg.apache.lucene.index.FilterLeafReader- Throws:
java.io.IOException
-
getTermVectors
public org.apache.lucene.index.Fields getTermVectors(int docID) throws java.io.IOException- Overrides:
getTermVectorsin classorg.apache.lucene.index.FilterLeafReader- Throws:
java.io.IOException
-
getNumericDocValues
public org.apache.lucene.index.NumericDocValues getNumericDocValues(java.lang.String field) throws java.io.IOException- Overrides:
getNumericDocValuesin classorg.apache.lucene.index.FilterLeafReader- Throws:
java.io.IOException
-
getBinaryDocValues
public org.apache.lucene.index.BinaryDocValues getBinaryDocValues(java.lang.String field) throws java.io.IOException- Overrides:
getBinaryDocValuesin classorg.apache.lucene.index.FilterLeafReader- Throws:
java.io.IOException
-
getSortedDocValues
public org.apache.lucene.index.SortedDocValues getSortedDocValues(java.lang.String field) throws java.io.IOException- Overrides:
getSortedDocValuesin classorg.apache.lucene.index.FilterLeafReader- Throws:
java.io.IOException
-
getSortedSetDocValues
public org.apache.lucene.index.SortedSetDocValues getSortedSetDocValues(java.lang.String field) throws java.io.IOException- Overrides:
getSortedSetDocValuesin classorg.apache.lucene.index.FilterLeafReader- Throws:
java.io.IOException
-
getNormValues
public org.apache.lucene.index.NumericDocValues getNormValues(java.lang.String field) throws java.io.IOException- Overrides:
getNormValuesin classorg.apache.lucene.index.FilterLeafReader- Throws:
java.io.IOException
-
getCoreCacheHelper
public org.apache.lucene.index.IndexReader.CacheHelper getCoreCacheHelper()- Specified by:
getCoreCacheHelperin classorg.apache.lucene.index.LeafReader
-
getReaderCacheHelper
public org.apache.lucene.index.IndexReader.CacheHelper getReaderCacheHelper()- Specified by:
getReaderCacheHelperin classorg.apache.lucene.index.IndexReader
-