You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ho...@apache.org on 2017/06/14 02:02:48 UTC
[12/35] lucene-solr:jira/SOLR-10834: SOLR-10857: Solr loads UNLOADed
core on request, cleaned up printStackTrace
SOLR-10857: Solr loads UNLOADed core on request, cleaned up printStackTrace
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/5a737a3a
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/5a737a3a
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/5a737a3a
Branch: refs/heads/jira/SOLR-10834
Commit: 5a737a3aab969b120a84dbc7cd7ed351796576b3
Parents: b2ea95c
Author: Erick Erickson <er...@apache.org>
Authored: Mon Jun 12 09:40:34 2017 -0700
Committer: Erick Erickson <er...@apache.org>
Committed: Mon Jun 12 09:40:34 2017 -0700
----------------------------------------------------------------------
.../handler/admin/CoreAdminHandlerTest.java | 22 +++++++++-----------
1 file changed, 10 insertions(+), 12 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/5a737a3a/solr/core/src/test/org/apache/solr/handler/admin/CoreAdminHandlerTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/handler/admin/CoreAdminHandlerTest.java b/solr/core/src/test/org/apache/solr/handler/admin/CoreAdminHandlerTest.java
index f1770f8..06c30e6 100644
--- a/solr/core/src/test/org/apache/solr/handler/admin/CoreAdminHandlerTest.java
+++ b/solr/core/src/test/org/apache/solr/handler/admin/CoreAdminHandlerTest.java
@@ -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