throw IAE in OfflineSorter if incoming blob is too big

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1593541 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael McCandless 2014-05-09 14:00:54 +00:00
parent 77fc7f22fd
commit e162b63759
1 changed files with 14 additions and 0 deletions

View File

@ -1200,4 +1200,18 @@ public class AnalyzingSuggesterTest extends LuceneTestCase {
Collections.shuffle(asList, random());
return asList;
}
// TODO: we need BaseSuggesterTestCase?
public void testTooLongSuggestion() throws Exception {
Analyzer a = new MockAnalyzer(random());
AnalyzingSuggester suggester = new AnalyzingSuggester(a);
String bigString = TestUtil.randomSimpleString(random(), 30000, 30000);
try {
suggester.build(new InputArrayIterator(new Input[] {
new Input(bigString, 7)}));
fail("did not hit expected exception");
} catch (IllegalArgumentException iae) {
// expected
}
}
}