Apache Lucene open-source search software
tests: lazy handler test didn't acutally test lazy handler, convert to junit4
Yonik Seeley5fb1cb40460e
diff --git a/solr/src/test/org/apache/solr/core/RequestHandlersTest.java b/solr/src/test/org/apache/solr/core/RequestHandlersTest.javaindex e812837b478..043d5d5954c 100755--- a/solr/src/test/org/apache/solr/core/RequestHandlersTest.java+++ b/solr/src/test/org/apache/solr/core/RequestHandlersTest.java@@ -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");+ }-+ @Testpublic 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 aboveassertU(adoc("id", "42","name", "Zapp Brannigan"));assertU(adoc("id", "43",@@ -48,21 +50,22 @@ public class RequestHandlersTest extends AbstractSolrTestCase {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 aboveassertQ("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']");}-++ @Testpublic void testPathNormalization(){SolrCore core = h.getCore();