SOLR-6755: Adding a check in the test to stop hitting the ClassCast exception.

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1687104 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Anshum Gupta 2015-06-23 17:31:12 +00:00
parent 48ea578733
commit 5164a48fd0
1 changed files with 10 additions and 3 deletions

View File

@ -122,10 +122,17 @@ public class CloudMLTQParserTest extends AbstractFullDistribZkTestBase {
assertArrayEquals(expectedIds, actualIds);
String expectedQueryString = "lowerfilt:bmw lowerfilt:usa";
ArrayList<String> actualParsedQueries = (ArrayList<String>) queryResponse
.getDebugMap().get("parsedquery");
ArrayList<String> actualParsedQueries;
if(queryResponse.getDebugMap().get("parsedquery") instanceof String) {
actualParsedQueries = new ArrayList();
actualParsedQueries.add((String) queryResponse.getDebugMap().get("parsedquery"));
} else {
actualParsedQueries = (ArrayList<String>) queryResponse
.getDebugMap().get("parsedquery");
}
for (int counter = 0; counter < actualParsedQueries.size(); counter++) {
assertTrue("Parsed queries aren't equal",
compareParsedQueryStrings(expectedQueryString,