mirror of
https://github.com/apache/lucene.git
synced 2025-03-06 16:29:30 +00:00
Remove test dependency on Java default exception message (#12724)
This commit is contained in:
parent
c3f48587fd
commit
f5776c8844
@ -157,19 +157,9 @@ public class TestCoreParser extends LuceneTestCase {
|
||||
}
|
||||
|
||||
public void testSpanNearQueryWithoutSlopXML() throws Exception {
|
||||
Exception expectedException = new NumberFormatException("For input string: \"\"");
|
||||
try {
|
||||
Query q = parse("SpanNearQueryWithoutSlop.xml");
|
||||
fail("got query " + q + " instead of expected exception " + expectedException);
|
||||
} catch (Exception e) {
|
||||
assertEquals(expectedException.toString(), e.toString());
|
||||
}
|
||||
try {
|
||||
SpanQuery sq = parseAsSpan("SpanNearQueryWithoutSlop.xml");
|
||||
fail("got span query " + sq + " instead of expected exception " + expectedException);
|
||||
} catch (Exception e) {
|
||||
assertEquals(expectedException.toString(), e.toString());
|
||||
}
|
||||
// expected NumberFormatException from empty "slop" string
|
||||
assertThrows(NumberFormatException.class, () -> parse("SpanNearQueryWithoutSlop.xml"));
|
||||
assertThrows(NumberFormatException.class, () -> parseAsSpan("SpanNearQueryWithoutSlop.xml"));
|
||||
}
|
||||
|
||||
public void testConstantScoreQueryXML() throws Exception {
|
||||
|
Loading…
x
Reference in New Issue
Block a user