From a private mail with Robert Muir:
yes, all of what you mentioned are problems, and testing for
attributes that should be there is good in my opinion too.
I noticed the shingle problem as well, it was strange to test
termAtt.toString() and expect position increments or types to appear
one reason I asked about this, is at some point it would be nice to
try to factor test cases in lucene contrib. currently, they all have
same helper methods such as assertAnalyzesTo and this is silly in my
On Sun, Aug 23, 2009 at 12:57 PM, Uwe Schindler<firstname.lastname@example.org> wrote:
> There are more problems. The test with getAttribute is good, if you are
> really sure, if the attribute is really available and want assert this. In
> all other cases addAttribute should be used to consume a TokenStream. The
> changed ones were problematic, because they used foreign TokenStreams, do
> not for sure have all these attributes.
> I thought, all tests in contrib use LuceneTestCase as superclass, but they
> use the standard junit class. Because of that I did not notice when I put
> setOnlyUseNewAPI(true) into LuceneTestCase.setUp(), that they are run with
> the default false setting.
> Other problems in these tests are, that some (shingle tests) use
> TermAttribute.toString() which looks different if the attribute is
> implemented by TermAttributeImpl (newAPI=true) or Token (newAPI=false).