mirror of https://github.com/apache/lucene.git
tests: ignore expected exceptions
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1307194 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
2d1bd256bd
commit
95f80348f6
|
@ -472,14 +472,14 @@ abstract public class SolrExampleTests extends SolrJettyTestBase
|
|||
SolrQuery query = new SolrQuery();
|
||||
query.set(CommonParams.QT, "/analysis/field");
|
||||
query.set(AnalysisParams.FIELD_TYPE, "int");
|
||||
query.set(AnalysisParams.FIELD_VALUE, "hello");
|
||||
query.set(AnalysisParams.FIELD_VALUE, "ignore_exception");
|
||||
try {
|
||||
server.query( query );
|
||||
Assert.fail("should have a number format exception");
|
||||
}
|
||||
catch(SolrException ex) {
|
||||
assertEquals(400, ex.code());
|
||||
assertEquals("Invalid Number: hello", ex.getMessage()); // The reason should get passed through
|
||||
assertEquals("Invalid Number: ignore_exception", ex.getMessage()); // The reason should get passed through
|
||||
}
|
||||
catch(Throwable t) {
|
||||
t.printStackTrace();
|
||||
|
@ -487,12 +487,12 @@ abstract public class SolrExampleTests extends SolrJettyTestBase
|
|||
}
|
||||
|
||||
try {
|
||||
server.deleteByQuery( "??::??" ); // query syntax error
|
||||
server.deleteByQuery( "??::?? ignore_exception" ); // query syntax error
|
||||
Assert.fail("should have a number format exception");
|
||||
}
|
||||
catch(SolrException ex) {
|
||||
assertEquals(400, ex.code());
|
||||
assertTrue(ex.getMessage().indexOf("??::??")>0); // The reason should get passed through
|
||||
assertTrue(ex.getMessage().indexOf("??::?? ignore_exception")>0); // The reason should get passed through
|
||||
}
|
||||
catch(Throwable t) {
|
||||
t.printStackTrace();
|
||||
|
|
Loading…
Reference in New Issue