dsmiley commented on code in PR #2126:
URL: https://github.com/apache/solr/pull/2126#discussion_r1423212973


##########
solr/core/src/test/org/apache/solr/api/NodeConfigContainerPluginsSourceTest.java:
##########
@@ -0,0 +1,287 @@
+/*
+ * 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.api;
+
+import static org.apache.solr.client.solrj.SolrRequest.METHOD.GET;
+
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+import org.apache.solr.client.solrj.impl.BaseHttpSolrClient;
+import org.apache.solr.client.solrj.request.V2Request;
+import org.apache.solr.client.solrj.request.beans.PluginMeta;
+import org.apache.solr.client.solrj.response.V2Response;
+import org.apache.solr.cloud.ClusterSingleton;
+import org.apache.solr.cloud.MiniSolrCloudCluster;
+import org.apache.solr.cloud.SolrCloudTestCase;
+import org.apache.solr.common.MapWriter;
+import org.apache.solr.common.annotation.JsonProperty;
+import org.apache.solr.common.util.ReflectMapWriter;
+import org.apache.solr.core.CoreContainer;
+import org.apache.solr.request.SolrQueryRequest;
+import org.apache.solr.response.SolrQueryResponse;
+import org.apache.solr.security.PermissionNameProvider;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/** Tests that verify initialization of container plugins that are declared in 
solr.xml */
+public class NodeConfigContainerPluginsSourceTest extends SolrCloudTestCase {
+
+  private static final String NODE_CONFIG_PLUGINS_SOURCE_XML =
+      "<containerPluginsSource 
class=\"org.apache.solr.api.NodeConfigContainerPluginsSource\"/>";
+
+  @BeforeClass
+  public static void setupCluster() throws Exception {
+    configureCluster(1)
+        .withSolrXml(
+            MiniSolrCloudCluster.DEFAULT_CLOUD_SOLR_XML.replace(
+                "</solr>",
+                NODE_CONFIG_PLUGINS_SOURCE_XML + SingletonNoConfig.xmlConfig() 
+ "</solr>"))
+        .addConfig(
+            "conf", 
TEST_PATH().resolve("configsets").resolve("cloud-minimal").resolve("conf"))
+        .configure();
+  }
+
+  /** Verifies that a cluster singleton config declared in solr.xml is loaded 
into the registry */
+  public void testOneClusterSingleton() {
+    CoreContainer cc = 
newCoreContainer(solrXml(SingletonNoConfig.xmlConfig()));

Review Comment:
   >  if NodeConfig is also a source, should the /cluster/plugin API be 
available in non-cloud mode?
   
   I would prefer it not.  Does that question impact the work here (harder / 
easier)?  I understand a "cluster singleton" implies SolrCloud, but namely a 
request handler does not.  I know that's out of scope of this PR.  Request 
handlers are one of the most popular plugin types to customize.



-- 
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: issues-unsubscr...@solr.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org
For additional commands, e-mail: issues-h...@solr.apache.org

Reply via email to