Is there any good document about Lucene Test Framework? I can only find API docs. Mimicking the unit test I've found in Lucene trunk, I tried to write a unit test that tests a TokenFilter I am writing. But it is failing with an error message like: java.lang.AssertionError: close() called in wrong state: SETREADER at __randomizedtesting.SeedInfo.seed([2899FF2F02A64CCB:47B7F94117CE7067]:0) at org.apache.lucene.analysis.MockTokenizer.close(MockTokenizer.java:261) at org.apache.lucene.analysis.TokenFilter.close(TokenFilter.java:58)
During a few round of try and error, I got an error message that the Test Framework JAR has to be before Lucene Core. And the above stack trace indicates that the Test Framework has its own Analyzer implementation, and it has a certain assumption but it is not clear what the assumption is. This exception was thrown from one of these lines, I believe: TokenStream ts = deuAna.tokenStream("text", new StringReader(testText)); TokenStreamToDot tstd = new TokenStreamToDot(testText, ts, new PrintWriter(System.out)); ts.close(); (I'm not too sure what TokenStreamToDot is about. I was hoping it would dump a token stream.) Kuro