Apache Lucene open-source search software
SOLR-4952: solrconfig.snippet.randomindexconfig.xml used in more configs, including eliminating TestPluginEnable and folding it into TestConfig
Chris M. Hostetter6edd62d43340
diff --git a/solr/core/src/test-files/solr/collection1/conf/solrconfig-enableplugin.xml b/solr/core/src/test-files/solr/collection1/conf/solrconfig-enableplugin.xmldeleted file mode 100644index 2d563d6266a..00000000000--- a/solr/core/src/test-files/solr/collection1/conf/solrconfig-enableplugin.xml+++ /dev/null@@ -1,63 +0,0 @@-<?xml version="1.0" ?>--<!--- 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.--->--<config>- <luceneMatchVersion>${tests.luceneMatchVersion:LUCENE_CURRENT}</luceneMatchVersion>- <dataDir>${solr.data.dir:}</dataDir>-- <!-- The DirectoryFactory to use for indexes.- solr.StandardDirectoryFactory, the default, is filesystem based.- solr.RAMDirectoryFactory is memory based and not persistent. -->- <directoryFactory name="DirectoryFactory" class="${solr.directoryFactory:solr.RAMDirectoryFactory}"/>-- <indexConfig>- <lockType>single</lockType>- <useCompoundFile>${useCompoundFile:false}</useCompoundFile>- </indexConfig>-- <updateHandler class="solr.DirectUpdateHandler2">- </updateHandler>-- <requestHandler name="standard" class="solr.StandardRequestHandler">- <bool name="httpCaching">true</bool>- </requestHandler>-- <!-- test query parameter defaults -->- <requestHandler name="defaults" class="solr.StandardRequestHandler">-- </requestHandler>-- <requestHandler name="disabled" class="solr.StandardRequestHandler" enable="false"/>- <requestHandler name="enabled" class="solr.StandardRequestHandler" enable="true"/>-- <!-- test query parameter defaults -->- <requestHandler name="lazy" class="solr.StandardRequestHandler" startup="lazy">- </requestHandler>-- <requestHandler name="/update" class="solr.UpdateRequestHandler" />-- <!-- enable streaming for testing... -->- <requestDispatcher handleSelect="true">- <requestParsers enableRemoteStreaming="true" multipartUploadLimitInKB="2048"/>- <httpCaching lastModifiedFrom="openTime" etagSeed="Solr" never304="false">- <cacheControl>max-age=30, public</cacheControl>- </httpCaching>- </requestDispatcher>--</config>diff --git a/solr/core/src/test-files/solr/collection1/conf/solrconfig-test-misc.xml b/solr/core/src/test-files/solr/collection1/conf/solrconfig-test-misc.xmlindex 4af9f371c8c..07ae132fe07 100644--- a/solr/core/src/test-files/solr/collection1/conf/solrconfig-test-misc.xml+++ b/solr/core/src/test-files/solr/collection1/conf/solrconfig-test-misc.xml@@ -45,4 +45,10 @@<propTest attr1="${solr.test.sys.prop1}-$${literal}"attr2="${non.existent.sys.prop:default-from-config}">prefix-${solr.test.sys.prop2}-suffix</propTest>+ <!-- see TestConfig.testDisableRequetsHandler -->+ <requestHandler name="disabled" class="solr.StandardRequestHandler" enable="false"/>+ <requestHandler name="enabled" class="solr.StandardRequestHandler" enable="true"/>+++</config>diff --git a/solr/core/src/test-files/solr/collection1/conf/solrconfig-tlog.xml b/solr/core/src/test-files/solr/collection1/conf/solrconfig-tlog.xmlindex 2cacb5ae412..d55845c13d0 100644--- a/solr/core/src/test-files/solr/collection1/conf/solrconfig-tlog.xml+++ b/solr/core/src/test-files/solr/collection1/conf/solrconfig-tlog.xml@@ -32,10 +32,7 @@<dataDir>${solr.data.dir:}</dataDir>- <indexConfig>- <lockType>${solr.lock.type:native}</lockType>- <useCompoundFile>${useCompoundFile:false}</useCompoundFile>- </indexConfig>+ <xi:include href="solrconfig.snippet.randomindexconfig.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/><!-- an update processor the explicitly excludes distrib to testclean errors when people attempt atomic updates w/o itdiff --git a/solr/core/src/test-files/solr/collection1/conf/solrconfig-warmer.xml b/solr/core/src/test-files/solr/collection1/conf/solrconfig-warmer.xmlindex 69a0f8a990d..3f187f34d9d 100644--- a/solr/core/src/test-files/solr/collection1/conf/solrconfig-warmer.xml+++ b/solr/core/src/test-files/solr/collection1/conf/solrconfig-warmer.xml@@ -26,7 +26,21 @@<requestHandler name="standard" class="solr.StandardRequestHandler"></requestHandler><indexConfig>- <useCompoundFile>${useCompoundFile:false}</useCompoundFile>+ <!-- we don't use solrconfig.snippet.randomindexconfig.xml here+ because we explicitly test that a mergedSegmentWarmer works,+ but we can still test some of the other randomized indexConfig+ settings+ --><mergedSegmentWarmer class="org.apache.lucene.index.SimpleMergedSegmentWarmer"/>+ <mergePolicy class="org.apache.solr.util.RandomMergePolicy" />++ <useCompoundFile>${useCompoundFile}</useCompoundFile>+ <maxBufferedDocs>${solr.tests.maxBufferedDocs}</maxBufferedDocs>+ <maxIndexingThreads>${solr.tests.maxIndexingThreads}</maxIndexingThreads>+ <ramBufferSizeMB>${solr.tests.ramBufferSizeMB}</ramBufferSizeMB>+ <mergeScheduler class="${solr.tests.mergeScheduler}" />+ <writeLockTimeout>1000</writeLockTimeout>+ <commitLockTimeout>10000</commitLockTimeout>+ <lockType>single</lockType></indexConfig></config>diff --git a/solr/core/src/test/org/apache/solr/TestPluginEnable.java b/solr/core/src/test/org/apache/solr/TestPluginEnable.javadeleted file mode 100644index d2505c19220..00000000000--- a/solr/core/src/test/org/apache/solr/TestPluginEnable.java+++ /dev/null@@ -1,41 +0,0 @@-package org.apache.solr;--/*- * 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.- */--import org.apache.solr.client.solrj.SolrServerException;-import org.junit.BeforeClass;-import org.junit.Test;-/**- * <p> Test disabling components</p>- *- *- * @since solr 1.4- */-public class TestPluginEnable extends SolrTestCaseJ4 {- @BeforeClass- public static void beforeClass() throws Exception {- initCore("solrconfig-enableplugin.xml", "schema-replication1.xml");- }-- @Test- public void testSimple() throws SolrServerException {- assertNull(h.getCore().getRequestHandler("disabled"));- assertNotNull(h.getCore().getRequestHandler("enabled"));-- }-}diff --git a/solr/core/src/test/org/apache/solr/core/TestConfig.java b/solr/core/src/test/org/apache/solr/core/TestConfig.javaindex 8eace48b279..8f065f49b96 100644--- a/solr/core/src/test/org/apache/solr/core/TestConfig.java+++ b/solr/core/src/test/org/apache/solr/core/TestConfig.java@@ -70,6 +70,11 @@ public class TestConfig extends SolrTestCaseJ4 {assertNull("should not have been able to find " + f, data);}}+ @Test+ public void testDisableRequetsHandler() throws Exception {+ assertNull(h.getCore().getRequestHandler("disabled"));+ assertNotNull(h.getCore().getRequestHandler("enabled"));+ }@Testpublic void testJavaProperty() {