Package org.apache.lucene.tests.analysis
Class MockReaderWrapper
java.lang.Object
java.io.Reader
org.apache.lucene.tests.analysis.MockReaderWrapper
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Readable
Wraps a Reader, and can throw random or fixed exceptions, and spoon feed read chars.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
static boolean
boolean
int
read
(char[] cbuf, int off, int len) boolean
ready()
void
throwExcAfterChar
(int charUpto) Throw an exception after reading this many chars.void
Methods inherited from class java.io.Reader
mark, nullReader, read, read, read, reset, skip, transferTo
-
Constructor Details
-
MockReaderWrapper
-
-
Method Details
-
throwExcAfterChar
public void throwExcAfterChar(int charUpto) Throw an exception after reading this many chars. -
throwExcNext
public void throwExcNext() -
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in classReader
- Throws:
IOException
-
read
- Specified by:
read
in classReader
- Throws:
IOException
-
markSupported
public boolean markSupported()- Overrides:
markSupported
in classReader
-
ready
public boolean ready() -
isMyEvilException
-