[ 
https://issues.apache.org/jira/browse/SOLR-16498?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17626726#comment-17626726
 ] 

Chris M. Hostetter commented on SOLR-16498:
-------------------------------------------

Maybe i'm missing something, but this feels like a false premise...
{quote}We would prefer a non-dependency approach using [Java 11's new 
HttpClient|https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/package-summary.html].
 And we need to figure out how to get the URL *_from the SolrClient_* in a more 
general way.
{quote}
If we're only concerned here with tests, then why does the URL need to come 
_from the SolrClient_ ?  If there is a SolrClient pointed at a URL in a test, 
then that URL is coming from a (test) Jetty instance, so why can't we just ask 
that jetty instance for it's URL directly?

Skimming the PR, i only see 2 tests being updated (are there others where this 
issue is relevant?) and in both cases it seems straightforward to refactor the 
tests so that instead of passing around a {{SolrClient}} just for the purposes 
of getting a URL out of it, the test code could pass around the 
{{JettySolrRunner}} to ask it for it's URL (or just pass around the URL)...
 * {{TestRemoteStreaming}}
 ** instead of calling getSolrUrl({{{}getSolrClient(){}}}) just use 
{{jetty.getBaseUrl()}}
 ** ({{{}jetty{}}} is a static variable in the super class)
 * {{TestReplicationHandler}}
 ** refactor the private method {{adminClient(...)}} (and the two other private 
methods that call it propogating their own args: {{reloadCore(...)}} and 
{{watchCoreStartAt(...)}} ) so that instead of taking in a {{SolrClient}} 
argument, it takes in a {{JettySolrRunner}} arg for the same purpose
 ** every existing place that calls these methods with a {{SolrClient}} also 
has direct access to the corisponding  {{JettySolrRunner}} 

(or am i missunderstanding something fundamental about the goal here?)

> Tests need the URL from a SolrClient; don't require legacy clients
> ------------------------------------------------------------------
>
>                 Key: SOLR-16498
>                 URL: https://issues.apache.org/jira/browse/SOLR-16498
>             Project: Solr
>          Issue Type: Test
>      Security Level: Public(Default Security Level. Issues are Public) 
>          Components: Tests
>            Reporter: David Smiley
>            Priority: Major
>              Labels: newdev
>          Time Spent: 1h 10m
>  Remaining Estimate: 0h
>
> SOLR-16368 could not switch many tests away from some legacy/deprecated 
> SolrClient classes because they were either getting the URL or Apache 
> HttpClient instance out of the client.  This issue aims to solve this so that 
> our tests don't depend on a legacy client and don't depend on Apache 
> HttpClient either.  We would prefer a non-dependency approach using [Java 
> 11's new 
> HttpClient|https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/package-summary.html].
>   And we need to figure out how to get the URL from the SolrClient in a more 
> general way.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to