SOLR-7912: Fix CloudMLTQParserTest from the previous commit

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1716028 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Anshum Gupta 2015-11-24 05:03:50 +00:00
parent 255ff56d4e
commit dc5249a849
1 changed files with 5 additions and 3 deletions

View File

@ -135,15 +135,16 @@ public class CloudMLTQParserTest extends AbstractFullDistribZkTestBase {
"(+(lowerfilt:usa lowerfilt:bmw) -id:3)/no_coord"};
String[] actualParsedQueries;
if(queryResponse.getDebugMap().get("parsedquery") instanceof String) {
actualParsedQueries = new String[]{(String) queryResponse.getDebugMap().get("parsedquery")};
String parsedQueryString = (String) queryResponse.getDebugMap().get("parsedquery");
assertTrue(parsedQueryString.equals(expectedQueryStrings[0]) || parsedQueryString.equals(expectedQueryStrings[1]));
} else {
actualParsedQueries = ((ArrayList<String>) queryResponse
.getDebugMap().get("parsedquery")).toArray(new String[0]);
Arrays.sort(actualParsedQueries);
assertArrayEquals(expectedQueryStrings, actualParsedQueries);
}
assertArrayEquals(expectedQueryStrings, actualParsedQueries);
params = new ModifiableSolrParams();
params.set(CommonParams.Q, "{!mlt qf=lowerfilt,lowerfilt1 mindf=0 mintf=1}26");
@ -164,6 +165,7 @@ public class CloudMLTQParserTest extends AbstractFullDistribZkTestBase {
"(+(lowerfilt:usa lowerfilt:bmw lowerfilt:328i) -id:26)/no_coord"};
if(queryResponse.getDebugMap().get("parsedquery") instanceof String) {
// todo: We might run into issues here. Should think about a better way to test this.
actualParsedQueries = new String[]{(String) queryResponse.getDebugMap().get("parsedquery")};
} else {
actualParsedQueries = ((ArrayList<String>) queryResponse