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:
Yonik Seeley 2012-03-30 01:08:11 +00:00
parent 2d1bd256bd
commit 95f80348f6
1 changed files with 4 additions and 4 deletions

View File

@ -472,14 +472,14 @@ abstract public class SolrExampleTests extends SolrJettyTestBase
SolrQuery query = new SolrQuery(); SolrQuery query = new SolrQuery();
query.set(CommonParams.QT, "/analysis/field"); query.set(CommonParams.QT, "/analysis/field");
query.set(AnalysisParams.FIELD_TYPE, "int"); query.set(AnalysisParams.FIELD_TYPE, "int");
query.set(AnalysisParams.FIELD_VALUE, "hello"); query.set(AnalysisParams.FIELD_VALUE, "ignore_exception");
try { try {
server.query( query ); server.query( query );
Assert.fail("should have a number format exception"); Assert.fail("should have a number format exception");
} }
catch(SolrException ex) { catch(SolrException ex) {
assertEquals(400, ex.code()); 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) { catch(Throwable t) {
t.printStackTrace(); t.printStackTrace();
@ -487,12 +487,12 @@ abstract public class SolrExampleTests extends SolrJettyTestBase
} }
try { try {
server.deleteByQuery( "??::??" ); // query syntax error server.deleteByQuery( "??::?? ignore_exception" ); // query syntax error
Assert.fail("should have a number format exception"); Assert.fail("should have a number format exception");
} }
catch(SolrException ex) { catch(SolrException ex) {
assertEquals(400, ex.code()); 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) { catch(Throwable t) {
t.printStackTrace(); t.printStackTrace();