lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ans...@apache.org
Subject svn commit: r1687104 - /lucene/dev/trunk/solr/core/src/test/org/apache/solr/search/mlt/CloudMLTQParserTest.java
Date Tue, 23 Jun 2015 17:31:12 GMT
Author: anshum
Date: Tue Jun 23 17:31:12 2015
New Revision: 1687104

URL: http://svn.apache.org/r1687104
Log:
SOLR-6755: Adding a check in the test to stop hitting the ClassCast exception.

Modified:
    lucene/dev/trunk/solr/core/src/test/org/apache/solr/search/mlt/CloudMLTQParserTest.java

Modified: lucene/dev/trunk/solr/core/src/test/org/apache/solr/search/mlt/CloudMLTQParserTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/test/org/apache/solr/search/mlt/CloudMLTQParserTest.java?rev=1687104&r1=1687103&r2=1687104&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/test/org/apache/solr/search/mlt/CloudMLTQParserTest.java
(original)
+++ lucene/dev/trunk/solr/core/src/test/org/apache/solr/search/mlt/CloudMLTQParserTest.java
Tue Jun 23 17:31:12 2015
@@ -122,10 +122,17 @@ public class CloudMLTQParserTest extends
     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,



Mime
View raw message