This is an automated email from the ASF dual-hosted git repository.

janhoy pushed a commit to branch branch_9_2
in repository https://gitbox.apache.org/repos/asf/solr.git


The following commit(s) were added to refs/heads/branch_9_2 by this push:
     new c118a9b028c SOLR-16649 Http2SolrClient.processErrorsAndResponse uses 
wrong instance of ResponseParser (#1526) Signed-off-by: Jan Høydahl 
<[email protected]>
c118a9b028c is described below

commit c118a9b028cc96521f1da110f21e935f134f6683
Author: Jan Høydahl <[email protected]>
AuthorDate: Sun Apr 2 01:15:12 2023 +0200

    SOLR-16649 Http2SolrClient.processErrorsAndResponse uses wrong instance of 
ResponseParser (#1526)
    Signed-off-by: Jan Høydahl <[email protected]>
    
    Signed-off-by: Jan Høydahl <[email protected]>
---
 solr/CHANGES.txt                                   |  2 ++
 .../solr/client/solrj/impl/Http2SolrClient.java    |  2 +-
 .../client/solrj/impl/Http2SolrClientTest.java     | 23 +++++++++++++++++++---
 3 files changed, 23 insertions(+), 4 deletions(-)

diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 770448533ec..a78836e6b25 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -17,6 +17,8 @@ Bug Fixes
 
 * SOLR-16734: SOLR_DATA_HOME is only honored in verbode mode (Kevin Risden)
 
+* SOLR-16649: Http2SolrClient.processErrorsAndResponse uses wrong instance of 
ResponseParser (Andrzej Białecki)
+
 Other Changes
 ---------------------
 * SOLR-16735: Allow custom configuration of Jetty's SecureRequestCustomizer 
(Tomás Fernández Löbbe)
diff --git 
a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/Http2SolrClient.java 
b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/Http2SolrClient.java
index 8e463c3c7bc..0847f04164f 100644
--- a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/Http2SolrClient.java
+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/Http2SolrClient.java
@@ -807,7 +807,7 @@ public class Http2SolrClient extends SolrClient {
           }
       }
 
-      if (wantStream(parser)) {
+      if (wantStream(processor)) {
         // no processor specified, return raw stream
         NamedList<Object> rsp = new NamedList<>();
         rsp.add("stream", is);
diff --git 
a/solr/solrj/src/test/org/apache/solr/client/solrj/impl/Http2SolrClientTest.java
 
b/solr/solrj/src/test/org/apache/solr/client/solrj/impl/Http2SolrClientTest.java
index 733650aca56..2252e11b412 100644
--- 
a/solr/solrj/src/test/org/apache/solr/client/solrj/impl/Http2SolrClientTest.java
+++ 
b/solr/solrj/src/test/org/apache/solr/client/solrj/impl/Http2SolrClientTest.java
@@ -39,9 +39,11 @@ import org.apache.solr.SolrJettyTestBase;
 import org.apache.solr.client.solrj.SolrQuery;
 import org.apache.solr.client.solrj.SolrRequest;
 import org.apache.solr.client.solrj.SolrServerException;
+import org.apache.solr.client.solrj.request.GenericSolrRequest;
 import org.apache.solr.client.solrj.request.QueryRequest;
 import org.apache.solr.client.solrj.request.RequestWriter;
 import org.apache.solr.client.solrj.request.UpdateRequest;
+import org.apache.solr.client.solrj.response.SimpleSolrResponse;
 import org.apache.solr.common.SolrException;
 import org.apache.solr.common.SolrInputDocument;
 import org.apache.solr.common.params.CommonParams;
@@ -904,7 +906,22 @@ public class Http2SolrClientTest extends SolrJettyTestBase 
{
     }
   }
 
-  /**
-   * Missed tests : - set cookies via interceptor - invariant params - 
compression - get raw stream
-   */
+  @Test
+  public void testGetRawStream() throws Exception {
+    DebugServlet.clear();
+    try (Http2SolrClient client =
+        getHttp2SolrClientBuilder(
+                jetty.getBaseUrl().toString() + "/debug/foo",
+                DEFAULT_CONNECTION_TIMEOUT,
+                DEFAULT_CONNECTION_TIMEOUT)
+            .build()) {
+      GenericSolrRequest req =
+          new GenericSolrRequest(SolrRequest.METHOD.GET, "/select", 
params("q", "*:*"));
+      req.setResponseParser(new InputStreamResponseParser("xml"));
+      SimpleSolrResponse rsp = req.process(client);
+      assertNotNull(rsp.getResponse().get("stream"));
+    }
+  }
+
+  /** Missed tests : - set cookies via interceptor - invariant params - 
compression */
 }

Reply via email to