You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ab...@apache.org on 2019/01/03 14:00:59 UTC

lucene-solr:master: SOLR-12514: Properly close a SolrClient to fix the test teardown.

Repository: lucene-solr
Updated Branches:
  refs/heads/master dbcb24506 -> 0a7a478c1


SOLR-12514: Properly close a SolrClient to fix the test teardown.


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/0a7a478c
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/0a7a478c
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/0a7a478c

Branch: refs/heads/master
Commit: 0a7a478c1fd8ea55c35d7c1ea05890f264da5317
Parents: dbcb245
Author: Andrzej Bialecki <ab...@apache.org>
Authored: Thu Jan 3 14:59:31 2019 +0100
Committer: Andrzej Bialecki <ab...@apache.org>
Committed: Thu Jan 3 14:59:31 2019 +0100

----------------------------------------------------------------------
 .../test/org/apache/solr/security/BasicAuthIntegrationTest.java | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/0a7a478c/solr/core/src/test/org/apache/solr/security/BasicAuthIntegrationTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/security/BasicAuthIntegrationTest.java b/solr/core/src/test/org/apache/solr/security/BasicAuthIntegrationTest.java
index 3f3618d..61d56da 100644
--- a/solr/core/src/test/org/apache/solr/security/BasicAuthIntegrationTest.java
+++ b/solr/core/src/test/org/apache/solr/security/BasicAuthIntegrationTest.java
@@ -44,6 +44,7 @@ import org.apache.http.entity.ByteArrayEntity;
 import org.apache.http.message.AbstractHttpMessage;
 import org.apache.http.message.BasicHeader;
 import org.apache.http.util.EntityUtils;
+import org.apache.solr.client.solrj.SolrClient;
 import org.apache.solr.client.solrj.SolrRequest;
 import org.apache.solr.client.solrj.SolrServerException;
 import org.apache.solr.client.solrj.embedded.JettySolrRunner;
@@ -242,13 +243,15 @@ public class BasicAuthIntegrationTest extends SolrCloudAuthTestCase {
       //Test for SOLR-12514. Create a new jetty . This jetty does not have the collection.
       //Make a request to that jetty and it should fail
       JettySolrRunner aNewJetty = cluster.startJettySolrRunner();
+      SolrClient aNewClient = aNewJetty.newClient();
       try {
         del = new UpdateRequest().deleteByQuery("*:*");
-        del.process(aNewJetty.newClient(), COLLECTION);
+        del.process(aNewClient, COLLECTION);
         fail("This should not have succeeded without credentials");
       } catch (HttpSolrClient.RemoteSolrException e) {
         assertTrue(e.getMessage().contains("Unauthorized request"));
       } finally {
+        aNewClient.close();
         cluster.stopJettySolrRunner(aNewJetty);
       }