This is an automated email from the ASF dual-hosted git repository.
janhoy pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/solr.git
The following commit(s) were added to refs/heads/main by this push:
new bef45ad3a2b Quiet test logs, deprecation warning per module (#5355)
bef45ad3a2b is described below
commit bef45ad3a2b598af4d47e2ae5b4c27589dedec5a
Author: Jan Høydahl <[email protected]>
AuthorDate: Wed Nov 18 16:29:36 2026 +0100
Quiet test logs, deprecation warning per module (#5355)
---
.github/actions/prepare-for-build/action.yml | 9 ++++--
.github/workflows/docker-nightly.yml | 5 +++
gradle/java/javac.gradle | 10 +++++-
.../randomization/policies/solr-tests.policy | 17 +++++++---
.../api/model/AddPackageVersionRequestBody.java | 6 ++--
.../api/model/AddReplicaPropertyRequestBody.java | 4 ++-
.../client/api/model/RenameCoreRequestBody.java | 4 ++-
.../solr/client/solrj/impl/HttpJdkSolrClient.java | 1 +
.../solrj/request/CollectionAdminRequest.java | 1 +
.../solrj/src/resources/java-template/api.mustache | 2 ++
.../apache/solr/client/solrj/SolrExampleTests.java | 1 +
.../client/solrj/embedded/TestSolrProperties.java | 1 +
.../solrj/impl/CloudHttp2SolrClientTest.java | 37 ++++++++++++++++++----
.../client/solrj/impl/HttpJdkSolrClientTest.java | 1 +
.../impl/SendUpdatesToLeadersOverrideTest.java | 35 ++++++++++----------
.../client/solrj/request/QueryRequestTest.java | 1 +
.../solr/client/solrj/request/SchemaTest.java | 1 +
.../solr/client/solrj/request/SolrPingTest.java | 1 +
.../solr/client/solrj/request/SolrQueryTest.java | 1 +
.../solrj/request/TestConfigSetAdminRequest.java | 1 +
.../solr/client/solrj/request/TestCoreAdmin.java | 1 +
.../solr/client/solrj/request/TestV2Request.java | 2 +-
.../client/solrj/response/TermsResponseTest.java | 1 +
.../cloud/PerReplicaStatesIntegrationTest.java | 1 +
24 files changed, 107 insertions(+), 37 deletions(-)
diff --git a/.github/actions/prepare-for-build/action.yml
b/.github/actions/prepare-for-build/action.yml
index fa30567b88f..728f91f976f 100644
--- a/.github/actions/prepare-for-build/action.yml
+++ b/.github/actions/prepare-for-build/action.yml
@@ -19,14 +19,14 @@ runs:
using: "composite"
steps:
- name: Set up Java (${{ inputs.java-distribution }}, ${{
inputs.java-version }})"
- uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 #
v4.7.1
+ uses: actions/setup-java@de7274f081f381c8f8158605e0321c36c376e2e6 #
v6.0.1
with:
distribution: ${{ inputs.java-distribution }}
java-version: ${{ inputs.java-version }}
java-package: jdk
- name: Cache gradle-wrapper.jar
- uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
+ uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: gradle/wrapper/gradle-wrapper.jar
key: gradle-wrapper-${{
hashFiles('gradle/wrapper/gradle-wrapper.jar.sha256') }}
@@ -38,3 +38,8 @@ runs:
# increase expiry time for the temp. develocity token.
#
https://github.com/gradle/actions/blob/main/docs/setup-gradle.md#increasing-the-expiry-time-for-develocity-access-tokens
develocity-token-expiry: 8
+ # the default omits "wrapper", so the distribution zip is downloaded
on every run
+ gradle-home-cache-includes: |
+ caches
+ notifications
+ wrapper
diff --git a/.github/workflows/docker-nightly.yml
b/.github/workflows/docker-nightly.yml
index af65fa3c8f4..e88df30a1b0 100644
--- a/.github/workflows/docker-nightly.yml
+++ b/.github/workflows/docker-nightly.yml
@@ -97,6 +97,11 @@ jobs:
uses:
gradle/actions/setup-gradle@9c971963bec38e04b3d30dcc455b5382be2fdbfb # v6.3.0
with:
develocity-token-expiry: 8
+ # the default omits "wrapper", so the distribution zip is downloaded
on every run
+ gradle-home-cache-includes: |
+ caches
+ notifications
+ wrapper
- name: Create custom gradle.properties
run: |
diff --git a/gradle/java/javac.gradle b/gradle/java/javac.gradle
index e4049b3e62d..076dc9a4fb7 100644
--- a/gradle/java/javac.gradle
+++ b/gradle/java/javac.gradle
@@ -17,6 +17,14 @@
// Configure Java project defaults.
+// Projects that compile free of deprecation warnings and so can keep
-Xlint:deprecation on.
+// Everywhere else javac prints an unsuppressable "uses or overrides a
deprecated API" note
+// instead; move a project here once its warnings are gone.
+def deprecationLintProjects = [
+ ":solr:api",
+ ":solr:solrj",
+]
+
allprojects {
plugins.withType(JavaPlugin) {
java {
@@ -38,7 +46,7 @@ allprojects {
tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
options.compilerArgs += [
- "-Xlint:-deprecation",
+ deprecationLintProjects.contains(project.path) ?
"-Xlint:deprecation" : "-Xlint:-deprecation",
"-Xlint:-serial",
"-Xlint:cast",
"-Xlint:classfile",
diff --git a/gradle/testing/randomization/policies/solr-tests.policy
b/gradle/testing/randomization/policies/solr-tests.policy
index f93c8cd997c..3d4597646d3 100644
--- a/gradle/testing/randomization/policies/solr-tests.policy
+++ b/gradle/testing/randomization/policies/solr-tests.policy
@@ -189,9 +189,12 @@ grant {
permission java.net.NetPermission "requestPasswordAuthentication";
// for java.net.http.HttpClient. See HttpJdkSolrClientTest
- permission "java.net.URLPermission" "http://127.0.0.1:*/solr/-",
"HEAD,GET,PUT,POST:*";
- permission "java.net.URLPermission" "https://127.0.0.1:*/solr/-",
"HEAD,GET,PUT,POST:*";
- permission "java.net.URLPermission" "socket://127.0.0.1:*", "CONNECT:*";
+ // JDK-8305346: a URLPermission with a numeric IPv4 host cannot be parsed
while the policy is
+ // bootstrapping, so such a grant is dropped with a warning; the
SocketPermissions above are what
+ // actually confine these to loopback, so the host is a wildcard here.
+ permission "java.net.URLPermission" "http://*:*/solr/-",
"HEAD,GET,PUT,POST:*";
+ permission "java.net.URLPermission" "https://*:*/solr/-",
"HEAD,GET,PUT,POST:*";
+ permission "java.net.URLPermission" "socket://*:*", "CONNECT:*";
permission "java.net.URLPermission" "http://localhost:*/solr/-",
"HEAD,GET,PUT,POST:*";
permission "java.net.URLPermission" "https://localhost:*/solr/-",
"HEAD,GET,PUT,POST:*";
@@ -202,8 +205,8 @@ grant {
permission "java.net.URLPermission" "socket://[::1]:*", "CONNECT:*";
// for java.net.http.HttpClient. See ConcurrentUpdateJdkSolrClientTest
- permission "java.net.URLPermission" "http://127.0.0.1:*/noOneThere/-",
"HEAD,GET,PUT,POST:*";
- permission "java.net.URLPermission" "https://127.0.0.1:*/noOneThere/-",
"HEAD,GET,PUT,POST:*";
+ permission "java.net.URLPermission" "http://*:*/noOneThere/-",
"HEAD,GET,PUT,POST:*";
+ permission "java.net.URLPermission" "https://*:*/noOneThere/-",
"HEAD,GET,PUT,POST:*";
permission "java.net.URLPermission" "http://localhost:*/noOneThere/-",
"HEAD,GET,PUT,POST:*";
permission "java.net.URLPermission" "https://localhost:*/noOneThere/-",
"HEAD,GET,PUT,POST:*";
permission "java.net.URLPermission" "http://[::1]:*/noOneThere/-",
"HEAD,GET,PUT,POST:*";
@@ -292,4 +295,8 @@ grant {
grant {
permission jdk.jfr.FlightRecorderPermission "accessFlightRecorder";
+ // OtelRuntimeJvmMetrics opens a JFR recording stream for the JVM metrics
+ permission jdk.jfr.FlightRecorderPermission "registerEvent";
+ permission java.lang.RuntimePermission
"accessClassInPackage.jdk.jfr.internal.event";
+ permission java.lang.RuntimePermission
"accessClassInPackage.jdk.internal.event";
};
diff --git
a/solr/api/src/java/org/apache/solr/client/api/model/AddPackageVersionRequestBody.java
b/solr/api/src/java/org/apache/solr/client/api/model/AddPackageVersionRequestBody.java
index 3b077c110d3..38c452e1bb4 100644
---
a/solr/api/src/java/org/apache/solr/client/api/model/AddPackageVersionRequestBody.java
+++
b/solr/api/src/java/org/apache/solr/client/api/model/AddPackageVersionRequestBody.java
@@ -24,13 +24,15 @@ import java.util.List;
public class AddPackageVersionRequestBody {
@JsonProperty("version")
- @Schema(description = "The version string for this package version.",
required = true)
+ @Schema(
+ description = "The version string for this package version.",
+ requiredMode = Schema.RequiredMode.REQUIRED)
public String version;
@JsonProperty("files")
@Schema(
description = "File paths from the file store to include in this
version.",
- required = true)
+ requiredMode = Schema.RequiredMode.REQUIRED)
public List<String> files;
@JsonProperty("manifest")
diff --git
a/solr/api/src/java/org/apache/solr/client/api/model/AddReplicaPropertyRequestBody.java
b/solr/api/src/java/org/apache/solr/client/api/model/AddReplicaPropertyRequestBody.java
index 603524e4ad1..d4b929d64c2 100644
---
a/solr/api/src/java/org/apache/solr/client/api/model/AddReplicaPropertyRequestBody.java
+++
b/solr/api/src/java/org/apache/solr/client/api/model/AddReplicaPropertyRequestBody.java
@@ -27,7 +27,9 @@ public class AddReplicaPropertyRequestBody {
this.value = value;
}
- @Schema(description = "The value to assign to the property.", required =
true)
+ @Schema(
+ description = "The value to assign to the property.",
+ requiredMode = Schema.RequiredMode.REQUIRED)
@JsonProperty("value")
public String value;
diff --git
a/solr/api/src/java/org/apache/solr/client/api/model/RenameCoreRequestBody.java
b/solr/api/src/java/org/apache/solr/client/api/model/RenameCoreRequestBody.java
index 55037117fe8..888fc12d206 100644
---
a/solr/api/src/java/org/apache/solr/client/api/model/RenameCoreRequestBody.java
+++
b/solr/api/src/java/org/apache/solr/client/api/model/RenameCoreRequestBody.java
@@ -20,7 +20,9 @@ import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.v3.oas.annotations.media.Schema;
public class RenameCoreRequestBody {
- @Schema(description = "The new name for the Solr core.", required = true)
+ @Schema(
+ description = "The new name for the Solr core.",
+ requiredMode = Schema.RequiredMode.REQUIRED)
@JsonProperty
public String to;
diff --git
a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/HttpJdkSolrClient.java
b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/HttpJdkSolrClient.java
index 07f809e6002..06cf8bec325 100644
---
a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/HttpJdkSolrClient.java
+++
b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/HttpJdkSolrClient.java
@@ -473,6 +473,7 @@ public class HttpJdkSolrClient extends HttpSolrClient {
return headSucceeded;
}
+ @SuppressWarnings("deprecation") // getContext() has no replacement yet; see
SOLR-14720
private void decorateRequest(HttpRequest.Builder reqb, SolrRequest<?>
solrRequest) {
reqb.timeout(Duration.of(requestTimeoutMillis, ChronoUnit.MILLIS));
diff --git
a/solr/solrj/src/java/org/apache/solr/client/solrj/request/CollectionAdminRequest.java
b/solr/solrj/src/java/org/apache/solr/client/solrj/request/CollectionAdminRequest.java
index 79e6b870042..44cd6a1488f 100644
---
a/solr/solrj/src/java/org/apache/solr/client/solrj/request/CollectionAdminRequest.java
+++
b/solr/solrj/src/java/org/apache/solr/client/solrj/request/CollectionAdminRequest.java
@@ -261,6 +261,7 @@ public abstract class CollectionAdminRequest<T extends
CollectionAdminResponse>
}
@Override
+ @SuppressWarnings("deprecation") // the parameter itself is on its way
out; see SOLR-17712
public SolrParams getParams() {
ModifiableSolrParams params = new
ModifiableSolrParams(super.getParams());
if (asyncId != null) {
diff --git a/solr/solrj/src/resources/java-template/api.mustache
b/solr/solrj/src/resources/java-template/api.mustache
index b8c0dce8168..296bfd2b360 100644
--- a/solr/solrj/src/resources/java-template/api.mustache
+++ b/solr/solrj/src/resources/java-template/api.mustache
@@ -189,6 +189,8 @@ public class {{classname}} {
* @param {{name}} {{description}}
*/
{{/description}}
+ // the model field this writes to may itself be deprecated
+ @SuppressWarnings("deprecation")
public void {{setter}}({{{dataType}}} {{name}}) {
this.requestBody.{{name}} = {{name}};
}
diff --git
a/solr/solrj/src/test/org/apache/solr/client/solrj/SolrExampleTests.java
b/solr/solrj/src/test/org/apache/solr/client/solrj/SolrExampleTests.java
index ab0860f0b5e..a84449977d2 100644
--- a/solr/solrj/src/test/org/apache/solr/client/solrj/SolrExampleTests.java
+++ b/solr/solrj/src/test/org/apache/solr/client/solrj/SolrExampleTests.java
@@ -1155,6 +1155,7 @@ public abstract class SolrExampleTests extends
SolrExampleTestsBase {
}
@Test
+ @SuppressWarnings("deprecation") // covers the deprecated ping()
public void testPingHandler() throws Exception {
SolrClient client = getSolrClient();
diff --git
a/solr/solrj/src/test/org/apache/solr/client/solrj/embedded/TestSolrProperties.java
b/solr/solrj/src/test/org/apache/solr/client/solrj/embedded/TestSolrProperties.java
index 0c46c15fc50..79bd7633698 100644
---
a/solr/solrj/src/test/org/apache/solr/client/solrj/embedded/TestSolrProperties.java
+++
b/solr/solrj/src/test/org/apache/solr/client/solrj/embedded/TestSolrProperties.java
@@ -28,6 +28,7 @@ import org.apache.solr.util.ErrorLogMuter;
import org.junit.Test;
/** Test properties in configuration files. */
+@SuppressWarnings("deprecation") // the embedded base class is deprecated, not
this test
public class TestSolrProperties extends AbstractEmbeddedSolrServerTestCase {
@Test
diff --git
a/solr/solrj/src/test/org/apache/solr/client/solrj/impl/CloudHttp2SolrClientTest.java
b/solr/solrj/src/test/org/apache/solr/client/solrj/impl/CloudHttp2SolrClientTest.java
index fc9825b30ca..1981c46332b 100644
---
a/solr/solrj/src/test/org/apache/solr/client/solrj/impl/CloudHttp2SolrClientTest.java
+++
b/solr/solrj/src/test/org/apache/solr/client/solrj/impl/CloudHttp2SolrClientTest.java
@@ -389,7 +389,8 @@ public class CloudHttp2SolrClientTest extends
SolrCloudTestCase {
CollectionAdminRequest.createCollection(collection, "conf", 2,
1).process(client);
cluster.waitForActiveCollection(collection, 2, 2);
- DocCollection col = client.getClusterState().getCollection(collection);
+ DocCollection col =
+
client.getClusterStateProvider().getClusterState().getCollection(collection);
String shard1Url = col.getSlice("shard1").getLeader().getCoreUrl();
String shard2Url = col.getSlice("shard2").getLeader().getCoreUrl();
NamedList<NamedList<?>> routeResponses = new NamedList<>();
@@ -482,7 +483,7 @@ public class CloudHttp2SolrClientTest extends
SolrCloudTestCase {
// Test that queries with _route_ params are routed by the client
// Track request counts on each node before query calls
- ClusterState clusterState = cluster.getSolrClient().getClusterState();
+ ClusterState clusterState =
cluster.getSolrClient().getClusterStateProvider().getClusterState();
DocCollection col = clusterState.getCollection("routing_collection");
Map<String, Double> requestCountsMap = new HashMap<>();
for (Slice slice : col.getSlices()) {
@@ -853,7 +854,12 @@ public class CloudHttp2SolrClientTest extends
SolrCloudTestCase {
.process(cluster.getSolrClient());
cluster.waitForActiveCollection(COLLECTION, 2, 2);
- DocCollection coll =
cluster.getSolrClient().getClusterState().getCollection(COLLECTION);
+ DocCollection coll =
+ cluster
+ .getSolrClient()
+ .getClusterStateProvider()
+ .getClusterState()
+ .getCollection(COLLECTION);
Replica r =
coll.getSlices().iterator().next().getReplicas().iterator().next();
SolrQuery q = new SolrQuery().setQuery("*:*");
@@ -896,7 +902,8 @@ public class CloudHttp2SolrClientTest extends
SolrCloudTestCase {
}
}
String theNode = null;
- Set<String> liveNodes =
cluster.getSolrClient().getClusterState().getLiveNodes();
+ Set<String> liveNodes =
+
cluster.getSolrClient().getClusterStateProvider().getClusterState().getLiveNodes();
for (String s : liveNodes) {
String n = cluster.getZkStateReader().getBaseUrlForNodeName(s);
if (!allNodesOfColl.contains(n)) {
@@ -1069,7 +1076,12 @@ public class CloudHttp2SolrClientTest extends
SolrCloudTestCase {
// determine the coreNodeName of only current replica
Collection<Slice> slices =
-
cluster.getSolrClient().getClusterState().getCollection(COL).getSlices();
+ cluster
+ .getSolrClient()
+ .getClusterStateProvider()
+ .getClusterState()
+ .getCollection(COL)
+ .getSlices();
assertEquals(1, slices.size()); // sanity check
Slice slice = slices.iterator().next();
assertEquals(1, slice.getReplicas().size()); // sanity check
@@ -1125,7 +1137,12 @@ public class CloudHttp2SolrClientTest extends
SolrCloudTestCase {
/** Asserts that each doc is on the leader of the shard it routes to,
querying that core alone. */
private static void assertDocsOnShardLeaders(String collection, String...
ids) throws Exception {
- DocCollection col =
cluster.getSolrClient().getClusterState().getCollection(collection);
+ DocCollection col =
+ cluster
+ .getSolrClient()
+ .getClusterStateProvider()
+ .getClusterState()
+ .getCollection(collection);
for (String id : ids) {
String coreUrl =
col.getRouter().getTargetSlice(id, null, null, null,
col).getLeader().getCoreUrl();
@@ -1144,7 +1161,11 @@ public class CloudHttp2SolrClientTest extends
SolrCloudTestCase {
NamedList<?> rfByRoute = (NamedList<?>)
header.get(CloudSolrClient.REPFACT_BY_ROUTE);
assertNotNull("no per-route rf in " + header, rfByRoute);
DocCollection col =
-
cluster.getSolrClient().getClusterState().getCollection("routing_collection");
+ cluster
+ .getSolrClient()
+ .getClusterStateProvider()
+ .getClusterState()
+ .getCollection("routing_collection");
Set<String> leaderUrls = new HashSet<>();
for (Slice slice : col.getSlices()) {
leaderUrls.add(slice.getLeader().getCoreUrl());
@@ -1263,6 +1284,7 @@ public class CloudHttp2SolrClientTest extends
SolrCloudTestCase {
}
@Test
+ @SuppressWarnings("deprecation") // covers the deprecated ping()
public void testPing() throws Exception {
final String testCollection = "ping_test";
CollectionAdminRequest.createCollection(testCollection, "conf", 2, 1)
@@ -1275,6 +1297,7 @@ public class CloudHttp2SolrClientTest extends
SolrCloudTestCase {
assertEquals("This should be OK", 0, response.getStatus());
}
+ @SuppressWarnings("deprecation") // covers the deprecated ping()
public void testPerReplicaStateCollection() throws Exception {
String collection = getSaferTestName();
diff --git
a/solr/solrj/src/test/org/apache/solr/client/solrj/impl/HttpJdkSolrClientTest.java
b/solr/solrj/src/test/org/apache/solr/client/solrj/impl/HttpJdkSolrClientTest.java
index 9f9233f375e..abfb6b2d123 100644
---
a/solr/solrj/src/test/org/apache/solr/client/solrj/impl/HttpJdkSolrClientTest.java
+++
b/solr/solrj/src/test/org/apache/solr/client/solrj/impl/HttpJdkSolrClientTest.java
@@ -615,6 +615,7 @@ public class HttpJdkSolrClientTest extends
HttpSolrClientTestBase {
}
@Test
+ @SuppressWarnings("deprecation") // covers the deprecated ping()
public void testPing() throws Exception {
try (HttpJdkSolrClient client =
builder(solrTestRule.getBaseUrl()).build()) {
SolrPingResponse spr = client.ping("collection1");
diff --git
a/solr/solrj/src/test/org/apache/solr/client/solrj/impl/SendUpdatesToLeadersOverrideTest.java
b/solr/solrj/src/test/org/apache/solr/client/solrj/impl/SendUpdatesToLeadersOverrideTest.java
index 08f3367edcc..ba2117fdb3a 100644
---
a/solr/solrj/src/test/org/apache/solr/client/solrj/impl/SendUpdatesToLeadersOverrideTest.java
+++
b/solr/solrj/src/test/org/apache/solr/client/solrj/impl/SendUpdatesToLeadersOverrideTest.java
@@ -19,7 +19,7 @@ package org.apache.solr.client.solrj.impl;
import static org.hamcrest.Matchers.everyItem;
import static org.hamcrest.Matchers.hasSize;
-import static org.hamcrest.Matchers.isIn;
+import static org.hamcrest.Matchers.in;
import static org.hamcrest.Matchers.not;
import java.lang.invoke.MethodHandles;
@@ -94,6 +94,7 @@ public class SendUpdatesToLeadersOverrideTest extends
SolrCloudTestCase {
final List<Replica> allReplicas =
cluster
.getSolrClient()
+ .getClusterStateProvider()
.getClusterState()
.getCollection(COLLECTION_NAME)
.replicaStream()
@@ -194,7 +195,7 @@ public class SendUpdatesToLeadersOverrideTest extends
SolrCloudTestCase {
assertThat(
"post-distrib should never be PULL replica",
results.postDistribCores.keySet(),
- everyItem(not(isIn(PULL_REPLICA_CORE_NAMES))));
+ everyItem(not(in(PULL_REPLICA_CORE_NAMES))));
return results;
}
@@ -252,7 +253,7 @@ public class SendUpdatesToLeadersOverrideTest extends
SolrCloudTestCase {
assertThat(
"add pre-distrib must be leader",
add.preDistribCores.keySet(),
- everyItem(isIn(LEADER_CORE_NAMES)));
+ everyItem(in(LEADER_CORE_NAMES)));
assertEquals(
"add pre and post should match",
add.preDistribCores.keySet(),
@@ -286,7 +287,7 @@ public class SendUpdatesToLeadersOverrideTest extends
SolrCloudTestCase {
assertThat(
"dbq pre-distrib must be leader",
record.preDistribCores.keySet(),
- everyItem(isIn(LEADER_CORE_NAMES)));
+ everyItem(in(LEADER_CORE_NAMES)));
assertThat("dbq pre-distrib size", record.preDistribRequests.keySet(),
hasSize(1));
assertThat("dbq pre-distrib size", record.preDistribCommands,
hasSize(1));
@@ -315,7 +316,7 @@ public class SendUpdatesToLeadersOverrideTest extends
SolrCloudTestCase {
assertThat(
"multi pre-distrib must be leaders",
record.preDistribCores.keySet(),
- everyItem(isIn(LEADER_CORE_NAMES)));
+ everyItem(in(LEADER_CORE_NAMES)));
assertThat(
"multi pre-distrib req != pre-distrib num cores",
record.preDistribRequests.keySet(),
@@ -356,7 +357,7 @@ public class SendUpdatesToLeadersOverrideTest extends
SolrCloudTestCase {
assertThat(
"add pre-distrib must be PULL",
add.preDistribCores.keySet(),
- everyItem(isIn(PULL_REPLICA_CORE_NAMES)));
+ everyItem(in(PULL_REPLICA_CORE_NAMES)));
assertThat("add pre-distrib size", add.preDistribRequests.keySet(),
hasSize(1));
assertThat("add pre-distrib size", add.preDistribCommands, hasSize(1));
@@ -365,7 +366,7 @@ public class SendUpdatesToLeadersOverrideTest extends
SolrCloudTestCase {
assertThat(
"add post-distrib must be leader",
add.postDistribCores.keySet(),
- everyItem(isIn(LEADER_CORE_NAMES)));
+ everyItem(in(LEADER_CORE_NAMES)));
assertThat("add post-distrib size", add.postDistribRequests.keySet(),
hasSize(1));
assertThat("add post-distrib size", add.postDistribCommands, hasSize(1));
@@ -378,7 +379,7 @@ public class SendUpdatesToLeadersOverrideTest extends
SolrCloudTestCase {
assertThat(
"del pre-distrib must be PULL",
del.preDistribCores.keySet(),
- everyItem(isIn(PULL_REPLICA_CORE_NAMES)));
+ everyItem(in(PULL_REPLICA_CORE_NAMES)));
assertThat("del pre-distrib size", del.preDistribRequests.keySet(),
hasSize(1));
assertThat("del pre-distrib size", del.preDistribCommands, hasSize(1));
@@ -398,7 +399,7 @@ public class SendUpdatesToLeadersOverrideTest extends
SolrCloudTestCase {
assertThat(
"dbq pre-distrib must be PULL",
record.preDistribCores.keySet(),
- everyItem(isIn(PULL_REPLICA_CORE_NAMES)));
+ everyItem(in(PULL_REPLICA_CORE_NAMES)));
assertThat("dbq pre-distrib size", record.preDistribRequests.keySet(),
hasSize(1));
assertThat("dbq pre-distrib size", record.preDistribCommands,
hasSize(1));
@@ -425,7 +426,7 @@ public class SendUpdatesToLeadersOverrideTest extends
SolrCloudTestCase {
assertThat(
"multi pre-distrib must be PULL",
record.preDistribCores.keySet(),
- everyItem(isIn(PULL_REPLICA_CORE_NAMES)));
+ everyItem(in(PULL_REPLICA_CORE_NAMES)));
assertThat("multi pre-distrib req size",
record.preDistribRequests.keySet(), hasSize(1));
assertThat("multi pre-distrib command size", record.preDistribCommands,
hasSize(100 + 10));
@@ -440,7 +441,7 @@ public class SendUpdatesToLeadersOverrideTest extends
SolrCloudTestCase {
assertThat(
"multi post-distrib cores",
record.postDistribCores.keySet(),
- everyItem(isIn(LEADER_CORE_NAMES)));
+ everyItem(in(LEADER_CORE_NAMES)));
assertThat("multi post-distrib command size",
record.postDistribCommands, hasSize(100 + 10));
}
}
@@ -462,7 +463,7 @@ public class SendUpdatesToLeadersOverrideTest extends
SolrCloudTestCase {
assertThat(
"add pre-distrib must be PULL",
add.preDistribCores.keySet(),
- everyItem(isIn(PULL_REPLICA_CORE_NAMES)));
+ everyItem(in(PULL_REPLICA_CORE_NAMES)));
assertThat("add pre-distrib size", add.preDistribRequests.keySet(),
hasSize(1));
assertThat("add pre-distrib size", add.preDistribCommands, hasSize(1));
@@ -471,7 +472,7 @@ public class SendUpdatesToLeadersOverrideTest extends
SolrCloudTestCase {
assertThat(
"add post-distrib must be leader",
add.postDistribCores.keySet(),
- everyItem(isIn(LEADER_CORE_NAMES)));
+ everyItem(in(LEADER_CORE_NAMES)));
assertThat("add post-distrib size", add.postDistribRequests.keySet(),
hasSize(1));
assertThat("add post-distrib size", add.postDistribCommands, hasSize(1));
@@ -485,7 +486,7 @@ public class SendUpdatesToLeadersOverrideTest extends
SolrCloudTestCase {
assertThat(
"del pre-distrib must be PULL",
del.preDistribCores.keySet(),
- everyItem(isIn(PULL_REPLICA_CORE_NAMES)));
+ everyItem(in(PULL_REPLICA_CORE_NAMES)));
assertThat("del pre-distrib size", del.preDistribRequests.keySet(),
hasSize(1));
assertThat("del pre-distrib size", del.preDistribCommands, hasSize(1));
@@ -506,7 +507,7 @@ public class SendUpdatesToLeadersOverrideTest extends
SolrCloudTestCase {
assertThat(
"dbq pre-distrib must be PULL",
record.preDistribCores.keySet(),
- everyItem(isIn(PULL_REPLICA_CORE_NAMES)));
+ everyItem(in(PULL_REPLICA_CORE_NAMES)));
assertThat("dbq pre-distrib size", record.preDistribRequests.keySet(),
hasSize(1));
assertThat("dbq pre-distrib size", record.preDistribCommands,
hasSize(1));
@@ -534,7 +535,7 @@ public class SendUpdatesToLeadersOverrideTest extends
SolrCloudTestCase {
assertThat(
"multi pre-distrib must be PULL",
record.preDistribCores.keySet(),
- everyItem(isIn(PULL_REPLICA_CORE_NAMES)));
+ everyItem(in(PULL_REPLICA_CORE_NAMES)));
assertThat("multi pre-distrib req size",
record.preDistribRequests.keySet(), hasSize(1));
assertThat("multi pre-distrib command size", record.preDistribCommands,
hasSize(100 + 10));
@@ -549,7 +550,7 @@ public class SendUpdatesToLeadersOverrideTest extends
SolrCloudTestCase {
assertThat(
"multi post-distrib cores",
record.postDistribCores.keySet(),
- everyItem(isIn(LEADER_CORE_NAMES)));
+ everyItem(in(LEADER_CORE_NAMES)));
assertThat("multi post-distrib command size",
record.postDistribCommands, hasSize(100 + 10));
}
}
diff --git
a/solr/solrj/src/test/org/apache/solr/client/solrj/request/QueryRequestTest.java
b/solr/solrj/src/test/org/apache/solr/client/solrj/request/QueryRequestTest.java
index dfc314c2e8c..a40b2d59ed1 100644
---
a/solr/solrj/src/test/org/apache/solr/client/solrj/request/QueryRequestTest.java
+++
b/solr/solrj/src/test/org/apache/solr/client/solrj/request/QueryRequestTest.java
@@ -20,6 +20,7 @@ import org.apache.solr.SolrTestCase;
import org.apache.solr.client.solrj.SolrRequest;
import org.junit.Test;
+@SuppressWarnings("deprecation") // covers the deprecated
SolrQuery.setRequestHandler
public class QueryRequestTest extends SolrTestCase {
@Test
diff --git
a/solr/solrj/src/test/org/apache/solr/client/solrj/request/SchemaTest.java
b/solr/solrj/src/test/org/apache/solr/client/solrj/request/SchemaTest.java
index cf50479bd43..c18f9f48158 100644
--- a/solr/solrj/src/test/org/apache/solr/client/solrj/request/SchemaTest.java
+++ b/solr/solrj/src/test/org/apache/solr/client/solrj/request/SchemaTest.java
@@ -104,6 +104,7 @@ public class SchemaTest extends RestTestBase {
}
@After
+ @SuppressWarnings("deprecation") // no replacement for
SolrJettyTestRule.reset() yet
public void cleanup() throws Exception {
solrTestRule.reset();
}
diff --git
a/solr/solrj/src/test/org/apache/solr/client/solrj/request/SolrPingTest.java
b/solr/solrj/src/test/org/apache/solr/client/solrj/request/SolrPingTest.java
index 721a9492539..a7757a3a2be 100644
--- a/solr/solrj/src/test/org/apache/solr/client/solrj/request/SolrPingTest.java
+++ b/solr/solrj/src/test/org/apache/solr/client/solrj/request/SolrPingTest.java
@@ -29,6 +29,7 @@ import org.junit.ClassRule;
import org.junit.Test;
/** Test SolrPing in Solrj */
+@SuppressWarnings("deprecation") // this suite exists to cover the deprecated
SolrPing
public class SolrPingTest extends SolrTestCase {
@ClassRule
diff --git
a/solr/solrj/src/test/org/apache/solr/client/solrj/request/SolrQueryTest.java
b/solr/solrj/src/test/org/apache/solr/client/solrj/request/SolrQueryTest.java
index 3621b697d7d..1c86d6cc9e3 100644
---
a/solr/solrj/src/test/org/apache/solr/client/solrj/request/SolrQueryTest.java
+++
b/solr/solrj/src/test/org/apache/solr/client/solrj/request/SolrQueryTest.java
@@ -308,6 +308,7 @@ public class SolrQueryTest extends SolrTestCase {
assertEquals("+1MONTH", q.get("f.field." + FacetParams.FACET_RANGE_GAP));
}
+ @SuppressWarnings("deprecation") // covers the deprecated requestHandler
accessors too
public void testSettersGetters() {
SolrQuery q = new SolrQuery("foo");
assertEquals(10, q.setFacetLimit(10).getFacetLimit());
diff --git
a/solr/solrj/src/test/org/apache/solr/client/solrj/request/TestConfigSetAdminRequest.java
b/solr/solrj/src/test/org/apache/solr/client/solrj/request/TestConfigSetAdminRequest.java
index 51c5a7bc5ee..bfbbfa0acb9 100644
---
a/solr/solrj/src/test/org/apache/solr/client/solrj/request/TestConfigSetAdminRequest.java
+++
b/solr/solrj/src/test/org/apache/solr/client/solrj/request/TestConfigSetAdminRequest.java
@@ -92,6 +92,7 @@ public class TestConfigSetAdminRequest extends SolrTestCaseJ4
{
private static class MyConfigSetAdminRequest
extends ConfigSetAdminRequest<MyConfigSetAdminRequest,
ConfigSetAdminResponse> {
+ @SuppressWarnings("deprecation") // the no-arg super constructor is
deprecated
public MyConfigSetAdminRequest() {}
@Override
diff --git
a/solr/solrj/src/test/org/apache/solr/client/solrj/request/TestCoreAdmin.java
b/solr/solrj/src/test/org/apache/solr/client/solrj/request/TestCoreAdmin.java
index 45198ba422c..83eb5149ab7 100644
---
a/solr/solrj/src/test/org/apache/solr/client/solrj/request/TestCoreAdmin.java
+++
b/solr/solrj/src/test/org/apache/solr/client/solrj/request/TestCoreAdmin.java
@@ -41,6 +41,7 @@ import org.apache.solr.core.CoreContainer;
import org.apache.solr.core.SolrCore;
import org.junit.Test;
+@SuppressWarnings("deprecation") // the embedded base class is deprecated, not
this test
public class TestCoreAdmin extends AbstractEmbeddedSolrServerTestCase {
@Test
diff --git
a/solr/solrj/src/test/org/apache/solr/client/solrj/request/TestV2Request.java
b/solr/solrj/src/test/org/apache/solr/client/solrj/request/TestV2Request.java
index aebadc76a42..c26e551a5bf 100644
---
a/solr/solrj/src/test/org/apache/solr/client/solrj/request/TestV2Request.java
+++
b/solr/solrj/src/test/org/apache/solr/client/solrj/request/TestV2Request.java
@@ -138,7 +138,7 @@ public class TestV2Request extends SolrCloudTestCase {
+ "}")
.build());
- ClusterState cs = cluster.getSolrClient().getClusterState();
+ ClusterState cs =
cluster.getSolrClient().getClusterStateProvider().getClusterState();
System.out.println("livenodes: " + cs.getLiveNodes());
String[] node = new String[1];
diff --git
a/solr/solrj/src/test/org/apache/solr/client/solrj/response/TermsResponseTest.java
b/solr/solrj/src/test/org/apache/solr/client/solrj/response/TermsResponseTest.java
index a299ecb4e18..decea3e166f 100644
---
a/solr/solrj/src/test/org/apache/solr/client/solrj/response/TermsResponseTest.java
+++
b/solr/solrj/src/test/org/apache/solr/client/solrj/response/TermsResponseTest.java
@@ -50,6 +50,7 @@ public class TermsResponseTest extends SolrTestCase {
}
@Test
+ @SuppressWarnings("deprecation") // SolrQuery.setRequestHandler is deprecated
public void testTermsResponse() throws Exception {
SolrInputDocument doc = new SolrInputDocument();
doc.setField("id", 1);
diff --git
a/solr/solrj/src/test/org/apache/solr/common/cloud/PerReplicaStatesIntegrationTest.java
b/solr/solrj/src/test/org/apache/solr/common/cloud/PerReplicaStatesIntegrationTest.java
index 009857689d1..f3ccd7f2b1e 100644
---
a/solr/solrj/src/test/org/apache/solr/common/cloud/PerReplicaStatesIntegrationTest.java
+++
b/solr/solrj/src/test/org/apache/solr/common/cloud/PerReplicaStatesIntegrationTest.java
@@ -56,6 +56,7 @@ public class PerReplicaStatesIntegrationTest extends
SolrCloudTestCase {
private static final Logger log =
LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
+ @SuppressWarnings("deprecation") // covers the deprecated ping()
public void testPerReplicaStateCollection() throws Exception {
String testCollection = "perReplicaState_test";