mirror of https://github.com/apache/lucene.git
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:
parent
77fc7f22fd
commit
e162b63759
|
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue