lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ahmet Arslan <iori...@yahoo.com.INVALID>
Subject Re: CachingTokenFilter tests fail when using MockTokenizer
Date Mon, 23 Mar 2015 19:10:57 GMT
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 <skapni@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-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message