Skip to content

SOLR-18188: RestTestHarness overhaul, add URLUtil.buildURI#4270

Merged
dsmiley merged 4 commits intoapache:mainfrom
dsmiley:SOLR-18188-restTestHarness
Apr 12, 2026
Merged

SOLR-18188: RestTestHarness overhaul, add URLUtil.buildURI#4270
dsmiley merged 4 commits intoapache:mainfrom
dsmiley:SOLR-18188-restTestHarness

Conversation

@dsmiley
Copy link
Copy Markdown
Contributor

@dsmiley dsmiley commented Apr 7, 2026

Refactors RestTestHarness to be immutable and use Jetty HttpClient directly instead of Apache HttpClient. Introduces URLUtil.buildURI helper, used by RestTestHarness and a backup test.

I recommend starting viewing this from URLUtil, then test-framework, and then tests generally.

https://issues.apache.org/jira/browse/SOLR-18188

This was split off from #4266 so already got some review.

…til.buildURI

Refactors RestTestHarness to be immutable and use Jetty HttpClient directly
instead of Apache HttpClient. Introduces URLUtil.buildURI helper. Updates all
callers across test-framework, core, solrj, ltr, and language-models modules.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Creates a REST client useful for HTTP operations. It closes when this {@link JettySolrRunner}
* is stopped.
*/
public RestTestHarness getRestClient(String collection) {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I chose this name "getRestClient" as I think it's a better characterization of what RestTestHarness is.

* calling getJetty().stop()/start() directly.
*/
protected static void restartJetty() throws Exception {
getJetty().stop();
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wish I could prevent subclasses from reaching into Jetty to start/stop it, forcing them to use this method. Ah well.

@dsmiley
Copy link
Copy Markdown
Contributor Author

dsmiley commented Apr 10, 2026

I'll merge Sunday if I don't hear anything more.

dsmiley added 2 commits April 11, 2026 18:21
# Conflicts:
#	solr/test-framework/src/java/org/apache/solr/util/RestTestBase.java
@github-actions github-actions bot removed the dependencies Dependency upgrades label Apr 12, 2026
@dsmiley dsmiley merged commit 6f15595 into apache:main Apr 12, 2026
5 of 6 checks passed
@dsmiley dsmiley deleted the SOLR-18188-restTestHarness branch April 12, 2026 15:37
dsmiley added a commit that referenced this pull request Apr 18, 2026
Refactors RestTestHarness to be immutable and use Jetty HttpClient instead of Apache HttpClient. 
Introduces URLUtil.buildURI helper, used by RestTestHarness and a backup test.

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant