mirror of https://github.com/apache/lucene.git
SOLR-400: Handle OpenDNS failure
git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@648683 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
a2d155e447
commit
6b7518d4b4
|
@ -348,6 +348,8 @@ Bug Fixes
|
|||
|
||||
24. SOLR-533: Fixed tests so they don't use hardcoded port numbers.
|
||||
(hossman)
|
||||
|
||||
25. SOLR-400: SolrExceptionTest should now handle using OpenDNS as a DNS provider (gsingers)
|
||||
|
||||
Other Changes
|
||||
1. SOLR-135: Moved common classes to org.apache.solr.common and altered the
|
||||
|
|
|
@ -22,6 +22,8 @@ import java.net.UnknownHostException;
|
|||
import junit.framework.TestCase;
|
||||
|
||||
import org.apache.solr.client.solrj.impl.CommonsHttpSolrServer;
|
||||
import org.apache.solr.client.solrj.response.QueryResponse;
|
||||
import org.apache.solr.common.SolrException;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -41,7 +43,9 @@ public class SolrExceptionTest extends TestCase {
|
|||
client.query(query);
|
||||
} catch (SolrServerException sse) {
|
||||
gotExpectedError = true;
|
||||
assertTrue(UnknownHostException.class == sse.getRootCause().getClass());
|
||||
assertTrue(UnknownHostException.class == sse.getRootCause().getClass()
|
||||
//If one is using OpenDNS, then you don't get UnknownHostException, instead you get back that the query couldn't execute
|
||||
|| (sse.getRootCause().getClass() == SolrException.class && ((SolrException) sse.getRootCause()).code() == 302 && sse.getMessage().equals("Error executing query")));
|
||||
}
|
||||
assertTrue(gotExpectedError);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue