use of org.apache.jackrabbit.core.query.lucene.LazyTextExtractorField.ParsingTask in project jackrabbit by apache.
the class LazyTextExtractorFieldTest method testEmptyParser.
/**
* @see <a
* href="https://issues.apache.org/jira/browse/JCR-3296">JCR-3296</a>
* Indexing ignored file types creates some garbage
*/
public void testEmptyParser() throws Exception {
InternalValue val = InternalValue.create(new RandomInputStream(1, 1024));
Metadata metadata = new Metadata();
metadata.set(Metadata.CONTENT_TYPE, "application/java-archive");
metadata.set(Metadata.CONTENT_ENCODING, "UTF-8");
Parser p = getSearchIndex().getParser();
ParsingTask task = new ParsingTask(p, val, metadata, Integer.MAX_VALUE) {
public void setExtractedText(String value) {
assertEquals("", value);
}
};
task.run();
}
Aggregations