lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Spyros Kapnissis <>
Subject Re: CachingTokenFilter tests fail when using MockTokenizer
Date Mon, 23 Mar 2015 22:02:06 GMT
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".

     On Monday, March 23, 2015 9:12 PM, Ahmet Arslan <> wrote:

 Hi Spyros,

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

public void reset() throws IOException {

cachedInput = null;


On Monday, March 23, 2015 1:29 PM, Spyros Kapnissis <> wrote:
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:
Do we misuse CachingTokenFilter? Or is it an issue of MockTonenizer when used with CachingTokenFilter?

To unsubscribe, e-mail:
For additional commands, e-mail:

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message