Skip to content

Apache Lucene open-source search software

SOLR-4952: get all manged schema tests using solrconfig.snippet.randomindexconfig.xml - mainly by removing several solrconfig-*-managed-schema.xml files and using sys props in solrconfig-managed-schema.xml

Chris M. Hostetter960e49b28843
diff --git a/solr/core/src/test-files/solr/collection1/conf/solrconfig-managed-schema.xml b/solr/core/src/test-files/solr/collection1/conf/solrconfig-managed-schema.xml
index 383f858328a..fc49a7b1c8c 100644
--- a/solr/core/src/test-files/solr/collection1/conf/solrconfig-managed-schema.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/solrconfig-managed-schema.xml
@@ -23,8 +23,29 @@
<xi:include href="solrconfig.snippet.randomindexconfig.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
<schemaFactory class="ManagedIndexSchemaFactory">
- <bool name="mutable">false</bool>
+ <bool name="mutable">${managed.schema.mutable}</bool>
<str name="managedSchemaResourceName">managed-schema</str>
</schemaFactory>
+ <codecFactory class="solr.SchemaCodecFactory"/>
+
+ <updateHandler>
+ <updateLog enable="${enable.update.log}">
+ <str name="dir">${solr.ulog.dir:}</str>
+ </updateLog>
+ </updateHandler>
+
+ <requestHandler name="standard" class="solr.StandardRequestHandler">
+ <bool name="httpCaching">true</bool>
+ </requestHandler>
+
+ <requestHandler name="/get" class="solr.RealTimeGetHandler">
+ <lst name="defaults">
+ <str name="omitHeader">true</str>
+ </lst>
+ </requestHandler>
+ <requestHandler name="/admin/" class="org.apache.solr.handler.admin.AdminHandlers" />
+ <requestHandler name="/update" class="solr.UpdateRequestHandler"/>
+ <requestHandler name="/replication" class="solr.ReplicationHandler" startup="lazy" />
+
</config>
diff --git a/solr/core/src/test-files/solr/collection1/conf/solrconfig-mutable-managed-schema.xml b/solr/core/src/test-files/solr/collection1/conf/solrconfig-mutable-managed-schema.xml
deleted file mode 100644
index 21571e11bb5..00000000000
--- a/solr/core/src/test-files/solr/collection1/conf/solrconfig-mutable-managed-schema.xml
+++ /dev/null
@@ -1,43 +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>
-
- <xi:include href="solrconfig.snippet.randomindexconfig.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
-
- <schemaFactory class="ManagedIndexSchemaFactory">
- <bool name="mutable">true</bool>
- <str name="managedSchemaResourceName">managed-schema</str>
- </schemaFactory>
-
- <codecFactory class="solr.SchemaCodecFactory"/>
-
- <updateHandler class="solr.DirectUpdateHandler2">
- </updateHandler>
-
- <queryResponseWriter name="xml" default="true"
- class="solr.XMLResponseWriter" />
-
- <requestHandler name="standard" class="solr.StandardRequestHandler">
- <bool name="httpCaching">true</bool>
- </requestHandler>
-
- <requestHandler name="/update" class="solr.UpdateRequestHandler"/>
-
-</config>
diff --git a/solr/core/src/test-files/solr/collection1/conf/solrconfig-tlog-managed-schema.xml b/solr/core/src/test-files/solr/collection1/conf/solrconfig-tlog-managed-schema.xml
deleted file mode 100644
index 2ae9b356150..00000000000
--- a/solr/core/src/test-files/solr/collection1/conf/solrconfig-tlog-managed-schema.xml
+++ /dev/null
@@ -1,101 +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>
- <jmx />
-
- <luceneMatchVersion>${tests.luceneMatchVersion:LUCENE_CURRENT}</luceneMatchVersion>
-
- <schemaFactory class="ManagedIndexSchemaFactory">
- <bool name="mutable">false</bool>
- <str name="managedSchemaResourceName">managed-schema</str>
- </schemaFactory>
-
- <directoryFactory name="DirectoryFactory" class="${solr.directoryFactory:solr.RAMDirectoryFactory}">
- <!-- used to keep RAM reqs down for HdfsDirectoryFactory -->
- <int name="solr.hdfs.blockcache.blocksperbank">${solr.hdfs.blockcache.blocksperbank:1024}</int>
- </directoryFactory>
-
- <dataDir>${solr.data.dir:}</dataDir>
-
- <indexConfig>
- <lockType>${solr.lock.type:native}</lockType>
- <useCompoundFile>${useCompoundFile:false}</useCompoundFile>
- </indexConfig>
-
- <!-- an update processor the explicitly excludes distrib to test
- clean errors when people attempt atomic updates w/o it
- -->
- <updateRequestProcessorChain name="nodistrib" >
- <processor class="solr.NoOpDistributingUpdateProcessorFactory" />
- <processor class="solr.RunUpdateProcessorFactory" />
- </updateRequestProcessorChain>
-
- <requestHandler name="standard" class="solr.StandardRequestHandler">
- </requestHandler>
-
- <requestHandler name="/get" class="solr.RealTimeGetHandler">
- <lst name="defaults">
- <str name="omitHeader">true</str>
- </lst>
- </requestHandler>
-
- <requestHandler name="/replication" class="solr.ReplicationHandler" startup="lazy" />
-
- <requestHandler name="/update" class="solr.UpdateRequestHandler" />
-
- <updateHandler class="solr.DirectUpdateHandler2">
- <updateLog>
- <str name="dir">${solr.ulog.dir:}</str>
- </updateLog>
- </updateHandler>
-
- <requestHandler name="/admin/" class="org.apache.solr.handler.admin.AdminHandlers" />
-
- <updateRequestProcessorChain name="distrib-dup-test-chain-explicit">
- <!-- explicit test using processors before and after distrib -->
- <processor class="solr.RegexReplaceProcessorFactory">
- <str name="fieldName">regex_dup_A_s</str>
- <str name="pattern">x</str>
- <str name="replacement">x_x</str>
- </processor>
- <processor class="solr.DistributedUpdateProcessorFactory" />
- <processor class="solr.RegexReplaceProcessorFactory">
- <str name="fieldName">regex_dup_B_s</str>
- <str name="pattern">x</str>
- <str name="replacement">x_x</str>
- </processor>
- <processor class="solr.RunUpdateProcessorFactory" />
- </updateRequestProcessorChain>
-
- <updateRequestProcessorChain name="distrib-dup-test-chain-implicit">
- <!-- implicit test w/o distrib declared-->
- <processor class="solr.RegexReplaceProcessorFactory">
- <str name="fieldName">regex_dup_A_s</str>
- <str name="pattern">x</str>
- <str name="replacement">x_x</str>
- </processor>
- <processor class="solr.RegexReplaceProcessorFactory">
- <str name="fieldName">regex_dup_B_s</str>
- <str name="pattern">x</str>
- <str name="replacement">x_x</str>
- </processor>
- <processor class="solr.RunUpdateProcessorFactory" />
- </updateRequestProcessorChain>
-
-</config>
diff --git a/solr/core/src/test-files/solr/collection1/conf/solrconfig-tlog-mutable-managed-schema.xml b/solr/core/src/test-files/solr/collection1/conf/solrconfig-tlog-mutable-managed-schema.xml
deleted file mode 100644
index 3c86eb9c49d..00000000000
--- a/solr/core/src/test-files/solr/collection1/conf/solrconfig-tlog-mutable-managed-schema.xml
+++ /dev/null
@@ -1,101 +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>
- <jmx />
-
- <luceneMatchVersion>${tests.luceneMatchVersion:LUCENE_CURRENT}</luceneMatchVersion>
-
- <schemaFactory class="ManagedIndexSchemaFactory">
- <bool name="mutable">true</bool>
- <str name="managedSchemaResourceName">managed-schema</str>
- </schemaFactory>
-
- <directoryFactory name="DirectoryFactory" class="${solr.directoryFactory:solr.RAMDirectoryFactory}">
- <!-- used to keep RAM reqs down for HdfsDirectoryFactory -->
- <int name="solr.hdfs.blockcache.blocksperbank">${solr.hdfs.blockcache.blocksperbank:1024}</int>
- </directoryFactory>
-
- <dataDir>${solr.data.dir:}</dataDir>
-
- <indexConfig>
- <lockType>${solr.lock.type:native}</lockType>
- <useCompoundFile>${useCompoundFile:false}</useCompoundFile>
- </indexConfig>
-
- <!-- an update processor the explicitly excludes distrib to test
- clean errors when people attempt atomic updates w/o it
- -->
- <updateRequestProcessorChain name="nodistrib" >
- <processor class="solr.NoOpDistributingUpdateProcessorFactory" />
- <processor class="solr.RunUpdateProcessorFactory" />
- </updateRequestProcessorChain>
-
- <requestHandler name="standard" class="solr.StandardRequestHandler">
- </requestHandler>
-
- <requestHandler name="/get" class="solr.RealTimeGetHandler">
- <lst name="defaults">
- <str name="omitHeader">true</str>
- </lst>
- </requestHandler>
-
- <requestHandler name="/replication" class="solr.ReplicationHandler" startup="lazy" />
-
- <requestHandler name="/update" class="solr.UpdateRequestHandler" />
-
- <updateHandler class="solr.DirectUpdateHandler2">
- <updateLog>
- <str name="dir">${solr.ulog.dir:}</str>
- </updateLog>
- </updateHandler>
-
- <requestHandler name="/admin/" class="org.apache.solr.handler.admin.AdminHandlers" />
-
- <updateRequestProcessorChain name="distrib-dup-test-chain-explicit">
- <!-- explicit test using processors before and after distrib -->
- <processor class="solr.RegexReplaceProcessorFactory">
- <str name="fieldName">regex_dup_A_s</str>
- <str name="pattern">x</str>
- <str name="replacement">x_x</str>
- </processor>
- <processor class="solr.DistributedUpdateProcessorFactory" />
- <processor class="solr.RegexReplaceProcessorFactory">
- <str name="fieldName">regex_dup_B_s</str>
- <str name="pattern">x</str>
- <str name="replacement">x_x</str>
- </processor>
- <processor class="solr.RunUpdateProcessorFactory" />
- </updateRequestProcessorChain>
-
- <updateRequestProcessorChain name="distrib-dup-test-chain-implicit">
- <!-- implicit test w/o distrib declared-->
- <processor class="solr.RegexReplaceProcessorFactory">
- <str name="fieldName">regex_dup_A_s</str>
- <str name="pattern">x</str>
- <str name="replacement">x_x</str>
- </processor>
- <processor class="solr.RegexReplaceProcessorFactory">
- <str name="fieldName">regex_dup_B_s</str>
- <str name="pattern">x</str>
- <str name="replacement">x_x</str>
- </processor>
- <processor class="solr.RunUpdateProcessorFactory" />
- </updateRequestProcessorChain>
-
-</config>
diff --git a/solr/core/src/test/org/apache/solr/rest/schema/TestManagedSchemaFieldResource.java b/solr/core/src/test/org/apache/solr/rest/schema/TestManagedSchemaFieldResource.java
index 24a4d5f705e..f7b74d08af4 100644
--- a/solr/core/src/test/org/apache/solr/rest/schema/TestManagedSchemaFieldResource.java
+++ b/solr/core/src/test/org/apache/solr/rest/schema/TestManagedSchemaFieldResource.java
@@ -42,7 +42,10 @@ public class TestManagedSchemaFieldResource extends RestTestBase {
solrRestApi.setInitParameter("org.restlet.application", "org.apache.solr.rest.SolrRestApi");
extraServlets.put(solrRestApi, "/schema/*"); // '/schema/*' matches '/schema', '/schema/', and '/schema/whatever...'
- createJettyAndHarness(tmpSolrHome, "solrconfig-mutable-managed-schema.xml", "schema-rest.xml", "/solr", true, extraServlets);
+ System.setProperty("managed.schema.mutable", "true");
+ System.setProperty("enable.update.log", "false");
+
+ createJettyAndHarness(tmpSolrHome, "solrconfig-managed-schema.xml", "schema-rest.xml", "/solr", true, extraServlets);
}
@After
diff --git a/solr/core/src/test/org/apache/solr/schema/TestCloudManagedSchema.java b/solr/core/src/test/org/apache/solr/schema/TestCloudManagedSchema.java
index 8dfb593c226..acb8a81c51d 100644
--- a/solr/core/src/test/org/apache/solr/schema/TestCloudManagedSchema.java
+++ b/solr/core/src/test/org/apache/solr/schema/TestCloudManagedSchema.java
@@ -27,6 +27,7 @@ import org.apache.solr.common.SolrException;
import org.apache.solr.common.params.CoreAdminParams;
import org.apache.solr.common.params.ModifiableSolrParams;
import org.apache.solr.common.util.NamedList;
+import org.junit.BeforeClass;
import java.io.IOException;
import java.io.InputStream;
@@ -39,9 +40,15 @@ public class TestCloudManagedSchema extends AbstractFullDistribZkTestBase {
super();
}
+ @BeforeClass
+ public static void initSysProperties() {
+ System.setProperty("managed.schema.mutable", "false");
+ System.setProperty("enable.update.log", "true");
+ }
+
@Override
protected String getCloudSolrConfig() {
- return "solrconfig-tlog-managed-schema.xml";
+ return "solrconfig-managed-schema.xml";
}
@Override
diff --git a/solr/core/src/test/org/apache/solr/schema/TestCloudManagedSchemaAddField.java b/solr/core/src/test/org/apache/solr/schema/TestCloudManagedSchemaAddField.java
index 95eafee8eaf..ffffe12f1d7 100644
--- a/solr/core/src/test/org/apache/solr/schema/TestCloudManagedSchemaAddField.java
+++ b/solr/core/src/test/org/apache/solr/schema/TestCloudManagedSchemaAddField.java
@@ -26,6 +26,8 @@ import org.restlet.ext.servlet.ServerServlet;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import org.junit.BeforeClass;
+
import java.util.ArrayList;
import java.util.List;
import java.util.SortedMap;
@@ -42,9 +44,15 @@ public class TestCloudManagedSchemaAddField extends AbstractFullDistribZkTestBas
shardCount = 8;
}
+ @BeforeClass
+ public static void initSysProperties() {
+ System.setProperty("managed.schema.mutable", "true");
+ System.setProperty("enable.update.log", "true");
+ }
+
@Override
protected String getCloudSolrConfig() {
- return "solrconfig-tlog-mutable-managed-schema.xml";
+ return "solrconfig-managed-schema.xml";
}
@Override
diff --git a/solr/core/src/test/org/apache/solr/schema/TestManagedSchema.java b/solr/core/src/test/org/apache/solr/schema/TestManagedSchema.java
index e99791da770..a127b67c6b1 100644
--- a/solr/core/src/test/org/apache/solr/schema/TestManagedSchema.java
+++ b/solr/core/src/test/org/apache/solr/schema/TestManagedSchema.java
@@ -52,7 +52,6 @@ public class TestManagedSchema extends AbstractBadConfigTestBase {
tmpSolrHome = new File(tmpSolrHomePath).getAbsoluteFile();
tmpConfDir = new File(tmpSolrHome, confDir);
File testHomeConfDir = new File(TEST_HOME(), confDir);
- FileUtils.copyFileToDirectory(new File(testHomeConfDir, "solrconfig-mutable-managed-schema.xml"), tmpConfDir);
FileUtils.copyFileToDirectory(new File(testHomeConfDir, "solrconfig-managed-schema.xml"), tmpConfDir);
FileUtils.copyFileToDirectory(new File(testHomeConfDir, "solrconfig-basic.xml"), tmpConfDir);
FileUtils.copyFileToDirectory(new File(testHomeConfDir, "solrconfig.snippet.randomindexconfig.xml"), tmpConfDir);
@@ -64,6 +63,8 @@ public class TestManagedSchema extends AbstractBadConfigTestBase {
// initCore will trigger an upgrade to managed schema, since the solrconfig has
// <schemaFactory class="ManagedIndexSchemaFactory" ... />
+ System.setProperty("managed.schema.mutable", "false");
+ System.setProperty("enable.update.log", "false");
initCore("solrconfig-managed-schema.xml", "schema-minimal.xml", tmpSolrHome.getPath());
}
@@ -71,6 +72,8 @@ public class TestManagedSchema extends AbstractBadConfigTestBase {
private void deleteCoreAndTempSolrHomeDirectory() throws Exception {
deleteCore();
FileUtils.deleteDirectory(tmpSolrHome);
+ System.clearProperty("managed.schema.mutable");
+ System.clearProperty("enable.update.log");
}
public void testUpgrade() throws Exception {
@@ -165,7 +168,9 @@ public class TestManagedSchema extends AbstractBadConfigTestBase {
deleteCore();
File managedSchemaFile = new File(tmpConfDir, "managed-schema");
assertTrue(managedSchemaFile.delete()); // Delete managed-schema so it won't block parsing a new schema
- initCore("solrconfig-mutable-managed-schema.xml", "schema-one-field-no-dynamic-field.xml", tmpSolrHome.getPath());
+
+ System.setProperty("managed.schema.mutable", "true");
+ initCore("solrconfig-managed-schema.xml", "schema-one-field-no-dynamic-field.xml", tmpSolrHome.getPath());
assertTrue(managedSchemaFile.exists());
String managedSchemaContents = FileUtils.readFileToString(managedSchemaFile, "UTF-8");
@@ -192,7 +197,8 @@ public class TestManagedSchema extends AbstractBadConfigTestBase {
deleteCore();
File managedSchemaFile = new File(tmpConfDir, "managed-schema");
assertTrue(managedSchemaFile.delete()); // Delete managed-schema so it won't block parsing a new schema
- initCore("solrconfig-mutable-managed-schema.xml", "schema-one-field-no-dynamic-field.xml", tmpSolrHome.getPath());
+ System.setProperty("managed.schema.mutable", "true");
+ initCore("solrconfig-managed-schema.xml", "schema-one-field-no-dynamic-field.xml", tmpSolrHome.getPath());
assertTrue(managedSchemaFile.exists());
String managedSchemaContents = FileUtils.readFileToString(managedSchemaFile, "UTF-8");
@@ -238,7 +244,8 @@ public class TestManagedSchema extends AbstractBadConfigTestBase {
deleteCore();
File managedSchemaFile = new File(tmpConfDir, "managed-schema");
assertTrue(managedSchemaFile.delete()); // Delete managed-schema so it won't block parsing a new schema
- initCore("solrconfig-mutable-managed-schema.xml", "schema-one-field-no-dynamic-field.xml", tmpSolrHome.getPath());
+ System.setProperty("managed.schema.mutable", "true");
+ initCore("solrconfig-managed-schema.xml", "schema-one-field-no-dynamic-field.xml", tmpSolrHome.getPath());
assertNotNull("Field 'str' is not present in the schema", h.getCore().getLatestSchema().getFieldOrNull("str"));
@@ -270,7 +277,8 @@ public class TestManagedSchema extends AbstractBadConfigTestBase {
deleteCore();
File managedSchemaFile = new File(tmpConfDir, "managed-schema");
assertTrue(managedSchemaFile.delete()); // Delete managed-schema so it won't block parsing a new schema
- initCore("solrconfig-mutable-managed-schema.xml", "schema-one-field-no-dynamic-field.xml", tmpSolrHome.getPath());
+ System.setProperty("managed.schema.mutable", "true");
+ initCore("solrconfig-managed-schema.xml", "schema-one-field-no-dynamic-field.xml", tmpSolrHome.getPath());
Map<String,Object> options = new HashMap<String,Object>();
options.put("stored", "false");
@@ -304,7 +312,8 @@ public class TestManagedSchema extends AbstractBadConfigTestBase {
deleteCore();
File managedSchemaFile = new File(tmpConfDir, "managed-schema");
assertTrue(managedSchemaFile.delete()); // Delete managed-schema so it won't block parsing a new schema
- initCore("solrconfig-mutable-managed-schema.xml", "schema-one-field-no-dynamic-field.xml", tmpSolrHome.getPath());
+ System.setProperty("managed.schema.mutable", "true");
+ initCore("solrconfig-managed-schema.xml", "schema-one-field-no-dynamic-field.xml", tmpSolrHome.getPath());
assertNull("Field '*_s' is present in the schema", h.getCore().getLatestSchema().getFieldOrNull("*_s"));
@@ -336,7 +345,8 @@ public class TestManagedSchema extends AbstractBadConfigTestBase {
deleteCore();
File managedSchemaFile = new File(tmpConfDir, "managed-schema");
assertTrue(managedSchemaFile.delete()); // Delete managed-schema so it won't block parsing a new schema
- initCore("solrconfig-mutable-managed-schema.xml", "schema_codec.xml", tmpSolrHome.getPath());
+ System.setProperty("managed.schema.mutable", "true");
+ initCore("solrconfig-managed-schema.xml", "schema_codec.xml", tmpSolrHome.getPath());
String uniqueKey = "string_f";
assertNotNull("Unique key field '" + uniqueKey + "' is not present in the schema",
@@ -363,7 +373,8 @@ public class TestManagedSchema extends AbstractBadConfigTestBase {
deleteCore();
File managedSchemaFile = new File(tmpConfDir, "managed-schema");
assertTrue(managedSchemaFile.delete()); // Delete managed-schema so it won't block parsing a new schema
- initCore("solrconfig-mutable-managed-schema.xml", "schema-bm25.xml", tmpSolrHome.getPath());
+ System.setProperty("managed.schema.mutable", "true");
+ initCore("solrconfig-managed-schema.xml", "schema-bm25.xml", tmpSolrHome.getPath());
String uniqueKey = "id";
assertNotNull("Unique key field '" + uniqueKey + "' is not present in the schema",
@@ -391,7 +402,8 @@ public class TestManagedSchema extends AbstractBadConfigTestBase {
deleteCore();
File managedSchemaFile = new File(tmpConfDir, "managed-schema");
assertTrue(managedSchemaFile.delete()); // Delete managed-schema so it won't block parsing a new schema
- initCore("solrconfig-mutable-managed-schema.xml", "schema-one-field-no-dynamic-field-unique-key.xml", tmpSolrHome.getPath());
+ System.setProperty("managed.schema.mutable", "true");
+ initCore("solrconfig-managed-schema.xml", "schema-one-field-no-dynamic-field-unique-key.xml", tmpSolrHome.getPath());
assertTrue(managedSchemaFile.exists());
String managedSchemaContents = FileUtils.readFileToString(managedSchemaFile, "UTF-8");
@@ -426,7 +438,8 @@ public class TestManagedSchema extends AbstractBadConfigTestBase {
deleteCore();
File managedSchemaFile = new File(tmpConfDir, "managed-schema");
assertTrue(managedSchemaFile.delete()); // Delete managed-schema so it won't block parsing a new schema
- initCore("solrconfig-mutable-managed-schema.xml", "schema-one-field-no-dynamic-field.xml", tmpSolrHome.getPath());
+ System.setProperty("managed.schema.mutable", "true");
+ initCore("solrconfig-managed-schema.xml", "schema-one-field-no-dynamic-field.xml", tmpSolrHome.getPath());
String fieldName = "new_text_field";
assertNull("Field '" + fieldName + "' is present in the schema",
diff --git a/solr/core/src/test/org/apache/solr/search/TestAddFieldRealTimeGet.java b/solr/core/src/test/org/apache/solr/search/TestAddFieldRealTimeGet.java
index 47b5591b960..392f038e4dd 100644
--- a/solr/core/src/test/org/apache/solr/search/TestAddFieldRealTimeGet.java
+++ b/solr/core/src/test/org/apache/solr/search/TestAddFieldRealTimeGet.java
@@ -42,13 +42,16 @@ public class TestAddFieldRealTimeGet extends TestRTGBase {
tmpSolrHome = new File(tmpSolrHomePath).getAbsoluteFile();
tmpConfDir = new File(tmpSolrHome, confDir);
File testHomeConfDir = new File(TEST_HOME(), confDir);
- final String configFileName = "solrconfig-tlog-mutable-managed-schema.xml";
+ final String configFileName = "solrconfig-managed-schema.xml";
final String schemaFileName = "schema-id-and-version-fields-only.xml";
FileUtils.copyFileToDirectory(new File(testHomeConfDir, configFileName), tmpConfDir);
FileUtils.copyFileToDirectory(new File(testHomeConfDir, schemaFileName), tmpConfDir);
+ FileUtils.copyFileToDirectory(new File(testHomeConfDir, "solrconfig.snippet.randomindexconfig.xml"), tmpConfDir);
// initCore will trigger an upgrade to managed schema, since the solrconfig has
// <schemaFactory class="ManagedIndexSchemaFactory" ... />
+ System.setProperty("managed.schema.mutable", "true");
+ System.setProperty("enable.update.log", "true");
initCore(configFileName, schemaFileName, tmpSolrHome.getPath());
}