SOLR-10857: Solr loads UNLOADed core on request, cleaned up printStackTrace

This commit is contained in:
Erick Erickson 2017-06-12 09:40:34 -07:00
parent b2ea95c9ec
commit 5a737a3aab
1 changed files with 10 additions and 12 deletions

View File

@ -320,18 +320,16 @@ public class CoreAdminHandlerTest extends SolrTestCaseJ4 {
req.process(client);
}
try (HttpSolrClient client = getHttpSolrClient(runner.getBaseUrl() + "/corex")) {
client.setConnectionTimeout(SolrTestCaseJ4.DEFAULT_CONNECTION_TIMEOUT);
client.setSoTimeout(SolrTestCaseJ4.DEFAULT_CONNECTION_TIMEOUT*1000);
QueryResponse result = client.query(new SolrQuery("id:*"));
//assertEquals(1,result.getResults().getNumFound());
fail("expect 404");
}catch(Exception e){
e.printStackTrace();
}
finally{
runner.stop();
}
HttpSolrClient.RemoteSolrException rse = expectThrows(HttpSolrClient.RemoteSolrException.class, () -> {
try (HttpSolrClient client = getHttpSolrClient(runner.getBaseUrl() + "/corex")) {
client.setConnectionTimeout(SolrTestCaseJ4.DEFAULT_CONNECTION_TIMEOUT);
client.setSoTimeout(SolrTestCaseJ4.DEFAULT_CONNECTION_TIMEOUT * 1000);
client.query(new SolrQuery("id:*"));
} finally {
runner.stop();
}
});
assertTrue(rse.getMessage().contains("Can not find: /solr/corex/select"));
}
@Test