Hello Ahmet, 
Unfortunately the test still fails with the same error: "end() called before 
incrementToken() returned false!". I am not sure if I am misusing 
CachingTokenFilter, or if it cannot be used with MockTokenizer, since it 
"always calls end() before incrementToken() returns false".
Spyros




     On Monday, March 23, 2015 9:12 PM, Ahmet Arslan 
<iori...@yahoo.com.INVALID> wrote:
   

 Hi Spyros,

Not 100% sure but I think you should override reset method.

@Override
public void reset() throws IOException {
super.reset();

cachedInput = null;
}

Ahmet


On Monday, March 23, 2015 1:29 PM, Spyros Kapnissis <ska...@yahoo.com.INVALID> 
wrote:
Hello, 
We have a couple of custom token filters that use CachingTokenFilter 
internally. However, when we try to test them with MockTokenizer so that we can 
have these nice TokenStream API checks that it provides, the tests fail with: 
"java.lang.AssertionError: end() called before incrementToken() returned false!"

Here is a link with a unit test to reproduce the issue: 
https://gist.github.com/spyk/c783c72689410070811b
Do we misuse CachingTokenFilter? Or is it an issue of MockTonenizer when used 
with CachingTokenFilter?
Thanks!Spyros

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org
For additional commands, e-mail: java-user-h...@lucene.apache.org



  

Reply via email to