lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hoss...@apache.org
Subject [12/35] lucene-solr:jira/SOLR-10834: SOLR-10857: Solr loads UNLOADed core on request, cleaned up printStackTrace
Date Wed, 14 Jun 2017 02:02:48 GMT
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 <erick@apache.org>
Authored: Mon Jun 12 09:40:34 2017 -0700
Committer: Erick Erickson <erick@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


Mime
View raw message