You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by an...@apache.org on 2015/07/30 21:29:21 UTC

svn commit: r1693483 - in /lucene/dev/trunk/solr: solrj/src/java/org/apache/solr/client/solrj/impl/HttpClientUtil.java test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java

Author: anshum
Date: Thu Jul 30 19:29:20 2015
New Revision: 1693483

URL: http://svn.apache.org/r1693483
Log:
SOLR-6625: Set HttpClientImpl in SolrTestCaseJ4 for tests

Modified:
    lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/client/solrj/impl/HttpClientUtil.java
    lucene/dev/trunk/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java

Modified: lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/client/solrj/impl/HttpClientUtil.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/client/solrj/impl/HttpClientUtil.java?rev=1693483&r1=1693482&r2=1693483&view=diff
==============================================================================
--- lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/client/solrj/impl/HttpClientUtil.java (original)
+++ lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/client/solrj/impl/HttpClientUtil.java Thu Jul 30 19:29:20 2015
@@ -395,10 +395,10 @@ public class HttpClientUtil {
     }
 
     public static DefaultHttpClient createHttpClient(ClientConnectionManager cm) {
-      Constructor<? extends DefaultHttpClient> productConstructor;
+      Constructor<? extends DefaultHttpClient> constructor;
       try {
-        productConstructor = defaultHttpClientClass.getDeclaredConstructor(new Class[]{ClientConnectionManager.class});
-        return productConstructor.newInstance(new Object[]{cm});
+        constructor = defaultHttpClientClass.getDeclaredConstructor(new Class[]{ClientConnectionManager.class});
+        return constructor.newInstance(new Object[]{cm});
       } catch (NoSuchMethodException | SecurityException | InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
         throw new SolrException(ErrorCode.SERVER_ERROR, "Unable to create HttpClient instance, registered class is: " + defaultHttpClientClass, e);
       }

Modified: lucene/dev/trunk/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java?rev=1693483&r1=1693482&r2=1693483&view=diff
==============================================================================
--- lucene/dev/trunk/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java (original)
+++ lucene/dev/trunk/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java Thu Jul 30 19:29:20 2015
@@ -100,6 +100,7 @@ import org.apache.solr.util.AbstractSolr
 import org.apache.solr.util.DateFormatUtil;
 import org.apache.solr.util.RevertDefaultThreadHandlerRule;
 import org.apache.solr.util.SSLTestConfig;
+import org.apache.solr.util.SolrHttpClient;
 import org.apache.solr.util.TestHarness;
 import org.apache.zookeeper.KeeperException;
 import org.junit.AfterClass;
@@ -140,6 +141,10 @@ public abstract class SolrTestCaseJ4 ext
 
   public static int DEFAULT_CONNECTION_TIMEOUT = 60000;  // default socket connection timeout in ms
 
+  static {
+    HttpClientUtil.HttpClientFactory.setHttpClientImpl(SolrHttpClient.SolrDefaultHttpClient.class, SolrHttpClient.SolrSystemDefaultHttpClient.class);
+  }
+
   protected void writeCoreProperties(Path coreDirectory, String corename) throws IOException {
     Properties props = new Properties();
     props.setProperty("name", corename);