From e14574716557f514dd41a298637bc18884c498e5 Mon Sep 17 00:00:00 2001 From: Christine Poerschke Date: Tue, 15 Dec 2015 21:12:18 +0000 Subject: [PATCH] SOLR-8388: ReturnFieldsTest.testToString() fix (don't assume ordering within sets' values) git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1720253 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/solr/search/ReturnFieldsTest.java | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/solr/core/src/test/org/apache/solr/search/ReturnFieldsTest.java b/solr/core/src/test/org/apache/solr/search/ReturnFieldsTest.java index d62879c35d6..4b669c0c34c 100644 --- a/solr/core/src/test/org/apache/solr/search/ReturnFieldsTest.java +++ b/solr/core/src/test/org/apache/solr/search/ReturnFieldsTest.java @@ -100,13 +100,20 @@ public class ReturnFieldsTest extends SolrTestCaseJ4 { assertEquals(rf1ToString, rf1.toString()); final ReturnFields rf2 = new SolrReturnFields( - req("fl", "id "+SolrReturnFields.SCORE+" test")); - final String rf2ToString = "SolrReturnFields=(globs=[]" - +",fields=[score, test, id]" - +",okFieldNames=[null, score, test, id]" - +",reqFieldNames=[id, score, test]" + req("fl", SolrReturnFields.SCORE)); + final String rf2ToStringA = "SolrReturnFields=(globs=[]" + +",fields=["+SolrReturnFields.SCORE+"]" + +",okFieldNames=[null, "+SolrReturnFields.SCORE+"]" + +",reqFieldNames=["+SolrReturnFields.SCORE+"]" +",transformer=score,wantsScore=true,wantsAllFields=false)"; - assertEquals(rf2ToString, rf2.toString()); + final String rf2ToStringB = "SolrReturnFields=(globs=[]" + +",fields=["+SolrReturnFields.SCORE+"]" + +",okFieldNames=["+SolrReturnFields.SCORE+", null]" + +",reqFieldNames=["+SolrReturnFields.SCORE+"]" + +",transformer=score,wantsScore=true,wantsAllFields=false)"; + assertTrue( + rf2ToStringA.equals(rf2.toString()) || + rf2ToStringB.equals(rf2.toString())); } @Test