dsmiley commented on code in PR #1374: URL: https://github.com/apache/solr/pull/1374#discussion_r1285847169
########## solr/test-framework/src/java/org/apache/solr/util/SolrJettyTestRule.java: ########## @@ -0,0 +1,122 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.solr.util; + +import static org.apache.lucene.tests.util.LuceneTestCase.createTempDir; +import static org.apache.solr.SolrTestCaseJ4.DEFAULT_TEST_CORENAME; +import static org.apache.solr.SolrTestCaseJ4.initCore; +import static org.apache.solr.SolrTestCaseJ4.writeCoreProperties; + +import java.io.IOException; +import java.lang.invoke.MethodHandles; +import java.nio.file.Path; +import java.util.Properties; +import org.apache.solr.SolrTestCaseJ4; +import org.apache.solr.client.solrj.SolrClient; +import org.apache.solr.embedded.JettyConfig; +import org.apache.solr.embedded.JettySolrRunner; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class SolrJettyTestRule extends SolrClientTestRule { Review Comment: I'd say that in general you should test with the most basic Solr possible based on what you are testing. If you can use EmbeddedSolrServerTestRule then do that. But if you need to test something relating to HTTP or Jetty then you're going to have to use this. Likewise, this isn't good enough for SolrCloud. As a subclass of SolrClientTestRule, the hope is that it be familiar enough so that how to use it is self-explanatory provided you're familiar with the other SolrClientTestRule's (there is just one other right now). If this is embraced everywhere that it should, fewer tests need to even be aware of JettySolrRunner. And maybe SolrJettyTestBase won't exist. I'm maybe not directly answering your question but I'm hoping it's more self evident as it's used more and more. Initially, mostly it's just SolrJettyTestBase. Maybe more of SJTB should be folded into this rule. -- 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]
