SOLR-4952: solrconfig.snippet.randomindexconfig.xml used in more configs, including eliminating TestPluginEnable and folding it into TestConfig

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1513691 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Chris M. Hostetter 2013-08-13 23:20:31 +00:00
parent 07b5204a77
commit 6edd62d433
6 changed files with 27 additions and 109 deletions

View File

@ -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>

View File

@ -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>

View File

@ -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 test
clean errors when people attempt atomic updates w/o it

View File

@ -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>

View File

@ -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"));
}
}

View File

@ -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"));
}
@Test
public void testJavaProperty() {