fix testOldStyleDefaults so that it actually tests the old style defaults -- i broke it with a typo way back in r441175

git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@915641 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Chris M. Hostetter 2010-02-24 02:12:55 +00:00
parent 83fc525d60
commit d16fe2ecca
1 changed files with 12 additions and 9 deletions

View File

@ -70,6 +70,9 @@ public class DisMaxRequestHandlerTest extends AbstractSolrTestCase {
} }
public void testSomeStuff() throws Exception { public void testSomeStuff() throws Exception {
doTestSomeStuff("dismax");
}
public void doTestSomeStuff(final String qt) throws Exception {
populate(); populate();
assertQ("basic match", assertQ("basic match",
@ -91,7 +94,7 @@ public class DisMaxRequestHandlerTest extends AbstractSolrTestCase {
assertQ("multi qf", assertQ("multi qf",
req("q", "cool" req("q", "cool"
,"qt", "dismax" ,"qt", qt
,"version", "2.0" ,"version", "2.0"
,"qf", "subject" ,"qf", "subject"
,"qf", "features_t" ,"qf", "features_t"
@ -101,7 +104,7 @@ public class DisMaxRequestHandlerTest extends AbstractSolrTestCase {
assertQ("boost query", assertQ("boost query",
req("q", "cool stuff" req("q", "cool stuff"
,"qt", "dismax" ,"qt", qt
,"version", "2.0" ,"version", "2.0"
,"bq", "subject:hell^400" ,"bq", "subject:hell^400"
) )
@ -113,7 +116,7 @@ public class DisMaxRequestHandlerTest extends AbstractSolrTestCase {
assertQ("multi boost query", assertQ("multi boost query",
req("q", "cool stuff" req("q", "cool stuff"
,"qt", "dismax" ,"qt", qt
,"version", "2.0" ,"version", "2.0"
,"bq", "subject:hell^400" ,"bq", "subject:hell^400"
,"bq", "subject:cool^4" ,"bq", "subject:cool^4"
@ -138,14 +141,14 @@ public class DisMaxRequestHandlerTest extends AbstractSolrTestCase {
); );
assertQ("relying on ALTQ from config", assertQ("relying on ALTQ from config",
req( "qt", "dismax", req( "qt", qt,
"fq", "id:666", "fq", "id:666",
"facet", "false" ) "facet", "false" )
,"//*[@numFound='1']" ,"//*[@numFound='1']"
); );
assertQ("explicit ALTQ", assertQ("explicit ALTQ",
req( "qt", "dismax", req( "qt", qt,
"q.alt", "id:9999", "q.alt", "id:9999",
"fq", "id:666", "fq", "id:666",
"facet", "false" ) "facet", "false" )
@ -153,12 +156,12 @@ public class DisMaxRequestHandlerTest extends AbstractSolrTestCase {
); );
assertQ("no query slop == no match", assertQ("no query slop == no match",
req( "qt", "dismax", req( "qt", qt,
"q", "\"cool chick\"" ) "q", "\"cool chick\"" )
,"//*[@numFound='0']" ,"//*[@numFound='0']"
); );
assertQ("query slop == match", assertQ("query slop == match",
req( "qt", "dismax", req( "qt", qt,
"qs", "2", "qs", "2",
"q", "\"cool chick\"" ) "q", "\"cool chick\"" )
,"//*[@numFound='1']" ,"//*[@numFound='1']"
@ -195,12 +198,12 @@ public class DisMaxRequestHandlerTest extends AbstractSolrTestCase {
public void testOldStyleDefaults() throws Exception { public void testOldStyleDefaults() throws Exception {
lrf = h.getRequestFactory lrf = h.getRequestFactory
("dismax", 0, 20, ("dismaxOldStyleDefaults", 0, 20,
"version","2.0", "version","2.0",
"facet", "true", "facet", "true",
"facet.field","t_s" "facet.field","t_s"
); );
testSomeStuff(); doTestSomeStuff("dismaxOldStyleDefaults");
} }