You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@solr.apache.org by "Joshua Ouma (Jira)" <ji...@apache.org> on 2022/10/29 06:01:00 UTC

[jira] [Comment Edited] (SOLR-16498) Tests need the URL from a SolrClient; don't require legacy clients

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

Joshua Ouma edited comment on SOLR-16498 at 10/29/22 6:00 AM:
--------------------------------------------------------------

With an example of the following test case I'm still not sure what is expected of getUrlFrom(SolrClient) after performing the instanceOf check. Should it cast the HttpSolrClient to jdk HttpClient and return the result or should it return the clients base url concatenated with the provided string
{code:java}
  public void testStreamUrl() throws Exception {
    HttpSolrClient client = (HttpSolrClient) getSolrClient();
    String streamUrl = client.getBaseURL() + "/select?q=*:*&fl=id&wt=csv";

    String getUrl =
        client.getBaseURL()
            + "/debug/dump?wt=xml&stream.url="
            + URLEncoder.encode(streamUrl, "UTF-8");
    String content = getUrlForString(getUrl);
    assertTrue(content.contains("1234"));
    // System.out.println(content);
  }
{code}


was (Author: JIRAUSER296285):
With an example of the following test case I'm still not sure what is expected of getUrlFrom(SolrClient). Should it cast the HttpSolrClient to jdk HttpClient and return the result or should it return the clients base url concatenated with the provided string
{code:java}
  public void testStreamUrl() throws Exception {
    HttpSolrClient client = (HttpSolrClient) getSolrClient();
    String streamUrl = client.getBaseURL() + "/select?q=*:*&fl=id&wt=csv";

    String getUrl =
        client.getBaseURL()
            + "/debug/dump?wt=xml&stream.url="
            + URLEncoder.encode(streamUrl, "UTF-8");
    String content = getUrlForString(getUrl);
    assertTrue(content.contains("1234"));
    // System.out.println(content);
  }
{code}

> 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
>
> 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: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org