mirror of https://github.com/apache/lucene.git
tests: lazy handler test didn't acutally test lazy handler, convert to junit4
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1023106 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
aa33fe16a6
commit
5fb1cb4046
|
@ -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 class RequestHandlersTest extends SolrTestCaseJ4 {
|
||||
@BeforeClass
|
||||
public static void beforeClass() throws Exception {
|
||||
initCore("solrconfig.xml", "schema.xml");
|
||||
}
|
||||
|
||||
public String getSchemaFile() { return "schema.xml"; }
|
||||
public String getSolrConfigFile() { return "solrconfig.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 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 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();
|
||||
|
|
Loading…
Reference in New Issue