lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From andyetitmo...@apache.org
Subject svn commit: r1689631 - in /lucene/dev/branches/branch_5x: ./ solr/ solr/CHANGES.txt solr/core/ solr/core/src/test/org/apache/solr/core/TestConfig.java
Date Tue, 07 Jul 2015 11:29:56 GMT
Author: andyetitmoves
Date: Tue Jul  7 11:29:56 2015
New Revision: 1689631

URL: http://svn.apache.org/r1689631
Log:
SOLR-7750: Change TestConfig.testDefaults to cover all SolrIndexConfig fields

Modified:
    lucene/dev/branches/branch_5x/   (props changed)
    lucene/dev/branches/branch_5x/solr/   (props changed)
    lucene/dev/branches/branch_5x/solr/CHANGES.txt   (contents, props changed)
    lucene/dev/branches/branch_5x/solr/core/   (props changed)
    lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/core/TestConfig.java
  (contents, props changed)

Modified: lucene/dev/branches/branch_5x/solr/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/CHANGES.txt?rev=1689631&r1=1689630&r2=1689631&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/solr/CHANGES.txt (original)
+++ lucene/dev/branches/branch_5x/solr/CHANGES.txt Tue Jul  7 11:29:56 2015
@@ -229,6 +229,9 @@ Other Changes
 
 * SOLR-7740: Fix typo bug with TestConfigOverlay (Christine Poerschke via Ramkumar Aiyengar)
 
+* SOLR-7750: Change TestConfig.testDefaults to cover all SolrIndexConfig fields
+  (Christine Poerschke via Ramkumar Aiyengar)
+
 ==================  5.2.1 ==================
 
 Consult the LUCENE_CHANGES.txt file for additional, low level, changes in this release

Modified: lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/core/TestConfig.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/core/TestConfig.java?rev=1689631&r1=1689630&r2=1689631&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/core/TestConfig.java
(original)
+++ lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/core/TestConfig.java
Tue Jul  7 11:29:56 2015
@@ -20,6 +20,7 @@ package org.apache.solr.core;
 import org.apache.lucene.index.ConcurrentMergeScheduler;
 import org.apache.lucene.index.IndexWriterConfig;
 import org.apache.lucene.index.TieredMergePolicy;
+import org.apache.lucene.util.InfoStream;
 import org.apache.solr.SolrTestCaseJ4;
 import org.apache.solr.handler.admin.ShowFileRequestHandler;
 import org.apache.solr.schema.IndexSchema;
@@ -109,11 +110,28 @@ public class TestConfig extends SolrTest
   @Test
   public void testDefaults() throws Exception {
 
+    int numDefaultsTested = 0;
+    int numNullDefaults = 0;
+
     SolrConfig sc = new SolrConfig(new SolrResourceLoader("solr/collection1"), "solrconfig-defaults.xml",
null);
     SolrIndexConfig sic = sc.indexConfig;
-    assertEquals("default ramBufferSizeMB", 100.0D, sic.ramBufferSizeMB, 0.0D);
-    assertEquals("default LockType", SolrIndexConfig.LOCK_TYPE_NATIVE, sic.lockType);
-    assertEquals("default useCompoundFile", false, sic.getUseCompoundFile());
+
+    ++numDefaultsTested; assertEquals("default useCompoundFile", false, sic.getUseCompoundFile());
+
+    ++numDefaultsTested; assertEquals("default maxBufferedDocs", -1, sic.maxBufferedDocs);
+    ++numDefaultsTested; assertEquals("default maxMergeDocs", -1, sic.maxMergeDocs);
+    ++numDefaultsTested; assertEquals("default maxIndexingThreads", IndexWriterConfig.DEFAULT_MAX_THREAD_STATES,
sic.maxIndexingThreads);
+    ++numDefaultsTested; assertEquals("default mergeFactor", -1, sic.mergeFactor);
+
+    ++numDefaultsTested; assertEquals("default ramBufferSizeMB", 100.0D, sic.ramBufferSizeMB,
0.0D);
+    ++numDefaultsTested; assertEquals("default writeLockTimeout", -1, sic.writeLockTimeout);
+    ++numDefaultsTested; assertEquals("default LockType", SolrIndexConfig.LOCK_TYPE_NATIVE,
sic.lockType);
+
+    ++numDefaultsTested; assertEquals("default infoStream", InfoStream.NO_OUTPUT, sic.infoStream);
+
+    ++numDefaultsTested; ++numNullDefaults; assertNull("default mergePolicyInfo", sic.mergePolicyInfo);
+    ++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());
@@ -123,6 +141,11 @@ public class TestConfig extends SolrTest
 
     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().size();
+    assertEquals("numDefaultsTested vs. numDefaultsMapped+numNullDefaults ="+sic.toMap().keySet(),
numDefaultsTested, numDefaultsMapped+numNullDefaults);
   }
 
 



Mime
View raw message