From 7a09cc1d49baef5fa5f3a70fb4076c58a6c6768a Mon Sep 17 00:00:00 2001 From: Christine Poerschke Date: Mon, 26 Oct 2020 09:43:56 +0000 Subject: [PATCH] SOLR-14937: Correct client.queryDefaults().set(...) calls in some JSON facet tests. (#1987) --- .../solr/search/facet/TestJsonFacetRefinement.java | 12 ++++++------ .../org/apache/solr/search/facet/TestJsonFacets.java | 6 +++--- .../solr/search/facet/TestJsonRangeFacets.java | 10 +++++----- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/solr/core/src/test/org/apache/solr/search/facet/TestJsonFacetRefinement.java b/solr/core/src/test/org/apache/solr/search/facet/TestJsonFacetRefinement.java index babc91c364c..e7fcd27c490 100644 --- a/solr/core/src/test/org/apache/solr/search/facet/TestJsonFacetRefinement.java +++ b/solr/core/src/test/org/apache/solr/search/facet/TestJsonFacetRefinement.java @@ -506,7 +506,7 @@ public class TestJsonFacetRefinement extends SolrTestCaseHS { initServers(); final Client client = servers.getClient(random().nextInt()); - client.queryDefaults().set("shards", servers.getShards(), "debugQuery", Boolean.toString(random().nextBoolean())); + client.queryDefaults().set("shards", servers.getShards()).set("debugQuery", Boolean.toString(random().nextBoolean())); List clients = client.getClientProvider().all(); assertTrue(clients.size() >= 3); // we only use 2, but assert 3 to also test empty shard @@ -596,7 +596,7 @@ public class TestJsonFacetRefinement extends SolrTestCaseHS { public void testSortedFacetRefinementPushingNonRefinedBucketBackIntoTopN() throws Exception { initServers(); final Client client = servers.getClient(random().nextInt()); - client.queryDefaults().set("shards", servers.getShards(), "debugQuery", Boolean.toString(random().nextBoolean())); + client.queryDefaults().set("shards", servers.getShards()).set("debugQuery", Boolean.toString(random().nextBoolean())); List clients = client.getClientProvider().all(); assertTrue(clients.size() >= 3); // we only use 2, but assert 3 to also test empty shard @@ -828,7 +828,7 @@ public class TestJsonFacetRefinement extends SolrTestCaseHS { public void testProcessEmptyRefinement() throws Exception { initServers(); final Client client = servers.getClient(random().nextInt()); - client.queryDefaults().set("shards", servers.getShards(), "debugQuery", Boolean.toString(random().nextBoolean())); + client.queryDefaults().set("shards", servers.getShards()).set("debugQuery", Boolean.toString(random().nextBoolean())); List clients = client.getClientProvider().all(); assertTrue(clients.size() >= 3); // we only use 2, but assert at least 3 to also test empty shard @@ -884,7 +884,7 @@ public class TestJsonFacetRefinement extends SolrTestCaseHS { private int initSomeDocsWhere1ShardHasOnlyParentFacetField() throws Exception { initServers(); final Client client = servers.getClient(random().nextInt()); - client.queryDefaults().set("shards", servers.getShards(), "debugQuery", Boolean.toString(random().nextBoolean())); + client.queryDefaults().set("shards", servers.getShards()).set("debugQuery", Boolean.toString(random().nextBoolean())); final List clients = client.getClientProvider().all(); assertTrue(clients.size() >= 2); @@ -1043,7 +1043,7 @@ public class TestJsonFacetRefinement extends SolrTestCaseHS { public void doBasicRefinement(ModifiableSolrParams p) throws Exception { initServers(); Client client = servers.getClient(random().nextInt()); - client.queryDefaults().set("shards", servers.getShards(), "debugQuery", Boolean.toString(random().nextBoolean())); + client.queryDefaults().set("shards", servers.getShards()).set("debugQuery", Boolean.toString(random().nextBoolean())); List clients = client.getClientProvider().all(); assertTrue(clients.size() >= 3); @@ -1476,7 +1476,7 @@ public class TestJsonFacetRefinement extends SolrTestCaseHS { public void testIndexAscRefineConsistency() throws Exception { initServers(); final Client client = servers.getClient(random().nextInt()); - client.queryDefaults().set("shards", servers.getShards(), "debugQuery", Boolean.toString(random().nextBoolean())); + client.queryDefaults().set("shards", servers.getShards()).set("debugQuery", Boolean.toString(random().nextBoolean())); List clients = client.getClientProvider().all(); assertTrue(clients.size() >= 3); diff --git a/solr/core/src/test/org/apache/solr/search/facet/TestJsonFacets.java b/solr/core/src/test/org/apache/solr/search/facet/TestJsonFacets.java index 8a851d05ccc..bf622b4abfa 100644 --- a/solr/core/src/test/org/apache/solr/search/facet/TestJsonFacets.java +++ b/solr/core/src/test/org/apache/solr/search/facet/TestJsonFacets.java @@ -1104,7 +1104,7 @@ public class TestJsonFacets extends SolrTestCaseHS { public void testStatsDistrib() throws Exception { initServers(); Client client = servers.getClient(random().nextInt()); - client.queryDefaults().set( "shards", servers.getShards(), "debugQuery", Boolean.toString(random().nextBoolean()) ); + client.queryDefaults().set( "shards", servers.getShards()).set("debugQuery", Boolean.toString(random().nextBoolean()) ); doStats( client, params() ); } @@ -2960,7 +2960,7 @@ public class TestJsonFacets extends SolrTestCaseHS { public void testOverrequest() throws Exception { initServers(); Client client = servers.getClient(random().nextInt()); - client.queryDefaults().set( "shards", servers.getShards(), "debugQuery", Boolean.toString(random().nextBoolean()) ); + client.queryDefaults().set( "shards", servers.getShards()).set("debugQuery", Boolean.toString(random().nextBoolean()) ); List clients = client.getClientProvider().all(); assertTrue(clients.size() >= 3); @@ -3458,7 +3458,7 @@ public class TestJsonFacets extends SolrTestCaseHS { public void testFacetValueTypesDistrib() throws Exception { initServers(); Client client = servers.getClient(random().nextInt()); - client.queryDefaults().set( "shards", servers.getShards(), "debugQuery", Boolean.toString(random().nextBoolean()) ); + client.queryDefaults().set( "shards", servers.getShards()).set("debugQuery", Boolean.toString(random().nextBoolean()) ); doFacetValueTypeValidation(client); } diff --git a/solr/core/src/test/org/apache/solr/search/facet/TestJsonRangeFacets.java b/solr/core/src/test/org/apache/solr/search/facet/TestJsonRangeFacets.java index 6c8364cc7d6..da9d93e8a96 100644 --- a/solr/core/src/test/org/apache/solr/search/facet/TestJsonRangeFacets.java +++ b/solr/core/src/test/org/apache/solr/search/facet/TestJsonRangeFacets.java @@ -87,7 +87,7 @@ public class TestJsonRangeFacets extends SolrTestCaseHS { public void testRangeOtherWhiteboxDistrib() throws Exception { initServers(); Client client = servers.getClient(random().nextInt()); - client.queryDefaults().set( "shards", servers.getShards(), "debugQuery", Boolean.toString(random().nextBoolean()) ); + client.queryDefaults().set( "shards", servers.getShards()).set("debugQuery", Boolean.toString(random().nextBoolean()) ); } public void testRangeOtherWhitebox() throws Exception { @@ -167,7 +167,7 @@ public class TestJsonRangeFacets extends SolrTestCaseHS { public void testDateFacetsDistrib() throws Exception { initServers(); Client client = servers.getClient(random().nextInt()); - client.queryDefaults().set( "shards", servers.getShards(), "debugQuery", Boolean.toString(random().nextBoolean()) ); + client.queryDefaults().set( "shards", servers.getShards()).set("debugQuery", Boolean.toString(random().nextBoolean()) ); doDateFacets(client); } @@ -234,7 +234,7 @@ public class TestJsonRangeFacets extends SolrTestCaseHS { public void testRangeFacetWithRangesDistrib() throws Exception { initServers(); Client client = servers.getClient(random().nextInt()); - client.queryDefaults().set( "shards", servers.getShards(), "debugQuery", Boolean.toString(random().nextBoolean()) ); + client.queryDefaults().set( "shards", servers.getShards()).set("debugQuery", Boolean.toString(random().nextBoolean()) ); doRangeFacetWithRanges(client); } @@ -304,7 +304,7 @@ public class TestJsonRangeFacets extends SolrTestCaseHS { public void testRangeFacetWithRangesInNewFormatDistrib() throws Exception { initServers(); Client client = servers.getClient(random().nextInt()); - client.queryDefaults().set( "shards", servers.getShards(), "debugQuery", Boolean.toString(random().nextBoolean()) ); + client.queryDefaults().set( "shards", servers.getShards()).set("debugQuery", Boolean.toString(random().nextBoolean()) ); doRangeFacetWithRangesInNewFormat(client); } @@ -403,7 +403,7 @@ public class TestJsonRangeFacets extends SolrTestCaseHS { public void testFacetValueTypeDistrib() throws Exception { initServers(); Client client = servers.getClient(random().nextInt()); - client.queryDefaults().set( "shards", servers.getShards(), "debugQuery", Boolean.toString(random().nextBoolean()) ); + client.queryDefaults().set( "shards", servers.getShards()).set("debugQuery", Boolean.toString(random().nextBoolean()) ); doFacetValueTypeValidation(client); }