lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sim...@apache.org
Subject svn commit: r1058540 - in /lucene/dev/trunk/solr/src/test/org/apache/solr: client/solrj/response/ core/ handler/ handler/component/
Date Thu, 13 Jan 2011 13:16:35 GMT
Author: simonw
Date: Thu Jan 13 13:16:34 2011
New Revision: 1058540

URL: http://svn.apache.org/viewvc?rev=1058540&view=rev
Log:
fixed testcases which failed with -Dtests.multiplier > 1

Modified:
    lucene/dev/trunk/solr/src/test/org/apache/solr/client/solrj/response/TermsResponseTest.java
    lucene/dev/trunk/solr/src/test/org/apache/solr/core/RAMDirectoryFactoryTest.java
    lucene/dev/trunk/solr/src/test/org/apache/solr/handler/TestCSVLoader.java
    lucene/dev/trunk/solr/src/test/org/apache/solr/handler/component/QueryElevationComponentTest.java
    lucene/dev/trunk/solr/src/test/org/apache/solr/handler/component/SpellCheckComponentTest.java

Modified: lucene/dev/trunk/solr/src/test/org/apache/solr/client/solrj/response/TermsResponseTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/test/org/apache/solr/client/solrj/response/TermsResponseTest.java?rev=1058540&r1=1058539&r2=1058540&view=diff
==============================================================================
--- lucene/dev/trunk/solr/src/test/org/apache/solr/client/solrj/response/TermsResponseTest.java
(original)
+++ lucene/dev/trunk/solr/src/test/org/apache/solr/client/solrj/response/TermsResponseTest.java
Thu Jan 13 13:16:34 2011
@@ -24,6 +24,7 @@ import org.apache.solr.client.solrj.Solr
 import org.apache.solr.common.SolrInputDocument;
 import org.apache.solr.client.solrj.request.QueryRequest;
 import org.apache.solr.client.solrj.response.TermsResponse.Term;
+import org.junit.Before;
 import org.junit.BeforeClass;
 import org.junit.Test;
 
@@ -36,6 +37,15 @@ public class TermsResponseTest extends S
   public static void beforeTest() throws Exception {
     initCore(EXAMPLE_CONFIG, EXAMPLE_SCHEMA, EXAMPLE_HOME);
   }
+  
+  @Before
+  @Override
+  public void setUp() throws Exception{
+    super.setUp();
+    clearIndex();
+    assertU(commit());
+    assertU(optimize());
+  }
 
   @Test
   public void testTermsResponse() throws Exception {

Modified: lucene/dev/trunk/solr/src/test/org/apache/solr/core/RAMDirectoryFactoryTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/test/org/apache/solr/core/RAMDirectoryFactoryTest.java?rev=1058540&r1=1058539&r2=1058540&view=diff
==============================================================================
--- lucene/dev/trunk/solr/src/test/org/apache/solr/core/RAMDirectoryFactoryTest.java (original)
+++ lucene/dev/trunk/solr/src/test/org/apache/solr/core/RAMDirectoryFactoryTest.java Thu Jan
13 13:16:34 2011
@@ -18,6 +18,7 @@
 package org.apache.solr.core;
 
 import org.apache.lucene.store.Directory;
+import org.apache.lucene.store.SingleInstanceLockFactory;
 import org.apache.lucene.util.LuceneTestCase;
 import java.io.IOException;
 
@@ -27,7 +28,7 @@ import java.io.IOException;
 public class RAMDirectoryFactoryTest extends LuceneTestCase {
   public void testOpenReturnsTheSameForSamePath() throws IOException {
     final Directory directory = new RefCntRamDirectory();
-    RAMDirectoryFactory factory = new RAMDirectoryFactory() {
+    RAMDirectoryFactory factory = new RAMDirectoryFactory()  {
       @Override
       Directory openNew(String path) throws IOException {
         return directory;
@@ -40,6 +41,8 @@ public class RAMDirectoryFactoryTest ext
         "every time open() is called for the same path", directory, dir1);
     assertEquals("RAMDirectoryFactory should not create new instance of RefCntRamDirectory
" +
         "every time open() is called for the same path", directory, dir2);
+    dir1.close();
+    dir2.close();
   }
 
   public void testOpenSucceedForEmptyDir() throws IOException {

Modified: lucene/dev/trunk/solr/src/test/org/apache/solr/handler/TestCSVLoader.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/test/org/apache/solr/handler/TestCSVLoader.java?rev=1058540&r1=1058539&r2=1058540&view=diff
==============================================================================
--- lucene/dev/trunk/solr/src/test/org/apache/solr/handler/TestCSVLoader.java (original)
+++ lucene/dev/trunk/solr/src/test/org/apache/solr/handler/TestCSVLoader.java Thu Jan 13 13:16:34
2011
@@ -76,7 +76,7 @@ public class TestCSVLoader extends SolrT
   }
 
   void cleanup() {
-    assertU(delQ("id:[100 TO 110]"));
+    assertU(delQ("*:*"));
     assertU(commit());
   }
 

Modified: lucene/dev/trunk/solr/src/test/org/apache/solr/handler/component/QueryElevationComponentTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/test/org/apache/solr/handler/component/QueryElevationComponentTest.java?rev=1058540&r1=1058539&r2=1058540&view=diff
==============================================================================
--- lucene/dev/trunk/solr/src/test/org/apache/solr/handler/component/QueryElevationComponentTest.java
(original)
+++ lucene/dev/trunk/solr/src/test/org/apache/solr/handler/component/QueryElevationComponentTest.java
Thu Jan 13 13:16:34 2011
@@ -55,6 +55,14 @@ public class QueryElevationComponentTest
     clearIndex();
     assertU(commit());
     assertU(optimize());
+    // make sure this component is initialized correctly for each test
+    QueryElevationComponent comp = (QueryElevationComponent)h.getCore().getSearchComponent("elevate");
+    NamedList<String> args = new NamedList<String>();
+    args.add( QueryElevationComponent.CONFIG_FILE, "elevate.xml" );
+    args.add( QueryElevationComponent.FIELD_TYPE, "string" );
+    comp.init( args );
+    comp.inform( h.getCore() );
+    comp.forceElevation = false; 
   }
   
   @Test

Modified: lucene/dev/trunk/solr/src/test/org/apache/solr/handler/component/SpellCheckComponentTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/test/org/apache/solr/handler/component/SpellCheckComponentTest.java?rev=1058540&r1=1058539&r2=1058540&view=diff
==============================================================================
--- lucene/dev/trunk/solr/src/test/org/apache/solr/handler/component/SpellCheckComponentTest.java
(original)
+++ lucene/dev/trunk/solr/src/test/org/apache/solr/handler/component/SpellCheckComponentTest.java
Thu Jan 13 13:16:34 2011
@@ -40,6 +40,10 @@ public class SpellCheckComponentTest ext
   @BeforeClass
   public static void beforeClass() throws Exception {
     initCore("solrconfig-spellcheckcomponent.xml","schema.xml");
+  }
+  
+  public void setUp() throws Exception {
+    super.setUp();
     assertU(adoc("id", "0", "lowerfilt", "This is a title"));
     assertU((adoc("id", "1", "lowerfilt",
             "The quick reb fox jumped over the lazy brown dogs.")));
@@ -55,6 +59,14 @@ public class SpellCheckComponentTest ext
     assertU((commit()));
   }
   
+  public void tearDown() throws Exception {
+    super.tearDown();
+    assertU(delQ("*:*"));
+    optimize();
+    assertU((commit()));
+
+  }
+  
   @Test
   public void testExtendedResultsCount() throws Exception {
     assertJQ(req("qt",rh, SpellCheckComponent.COMPONENT_NAME, "true", SpellCheckComponent.SPELLCHECK_BUILD,
"true", "q","bluo", SpellCheckComponent.SPELLCHECK_COUNT,"5", SpellCheckComponent.SPELLCHECK_EXTENDED_RESULTS,"false")



Mime
View raw message