use of org.apache.solr.update.SolrIndexConfig in project lucene-solr by apache.
the class TestConfig method testSanityCheckTestSysPropsAreUsed.
// sanity check that sys propertis are working as expected
public void testSanityCheckTestSysPropsAreUsed() throws Exception {
SolrConfig sc = new SolrConfig(new SolrResourceLoader(TEST_PATH().resolve("collection1")), "solrconfig-basic.xml", null);
SolrIndexConfig sic = sc.indexConfig;
assertEquals("ramBufferSizeMB sysprop", Double.parseDouble(System.getProperty("solr.tests.ramBufferSizeMB")), sic.ramBufferSizeMB, 0.0D);
assertEquals("useCompoundFile sysprop", Boolean.parseBoolean(System.getProperty("useCompoundFile")), sic.useCompoundFile);
}
use of org.apache.solr.update.SolrIndexConfig in project lucene-solr by apache.
the class TestConfig method testDefaults.
// If defaults change, add test methods to cover each version
@Test
public void testDefaults() throws Exception {
int numDefaultsTested = 0;
int numNullDefaults = 0;
SolrConfig sc = new SolrConfig(new SolrResourceLoader(TEST_PATH().resolve("collection1")), "solrconfig-defaults.xml", null);
SolrIndexConfig sic = sc.indexConfig;
++numDefaultsTested;
assertEquals("default useCompoundFile", false, sic.useCompoundFile);
++numDefaultsTested;
assertEquals("default maxBufferedDocs", -1, sic.maxBufferedDocs);
++numDefaultsTested;
assertEquals("default ramBufferSizeMB", 100.0D, sic.ramBufferSizeMB, 0.0D);
++numDefaultsTested;
assertEquals("default writeLockTimeout", -1, sic.writeLockTimeout);
++numDefaultsTested;
assertEquals("default LockType", DirectoryFactory.LOCK_TYPE_NATIVE, sic.lockType);
++numDefaultsTested;
assertEquals("default infoStream", InfoStream.NO_OUTPUT, sic.infoStream);
++numDefaultsTested;
assertNotNull("default metrics", sic.metricsInfo);
++numDefaultsTested;
++numNullDefaults;
assertNull("default mergePolicyFactoryInfo", sic.mergePolicyFactoryInfo);
++numDefaultsTested;
++numNullDefaults;
assertNull("default mergeSchedulerInfo", sic.mergeSchedulerInfo);
++numDefaultsTested;
++numNullDefaults;
assertNull("default mergedSegmentWarmerInfo", sic.mergedSegmentWarmerInfo);
IndexSchema indexSchema = IndexSchemaFactory.buildIndexSchema("schema.xml", solrConfig);
IndexWriterConfig iwc = sic.toIndexWriterConfig(h.getCore());
assertNotNull("null mp", iwc.getMergePolicy());
assertTrue("mp is not TieredMergePolicy", iwc.getMergePolicy() instanceof TieredMergePolicy);
assertNotNull("null ms", iwc.getMergeScheduler());
assertTrue("ms is not CMS", iwc.getMergeScheduler() instanceof ConcurrentMergeScheduler);
assertNull("non-null mergedSegmentWarmer", iwc.getMergedSegmentWarmer());
final int numDefaultsMapped = sic.toMap(new LinkedHashMap<>()).size();
assertEquals("numDefaultsTested vs. numDefaultsMapped+numNullDefaults =" + sic.toMap(new LinkedHashMap<>()).keySet(), numDefaultsTested, numDefaultsMapped + numNullDefaults);
}
Aggregations