You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by yo...@apache.org on 2010/10/15 22:46:06 UTC

svn commit: r1023106 - /lucene/dev/trunk/solr/src/test/org/apache/solr/core/RequestHandlersTest.java

Author: yonik
Date: Fri Oct 15 20:46:05 2010
New Revision: 1023106

URL: http://svn.apache.org/viewvc?rev=1023106&view=rev
Log:
tests: lazy handler test didn't acutally test lazy handler, convert to junit4

Modified:
    lucene/dev/trunk/solr/src/test/org/apache/solr/core/RequestHandlersTest.java

Modified: lucene/dev/trunk/solr/src/test/org/apache/solr/core/RequestHandlersTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/test/org/apache/solr/core/RequestHandlersTest.java?rev=1023106&r1=1023105&r2=1023106&view=diff
==============================================================================
--- lucene/dev/trunk/solr/src/test/org/apache/solr/core/RequestHandlersTest.java (original)
+++ lucene/dev/trunk/solr/src/test/org/apache/solr/core/RequestHandlersTest.java Fri Oct 15 20:46:05 2010
@@ -17,22 +17,24 @@
 
 package org.apache.solr.core;
 
+import org.apache.solr.SolrTestCaseJ4;
 import org.apache.solr.handler.StandardRequestHandler;
 import org.apache.solr.request.SolrRequestHandler;
-import org.apache.solr.util.AbstractSolrTestCase;
+import org.junit.BeforeClass;
+import org.junit.Test;
 
-public class RequestHandlersTest extends AbstractSolrTestCase {
-
-  public String getSchemaFile() { return "schema.xml"; }
-  public String getSolrConfigFile() { return "solrconfig.xml"; }
+public class RequestHandlersTest extends SolrTestCaseJ4 {
+  @BeforeClass
+  public static void beforeClass() throws Exception {
+    initCore("solrconfig.xml", "schema.xml");
+  }
 
-  
+  @Test
   public void testLazyLoading() {
     SolrCore core = h.getCore();
     SolrRequestHandler handler = core.getRequestHandler( "lazy" );
     assertFalse( handler instanceof StandardRequestHandler ); 
     
-    // But it should behave just like the 'defaults' request handler above
     assertU(adoc("id", "42",
                  "name", "Zapp Brannigan"));
     assertU(adoc("id", "43",
@@ -48,21 +50,22 @@ public class RequestHandlersTest extends
     assertU(commit());
 
     assertQ("lazy request handler returns all matches",
-            req("id:[42 TO 47]"),
-            "*[count(//doc)=6]"
-            );
+            req("q","id:[42 TO 47]"),
+            "*[count(//doc)=6]");
 
+        // But it should behave just like the 'defaults' request handler above
     assertQ("lazy handler returns fewer matches",
-            req("q", "id:[42 TO 47]",   "qt","defaults"),
+            req("q", "id:[42 TO 47]", "qt","lazy"),
             "*[count(//doc)=4]"
             );
 
     assertQ("lazy handler includes highlighting",
-            req("q", "name:Zapp OR title:General",   "qt","defaults"),
+            req("q", "name:Zapp OR title:General", "qt","lazy"),
             "//lst[@name='highlighting']"
             );
   }
-  
+
+  @Test
   public void testPathNormalization()
   {
     SolrCore core = h.getCore();