mirror of https://github.com/apache/lucene.git
fix hangs/fails in test for certain name service configs
git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@816264 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
1eb4697977
commit
c968a41ef6
|
@ -38,14 +38,17 @@ public class SolrExceptionTest extends TestCase {
|
|||
// if the compiler won't let you by without the try/catch
|
||||
boolean gotExpectedError = false;
|
||||
try {
|
||||
SolrServer client = new CommonsHttpSolrServer("http://333.333.333.333:8080/solr/");
|
||||
// switched to a local address to avoid going out on the net, ns lookup issues, etc.
|
||||
SolrServer client = new CommonsHttpSolrServer("http://localhost:11235/solr/");
|
||||
SolrQuery query = new SolrQuery("test123");
|
||||
client.query(query);
|
||||
} catch (SolrServerException sse) {
|
||||
gotExpectedError = true;
|
||||
/***
|
||||
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