mirror of https://github.com/apache/lucene.git
SOLR-1730: check the cause exception
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1213704 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
4da73b1f9e
commit
7c0069cbb7
|
@ -33,9 +33,14 @@ public class BadComponentTest extends SolrTestCaseJ4{
|
|||
System.setProperty("elevate.file", "foo.xml");
|
||||
initCore("solrconfig-elevate.xml", "schema12.xml");
|
||||
assertTrue(false);
|
||||
} catch (Throwable e) {
|
||||
log.error("Exception", e);
|
||||
assertTrue(true);
|
||||
} catch (RuntimeException e) {
|
||||
//TODO: better way of checking this?
|
||||
if (e.getCause() instanceof SolrException && e.getCause().getCause().getMessage().equals("Error initializing QueryElevationComponent.")){
|
||||
log.error("Exception", e);
|
||||
assertTrue(true);
|
||||
} else {
|
||||
assertTrue(false);
|
||||
}
|
||||
} finally {
|
||||
System.clearProperty("elevate.file");
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue