nick-boss-tech commented on code in PR #5015: URL: https://github.com/apache/solr/pull/5015#discussion_r4179900764
########## solr/core/src/test/org/apache/solr/core/TestConfigHighlightOutput.java: ########## @@ -0,0 +1,74 @@ +/* + * 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.core; + +import java.util.List; +import java.util.Map; +import org.apache.solr.SolrTestCase; +import org.apache.solr.SolrTestCaseJ4; +import org.apache.solr.common.util.Utils; +import org.apache.solr.util.EmbeddedSolrServerTestRule; +import org.junit.BeforeClass; +import org.junit.ClassRule; +import org.junit.Test; + +/** Tests that the serialized config, as returned by the Config API, includes the highlighter. */ +public class TestConfigHighlightOutput extends SolrTestCase { + + @ClassRule + public static final EmbeddedSolrServerTestRule solrTestRule = new EmbeddedSolrServerTestRule(); + + @BeforeClass + public static void beforeClass() throws Exception { + solrTestRule.startSolr(SolrTestCaseJ4.TEST_HOME()); + // Sets the randomized solr.tests.* properties the collection1 solrconfig.xml requires. + SolrTestCaseJ4.newRandomConfig(); + solrTestRule + .newCollection() + .withConfigSet(SolrTestCaseJ4.TEST_COLL1_CONF()) + .withSchemaFile("schema.xml") Review Comment: 🤖 *AI text below* 🤖 *(posted on behalf of Nick Shanin)* Fair point. The withSchemaFile line just restated the default (schema.xml is already the default schema name), so it is gone, and the test no longer boots a server or a core at all: it builds the SolrConfig directly from the collection1 solrconfig, the pattern TestConfig uses, and asserts on the same serialized output, since it never indexed or queried anything. Pushed in c96d7eee3b7. -- 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]
