epugh commented on code in PR #3947:
URL: https://github.com/apache/solr/pull/3947#discussion_r2649822738
##########
solr/solrj/src/test/org/apache/solr/client/solrj/SolrExampleTestsBase.java:
##########
@@ -49,24 +56,37 @@ public void after() {
}
}
client = null;
+ super.tearDown();
}
- @Override
- public SolrClient getSolrClient() {
+ protected SolrClient getSolrClient() {
if (client == null) {
client = createNewSolrClient();
}
return client;
}
/**
- * Create a new solr client. If createJetty was called, a http
implementation will be created,
+ * Create a new solr client. If createJetty was called, an http
implementation will be created,
* otherwise an embedded implementation will be created. Subclasses should
override for other
* options.
*/
- @Override
public SolrClient createNewSolrClient() {
- return getHttpSolrClient(getBaseUrl(), DEFAULT_TEST_CORENAME);
+ return SolrTestCaseJ4.getHttpSolrClient(solrJettyTestRule.getBaseUrl(),
DEFAULT_TEST_CORENAME);
+ }
+
+ protected static String getCoreUrl() {
+ return solrJettyTestRule.getBaseUrl() + "/" + DEFAULT_TEST_CORENAME;
+ }
+
+ protected static String getBaseUrl() {
+ return solrJettyTestRule.getBaseUrl();
+ }
+
+ // Backward compatibility methods for existing subclasses
+ @Deprecated
+ protected static void createAndStartJetty(Path solrHome) throws Exception {
+ solrJettyTestRule.startSolr(solrHome, new Properties(),
JettyConfig.builder().build());
}
Review Comment:
This is the one that I am still mulling on if it's worth doing!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]