lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hoss...@apache.org
Subject svn commit: r1510802 - in /lucene/dev/trunk/solr: core/src/test-files/solr/ core/src/test-files/solr/collection1/conf/ core/src/test/org/apache/solr/ core/src/test/org/apache/solr/cloud/ test-framework/src/java/org/apache/solr/cloud/
Date Mon, 05 Aug 2013 23:17:39 GMT
Author: hossman
Date: Mon Aug  5 23:17:39 2013
New Revision: 1510802

URL: http://svn.apache.org/r1510802
Log:
SOLR-4952: use solrconfig.snippet.randomindexconfig.xml in solrconfig.xml and crazy-path-to-config.xml;
this included removing some unneccessary checks for indexConfig settings that already have
their own explicit tests

Modified:
    lucene/dev/trunk/solr/core/src/test-files/solr/collection1/conf/solrconfig.xml
    lucene/dev/trunk/solr/core/src/test-files/solr/crazy-path-to-config.xml
    lucene/dev/trunk/solr/core/src/test/org/apache/solr/BasicFunctionalityTest.java
    lucene/dev/trunk/solr/core/src/test/org/apache/solr/cloud/BasicZkTest.java
    lucene/dev/trunk/solr/test-framework/src/java/org/apache/solr/cloud/AbstractZkTestCase.java

Modified: lucene/dev/trunk/solr/core/src/test-files/solr/collection1/conf/solrconfig.xml
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/test-files/solr/collection1/conf/solrconfig.xml?rev=1510802&r1=1510801&r2=1510802&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/test-files/solr/collection1/conf/solrconfig.xml (original)
+++ lucene/dev/trunk/solr/core/src/test-files/solr/collection1/conf/solrconfig.xml Mon Aug
 5 23:17:39 2013
@@ -49,20 +49,8 @@
 
   <luceneMatchVersion>${tests.luceneMatchVersion:LUCENE_CURRENT}</luceneMatchVersion>
 
-  <indexConfig>
-    <mergeScheduler class="org.apache.lucene.index.ConcurrentMergeScheduler"/>
-    <writeLockTimeout>1000</writeLockTimeout>
-    <mergeFactor>8</mergeFactor>
-    <useCompoundFile>${useCompoundFile:false}</useCompoundFile>
-    <!-- for better multi-segment testing, we are using slower
-    indexing properties of maxBufferedDocs=10 and LogDocMergePolicy.
-    -->
-    <maxBufferedDocs>10</maxBufferedDocs>
-    <mergePolicy class="org.apache.lucene.index.LogDocMergePolicy"/>
-    <lockType>native</lockType>
-    <unlockOnStartup>true</unlockOnStartup>
-  </indexConfig>
-  
+  <xi:include href="solrconfig.snippet.randomindexconfig.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
+
   <updateHandler class="solr.DirectUpdateHandler2">
 
     <!-- autocommit pending docs if certain criteria are met

Modified: lucene/dev/trunk/solr/core/src/test-files/solr/crazy-path-to-config.xml
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/test-files/solr/crazy-path-to-config.xml?rev=1510802&r1=1510801&r2=1510802&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/test-files/solr/crazy-path-to-config.xml (original)
+++ lucene/dev/trunk/solr/core/src/test-files/solr/crazy-path-to-config.xml Mon Aug  5 23:17:39
2013
@@ -24,10 +24,7 @@
 <config>
   <luceneMatchVersion>${tests.luceneMatchVersion:LUCENE_CURRENT}</luceneMatchVersion>
 
-  <indexConfig>
-    <useCompoundFile>${useCompoundFile:false}</useCompoundFile>
-    <lockType>single</lockType>
-  </indexConfig>
+  <xi:include href="collection1/conf/solrconfig.snippet.randomindexconfig.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
 
   <updateHandler class="solr.DirectUpdateHandler2">
     <commitIntervalLowerBound>0</commitIntervalLowerBound>

Modified: lucene/dev/trunk/solr/core/src/test/org/apache/solr/BasicFunctionalityTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/test/org/apache/solr/BasicFunctionalityTest.java?rev=1510802&r1=1510801&r2=1510802&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/test/org/apache/solr/BasicFunctionalityTest.java (original)
+++ lucene/dev/trunk/solr/core/src/test/org/apache/solr/BasicFunctionalityTest.java Mon Aug
 5 23:17:39 2013
@@ -31,7 +31,6 @@ import javax.xml.parsers.DocumentBuilder
 import org.apache.lucene.document.Field;
 import org.apache.lucene.document.LazyDocument;
 import org.apache.lucene.index.IndexWriter;
-import org.apache.lucene.index.LogMergePolicy;
 import org.apache.lucene.index.StorableField;
 import org.apache.lucene.index.StoredDocument;
 import org.apache.lucene.store.Directory;
@@ -127,30 +126,11 @@ public class BasicFunctionalityTest exte
   public void testSomeStuff() throws Exception {
     clearIndex();
 
-    // test merge factor picked up
-    // and for rate limited settings
     SolrCore core = h.getCore();
 
-    RefCounted<IndexWriter> iwr = ((DirectUpdateHandler2) core
-        .getUpdateHandler()).getSolrCoreState().getIndexWriter(core);
-    try {
-      IndexWriter iw = iwr.get();
-      assertEquals("Mergefactor was not picked up", 8, ((LogMergePolicy) iw.getConfig().getMergePolicy()).getMergeFactor());
-      
-      Directory dir = iw.getDirectory();
-      
-      if (dir instanceof MockDirectoryWrapper) {
-        dir = ((MockDirectoryWrapper)dir).getDelegate();
-      }
-      
-      assertTrue(dir.getClass().getName(), dir instanceof RateLimitedDirectoryWrapper);
-      assertEquals(Double.valueOf(1000000), ((RateLimitedDirectoryWrapper)dir).getMaxWriteMBPerSec(Context.DEFAULT));
-      assertEquals(Double.valueOf(2000000), ((RateLimitedDirectoryWrapper)dir).getMaxWriteMBPerSec(Context.FLUSH));
-      assertEquals(Double.valueOf(3000000), ((RateLimitedDirectoryWrapper)dir).getMaxWriteMBPerSec(Context.MERGE));
-      assertEquals(Double.valueOf(4000000), ((RateLimitedDirectoryWrapper)dir).getMaxWriteMBPerSec(Context.READ));
-    } finally {
-      iwr.decref();
-    }
+    // test that we got the expected config, not just hardcoded defaults
+    assertNotNull(core.getRequestHandler("mock"));
+
     // test stats call
     NamedList stats = core.getStatistics();
     assertEquals("collection1", stats.get("coreName"));

Modified: lucene/dev/trunk/solr/core/src/test/org/apache/solr/cloud/BasicZkTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/test/org/apache/solr/cloud/BasicZkTest.java?rev=1510802&r1=1510801&r2=1510802&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/test/org/apache/solr/cloud/BasicZkTest.java (original)
+++ lucene/dev/trunk/solr/core/src/test/org/apache/solr/cloud/BasicZkTest.java Mon Aug  5
23:17:39 2013
@@ -18,7 +18,6 @@ package org.apache.solr.cloud;
  */
 
 import org.apache.lucene.index.IndexWriter;
-import org.apache.lucene.index.LogMergePolicy;
 import org.apache.lucene.util.LuceneTestCase.Slow;
 import org.apache.solr.SolrTestCaseJ4;
 import org.apache.solr.common.SolrException;
@@ -58,16 +57,12 @@ public class BasicZkTest extends Abstrac
     h.getCoreContainer().getZkController().getZkStateReader().getLeaderUrl("collection1",
"shard1", 30000);
     
     ZkController zkController = h.getCoreContainer().getZkController();
-    
-    // test merge factor picked up
+
     SolrCore core = h.getCore();
 
-    RefCounted<IndexWriter> iw = ((DirectUpdateHandler2)core.getUpdateHandler()).getSolrCoreState().getIndexWriter(core);
-    try {
-      assertEquals("Mergefactor was not picked up", 8, ((LogMergePolicy)iw.get().getConfig().getMergePolicy()).getMergeFactor());
-    } finally {
-      iw.decref();
-    }
+    // test that we got the expected config, not just hardcoded defaults
+    assertNotNull(core.getRequestHandler("mock"));
+
     lrf.args.put(CommonParams.VERSION, "2.2");
     assertQ("test query on empty index", request("qlkciyopsbgzyvkylsjhchghjrdf"),
         "//result[@numFound='0']");

Modified: lucene/dev/trunk/solr/test-framework/src/java/org/apache/solr/cloud/AbstractZkTestCase.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/test-framework/src/java/org/apache/solr/cloud/AbstractZkTestCase.java?rev=1510802&r1=1510801&r2=1510802&view=diff
==============================================================================
--- lucene/dev/trunk/solr/test-framework/src/java/org/apache/solr/cloud/AbstractZkTestCase.java
(original)
+++ lucene/dev/trunk/solr/test-framework/src/java/org/apache/solr/cloud/AbstractZkTestCase.java
Mon Aug  5 23:17:39 2013
@@ -105,6 +105,7 @@ public abstract class AbstractZkTestCase
     putConfig(zkClient, solrhome, config, "solrconfig.xml");
     putConfig(zkClient, solrhome, schema, "schema.xml");
 
+    putConfig(zkClient, solrhome, "solrconfig.snippet.randomindexconfig.xml");
     putConfig(zkClient, solrhome, "stopwords.txt");
     putConfig(zkClient, solrhome, "protwords.txt");
     putConfig(zkClient, solrhome, "currency.xml");



Mime
View raw message