Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

SOLR-16223: Don't declare Exceptions that aren't Thrown (#885)

Eric Pughe8437d6616d8
diff --git a/solr/core/src/test/org/apache/solr/DisMaxRequestHandlerTest.java b/solr/core/src/test/org/apache/solr/DisMaxRequestHandlerTest.java
index 3c16be19704..15b5045749a 100644
--- a/solr/core/src/test/org/apache/solr/DisMaxRequestHandlerTest.java
+++ b/solr/core/src/test/org/apache/solr/DisMaxRequestHandlerTest.java
@@ -104,11 +104,11 @@ public class DisMaxRequestHandlerTest extends SolrTestCaseJ4 {
}
@Test
- public void testSomeStuff() throws Exception {
+ public void testSomeStuff() {
doTestSomeStuff("/dismax");
}
- public void doTestSomeStuff(final String qt) throws Exception {
+ public void doTestSomeStuff(final String qt) {
assertQ(
"basic match",
diff --git a/solr/core/src/test/org/apache/solr/SolrTestCaseJ4Test.java b/solr/core/src/test/org/apache/solr/SolrTestCaseJ4Test.java
index d281eb7c48c..07a375870f9 100644
--- a/solr/core/src/test/org/apache/solr/SolrTestCaseJ4Test.java
+++ b/solr/core/src/test/org/apache/solr/SolrTestCaseJ4Test.java
@@ -58,7 +58,7 @@ public class SolrTestCaseJ4Test extends SolrTestCaseJ4 {
public static void AfterClass() throws Exception {}
@Test
- public void testCorrectCore() throws Exception {
+ public void testCorrectCore() {
assertEquals("should be core1", "core1", h.getCore().getName());
}
diff --git a/solr/core/src/test/org/apache/solr/TestCursorMarkWithoutUniqueKey.java b/solr/core/src/test/org/apache/solr/TestCursorMarkWithoutUniqueKey.java
index 1c0638d3a9b..88d4925c7e2 100644
--- a/solr/core/src/test/org/apache/solr/TestCursorMarkWithoutUniqueKey.java
+++ b/solr/core/src/test/org/apache/solr/TestCursorMarkWithoutUniqueKey.java
@@ -43,7 +43,7 @@ public class TestCursorMarkWithoutUniqueKey extends SolrTestCaseJ4 {
}
@After
- public void afterDestroyCore() throws Exception {
+ public void afterDestroyCore() {
deleteCore();
}
diff --git a/solr/core/src/test/org/apache/solr/TestDocumentBuilder.java b/solr/core/src/test/org/apache/solr/TestDocumentBuilder.java
index a0cdf24de2e..e68f32ec724 100644
--- a/solr/core/src/test/org/apache/solr/TestDocumentBuilder.java
+++ b/solr/core/src/test/org/apache/solr/TestDocumentBuilder.java
@@ -16,7 +16,6 @@
*/
package org.apache.solr;
-import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
@@ -27,7 +26,7 @@ import org.junit.Test;
public class TestDocumentBuilder extends SolrTestCase {
@Test
- public void testDeepCopy() throws IOException {
+ public void testDeepCopy() {
SolrInputDocument doc = new SolrInputDocument();
doc.addField("field1", "value1");
doc.addField("field2", "value1");
diff --git a/solr/core/src/test/org/apache/solr/TestJoin.java b/solr/core/src/test/org/apache/solr/TestJoin.java
index f966a69bb09..9f8b78cc60d 100644
--- a/solr/core/src/test/org/apache/solr/TestJoin.java
+++ b/solr/core/src/test/org/apache/solr/TestJoin.java
@@ -249,7 +249,7 @@ public class TestJoin extends SolrTestCaseJ4 {
* Exercises behavior specific to method=topLevel join queries
*/
@Test
- public void testTopLevelDVJoin() throws Exception {
+ public void testTopLevelDVJoin() {
indexEmployeeDocs();
ModifiableSolrParams p = params("sort", "id asc");
diff --git a/solr/core/src/test/org/apache/solr/TestRandomFaceting.java b/solr/core/src/test/org/apache/solr/TestRandomFaceting.java
index 7cf341ea2e8..778a8854de5 100644
--- a/solr/core/src/test/org/apache/solr/TestRandomFaceting.java
+++ b/solr/core/src/test/org/apache/solr/TestRandomFaceting.java
@@ -16,7 +16,6 @@
*/
package org.apache.solr;
-import java.io.IOException;
import java.lang.invoke.MethodHandles;
import java.util.ArrayList;
import java.util.Arrays;
@@ -466,7 +465,7 @@ public class TestRandomFaceting extends SolrTestCaseJ4 {
"facet_heatmaps":{}}}
* */
@SuppressWarnings({"rawtypes", "unchecked"})
- private String capFacetCountsTo1(String expected) throws IOException {
+ private String capFacetCountsTo1(String expected) {
return transformFacetFields(
expected,
e -> {
@@ -482,8 +481,8 @@ public class TestRandomFaceting extends SolrTestCaseJ4 {
}
@SuppressWarnings({"unchecked"})
- private String transformFacetFields(String expected, Consumer<Map.Entry<Object, Object>> consumer)
- throws IOException {
+ private String transformFacetFields(
+ String expected, Consumer<Map.Entry<Object, Object>> consumer) {
Object json = Utils.fromJSONString(expected);
@SuppressWarnings({"rawtypes"})
Map facet_fields = getFacetFieldMap(json);
diff --git a/solr/core/src/test/org/apache/solr/TestTrie.java b/solr/core/src/test/org/apache/solr/TestTrie.java
index 6e69532fb67..ad1bd21f15a 100644
--- a/solr/core/src/test/org/apache/solr/TestTrie.java
+++ b/solr/core/src/test/org/apache/solr/TestTrie.java
@@ -49,7 +49,7 @@ public class TestTrie extends SolrTestCaseJ4 {
}
@Test
- public void testTrieIntRangeSearch() throws Exception {
+ public void testTrieIntRangeSearch() {
for (int i = 0; i < 10; i++) {
assertU(adoc("id", String.valueOf(i), "tint", String.valueOf(i)));
}
@@ -102,7 +102,7 @@ public class TestTrie extends SolrTestCaseJ4 {
}
@Test
- public void testTrieTermQuery() throws Exception {
+ public void testTrieTermQuery() {
for (int i = 0; i < 10; i++) {
assertU(
adoc(
@@ -157,7 +157,7 @@ public class TestTrie extends SolrTestCaseJ4 {
}
@Test
- public void testTrieFloatRangeSearch() throws Exception {
+ public void testTrieFloatRangeSearch() {
for (int i = 0; i < 10; i++) {
assertU(adoc("id", String.valueOf(i), "tfloat", String.valueOf(i * i * 31.11f)));
}
@@ -188,7 +188,7 @@ public class TestTrie extends SolrTestCaseJ4 {
}
@Test
- public void testTrieLongRangeSearch() throws Exception {
+ public void testTrieLongRangeSearch() {
for (long i = Integer.MAX_VALUE, c = 0; i < (long) Integer.MAX_VALUE + 10l; i++) {
assertU(adoc("id", String.valueOf(c++), "tlong", String.valueOf(i)));
}
@@ -222,7 +222,7 @@ public class TestTrie extends SolrTestCaseJ4 {
}
@Test
- public void testTrieDoubleRangeSearch() throws Exception {
+ public void testTrieDoubleRangeSearch() {
for (long i = Integer.MAX_VALUE, c = 0; i < (long) Integer.MAX_VALUE + 10l; i++) {
assertU(adoc("id", String.valueOf(c++), "tdouble", String.valueOf(i * 2.33d)));
}
@@ -342,7 +342,7 @@ public class TestTrie extends SolrTestCaseJ4 {
}
@Test
- public void testTrieDoubleRangeSearch_CustomPrecisionStep() throws Exception {
+ public void testTrieDoubleRangeSearch_CustomPrecisionStep() {
for (long i = Integer.MAX_VALUE, c = 0; i < (long) Integer.MAX_VALUE + 10l; i++) {
assertU(adoc("id", String.valueOf(c++), "tdouble4", String.valueOf(i * 2.33d)));
}
diff --git a/solr/core/src/test/org/apache/solr/analysis/CommonGramsPhraseQueryTest.java b/solr/core/src/test/org/apache/solr/analysis/CommonGramsPhraseQueryTest.java
index e20ed9cc1b5..f6fdbf3ff45 100644
--- a/solr/core/src/test/org/apache/solr/analysis/CommonGramsPhraseQueryTest.java
+++ b/solr/core/src/test/org/apache/solr/analysis/CommonGramsPhraseQueryTest.java
@@ -76,7 +76,7 @@ public class CommonGramsPhraseQueryTest extends SolrTestCaseJ4 {
}
}
- protected void testCommonQueries(final String f) throws Exception {
+ protected void testCommonQueries(final String f) {
// match 2...
for (String phrase :
Arrays.asList(
diff --git a/solr/core/src/test/org/apache/solr/analysis/PathHierarchyTokenizerFactoryTest.java b/solr/core/src/test/org/apache/solr/analysis/PathHierarchyTokenizerFactoryTest.java
index b7eb893a5c5..7b1345261ab 100644
--- a/solr/core/src/test/org/apache/solr/analysis/PathHierarchyTokenizerFactoryTest.java
+++ b/solr/core/src/test/org/apache/solr/analysis/PathHierarchyTokenizerFactoryTest.java
@@ -65,7 +65,7 @@ public class PathHierarchyTokenizerFactoryTest extends SolrTestCaseJ4 {
assertU(commit());
}
- public void testDescendents() throws Exception {
+ public void testDescendents() {
assertQ(
req("{!field f=cat_path}Books/NonFic"),
diff --git a/solr/core/src/test/org/apache/solr/analysis/TestLuceneMatchVersion.java b/solr/core/src/test/org/apache/solr/analysis/TestLuceneMatchVersion.java
index 09e567d55fe..ebf6126f632 100644
--- a/solr/core/src/test/org/apache/solr/analysis/TestLuceneMatchVersion.java
+++ b/solr/core/src/test/org/apache/solr/analysis/TestLuceneMatchVersion.java
@@ -37,7 +37,7 @@ public class TestLuceneMatchVersion extends SolrTestCaseJ4 {
public static final Version DEFAULT_VERSION =
SolrConfig.parseLuceneVersionString(System.getProperty("tests.luceneMatchVersion", "LATEST"));
- public void testStandardTokenizerVersions() throws Exception {
+ public void testStandardTokenizerVersions() {
assertEquals(DEFAULT_VERSION, solrConfig.luceneMatchVersion);
final IndexSchema schema = h.getCore().getLatestSchema();
diff --git a/solr/core/src/test/org/apache/solr/analysis/TestReversedWildcardFilterFactory.java b/solr/core/src/test/org/apache/solr/analysis/TestReversedWildcardFilterFactory.java
index 8746113ec8d..3ae87e23b11 100644
--- a/solr/core/src/test/org/apache/solr/analysis/TestReversedWildcardFilterFactory.java
+++ b/solr/core/src/test/org/apache/solr/analysis/TestReversedWildcardFilterFactory.java
@@ -32,7 +32,6 @@ import org.apache.lucene.search.Query;
import org.apache.lucene.util.automaton.Automaton;
import org.apache.lucene.util.automaton.Operations;
import org.apache.solr.SolrTestCaseJ4;
-import org.apache.solr.parser.ParseException;
import org.apache.solr.parser.SolrQueryParserBase;
import org.apache.solr.request.SolrQueryRequest;
import org.apache.solr.schema.FieldType;
@@ -40,7 +39,6 @@ import org.apache.solr.schema.IndexSchema;
import org.apache.solr.schema.IndexSchemaFactory;
import org.apache.solr.search.QParser;
import org.apache.solr.search.SolrQueryParser;
-import org.apache.solr.search.SyntaxError;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -175,7 +173,7 @@ public class TestReversedWildcardFilterFactory extends SolrTestCaseJ4 {
}
@Test
- public void testFalsePositives() throws Exception {
+ public void testFalsePositives() {
// add a doc
assertU(adoc("id", "1", "one", "gomez", "two", "gomez", "three", "gomez"));
assertU(commit());
@@ -203,7 +201,7 @@ public class TestReversedWildcardFilterFactory extends SolrTestCaseJ4 {
private static final class SolrQParser extends SolrQueryParserBase {
@Override
- public Query TopLevelQuery(String field) throws ParseException, SyntaxError {
+ public Query TopLevelQuery(String field) {
return null;
}
diff --git a/solr/core/src/test/org/apache/solr/analysis/TokenizerChainTest.java b/solr/core/src/test/org/apache/solr/analysis/TokenizerChainTest.java
index 5dad20e003b..5a8cc2bf656 100644
--- a/solr/core/src/test/org/apache/solr/analysis/TokenizerChainTest.java
+++ b/solr/core/src/test/org/apache/solr/analysis/TokenizerChainTest.java
@@ -27,7 +27,7 @@ import org.junit.Test;
public class TokenizerChainTest extends SolrTestCaseJ4 {
@Test
- public void testNormalization() throws Exception {
+ public void testNormalization() {
String fieldName = "f";
TokenFilterFactory[] tff = new TokenFilterFactory[2];
tff[0] = new LowerCaseFilterFactory(Collections.emptyMap());
diff --git a/solr/core/src/test/org/apache/solr/client/solrj/embedded/TestJettySolrRunner.java b/solr/core/src/test/org/apache/solr/client/solrj/embedded/TestJettySolrRunner.java
index e5e0ee4716e..4df108fb422 100644
--- a/solr/core/src/test/org/apache/solr/client/solrj/embedded/TestJettySolrRunner.java
+++ b/solr/core/src/test/org/apache/solr/client/solrj/embedded/TestJettySolrRunner.java
@@ -70,7 +70,6 @@ public class TestJettySolrRunner extends SolrTestCaseJ4 {
}
}
- @SuppressWarnings("ThrowableNotThrown")
@Test
public void testLookForBindException() throws IOException {
Path solrHome = createTempDir();
diff --git a/solr/core/src/test/org/apache/solr/cloud/ActionThrottleTest.java b/solr/core/src/test/org/apache/solr/cloud/ActionThrottleTest.java
index 984d1b8e4a7..77e2dce5d08 100644
--- a/solr/core/src/test/org/apache/solr/cloud/ActionThrottleTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/ActionThrottleTest.java
@@ -100,7 +100,7 @@ public class ActionThrottleTest extends SolrTestCaseJ4 {
}
@Test
- public void testAZeroNanoTimeReturnInWait() throws Exception {
+ public void testAZeroNanoTimeReturnInWait() {
ActionThrottle at =
new ActionThrottle(
@@ -117,7 +117,7 @@ public class ActionThrottleTest extends SolrTestCaseJ4 {
assertTrue(elaspsedTime + "ms", elaspsedTime >= 995);
}
- public void testCreateNewThrottleWithLastValue() throws Exception {
+ public void testCreateNewThrottleWithLastValue() {
ActionThrottle throttle =
new ActionThrottle(
"xyz", 1000, new TestNanoTimeSource(Arrays.asList(new Long[] {10L, 20L})));
diff --git a/solr/core/src/test/org/apache/solr/cloud/AssignBackwardCompatibilityTest.java b/solr/core/src/test/org/apache/solr/cloud/AssignBackwardCompatibilityTest.java
index ab0f4be3c9c..0587fada196 100644
--- a/solr/core/src/test/org/apache/solr/cloud/AssignBackwardCompatibilityTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/AssignBackwardCompatibilityTest.java
@@ -110,7 +110,7 @@ public class AssignBackwardCompatibilityTest extends SolrCloudTestCase {
}
}
- private int getCounter() throws KeeperException, InterruptedException {
+ private int getCounter() throws InterruptedException {
try {
byte[] data =
cluster
diff --git a/solr/core/src/test/org/apache/solr/cloud/ChaosMonkeyShardSplitTest.java b/solr/core/src/test/org/apache/solr/cloud/ChaosMonkeyShardSplitTest.java
index ed3156d8750..2febbc6a0aa 100644
--- a/solr/core/src/test/org/apache/solr/cloud/ChaosMonkeyShardSplitTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/ChaosMonkeyShardSplitTest.java
@@ -16,7 +16,6 @@
*/
package org.apache.solr.cloud;
-import java.io.IOException;
import java.lang.invoke.MethodHandles;
import java.util.Collection;
import java.util.List;
@@ -256,7 +255,7 @@ public class ChaosMonkeyShardSplitTest extends ShardSplitTest {
* @return SolrZkClient
*/
private SolrZkClient electNewOverseer(String address)
- throws KeeperException, InterruptedException, IOException {
+ throws KeeperException, InterruptedException {
SolrZkClient zkClient = new SolrZkClient(address, TIMEOUT);
ZkStateReader reader = new ZkStateReader(zkClient);
LeaderElector overseerElector = new LeaderElector(zkClient);
diff --git a/solr/core/src/test/org/apache/solr/cloud/CollectionPropsTest.java b/solr/core/src/test/org/apache/solr/cloud/CollectionPropsTest.java
index 01c7355f156..87639adfd4e 100644
--- a/solr/core/src/test/org/apache/solr/cloud/CollectionPropsTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/CollectionPropsTest.java
@@ -67,7 +67,7 @@ public class CollectionPropsTest extends SolrCloudTestCase {
}
@Test
- public void testReadWriteNoCache() throws InterruptedException, IOException {
+ public void testReadWriteNoCache() throws IOException {
CollectionProperties collectionProps = new CollectionProperties(zkClient());
collectionProps.setCollectionProperty(collectionName, "property1", "value1");
@@ -147,7 +147,7 @@ public class CollectionPropsTest extends SolrCloudTestCase {
checkValue("property1", "value1");
}
- private void checkValue(String propertyName, String expectedValue) throws InterruptedException {
+ private void checkValue(String propertyName, String expectedValue) {
final Object value =
cluster.getZkStateReader().getCollectionProperties(collectionName).get(propertyName);
assertEquals("Unexpected value for collection property: " + propertyName, expectedValue, value);
diff --git a/solr/core/src/test/org/apache/solr/cloud/CollectionsAPISolrJTest.java b/solr/core/src/test/org/apache/solr/cloud/CollectionsAPISolrJTest.java
index 95aad74ba04..df6fb233a31 100644
--- a/solr/core/src/test/org/apache/solr/cloud/CollectionsAPISolrJTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/CollectionsAPISolrJTest.java
@@ -69,7 +69,6 @@ import org.apache.solr.common.util.RetryUtil;
import org.apache.solr.common.util.TimeSource;
import org.apache.solr.common.util.Utils;
import org.apache.solr.util.TimeOut;
-import org.apache.zookeeper.KeeperException;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
@@ -1231,8 +1230,7 @@ public class CollectionsAPISolrJTest extends SolrCloudTestCase {
}
@Test
- public void testAddAndDeleteReplicaProp()
- throws InterruptedException, IOException, SolrServerException {
+ public void testAddAndDeleteReplicaProp() throws IOException, SolrServerException {
final String collection = "replicaProperties";
CollectionAdminRequest.createCollection(collection, "conf", 2, 2)
@@ -1265,8 +1263,7 @@ public class CollectionsAPISolrJTest extends SolrCloudTestCase {
}
@Test
- public void testBalanceShardUnique()
- throws IOException, SolrServerException, KeeperException, InterruptedException {
+ public void testBalanceShardUnique() throws IOException, SolrServerException {
final String collection = "balancedProperties";
CollectionAdminRequest.createCollection(collection, "conf", 2, 2)
diff --git a/solr/core/src/test/org/apache/solr/cloud/ConcurrentCreateRoutedAliasTest.java b/solr/core/src/test/org/apache/solr/cloud/ConcurrentCreateRoutedAliasTest.java
index 39202ac18d5..b811ea2073f 100644
--- a/solr/core/src/test/org/apache/solr/cloud/ConcurrentCreateRoutedAliasTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/ConcurrentCreateRoutedAliasTest.java
@@ -16,7 +16,6 @@
*/
package org.apache.solr.cloud;
-import java.io.IOException;
import java.lang.invoke.MethodHandles;
import java.util.concurrent.atomic.AtomicReference;
import org.apache.lucene.tests.util.LuceneTestCase;
@@ -25,7 +24,6 @@ import org.apache.solr.client.solrj.SolrClient;
import org.apache.solr.client.solrj.request.CollectionAdminRequest;
import org.apache.solr.client.solrj.response.CollectionAdminResponse;
import org.apache.solr.common.util.IOUtils;
-import org.apache.zookeeper.KeeperException;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
@@ -58,8 +56,7 @@ public class ConcurrentCreateRoutedAliasTest extends SolrTestCaseJ4 {
}
@Test
- public void testConcurrentCreateRoutedAliasMinimal()
- throws IOException, KeeperException.NoNodeException {
+ public void testConcurrentCreateRoutedAliasMinimal() {
// this is the test where be blow out a bunch of create commands all out at once. other tests
// are more functionality based, and just use a single thread.
diff --git a/solr/core/src/test/org/apache/solr/cloud/ConfigSetApiLockingTest.java b/solr/core/src/test/org/apache/solr/cloud/ConfigSetApiLockingTest.java
index c8e313839b5..1aaaabe8107 100644
--- a/solr/core/src/test/org/apache/solr/cloud/ConfigSetApiLockingTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/ConfigSetApiLockingTest.java
@@ -52,7 +52,7 @@ public class ConfigSetApiLockingTest extends SolrTestCaseJ4 {
}
}
- private void monothreadedTests(ConfigSetApiLockFactory apiLockingHelper) throws Exception {
+ private void monothreadedTests(ConfigSetApiLockFactory apiLockingHelper) {
// Config set lock without a base config set
DistributedMultiLock cs1Lock = apiLockingHelper.createConfigSetApiLock(CONFIG_SET_NAME_1, null);
assertTrue("cs1Lock should have been acquired", cs1Lock.isAcquired());
diff --git a/solr/core/src/test/org/apache/solr/cloud/CreateRoutedAliasTest.java b/solr/core/src/test/org/apache/solr/cloud/CreateRoutedAliasTest.java
index b5cb4127609..9a183919063 100644
--- a/solr/core/src/test/org/apache/solr/cloud/CreateRoutedAliasTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/CreateRoutedAliasTest.java
@@ -75,7 +75,7 @@ public class CreateRoutedAliasTest extends SolrCloudTestCase {
private CloudSolrClient solrClient;
@Before
- public void doBefore() throws Exception {
+ public void doBefore() {
solrClient = getCloudSolrClient(cluster);
}
@@ -524,7 +524,7 @@ public class CreateRoutedAliasTest extends SolrCloudTestCase {
}
}
- private void assertCollectionExists(String name) throws IOException, SolrServerException {
+ private void assertCollectionExists(String name) {
solrClient.getClusterStateProvider().connect(); // TODO get rid of this
// https://issues.apache.org/jira/browse/SOLR-9784?focusedCommentId=16332729
diff --git a/solr/core/src/test/org/apache/solr/cloud/DeleteShardTest.java b/solr/core/src/test/org/apache/solr/cloud/DeleteShardTest.java
index 0aeaa878d65..60964aa06fa 100644
--- a/solr/core/src/test/org/apache/solr/cloud/DeleteShardTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/DeleteShardTest.java
@@ -133,8 +133,7 @@ public class DeleteShardTest extends SolrCloudTestCase {
}
@Test
- public void testDirectoryCleanupAfterDeleteShard()
- throws InterruptedException, IOException, SolrServerException {
+ public void testDirectoryCleanupAfterDeleteShard() throws IOException, SolrServerException {
final String collection = "deleteshard_test";
CollectionAdminRequest.createCollectionWithImplicitRouter(collection, "conf", "a,b,c", 1)
diff --git a/solr/core/src/test/org/apache/solr/cloud/DistribJoinFromCollectionTest.java b/solr/core/src/test/org/apache/solr/cloud/DistribJoinFromCollectionTest.java
index eed3acc0a35..cdacf4daa11 100644
--- a/solr/core/src/test/org/apache/solr/cloud/DistribJoinFromCollectionTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/DistribJoinFromCollectionTest.java
@@ -133,7 +133,7 @@ public class DistribJoinFromCollectionTest extends SolrCloudTestCase {
}
private void testJoins(String toColl, String fromColl, String toDocId, boolean isScoresTest)
- throws SolrServerException, IOException, InterruptedException {
+ throws SolrServerException, IOException {
// verify the join with fromIndex works
final String fromQ = "match_s:c^2";
CloudSolrClient client = cluster.getSolrClient();
@@ -214,8 +214,7 @@ public class DistribJoinFromCollectionTest extends SolrCloudTestCase {
return isScoresTest ? "score=" + (scoreModes[random().nextInt(scoreModes.length)]) + " " : "";
}
- private void checkAbsentFromIndex(String fromColl, String toColl, boolean isScoresTest)
- throws SolrServerException, IOException {
+ private void checkAbsentFromIndex(String fromColl, String toColl, boolean isScoresTest) {
final String wrongName = fromColl + "WrongName";
final String joinQ =
"{!join "
diff --git a/solr/core/src/test/org/apache/solr/cloud/ForceLeaderTest.java b/solr/core/src/test/org/apache/solr/cloud/ForceLeaderTest.java
index 618418232a7..ae3e50ac6fe 100644
--- a/solr/core/src/test/org/apache/solr/cloud/ForceLeaderTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/ForceLeaderTest.java
@@ -262,7 +262,7 @@ public class ForceLeaderTest extends HttpPartitionTest {
}
}
- private void assertSendDocFails(int docId) throws Exception {
+ private void assertSendDocFails(int docId) {
// sending a doc in this state fails
expectThrows(
SolrException.class,
diff --git a/solr/core/src/test/org/apache/solr/cloud/HttpPartitionTest.java b/solr/core/src/test/org/apache/solr/cloud/HttpPartitionTest.java
index 50b5cfc1701..1a1a8c2b1f3 100644
--- a/solr/core/src/test/org/apache/solr/cloud/HttpPartitionTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/HttpPartitionTest.java
@@ -508,8 +508,7 @@ public class HttpPartitionTest extends AbstractFullDistribZkTestBase {
attemptCollectionDelete(cloudClient, testCollectionName);
}
- protected List<Replica> getActiveOrRecoveringReplicas(String testCollectionName, String shardId)
- throws Exception {
+ protected List<Replica> getActiveOrRecoveringReplicas(String testCollectionName, String shardId) {
Map<String, Replica> activeReplicas = new HashMap<>();
ZkStateReader zkr = ZkStateReader.from(cloudClient);
ClusterState cs = zkr.getClusterState();
diff --git a/solr/core/src/test/org/apache/solr/cloud/LeaderElectionTest.java b/solr/core/src/test/org/apache/solr/cloud/LeaderElectionTest.java
index 8c3ab1475de..09939b398de 100644
--- a/solr/core/src/test/org/apache/solr/cloud/LeaderElectionTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/LeaderElectionTest.java
@@ -18,7 +18,6 @@ package org.apache.solr.cloud;
import static org.apache.solr.common.cloud.ZkStateReader.URL_SCHEME;
-import java.io.IOException;
import java.lang.invoke.MethodHandles;
import java.nio.file.Path;
import java.util.ArrayList;
@@ -141,12 +140,11 @@ public class LeaderElectionTest extends SolrTestCaseJ4 {
private volatile boolean electionDone = false;
private final ZkNodeProps props;
- public ClientThread(String shard, int nodeNumber) throws Exception {
+ public ClientThread(String shard, int nodeNumber) {
this(null, shard, nodeNumber, 0);
}
- public ClientThread(ElectorSetup es, String shard, int nodeNumber, long runLeaderDelay)
- throws Exception {
+ public ClientThread(ElectorSetup es, String shard, int nodeNumber, long runLeaderDelay) {
super("Thread-" + shard + nodeNumber);
this.shard = shard;
this.nodeName = shard + nodeNumber + ":80_solr";
@@ -174,7 +172,7 @@ public class LeaderElectionTest extends SolrTestCaseJ4 {
}
}
- private void setupOnConnect() throws InterruptedException, KeeperException, IOException {
+ private void setupOnConnect() throws InterruptedException, KeeperException {
assertNotNull(es);
TestLeaderElectionContext context =
new TestLeaderElectionContext(
diff --git a/solr/core/src/test/org/apache/solr/cloud/OverseerTest.java b/solr/core/src/test/org/apache/solr/cloud/OverseerTest.java
index 645abaef67b..d06e2ae00d6 100644
--- a/solr/core/src/test/org/apache/solr/cloud/OverseerTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/OverseerTest.java
@@ -47,7 +47,6 @@ import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;
-import javax.xml.parsers.ParserConfigurationException;
import org.apache.lucene.tests.util.LuceneTestCase.Slow;
import org.apache.solr.SolrTestCaseJ4;
import org.apache.solr.client.solrj.SolrClient;
@@ -107,7 +106,6 @@ import org.mockito.plugins.MemberAccessor;
import org.mockito.stubbing.Answer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import org.xml.sax.SAXException;
@Slow
@SolrTestCaseJ4.SuppressSSL
@@ -756,7 +754,7 @@ public class OverseerTest extends SolrTestCaseJ4 {
// wait until collections are available
private void waitForCollections(ZkStateReader stateReader, String... collections)
- throws InterruptedException, KeeperException, TimeoutException {
+ throws InterruptedException, TimeoutException {
int maxIterations = 100;
while (0 < maxIterations--) {
@@ -856,7 +854,7 @@ public class OverseerTest extends SolrTestCaseJ4 {
private void verifyShardLeader(
ZkStateReader reader, String collection, String shard, String expectedCore)
- throws InterruptedException, KeeperException, TimeoutException {
+ throws InterruptedException, TimeoutException {
reader.waitForState(
collection,
@@ -1831,15 +1829,14 @@ public class OverseerTest extends SolrTestCaseJ4 {
}
}
- private void close(SolrZkClient client) throws InterruptedException {
+ private void close(SolrZkClient client) {
if (client != null) {
client.close();
}
}
private SolrZkClient electNewOverseer(String address)
- throws InterruptedException, TimeoutException, IOException, KeeperException,
- ParserConfigurationException, SAXException, NoSuchFieldException, SecurityException,
+ throws InterruptedException, KeeperException, NoSuchFieldException, SecurityException,
IllegalAccessException {
SolrZkClient zkClient = new SolrZkClient(address, TIMEOUT);
zkClients.add(zkClient);
diff --git a/solr/core/src/test/org/apache/solr/cloud/ReindexCollectionTest.java b/solr/core/src/test/org/apache/solr/cloud/ReindexCollectionTest.java
index ade4f5ca195..3fcdd2efd2f 100644
--- a/solr/core/src/test/org/apache/solr/cloud/ReindexCollectionTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/ReindexCollectionTest.java
@@ -68,7 +68,7 @@ public class ReindexCollectionTest extends SolrCloudTestCase {
private DistribStateManager stateManager;
@Before
- public void doBefore() throws Exception {
+ public void doBefore() {
ZkController zkController = cluster.getJettySolrRunner(0).getCoreContainer().getZkController();
cloudManager = zkController.getSolrCloudManager();
stateManager = cloudManager.getDistribStateManager();
diff --git a/solr/core/src/test/org/apache/solr/cloud/SSLMigrationTest.java b/solr/core/src/test/org/apache/solr/cloud/SSLMigrationTest.java
index 7f72b4074fe..e3c86a8be2f 100644
--- a/solr/core/src/test/org/apache/solr/cloud/SSLMigrationTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/SSLMigrationTest.java
@@ -16,7 +16,6 @@
*/
package org.apache.solr.cloud;
-import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
@@ -93,7 +92,7 @@ public class SSLMigrationTest extends AbstractFullDistribZkTestBase {
assertReplicaInformation(urlScheme);
}
- private void assertReplicaInformation(String urlScheme) throws Exception {
+ private void assertReplicaInformation(String urlScheme) {
List<Replica> replicas = getReplicas();
assertEquals("Wrong number of replicas found", 4, replicas.size());
for (Replica replica : replicas) {
@@ -103,7 +102,7 @@ public class SSLMigrationTest extends AbstractFullDistribZkTestBase {
}
}
- private List<Replica> getReplicas() throws IOException {
+ private List<Replica> getReplicas() {
List<Replica> replicas = new ArrayList<>();
DocCollection collection = cloudClient.getClusterState().getCollection(DEFAULT_COLLECTION);
diff --git a/solr/core/src/test/org/apache/solr/cloud/SolrCLIZkUtilsTest.java b/solr/core/src/test/org/apache/solr/cloud/SolrCLIZkUtilsTest.java
index 2c308694650..62f3fd68011 100644
--- a/solr/core/src/test/org/apache/solr/cloud/SolrCLIZkUtilsTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/SolrCLIZkUtilsTest.java
@@ -1005,16 +1005,14 @@ public class SolrCLIZkUtilsTest extends SolrCloudTestCase {
}
@Override
- public FileVisitResult visitFile(Path file, BasicFileAttributes attrs)
- throws IOException {
+ public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) {
assertTrue("Path should start at proper place!", file.startsWith(fileRoot));
checkPathOnZk(file);
return FileVisitResult.CONTINUE;
}
@Override
- public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs)
- throws IOException {
+ public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) {
checkPathOnZk(dir);
return FileVisitResult.CONTINUE;
diff --git a/solr/core/src/test/org/apache/solr/cloud/TestAuthenticationFramework.java b/solr/core/src/test/org/apache/solr/cloud/TestAuthenticationFramework.java
index 6c78f20f176..54847cbf16a 100644
--- a/solr/core/src/test/org/apache/solr/cloud/TestAuthenticationFramework.java
+++ b/solr/core/src/test/org/apache/solr/cloud/TestAuthenticationFramework.java
@@ -58,7 +58,7 @@ public class TestAuthenticationFramework extends SolrCloudTestCase {
super.setUp();
}
- private void setupAuthenticationPlugin() throws Exception {
+ private void setupAuthenticationPlugin() {
System.setProperty(
"authenticationPlugin",
"org.apache.solr.cloud.TestAuthenticationFramework$MockAuthenticationPlugin");
diff --git a/solr/core/src/test/org/apache/solr/cloud/TestBaseStatsCacheCloud.java b/solr/core/src/test/org/apache/solr/cloud/TestBaseStatsCacheCloud.java
index 31ca4e11921..2597951803a 100644
--- a/solr/core/src/test/org/apache/solr/cloud/TestBaseStatsCacheCloud.java
+++ b/solr/core/src/test/org/apache/solr/cloud/TestBaseStatsCacheCloud.java
@@ -212,7 +212,7 @@ public abstract class TestBaseStatsCacheCloud extends SolrCloudTestCase {
}
protected void assertResponses(
- QueryResponse controlRsp, QueryResponse cloudRsp, boolean sameScores) throws Exception {
+ QueryResponse controlRsp, QueryResponse cloudRsp, boolean sameScores) {
Map<String, SolrDocument> cloudDocs = new HashMap<>();
Map<String, SolrDocument> controlDocs = new HashMap<>();
cloudRsp.getResults().forEach(doc -> cloudDocs.put((String) doc.getFieldValue("id"), doc));
diff --git a/solr/core/src/test/org/apache/solr/cloud/TestCloudDeleteByQuery.java b/solr/core/src/test/org/apache/solr/cloud/TestCloudDeleteByQuery.java
index 872189b8315..d8e021327b1 100644
--- a/solr/core/src/test/org/apache/solr/cloud/TestCloudDeleteByQuery.java
+++ b/solr/core/src/test/org/apache/solr/cloud/TestCloudDeleteByQuery.java
@@ -229,7 +229,7 @@ public class TestCloudDeleteByQuery extends SolrCloudTestCase {
assertEquals(0, CLOUD_CLIENT.commit().getStatus());
}
- public void testMalformedDBQ(SolrClient client) throws Exception {
+ public void testMalformedDBQ(SolrClient client) {
assertNotNull("client not initialized", client);
SolrException e =
expectThrows(
@@ -240,27 +240,27 @@ public class TestCloudDeleteByQuery extends SolrCloudTestCase {
}
//
- public void testMalformedDBQViaCloudClient() throws Exception {
+ public void testMalformedDBQViaCloudClient() {
testMalformedDBQ(CLOUD_CLIENT);
}
- public void testMalformedDBQViaShard1LeaderClient() throws Exception {
+ public void testMalformedDBQViaShard1LeaderClient() {
testMalformedDBQ(S_ONE_LEADER_CLIENT);
}
- public void testMalformedDBQViaShard2LeaderClient() throws Exception {
+ public void testMalformedDBQViaShard2LeaderClient() {
testMalformedDBQ(S_TWO_LEADER_CLIENT);
}
- public void testMalformedDBQViaShard1NonLeaderClient() throws Exception {
+ public void testMalformedDBQViaShard1NonLeaderClient() {
testMalformedDBQ(S_ONE_NON_LEADER_CLIENT);
}
- public void testMalformedDBQViaShard2NonLeaderClient() throws Exception {
+ public void testMalformedDBQViaShard2NonLeaderClient() {
testMalformedDBQ(S_TWO_NON_LEADER_CLIENT);
}
- public void testMalformedDBQViaNoCollectionClient() throws Exception {
+ public void testMalformedDBQViaNoCollectionClient() {
testMalformedDBQ(NO_COLLECTION_CLIENT);
}
diff --git a/solr/core/src/test/org/apache/solr/cloud/TestCloudInspectUtil.java b/solr/core/src/test/org/apache/solr/cloud/TestCloudInspectUtil.java
index 125a10f3c27..b6ff6344a91 100644
--- a/solr/core/src/test/org/apache/solr/cloud/TestCloudInspectUtil.java
+++ b/solr/core/src/test/org/apache/solr/cloud/TestCloudInspectUtil.java
@@ -41,7 +41,7 @@ public class TestCloudInspectUtil extends SolrTestCaseJ4 {
}
@Test
- public void testCheckIfDiffIsLegal() throws Exception {
+ public void testCheckIfDiffIsLegal() {
Set<String> addFails = null;
Set<String> deleteFails = null;
SolrDocumentList a = getDocList("2", "3");
diff --git a/solr/core/src/test/org/apache/solr/cloud/TestCloudPivotFacet.java b/solr/core/src/test/org/apache/solr/cloud/TestCloudPivotFacet.java
index 43757f7be51..de768d30544 100644
--- a/solr/core/src/test/org/apache/solr/cloud/TestCloudPivotFacet.java
+++ b/solr/core/src/test/org/apache/solr/cloud/TestCloudPivotFacet.java
@@ -293,7 +293,7 @@ public class TestCloudPivotFacet extends AbstractFullDistribZkTestBase {
* on those constraints. Returns the recursive depth reached (for sanity checking)
*/
private int assertPivotCountsAreCorrect(
- String pivotName, SolrParams baseParams, PivotField constraint) throws SolrServerException {
+ String pivotName, SolrParams baseParams, PivotField constraint) {
SolrParams p = SolrParams.wrapAppended(baseParams, params("fq", buildFilter(constraint)));
List<PivotField> subPivots = null;
diff --git a/solr/core/src/test/org/apache/solr/cloud/TestHashPartitioner.java b/solr/core/src/test/org/apache/solr/cloud/TestHashPartitioner.java
index 890faddbbd2..f48aec46cfe 100644
--- a/solr/core/src/test/org/apache/solr/cloud/TestHashPartitioner.java
+++ b/solr/core/src/test/org/apache/solr/cloud/TestHashPartitioner.java
@@ -37,7 +37,7 @@ import org.apache.solr.handler.admin.ConfigSetsHandler;
public class TestHashPartitioner extends SolrTestCaseJ4 {
- public void testMapHashes() throws Exception {
+ public void testMapHashes() {
DocRouter hp = DocRouter.DEFAULT;
List<Range> ranges;
@@ -117,14 +117,14 @@ public class TestHashPartitioner extends SolrTestCaseJ4 {
return Hash.murmurhash3_x86_32(id, 0, id.length(), 0);
}
- public void testHashCodes() throws Exception {
+ public void testHashCodes() {
DocRouter router = DocRouter.getDocRouter(PlainIdRouter.NAME);
assertTrue(router instanceof PlainIdRouter);
DocCollection coll = createCollection(4, router);
doNormalIdHashing(coll);
}
- public void doNormalIdHashing(DocCollection coll) throws Exception {
+ public void doNormalIdHashing(DocCollection coll) {
assertEquals(4, coll.getSlices().size());
doId(coll, "b", "shard1");
@@ -160,7 +160,7 @@ public class TestHashPartitioner extends SolrTestCaseJ4 {
assertEquals(expectedSet, obtainedSet);
}
- public void testCompositeHashCodes() throws Exception {
+ public void testCompositeHashCodes() {
DocRouter router = DocRouter.getDocRouter(CompositeIdRouter.NAME);
assertTrue(router instanceof CompositeIdRouter);
router = DocRouter.DEFAULT;
diff --git a/solr/core/src/test/org/apache/solr/cloud/TestPrepRecovery.java b/solr/core/src/test/org/apache/solr/cloud/TestPrepRecovery.java
index b34f3f494ab..504bc5087ab 100644
--- a/solr/core/src/test/org/apache/solr/cloud/TestPrepRecovery.java
+++ b/solr/core/src/test/org/apache/solr/cloud/TestPrepRecovery.java
@@ -47,7 +47,7 @@ public class TestPrepRecovery extends SolrCloudTestCase {
}
@AfterClass
- public static void tearCluster() throws Exception {
+ public static void tearCluster() {
System.clearProperty("leaderConflictResolveWait");
}
diff --git a/solr/core/src/test/org/apache/solr/cloud/TestRebalanceLeaders.java b/solr/core/src/test/org/apache/solr/cloud/TestRebalanceLeaders.java
index c8bcfe99876..4355365e2f6 100644
--- a/solr/core/src/test/org/apache/solr/cloud/TestRebalanceLeaders.java
+++ b/solr/core/src/test/org/apache/solr/cloud/TestRebalanceLeaders.java
@@ -81,7 +81,7 @@ public class TestRebalanceLeaders extends SolrCloudTestCase {
}
@Before
- public void removeAllProperties() throws KeeperException, InterruptedException {
+ public void removeAllProperties() {
forceUpdateCollectionStatus();
DocCollection docCollection =
cluster.getSolrClient().getClusterState().getCollection(COLLECTION_NAME);
@@ -114,7 +114,7 @@ public class TestRebalanceLeaders extends SolrCloudTestCase {
// we're explicitly testing that as well.
@Test
public void testSetArbitraryPropertySliceUnique()
- throws IOException, SolrServerException, InterruptedException, KeeperException {
+ throws IOException, SolrServerException, InterruptedException {
// Check both special (preferredLeader) and something arbitrary.
doTestSetArbitraryPropertySliceUnique("foo" + random().nextInt(1_000_000));
removeAllProperties();
@@ -127,7 +127,7 @@ public class TestRebalanceLeaders extends SolrCloudTestCase {
// set the property on
@Test
public void testBalancePropertySliceUnique()
- throws KeeperException, InterruptedException, IOException, SolrServerException {
+ throws InterruptedException, IOException, SolrServerException {
// Check both cases of "special" property preferred(Ll)eader
doTestBalancePropertySliceUnique("foo" + random().nextInt(1_000_000));
removeAllProperties();
@@ -161,7 +161,7 @@ public class TestRebalanceLeaders extends SolrCloudTestCase {
// on an individual
// replica.
private void doTestSetArbitraryPropertySliceUnique(String propIn)
- throws InterruptedException, KeeperException, IOException, SolrServerException {
+ throws InterruptedException, IOException, SolrServerException {
final String prop = (random().nextBoolean()) ? propIn : propIn.toUpperCase(Locale.ROOT);
// First set the property in some replica in some slice
forceUpdateCollectionStatus();
@@ -301,8 +301,7 @@ public class TestRebalanceLeaders extends SolrCloudTestCase {
// Just an encapsulation for checkPreferredsAreLeaders to make returning easier.
// the doAsserts var is to actually print the problem and fail the test if the condition is not
// met.
- private boolean checkPreferredsAreLeaders(boolean doAsserts)
- throws KeeperException, InterruptedException {
+ private boolean checkPreferredsAreLeaders(boolean doAsserts) {
forceUpdateCollectionStatus();
DocCollection docCollection =
cluster.getSolrClient().getClusterState().getCollection(COLLECTION_NAME);
@@ -322,8 +321,7 @@ public class TestRebalanceLeaders extends SolrCloudTestCase {
}
// Arbitrarily send the rebalance command either with the SolrJ interface or with an HTTP request.
- private void sendRebalanceCommand()
- throws SolrServerException, InterruptedException, IOException {
+ private void sendRebalanceCommand() throws SolrServerException, IOException {
if (random().nextBoolean()) {
rebalanceLeaderUsingSolrJAPI();
} else {
@@ -335,7 +333,7 @@ public class TestRebalanceLeaders extends SolrCloudTestCase {
// re-assigned with the
// BALANCESHARDUNIQUE command.
private void doTestBalancePropertySliceUnique(String propIn)
- throws InterruptedException, IOException, KeeperException, SolrServerException {
+ throws InterruptedException, IOException, SolrServerException {
final String prop = (random().nextBoolean()) ? propIn : propIn.toUpperCase(Locale.ROOT);
// Concentrate the properties on as few replicas a possible
@@ -351,8 +349,7 @@ public class TestRebalanceLeaders extends SolrCloudTestCase {
verifyPropCorrectlyDistributed(prop);
}
- private void verifyPropCorrectlyDistributed(String prop)
- throws KeeperException, InterruptedException {
+ private void verifyPropCorrectlyDistributed(String prop) {
TimeOut timeout = new TimeOut(timeoutMs, TimeUnit.MILLISECONDS, TimeSource.NANO_TIME);
@@ -381,8 +378,7 @@ public class TestRebalanceLeaders extends SolrCloudTestCase {
// Used when we concentrate the leader on a few nodes.
private void verifyPropDistributedAsExpected(
- Map<String, String> expectedShardReplicaMap, String prop)
- throws InterruptedException, KeeperException {
+ Map<String, String> expectedShardReplicaMap, String prop) throws InterruptedException {
// Make sure that the shard unique are where you expect.
TimeOut timeout = new TimeOut(timeoutMs, TimeUnit.MILLISECONDS, TimeSource.NANO_TIME);
@@ -415,8 +411,7 @@ public class TestRebalanceLeaders extends SolrCloudTestCase {
}
// Just check that the property is distributed as expectecd. This does _not_ rebalance the leaders
- private void rebalancePropAndCheck(String prop)
- throws IOException, SolrServerException, InterruptedException, KeeperException {
+ private void rebalancePropAndCheck(String prop) throws IOException, SolrServerException {
if (random().nextBoolean()) {
rebalancePropUsingSolrJAPI(prop);
@@ -425,8 +420,7 @@ public class TestRebalanceLeaders extends SolrCloudTestCase {
}
}
- private void rebalanceLeaderUsingSolrJAPI()
- throws IOException, SolrServerException, InterruptedException {
+ private void rebalanceLeaderUsingSolrJAPI() throws IOException, SolrServerException {
CollectionAdminResponse resp =
CollectionAdminRequest.rebalanceLeaders(COLLECTION_NAME).process(cluster.getSolrClient());
assertTrue(
@@ -448,8 +442,7 @@ public class TestRebalanceLeaders extends SolrCloudTestCase {
assertEquals("Call to rebalanceLeaders failed ", 0, resp.getStatus());
}
- private void rebalancePropUsingSolrJAPI(String prop)
- throws IOException, SolrServerException, InterruptedException {
+ private void rebalancePropUsingSolrJAPI(String prop) throws IOException, SolrServerException {
// Don't set the value, that should be done automatically.
CollectionAdminResponse resp;
@@ -606,14 +599,13 @@ public class TestRebalanceLeaders extends SolrCloudTestCase {
// while banging my nead against a wall, I put a lot of force refresh statements in. Want to leave
// them in but have this be a no-op so if we start to get failures, we can re-enable with minimal
// effort.
- private void forceUpdateCollectionStatus() throws KeeperException, InterruptedException {
+ private void forceUpdateCollectionStatus() {
// cluster.getSolrClient().getZkStateReader().forceUpdateCollection(COLLECTION_NAME);
}
// Since we have to restart jettys, we don't want to try rebalancing etc. until we're sure all
// jettys that should be up are up and all replicas are active.
- private void checkReplicasInactive(List<JettySolrRunner> downJettys)
- throws KeeperException, InterruptedException {
+ private void checkReplicasInactive(List<JettySolrRunner> downJettys) throws InterruptedException {
TimeOut timeout = new TimeOut(timeoutMs, TimeUnit.MILLISECONDS, TimeSource.NANO_TIME);
DocCollection docCollection = null;
Set<String> liveNodes = null;
@@ -654,7 +646,7 @@ public class TestRebalanceLeaders extends SolrCloudTestCase {
// We need to wait around until all replicas are active before expecting rebalancing or
// distributing shard-unique properties to work.
- private void checkAllReplicasActive() throws KeeperException, InterruptedException {
+ private void checkAllReplicasActive() throws InterruptedException {
TimeOut timeout = new TimeOut(timeoutMs, TimeUnit.MILLISECONDS, TimeSource.NANO_TIME);
while (timeout.hasTimedOut() == false) {
forceUpdateCollectionStatus();
@@ -680,7 +672,7 @@ public class TestRebalanceLeaders extends SolrCloudTestCase {
// use a simple heuristic to put as many replicas with the property on as few nodes as possible.
// The point is that then we can execute BALANCESHARDUNIQUE and be sure it worked correctly
private void concentrateProp(String prop)
- throws KeeperException, InterruptedException, IOException, SolrServerException {
+ throws InterruptedException, IOException, SolrServerException {
// find all the live nodes for each slice, assign the leader to the first replica that is in the
// lowest position on live_nodes
List<String> liveNodes =
@@ -715,8 +707,7 @@ public class TestRebalanceLeaders extends SolrCloudTestCase {
}
// make sure that the property in question is unique per shard.
- private Map<String, String> verifyPropUniquePerShard(String prop)
- throws InterruptedException, KeeperException {
+ private Map<String, String> verifyPropUniquePerShard(String prop) throws InterruptedException {
Map<String, String> uniquePropMaps = new TreeMap<>();
TimeOut timeout = new TimeOut(timeoutMs, TimeUnit.MILLISECONDS, TimeSource.NANO_TIME);
@@ -736,8 +727,7 @@ public class TestRebalanceLeaders extends SolrCloudTestCase {
}
// return true if every shard has exactly one replica with the unique property set to "true"
- private boolean checkdUniquePropPerShard(Map<String, String> uniques, String prop)
- throws KeeperException, InterruptedException {
+ private boolean checkdUniquePropPerShard(Map<String, String> uniques, String prop) {
forceUpdateCollectionStatus();
DocCollection docCollection =
cluster.getSolrClient().getClusterState().getCollection(COLLECTION_NAME);
diff --git a/solr/core/src/test/org/apache/solr/cloud/TestSSLRandomization.java b/solr/core/src/test/org/apache/solr/cloud/TestSSLRandomization.java
index 13ee50d213e..4514d137aad 100644
--- a/solr/core/src/test/org/apache/solr/cloud/TestSSLRandomization.java
+++ b/solr/core/src/test/org/apache/solr/cloud/TestSSLRandomization.java
@@ -47,7 +47,7 @@ public class TestSSLRandomization extends SolrCloudTestCase {
TestMiniSolrCloudClusterSSL.checkClusterWithCollectionCreations(cluster, sslConfig);
}
- public void testBaseUrl() throws Exception {
+ public void testBaseUrl() {
String url = buildUrl(6666, "/foo");
assertEquals(
sslConfig.isSSLMode() ? "https://127.0.0.1:6666/foo" : "http://127.0.0.1:6666/foo", url);
diff --git a/solr/core/src/test/org/apache/solr/cloud/TestStressCloudBlindAtomicUpdates.java b/solr/core/src/test/org/apache/solr/cloud/TestStressCloudBlindAtomicUpdates.java
index eb3bc09fc26..a9233e388c7 100644
--- a/solr/core/src/test/org/apache/solr/cloud/TestStressCloudBlindAtomicUpdates.java
+++ b/solr/core/src/test/org/apache/solr/cloud/TestStressCloudBlindAtomicUpdates.java
@@ -160,7 +160,7 @@ public class TestStressCloudBlindAtomicUpdates extends SolrCloudTestCase {
}
@AfterClass
- private static void afterClass() throws Exception {
+ private static void afterClass() {
TestInjection.reset();
if (null != EXEC_SERVICE) {
ExecutorUtil.shutdownAndAwaitTermination(EXEC_SERVICE);
diff --git a/solr/core/src/test/org/apache/solr/cloud/TestTlogReplica.java b/solr/core/src/test/org/apache/solr/cloud/TestTlogReplica.java
index 1625745214e..c3c0d924d3d 100644
--- a/solr/core/src/test/org/apache/solr/cloud/TestTlogReplica.java
+++ b/solr/core/src/test/org/apache/solr/cloud/TestTlogReplica.java
@@ -900,8 +900,7 @@ public class TestTlogReplica extends SolrCloudTestCase {
assertNotNull(doc.get("title_s"));
}
- private UpdateRequest simulatedUpdateRequest(Long prevVersion, Object... fields)
- throws SolrServerException, IOException {
+ private UpdateRequest simulatedUpdateRequest(Long prevVersion, Object... fields) {
SolrInputDocument doc = sdoc(fields);
// get baseUrl of the leader
@@ -918,8 +917,7 @@ public class TestTlogReplica extends SolrCloudTestCase {
return ur;
}
- private UpdateRequest simulatedDBQ(String query, long version)
- throws SolrServerException, IOException {
+ private UpdateRequest simulatedDBQ(String query, long version) {
String baseUrl = getBaseUrl();
UpdateRequest ur = new UpdateRequest();
diff --git a/solr/core/src/test/org/apache/solr/cloud/ZkCLITest.java b/solr/core/src/test/org/apache/solr/cloud/ZkCLITest.java
index 44d373495ee..14469466aa0 100644
--- a/solr/core/src/test/org/apache/solr/cloud/ZkCLITest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/ZkCLITest.java
@@ -103,7 +103,7 @@ public class ZkCLITest extends SolrTestCaseJ4 {
}
@Test
- public void testCmdConstants() throws Exception {
+ public void testCmdConstants() {
assertEquals("upconfig", ZkCLI.UPCONFIG);
assertEquals("x", ZkCLI.EXCLUDE_REGEX_SHORT);
assertEquals("excluderegex", ZkCLI.EXCLUDE_REGEX);
@@ -189,7 +189,7 @@ public class ZkCLITest extends SolrTestCaseJ4 {
}
@Test
- public void testPutFileNotExists() throws Exception {
+ public void testPutFileNotExists() {
// test put file
String[] args =
new String[] {
diff --git a/solr/core/src/test/org/apache/solr/cloud/api/collections/AsyncCallRequestStatusResponseTest.java b/solr/core/src/test/org/apache/solr/cloud/api/collections/AsyncCallRequestStatusResponseTest.java
index a2ddd4756b7..83d51b9048e 100644
--- a/solr/core/src/test/org/apache/solr/cloud/api/collections/AsyncCallRequestStatusResponseTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/api/collections/AsyncCallRequestStatusResponseTest.java
@@ -42,7 +42,7 @@ public class AsyncCallRequestStatusResponseTest extends SolrCloudTestCase {
@SuppressWarnings("deprecation")
@AfterClass
- public static void restoreFlag() throws Exception {
+ public static void restoreFlag() {
ShardRequestTracker.INCLUDE_TOP_LEVEL_RESPONSE = oldResponseEntries;
}
diff --git a/solr/core/src/test/org/apache/solr/cloud/api/collections/BackupRestoreApiErrorConditionsTest.java b/solr/core/src/test/org/apache/solr/cloud/api/collections/BackupRestoreApiErrorConditionsTest.java
index 6ae68141d7e..942dd879f4d 100644
--- a/solr/core/src/test/org/apache/solr/cloud/api/collections/BackupRestoreApiErrorConditionsTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/api/collections/BackupRestoreApiErrorConditionsTest.java
@@ -83,13 +83,12 @@ public class BackupRestoreApiErrorConditionsTest extends SolrCloudTestCase {
}
@AfterClass
- public static void tearDownClass() throws Exception {
+ public static void tearDownClass() {
System.clearProperty("solr.allowPaths");
}
@Test
- public void testBackupOperationsReportErrorWhenUnknownBackupRepositoryRequested()
- throws Exception {
+ public void testBackupOperationsReportErrorWhenUnknownBackupRepositoryRequested() {
// Check message for create-backup
Exception e =
expectThrows(
diff --git a/solr/core/src/test/org/apache/solr/cloud/api/collections/CollectionApiLockingTest.java b/solr/core/src/test/org/apache/solr/cloud/api/collections/CollectionApiLockingTest.java
index 9ab75b979c8..8eb2d9f383f 100644
--- a/solr/core/src/test/org/apache/solr/cloud/api/collections/CollectionApiLockingTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/api/collections/CollectionApiLockingTest.java
@@ -55,7 +55,7 @@ public class CollectionApiLockingTest extends SolrTestCaseJ4 {
}
}
- private void monothreadedTests(CollectionApiLockFactory apiLockingHelper) throws Exception {
+ private void monothreadedTests(CollectionApiLockFactory apiLockingHelper) {
// Lock at collection level (which prevents locking + acquiring on any other level of the
// hierarchy)
DistributedMultiLock collLock =
diff --git a/solr/core/src/test/org/apache/solr/cloud/api/collections/CollectionTooManyReplicasTest.java b/solr/core/src/test/org/apache/solr/cloud/api/collections/CollectionTooManyReplicasTest.java
index 126b167f1c0..67de4ee78ba 100644
--- a/solr/core/src/test/org/apache/solr/cloud/api/collections/CollectionTooManyReplicasTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/api/collections/CollectionTooManyReplicasTest.java
@@ -26,7 +26,6 @@ import org.apache.solr.cloud.SolrCloudTestCase;
import org.apache.solr.common.cloud.DocCollection;
import org.apache.solr.common.cloud.Replica;
import org.apache.solr.common.cloud.Slice;
-import org.apache.zookeeper.KeeperException;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Ignore;
@@ -260,8 +259,7 @@ public class CollectionTooManyReplicasTest extends SolrCloudTestCase {
}
}
- private List<String> getAllNodeNames(String collectionName)
- throws KeeperException, InterruptedException {
+ private List<String> getAllNodeNames(String collectionName) {
DocCollection state = getCollectionState(collectionName);
return state.getReplicas().stream()
.map(Replica::getNodeName)
diff --git a/solr/core/src/test/org/apache/solr/cloud/api/collections/ReplicaPropertiesBase.java b/solr/core/src/test/org/apache/solr/cloud/api/collections/ReplicaPropertiesBase.java
index 0ae66ab0e64..8f5e383316e 100644
--- a/solr/core/src/test/org/apache/solr/cloud/api/collections/ReplicaPropertiesBase.java
+++ b/solr/core/src/test/org/apache/solr/cloud/api/collections/ReplicaPropertiesBase.java
@@ -29,7 +29,6 @@ import org.apache.solr.cloud.AbstractFullDistribZkTestBase;
import org.apache.solr.common.cloud.*;
import org.apache.solr.common.params.ModifiableSolrParams;
import org.apache.solr.common.util.NamedList;
-import org.apache.zookeeper.KeeperException;
// Collect useful operations for testing assigning properties to individual replicas
// Could probably expand this to do something creative with getting random slices
@@ -52,7 +51,7 @@ public abstract class ReplicaPropertiesBase extends AbstractFullDistribZkTestBas
public static void verifyPropertyNotPresent(
CloudSolrClient client, String collectionName, String replicaName, String property)
- throws KeeperException, InterruptedException {
+ throws InterruptedException {
ClusterState clusterState = null;
Replica replica = null;
for (int idx = 0; idx < 300; ++idx) {
@@ -88,7 +87,7 @@ public abstract class ReplicaPropertiesBase extends AbstractFullDistribZkTestBas
String replicaName,
String property,
String val)
- throws InterruptedException, KeeperException {
+ throws InterruptedException {
Replica replica = null;
ClusterState clusterState = null;
@@ -122,20 +121,18 @@ public abstract class ReplicaPropertiesBase extends AbstractFullDistribZkTestBas
// 1> the property is only set once in all the replicas in a slice.
// 2> the property is balanced evenly across all the nodes hosting collection
public static void verifyUniqueAcrossCollection(
- CloudSolrClient client, String collectionName, String property)
- throws KeeperException, InterruptedException {
+ CloudSolrClient client, String collectionName, String property) throws InterruptedException {
verifyUnique(client, collectionName, property, true);
}
public static void verifyUniquePropertyWithinCollection(
- CloudSolrClient client, String collectionName, String property)
- throws KeeperException, InterruptedException {
+ CloudSolrClient client, String collectionName, String property) throws InterruptedException {
verifyUnique(client, collectionName, property, false);
}
public static void verifyUnique(
CloudSolrClient client, String collectionName, String property, boolean balanced)
- throws KeeperException, InterruptedException {
+ throws InterruptedException {
DocCollection col = null;
for (int idx = 0; idx < 300; ++idx) {
diff --git a/solr/core/src/test/org/apache/solr/cloud/api/collections/TestLocalFSCloudBackupRestore.java b/solr/core/src/test/org/apache/solr/cloud/api/collections/TestLocalFSCloudBackupRestore.java
index 70aa80cbe64..e63fe247e82 100644
--- a/solr/core/src/test/org/apache/solr/cloud/api/collections/TestLocalFSCloudBackupRestore.java
+++ b/solr/core/src/test/org/apache/solr/cloud/api/collections/TestLocalFSCloudBackupRestore.java
@@ -158,12 +158,12 @@ public class TestLocalFSCloudBackupRestore extends AbstractCloudBackupRestoreTes
}
@Override
- public void copyFileFrom(Directory sourceDir, String fileName, URI dest) throws IOException {
+ public void copyFileFrom(Directory sourceDir, String fileName, URI dest) {
throw new UnsupportedOperationException(poisioned);
}
@Override
- public void copyFileTo(URI sourceDir, String fileName, Directory dest) throws IOException {
+ public void copyFileTo(URI sourceDir, String fileName, Directory dest) {
throw new UnsupportedOperationException(poisioned);
}
@@ -173,7 +173,7 @@ public class TestLocalFSCloudBackupRestore extends AbstractCloudBackupRestoreTes
}
@Override
- public OutputStream createOutput(URI path) throws IOException {
+ public OutputStream createOutput(URI path) {
throw new UnsupportedOperationException(poisioned);
}
}
diff --git a/solr/core/src/test/org/apache/solr/cloud/api/collections/TestReplicaProperties.java b/solr/core/src/test/org/apache/solr/cloud/api/collections/TestReplicaProperties.java
index 48e4a9c2966..e0eb34d19c0 100644
--- a/solr/core/src/test/org/apache/solr/cloud/api/collections/TestReplicaProperties.java
+++ b/solr/core/src/test/org/apache/solr/cloud/api/collections/TestReplicaProperties.java
@@ -32,7 +32,6 @@ import org.apache.solr.common.cloud.ZkStateReader;
import org.apache.solr.common.params.CollectionParams;
import org.apache.solr.common.params.ModifiableSolrParams;
import org.apache.solr.common.util.NamedList;
-import org.apache.zookeeper.KeeperException;
import org.junit.Test;
@Slow
@@ -240,7 +239,7 @@ public class TestReplicaProperties extends ReplicaPropertiesBase {
}
private void verifyLeaderAssignment(CloudSolrClient client, String collectionName)
- throws InterruptedException, KeeperException {
+ throws InterruptedException {
String lastFailMsg = "";
// Keep trying while Overseer writes the ZK state for up to 30 seconds.
for (int idx = 0; idx < 300; ++idx) {
diff --git a/solr/core/src/test/org/apache/solr/cluster/events/impl/CollectionsRepairEventListenerTest.java b/solr/core/src/test/org/apache/solr/cluster/events/impl/CollectionsRepairEventListenerTest.java
index 9015286f99c..6645e0a0d76 100644
--- a/solr/core/src/test/org/apache/solr/cluster/events/impl/CollectionsRepairEventListenerTest.java
+++ b/solr/core/src/test/org/apache/solr/cluster/events/impl/CollectionsRepairEventListenerTest.java
@@ -50,7 +50,7 @@ public class CollectionsRepairEventListenerTest extends SolrCloudTestCase {
CountDownLatch completed = new CountDownLatch(1);
- CollectionsRepairWrapperListener(CoreContainer cc, int waitFor) throws Exception {
+ CollectionsRepairWrapperListener(CoreContainer cc, int waitFor) {
delegate = new CollectionsRepairEventListener(cc);
delegate.setWaitForSecond(waitFor);
}
diff --git a/solr/core/src/test/org/apache/solr/core/AlternateDirectoryTest.java b/solr/core/src/test/org/apache/solr/core/AlternateDirectoryTest.java
index b8c2da14acc..f78e02a3972 100644
--- a/solr/core/src/test/org/apache/solr/core/AlternateDirectoryTest.java
+++ b/solr/core/src/test/org/apache/solr/core/AlternateDirectoryTest.java
@@ -32,13 +32,13 @@ public class AlternateDirectoryTest extends SolrTestCaseJ4 {
initCore("solrconfig-altdirectory.xml", "schema.xml");
}
- public void testAltDirectoryUsed() throws Exception {
+ public void testAltDirectoryUsed() {
assertQ(req("q", "*:*", "qt", "/select"));
assertTrue(TestFSDirectoryFactory.openCalled);
assertTrue(TestIndexReaderFactory.newReaderCalled);
}
- public void testAltReaderUsed() throws Exception {
+ public void testAltReaderUsed() {
IndexReaderFactory readerFactory = h.getCore().getIndexReaderFactory();
assertNotNull("Factory is null", readerFactory);
assertEquals(
diff --git a/solr/core/src/test/org/apache/solr/core/ConfigureRecoveryStrategyTest.java b/solr/core/src/test/org/apache/solr/core/ConfigureRecoveryStrategyTest.java
index 7134dad3e85..c1a05d00987 100644
--- a/solr/core/src/test/org/apache/solr/core/ConfigureRecoveryStrategyTest.java
+++ b/solr/core/src/test/org/apache/solr/core/ConfigureRecoveryStrategyTest.java
@@ -41,7 +41,7 @@ public class ConfigureRecoveryStrategyTest extends SolrTestCaseJ4 {
initCore(solrConfigFileName, "schema.xml");
}
- public void testBuilder() throws Exception {
+ public void testBuilder() {
final RecoveryStrategy.Builder recoveryStrategyBuilder =
h.getCore().getSolrCoreState().getRecoveryStrategyBuilder();
assertNotNull("recoveryStrategyBuilder is null", recoveryStrategyBuilder);
@@ -66,7 +66,7 @@ public class ConfigureRecoveryStrategyTest extends SolrTestCaseJ4 {
recoveryStrategyBuilder.getClass().getName());
}
- public void testAlmostAllMethodsAreFinal() throws Exception {
+ public void testAlmostAllMethodsAreFinal() {
for (Method m : RecoveryStrategy.class.getDeclaredMethods()) {
if (Modifier.isStatic(m.getModifiers()) || Modifier.isPrivate(m.getModifiers())) continue;
final String methodName = m.getName();
diff --git a/solr/core/src/test/org/apache/solr/core/DirectoryFactoryTest.java b/solr/core/src/test/org/apache/solr/core/DirectoryFactoryTest.java
index c395e0b3682..ff696da512e 100755
--- a/solr/core/src/test/org/apache/solr/core/DirectoryFactoryTest.java
+++ b/solr/core/src/test/org/apache/solr/core/DirectoryFactoryTest.java
@@ -36,7 +36,7 @@ public class DirectoryFactoryTest extends SolrTestCase {
private static SolrResourceLoader loader = null;
@BeforeClass
- public static void setupLoader() throws Exception {
+ public static void setupLoader() {
solrHome = FilterPath.unwrap(createTempDir()); // FilterPath can interfere
loader = new SolrResourceLoader(solrHome);
}
@@ -58,7 +58,7 @@ public class DirectoryFactoryTest extends SolrTestCase {
}
@Test
- public void testLockTypesUnchanged() throws Exception {
+ public void testLockTypesUnchanged() {
assertEquals("simple", DirectoryFactory.LOCK_TYPE_SIMPLE);
assertEquals("native", DirectoryFactory.LOCK_TYPE_NATIVE);
assertEquals("single", DirectoryFactory.LOCK_TYPE_SINGLE);
@@ -134,7 +134,7 @@ public class DirectoryFactoryTest extends SolrTestCase {
assertEquals(Paths.get(expected).toAbsolutePath(), Paths.get(dataHome).toAbsolutePath());
}
- private NodeConfig loadNodeConfig(String config) throws Exception {
+ private NodeConfig loadNodeConfig(String config) {
InputStream is = DirectoryFactoryTest.class.getResourceAsStream(config);
return SolrXmlConfig.fromInputStream(solrHome, is, new Properties());
}
diff --git a/solr/core/src/test/org/apache/solr/core/HelloStream.java b/solr/core/src/test/org/apache/solr/core/HelloStream.java
index ba0135e6b3f..52bf6437261 100644
--- a/solr/core/src/test/org/apache/solr/core/HelloStream.java
+++ b/solr/core/src/test/org/apache/solr/core/HelloStream.java
@@ -36,7 +36,7 @@ public class HelloStream extends TupleStream implements Expressible {
public HelloStream() {}
- public HelloStream(StreamExpression expression, StreamFactory factory) throws IOException {}
+ public HelloStream(StreamExpression expression, StreamFactory factory) {}
@Override
public void setStreamContext(StreamContext context) {}
@@ -74,7 +74,7 @@ public class HelloStream extends TupleStream implements Expressible {
}
@Override
- public Explanation toExplanation(StreamFactory factory) throws IOException {
+ public Explanation toExplanation(StreamFactory factory) {
return new StreamExplanation(getStreamNodeId().toString())
.withFunctionName("hello")
.withImplementingClass(this.getClass().getName())
diff --git a/solr/core/src/test/org/apache/solr/core/ResourceLoaderTest.java b/solr/core/src/test/org/apache/solr/core/ResourceLoaderTest.java
index a22b3bfdbb8..aa2f3dee9a3 100644
--- a/solr/core/src/test/org/apache/solr/core/ResourceLoaderTest.java
+++ b/solr/core/src/test/org/apache/solr/core/ResourceLoaderTest.java
@@ -113,7 +113,7 @@ public class ResourceLoaderTest extends SolrTestCaseJ4 {
}
@SuppressWarnings({"unchecked"})
- public void testAwareCompatibility() throws Exception {
+ public void testAwareCompatibility() {
final Class<?> clazz1 = ResourceLoaderAware.class;
// Check ResourceLoaderAware valid objects
diff --git a/solr/core/src/test/org/apache/solr/core/SOLR749Test.java b/solr/core/src/test/org/apache/solr/core/SOLR749Test.java
index 75c88460a7f..72013c2ae4c 100644
--- a/solr/core/src/test/org/apache/solr/core/SOLR749Test.java
+++ b/solr/core/src/test/org/apache/solr/core/SOLR749Test.java
@@ -36,7 +36,7 @@ public class SOLR749Test extends SolrTestCaseJ4 {
initCore("solrconfig-SOLR-749.xml", "schema.xml");
}
- public void testConstruction() throws Exception {
+ public void testConstruction() {
SolrCore core = h.getCore();
assertTrue("core is null and it shouldn't be", core != null);
QParserPlugin parserPlugin = core.getQueryPlugin(QParserPlugin.DEFAULT_QTYPE);
@@ -52,7 +52,7 @@ public class SOLR749Test extends SolrTestCaseJ4 {
vsp instanceof DummyValueSourceParser);
}
- public void testHowManyDocsHaveBoostFunctionComputed() throws Exception {
+ public void testHowManyDocsHaveBoostFunctionComputed() {
for (int i = 0; i < 100; i++) {
assertU(adoc("id", "" + i));
}
diff --git a/solr/core/src/test/org/apache/solr/core/SolrCoreTest.java b/solr/core/src/test/org/apache/solr/core/SolrCoreTest.java
index c0f130e21bc..939db6e4ca7 100644
--- a/solr/core/src/test/org/apache/solr/core/SolrCoreTest.java
+++ b/solr/core/src/test/org/apache/solr/core/SolrCoreTest.java
@@ -163,7 +163,7 @@ public class SolrCoreTest extends SolrTestCaseJ4 {
}
@Test
- public void testRefCount() throws Exception {
+ public void testRefCount() {
SolrCore core = h.getCore();
assertTrue("Refcount != 1", core.getOpenCount() == 1);
@@ -269,7 +269,7 @@ public class SolrCoreTest extends SolrTestCaseJ4 {
}
@Test
- public void testInfoRegistry() throws Exception {
+ public void testInfoRegistry() {
// TEst that SolrInfoMBeans are registered, including SearchComponents
SolrCore core = h.getCore();
@@ -289,7 +289,7 @@ public class SolrCoreTest extends SolrTestCaseJ4 {
}
@Test
- public void testConfiguration() throws Exception {
+ public void testConfiguration() {
assertEquals(
"wrong config for slowQueryThresholdMillis", 2000, solrConfig.slowQueryThresholdMillis);
assertEquals("wrong config for maxBooleanClauses", 1024, solrConfig.booleanQueryMaxClauseCount);
diff --git a/solr/core/src/test/org/apache/solr/core/TestBackupRepositoryFactory.java b/solr/core/src/test/org/apache/solr/core/TestBackupRepositoryFactory.java
index 60cb11694cd..e4e2827c274 100644
--- a/solr/core/src/test/org/apache/solr/core/TestBackupRepositoryFactory.java
+++ b/solr/core/src/test/org/apache/solr/core/TestBackupRepositoryFactory.java
@@ -46,13 +46,13 @@ public class TestBackupRepositoryFactory extends SolrTestCaseJ4 {
private static SolrResourceLoader loader = null;
@BeforeClass
- public static void setupLoader() throws Exception {
+ public static void setupLoader() {
solrHome = createTempDir().toFile();
loader = new SolrResourceLoader(solrHome.toPath());
}
@AfterClass
- public static void cleanupLoader() throws Exception {
+ public static void cleanupLoader() {
solrHome = null;
loader = null;
}
diff --git a/solr/core/src/test/org/apache/solr/core/TestCodecSupport.java b/solr/core/src/test/org/apache/solr/core/TestCodecSupport.java
index c309eddc709..56ce4ce8deb 100644
--- a/solr/core/src/test/org/apache/solr/core/TestCodecSupport.java
+++ b/solr/core/src/test/org/apache/solr/core/TestCodecSupport.java
@@ -188,7 +188,7 @@ public class TestCodecSupport extends SolrTestCaseJ4 {
System.clearProperty("tests.COMPRESSION_MODE");
}
- public void testBadCompressionMode() throws Exception {
+ public void testBadCompressionMode() {
SolrException thrown =
expectThrows(
SolrException.class,
diff --git a/solr/core/src/test/org/apache/solr/core/TestConfig.java b/solr/core/src/test/org/apache/solr/core/TestConfig.java
index 75b944836ed..6e5a3a24220 100644
--- a/solr/core/src/test/org/apache/solr/core/TestConfig.java
+++ b/solr/core/src/test/org/apache/solr/core/TestConfig.java
@@ -73,7 +73,7 @@ public class TestConfig extends SolrTestCaseJ4 {
}
@Test
- public void testDisableRequetsHandler() throws Exception {
+ public void testDisableRequetsHandler() {
assertNull(h.getCore().getRequestHandler("/disabled"));
assertNotNull(h.getCore().getRequestHandler("/enabled"));
}
diff --git a/solr/core/src/test/org/apache/solr/core/TestConfigSetImmutable.java b/solr/core/src/test/org/apache/solr/core/TestConfigSetImmutable.java
index ec5f29229b3..14e17706c6f 100644
--- a/solr/core/src/test/org/apache/solr/core/TestConfigSetImmutable.java
+++ b/solr/core/src/test/org/apache/solr/core/TestConfigSetImmutable.java
@@ -110,7 +110,7 @@ public class TestConfigSetImmutable extends RestTestBase {
}
@Test
- public void testAddSchemaFieldsImmutable() throws Exception {
+ public void testAddSchemaFieldsImmutable() {
final String error = "error";
// check writing an existing field is okay
diff --git a/solr/core/src/test/org/apache/solr/core/TestConfigSetProperties.java b/solr/core/src/test/org/apache/solr/core/TestConfigSetProperties.java
index 3610e549743..e3aeea8a55a 100644
--- a/solr/core/src/test/org/apache/solr/core/TestConfigSetProperties.java
+++ b/solr/core/src/test/org/apache/solr/core/TestConfigSetProperties.java
@@ -42,7 +42,7 @@ public class TestConfigSetProperties extends SolrTestCaseJ4 {
}
@Test
- public void testEmptyConfigSetProperties() throws Exception {
+ public void testEmptyConfigSetProperties() {
SolrException thrown =
expectThrows(
SolrException.class,
@@ -53,7 +53,7 @@ public class TestConfigSetProperties extends SolrTestCaseJ4 {
}
@Test
- public void testConfigSetPropertiesNotMap() throws Exception {
+ public void testConfigSetPropertiesNotMap() {
SolrException thrown =
expectThrows(
SolrException.class,
diff --git a/solr/core/src/test/org/apache/solr/core/TestConfigSets.java b/solr/core/src/test/org/apache/solr/core/TestConfigSets.java
index 58ee28f3475..fe55fa43dec 100644
--- a/solr/core/src/test/org/apache/solr/core/TestConfigSets.java
+++ b/solr/core/src/test/org/apache/solr/core/TestConfigSets.java
@@ -53,7 +53,7 @@ public class TestConfigSets extends SolrTestCaseJ4 {
}
@Test
- public void testDefaultConfigSetBasePathResolution() throws IOException {
+ public void testDefaultConfigSetBasePathResolution() {
Path solrHome = Paths.get("/path/to/solr/home");
NodeConfig config =
diff --git a/solr/core/src/test/org/apache/solr/core/TestShardHandlerFactory.java b/solr/core/src/test/org/apache/solr/core/TestShardHandlerFactory.java
index b920c6a0bfb..707214014a1 100644
--- a/solr/core/src/test/org/apache/solr/core/TestShardHandlerFactory.java
+++ b/solr/core/src/test/org/apache/solr/core/TestShardHandlerFactory.java
@@ -24,7 +24,7 @@ import org.apache.solr.handler.component.ShardHandlerFactory;
/** Tests specifying a custom ShardHandlerFactory */
public class TestShardHandlerFactory extends SolrTestCaseJ4 {
- public void testXML() throws Exception {
+ public void testXML() {
Path home = TEST_PATH();
CoreContainer cc = CoreContainer.createAndLoad(home, home.resolve("solr-shardhandler.xml"));
ShardHandlerFactory factory = cc.getShardHandlerFactory();
diff --git a/solr/core/src/test/org/apache/solr/core/TestXIncludeConfig.java b/solr/core/src/test/org/apache/solr/core/TestXIncludeConfig.java
index 62dd2356d50..e6c6559730a 100644
--- a/solr/core/src/test/org/apache/solr/core/TestXIncludeConfig.java
+++ b/solr/core/src/test/org/apache/solr/core/TestXIncludeConfig.java
@@ -45,7 +45,7 @@ public class TestXIncludeConfig extends SolrTestCaseJ4 {
super.setUp();
}
- public void testXInclude() throws Exception {
+ public void testXInclude() {
SolrCore core = h.getCore();
assertNotNull("includedHandler is null", core.getRequestHandler("/includedHandler"));
diff --git a/solr/core/src/test/org/apache/solr/core/snapshots/TestSolrCloudSnapshots.java b/solr/core/src/test/org/apache/solr/core/snapshots/TestSolrCloudSnapshots.java
index 9e19036acc1..4d8bfeda690 100644
--- a/solr/core/src/test/org/apache/solr/core/snapshots/TestSolrCloudSnapshots.java
+++ b/solr/core/src/test/org/apache/solr/core/snapshots/TestSolrCloudSnapshots.java
@@ -81,7 +81,7 @@ public class TestSolrCloudSnapshots extends SolrCloudTestCase {
}
@AfterClass
- public static void teardownClass() throws Exception {
+ public static void teardownClass() {
System.clearProperty("test.build.data");
System.clearProperty("test.cache.data");
System.clearProperty("solr.allowPaths");
diff --git a/solr/core/src/test/org/apache/solr/core/snapshots/TestSolrCoreSnapshots.java b/solr/core/src/test/org/apache/solr/core/snapshots/TestSolrCoreSnapshots.java
index 8ec6bd90ee0..bc9bd222aab 100644
--- a/solr/core/src/test/org/apache/solr/core/snapshots/TestSolrCoreSnapshots.java
+++ b/solr/core/src/test/org/apache/solr/core/snapshots/TestSolrCoreSnapshots.java
@@ -83,7 +83,7 @@ public class TestSolrCoreSnapshots extends SolrCloudTestCase {
}
@AfterClass
- public static void teardownClass() throws Exception {
+ public static void teardownClass() {
System.clearProperty("test.build.data");
System.clearProperty("test.cache.data");
System.clearProperty("solr.allowPaths");
diff --git a/solr/core/src/test/org/apache/solr/handler/DocumentAnalysisRequestHandlerTest.java b/solr/core/src/test/org/apache/solr/handler/DocumentAnalysisRequestHandlerTest.java
index 645d838935c..3deab0bdd8c 100644
--- a/solr/core/src/test/org/apache/solr/handler/DocumentAnalysisRequestHandlerTest.java
+++ b/solr/core/src/test/org/apache/solr/handler/DocumentAnalysisRequestHandlerTest.java
@@ -123,7 +123,7 @@ public class DocumentAnalysisRequestHandlerTest extends AnalysisRequestHandlerTe
}
@Override
- public InputStream getStream() throws IOException {
+ public InputStream getStream() {
return new ByteArrayInputStream(bytes);
}
@@ -207,7 +207,7 @@ public class DocumentAnalysisRequestHandlerTest extends AnalysisRequestHandlerTe
*/
@Test
@SuppressWarnings({"unchecked", "rawtypes"})
- public void testHandleAnalysisRequest() throws Exception {
+ public void testHandleAnalysisRequest() {
SolrInputDocument document = new SolrInputDocument();
document.addField("id", 1);
diff --git a/solr/core/src/test/org/apache/solr/handler/FieldAnalysisRequestHandlerTest.java b/solr/core/src/test/org/apache/solr/handler/FieldAnalysisRequestHandlerTest.java
index acabc717381..eca1e32e9aa 100644
--- a/solr/core/src/test/org/apache/solr/handler/FieldAnalysisRequestHandlerTest.java
+++ b/solr/core/src/test/org/apache/solr/handler/FieldAnalysisRequestHandlerTest.java
@@ -71,7 +71,7 @@ public class FieldAnalysisRequestHandlerTest extends AnalysisRequestHandlerTestB
}
@Test
- public void testPointField() throws Exception {
+ public void testPointField() {
FieldAnalysisRequest request = new FieldAnalysisRequest();
request.addFieldType("pint");
request.setFieldValue("5");
@@ -94,7 +94,7 @@ public class FieldAnalysisRequestHandlerTest extends AnalysisRequestHandlerTestB
* FieldAnalysisRequestHandler#resolveAnalysisRequest(org.apache.solr.request.SolrQueryRequest)}
*/
@Test
- public void testResolveAnalysisRequest() throws Exception {
+ public void testResolveAnalysisRequest() {
ModifiableSolrParams params = new ModifiableSolrParams();
params.add(AnalysisParams.FIELD_NAME, "text,nametext");
params.add(AnalysisParams.FIELD_TYPE, "whitetok,keywordtok");
@@ -178,7 +178,7 @@ public class FieldAnalysisRequestHandlerTest extends AnalysisRequestHandlerTestB
*/
@Test
@SuppressWarnings({"unchecked"})
- public void testHandleAnalysisRequest() throws Exception {
+ public void testHandleAnalysisRequest() {
FieldAnalysisRequest request = new FieldAnalysisRequest();
request.addFieldName("whitetok");
@@ -511,7 +511,7 @@ public class FieldAnalysisRequestHandlerTest extends AnalysisRequestHandlerTestB
}
@Test
- public void testCharFilterAnalysis() throws Exception {
+ public void testCharFilterAnalysis() {
FieldAnalysisRequest request = new FieldAnalysisRequest();
request.addFieldType("charfilthtmlmap");
@@ -551,7 +551,7 @@ public class FieldAnalysisRequestHandlerTest extends AnalysisRequestHandlerTestB
}
@Test
- public void testPositionHistoryWithWDGF() throws Exception {
+ public void testPositionHistoryWithWDGF() {
FieldAnalysisRequest request = new FieldAnalysisRequest();
request.addFieldType("skutype1");
@@ -633,7 +633,7 @@ public class FieldAnalysisRequestHandlerTest extends AnalysisRequestHandlerTestB
}
@SuppressWarnings({"unchecked"})
- public void testCommonGrams() throws Exception {
+ public void testCommonGrams() {
final FieldAnalysisRequest request = new FieldAnalysisRequest();
final String fieldType = "commongrams";
@@ -745,7 +745,7 @@ public class FieldAnalysisRequestHandlerTest extends AnalysisRequestHandlerTestB
}
@Test
- public void testSpatial() throws Exception {
+ public void testSpatial() {
FieldAnalysisRequest request = new FieldAnalysisRequest();
request.addFieldType("location_rpt");
request.setFieldValue("MULTIPOINT ((10 40), (40 30), (20 20), (30 10))");
@@ -771,7 +771,7 @@ public class FieldAnalysisRequestHandlerTest extends AnalysisRequestHandlerTestB
}
@Test // See SOLR-8460
- public void testCustomAttribute() throws Exception {
+ public void testCustomAttribute() {
FieldAnalysisRequest request = new FieldAnalysisRequest();
request.addFieldType("skutype1");
request.setFieldValue("hi, 3456-12 a Test");
@@ -810,7 +810,7 @@ public class FieldAnalysisRequestHandlerTest extends AnalysisRequestHandlerTestB
}
@Test(expected = Exception.class)
- public void testNoDefaultField() throws Exception {
+ public void testNoDefaultField() {
ModifiableSolrParams params = new ModifiableSolrParams();
params.add(CommonParams.Q, "fox brown");
SolrQueryRequest req = new LocalSolrQueryRequest(h.getCore(), params);
diff --git a/solr/core/src/test/org/apache/solr/handler/MoreLikeThisHandlerTest.java b/solr/core/src/test/org/apache/solr/handler/MoreLikeThisHandlerTest.java
index afa0bb44f6f..bd96f10a258 100644
--- a/solr/core/src/test/org/apache/solr/handler/MoreLikeThisHandlerTest.java
+++ b/solr/core/src/test/org/apache/solr/handler/MoreLikeThisHandlerTest.java
@@ -38,7 +38,7 @@ public class MoreLikeThisHandlerTest extends SolrTestCaseJ4 {
}
@Test
- public void testInterface() throws Exception {
+ public void testInterface() {
SolrCore core = h.getCore();
ModifiableSolrParams params = new ModifiableSolrParams();
@@ -237,7 +237,7 @@ public class MoreLikeThisHandlerTest extends SolrTestCaseJ4 {
}
@Test
- public void testMultifieldSimilarity() throws Exception {
+ public void testMultifieldSimilarity() {
SolrCore core = h.getCore();
ModifiableSolrParams params = new ModifiableSolrParams();
diff --git a/solr/core/src/test/org/apache/solr/handler/PingRequestHandlerTest.java b/solr/core/src/test/org/apache/solr/handler/PingRequestHandlerTest.java
index 14ebd940519..29b085c6049 100644
--- a/solr/core/src/test/org/apache/solr/handler/PingRequestHandlerTest.java
+++ b/solr/core/src/test/org/apache/solr/handler/PingRequestHandlerTest.java
@@ -158,7 +158,7 @@ public class PingRequestHandlerTest extends SolrTestCaseJ4 {
assertEquals("disabled", rsp.getValues().get("status"));
}
- public void testBadActionRaisesException() throws Exception {
+ public void testBadActionRaisesException() {
SolrException se =
expectThrows(SolrException.class, () -> makeRequest(handler, req("action", "badaction")));
assertEquals(SolrException.ErrorCode.BAD_REQUEST.code, se.code());
diff --git a/solr/core/src/test/org/apache/solr/handler/SearchHandlerTest.java b/solr/core/src/test/org/apache/solr/handler/SearchHandlerTest.java
index 28d90e77ca7..5f807088deb 100644
--- a/solr/core/src/test/org/apache/solr/handler/SearchHandlerTest.java
+++ b/solr/core/src/test/org/apache/solr/handler/SearchHandlerTest.java
@@ -30,7 +30,7 @@ public class SearchHandlerTest extends SolrTestCaseJ4 {
initCore("solrconfig.xml", "schema.xml");
}
- public void testSorting() throws Exception {
+ public void testSorting() {
assertU(adoc("id", "10", "title", "test", "val_s1", "aaa"));
assertU(adoc("id", "11", "title", "test", "val_s1", "bbb"));
assertU(adoc("id", "12", "title", "test", "val_s1", "ccc"));
diff --git a/solr/core/src/test/org/apache/solr/handler/TestContainerPlugin.java b/solr/core/src/test/org/apache/solr/handler/TestContainerPlugin.java
index 1c7b07b2f0d..78bfae8aa1a 100644
--- a/solr/core/src/test/org/apache/solr/handler/TestContainerPlugin.java
+++ b/solr/core/src/test/org/apache/solr/handler/TestContainerPlugin.java
@@ -39,7 +39,6 @@ import org.apache.solr.api.ConfigurablePlugin;
import org.apache.solr.api.ContainerPluginsRegistry;
import org.apache.solr.api.EndPoint;
import org.apache.solr.client.solrj.SolrClient;
-import org.apache.solr.client.solrj.SolrServerException;
import org.apache.solr.client.solrj.embedded.JettySolrRunner;
import org.apache.solr.client.solrj.impl.BaseHttpSolrClient.RemoteExecutionException;
import org.apache.solr.client.solrj.request.V2Request;
@@ -457,15 +456,13 @@ public class TestContainerPlugin extends SolrCloudTestCase {
}
}
- private void expectError(V2Request req, String expectErrorMsg)
- throws IOException, SolrServerException {
+ private void expectError(V2Request req, String expectErrorMsg) {
String errPath = "/error/details[0]/errorMessages[0]";
expectError(req, cluster.getSolrClient(), errPath, expectErrorMsg);
}
private static void expectError(
- V2Request req, SolrClient client, String errPath, String expectErrorMsg)
- throws IOException, SolrServerException {
+ V2Request req, SolrClient client, String errPath, String expectErrorMsg) {
RemoteExecutionException e =
expectThrows(RemoteExecutionException.class, () -> req.process(client));
String msg = e.getMetaData()._getStr(errPath, "");
diff --git a/solr/core/src/test/org/apache/solr/handler/TestIncrementalCoreBackup.java b/solr/core/src/test/org/apache/solr/handler/TestIncrementalCoreBackup.java
index 12c0c9977aa..80c0d073b84 100644
--- a/solr/core/src/test/org/apache/solr/handler/TestIncrementalCoreBackup.java
+++ b/solr/core/src/test/org/apache/solr/handler/TestIncrementalCoreBackup.java
@@ -46,7 +46,7 @@ public class TestIncrementalCoreBackup extends SolrTestCaseJ4 {
}
@After // unique core per test
- public void coreDestroy() throws Exception {
+ public void coreDestroy() {
deleteCore();
}
diff --git a/solr/core/src/test/org/apache/solr/handler/TestSnapshotCoreBackup.java b/solr/core/src/test/org/apache/solr/handler/TestSnapshotCoreBackup.java
index e10cbde5263..4e440c84878 100644
--- a/solr/core/src/test/org/apache/solr/handler/TestSnapshotCoreBackup.java
+++ b/solr/core/src/test/org/apache/solr/handler/TestSnapshotCoreBackup.java
@@ -43,7 +43,7 @@ public class TestSnapshotCoreBackup extends SolrTestCaseJ4 {
}
@After // unique core per test
- public void coreDestroy() throws Exception {
+ public void coreDestroy() {
deleteCore();
}
diff --git a/solr/core/src/test/org/apache/solr/handler/TestSolrConfigHandlerCloud.java b/solr/core/src/test/org/apache/solr/handler/TestSolrConfigHandlerCloud.java
index f804cb8b4ed..87a31f226c1 100644
--- a/solr/core/src/test/org/apache/solr/handler/TestSolrConfigHandlerCloud.java
+++ b/solr/core/src/test/org/apache/solr/handler/TestSolrConfigHandlerCloud.java
@@ -18,7 +18,6 @@ package org.apache.solr.handler;
import static java.util.Arrays.asList;
-import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@@ -81,8 +80,7 @@ public class TestSolrConfigHandlerCloud extends AbstractFullDistribZkTestBase {
TestSolrConfigHandler.reqhandlertests(writeHarness, testServerBaseUrl, cloudClient);
}
- public static String getRandomServer(CloudSolrClient cloudClient, String collName)
- throws IOException {
+ public static String getRandomServer(CloudSolrClient cloudClient, String collName) {
DocCollection coll = cloudClient.getClusterState().getCollection(collName);
List<String> urls = new ArrayList<>();
for (Slice slice : coll.getSlices()) {
diff --git a/solr/core/src/test/org/apache/solr/handler/V2ApiIntegrationTest.java b/solr/core/src/test/org/apache/solr/handler/V2ApiIntegrationTest.java
index 5336b2ed92d..eab42e0383f 100644
--- a/solr/core/src/test/org/apache/solr/handler/V2ApiIntegrationTest.java
+++ b/solr/core/src/test/org/apache/solr/handler/V2ApiIntegrationTest.java
@@ -63,8 +63,7 @@ public class V2ApiIntegrationTest extends SolrCloudTestCase {
}
private void testException(
- ResponseParser responseParser, int expectedCode, String path, String payload)
- throws IOException, SolrServerException {
+ ResponseParser responseParser, int expectedCode, String path, String payload) {
V2Request v2Request =
new V2Request.Builder(path)
.withMethod(SolrRequest.METHOD.POST)
diff --git a/solr/core/src/test/org/apache/solr/handler/V2ClusterAPIMappingTest.java b/solr/core/src/test/org/apache/solr/handler/V2ClusterAPIMappingTest.java
index 20c4bccdab0..7db47485103 100644
--- a/solr/core/src/test/org/apache/solr/handler/V2ClusterAPIMappingTest.java
+++ b/solr/core/src/test/org/apache/solr/handler/V2ClusterAPIMappingTest.java
@@ -61,7 +61,7 @@ public class V2ClusterAPIMappingTest {
}
@Before
- public void setupApiBag() throws Exception {
+ public void setupApiBag() {
mockCollectionsHandler = mock(CollectionsHandler.class);
mockConfigSetHandler = mock(ConfigSetsHandler.class);
queryRequestCaptor = ArgumentCaptor.forClass(SolrQueryRequest.class);
diff --git a/solr/core/src/test/org/apache/solr/handler/V2UpdateAPIMappingTest.java b/solr/core/src/test/org/apache/solr/handler/V2UpdateAPIMappingTest.java
index a7955a6b400..39f6de7efcf 100644
--- a/solr/core/src/test/org/apache/solr/handler/V2UpdateAPIMappingTest.java
+++ b/solr/core/src/test/org/apache/solr/handler/V2UpdateAPIMappingTest.java
@@ -53,7 +53,7 @@ public class V2UpdateAPIMappingTest {
}
@Before
- public void setupApiBag() throws Exception {
+ public void setupApiBag() {
mockUpdateHandler = mock(UpdateRequestHandler.class);
mockConfigSetHandler = mock(ConfigSetsHandler.class);
queryRequestCaptor = ArgumentCaptor.forClass(SolrQueryRequest.class);
diff --git a/solr/core/src/test/org/apache/solr/handler/XmlUpdateRequestHandlerTest.java b/solr/core/src/test/org/apache/solr/handler/XmlUpdateRequestHandlerTest.java
index 886f1209ed6..08d4d6c1f84 100644
--- a/solr/core/src/test/org/apache/solr/handler/XmlUpdateRequestHandlerTest.java
+++ b/solr/core/src/test/org/apache/solr/handler/XmlUpdateRequestHandlerTest.java
@@ -16,7 +16,6 @@
*/
package org.apache.solr.handler;
-import java.io.IOException;
import java.io.StringReader;
import java.util.Collection;
import java.util.LinkedList;
@@ -135,7 +134,7 @@ public class XmlUpdateRequestHandlerTest extends SolrTestCaseJ4 {
req.close();
}
- public void testNamedEntity() throws Exception {
+ public void testNamedEntity() {
assertU(
"<?xml version=\"1.0\" ?>\n"
+ "<!DOCTYPE add [\n<!ENTITY wacky \"zzz\" >\n]>"
@@ -193,7 +192,7 @@ public class XmlUpdateRequestHandlerTest extends SolrTestCaseJ4 {
}
@Test
- public void XMLLoader_denseVector_shouldIndexCorrectly() throws Exception {
+ public void XMLLoader_denseVector_shouldIndexCorrectly() {
assertU(
"<?xml version=\"1.0\" ?>\n"
+ "<add><doc>"
@@ -239,7 +238,7 @@ public class XmlUpdateRequestHandlerTest extends SolrTestCaseJ4 {
}
@Override
- public void processDelete(DeleteUpdateCommand cmd) throws IOException {
+ public void processDelete(DeleteUpdateCommand cmd) {
DeleteUpdateCommand expected = deleteCommands.poll();
assertNotNull("Unexpected delete command: [" + cmd + "]", expected);
assertTrue(
diff --git a/solr/core/src/test/org/apache/solr/handler/admin/CoreAdminOperationTest.java b/solr/core/src/test/org/apache/solr/handler/admin/CoreAdminOperationTest.java
index f286d6aaa3a..384b78c9487 100644
--- a/solr/core/src/test/org/apache/solr/handler/admin/CoreAdminOperationTest.java
+++ b/solr/core/src/test/org/apache/solr/handler/admin/CoreAdminOperationTest.java
@@ -55,7 +55,7 @@ public class CoreAdminOperationTest extends SolrTestCaseJ4 {
}
@Test
- public void testStatusUnexpectedFailuresResultIn500SolrException() throws Exception {
+ public void testStatusUnexpectedFailuresResultIn500SolrException() {
final Throwable cause = new NullPointerException();
whenUnexpectedErrorOccursDuringCoreAdminOp(cause);
@@ -65,7 +65,7 @@ public class CoreAdminOperationTest extends SolrTestCaseJ4 {
}
@Test
- public void testUnloadUnexpectedFailuresResultIn500SolrException() throws Exception {
+ public void testUnloadUnexpectedFailuresResultIn500SolrException() {
final Throwable cause = new NullPointerException();
whenUnexpectedErrorOccursDuringCoreAdminOp(cause);
@@ -75,7 +75,7 @@ public class CoreAdminOperationTest extends SolrTestCaseJ4 {
}
@Test
- public void testUnloadMissingCoreNameResultsIn400SolrException() throws Exception {
+ public void testUnloadMissingCoreNameResultsIn400SolrException() {
whenCoreAdminOpHasParams(Maps.newHashMap());
Exception ex =
diff --git a/solr/core/src/test/org/apache/solr/handler/admin/HealthCheckHandlerTest.java b/solr/core/src/test/org/apache/solr/handler/admin/HealthCheckHandlerTest.java
index 3e7b1d76d8e..cd0a7d5661a 100644
--- a/solr/core/src/test/org/apache/solr/handler/admin/HealthCheckHandlerTest.java
+++ b/solr/core/src/test/org/apache/solr/handler/admin/HealthCheckHandlerTest.java
@@ -212,7 +212,7 @@ public class HealthCheckHandlerTest extends SolrCloudTestCase {
}
@Test
- public void testFindUnhealthyCores() throws Exception {
+ public void testFindUnhealthyCores() {
// Simulate two nodes, with two collections:
// node1: collection1 -> shard1: [ replica1 (active), replica3 (down) ]
// collection2 -> shard1: [ replica2 (recovering) ]
diff --git a/solr/core/src/test/org/apache/solr/handler/admin/IndexSizeEstimatorTest.java b/solr/core/src/test/org/apache/solr/handler/admin/IndexSizeEstimatorTest.java
index 3e35bae0482..4a8592ce1bb 100644
--- a/solr/core/src/test/org/apache/solr/handler/admin/IndexSizeEstimatorTest.java
+++ b/solr/core/src/test/org/apache/solr/handler/admin/IndexSizeEstimatorTest.java
@@ -81,7 +81,7 @@ public class IndexSizeEstimatorTest extends SolrCloudTestCase {
}
@AfterClass
- public static void releaseClient() throws Exception {
+ public static void releaseClient() {
solrClient = null;
}
diff --git a/solr/core/src/test/org/apache/solr/handler/admin/LukeRequestHandlerTest.java b/solr/core/src/test/org/apache/solr/handler/admin/LukeRequestHandlerTest.java
index 89012c50a9f..ff0c2bc1513 100644
--- a/solr/core/src/test/org/apache/solr/handler/admin/LukeRequestHandlerTest.java
+++ b/solr/core/src/test/org/apache/solr/handler/admin/LukeRequestHandlerTest.java
@@ -194,7 +194,7 @@ public class LukeRequestHandlerTest extends SolrTestCaseJ4 {
}
}
- public void testNumTerms() throws Exception {
+ public void testNumTerms() {
final String f = "name";
for (String n : new String[] {"2", "3", "100", "99999"}) {
assertQ(
diff --git a/solr/core/src/test/org/apache/solr/handler/admin/MetricsHandlerTest.java b/solr/core/src/test/org/apache/solr/handler/admin/MetricsHandlerTest.java
index 1289af9dbe0..40dfba5d6ae 100644
--- a/solr/core/src/test/org/apache/solr/handler/admin/MetricsHandlerTest.java
+++ b/solr/core/src/test/org/apache/solr/handler/admin/MetricsHandlerTest.java
@@ -60,7 +60,7 @@ public class MetricsHandlerTest extends SolrTestCaseJ4 {
}
@AfterClass
- public static void cleanupMetrics() throws Exception {
+ public static void cleanupMetrics() {
if (null != h) {
h.getCoreContainer().getMetricManager().registry("solr.jvm").remove("solrtest_foo");
h.getCoreContainer().getMetricManager().registry("solr.jetty").remove("solrtest_foo");
@@ -809,7 +809,7 @@ public class MetricsHandlerTest extends SolrTestCaseJ4 {
this.rh.close();
}
- void reset(DumpRequestHandler rh) throws Exception {
+ void reset(DumpRequestHandler rh) {
this.rh = rh;
if (metricsInfo != null) this.rh.initializeMetrics(metricsInfo, "/dumphandler");
}
diff --git a/solr/core/src/test/org/apache/solr/handler/admin/ShowFileRequestHandlerTest.java b/solr/core/src/test/org/apache/solr/handler/admin/ShowFileRequestHandlerTest.java
index 7a133eb3630..2950c66e25c 100644
--- a/solr/core/src/test/org/apache/solr/handler/admin/ShowFileRequestHandlerTest.java
+++ b/solr/core/src/test/org/apache/solr/handler/admin/ShowFileRequestHandlerTest.java
@@ -50,7 +50,7 @@ public class ShowFileRequestHandlerTest extends SolrJettyTestBase {
createAndStartJetty(legacyExampleCollection1SolrHome());
}
- public void test404ViaHttp() throws Exception {
+ public void test404ViaHttp() {
SolrClient client = getSolrClient();
QueryRequest request = new QueryRequest(params("file", "does-not-exist-404.txt"));
request.setPath("/admin/file");
@@ -58,7 +58,7 @@ public class ShowFileRequestHandlerTest extends SolrJettyTestBase {
assertEquals(404, e.code());
}
- public void test404Locally() throws Exception {
+ public void test404Locally() {
// we need to test that executing the handler directly does not
// throw an exception, just sets the exception on the response.
@@ -121,7 +121,7 @@ public class ShowFileRequestHandlerTest extends SolrJettyTestBase {
assertTrue(readFile.get());
}
- public void testContentTypeHtmlBecomesTextPlain() throws Exception {
+ public void testContentTypeHtmlBecomesTextPlain() {
SolrRequestHandler handler = h.getCore().getRequestHandler("/admin/file");
SolrQueryRequest req =
new LocalSolrQueryRequest(
@@ -133,7 +133,7 @@ public class ShowFileRequestHandlerTest extends SolrJettyTestBase {
assertEquals("text/plain", content.getContentType());
}
- public void testContentTypeHtmlDefault() throws Exception {
+ public void testContentTypeHtmlDefault() {
SolrRequestHandler handler = h.getCore().getRequestHandler("/admin/file");
SolrQueryRequest req = new LocalSolrQueryRequest(h.getCore(), params("file", "example.html"));
SolrQueryResponse rsp = new SolrQueryResponse();
diff --git a/solr/core/src/test/org/apache/solr/handler/admin/SplitHandlerTest.java b/solr/core/src/test/org/apache/solr/handler/admin/SplitHandlerTest.java
index ee819753451..ab542bf1154 100644
--- a/solr/core/src/test/org/apache/solr/handler/admin/SplitHandlerTest.java
+++ b/solr/core/src/test/org/apache/solr/handler/admin/SplitHandlerTest.java
@@ -84,14 +84,14 @@ public class SplitHandlerTest extends SolrTestCaseJ4 {
}
@Test
- public void testRandomSplitRecommendations() throws Exception {
+ public void testRandomSplitRecommendations() {
Random rand = random();
for (int i = 0; i < 10000; i++) { // 1M takes ~ 1 sec
doRandomSplitRecommendation(rand);
}
}
- public void doRandomSplitRecommendation(Random rand) throws Exception {
+ public void doRandomSplitRecommendation(Random rand) {
int low = 0;
int high = 0;
diff --git a/solr/core/src/test/org/apache/solr/handler/admin/StatsReloadRaceTest.java b/solr/core/src/test/org/apache/solr/handler/admin/StatsReloadRaceTest.java
index 1f5b3ca84fb..0bca9183832 100644
--- a/solr/core/src/test/org/apache/solr/handler/admin/StatsReloadRaceTest.java
+++ b/solr/core/src/test/org/apache/solr/handler/admin/StatsReloadRaceTest.java
@@ -82,7 +82,7 @@ public class StatsReloadRaceTest extends SolrTestCaseJ4 {
}
}
- private void requestCoreStatus() throws Exception {
+ private void requestCoreStatus() {
SolrQueryResponse rsp = new SolrQueryResponse();
h.getCoreContainer()
.getMultiCoreHandler()
diff --git a/solr/core/src/test/org/apache/solr/handler/admin/SystemInfoHandlerTest.java b/solr/core/src/test/org/apache/solr/handler/admin/SystemInfoHandlerTest.java
index c61af34c26e..d9998ee109f 100644
--- a/solr/core/src/test/org/apache/solr/handler/admin/SystemInfoHandlerTest.java
+++ b/solr/core/src/test/org/apache/solr/handler/admin/SystemInfoHandlerTest.java
@@ -26,7 +26,7 @@ import org.apache.solr.util.stats.MetricUtils;
public class SystemInfoHandlerTest extends SolrTestCase {
- public void testMagickGetter() throws Exception {
+ public void testMagickGetter() {
OperatingSystemMXBean os = ManagementFactory.getOperatingSystemMXBean();
diff --git a/solr/core/src/test/org/apache/solr/handler/admin/TestApiFramework.java b/solr/core/src/test/org/apache/solr/handler/admin/TestApiFramework.java
index 858c92c44ab..c9c031fb34b 100644
--- a/solr/core/src/test/org/apache/solr/handler/admin/TestApiFramework.java
+++ b/solr/core/src/test/org/apache/solr/handler/admin/TestApiFramework.java
@@ -27,7 +27,6 @@ import static org.apache.solr.common.params.CommonParams.CORES_HANDLER_PATH;
import static org.apache.solr.common.util.ValidatingJsonMap.NOT_NULL;
import java.io.ByteArrayInputStream;
-import java.io.IOException;
import java.io.InputStream;
import java.util.Collections;
import java.util.HashMap;
@@ -175,7 +174,7 @@ public class TestApiFramework extends SolrTestCaseJ4 {
"availableSubPaths /collections/hello/shards/{shard}/{replica}", NOT_NULL));
}
- public void testPayload() throws IOException {
+ public void testPayload() {
String json = "{package:pkg1, version: '0.1', files :[a.jar, b.jar]}";
Utils.fromJSONString(json);
@@ -325,7 +324,7 @@ public class TestApiFramework extends SolrTestCaseJ4 {
return Collections.singletonList(
new ContentStreamBase() {
@Override
- public InputStream getStream() throws IOException {
+ public InputStream getStream() {
return payload;
}
});
diff --git a/solr/core/src/test/org/apache/solr/handler/admin/TestCollectionAPIs.java b/solr/core/src/test/org/apache/solr/handler/admin/TestCollectionAPIs.java
index 09327fd37d4..ee608e531ec 100644
--- a/solr/core/src/test/org/apache/solr/handler/admin/TestCollectionAPIs.java
+++ b/solr/core/src/test/org/apache/solr/handler/admin/TestCollectionAPIs.java
@@ -284,8 +284,7 @@ public class TestCollectionAPIs extends SolrTestCaseJ4 {
final SolrRequest.METHOD method,
final String payload,
final CoreContainer cc,
- String expectedOutputMapJson)
- throws Exception {
+ String expectedOutputMapJson) {
Pair<SolrQueryRequest, SolrQueryResponse> ctx = makeCall(apiBag, path, method, payload, cc);
ZkNodeProps output = (ZkNodeProps) ctx.second().getValues().get(ZkNodeProps.class.getName());
@SuppressWarnings("unchecked")
@@ -300,8 +299,7 @@ public class TestCollectionAPIs extends SolrTestCaseJ4 {
final SolrRequest.METHOD method,
final String payload,
final CoreContainer cc,
- String expectedErrorMsg)
- throws Exception {
+ String expectedErrorMsg) {
RuntimeException e =
expectThrows(RuntimeException.class, () -> makeCall(apiBag, path, method, payload, cc));
assertTrue(
@@ -317,8 +315,7 @@ public class TestCollectionAPIs extends SolrTestCaseJ4 {
String path,
final SolrRequest.METHOD method,
final String payload,
- final CoreContainer cc)
- throws Exception {
+ final CoreContainer cc) {
SolrParams queryParams = new MultiMapSolrParams(Collections.emptyMap());
if (path.indexOf('?') > 0) {
String queryStr = path.substring(path.indexOf('?') + 1);
diff --git a/solr/core/src/test/org/apache/solr/handler/admin/V2CollectionBackupsAPIMappingTest.java b/solr/core/src/test/org/apache/solr/handler/admin/V2CollectionBackupsAPIMappingTest.java
index 6ad3ccad53f..9f894682518 100644
--- a/solr/core/src/test/org/apache/solr/handler/admin/V2CollectionBackupsAPIMappingTest.java
+++ b/solr/core/src/test/org/apache/solr/handler/admin/V2CollectionBackupsAPIMappingTest.java
@@ -57,7 +57,7 @@ public class V2CollectionBackupsAPIMappingTest extends SolrTestCaseJ4 {
}
@Before
- public void setupApiBag() throws Exception {
+ public void setupApiBag() {
mockCollectionsHandler = mock(CollectionsHandler.class);
queryRequestCaptor = ArgumentCaptor.forClass(SolrQueryRequest.class);
diff --git a/solr/core/src/test/org/apache/solr/handler/admin/V2CollectionsAPIMappingTest.java b/solr/core/src/test/org/apache/solr/handler/admin/V2CollectionsAPIMappingTest.java
index f2eff0b8629..788e7494974 100644
--- a/solr/core/src/test/org/apache/solr/handler/admin/V2CollectionsAPIMappingTest.java
+++ b/solr/core/src/test/org/apache/solr/handler/admin/V2CollectionsAPIMappingTest.java
@@ -81,7 +81,7 @@ public class V2CollectionsAPIMappingTest extends SolrTestCaseJ4 {
}
@Before
- public void setupApiBag() throws Exception {
+ public void setupApiBag() {
mockCollectionsHandler = mock(CollectionsHandler.class);
queryRequestCaptor = ArgumentCaptor.forClass(SolrQueryRequest.class);
diff --git a/solr/core/src/test/org/apache/solr/handler/admin/api/V2CollectionAPIMappingTest.java b/solr/core/src/test/org/apache/solr/handler/admin/api/V2CollectionAPIMappingTest.java
index 3deaf524185..bf2af4e6f31 100644
--- a/solr/core/src/test/org/apache/solr/handler/admin/api/V2CollectionAPIMappingTest.java
+++ b/solr/core/src/test/org/apache/solr/handler/admin/api/V2CollectionAPIMappingTest.java
@@ -78,7 +78,7 @@ public class V2CollectionAPIMappingTest extends SolrTestCaseJ4 {
}
@Before
- public void setupApiBag() throws Exception {
+ public void setupApiBag() {
mockCollectionsHandler = mock(CollectionsHandler.class);
queryRequestCaptor = ArgumentCaptor.forClass(SolrQueryRequest.class);
diff --git a/solr/core/src/test/org/apache/solr/handler/admin/api/V2CoreAPIMappingTest.java b/solr/core/src/test/org/apache/solr/handler/admin/api/V2CoreAPIMappingTest.java
index 2ff782f7eb5..a11dfce9750 100644
--- a/solr/core/src/test/org/apache/solr/handler/admin/api/V2CoreAPIMappingTest.java
+++ b/solr/core/src/test/org/apache/solr/handler/admin/api/V2CoreAPIMappingTest.java
@@ -71,7 +71,7 @@ public class V2CoreAPIMappingTest extends SolrTestCaseJ4 {
}
@Before
- public void setupApiBag() throws Exception {
+ public void setupApiBag() {
mockCoreHandler = mock(CoreAdminHandler.class);
queryRequestCaptor = ArgumentCaptor.forClass(SolrQueryRequest.class);
diff --git a/solr/core/src/test/org/apache/solr/handler/admin/api/V2NodeAPIMappingTest.java b/solr/core/src/test/org/apache/solr/handler/admin/api/V2NodeAPIMappingTest.java
index 261ad17fbb3..159e3d2e59b 100644
--- a/solr/core/src/test/org/apache/solr/handler/admin/api/V2NodeAPIMappingTest.java
+++ b/solr/core/src/test/org/apache/solr/handler/admin/api/V2NodeAPIMappingTest.java
@@ -70,7 +70,7 @@ public class V2NodeAPIMappingTest {
}
@Before
- public void setupApiBag() throws Exception {
+ public void setupApiBag() {
mockCoresHandler = mock(CoreAdminHandler.class);
infoHandler = mock(InfoHandler.class);
mockSystemInfoHandler = mock(SystemInfoHandler.class);
diff --git a/solr/core/src/test/org/apache/solr/handler/admin/api/V2ShardsAPIMappingTest.java b/solr/core/src/test/org/apache/solr/handler/admin/api/V2ShardsAPIMappingTest.java
index d59d50cf713..127183c386c 100644
--- a/solr/core/src/test/org/apache/solr/handler/admin/api/V2ShardsAPIMappingTest.java
+++ b/solr/core/src/test/org/apache/solr/handler/admin/api/V2ShardsAPIMappingTest.java
@@ -73,7 +73,7 @@ public class V2ShardsAPIMappingTest {
}
@Before
- public void setupApiBag() throws Exception {
+ public void setupApiBag() {
mockCollectionsHandler = mock(CollectionsHandler.class);
queryRequestCaptor = ArgumentCaptor.forClass(SolrQueryRequest.class);
diff --git a/solr/core/src/test/org/apache/solr/handler/component/BadComponentTest.java b/solr/core/src/test/org/apache/solr/handler/component/BadComponentTest.java
index e6fd6fb3747..dd6a83e2666 100644
--- a/solr/core/src/test/org/apache/solr/handler/component/BadComponentTest.java
+++ b/solr/core/src/test/org/apache/solr/handler/component/BadComponentTest.java
@@ -37,7 +37,7 @@ public class BadComponentTest extends SolrTestCaseJ4 {
}
@After
- public void deleteCoreThatFailedToInit() throws Exception {
+ public void deleteCoreThatFailedToInit() {
deleteCore();
}
}
diff --git a/solr/core/src/test/org/apache/solr/handler/component/CustomHighlightComponentTest.java b/solr/core/src/test/org/apache/solr/handler/component/CustomHighlightComponentTest.java
index 8b7ebf51b72..c6bb670a5b3 100644
--- a/solr/core/src/test/org/apache/solr/handler/component/CustomHighlightComponentTest.java
+++ b/solr/core/src/test/org/apache/solr/handler/component/CustomHighlightComponentTest.java
@@ -245,8 +245,7 @@ public class CustomHighlightComponentTest extends SolrCloudTestCase {
}
protected void checkHighlightingResponseMap(
- Map<String, Map<String, List<String>>> highlightingMap, String highlightedField)
- throws Exception {
+ Map<String, Map<String, List<String>>> highlightingMap, String highlightedField) {
assertEquals(
"too few or too many keys: " + highlightingMap.keySet(), 3, highlightingMap.size());
checkHighlightingResponseMapElement(
@@ -261,8 +260,7 @@ public class CustomHighlightComponentTest extends SolrCloudTestCase {
Map<String, List<String>> docHighlights,
String highlightedField,
String preHighlightText,
- String highlightedText)
- throws Exception {
+ String highlightedText) {
if (highlightedField == null) {
assertEquals(0, docHighlights.size());
} else {
@@ -278,8 +276,7 @@ public class CustomHighlightComponentTest extends SolrCloudTestCase {
}
protected void checkHighlightingResponseList(
- ArrayList<SimpleOrderedMap<Object>> highlightingList, String highlightedField)
- throws Exception {
+ ArrayList<SimpleOrderedMap<Object>> highlightingList, String highlightedField) {
assertEquals(
"too few or too many elements: " + highlightingList.size(), 3, highlightingList.size());
final Set<String> seenDocIds = new HashSet<>();
diff --git a/solr/core/src/test/org/apache/solr/handler/component/DebugComponentTest.java b/solr/core/src/test/org/apache/solr/handler/component/DebugComponentTest.java
index e46917d9ef2..dcc97e7fe2a 100644
--- a/solr/core/src/test/org/apache/solr/handler/component/DebugComponentTest.java
+++ b/solr/core/src/test/org/apache/solr/handler/component/DebugComponentTest.java
@@ -44,7 +44,7 @@ public class DebugComponentTest extends SolrTestCaseJ4 {
}
@Test
- public void testBasicInterface() throws Exception {
+ public void testBasicInterface() {
// make sure the basics are in place
assertQ(
req("q", "*:*", CommonParams.DEBUG_QUERY, "true"),
@@ -69,7 +69,7 @@ public class DebugComponentTest extends SolrTestCaseJ4 {
// Test the ability to specify which pieces to include
@Test
- public void testPerItemInterface() throws Exception {
+ public void testPerItemInterface() {
// Same as debugQuery = true
assertQ(
req("q", "*:*", "debug", "true"),
@@ -241,7 +241,7 @@ public class DebugComponentTest extends SolrTestCaseJ4 {
// judgement when modifying these tests.
//
@Test
- public void testQueryToString() throws Exception {
+ public void testQueryToString() {
// test that both boosts are represented in a double-boost scenario
assertQ(
diff --git a/solr/core/src/test/org/apache/solr/handler/component/DistributedExpandComponentTest.java b/solr/core/src/test/org/apache/solr/handler/component/DistributedExpandComponentTest.java
index 1bacbdffaba..50b37c3eb31 100644
--- a/solr/core/src/test/org/apache/solr/handler/component/DistributedExpandComponentTest.java
+++ b/solr/core/src/test/org/apache/solr/handler/component/DistributedExpandComponentTest.java
@@ -533,7 +533,7 @@ public class DistributedExpandComponentTest extends BaseDistributedSearchTestCas
}
private void assertCountAndOrder(
- final int count, final SolrDocumentList results, final String... docs) throws Exception {
+ final int count, final SolrDocumentList results, final String... docs) {
assertEquals(results.toString(), count, results.size());
for (int i = 0; i < docs.length; i++) {
diff --git a/solr/core/src/test/org/apache/solr/handler/component/DistributedFacetExistsSmallTest.java b/solr/core/src/test/org/apache/solr/handler/component/DistributedFacetExistsSmallTest.java
index a34d0c2478e..712cc6d8bfc 100644
--- a/solr/core/src/test/org/apache/solr/handler/component/DistributedFacetExistsSmallTest.java
+++ b/solr/core/src/test/org/apache/solr/handler/component/DistributedFacetExistsSmallTest.java
@@ -18,12 +18,10 @@ package org.apache.solr.handler.component;
import static org.hamcrest.CoreMatchers.is;
-import java.io.IOException;
import java.util.List;
import java.util.Random;
import org.apache.solr.BaseDistributedSearchTestCase;
import org.apache.solr.client.solrj.SolrClient;
-import org.apache.solr.client.solrj.SolrServerException;
import org.apache.solr.client.solrj.response.FacetField;
import org.apache.solr.client.solrj.response.QueryResponse;
import org.apache.solr.common.SolrException;
@@ -143,7 +141,7 @@ public class DistributedFacetExistsSmallTest extends BaseDistributedSearchTestCa
query(params);
}
- private void checkInvalidMincount() throws SolrServerException, IOException {
+ private void checkInvalidMincount() {
final ModifiableSolrParams params = buildParams();
if (random().nextBoolean()) {
params.remove("facet.exists");
diff --git a/solr/core/src/test/org/apache/solr/handler/component/DistributedSpellCheckComponentTest.java b/solr/core/src/test/org/apache/solr/handler/component/DistributedSpellCheckComponentTest.java
index c280486b3ae..83aea9e73cb 100644
--- a/solr/core/src/test/org/apache/solr/handler/component/DistributedSpellCheckComponentTest.java
+++ b/solr/core/src/test/org/apache/solr/handler/component/DistributedSpellCheckComponentTest.java
@@ -71,7 +71,7 @@ public class DistributedSpellCheckComponentTest extends BaseDistributedSearchTes
}
@Override
- public void validateControlData(QueryResponse control) throws Exception {
+ public void validateControlData(QueryResponse control) {
NamedList<Object> nl = control.getResponse();
@SuppressWarnings("unchecked")
NamedList<Object> sc = (NamedList<Object>) nl.get("spellcheck");
diff --git a/solr/core/src/test/org/apache/solr/handler/component/DistributedSuggestComponentTest.java b/solr/core/src/test/org/apache/solr/handler/component/DistributedSuggestComponentTest.java
index ea3d596f7cf..e84c62cf086 100644
--- a/solr/core/src/test/org/apache/solr/handler/component/DistributedSuggestComponentTest.java
+++ b/solr/core/src/test/org/apache/solr/handler/component/DistributedSuggestComponentTest.java
@@ -52,7 +52,7 @@ public class DistributedSuggestComponentTest extends BaseDistributedSearchTestCa
}
@Override
- public void validateControlData(QueryResponse control) throws Exception {
+ public void validateControlData(QueryResponse control) {
NamedList<Object> nl = control.getResponse();
@SuppressWarnings("unchecked")
NamedList<SimpleOrderedMap<NamedList<Object>>> sc =
diff --git a/solr/core/src/test/org/apache/solr/handler/component/FacetPivotSmallTest.java b/solr/core/src/test/org/apache/solr/handler/component/FacetPivotSmallTest.java
index 1465c5840a0..fe5f6e59b9a 100644
--- a/solr/core/src/test/org/apache/solr/handler/component/FacetPivotSmallTest.java
+++ b/solr/core/src/test/org/apache/solr/handler/component/FacetPivotSmallTest.java
@@ -42,7 +42,7 @@ public class FacetPivotSmallTest extends SolrTestCaseJ4 {
}
/** we don't support comma's in the "stats" local param ... yet: SOLR-6663 */
- public void testStatsTagHasComma() throws Exception {
+ public void testStatsTagHasComma() {
if (random().nextBoolean()) {
// behavior should be same either way
@@ -68,7 +68,7 @@ public class FacetPivotSmallTest extends SolrTestCaseJ4 {
}
/** if bogus stats are requested, the pivots should still work */
- public void testBogusStatsTag() throws Exception {
+ public void testBogusStatsTag() {
index();
assertQ(
@@ -79,7 +79,7 @@ public class FacetPivotSmallTest extends SolrTestCaseJ4 {
"count(//arr[@name='place_t,company_t']/lst[str[@name='value'][.='dublin']]/lst[@name='stats'])=0");
}
- public void testPivotFacetUnsorted() throws Exception {
+ public void testPivotFacetUnsorted() {
index();
final ModifiableSolrParams params = new ModifiableSolrParams();
@@ -210,7 +210,7 @@ public class FacetPivotSmallTest extends SolrTestCaseJ4 {
+ "[str[@name='value'][.='cork']]/arr[@name='pivot']/lst[2]/int[@name='count'][.=1]");
}
- public void testPivotFacetStatsUnsortedTagged() throws Exception {
+ public void testPivotFacetStatsUnsortedTagged() {
index();
final ModifiableSolrParams params = new ModifiableSolrParams();
@@ -266,7 +266,7 @@ public class FacetPivotSmallTest extends SolrTestCaseJ4 {
"count(" + krakowFujitsuStats + "/*)=8");
}
- public void testPivotFacetSortedCount() throws Exception {
+ public void testPivotFacetSortedCount() {
index();
final ModifiableSolrParams params = new ModifiableSolrParams();
@@ -402,7 +402,7 @@ public class FacetPivotSmallTest extends SolrTestCaseJ4 {
+ "[str[@name='value'][.='cork']]/arr[@name='pivot']/lst[2]/int[@name='count'][.=1]");
}
- public void testPivotFacetLimit() throws Exception {
+ public void testPivotFacetLimit() {
index();
final ModifiableSolrParams params = new ModifiableSolrParams();
@@ -439,7 +439,7 @@ public class FacetPivotSmallTest extends SolrTestCaseJ4 {
+ "[str[@name='value'][.='london']]/arr[@name='pivot']/lst[2]/int[@name='count'][.=3]");
}
- public void testPivotIndividualFacetLimit() throws Exception {
+ public void testPivotIndividualFacetLimit() {
index();
final ModifiableSolrParams params = new ModifiableSolrParams();
@@ -476,7 +476,7 @@ public class FacetPivotSmallTest extends SolrTestCaseJ4 {
+ "[str[@name='value'][.='dublin']]/arr[@name='pivot']/lst[4]/int[@name='count'][.=2]");
}
- public void testPivotFacetMissing() throws Exception {
+ public void testPivotFacetMissing() {
// Test facet.missing=true with diff sorts
index();
indexMissing();
@@ -559,7 +559,7 @@ public class FacetPivotSmallTest extends SolrTestCaseJ4 {
facetPivotPrefix + "[1]/arr[@name='pivot']/lst[1][not(arr[@name='pivot'])]");
}
- public void testPivotFacetIndexSortMincountAndLimit() throws Exception {
+ public void testPivotFacetIndexSortMincountAndLimit() {
// sort=index + mincount + limit
index();
indexMissing();
@@ -604,7 +604,7 @@ public class FacetPivotSmallTest extends SolrTestCaseJ4 {
}
}
- public void testPivotFacetIndexSortMincountLimitAndOffset() throws Exception {
+ public void testPivotFacetIndexSortMincountLimitAndOffset() {
// sort=index + mincount + limit + offset
index();
indexMissing();
@@ -649,7 +649,7 @@ public class FacetPivotSmallTest extends SolrTestCaseJ4 {
}
}
- public void testPivotFacetIndexSortMincountLimitAndOffsetPermutations() throws Exception {
+ public void testPivotFacetIndexSortMincountLimitAndOffsetPermutations() {
// sort=index + mincount + limit + offset (more permutations)
index();
indexMissing();
diff --git a/solr/core/src/test/org/apache/solr/handler/component/ShardRequestTest.java b/solr/core/src/test/org/apache/solr/handler/component/ShardRequestTest.java
index 3cc27ac8c8b..86fedd37143 100644
--- a/solr/core/src/test/org/apache/solr/handler/component/ShardRequestTest.java
+++ b/solr/core/src/test/org/apache/solr/handler/component/ShardRequestTest.java
@@ -22,7 +22,7 @@ import org.junit.Test;
public class ShardRequestTest extends SolrTestCase {
@Test
- public void testDefaultPurposeIsZero() throws Exception {
+ public void testDefaultPurposeIsZero() {
final ShardRequest sr = new ShardRequest();
assertEquals(0, sr.purpose);
}
@@ -34,18 +34,18 @@ public class ShardRequestTest extends SolrTestCase {
* impacted by that.
*/
@Test
- public void testPurposePrivateIsOne() throws Exception {
+ public void testPurposePrivateIsOne() {
assertEquals(1, ShardRequest.PURPOSE_PRIVATE);
}
@Test
- public void testToStringWithDefaultPurpose() throws Exception {
+ public void testToStringWithDefaultPurpose() {
final ShardRequest sr = new ShardRequest();
assertEquals("ShardRequest:{params=null, purpose=0, nResponses =0}", sr.toString());
}
@Test
- public void testToStringWithPurposePrivate() throws Exception {
+ public void testToStringWithPurposePrivate() {
final ShardRequest sr = new ShardRequest();
sr.purpose = ShardRequest.PURPOSE_PRIVATE;
assertEquals("ShardRequest:{params=null, purpose=1, nResponses =0}", sr.toString());
diff --git a/solr/core/src/test/org/apache/solr/handler/component/SpellCheckComponentTest.java b/solr/core/src/test/org/apache/solr/handler/component/SpellCheckComponentTest.java
index 0b9aa279d6f..44b8d9ad9c1 100644
--- a/solr/core/src/test/org/apache/solr/handler/component/SpellCheckComponentTest.java
+++ b/solr/core/src/test/org/apache/solr/handler/component/SpellCheckComponentTest.java
@@ -291,7 +291,7 @@ public class SpellCheckComponentTest extends SolrTestCaseJ4 {
}
@Test
- public void testInvalidDictionary() throws Exception {
+ public void testInvalidDictionary() {
assertQEx(
"Invalid specified dictionary should throw exception",
"Specified dictionaries do not exist: INVALID",
@@ -481,7 +481,7 @@ public class SpellCheckComponentTest extends SolrTestCaseJ4 {
}
@Test
- public void testRelativeIndexDirLocation() throws Exception {
+ public void testRelativeIndexDirLocation() {
SolrCore core = h.getCore();
File indexDir = new File(core.getDataDir() + File.separator + "spellchecker1");
assertTrue(indexDir.exists());
diff --git a/solr/core/src/test/org/apache/solr/handler/component/SuggestComponentContextFilterQueryTest.java b/solr/core/src/test/org/apache/solr/handler/component/SuggestComponentContextFilterQueryTest.java
index e12bbae05a1..73100901d29 100644
--- a/solr/core/src/test/org/apache/solr/handler/component/SuggestComponentContextFilterQueryTest.java
+++ b/solr/core/src/test/org/apache/solr/handler/component/SuggestComponentContextFilterQueryTest.java
@@ -106,7 +106,7 @@ public class SuggestComponentContextFilterQueryTest extends SolrTestCaseJ4 {
}
@Test
- public void testContextFilterParamIsIgnoredWhenContextIsNotImplemented() throws Exception {
+ public void testContextFilterParamIsIgnoredWhenContextIsNotImplemented() {
assertQ(
req(
"qt",
@@ -126,8 +126,7 @@ public class SuggestComponentContextFilterQueryTest extends SolrTestCaseJ4 {
}
@Test
- public void testContextFilteringIsIgnoredWhenContextIsImplementedButNotConfigured()
- throws Exception {
+ public void testContextFilteringIsIgnoredWhenContextIsImplementedButNotConfigured() {
assertQ(
req(
"qt",
@@ -145,8 +144,7 @@ public class SuggestComponentContextFilterQueryTest extends SolrTestCaseJ4 {
}
@Test
- public void testBuildThrowsIllegalArgumentExceptionWhenContextIsConfiguredButNotImplemented()
- throws Exception {
+ public void testBuildThrowsIllegalArgumentExceptionWhenContextIsConfiguredButNotImplemented() {
IllegalArgumentException ex =
expectThrows(
IllegalArgumentException.class,
@@ -179,7 +177,7 @@ public class SuggestComponentContextFilterQueryTest extends SolrTestCaseJ4 {
}
@Test
- public void testContextFilterIsTrimmed() throws Exception {
+ public void testContextFilterIsTrimmed() {
assertQ(
req(
"qt",
@@ -195,7 +193,7 @@ public class SuggestComponentContextFilterQueryTest extends SolrTestCaseJ4 {
"//lst[@name='suggest']/lst[@name='suggest_blended_infix_suggester']/lst[@name='examp']/int[@name='numFound'][.='3']");
}
- public void testExplicitFieldedQuery() throws Exception {
+ public void testExplicitFieldedQuery() {
assertQ(
req(
"qt",
@@ -212,7 +210,7 @@ public class SuggestComponentContextFilterQueryTest extends SolrTestCaseJ4 {
"//lst[@name='suggest']/lst[@name='suggest_blended_infix_suggester']/lst[@name='examp']/arr[@name='suggestions']/lst[1]/str[@name='term'][.='example with ctx1 at 40']");
}
- public void testContextFilterOK() throws Exception {
+ public void testContextFilterOK() {
// No filtering
assertQ(
req(
@@ -361,7 +359,7 @@ public class SuggestComponentContextFilterQueryTest extends SolrTestCaseJ4 {
}
@Test
- public void testContextFilterOnInvalidFieldGivesNoSuggestions() throws Exception {
+ public void testContextFilterOnInvalidFieldGivesNoSuggestions() {
assertQ(
req(
"qt",
@@ -378,7 +376,7 @@ public class SuggestComponentContextFilterQueryTest extends SolrTestCaseJ4 {
}
@Test
- public void testContextFilterUsesAnalyzer() throws Exception {
+ public void testContextFilterUsesAnalyzer() {
assertQ(
req(
"qt",
@@ -396,7 +394,7 @@ public class SuggestComponentContextFilterQueryTest extends SolrTestCaseJ4 {
@Ignore // TODO: SOLR-7964
@Test
- public void testContextFilterWithHighlight() throws Exception {
+ public void testContextFilterWithHighlight() {
assertQ(
req(
"qt",
diff --git a/solr/core/src/test/org/apache/solr/handler/component/SuggestComponentTest.java b/solr/core/src/test/org/apache/solr/handler/component/SuggestComponentTest.java
index 7acb1274fde..d469a981f94 100644
--- a/solr/core/src/test/org/apache/solr/handler/component/SuggestComponentTest.java
+++ b/solr/core/src/test/org/apache/solr/handler/component/SuggestComponentTest.java
@@ -69,7 +69,7 @@ public class SuggestComponentTest extends SolrTestCaseJ4 {
}
@Test
- public void testDocumentBased() throws Exception {
+ public void testDocumentBased() {
assertQ(
req(
"qt",
@@ -108,7 +108,7 @@ public class SuggestComponentTest extends SolrTestCaseJ4 {
}
@Test
- public void testExpressionBased() throws Exception {
+ public void testExpressionBased() {
assertQ(
req(
"qt",
@@ -129,7 +129,7 @@ public class SuggestComponentTest extends SolrTestCaseJ4 {
}
@Test
- public void testFileBased() throws Exception {
+ public void testFileBased() {
assertQ(
req(
"qt",
@@ -150,7 +150,7 @@ public class SuggestComponentTest extends SolrTestCaseJ4 {
}
@Test
- public void testMultiSuggester() throws Exception {
+ public void testMultiSuggester() {
assertQ(
req(
"qt",
@@ -178,7 +178,7 @@ public class SuggestComponentTest extends SolrTestCaseJ4 {
}
@Test
- public void testBuildAllSuggester() throws Exception {
+ public void testBuildAllSuggester() {
assertQ(
req(
"qt",
@@ -197,7 +197,7 @@ public class SuggestComponentTest extends SolrTestCaseJ4 {
}
@Test
- public void testReloadAllSuggester() throws Exception {
+ public void testReloadAllSuggester() {
assertQ(
req(
"qt",
@@ -216,7 +216,7 @@ public class SuggestComponentTest extends SolrTestCaseJ4 {
}
@Test
- public void testBadSuggesterName() throws Exception {
+ public void testBadSuggesterName() {
String fakeSuggesterName = "does-not-exist";
assertQEx(
"No suggester named " + fakeSuggesterName + " was configured",
diff --git a/solr/core/src/test/org/apache/solr/handler/component/TestExpandComponent.java b/solr/core/src/test/org/apache/solr/handler/component/TestExpandComponent.java
index bbd6131de80..56a8f658d15 100644
--- a/solr/core/src/test/org/apache/solr/handler/component/TestExpandComponent.java
+++ b/solr/core/src/test/org/apache/solr/handler/component/TestExpandComponent.java
@@ -59,7 +59,7 @@ public class TestExpandComponent extends SolrTestCaseJ4 {
_testExpand("group_s", "", maybeTopFc());
}
- public void testStringDv() throws Exception {
+ public void testStringDv() {
_testExpand("group_s_dv", "", maybeTopFc());
}
@@ -67,7 +67,7 @@ public class TestExpandComponent extends SolrTestCaseJ4 {
_testExpand("group_i", "", "");
}
- public void testIntDv() throws Exception {
+ public void testIntDv() {
_testExpand("group_ti_dv", "", "");
}
@@ -76,12 +76,12 @@ public class TestExpandComponent extends SolrTestCaseJ4 {
_testExpand("group_f", ".0", ""); // explicit 0 check for 0 vs null group
}
- public void testFloatDv() throws Exception {
+ public void testFloatDv() {
_testExpand("group_tf_dv", floatAppend(), "");
_testExpand("group_tf_dv", ".0", ""); // explicit 0 check for 0 vs null group
}
- private void _testExpand(String group, String floatAppend, String hint) throws Exception {
+ private void _testExpand(String group, String floatAppend, String hint) {
// NOTE: one of our groups uses '0' as the group value to explicitly check numeric expand for 0
// vs null group behavior
String[][] docs = {
diff --git a/solr/core/src/test/org/apache/solr/handler/component/TestHttpShardHandlerFactory.java b/solr/core/src/test/org/apache/solr/handler/component/TestHttpShardHandlerFactory.java
index cb082e56a00..79847e6eb64 100644
--- a/solr/core/src/test/org/apache/solr/handler/component/TestHttpShardHandlerFactory.java
+++ b/solr/core/src/test/org/apache/solr/handler/component/TestHttpShardHandlerFactory.java
@@ -65,7 +65,7 @@ public class TestHttpShardHandlerFactory extends SolrTestCaseJ4 {
System.clearProperty(LOAD_BALANCER_REQUESTS_MAX_FRACTION);
}
- public void testLoadBalancerRequestsMinMax() throws Exception {
+ public void testLoadBalancerRequestsMinMax() {
final Path home = TEST_PATH();
CoreContainer cc = null;
ShardHandlerFactory factory = null;
@@ -124,7 +124,7 @@ public class TestHttpShardHandlerFactory extends SolrTestCaseJ4 {
}
@Test
- public void getShardsAllowList() throws Exception {
+ public void getShardsAllowList() {
System.setProperty(TEST_URL_ALLOW_LIST, "http://abc:8983/,http://def:8984/,");
CoreContainer cc = null;
ShardHandlerFactory factory = null;
@@ -144,7 +144,7 @@ public class TestHttpShardHandlerFactory extends SolrTestCaseJ4 {
}
@Test
- public void testLiveNodesToHostUrl() throws Exception {
+ public void testLiveNodesToHostUrl() {
Set<String> liveNodes =
new HashSet<>(Arrays.asList("1.2.3.4:8983_solr", "1.2.3.4:9000_", "1.2.3.4:9001_solr-2"));
ClusterState cs = new ClusterState(liveNodes, new HashMap<>());
diff --git a/solr/core/src/test/org/apache/solr/handler/component/TestPivotHelperCode.java b/solr/core/src/test/org/apache/solr/handler/component/TestPivotHelperCode.java
index c7b6e796f80..384a2449334 100644
--- a/solr/core/src/test/org/apache/solr/handler/component/TestPivotHelperCode.java
+++ b/solr/core/src/test/org/apache/solr/handler/component/TestPivotHelperCode.java
@@ -82,7 +82,7 @@ public class TestPivotHelperCode extends SolrTestCaseJ4 {
@SuppressForbidden(reason = "Checking object equality for Long instance")
@SuppressWarnings("BoxedPrimitiveConstructor")
- public void testCompareWithNullLast() throws Exception {
+ public void testCompareWithNullLast() {
Long a = random().nextLong();
Long b = random().nextLong();
diff --git a/solr/core/src/test/org/apache/solr/handler/loader/JavabinLoaderTest.java b/solr/core/src/test/org/apache/solr/handler/loader/JavabinLoaderTest.java
index 40bf640da08..b4d4b22e66a 100644
--- a/solr/core/src/test/org/apache/solr/handler/loader/JavabinLoaderTest.java
+++ b/solr/core/src/test/org/apache/solr/handler/loader/JavabinLoaderTest.java
@@ -17,7 +17,6 @@
package org.apache.solr.handler.loader;
import java.io.ByteArrayOutputStream;
-import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@@ -74,7 +73,7 @@ public class JavabinLoaderTest extends SolrTestCaseJ4 {
BufferingRequestProcessor mockUpdateProcessor =
new BufferingRequestProcessor(null) {
@Override
- public void processAdd(AddUpdateCommand cmd) throws IOException {
+ public void processAdd(AddUpdateCommand cmd) {
addCommands.add((AddUpdateCommand) cmd.clone());
}
};
diff --git a/solr/core/src/test/org/apache/solr/handler/tagger/EmbeddedSolrNoSerializeTest.java b/solr/core/src/test/org/apache/solr/handler/tagger/EmbeddedSolrNoSerializeTest.java
index 21a68296f29..e5b938b43bf 100644
--- a/solr/core/src/test/org/apache/solr/handler/tagger/EmbeddedSolrNoSerializeTest.java
+++ b/solr/core/src/test/org/apache/solr/handler/tagger/EmbeddedSolrNoSerializeTest.java
@@ -60,7 +60,7 @@ public class EmbeddedSolrNoSerializeTest extends SolrTestCaseJ4 {
}
@AfterClass
- public static void cleanUpAfterClass() throws Exception {
+ public static void cleanUpAfterClass() {
solrServer = null;
}
diff --git a/solr/core/src/test/org/apache/solr/handler/tagger/XmlInterpolationTest.java b/solr/core/src/test/org/apache/solr/handler/tagger/XmlInterpolationTest.java
index 82d0bbf48f1..284191403e0 100644
--- a/solr/core/src/test/org/apache/solr/handler/tagger/XmlInterpolationTest.java
+++ b/solr/core/src/test/org/apache/solr/handler/tagger/XmlInterpolationTest.java
@@ -59,7 +59,7 @@ public class XmlInterpolationTest extends TaggerTestCase {
}
@AfterClass
- public static void cleanUpAfterClass() throws Exception {
+ public static void cleanUpAfterClass() {
xmlDocBuilder = null;
}
diff --git a/solr/core/src/test/org/apache/solr/highlight/DummyHighlighter.java b/solr/core/src/test/org/apache/solr/highlight/DummyHighlighter.java
index f3f467c48cc..4b4d3d3395b 100644
--- a/solr/core/src/test/org/apache/solr/highlight/DummyHighlighter.java
+++ b/solr/core/src/test/org/apache/solr/highlight/DummyHighlighter.java
@@ -16,7 +16,6 @@
*/
package org.apache.solr.highlight;
-import java.io.IOException;
import org.apache.lucene.search.Query;
import org.apache.solr.common.util.NamedList;
import org.apache.solr.common.util.SimpleOrderedMap;
@@ -27,7 +26,7 @@ public class DummyHighlighter extends SolrHighlighter {
@Override
public NamedList<Object> doHighlighting(
- DocList docs, Query query, SolrQueryRequest req, String[] defaultFields) throws IOException {
+ DocList docs, Query query, SolrQueryRequest req, String[] defaultFields) {
NamedList<Object> fragments = new SimpleOrderedMap<>();
fragments.add("dummy", "thing1");
return fragments;
diff --git a/solr/core/src/test/org/apache/solr/highlight/HighlighterMaxOffsetTest.java b/solr/core/src/test/org/apache/solr/highlight/HighlighterMaxOffsetTest.java
index efcc3d709c1..b5bdec0e6c8 100644
--- a/solr/core/src/test/org/apache/solr/highlight/HighlighterMaxOffsetTest.java
+++ b/solr/core/src/test/org/apache/solr/highlight/HighlighterMaxOffsetTest.java
@@ -30,11 +30,11 @@ public class HighlighterMaxOffsetTest extends SolrTestCaseJ4 {
}
@After
- public void purgeDocs() throws Exception {
+ public void purgeDocs() {
clearIndex();
}
- public void testIndexedMultiValuedButSingleValuePassed() throws Exception {
+ public void testIndexedMultiValuedButSingleValuePassed() {
assertU(adoc("indexed_multiValued", SHORT_TEXT, "id", "DOC1"));
@@ -43,7 +43,7 @@ public class HighlighterMaxOffsetTest extends SolrTestCaseJ4 {
}
@Test
- public void testIndexedMultiValued() throws Exception {
+ public void testIndexedMultiValued() {
assertU(
adoc(
@@ -56,7 +56,7 @@ public class HighlighterMaxOffsetTest extends SolrTestCaseJ4 {
}
@Test
- public void testIndexedSingleValued() throws Exception {
+ public void testIndexedSingleValued() {
assertU(adoc("indexed_singleValued", SHORT_TEXT, "id", "DOC1"));
@@ -65,7 +65,7 @@ public class HighlighterMaxOffsetTest extends SolrTestCaseJ4 {
}
@Test
- public void testNonIndexedSingleValued() throws Exception {
+ public void testNonIndexedSingleValued() {
assertU(adoc("non_indexed_singleValued", SHORT_TEXT, "id", "DOC1"));
@@ -74,7 +74,7 @@ public class HighlighterMaxOffsetTest extends SolrTestCaseJ4 {
}
@Test
- public void testNonIndexedMultiValued() throws Exception {
+ public void testNonIndexedMultiValued() {
assertU(
adoc(
@@ -87,7 +87,7 @@ public class HighlighterMaxOffsetTest extends SolrTestCaseJ4 {
}
@Test
- public void testText_general_rev() throws Exception {
+ public void testText_general_rev() {
assertU(
adoc(
@@ -99,7 +99,7 @@ public class HighlighterMaxOffsetTest extends SolrTestCaseJ4 {
assertHighlighting("content");
}
- private static void assertHighlighting(String field) throws Exception {
+ private static void assertHighlighting(String field) {
assertQ(
req(
"q", "id:DOC1",
diff --git a/solr/core/src/test/org/apache/solr/highlight/HighlighterTest.java b/solr/core/src/test/org/apache/solr/highlight/HighlighterTest.java
index 1ccc8a7ef53..0a42d2e9f9a 100644
--- a/solr/core/src/test/org/apache/solr/highlight/HighlighterTest.java
+++ b/solr/core/src/test/org/apache/solr/highlight/HighlighterTest.java
@@ -89,7 +89,7 @@ public class HighlighterTest extends SolrTestCaseJ4 {
}
@Test
- public void testMergeContiguous() throws Exception {
+ public void testMergeContiguous() {
HashMap<String, String> args = new HashMap<>();
args.put(HighlightParams.HIGHLIGHT, "true");
args.put("df", "t_text");
@@ -201,7 +201,7 @@ public class HighlighterTest extends SolrTestCaseJ4 {
}
@Test
- public void testTermVecMultiValuedHighlight() throws Exception {
+ public void testTermVecMultiValuedHighlight() {
// do summarization using term vectors on multivalued field
HashMap<String, String> args = new HashMap<>();
@@ -228,7 +228,7 @@ public class HighlighterTest extends SolrTestCaseJ4 {
// more than just the first value of a multi-valued field is
// considered for highlighting.
@Test
- public void testTermVecMultiValuedHighlight2() throws Exception {
+ public void testTermVecMultiValuedHighlight2() {
// do summarization using term vectors on multivalued field
HashMap<String, String> args = new HashMap<>();
@@ -551,7 +551,7 @@ public class HighlighterTest extends SolrTestCaseJ4 {
// Test multi-valued together with hl.maxAnalyzedChars
@Test
- public void testMultiValuedMaxAnalyzedChars() throws Exception {
+ public void testMultiValuedMaxAnalyzedChars() {
String shortText = "some short blah blah blah blah";
final String field = random().nextBoolean() ? "tv_mv_text" : "textgap"; // term vecs or not
assertU(adoc(field, shortText, field, LONG_TEXT, "id", "1"));
diff --git a/solr/core/src/test/org/apache/solr/internal/csv/CharBufferTest.java b/solr/core/src/test/org/apache/solr/internal/csv/CharBufferTest.java
index 9fb65ed013b..04fd256dc01 100644
--- a/solr/core/src/test/org/apache/solr/internal/csv/CharBufferTest.java
+++ b/solr/core/src/test/org/apache/solr/internal/csv/CharBufferTest.java
@@ -105,7 +105,7 @@ public class CharBufferTest extends TestCase {
// -- the following test cases have been adapted from the HttpComponents project
// -- written by Oleg Kalnichevski
- public void testSimpleAppend() throws Exception {
+ public void testSimpleAppend() {
CharBuffer buffer = new CharBuffer(16);
assertEquals(16, buffer.capacity());
assertEquals(0, buffer.length());
@@ -132,14 +132,14 @@ public class CharBufferTest extends TestCase {
assertEquals(0, buffer.length());
}
- public void testAppendString2() throws Exception {
+ public void testAppendString2() {
CharBuffer buffer = new CharBuffer(8);
buffer.append("stuff");
buffer.append(" and more stuff");
assertEquals("stuff and more stuff", buffer.toString());
}
- public void testAppendNull() throws Exception {
+ public void testAppendNull() {
CharBuffer buffer = new CharBuffer(8);
buffer.append((StringBuffer) null);
@@ -155,7 +155,7 @@ public class CharBufferTest extends TestCase {
assertEquals("", buffer.toString());
}
- public void testAppendCharArrayBuffer() throws Exception {
+ public void testAppendCharArrayBuffer() {
CharBuffer buffer1 = new CharBuffer(8);
buffer1.append(" and more stuff");
CharBuffer buffer2 = new CharBuffer(8);
@@ -164,7 +164,7 @@ public class CharBufferTest extends TestCase {
assertEquals("stuff and more stuff", buffer2.toString());
}
- public void testAppendSingleChar() throws Exception {
+ public void testAppendSingleChar() {
CharBuffer buffer = new CharBuffer(4);
buffer.append('1');
buffer.append('2');
@@ -175,7 +175,7 @@ public class CharBufferTest extends TestCase {
assertEquals("123456", buffer.toString());
}
- public void testProvideCapacity() throws Exception {
+ public void testProvideCapacity() {
CharBuffer buffer = new CharBuffer(4);
buffer.provideCapacity(2);
assertEquals(4, buffer.capacity());
diff --git a/solr/core/src/test/org/apache/solr/legacy/TestLegacyField.java b/solr/core/src/test/org/apache/solr/legacy/TestLegacyField.java
index 465f82ded88..ee523515613 100644
--- a/solr/core/src/test/org/apache/solr/legacy/TestLegacyField.java
+++ b/solr/core/src/test/org/apache/solr/legacy/TestLegacyField.java
@@ -25,7 +25,7 @@ import org.apache.solr.SolrTestCase;
public class TestLegacyField extends SolrTestCase {
- public void testLegacyDoubleField() throws Exception {
+ public void testLegacyDoubleField() {
Field fields[] =
new Field[] {
new LegacyDoubleField("foo", 5d, Field.Store.NO),
@@ -49,7 +49,7 @@ public class TestLegacyField extends SolrTestCase {
}
}
- public void testLegacyFloatField() throws Exception {
+ public void testLegacyFloatField() {
Field fields[] =
new Field[] {
new LegacyFloatField("foo", 5f, Field.Store.NO),
@@ -73,7 +73,7 @@ public class TestLegacyField extends SolrTestCase {
}
}
- public void testLegacyIntField() throws Exception {
+ public void testLegacyIntField() {
Field fields[] =
new Field[] {
new LegacyIntField("foo", 5, Field.Store.NO),
@@ -97,7 +97,7 @@ public class TestLegacyField extends SolrTestCase {
}
}
- public void testLegacyLongField() throws Exception {
+ public void testLegacyLongField() {
Field fields[] =
new Field[] {
new LegacyLongField("foo", 5L, Field.Store.NO),
diff --git a/solr/core/src/test/org/apache/solr/legacy/TestLegacyNumericUtils.java b/solr/core/src/test/org/apache/solr/legacy/TestLegacyNumericUtils.java
index d10146326ef..f26b85f2bc4 100644
--- a/solr/core/src/test/org/apache/solr/legacy/TestLegacyNumericUtils.java
+++ b/solr/core/src/test/org/apache/solr/legacy/TestLegacyNumericUtils.java
@@ -28,7 +28,7 @@ import org.apache.solr.SolrTestCase;
public class TestLegacyNumericUtils extends SolrTestCase {
- public void testLongConversionAndOrdering() throws Exception {
+ public void testLongConversionAndOrdering() {
// generate a series of encoded longs, each numerical one bigger than the one before
BytesRefBuilder last = new BytesRefBuilder();
BytesRefBuilder act = new BytesRefBuilder();
@@ -51,7 +51,7 @@ public class TestLegacyNumericUtils extends SolrTestCase {
}
}
- public void testIntConversionAndOrdering() throws Exception {
+ public void testIntConversionAndOrdering() {
// generate a series of encoded ints, each numerical one bigger than the one before
BytesRefBuilder act = new BytesRefBuilder();
BytesRefBuilder last = new BytesRefBuilder();
@@ -74,7 +74,7 @@ public class TestLegacyNumericUtils extends SolrTestCase {
}
}
- public void testLongSpecialValues() throws Exception {
+ public void testLongSpecialValues() {
long[] vals =
new long[] {
Long.MIN_VALUE,
@@ -494,14 +494,14 @@ public class TestLegacyNumericUtils extends SolrTestCase {
Arrays.asList(0, 4));
}
- public void testRandomSplit() throws Exception {
+ public void testRandomSplit() {
long num = (long) atLeast(10);
for (long i = 0; i < num; i++) {
executeOneRandomSplit(random());
}
}
- private void executeOneRandomSplit(final Random random) throws Exception {
+ private void executeOneRandomSplit(final Random random) {
long lower = randomLong(random);
long len = random.nextInt(16384 * 1024); // not too large bitsets, else OOME!
while (lower + len < lower) { // overflow
@@ -538,7 +538,7 @@ public class TestLegacyNumericUtils extends SolrTestCase {
return val;
}
- public void testSplitLongRange() throws Exception {
+ public void testSplitLongRange() {
// a hard-coded "standard" range
assertLongRangeSplit(
-5000L,
@@ -655,7 +655,7 @@ public class TestLegacyNumericUtils extends SolrTestCase {
}
}
- public void testSplitIntRange() throws Exception {
+ public void testSplitIntRange() {
// a hard-coded "standard" range
assertIntRangeSplit(
-5000,
diff --git a/solr/core/src/test/org/apache/solr/metrics/JvmMetricsTest.java b/solr/core/src/test/org/apache/solr/metrics/JvmMetricsTest.java
index d09a4d4149e..59bd27f2ab0 100644
--- a/solr/core/src/test/org/apache/solr/metrics/JvmMetricsTest.java
+++ b/solr/core/src/test/org/apache/solr/metrics/JvmMetricsTest.java
@@ -50,7 +50,7 @@ public class JvmMetricsTest extends SolrJettyTestBase {
}
@Test
- public void testOperatingSystemMetricSet() throws Exception {
+ public void testOperatingSystemMetricSet() {
OperatingSystemMetricSet set = new OperatingSystemMetricSet();
Map<String, Metric> metrics = set.getMetrics();
assertTrue(metrics.size() > 0);
@@ -71,7 +71,7 @@ public class JvmMetricsTest extends SolrJettyTestBase {
}
@Test
- public void testAltBufferPoolMetricSet() throws Exception {
+ public void testAltBufferPoolMetricSet() {
AltBufferPoolMetricSet set = new AltBufferPoolMetricSet();
Map<String, Metric> metrics = set.getMetrics();
assertTrue(metrics.size() > 0);
@@ -85,7 +85,7 @@ public class JvmMetricsTest extends SolrJettyTestBase {
}
@Test
- public void testSystemProperties() throws Exception {
+ public void testSystemProperties() {
if (System.getProperty("basicauth") == null) {
// make sure it's set
System.setProperty("basicauth", "foo:bar");
@@ -130,7 +130,7 @@ public class JvmMetricsTest extends SolrJettyTestBase {
}
@Test
- public void testSetupJvmMetrics() throws Exception {
+ public void testSetupJvmMetrics() {
SolrMetricManager metricManager = jetty.getCoreContainer().getMetricManager();
Map<String, Metric> metrics = metricManager.registry("solr.jvm").getMetrics();
assertTrue(metrics.size() > 0);
diff --git a/solr/core/src/test/org/apache/solr/metrics/MetricsConfigTest.java b/solr/core/src/test/org/apache/solr/metrics/MetricsConfigTest.java
index 444829e993b..d8ca08a9bae 100644
--- a/solr/core/src/test/org/apache/solr/metrics/MetricsConfigTest.java
+++ b/solr/core/src/test/org/apache/solr/metrics/MetricsConfigTest.java
@@ -44,12 +44,12 @@ public class MetricsConfigTest extends SolrTestCaseJ4 {
private static File solrHome = null;
@BeforeClass
- public static void setupLoader() throws Exception {
+ public static void setupLoader() {
solrHome = createTempDir().toFile();
}
@AfterClass
- public static void cleanupLoader() throws Exception {
+ public static void cleanupLoader() {
solrHome = null;
}
@@ -69,7 +69,7 @@ public class MetricsConfigTest extends SolrTestCaseJ4 {
}
@Test
- public void testCustomReservoir() throws Exception {
+ public void testCustomReservoir() {
System.setProperty("timer.reservoir", UniformReservoir.class.getName());
System.setProperty("histogram.size", "2048");
System.setProperty("histogram.window", "600");
@@ -88,7 +88,7 @@ public class MetricsConfigTest extends SolrTestCaseJ4 {
}
@Test
- public void testCustomSupplier() throws Exception {
+ public void testCustomSupplier() {
System.setProperty("counter.class", MockCounterSupplier.class.getName());
System.setProperty("meter.class", MockMeterSupplier.class.getName());
System.setProperty("timer.class", MockTimerSupplier.class.getName());
@@ -118,7 +118,7 @@ public class MetricsConfigTest extends SolrTestCaseJ4 {
}
@Test
- public void testDisabledMetrics() throws Exception {
+ public void testDisabledMetrics() {
System.setProperty("metricsEnabled", "false");
NodeConfig cfg = loadNodeConfig("solr-metricsconfig.xml");
SolrMetricManager mgr =
@@ -130,7 +130,7 @@ public class MetricsConfigTest extends SolrTestCaseJ4 {
}
@Test
- public void testMissingValuesConfig() throws Exception {
+ public void testMissingValuesConfig() {
NodeConfig cfg = loadNodeConfig("solr-metricsconfig1.xml");
SolrMetricManager mgr =
new SolrMetricManager(cfg.getSolrResourceLoader(), cfg.getMetricsConfig());
@@ -143,7 +143,7 @@ public class MetricsConfigTest extends SolrTestCaseJ4 {
assertEquals("missing", map.get("value"));
}
- private NodeConfig loadNodeConfig(String config) throws Exception {
+ private NodeConfig loadNodeConfig(String config) {
InputStream is = MetricsConfigTest.class.getResourceAsStream("/solr/" + config);
return SolrXmlConfig.fromInputStream(TEST_PATH(), is, new Properties()); // TODO pass in props
}
diff --git a/solr/core/src/test/org/apache/solr/metrics/SolrCoreMetricManagerTest.java b/solr/core/src/test/org/apache/solr/metrics/SolrCoreMetricManagerTest.java
index 3bfc2691f54..a352b555744 100644
--- a/solr/core/src/test/org/apache/solr/metrics/SolrCoreMetricManagerTest.java
+++ b/solr/core/src/test/org/apache/solr/metrics/SolrCoreMetricManagerTest.java
@@ -172,7 +172,7 @@ public class SolrCoreMetricManagerTest extends SolrTestCaseJ4 {
}
@Test
- public void testNonCloudRegistryName() throws Exception {
+ public void testNonCloudRegistryName() {
String registryName = h.getCore().getCoreMetricManager().getRegistryName();
String leaderRegistryName = h.getCore().getCoreMetricManager().getLeaderRegistryName();
assertNotNull(registryName);
diff --git a/solr/core/src/test/org/apache/solr/metrics/SolrMetricManagerTest.java b/solr/core/src/test/org/apache/solr/metrics/SolrMetricManagerTest.java
index 30dce4a9761..730fe0989aa 100644
--- a/solr/core/src/test/org/apache/solr/metrics/SolrMetricManagerTest.java
+++ b/solr/core/src/test/org/apache/solr/metrics/SolrMetricManagerTest.java
@@ -36,7 +36,7 @@ import org.junit.Test;
public class SolrMetricManagerTest extends SolrTestCaseJ4 {
@Test
- public void testSwapRegistries() throws Exception {
+ public void testSwapRegistries() {
Random r = random();
SolrMetricManager metricManager = new SolrMetricManager();
@@ -105,7 +105,7 @@ public class SolrMetricManagerTest extends SolrTestCaseJ4 {
}
@Test
- public void testClearMetrics() throws Exception {
+ public void testClearMetrics() {
Random r = random();
SolrMetricManager metricManager = new SolrMetricManager();
@@ -148,7 +148,7 @@ public class SolrMetricManagerTest extends SolrTestCaseJ4 {
}
@Test
- public void testSimpleMetrics() throws Exception {
+ public void testSimpleMetrics() {
Random r = random();
SolrMetricManager metricManager = new SolrMetricManager();
@@ -167,7 +167,7 @@ public class SolrMetricManagerTest extends SolrTestCaseJ4 {
}
@Test
- public void testRegistryName() throws Exception {
+ public void testRegistryName() {
Random r = random();
String name = TestUtil.randomSimpleString(r, 1, 10);
@@ -252,7 +252,7 @@ public class SolrMetricManagerTest extends SolrTestCaseJ4 {
}
@Test
- public void testDefaultCloudReporterPeriodUnchanged() throws Exception {
+ public void testDefaultCloudReporterPeriodUnchanged() {
assertEquals(60, SolrMetricManager.DEFAULT_CLOUD_REPORTER_PERIOD);
}
diff --git a/solr/core/src/test/org/apache/solr/metrics/reporters/SolrJmxReporterTest.java b/solr/core/src/test/org/apache/solr/metrics/reporters/SolrJmxReporterTest.java
index ffcd88fa1d2..eaff106a42a 100644
--- a/solr/core/src/test/org/apache/solr/metrics/reporters/SolrJmxReporterTest.java
+++ b/solr/core/src/test/org/apache/solr/metrics/reporters/SolrJmxReporterTest.java
@@ -157,7 +157,7 @@ public class SolrJmxReporterTest extends SolrTestCaseJ4 {
}
@Test
- public void testReportMetrics() throws Exception {
+ public void testReportMetrics() {
Random random = random();
Map<String, Counter> registered = new HashMap<>();
diff --git a/solr/core/src/test/org/apache/solr/metrics/reporters/SolrSlf4jReporterTest.java b/solr/core/src/test/org/apache/solr/metrics/reporters/SolrSlf4jReporterTest.java
index fb57ca0d785..7fb9ea1d793 100644
--- a/solr/core/src/test/org/apache/solr/metrics/reporters/SolrSlf4jReporterTest.java
+++ b/solr/core/src/test/org/apache/solr/metrics/reporters/SolrSlf4jReporterTest.java
@@ -104,7 +104,7 @@ public class SolrSlf4jReporterTest extends SolrTestCaseJ4 {
}
}
- private static void ensureLoggingConfiguredAppropriately() throws Exception {
+ private static void ensureLoggingConfiguredAppropriately() {
if (!log.isInfoEnabled()) {
fail("Test requires that log-level is at-least INFO, but INFO is disabled");
}
diff --git a/solr/core/src/test/org/apache/solr/request/TestFaceting.java b/solr/core/src/test/org/apache/solr/request/TestFaceting.java
index b2f632bfef1..641b1bd86db 100644
--- a/solr/core/src/test/org/apache/solr/request/TestFaceting.java
+++ b/solr/core/src/test/org/apache/solr/request/TestFaceting.java
@@ -148,7 +148,7 @@ public class TestFaceting extends SolrTestCaseJ4 {
}
@Test
- public void testFacets() throws Exception {
+ public void testFacets() {
StringBuilder sb = new StringBuilder();
// go over 4096 to test some of the buffer resizing
@@ -228,7 +228,7 @@ public class TestFaceting extends SolrTestCaseJ4 {
}
@Test
- public void testRegularBig() throws Exception {
+ public void testRegularBig() {
StringBuilder sb = new StringBuilder();
// go over 4096 to test some of the buffer resizing
@@ -808,7 +808,7 @@ public class TestFaceting extends SolrTestCaseJ4 {
}
@Test
- public void testThreadWait() throws Exception {
+ public void testThreadWait() {
add50ocs();
String[] methodParam =
@@ -1283,7 +1283,7 @@ public class TestFaceting extends SolrTestCaseJ4 {
}
@Test
- public void testListedTermCounts() throws Exception {
+ public void testListedTermCounts() {
assertU(adoc("id", "1", "title_ws", "Book1"));
assertU(adoc("id", "2", "title_ws", "Book2"));
assertU(adoc("id", "3", "title_ws", "Book3"));
@@ -1337,7 +1337,7 @@ public class TestFaceting extends SolrTestCaseJ4 {
}
@Test
- public void testFacetCountsWithMinExactCount() throws Exception {
+ public void testFacetCountsWithMinExactCount() {
final int NUM_DOCS = 20;
for (int i = 0; i < NUM_DOCS; i++) {
assertU(adoc("id", String.valueOf(i), "title_ws", "Book1"));
diff --git a/solr/core/src/test/org/apache/solr/response/TestJavabinTupleStreamParser.java b/solr/core/src/test/org/apache/solr/response/TestJavabinTupleStreamParser.java
index a97c9d45096..7510412b2a0 100644
--- a/solr/core/src/test/org/apache/solr/response/TestJavabinTupleStreamParser.java
+++ b/solr/core/src/test/org/apache/solr/response/TestJavabinTupleStreamParser.java
@@ -111,13 +111,13 @@ public class TestJavabinTupleStreamParser extends SolrTestCaseJ4 {
}
@Override
- public void open() throws IOException {}
+ public void open() {}
@Override
- public void close() throws IOException {}
+ public void close() {}
@Override
- public Tuple read() throws IOException {
+ public Tuple read() {
if (iterator.hasNext()) return new Tuple(iterator.next());
else return null;
}
@@ -128,7 +128,7 @@ public class TestJavabinTupleStreamParser extends SolrTestCaseJ4 {
}
@Override
- public Explanation toExplanation(StreamFactory factory) throws IOException {
+ public Explanation toExplanation(StreamFactory factory) {
return new StreamExplanation(getStreamNodeId().toString())
.withFunctionName("Dummy")
.withImplementingClass(this.getClass().getName())
diff --git a/solr/core/src/test/org/apache/solr/response/TestRawResponseWriter.java b/solr/core/src/test/org/apache/solr/response/TestRawResponseWriter.java
index f2e65d30e78..07560024089 100644
--- a/solr/core/src/test/org/apache/solr/response/TestRawResponseWriter.java
+++ b/solr/core/src/test/org/apache/solr/response/TestRawResponseWriter.java
@@ -58,7 +58,7 @@ public class TestRawResponseWriter extends SolrTestCaseJ4 {
}
@AfterClass
- public static void cleanupWriters() throws Exception {
+ public static void cleanupWriters() {
writerXmlBase = null;
writerJsonBase = null;
writerBinBase = null;
diff --git a/solr/core/src/test/org/apache/solr/response/TestRetrieveFieldsOptimizer.java b/solr/core/src/test/org/apache/solr/response/TestRetrieveFieldsOptimizer.java
index ba88946142a..04741a1c51e 100644
--- a/solr/core/src/test/org/apache/solr/response/TestRetrieveFieldsOptimizer.java
+++ b/solr/core/src/test/org/apache/solr/response/TestRetrieveFieldsOptimizer.java
@@ -26,7 +26,6 @@ import static org.apache.solr.search.SolrReturnFields.FIELD_SOURCES.MIXED_SOURCE
import com.carrotsearch.randomizedtesting.rules.SystemPropertiesRestoreRule;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
-import java.io.IOException;
import java.time.Instant;
import java.util.AbstractMap.SimpleEntry;
import java.util.ArrayList;
@@ -107,7 +106,7 @@ public class TestRetrieveFieldsOptimizer extends SolrTestCaseJ4 {
// TODO, how to generalize?
@SuppressWarnings({"unchecked"})
- private static void setupAllFields() throws IOException {
+ private static void setupAllFields() {
IndexSchema schema = h.getCore().getLatestSchema();
diff --git a/solr/core/src/test/org/apache/solr/response/TestSolrQueryResponse.java b/solr/core/src/test/org/apache/solr/response/TestSolrQueryResponse.java
index 5a34f3b7875..0f5e5fc2663 100644
--- a/solr/core/src/test/org/apache/solr/response/TestSolrQueryResponse.java
+++ b/solr/core/src/test/org/apache/solr/response/TestSolrQueryResponse.java
@@ -36,7 +36,7 @@ public class TestSolrQueryResponse extends SolrTestCase {
}
@Test
- public void testResponseHeaderPartialResults() throws Exception {
+ public void testResponseHeaderPartialResults() {
assertEquals(
"SolrQueryResponse.RESPONSE_HEADER_PARTIAL_RESULTS_KEY value changed",
"partialResults",
@@ -44,7 +44,7 @@ public class TestSolrQueryResponse extends SolrTestCase {
}
@Test
- public void testResponseHeaderSegmentTerminatedEarly() throws Exception {
+ public void testResponseHeaderSegmentTerminatedEarly() {
assertEquals(
"SolrQueryResponse.RESPONSE_HEADER_SEGMENT_TERMINATED_EARLY_KEY value changed",
"segmentTerminatedEarly",
@@ -52,7 +52,7 @@ public class TestSolrQueryResponse extends SolrTestCase {
}
@Test
- public void testValues() throws Exception {
+ public void testValues() {
final SolrQueryResponse response = new SolrQueryResponse();
assertEquals("values initially not empty", 0, response.getValues().size());
// initially empty, then add something
@@ -87,7 +87,7 @@ public class TestSolrQueryResponse extends SolrTestCase {
}
@Test
- public void testToLog() throws Exception {
+ public void testToLog() {
final SolrQueryResponse response = new SolrQueryResponse();
assertEquals("toLog initially not empty", 0, response.getToLog().size());
assertEquals("logid_only", response.getToLogAsString("logid_only"));
@@ -122,7 +122,7 @@ public class TestSolrQueryResponse extends SolrTestCase {
}
@Test
- public void testReturnFields() throws Exception {
+ public void testReturnFields() {
final SolrQueryResponse response = new SolrQueryResponse();
final ReturnFields defaultReturnFields = new SolrReturnFields();
assertEquals(
@@ -277,7 +277,7 @@ public class TestSolrQueryResponse extends SolrTestCase {
}
@Test
- public void testResponseHeader() throws Exception {
+ public void testResponseHeader() {
final SolrQueryResponse response = new SolrQueryResponse();
assertEquals("responseHeader initially present", null, response.getResponseHeader());
final NamedList<Object> newValue = new SimpleOrderedMap<>();
@@ -290,7 +290,7 @@ public class TestSolrQueryResponse extends SolrTestCase {
}
@Test
- public void testHttpCaching() throws Exception {
+ public void testHttpCaching() {
final SolrQueryResponse response = new SolrQueryResponse();
assertEquals("httpCaching initial value", true, response.isHttpCaching());
final boolean newValue = random().nextBoolean();
@@ -299,7 +299,7 @@ public class TestSolrQueryResponse extends SolrTestCase {
}
@Test
- public void testConvertToHEADStyleResponse() throws Exception {
+ public void testConvertToHEADStyleResponse() {
final SolrQueryResponse response = new SolrQueryResponse();
final NamedList<Object> newValue = new SimpleOrderedMap<>();
newValue.add("responseHeaderKey1", "value1");
diff --git a/solr/core/src/test/org/apache/solr/response/transform/TestChildDocTransformer.java b/solr/core/src/test/org/apache/solr/response/transform/TestChildDocTransformer.java
index c4db16843fb..2d6dcc70841 100644
--- a/solr/core/src/test/org/apache/solr/response/transform/TestChildDocTransformer.java
+++ b/solr/core/src/test/org/apache/solr/response/transform/TestChildDocTransformer.java
@@ -72,7 +72,7 @@ public class TestChildDocTransformer extends SolrTestCaseJ4 {
testChildReturnFields();
}
- private void testChildDoctransformerXML() throws Exception {
+ private void testChildDoctransformerXML() {
String test1[] =
new String[] {
"//*[@numFound='1']",
diff --git a/solr/core/src/test/org/apache/solr/response/transform/TestChildDocTransformerHierarchy.java b/solr/core/src/test/org/apache/solr/response/transform/TestChildDocTransformerHierarchy.java
index 04345c1c79e..99df40daa49 100644
--- a/solr/core/src/test/org/apache/solr/response/transform/TestChildDocTransformerHierarchy.java
+++ b/solr/core/src/test/org/apache/solr/response/transform/TestChildDocTransformerHierarchy.java
@@ -78,7 +78,7 @@ public class TestChildDocTransformerHierarchy extends SolrTestCaseJ4 {
}
@Test
- public void testNonTrivialChildFilter() throws Exception {
+ public void testNonTrivialChildFilter() {
// just check we don't throw an exception. This used to throw before SOLR-15152
assertQ(
req(
@@ -498,7 +498,7 @@ public class TestChildDocTransformerHierarchy extends SolrTestCaseJ4 {
}
@Test
- public void testExceptionThrownWParentFilter() throws Exception {
+ public void testExceptionThrownWParentFilter() {
expectThrows(
SolrException.class,
"Exception was not thrown when parentFilter param was passed to ChildDocTransformer using a nested schema",
diff --git a/solr/core/src/test/org/apache/solr/response/transform/TestExplainDocTransformer.java b/solr/core/src/test/org/apache/solr/response/transform/TestExplainDocTransformer.java
index 5c72602602a..99b4bf7edce 100644
--- a/solr/core/src/test/org/apache/solr/response/transform/TestExplainDocTransformer.java
+++ b/solr/core/src/test/org/apache/solr/response/transform/TestExplainDocTransformer.java
@@ -103,7 +103,7 @@ public class TestExplainDocTransformer extends SolrTestCaseJ4 {
}
@Test
- public void testStyle() throws Exception {
+ public void testStyle() {
// this doesn't validate the explain response but checks if explain response is returned in
// expected format
diff --git a/solr/core/src/test/org/apache/solr/response/transform/TestSubQueryTransformer.java b/solr/core/src/test/org/apache/solr/response/transform/TestSubQueryTransformer.java
index c7ff7c01d16..b2a13627df6 100644
--- a/solr/core/src/test/org/apache/solr/response/transform/TestSubQueryTransformer.java
+++ b/solr/core/src/test/org/apache/solr/response/transform/TestSubQueryTransformer.java
@@ -209,7 +209,7 @@ public class TestSubQueryTransformer extends SolrTestCaseJ4 {
}
@Test
- public void testJohnOrNancySingleField() throws Exception {
+ public void testJohnOrNancySingleField() {
// System.out.println("p "+peopleMultiplier+" d "+deptMultiplier);
assertQ(
"subq1.fl is limited to single field",
@@ -289,7 +289,7 @@ public class TestSubQueryTransformer extends SolrTestCaseJ4 {
};
@Test
- public void testTwoSubQueriesAndByNumberWithTwoFields() throws Exception {
+ public void testTwoSubQueriesAndByNumberWithTwoFields() {
final SolrQueryRequest johnOrNancyTwoFL = req(johnAndNancyParams);
assertQ(
@@ -495,7 +495,7 @@ public class TestSubQueryTransformer extends SolrTestCaseJ4 {
}
@Test
- public void testNoExplicitName() throws Exception {
+ public void testNoExplicitName() {
String[] john =
new String[] {
"q",
@@ -551,7 +551,7 @@ public class TestSubQueryTransformer extends SolrTestCaseJ4 {
}
@Test
- public void testDupePrefix() throws Exception {
+ public void testDupePrefix() {
assertQEx(
"subquery name clash",
req(
@@ -668,7 +668,7 @@ public class TestSubQueryTransformer extends SolrTestCaseJ4 {
}
@Test
- public void testExceptionPropagation() throws Exception {
+ public void testExceptionPropagation() {
final SolrQueryRequest r =
req(
"q",
@@ -719,7 +719,7 @@ public class TestSubQueryTransformer extends SolrTestCaseJ4 {
}
@Test
- public void testMultiValue() throws Exception {
+ public void testMultiValue() {
String[] happyPathAsserts =
new String[] {
diff --git a/solr/core/src/test/org/apache/solr/response/transform/TestSubQueryTransformerCrossCore.java b/solr/core/src/test/org/apache/solr/response/transform/TestSubQueryTransformerCrossCore.java
index 8b350606cce..674a9b9a396 100644
--- a/solr/core/src/test/org/apache/solr/response/transform/TestSubQueryTransformerCrossCore.java
+++ b/solr/core/src/test/org/apache/solr/response/transform/TestSubQueryTransformerCrossCore.java
@@ -169,7 +169,7 @@ public class TestSubQueryTransformerCrossCore extends SolrTestCaseJ4 {
}
@Test
- public void testSameCoreSingleField() throws Exception {
+ public void testSameCoreSingleField() {
assertQ(
"subq1.fl is limited to single field",
req(
@@ -182,7 +182,7 @@ public class TestSubQueryTransformerCrossCore extends SolrTestCaseJ4 {
}
@Test
- public void testAbsentCore() throws Exception {
+ public void testAbsentCore() {
assertQEx(
"from index not exist",
req(
@@ -194,7 +194,7 @@ public class TestSubQueryTransformerCrossCore extends SolrTestCaseJ4 {
}
@Test
- public void testCrossCoreSubQueryTransformer() throws Exception {
+ public void testCrossCoreSubQueryTransformer() {
assertQ(
"make sure request is parsed in this core",
diff --git a/solr/core/src/test/org/apache/solr/rest/TestManagedResource.java b/solr/core/src/test/org/apache/solr/rest/TestManagedResource.java
index c2c59fcd280..c8afa16951d 100644
--- a/solr/core/src/test/org/apache/solr/rest/TestManagedResource.java
+++ b/solr/core/src/test/org/apache/solr/rest/TestManagedResource.java
@@ -198,7 +198,7 @@ public class TestManagedResource extends SolrTestCaseJ4 {
*/
@SuppressWarnings("unchecked")
@Test
- public void testLoadingAndStoringOfManagedData() throws Exception {
+ public void testLoadingAndStoringOfManagedData() {
String resourceId = "/config/test/foo";
String storedResourceId = "_config_test_foo.json";
diff --git a/solr/core/src/test/org/apache/solr/rest/TestRestManager.java b/solr/core/src/test/org/apache/solr/rest/TestRestManager.java
index 4f4b2f9b28e..2afba9d8a9c 100644
--- a/solr/core/src/test/org/apache/solr/rest/TestRestManager.java
+++ b/solr/core/src/test/org/apache/solr/rest/TestRestManager.java
@@ -112,7 +112,7 @@ public class TestRestManager extends SolrRestletTestBase {
}
@Test
- public void testReloadFromPersistentStorage() throws Exception {
+ public void testReloadFromPersistentStorage() {
SolrResourceLoader loader = new SolrResourceLoader(Paths.get("./"));
File unitTestStorageDir = createTempDir("testRestManager").toFile();
assertTrue(
@@ -138,14 +138,14 @@ public class TestRestManager extends SolrRestletTestBase {
}
@Test
- public void testResolveResourceId() throws Exception {
+ public void testResolveResourceId() {
String path = "http://solr.apache.org/schema/analysis/synonyms/de";
String resourceId = RestManager.ManagedEndpoint.resolveResourceId(path);
assertEquals(resourceId, "/schema/analysis/synonyms/de");
}
@Test
- public void testResolveResourceIdDecodeUrlEntities() throws Exception {
+ public void testResolveResourceIdDecodeUrlEntities() {
String path = "http://solr.apache.org/schema/analysis/synonyms/de/%C3%84ndern";
String resourceId = RestManager.ManagedEndpoint.resolveResourceId(path);
assertEquals(resourceId, "/schema/analysis/synonyms/de/Ändern");
diff --git a/solr/core/src/test/org/apache/solr/rest/schema/TestDynamicFieldCollectionResource.java b/solr/core/src/test/org/apache/solr/rest/schema/TestDynamicFieldCollectionResource.java
index dc2c57ca243..ab7571559fb 100644
--- a/solr/core/src/test/org/apache/solr/rest/schema/TestDynamicFieldCollectionResource.java
+++ b/solr/core/src/test/org/apache/solr/rest/schema/TestDynamicFieldCollectionResource.java
@@ -16,13 +16,12 @@
*/
package org.apache.solr.rest.schema;
-import java.io.IOException;
import org.apache.solr.rest.SolrRestletTestBase;
import org.junit.Test;
public class TestDynamicFieldCollectionResource extends SolrRestletTestBase {
@Test
- public void testGetAllDynamicFields() throws Exception {
+ public void testGetAllDynamicFields() {
assertQ(
"/schema/dynamicfields?indent=on&wt=xml",
"(/response/arr[@name='dynamicFields']/lst/str[@name='name'])[1] = '*_coordinate'",
@@ -31,7 +30,7 @@ public class TestDynamicFieldCollectionResource extends SolrRestletTestBase {
}
@Test
- public void testGetTwoDynamicFields() throws IOException {
+ public void testGetTwoDynamicFields() {
assertQ(
"/schema/dynamicfields?indent=on&wt=xml&fl=*_i,*_s",
"count(/response/arr[@name='dynamicFields']/lst/str[@name='name']) = 2",
@@ -40,7 +39,7 @@ public class TestDynamicFieldCollectionResource extends SolrRestletTestBase {
}
@Test
- public void testNotFoundDynamicFields() throws IOException {
+ public void testNotFoundDynamicFields() {
assertQ(
"/schema/dynamicfields?indent=on&wt=xml&fl=*_not_in_there,this_one_isnt_either_*",
"count(/response/arr[@name='dynamicFields']) = 1",
diff --git a/solr/core/src/test/org/apache/solr/rest/schema/TestDynamicFieldResource.java b/solr/core/src/test/org/apache/solr/rest/schema/TestDynamicFieldResource.java
index 4dcd6bc824d..2df5e70aab7 100644
--- a/solr/core/src/test/org/apache/solr/rest/schema/TestDynamicFieldResource.java
+++ b/solr/core/src/test/org/apache/solr/rest/schema/TestDynamicFieldResource.java
@@ -21,7 +21,7 @@ import org.junit.Test;
public class TestDynamicFieldResource extends SolrRestletTestBase {
@Test
- public void testGetDynamicField() throws Exception {
+ public void testGetDynamicField() {
final boolean expectedDocValues = Boolean.getBoolean(NUMERIC_DOCVALUES_SYSPROP);
assertQ(
"/schema/dynamicfields/*_i?indent=on&wt=xml&showDefaults=on",
@@ -44,7 +44,7 @@ public class TestDynamicFieldResource extends SolrRestletTestBase {
}
@Test
- public void testGetNotFoundDynamicField() throws Exception {
+ public void testGetNotFoundDynamicField() {
assertQ(
"/schema/dynamicfields/*not_in_there?indent=on&wt=xml",
"count(/response/lst[@name='dynamicField']) = 0",
diff --git a/solr/core/src/test/org/apache/solr/rest/schema/TestFieldCollectionResource.java b/solr/core/src/test/org/apache/solr/rest/schema/TestFieldCollectionResource.java
index daf147dc2b8..9538eec1ca8 100644
--- a/solr/core/src/test/org/apache/solr/rest/schema/TestFieldCollectionResource.java
+++ b/solr/core/src/test/org/apache/solr/rest/schema/TestFieldCollectionResource.java
@@ -16,7 +16,6 @@
*/
package org.apache.solr.rest.schema;
-import java.io.IOException;
import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -26,7 +25,7 @@ import org.junit.Test;
public class TestFieldCollectionResource extends SolrRestletTestBase {
@Test
- public void testXMLGetAllFields() throws Exception {
+ public void testXMLGetAllFields() {
assertQ(
"/schema/fields?wt=xml",
"(/response/arr[@name='fields']/lst/str[@name='name'])[1] = 'HTMLstandardtok'",
@@ -44,7 +43,7 @@ public class TestFieldCollectionResource extends SolrRestletTestBase {
}
@Test
- public void testXMLGetThreeFieldsDontIncludeDynamic() throws IOException {
+ public void testXMLGetThreeFieldsDontIncludeDynamic() {
//
assertQ(
"/schema/fields?wt=xml&fl=id,_version_,price_i",
@@ -54,7 +53,7 @@ public class TestFieldCollectionResource extends SolrRestletTestBase {
}
@Test
- public void testXMLGetThreeFieldsIncludeDynamic() throws IOException {
+ public void testXMLGetThreeFieldsIncludeDynamic() {
assertQ(
"/schema/fields?wt=xml&fl=id,_version_,price_i&includeDynamic=on",
"count(/response/arr[@name='fields']/lst/str[@name='name']) = 3",
@@ -66,7 +65,7 @@ public class TestFieldCollectionResource extends SolrRestletTestBase {
}
@Test
- public void testXMLNotFoundFields() throws IOException {
+ public void testXMLNotFoundFields() {
assertQ(
"/schema/fields?&wt=xml&fl=not_in_there,this_one_either",
"count(/response/arr[@name='fields']) = 1",
diff --git a/solr/core/src/test/org/apache/solr/rest/schema/TestFieldResource.java b/solr/core/src/test/org/apache/solr/rest/schema/TestFieldResource.java
index 941a61c43a2..f019e73aef2 100644
--- a/solr/core/src/test/org/apache/solr/rest/schema/TestFieldResource.java
+++ b/solr/core/src/test/org/apache/solr/rest/schema/TestFieldResource.java
@@ -21,7 +21,7 @@ import org.junit.Test;
public class TestFieldResource extends SolrRestletTestBase {
@Test
- public void testGetField() throws Exception {
+ public void testGetField() {
assertQ(
"/schema/fields/test_postv?indent=on&wt=xml&showDefaults=true",
"count(/response/lst[@name='field']) = 1",
@@ -48,7 +48,7 @@ public class TestFieldResource extends SolrRestletTestBase {
}
@Test
- public void testGetNotFoundField() throws Exception {
+ public void testGetNotFoundField() {
assertQ(
"/schema/fields/not_in_there?indent=on&wt=xml",
"count(/response/lst[@name='field']) = 0",
@@ -80,7 +80,7 @@ public class TestFieldResource extends SolrRestletTestBase {
}
@Test
- public void testGetFieldIncludeDynamic() throws Exception {
+ public void testGetFieldIncludeDynamic() {
assertQ(
"/schema/fields/some_crazy_name_i?indent=on&wt=xml&includeDynamic=true",
"/response/lst[@name='field']/str[@name='name'] = 'some_crazy_name_i'",
@@ -88,7 +88,7 @@ public class TestFieldResource extends SolrRestletTestBase {
}
@Test
- public void testGetFieldDontShowDefaults() throws Exception {
+ public void testGetFieldDontShowDefaults() {
String[] tests = {
"count(/response/lst[@name='field']) = 1",
"count(/response/lst[@name='field']/*) = 6",
diff --git a/solr/core/src/test/org/apache/solr/rest/schema/TestFieldTypeCollectionResource.java b/solr/core/src/test/org/apache/solr/rest/schema/TestFieldTypeCollectionResource.java
index b0651b3a9b5..53eca91101a 100644
--- a/solr/core/src/test/org/apache/solr/rest/schema/TestFieldTypeCollectionResource.java
+++ b/solr/core/src/test/org/apache/solr/rest/schema/TestFieldTypeCollectionResource.java
@@ -22,7 +22,7 @@ import org.junit.Test;
public class TestFieldTypeCollectionResource extends SolrRestletTestBase {
@Test
- public void testGetAllFieldTypes() throws Exception {
+ public void testGetAllFieldTypes() {
assertQ(
"/schema/fieldtypes?indent=on&wt=xml",
"(/response/arr[@name='fieldTypes']/lst/str[@name='name'])[1] = 'HTMLstandardtok'",
diff --git a/solr/core/src/test/org/apache/solr/rest/schema/TestFieldTypeResource.java b/solr/core/src/test/org/apache/solr/rest/schema/TestFieldTypeResource.java
index b89079d452a..e58815df44c 100644
--- a/solr/core/src/test/org/apache/solr/rest/schema/TestFieldTypeResource.java
+++ b/solr/core/src/test/org/apache/solr/rest/schema/TestFieldTypeResource.java
@@ -21,7 +21,7 @@ import org.junit.Test;
public class TestFieldTypeResource extends SolrRestletTestBase {
@Test
- public void testXMLGetFieldType() throws Exception {
+ public void testXMLGetFieldType() {
final String expectedFloatClass = RANDOMIZED_NUMERIC_FIELDTYPES.get(Float.class);
final boolean expectedDocValues = Boolean.getBoolean(NUMERIC_DOCVALUES_SYSPROP);
assertQ(
@@ -48,7 +48,7 @@ public class TestFieldTypeResource extends SolrRestletTestBase {
}
@Test
- public void testXMLGetNotFoundFieldType() throws Exception {
+ public void testXMLGetNotFoundFieldType() {
assertQ(
"/schema/fieldtypes/not_in_there?wt=xml",
"count(/response/lst[@name='fieldtypes']) = 0",
@@ -81,7 +81,7 @@ public class TestFieldTypeResource extends SolrRestletTestBase {
}
@Test
- public void testXMLGetFieldTypeDontShowDefaults() throws Exception {
+ public void testXMLGetFieldTypeDontShowDefaults() {
assertQ(
"/schema/fieldtypes/teststop?wt=xml",
"count(/response/lst[@name='fieldType']/*) = 3",
diff --git a/solr/core/src/test/org/apache/solr/rest/schema/TestSchemaNameResource.java b/solr/core/src/test/org/apache/solr/rest/schema/TestSchemaNameResource.java
index a890987a362..e63641853ed 100644
--- a/solr/core/src/test/org/apache/solr/rest/schema/TestSchemaNameResource.java
+++ b/solr/core/src/test/org/apache/solr/rest/schema/TestSchemaNameResource.java
@@ -21,7 +21,7 @@ import org.junit.Test;
public class TestSchemaNameResource extends SolrRestletTestBase {
@Test
- public void testGetSchemaName() throws Exception {
+ public void testGetSchemaName() {
assertQ(
"/schema/name?wt=xml",
"count(/response/str[@name='name']) = 1",
diff --git a/solr/core/src/test/org/apache/solr/rest/schema/TestSchemaResource.java b/solr/core/src/test/org/apache/solr/rest/schema/TestSchemaResource.java
index bd52af0614a..f77794c5aaf 100644
--- a/solr/core/src/test/org/apache/solr/rest/schema/TestSchemaResource.java
+++ b/solr/core/src/test/org/apache/solr/rest/schema/TestSchemaResource.java
@@ -21,7 +21,7 @@ import org.junit.Test;
public class TestSchemaResource extends SolrRestletTestBase {
@Test
- public void testXMLResponse() throws Exception {
+ public void testXMLResponse() {
// should work with or without trailing slash on '/schema/' path
assertQ(
"/schema/?indent=on&wt=xml",
diff --git a/solr/core/src/test/org/apache/solr/rest/schema/TestSchemaSimilarityResource.java b/solr/core/src/test/org/apache/solr/rest/schema/TestSchemaSimilarityResource.java
index 636032e519f..b73c2036cbf 100644
--- a/solr/core/src/test/org/apache/solr/rest/schema/TestSchemaSimilarityResource.java
+++ b/solr/core/src/test/org/apache/solr/rest/schema/TestSchemaSimilarityResource.java
@@ -26,7 +26,7 @@ public class TestSchemaSimilarityResource extends SolrRestletTestBase {
* which causes the FQN of the class to be returned
*/
@Test
- public void testGetSchemaSimilarity() throws Exception {
+ public void testGetSchemaSimilarity() {
assertQ(
"/schema/similarity?wt=xml",
"count(/response/lst[@name='similarity']) = 1",
diff --git a/solr/core/src/test/org/apache/solr/rest/schema/TestSchemaVersionResource.java b/solr/core/src/test/org/apache/solr/rest/schema/TestSchemaVersionResource.java
index ddfc2d6b630..19ccf9e15c6 100644
--- a/solr/core/src/test/org/apache/solr/rest/schema/TestSchemaVersionResource.java
+++ b/solr/core/src/test/org/apache/solr/rest/schema/TestSchemaVersionResource.java
@@ -21,7 +21,7 @@ import org.junit.Test;
public class TestSchemaVersionResource extends SolrRestletTestBase {
@Test
- public void testGetSchemaVersion() throws Exception {
+ public void testGetSchemaVersion() {
assertQ(
"/schema/version?indent=on&wt=xml",
"count(/response/float[@name='version']) = 1",
diff --git a/solr/core/src/test/org/apache/solr/rest/schema/TestSerializedLuceneMatchVersion.java b/solr/core/src/test/org/apache/solr/rest/schema/TestSerializedLuceneMatchVersion.java
index c732ee1d263..463861f517e 100644
--- a/solr/core/src/test/org/apache/solr/rest/schema/TestSerializedLuceneMatchVersion.java
+++ b/solr/core/src/test/org/apache/solr/rest/schema/TestSerializedLuceneMatchVersion.java
@@ -39,7 +39,7 @@ public class TestSerializedLuceneMatchVersion extends RestTestBase {
}
@Test
- public void testExplicitLuceneMatchVersions() throws Exception {
+ public void testExplicitLuceneMatchVersions() {
assertQ(
"/schema/fieldtypes/explicitLuceneMatchVersions?indent=on&wt=xml&showDefaults=true",
"count(/response/lst[@name='fieldType']) = 1",
@@ -52,7 +52,7 @@ public class TestSerializedLuceneMatchVersion extends RestTestBase {
}
@Test
- public void testNoLuceneMatchVersions() throws Exception {
+ public void testNoLuceneMatchVersions() {
assertQ(
"/schema/fieldtypes/noLuceneMatchVersions?indent=on&wt=xml&showDefaults=true",
"count(/response/lst[@name='fieldType']) = 1",
diff --git a/solr/core/src/test/org/apache/solr/rest/schema/TestUniqueKeyFieldResource.java b/solr/core/src/test/org/apache/solr/rest/schema/TestUniqueKeyFieldResource.java
index 9932c8166eb..0ddeaad11ee 100644
--- a/solr/core/src/test/org/apache/solr/rest/schema/TestUniqueKeyFieldResource.java
+++ b/solr/core/src/test/org/apache/solr/rest/schema/TestUniqueKeyFieldResource.java
@@ -22,7 +22,7 @@ import org.junit.Test;
public class TestUniqueKeyFieldResource extends SolrRestletTestBase {
@Test
- public void testGetUniqueKey() throws Exception {
+ public void testGetUniqueKey() {
assertQ(
"/schema/uniquekey?indent=on&wt=xml",
"count(/response/str[@name='uniqueKey']) = 1",
diff --git a/solr/core/src/test/org/apache/solr/schema/CurrencyFieldTypeTest.java b/solr/core/src/test/org/apache/solr/schema/CurrencyFieldTypeTest.java
index fa711929403..9fcd2f57c10 100644
--- a/solr/core/src/test/org/apache/solr/schema/CurrencyFieldTypeTest.java
+++ b/solr/core/src/test/org/apache/solr/schema/CurrencyFieldTypeTest.java
@@ -79,7 +79,7 @@ public class CurrencyFieldTypeTest extends SolrTestCaseJ4 {
}
@Test
- public void testCurrencySchema() throws Exception {
+ public void testCurrencySchema() {
IndexSchema schema = h.getCore().getLatestSchema();
SchemaField amount = schema.getField(fieldName);
@@ -117,7 +117,7 @@ public class CurrencyFieldTypeTest extends SolrTestCaseJ4 {
}
@Test
- public void testCurrencyFieldType() throws Exception {
+ public void testCurrencyFieldType() {
assumeTrue(
"This test is only applicable to the XML file based exchange rate provider",
expectedProviderClass.equals(FileExchangeRateProvider.class));
@@ -154,7 +154,7 @@ public class CurrencyFieldTypeTest extends SolrTestCaseJ4 {
}
@Test
- public void testMockExchangeRateProvider() throws Exception {
+ public void testMockExchangeRateProvider() {
assumeTrue(
"This test is only applicable to the mock exchange rate provider",
expectedProviderClass.equals(MockExchangeRateProvider.class));
@@ -172,7 +172,7 @@ public class CurrencyFieldTypeTest extends SolrTestCaseJ4 {
}
@Test
- public void testCurrencyRangeSearch() throws Exception {
+ public void testCurrencyRangeSearch() {
assumeTrue(
"This test is only applicable to the XML file based exchange rate provider",
expectedProviderClass.equals(FileExchangeRateProvider.class));
@@ -249,7 +249,7 @@ public class CurrencyFieldTypeTest extends SolrTestCaseJ4 {
}
@Test
- public void testBogusCurrency() throws Exception {
+ public void testBogusCurrency() {
ignoreException("HOSS");
// bogus currency
@@ -260,7 +260,7 @@ public class CurrencyFieldTypeTest extends SolrTestCaseJ4 {
}
@Test
- public void testCurrencyPointQuery() throws Exception {
+ public void testCurrencyPointQuery() {
assumeTrue(
"This test is only applicable to the XML file based exchange rate provider",
expectedProviderClass.equals(FileExchangeRateProvider.class));
@@ -279,7 +279,7 @@ public class CurrencyFieldTypeTest extends SolrTestCaseJ4 {
}
@Ignore
- public void testPerformance() throws Exception {
+ public void testPerformance() {
clearIndex();
Random r = random();
@@ -345,7 +345,7 @@ public class CurrencyFieldTypeTest extends SolrTestCaseJ4 {
}
@Test
- public void testCurrencySort() throws Exception {
+ public void testCurrencySort() {
assumeTrue(
"This test is only applicable to the XML file based exchange rate provider",
expectedProviderClass.equals(FileExchangeRateProvider.class));
@@ -376,7 +376,7 @@ public class CurrencyFieldTypeTest extends SolrTestCaseJ4 {
assertEquals(expectedProviderClass, provider.getClass());
}
- public void testFunctionUsage() throws Exception {
+ public void testFunctionUsage() {
assumeTrue(
"This test is only applicable to the XML file based exchange rate provider",
expectedProviderClass.equals(FileExchangeRateProvider.class));
@@ -504,7 +504,7 @@ public class CurrencyFieldTypeTest extends SolrTestCaseJ4 {
}
@Test
- public void testStringValue() throws Exception {
+ public void testStringValue() {
assertEquals("3.14,USD", new CurrencyValue(314, "USD").strValue());
assertEquals("-3.14,GBP", new CurrencyValue(-314, "GBP").strValue());
assertEquals("3.14,GBP", new CurrencyValue(314, "GBP").strValue());
@@ -514,7 +514,7 @@ public class CurrencyFieldTypeTest extends SolrTestCaseJ4 {
}
@Test
- public void testRangeFacet() throws Exception {
+ public void testRangeFacet() {
assumeTrue(
"This test is only applicable to the XML file based exchange rate provider "
+ "because it excercies the asymetric exchange rates option it supports",
@@ -857,7 +857,7 @@ public class CurrencyFieldTypeTest extends SolrTestCaseJ4 {
}
@Test
- public void testMockFieldType() throws Exception {
+ public void testMockFieldType() {
assumeTrue(
"This test is only applicable to the mock exchange rate provider",
expectedProviderClass.equals(MockExchangeRateProvider.class));
@@ -885,7 +885,7 @@ public class CurrencyFieldTypeTest extends SolrTestCaseJ4 {
}
@Test
- public void testAsymmetricPointQuery() throws Exception {
+ public void testAsymmetricPointQuery() {
assumeTrue(
"This test is only applicable to the XML file based exchange rate provider",
expectedProviderClass.equals(FileExchangeRateProvider.class));
diff --git a/solr/core/src/test/org/apache/solr/schema/DocValuesMultiTest.java b/solr/core/src/test/org/apache/solr/schema/DocValuesMultiTest.java
index b38a0f094a8..7c51b0e2e56 100644
--- a/solr/core/src/test/org/apache/solr/schema/DocValuesMultiTest.java
+++ b/solr/core/src/test/org/apache/solr/schema/DocValuesMultiTest.java
@@ -114,7 +114,7 @@ public class DocValuesMultiTest extends SolrTestCaseJ4 {
* fields that are not inverted (indexed "forward" only)
*/
@Test
- public void testStringDocValuesMatch() throws Exception {
+ public void testStringDocValuesMatch() {
assertU(adoc("id", "1", "stringdv", "b"));
assertU(adoc("id", "2", "stringdv", "a"));
assertU(adoc("id", "3", "stringdv", "c"));
@@ -163,7 +163,7 @@ public class DocValuesMultiTest extends SolrTestCaseJ4 {
* fields that are not inverted (indexed "forward" only)
*/
@Test
- public void testBoolDocValuesMatch() throws Exception {
+ public void testBoolDocValuesMatch() {
assertU(adoc("id", "1", "booldv", "true"));
assertU(adoc("id", "2", "booldv", "false"));
assertU(adoc("id", "3", "booldv", "true"));
@@ -201,7 +201,7 @@ public class DocValuesMultiTest extends SolrTestCaseJ4 {
* fields that are not inverted (indexed "forward" only)
*/
@Test
- public void testFloatDocValuesMatch() throws Exception {
+ public void testFloatDocValuesMatch() {
assertU(adoc("id", "1", "floatdv", "2"));
assertU(adoc("id", "2", "floatdv", "-5"));
assertU(adoc("id", "3", "floatdv", "3.0", "floatdv", "-1.3", "floatdv", "2.2"));
@@ -242,7 +242,7 @@ public class DocValuesMultiTest extends SolrTestCaseJ4 {
* fields that are not inverted (indexed "forward" only)
*/
@Test
- public void testDoubleDocValuesMatch() throws Exception {
+ public void testDoubleDocValuesMatch() {
assertU(adoc("id", "1", "doubledv", "2"));
assertU(adoc("id", "2", "doubledv", "-5"));
assertU(adoc("id", "3", "doubledv", "3.0", "doubledv", "-1.3", "doubledv", "2.2"));
diff --git a/solr/core/src/test/org/apache/solr/schema/EnumFieldTest.java b/solr/core/src/test/org/apache/solr/schema/EnumFieldTest.java
index 568f95a5622..c6ec5772899 100644
--- a/solr/core/src/test/org/apache/solr/schema/EnumFieldTest.java
+++ b/solr/core/src/test/org/apache/solr/schema/EnumFieldTest.java
@@ -57,7 +57,7 @@ public class EnumFieldTest extends SolrTestCaseJ4 {
}
@Test
- public void testEnumSchema() throws Exception {
+ public void testEnumSchema() {
assumeFalse(
"Skipping testing of EnumFieldType without docValues, which is unsupported.",
System.getProperty("solr.tests.EnumFieldType").equals("solr.EnumFieldType")
@@ -72,7 +72,7 @@ public class EnumFieldTest extends SolrTestCaseJ4 {
}
@Test
- public void testEnumRangeSearch() throws Exception {
+ public void testEnumRangeSearch() {
assumeFalse(
"Skipping testing of EnumFieldType without docValues, which is unsupported.",
System.getProperty("solr.tests.EnumFieldType").equals("solr.EnumFieldType")
@@ -229,7 +229,7 @@ public class EnumFieldTest extends SolrTestCaseJ4 {
}
@Test
- public void testBogusEnumSearch() throws Exception {
+ public void testBogusEnumSearch() {
assumeFalse(
"Skipping testing of EnumFieldType without docValues, which is unsupported.",
System.getProperty("solr.tests.EnumFieldType").equals("solr.EnumFieldType")
@@ -258,7 +258,7 @@ public class EnumFieldTest extends SolrTestCaseJ4 {
}
@Test
- public void testMultivaluedBogusEnumSearch() throws Exception {
+ public void testMultivaluedBogusEnumSearch() {
assumeFalse(
"Skipping testing of EnumFieldType without docValues, which is unsupported.",
System.getProperty("solr.tests.EnumFieldType").equals("solr.EnumFieldType")
@@ -287,7 +287,7 @@ public class EnumFieldTest extends SolrTestCaseJ4 {
}
@Test
- public void testBogusEnumIndexing() throws Exception {
+ public void testBogusEnumIndexing() {
assumeFalse(
"Skipping testing of EnumFieldType without docValues, which is unsupported.",
System.getProperty("solr.tests.EnumFieldType").equals("solr.EnumFieldType")
@@ -305,7 +305,7 @@ public class EnumFieldTest extends SolrTestCaseJ4 {
}
@Test
- public void testMultivaluedBogusEnumIndexing() throws Exception {
+ public void testMultivaluedBogusEnumIndexing() {
assumeFalse(
"Skipping testing of EnumFieldType without docValues, which is unsupported.",
System.getProperty("solr.tests.EnumFieldType").equals("solr.EnumFieldType")
@@ -323,7 +323,7 @@ public class EnumFieldTest extends SolrTestCaseJ4 {
}
@Test
- public void testKnownIntegerEnumIndexing() throws Exception {
+ public void testKnownIntegerEnumIndexing() {
assumeFalse(
"Skipping testing of EnumFieldType without docValues, which is unsupported.",
System.getProperty("solr.tests.EnumFieldType").equals("solr.EnumFieldType")
@@ -343,7 +343,7 @@ public class EnumFieldTest extends SolrTestCaseJ4 {
}
@Test
- public void testMultivaluedKnownIntegerEnumIndexing() throws Exception {
+ public void testMultivaluedKnownIntegerEnumIndexing() {
assumeFalse(
"Skipping testing of EnumFieldType without docValues, which is unsupported.",
System.getProperty("solr.tests.EnumFieldType").equals("solr.EnumFieldType")
@@ -367,7 +367,7 @@ public class EnumFieldTest extends SolrTestCaseJ4 {
}
@Test
- public void testEnumSort() throws Exception {
+ public void testEnumSort() {
assumeFalse(
"Skipping testing of EnumFieldType without docValues, which is unsupported.",
System.getProperty("solr.tests.EnumFieldType").equals("solr.EnumFieldType")
@@ -439,7 +439,7 @@ public class EnumFieldTest extends SolrTestCaseJ4 {
}
@Test
- public void testMultivaluedEnumSort() throws Exception {
+ public void testMultivaluedEnumSort() {
assumeFalse(
"Skipping testing of EnumFieldType without docValues, which is unsupported.",
System.getProperty("solr.tests.EnumFieldType").equals("solr.EnumFieldType")
@@ -526,7 +526,7 @@ public class EnumFieldTest extends SolrTestCaseJ4 {
}
@Test
- public void testSetQuery() throws Exception {
+ public void testSetQuery() {
assumeFalse(
"Skipping testing of EnumFieldType without docValues, which is unsupported.",
System.getProperty("solr.tests.EnumFieldType").equals("solr.EnumFieldType")
@@ -605,7 +605,7 @@ public class EnumFieldTest extends SolrTestCaseJ4 {
}
@Test
- public void testMultivaluedSetQuery() throws Exception {
+ public void testMultivaluedSetQuery() {
assumeFalse(
"Skipping testing of EnumFieldType without docValues, which is unsupported.",
System.getProperty("solr.tests.EnumFieldType").equals("solr.EnumFieldType")
diff --git a/solr/core/src/test/org/apache/solr/schema/ExternalFileFieldSortTest.java b/solr/core/src/test/org/apache/solr/schema/ExternalFileFieldSortTest.java
index a32ea1cbdee..1f5a9423ab6 100644
--- a/solr/core/src/test/org/apache/solr/schema/ExternalFileFieldSortTest.java
+++ b/solr/core/src/test/org/apache/solr/schema/ExternalFileFieldSortTest.java
@@ -57,7 +57,7 @@ public class ExternalFileFieldSortTest extends SolrTestCaseJ4 {
}
@Test
- public void testPointKeyFieldType() throws Exception {
+ public void testPointKeyFieldType() {
// This one should fail though, no "node" parameter specified
SolrException e =
expectThrows(
diff --git a/solr/core/src/test/org/apache/solr/schema/IndexSchemaTest.java b/solr/core/src/test/org/apache/solr/schema/IndexSchemaTest.java
index aabf95a3145..78435b9b726 100644
--- a/solr/core/src/test/org/apache/solr/schema/IndexSchemaTest.java
+++ b/solr/core/src/test/org/apache/solr/schema/IndexSchemaTest.java
@@ -81,7 +81,7 @@ public class IndexSchemaTest extends SolrTestCaseJ4 {
}
@Test
- public void testIsDynamicField() throws Exception {
+ public void testIsDynamicField() {
SolrCore core = h.getCore();
IndexSchema schema = core.getLatestSchema();
assertFalse(schema.isDynamicField("id"));
diff --git a/solr/core/src/test/org/apache/solr/schema/ManagedSchemaRoundRobinCloudTest.java b/solr/core/src/test/org/apache/solr/schema/ManagedSchemaRoundRobinCloudTest.java
index 0562fecb41b..3aa53058924 100644
--- a/solr/core/src/test/org/apache/solr/schema/ManagedSchemaRoundRobinCloudTest.java
+++ b/solr/core/src/test/org/apache/solr/schema/ManagedSchemaRoundRobinCloudTest.java
@@ -56,7 +56,7 @@ public class ManagedSchemaRoundRobinCloudTest extends SolrCloudTestCase {
}
@AfterClass
- public static void clearSysProps() throws Exception {
+ public static void clearSysProps() {
System.clearProperty("managed.schema.mutable");
}
diff --git a/solr/core/src/test/org/apache/solr/schema/PolyFieldTest.java b/solr/core/src/test/org/apache/solr/schema/PolyFieldTest.java
index 70eb14db0c3..f7d50c0f81c 100644
--- a/solr/core/src/test/org/apache/solr/schema/PolyFieldTest.java
+++ b/solr/core/src/test/org/apache/solr/schema/PolyFieldTest.java
@@ -36,7 +36,7 @@ public class PolyFieldTest extends SolrTestCaseJ4 {
}
@Test
- public void testSchemaBasics() throws Exception {
+ public void testSchemaBasics() {
IndexSchema schema = h.getCore().getLatestSchema();
SchemaField home = schema.getField("home");
@@ -69,7 +69,7 @@ public class PolyFieldTest extends SolrTestCaseJ4 {
}
@Test
- public void testPointFieldType() throws Exception {
+ public void testPointFieldType() {
SolrCore core = h.getCore();
IndexSchema schema = core.getLatestSchema();
SchemaField home = schema.getField("home");
@@ -127,7 +127,7 @@ public class PolyFieldTest extends SolrTestCaseJ4 {
}
@Test
- public void testSearching() throws Exception {
+ public void testSearching() {
for (int i = 0; i < 50; i++) {
assertU(
adoc("id", "" + i, "home", i + "," + (i * 100), "homed", (i * 1000) + "," + (i * 10000)));
@@ -162,7 +162,7 @@ public class PolyFieldTest extends SolrTestCaseJ4 {
}
@Test
- public void testSearchDetails() throws Exception {
+ public void testSearchDetails() {
SolrCore core = h.getCore();
IndexSchema schema = core.getLatestSchema();
double[] xy = new double[] {35.0, -79.34};
diff --git a/solr/core/src/test/org/apache/solr/schema/PreAnalyzedFieldTest.java b/solr/core/src/test/org/apache/solr/schema/PreAnalyzedFieldTest.java
index c8ca46458d1..b33b68ac0c1 100644
--- a/solr/core/src/test/org/apache/solr/schema/PreAnalyzedFieldTest.java
+++ b/solr/core/src/test/org/apache/solr/schema/PreAnalyzedFieldTest.java
@@ -136,7 +136,7 @@ public class PreAnalyzedFieldTest extends SolrTestCaseJ4 {
}
@Test
- public void testIndexAndQueryNoSchemaAnalyzer() throws Exception {
+ public void testIndexAndQueryNoSchemaAnalyzer() {
assertU(addTwoDocs(1, "pre_no_analyzer"));
assertU(commit());
assertQ(
diff --git a/solr/core/src/test/org/apache/solr/schema/RankFieldTest.java b/solr/core/src/test/org/apache/solr/schema/RankFieldTest.java
index f8f38430d99..cb354f1e398 100644
--- a/solr/core/src/test/org/apache/solr/schema/RankFieldTest.java
+++ b/solr/core/src/test/org/apache/solr/schema/RankFieldTest.java
@@ -143,7 +143,7 @@ public class RankFieldTest extends SolrTestCaseJ4 {
});
}
- public void testSortFails() throws IOException {
+ public void testSortFails() {
assertU(adoc("id", "testSortFails", RANK_1, "1"));
assertU(commit());
assertQEx(
@@ -151,7 +151,7 @@ public class RankFieldTest extends SolrTestCaseJ4 {
}
@Ignore("We currently don't fail these kinds of requests with other field types")
- public void testFacetFails() throws IOException {
+ public void testFacetFails() {
assertU(adoc("id", "testFacetFails", RANK_1, "1"));
assertU(commit());
assertQEx(
@@ -163,7 +163,7 @@ public class RankFieldTest extends SolrTestCaseJ4 {
400);
}
- public void testTermQuery() throws IOException {
+ public void testTermQuery() {
assertU(adoc("id", "testTermQuery", RANK_1, "1", RANK_2, "1"));
assertU(adoc("id", "testTermQuery2", RANK_1, "1"));
assertU(commit());
@@ -176,7 +176,7 @@ public class RankFieldTest extends SolrTestCaseJ4 {
assertQEx("Range queries not supported", req("q", RANK_1 + ":[1 TO 10]"), 400);
}
- public void testResponseQuery() throws IOException {
+ public void testResponseQuery() {
assertU(adoc("id", "testResponseQuery", RANK_1, "1"));
assertU(commit());
// Ignore requests to retrieve rank
@@ -186,7 +186,7 @@ public class RankFieldTest extends SolrTestCaseJ4 {
"count(//result/doc[1]/str)=1");
}
- public void testRankQParserQuery() throws IOException {
+ public void testRankQParserQuery() {
assertU(adoc("id", "1", "str_field", "foo", RANK_1, "1", RANK_2, "2"));
assertU(adoc("id", "2", "str_field", "foo", RANK_1, "2", RANK_2, "1"));
assertU(commit());
diff --git a/solr/core/src/test/org/apache/solr/schema/SchemaWatcherTest.java b/solr/core/src/test/org/apache/solr/schema/SchemaWatcherTest.java
index 98fd661f3d9..58cbd2405e9 100644
--- a/solr/core/src/test/org/apache/solr/schema/SchemaWatcherTest.java
+++ b/solr/core/src/test/org/apache/solr/schema/SchemaWatcherTest.java
@@ -50,7 +50,7 @@ public class SchemaWatcherTest {
}
@Test
- public void testDiscardReaderReference() throws Exception {
+ public void testDiscardReaderReference() {
schemaWatcher.discardReaderReference();
schemaWatcher.process(
diff --git a/solr/core/src/test/org/apache/solr/schema/SpatialRPTFieldTypeTest.java b/solr/core/src/test/org/apache/solr/schema/SpatialRPTFieldTypeTest.java
index 103dcd7371f..042d4492ca9 100644
--- a/solr/core/src/test/org/apache/solr/schema/SpatialRPTFieldTypeTest.java
+++ b/solr/core/src/test/org/apache/solr/schema/SpatialRPTFieldTypeTest.java
@@ -61,7 +61,7 @@ public class SpatialRPTFieldTypeTest extends AbstractBadConfigTestBase {
}
@After
- private void afterClass() throws Exception {
+ private void afterClass() {
deleteCore();
System.clearProperty("managed.schema.mutable");
System.clearProperty("enable.update.log");
@@ -135,7 +135,7 @@ public class SpatialRPTFieldTypeTest extends AbstractBadConfigTestBase {
"//result/doc/float[@name='score'][.='" + DISTANCE_MILES + "']");
}
- public void testJunkValuesForDistanceUnits() throws Exception {
+ public void testJunkValuesForDistanceUnits() {
Exception ex = expectThrows(Exception.class, () -> setupRPTField("rose", "true"));
assertTrue(ex.getMessage().startsWith("Must specify distanceUnits as one of"));
}
diff --git a/solr/core/src/test/org/apache/solr/schema/TestCloudManagedSchema.java b/solr/core/src/test/org/apache/solr/schema/TestCloudManagedSchema.java
index ec131cc0243..5b6fe56d36c 100644
--- a/solr/core/src/test/org/apache/solr/schema/TestCloudManagedSchema.java
+++ b/solr/core/src/test/org/apache/solr/schema/TestCloudManagedSchema.java
@@ -16,10 +16,8 @@
*/
package org.apache.solr.schema;
-import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.List;
-import org.apache.solr.client.solrj.SolrServerException;
import org.apache.solr.client.solrj.impl.HttpSolrClient;
import org.apache.solr.client.solrj.request.QueryRequest;
import org.apache.solr.cloud.AbstractFullDistribZkTestBase;
@@ -89,7 +87,7 @@ public class TestCloudManagedSchema extends AbstractFullDistribZkTestBase {
}
private String getFileContentFromZooKeeper(SolrZkClient zkClient, String fileName)
- throws IOException, SolrServerException, KeeperException, InterruptedException {
+ throws KeeperException, InterruptedException {
return (new String(zkClient.getData(fileName, null, null, true), StandardCharsets.UTF_8));
}
diff --git a/solr/core/src/test/org/apache/solr/schema/TestManagedSchema.java b/solr/core/src/test/org/apache/solr/schema/TestManagedSchema.java
index 740dd445d53..49f8212304a 100644
--- a/solr/core/src/test/org/apache/solr/schema/TestManagedSchema.java
+++ b/solr/core/src/test/org/apache/solr/schema/TestManagedSchema.java
@@ -77,7 +77,7 @@ public class TestManagedSchema extends AbstractBadConfigTestBase {
}
@After
- private void afterClass() throws Exception {
+ private void afterClass() {
deleteCore();
System.clearProperty("managed.schema.mutable");
System.clearProperty("enable.update.log");
diff --git a/solr/core/src/test/org/apache/solr/schema/TestSortableTextField.java b/solr/core/src/test/org/apache/solr/schema/TestSortableTextField.java
index 5764da5f0e3..79431931a81 100644
--- a/solr/core/src/test/org/apache/solr/schema/TestSortableTextField.java
+++ b/solr/core/src/test/org/apache/solr/schema/TestSortableTextField.java
@@ -173,7 +173,7 @@ public class TestSortableTextField extends SolrTestCaseJ4 {
"//result/doc[4]/str[@name='id'][.=4]");
}
- public void testSimpleSearchAndFacets() throws Exception {
+ public void testSimpleSearchAndFacets() {
assertU(adoc("id", "1", "whitespace_stxt", "how now brown cow ?"));
assertU(adoc("id", "2", "whitespace_stxt", "how now brown cow ?"));
assertU(adoc("id", "3", "whitespace_stxt", "holy cow !"));
@@ -278,7 +278,7 @@ public class TestSortableTextField extends SolrTestCaseJ4 {
}
}
- public void testWhiteboxCreateFields() throws Exception {
+ public void testWhiteboxCreateFields() {
List<IndexableField> values = null;
// common case...
@@ -315,7 +315,7 @@ public class TestSortableTextField extends SolrTestCaseJ4 {
return sf.getType().createFields(sf, "dummy value");
}
- public void testMaxCharsSort() throws Exception {
+ public void testMaxCharsSort() {
assertU(adoc("id", "1", "whitespace_stxt", "aaa bbb ccc ddd"));
assertU(adoc("id", "2", "whitespace_stxt", "aaa bbb xxx yyy"));
assertU(adoc("id", "3", "whitespace_stxt", "aaa bbb ccc xxx"));
@@ -420,7 +420,7 @@ public class TestSortableTextField extends SolrTestCaseJ4 {
}
/** test how various permutations of useDocValuesAsStored and maxCharsForDocValues interact */
- public void testUseDocValuesAsStored() throws Exception {
+ public void testUseDocValuesAsStored() {
ignoreException("when useDocValuesAsStored=true \\(length=");
// first things first...
diff --git a/solr/core/src/test/org/apache/solr/schema/TestUseDocValuesAsStored.java b/solr/core/src/test/org/apache/solr/schema/TestUseDocValuesAsStored.java
index 780824d92ca..ed73527d150 100644
--- a/solr/core/src/test/org/apache/solr/schema/TestUseDocValuesAsStored.java
+++ b/solr/core/src/test/org/apache/solr/schema/TestUseDocValuesAsStored.java
@@ -120,7 +120,7 @@ public class TestUseDocValuesAsStored extends AbstractBadConfigTestBase {
}
@After
- private void afterTest() throws Exception {
+ private void afterTest() {
clearIndex();
deleteCore();
System.clearProperty("managed.schema.mutable");
@@ -170,7 +170,7 @@ public class TestUseDocValuesAsStored extends AbstractBadConfigTestBase {
}
@Test
- public void testDuplicateMultiValued() throws Exception {
+ public void testDuplicateMultiValued() {
doTest("strTF", dvStringFieldName(3, true, false), "str", "X", "X", "Y");
doTest("strTT", dvStringFieldName(3, true, true), "str", "X", "X", "Y");
doTest("strFF", dvStringFieldName(3, false, false), "str", "X", "X", "Y");
diff --git a/solr/core/src/test/org/apache/solr/search/AnalyticsQueryTest.java b/solr/core/src/test/org/apache/solr/search/AnalyticsQueryTest.java
index 6c1474eacf5..999dc652875 100644
--- a/solr/core/src/test/org/apache/solr/search/AnalyticsQueryTest.java
+++ b/solr/core/src/test/org/apache/solr/search/AnalyticsQueryTest.java
@@ -40,7 +40,7 @@ public class AnalyticsQueryTest extends SolrTestCaseJ4 {
}
@Test
- public void testAnalyticsQuery() throws Exception {
+ public void testAnalyticsQuery() {
String[] doc = {"id", "1", "sort_i", "100"};
assertU(adoc(doc));
diff --git a/solr/core/src/test/org/apache/solr/search/MaxScoreCollectorTest.java b/solr/core/src/test/org/apache/solr/search/MaxScoreCollectorTest.java
index 492dd8b2b03..a3b21259d3f 100644
--- a/solr/core/src/test/org/apache/solr/search/MaxScoreCollectorTest.java
+++ b/solr/core/src/test/org/apache/solr/search/MaxScoreCollectorTest.java
@@ -80,7 +80,7 @@ public class MaxScoreCollectorTest extends SolrTestCase {
}
@Override
- public void setMinCompetitiveScore(float minScore) throws IOException {
+ public void setMinCompetitiveScore(float minScore) {
this.minCompetitiveScore = minScore;
}
}
diff --git a/solr/core/src/test/org/apache/solr/search/QueryParsingTest.java b/solr/core/src/test/org/apache/solr/search/QueryParsingTest.java
index c423bda72ea..76284cea64f 100644
--- a/solr/core/src/test/org/apache/solr/search/QueryParsingTest.java
+++ b/solr/core/src/test/org/apache/solr/search/QueryParsingTest.java
@@ -90,7 +90,7 @@ public class QueryParsingTest extends SolrTestCaseJ4 {
QParser.getParser("strdist(\"a value\",literal('a value'),edit)", NAME, req).getQuery());
}
- public void testGetQParser() throws Exception {
+ public void testGetQParser() {
// invalid defType
SolrException exception =
expectThrows(SolrException.class, () -> h.query(req("q", "ad", "defType", "bleh")));
diff --git a/solr/core/src/test/org/apache/solr/search/RankQParserPluginTest.java b/solr/core/src/test/org/apache/solr/search/RankQParserPluginTest.java
index 4420fc00824..794a614457f 100644
--- a/solr/core/src/test/org/apache/solr/search/RankQParserPluginTest.java
+++ b/solr/core/src/test/org/apache/solr/search/RankQParserPluginTest.java
@@ -63,7 +63,7 @@ public class RankQParserPluginTest extends SolrTestCaseJ4 {
}
}
- public void testSyntaxErrors() throws IOException, SyntaxError {
+ public void testSyntaxErrors() {
assertSyntaxError(
"No Field",
"Field can't be empty",
@@ -82,7 +82,7 @@ public class RankQParserPluginTest extends SolrTestCaseJ4 {
() -> getRankQParser(params(FIELD, "id"), null, req()).parse());
}
- public void testBadLogParameters() throws IOException, SyntaxError {
+ public void testBadLogParameters() {
assertSyntaxError(
"Expecting bad weight",
"weight must be in",
@@ -109,7 +109,7 @@ public class RankQParserPluginTest extends SolrTestCaseJ4 {
.parse());
}
- public void testBadSaturationParameters() throws IOException, SyntaxError {
+ public void testBadSaturationParameters() {
assertSyntaxError(
"Expecting a pivot value",
"A pivot value",
@@ -137,7 +137,7 @@ public class RankQParserPluginTest extends SolrTestCaseJ4 {
.parse());
}
- public void testBadSigmoidParameters() throws IOException, SyntaxError {
+ public void testBadSigmoidParameters() {
assertSyntaxError(
"Expecting missing pivot",
"A pivot value",
@@ -204,7 +204,7 @@ public class RankQParserPluginTest extends SolrTestCaseJ4 {
.parse());
}
- public void testUnknownFunction() throws IOException, SyntaxError {
+ public void testUnknownFunction() {
assertSyntaxError(
"Expecting bad function",
"Unknown function in rank query: \"foo\"",
diff --git a/solr/core/src/test/org/apache/solr/search/RankQueryTest.java b/solr/core/src/test/org/apache/solr/search/RankQueryTest.java
index 21ba5369274..8bcdea1d50c 100644
--- a/solr/core/src/test/org/apache/solr/search/RankQueryTest.java
+++ b/solr/core/src/test/org/apache/solr/search/RankQueryTest.java
@@ -40,7 +40,7 @@ public class RankQueryTest extends SolrTestCaseJ4 {
}
@Test
- public void testPluggableCollector() throws Exception {
+ public void testPluggableCollector() {
String[] doc = {"id", "1", "sort_i", "100"};
assertU(adoc(doc));
diff --git a/solr/core/src/test/org/apache/solr/search/RankQueryTestPlugin.java b/solr/core/src/test/org/apache/solr/search/RankQueryTestPlugin.java
index 3135802a180..4caa028a1f0 100644
--- a/solr/core/src/test/org/apache/solr/search/RankQueryTestPlugin.java
+++ b/solr/core/src/test/org/apache/solr/search/RankQueryTestPlugin.java
@@ -681,7 +681,7 @@ public class RankQueryTestPlugin extends QParserPlugin {
return new LeafCollector() {
@Override
- public void setScorer(Scorable scorer) throws IOException {}
+ public void setScorer(Scorable scorer) {}
public void collect(int doc) throws IOException {
long value;
@@ -740,14 +740,14 @@ public class RankQueryTestPlugin extends QParserPlugin {
}
@Override
- public LeafCollector getLeafCollector(LeafReaderContext context) throws IOException {
+ public LeafCollector getLeafCollector(LeafReaderContext context) {
final int base = context.docBase;
return new LeafCollector() {
Scorable scorer;
@Override
- public void setScorer(Scorable scorer) throws IOException {
+ public void setScorer(Scorable scorer) {
this.scorer = scorer;
}
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 a673ef6d98b..ecac1c6453f 100644
--- a/solr/core/src/test/org/apache/solr/search/ReturnFieldsTest.java
+++ b/solr/core/src/test/org/apache/solr/search/ReturnFieldsTest.java
@@ -52,7 +52,7 @@ public class ReturnFieldsTest extends SolrTestCaseJ4 {
}
@Test
- public void testCopyRename() throws Exception {
+ public void testCopyRename() {
// original
assertQ(
diff --git a/solr/core/src/test/org/apache/solr/search/SolrIndexSearcherTest.java b/solr/core/src/test/org/apache/solr/search/SolrIndexSearcherTest.java
index 484e16fe466..612b16b7ba1 100644
--- a/solr/core/src/test/org/apache/solr/search/SolrIndexSearcherTest.java
+++ b/solr/core/src/test/org/apache/solr/search/SolrIndexSearcherTest.java
@@ -462,8 +462,7 @@ public class SolrIndexSearcherTest extends SolrTestCaseJ4 {
}
@Override
- public Weight createWeight(IndexSearcher searcher, ScoreMode scoreMode, float boost)
- throws IOException {
+ public Weight createWeight(IndexSearcher searcher, ScoreMode scoreMode, float boost) {
throw new UnsupportedOperationException(
"This class is only intended to be used as a PostFilter");
}
diff --git a/solr/core/src/test/org/apache/solr/search/SpatialFilterTest.java b/solr/core/src/test/org/apache/solr/search/SpatialFilterTest.java
index aa5c4114a8f..a49d5d02aae 100644
--- a/solr/core/src/test/org/apache/solr/search/SpatialFilterTest.java
+++ b/solr/core/src/test/org/apache/solr/search/SpatialFilterTest.java
@@ -46,7 +46,7 @@ public class SpatialFilterTest extends SolrTestCaseJ4 {
}
@Test
- public void testPoints() throws Exception {
+ public void testPoints() {
String fieldName = "home";
setupDocs(fieldName);
// Try some edge cases
@@ -60,7 +60,7 @@ public class SpatialFilterTest extends SolrTestCaseJ4 {
}
@Test
- public void testLatLonType() throws Exception {
+ public void testLatLonType() {
String fieldName = "store";
setupDocs(fieldName);
// Try some edge cases
diff --git a/solr/core/src/test/org/apache/solr/search/TestBlockCollapse.java b/solr/core/src/test/org/apache/solr/search/TestBlockCollapse.java
index 23295676dc8..0dbf5315937 100644
--- a/solr/core/src/test/org/apache/solr/search/TestBlockCollapse.java
+++ b/solr/core/src/test/org/apache/solr/search/TestBlockCollapse.java
@@ -163,7 +163,7 @@ public class TestBlockCollapse extends SolrTestCaseJ4 {
}
}
- public void testEmptyIndex() throws Exception {
+ public void testEmptyIndex() {
// some simple sanity checks that collapse queries against empty indexes don't match any docs
// (or throw any errors)
@@ -234,7 +234,7 @@ public class TestBlockCollapse extends SolrTestCaseJ4 {
/**
* @see #testEmptyIndex
*/
- private void doTestEmptyIndex() throws Exception {
+ private void doTestEmptyIndex() {
for (String opt :
Arrays.asList( // no block collapse logic used (sanity checks)
"field=block_s1",
@@ -603,7 +603,7 @@ public class TestBlockCollapse extends SolrTestCaseJ4 {
} // sort
}
- public void testNullPolicyExpand() throws Exception {
+ public void testNullPolicyExpand() {
{ // convert our docs + some docs w/o collapse fields, along with some commits, to update
// commands in a shuffled order and process all of them...
@@ -951,7 +951,7 @@ public class TestBlockCollapse extends SolrTestCaseJ4 {
* field values then our other collapse fields. (and the other tests should adequeately prove that
* the block hueristics for _root_ collapsing work)
*/
- public void testBlockCollapseWithExpandComponent() throws Exception {
+ public void testBlockCollapseWithExpandComponent() {
{ // convert our docs + some docs w/o collapse fields, along with some commits, to update
// commands in a shuffled order and process all of them...
diff --git a/solr/core/src/test/org/apache/solr/search/TestCollapseQParserPlugin.java b/solr/core/src/test/org/apache/solr/search/TestCollapseQParserPlugin.java
index 97088ec08fa..ca05bae45d8 100644
--- a/solr/core/src/test/org/apache/solr/search/TestCollapseQParserPlugin.java
+++ b/solr/core/src/test/org/apache/solr/search/TestCollapseQParserPlugin.java
@@ -57,7 +57,7 @@ public class TestCollapseQParserPlugin extends SolrTestCaseJ4 {
assertU(commit());
}
- public void testMultiSort() throws Exception {
+ public void testMultiSort() {
assertU(adoc("id", "1", "group_s", "group1", "test_i", "5", "test_l", "10"));
assertU(commit());
assertU(adoc("id", "2", "group_s", "group1", "test_i", "5", "test_l", "1000"));
@@ -218,7 +218,7 @@ public class TestCollapseQParserPlugin extends SolrTestCaseJ4 {
}
@Test
- public void testStringCollapse() throws Exception {
+ public void testStringCollapse() {
for (final String hint : new String[] {"", " hint=" + CollapsingQParserPlugin.HINT_TOP_FC}) {
testCollapseQueries("group_s", hint, false);
testCollapseQueries("group_s_dv", hint, false);
@@ -226,7 +226,7 @@ public class TestCollapseQParserPlugin extends SolrTestCaseJ4 {
}
@Test
- public void testNumericCollapse() throws Exception {
+ public void testNumericCollapse() {
final String hint = "";
testCollapseQueries("group_i", hint, true);
testCollapseQueries("group_ti_dv", hint, true);
@@ -235,7 +235,7 @@ public class TestCollapseQParserPlugin extends SolrTestCaseJ4 {
}
@Test
- public void testFieldValueCollapseWithNegativeMinMax() throws Exception {
+ public void testFieldValueCollapseWithNegativeMinMax() {
String[] doc = {
"id", "1", "group_i", "-1000", "test_i", "5", "test_l", "-10", "test_f", "2000.32"
};
@@ -281,7 +281,7 @@ public class TestCollapseQParserPlugin extends SolrTestCaseJ4 {
}
@Test // https://issues.apache.org/jira/browse/SOLR-9494
- public void testNeedsScoreBugFixed() throws Exception {
+ public void testNeedsScoreBugFixed() {
String[] doc = {"id", "1", "group_s", "xyz", "text_ws", "hello xxx world"};
assertU(adoc(doc));
assertU(commit());
@@ -440,7 +440,7 @@ public class TestCollapseQParserPlugin extends SolrTestCaseJ4 {
req(params, "indent", "on"), "*[count(//doc)=1]", "//result/doc[1]/str[@name='id'][.='2']");
}
- private void testCollapseQueries(String group, String hint, boolean numeric) throws Exception {
+ private void testCollapseQueries(String group, String hint, boolean numeric) {
String[] doc = {
"id", "1", "term_s", "YYYY", group, "1", "test_i", "5", "test_l", "10", "test_f", "2000"
@@ -994,7 +994,7 @@ public class TestCollapseQParserPlugin extends SolrTestCaseJ4 {
}
@Test
- public void testMissingFieldParam() throws Exception {
+ public void testMissingFieldParam() {
ModifiableSolrParams params = new ModifiableSolrParams();
params.add("q", "*:*");
params.add("fq", "{!collapse}");
@@ -1005,7 +1005,7 @@ public class TestCollapseQParserPlugin extends SolrTestCaseJ4 {
}
@Test
- public void testEmptyCollection() throws Exception {
+ public void testEmptyCollection() {
// group_s is docValues=false and group_dv_s is docValues=true
String group = (random().nextBoolean() ? "group_s" : "group_s_dv");
@@ -1041,7 +1041,7 @@ public class TestCollapseQParserPlugin extends SolrTestCaseJ4 {
}
}
- public void testNoDocsHaveGroupField() throws Exception {
+ public void testNoDocsHaveGroupField() {
// as unlikely as this test seems, it's important for the possibility that a segment exists w/o
// any live docs that have DocValues for the group field -- ie: every doc in segment is in null
// group.
@@ -1257,7 +1257,7 @@ public class TestCollapseQParserPlugin extends SolrTestCaseJ4 {
}
@Test
- public void testMinExactCountDisabledByCollapse() throws Exception {
+ public void testMinExactCountDisabledByCollapse() {
int numDocs = 10;
String collapseFieldInt = "field_ti_dv";
String collapseFieldFloat = "field_tf_dv";
@@ -1296,7 +1296,7 @@ public class TestCollapseQParserPlugin extends SolrTestCaseJ4 {
}
}
- public void testNullGroupNumericVsStringCollapse() throws Exception {
+ public void testNullGroupNumericVsStringCollapse() {
// NOTE: group_i and group_s will contain identical content so these need to be "numbers"...
// The specific numbers shouldn't matter (and we explicitly test '0' to confirm legacy
// bug/behavior of treating 0 as null is no longer a problem) ...
diff --git a/solr/core/src/test/org/apache/solr/search/TestCustomSort.java b/solr/core/src/test/org/apache/solr/search/TestCustomSort.java
index c1f01bd02d6..53b27c5105f 100644
--- a/solr/core/src/test/org/apache/solr/search/TestCustomSort.java
+++ b/solr/core/src/test/org/apache/solr/search/TestCustomSort.java
@@ -28,7 +28,7 @@ public class TestCustomSort extends SolrTestCaseJ4 {
initCore("solrconfig.xml", "schema-custom-field.xml");
}
- public void testSortableBinary() throws Exception {
+ public void testSortableBinary() {
clearIndex();
assertU(
adoc(
diff --git a/solr/core/src/test/org/apache/solr/search/TestDocSet.java b/solr/core/src/test/org/apache/solr/search/TestDocSet.java
index 339074837ff..a916fade515 100644
--- a/solr/core/src/test/org/apache/solr/search/TestDocSet.java
+++ b/solr/core/src/test/org/apache/solr/search/TestDocSet.java
@@ -322,7 +322,7 @@ public class TestDocSet extends SolrTestCase {
}
@Override
- public Terms terms(String field) throws IOException {
+ public Terms terms(String field) {
return null;
}
@@ -368,8 +368,7 @@ public class TestDocSet extends SolrTestCase {
@Override
public TopDocs searchNearestVectors(
- String field, float[] target, int k, Bits acceptDocs, int visitedLimit)
- throws IOException {
+ String field, float[] target, int k, Bits acceptDoc, int visitedLimits) {
return null;
}
@@ -380,7 +379,7 @@ public class TestDocSet extends SolrTestCase {
public void document(int doc, StoredFieldVisitor visitor) {}
@Override
- public void checkIntegrity() throws IOException {}
+ public void checkIntegrity() {}
@Override
public LeafMetaData getMetaData() {
@@ -445,8 +444,7 @@ public class TestDocSet extends SolrTestCase {
}
private static void populateDocs(
- NoThrowDocIdSetIterator[] disis, int[] docs, ToIntFunction<NoThrowDocIdSetIterator> toDocId)
- throws IOException {
+ NoThrowDocIdSetIterator[] disis, int[] docs, ToIntFunction<NoThrowDocIdSetIterator> toDocId) {
for (int i = 0; i < docs.length; i++) {
docs[i] = toDocId.applyAsInt(disis[i]);
}
diff --git a/solr/core/src/test/org/apache/solr/search/TestFieldSortValues.java b/solr/core/src/test/org/apache/solr/search/TestFieldSortValues.java
index 5718f3d69af..17135a8e7d1 100644
--- a/solr/core/src/test/org/apache/solr/search/TestFieldSortValues.java
+++ b/solr/core/src/test/org/apache/solr/search/TestFieldSortValues.java
@@ -30,7 +30,7 @@ public class TestFieldSortValues extends SolrTestCaseJ4 {
initCore("solrconfig-minimal.xml", "schema-field-sort-values.xml");
}
- public void testCustomComparator() throws Exception {
+ public void testCustomComparator() {
clearIndex();
assertU(adoc(sdoc("id", "1", "payload", "2")));
assertU(adoc(sdoc("id", "2", "payload", "3")));
diff --git a/solr/core/src/test/org/apache/solr/search/TestFoldingMultitermQuery.java b/solr/core/src/test/org/apache/solr/search/TestFoldingMultitermQuery.java
index e53582862ca..4bd048fbabd 100644
--- a/solr/core/src/test/org/apache/solr/search/TestFoldingMultitermQuery.java
+++ b/solr/core/src/test/org/apache/solr/search/TestFoldingMultitermQuery.java
@@ -118,7 +118,7 @@ public class TestFoldingMultitermQuery extends SolrTestCaseJ4 {
}
@Test
- public void testPrefixCaseAccentFolding() throws Exception {
+ public void testPrefixCaseAccentFolding() {
String matchOneDocPrefixUpper[][] = {
{"A*", "ÁB*", "ABÇ*"}, // these should find only doc 0
{"H*", "HÏ*", "HìJ*"}, // these should find only doc 1
@@ -168,7 +168,7 @@ public class TestFoldingMultitermQuery extends SolrTestCaseJ4 {
// test the wildcard queries find only one doc where the query is uppercased and/or accented.
@Test
- public void testWildcardCaseAccentFolding() throws Exception {
+ public void testWildcardCaseAccentFolding() {
String matchOneDocWildUpper[][] = {
{"Á*C*", "ÁB*1", "ABÇ*g1", "Á*FG1"}, // these should find only doc 0
{"H*k*", "HÏ*l?*", "HìJ*n*", "HìJ*m*"}, // these should find only doc 1
@@ -197,7 +197,7 @@ public class TestFoldingMultitermQuery extends SolrTestCaseJ4 {
}
@Test
- public void testFuzzy() throws Exception {
+ public void testFuzzy() {
assertQ(req("q", "content:ZiLLx~1"), "//result[@numFound='1']");
assertQ(
req("q", "content_straight:ZiLLx~1"), // case preserving field shouldn't match
@@ -208,7 +208,7 @@ public class TestFoldingMultitermQuery extends SolrTestCaseJ4 {
}
@Test
- public void testRegex() throws Exception {
+ public void testRegex() {
assertQ(req("q", "content:/Zill[a-z]/"), "//result[@numFound='1']");
assertQ(
req("q", "content:/Zill[A-Z]/"), // everything in the regex gets lowercased?
@@ -228,7 +228,7 @@ public class TestFoldingMultitermQuery extends SolrTestCaseJ4 {
}
@Test
- public void testGeneral() throws Exception {
+ public void testGeneral() {
assertQ(
req("q", "content_stemming:fings*"),
"//result[@numFound='0']"); // should not match (but would if fings* was stemmed to fing*
diff --git a/solr/core/src/test/org/apache/solr/search/TestGraphTermsQParserPlugin.java b/solr/core/src/test/org/apache/solr/search/TestGraphTermsQParserPlugin.java
index b257c3efb7d..03cd1cfbaf3 100644
--- a/solr/core/src/test/org/apache/solr/search/TestGraphTermsQParserPlugin.java
+++ b/solr/core/src/test/org/apache/solr/search/TestGraphTermsQParserPlugin.java
@@ -44,7 +44,7 @@ public class TestGraphTermsQParserPlugin extends SolrTestCaseJ4 {
}
@Test
- public void testQueries() throws Exception {
+ public void testQueries() {
String group = "group_s";
diff --git a/solr/core/src/test/org/apache/solr/search/TestMissingGroups.java b/solr/core/src/test/org/apache/solr/search/TestMissingGroups.java
index f00bbe6d042..4694385c21d 100644
--- a/solr/core/src/test/org/apache/solr/search/TestMissingGroups.java
+++ b/solr/core/src/test/org/apache/solr/search/TestMissingGroups.java
@@ -40,7 +40,7 @@ public class TestMissingGroups extends SolrTestCaseJ4 {
assertU(optimize());
}
- public void testGroupsOnMissingValues() throws Exception {
+ public void testGroupsOnMissingValues() {
final int numDocs = atLeast(500);
diff --git a/solr/core/src/test/org/apache/solr/search/TestMultiWordSynonyms.java b/solr/core/src/test/org/apache/solr/search/TestMultiWordSynonyms.java
index cb98f514ffa..2468f0ad2a2 100644
--- a/solr/core/src/test/org/apache/solr/search/TestMultiWordSynonyms.java
+++ b/solr/core/src/test/org/apache/solr/search/TestMultiWordSynonyms.java
@@ -31,7 +31,7 @@ public class TestMultiWordSynonyms extends SolrTestCaseJ4 {
index();
}
- private static void index() throws Exception {
+ private static void index() {
assertU(adoc("id", "1", "text", "USA Today"));
assertU(adoc("id", "2", "text", "A dynamic US economy"));
assertU(adoc("id", "3", "text", "The United States of America's 50 states"));
@@ -90,7 +90,7 @@ public class TestMultiWordSynonyms extends SolrTestCaseJ4 {
}
@Test
- public void testPf() throws Exception {
+ public void testPf() {
// test phrase fields including pf2 pf3 and phrase slop
// same as edismax test, but "bar" is synonym for "tropical cyclone" here
assertU(adoc("id", "10", "text", "foo bar a b c", "boost_d", "1.0"));
@@ -204,7 +204,7 @@ public class TestMultiWordSynonyms extends SolrTestCaseJ4 {
}
@Test
- public void testPf3WithReordering() throws Exception {
+ public void testPf3WithReordering() {
// test pf3 and phrase slop
assertU(
adoc(
@@ -248,7 +248,7 @@ public class TestMultiWordSynonyms extends SolrTestCaseJ4 {
}
@Test
- public void testPf3WithoutReordering() throws Exception {
+ public void testPf3WithoutReordering() {
// test pf3 and phrase slop
assertU(
adoc(
diff --git a/solr/core/src/test/org/apache/solr/search/TestOverriddenPrefixQueryForCustomFieldType.java b/solr/core/src/test/org/apache/solr/search/TestOverriddenPrefixQueryForCustomFieldType.java
index 16ea2c1723f..8d11b723a76 100644
--- a/solr/core/src/test/org/apache/solr/search/TestOverriddenPrefixQueryForCustomFieldType.java
+++ b/solr/core/src/test/org/apache/solr/search/TestOverriddenPrefixQueryForCustomFieldType.java
@@ -85,7 +85,7 @@ public class TestOverriddenPrefixQueryForCustomFieldType extends SolrTestCaseJ4
}
@Test
- public void testPrefixQueries() throws Exception {
+ public void testPrefixQueries() {
createIndex(100);
assertQ(req("fl", "id", "q", "*:*"), "//*[@numFound='100']");
diff --git a/solr/core/src/test/org/apache/solr/search/TestPseudoReturnFields.java b/solr/core/src/test/org/apache/solr/search/TestPseudoReturnFields.java
index f551defe10b..f478b8ee4e0 100644
--- a/solr/core/src/test/org/apache/solr/search/TestPseudoReturnFields.java
+++ b/solr/core/src/test/org/apache/solr/search/TestPseudoReturnFields.java
@@ -54,7 +54,7 @@ public class TestPseudoReturnFields extends SolrTestCaseJ4 {
}
@Before
- private void addUncommittedDoc99() throws Exception {
+ private void addUncommittedDoc99() {
// uncommitted doc in transaction log at start of every test
// Even if an RTG causes ulog to re-open realtime searcher, next test method
// will get another copy of doc 99 in the ulog
@@ -110,7 +110,7 @@ public class TestPseudoReturnFields extends SolrTestCaseJ4 {
"/doc=={'val2_ss':10,'val_ss':1,'subject':'uncommitted'}");
}
- public void testAllRealFields() throws Exception {
+ public void testAllRealFields() {
for (String fl : ALL_REAL_FIELDS) {
assertQ(
@@ -125,7 +125,7 @@ public class TestPseudoReturnFields extends SolrTestCaseJ4 {
}
}
- public void testAllRealFieldsRTG() throws Exception {
+ public void testAllRealFieldsRTG() {
// shouldn't matter if we use RTG (committed or otherwise)
for (String fl : ALL_REAL_FIELDS) {
for (String id : Arrays.asList("42", "99")) {
@@ -142,7 +142,7 @@ public class TestPseudoReturnFields extends SolrTestCaseJ4 {
}
}
- public void testFilterAndOneRealFieldRTG() throws Exception {
+ public void testFilterAndOneRealFieldRTG() {
// shouldn't matter if we use RTG (committed or otherwise)
// only one of these docs should match...
assertQ(
@@ -166,7 +166,7 @@ public class TestPseudoReturnFields extends SolrTestCaseJ4 {
"//result/doc[count(*)=2]");
}
- public void testScoreAndAllRealFields() throws Exception {
+ public void testScoreAndAllRealFields() {
for (String fl : SCORE_AND_REAL_FIELDS) {
assertQ(
@@ -182,7 +182,7 @@ public class TestPseudoReturnFields extends SolrTestCaseJ4 {
}
}
- public void testScoreAndAllRealFieldsRTG() throws Exception {
+ public void testScoreAndAllRealFieldsRTG() {
// if we use RTG (committed or otherwise) score should be ignored
for (String fl : SCORE_AND_REAL_FIELDS) {
@@ -200,7 +200,7 @@ public class TestPseudoReturnFields extends SolrTestCaseJ4 {
}
}
- public void testScoreAndExplicitRealFields() throws Exception {
+ public void testScoreAndExplicitRealFields() {
assertQ(
"fl=score,val_i",
@@ -225,7 +225,7 @@ public class TestPseudoReturnFields extends SolrTestCaseJ4 {
"//result/doc[count(*)=1]");
}
- public void testScoreAndExplicitRealFieldsRTG() throws Exception {
+ public void testScoreAndExplicitRealFieldsRTG() {
// if we use RTG (committed or otherwise) score should be ignored
for (String id : Arrays.asList("42", "99")) {
assertQ(
@@ -261,7 +261,7 @@ public class TestPseudoReturnFields extends SolrTestCaseJ4 {
"//result/doc[count(*)=2]");
}
- public void testFunctionsRTG() throws Exception {
+ public void testFunctionsRTG() {
// if we use RTG (committed or otherwise) functions should behave the same
for (String id : Arrays.asList("42", "99")) {
for (SolrParams p :
@@ -281,7 +281,7 @@ public class TestPseudoReturnFields extends SolrTestCaseJ4 {
}
}
- public void testFunctionsAndExplicit() throws Exception {
+ public void testFunctionsAndExplicit() {
assertQ(
"fl=log(val_i),val_i",
req("q", "*:*", "rows", "1", "fl", "log(val_i),val_i"),
@@ -299,7 +299,7 @@ public class TestPseudoReturnFields extends SolrTestCaseJ4 {
"//result/doc[count(*)=2]");
}
- public void testFunctionsAndExplicitRTG() throws Exception {
+ public void testFunctionsAndExplicitRTG() {
// shouldn't matter if we use RTG (committed or otherwise)
for (String id : Arrays.asList("42", "99")) {
for (SolrParams p :
@@ -317,7 +317,7 @@ public class TestPseudoReturnFields extends SolrTestCaseJ4 {
}
}
- public void testFunctionsAndScore() throws Exception {
+ public void testFunctionsAndScore() {
assertQ(
"fl=log(val_i),score",
@@ -352,7 +352,7 @@ public class TestPseudoReturnFields extends SolrTestCaseJ4 {
"//result/doc[count(*)=3]");
}
- public void testFunctionsAndScoreRTG() throws Exception {
+ public void testFunctionsAndScoreRTG() {
// if we use RTG (committed or otherwise) score should be ignored
for (String id : Arrays.asList("42", "99")) {
for (SolrParams p :
@@ -372,7 +372,7 @@ public class TestPseudoReturnFields extends SolrTestCaseJ4 {
}
}
- public void testGlobs() throws Exception {
+ public void testGlobs() {
assertQ(
"fl=val_*",
req("q", "*:*", "rows", "1", "fl", "val_*"),
@@ -396,7 +396,7 @@ public class TestPseudoReturnFields extends SolrTestCaseJ4 {
}
}
- public void testGlobsRTG() throws Exception {
+ public void testGlobsRTG() {
// behavior shouldn't matter if we are committed or uncommitted
for (String id : Arrays.asList("42", "99")) {
assertQ(
@@ -420,7 +420,7 @@ public class TestPseudoReturnFields extends SolrTestCaseJ4 {
}
}
- public void testGlobsAndExplicit() throws Exception {
+ public void testGlobsAndExplicit() {
assertQ(
"fl=val_*,id",
req("q", "*:*", "rows", "1", "fl", "val_*,id"),
@@ -445,7 +445,7 @@ public class TestPseudoReturnFields extends SolrTestCaseJ4 {
}
}
- public void testGlobsAndExplicitRTG() throws Exception {
+ public void testGlobsAndExplicitRTG() {
// behavior shouldn't matter if we are committed or uncommitted
for (String id : Arrays.asList("42", "99")) {
assertQ(
@@ -473,7 +473,7 @@ public class TestPseudoReturnFields extends SolrTestCaseJ4 {
}
}
- public void testGlobsAndScore() throws Exception {
+ public void testGlobsAndScore() {
assertQ(
"fl=val_*,score",
req("q", "*:*", "rows", "1", "fl", "val_*,score", "indent", "true"),
@@ -497,7 +497,7 @@ public class TestPseudoReturnFields extends SolrTestCaseJ4 {
}
}
- public void testGlobsAndScoreRTG() throws Exception {
+ public void testGlobsAndScoreRTG() {
// behavior shouldn't matter if we are committed or uncommitted, score should be ignored
for (String id : Arrays.asList("42", "99")) {
assertQ(
@@ -522,7 +522,7 @@ public class TestPseudoReturnFields extends SolrTestCaseJ4 {
}
}
- public void testAugmenters() throws Exception {
+ public void testAugmenters() {
assertQ(
"fl=[docid]",
req("q", "*:*", "rows", "1", "fl", "[docid]"),
@@ -554,7 +554,7 @@ public class TestPseudoReturnFields extends SolrTestCaseJ4 {
}
}
- public void testDocIdAugmenterRTG() throws Exception {
+ public void testDocIdAugmenterRTG() {
// for an uncommitted doc, we should get -1
for (String id : Arrays.asList("42", "99")) {
assertQ(
@@ -566,7 +566,7 @@ public class TestPseudoReturnFields extends SolrTestCaseJ4 {
}
}
- public void testAugmentersRTG() throws Exception {
+ public void testAugmentersRTG() {
// behavior shouldn't matter if we are committed or uncommitted
for (String id : Arrays.asList("42", "99")) {
for (SolrParams p :
@@ -606,7 +606,7 @@ public class TestPseudoReturnFields extends SolrTestCaseJ4 {
}
}
- public void testAugmentersAndExplicit() throws Exception {
+ public void testAugmentersAndExplicit() {
for (SolrParams p :
Arrays.asList(
params("fl", "id,[docid],[explain],x_alias:[value v=10 t=int]"),
@@ -632,7 +632,7 @@ public class TestPseudoReturnFields extends SolrTestCaseJ4 {
}
}
- public void testAugmentersAndExplicitRTG() throws Exception {
+ public void testAugmentersAndExplicitRTG() {
// behavior shouldn't matter if we are committed or uncommitted
for (String id : Arrays.asList("42", "99")) {
for (SolrParams p :
@@ -664,7 +664,7 @@ public class TestPseudoReturnFields extends SolrTestCaseJ4 {
}
}
- public void testAugmentersAndScore() throws Exception {
+ public void testAugmentersAndScore() {
assertQ(
req("q", "*:*", "rows", "1", "fl", "[docid],x_alias:[value v=10 t=int],score"),
"//result[@numFound='5']",
@@ -698,7 +698,7 @@ public class TestPseudoReturnFields extends SolrTestCaseJ4 {
}
}
- public void testAugmentersAndScoreRTG() throws Exception {
+ public void testAugmentersAndScoreRTG() {
// if we use RTG (committed or otherwise) score should be ignored
for (String id : Arrays.asList("42", "99")) {
assertQ(
@@ -745,7 +745,7 @@ public class TestPseudoReturnFields extends SolrTestCaseJ4 {
}
}
- public void testAugmentersGlobsExplicitAndScoreOhMy() throws Exception {
+ public void testAugmentersGlobsExplicitAndScoreOhMy() {
Random random = random();
// NOTE: 'ssto' is the missing one
@@ -777,7 +777,7 @@ public class TestPseudoReturnFields extends SolrTestCaseJ4 {
}
}
- public void testAugmentersGlobsExplicitAndScoreOhMyRTG() throws Exception {
+ public void testAugmentersGlobsExplicitAndScoreOhMyRTG() {
Random random = random();
// NOTE: 'ssto' is the missing one
diff --git a/solr/core/src/test/org/apache/solr/search/TestRandomCollapseQParserPlugin.java b/solr/core/src/test/org/apache/solr/search/TestRandomCollapseQParserPlugin.java
index 1bfca2d92ee..d6fb1c6b215 100644
--- a/solr/core/src/test/org/apache/solr/search/TestRandomCollapseQParserPlugin.java
+++ b/solr/core/src/test/org/apache/solr/search/TestRandomCollapseQParserPlugin.java
@@ -81,7 +81,7 @@ public class TestRandomCollapseQParserPlugin extends SolrTestCaseJ4 {
}
@AfterClass
- public static void cleanupStatics() throws Exception {
+ public static void cleanupStatics() {
deleteCore();
SOLR = null;
ALL_SORT_FIELD_NAMES = ALL_COLLAPSE_FIELD_NAMES = null;
@@ -135,7 +135,7 @@ public class TestRandomCollapseQParserPlugin extends SolrTestCaseJ4 {
}
}
- public void testRandomCollpaseWithSort() throws Exception {
+ public void testRandomCollpaseWithSort() {
final int numMainQueriesPerCollapseField = atLeast(5);
diff --git a/solr/core/src/test/org/apache/solr/search/TestRangeQuery.java b/solr/core/src/test/org/apache/solr/search/TestRangeQuery.java
index ab11c0b9e57..d6e1dfac544 100644
--- a/solr/core/src/test/org/apache/solr/search/TestRangeQuery.java
+++ b/solr/core/src/test/org/apache/solr/search/TestRangeQuery.java
@@ -107,7 +107,7 @@ public class TestRangeQuery extends SolrTestCaseJ4 {
}
@Test
- public void testRangeQueries() throws Exception {
+ public void testRangeQueries() {
// ensure that we aren't losing precision on any fields in addition to testing other non-numeric
// fields that aren't tested in testRandomRangeQueries()
diff --git a/solr/core/src/test/org/apache/solr/search/TestReRankQParserPlugin.java b/solr/core/src/test/org/apache/solr/search/TestReRankQParserPlugin.java
index 5b00a9e4d05..d9e8869a401 100644
--- a/solr/core/src/test/org/apache/solr/search/TestReRankQParserPlugin.java
+++ b/solr/core/src/test/org/apache/solr/search/TestReRankQParserPlugin.java
@@ -47,7 +47,7 @@ public class TestReRankQParserPlugin extends SolrTestCaseJ4 {
}
@Test
- public void testReRankQParserPluginConstants() throws Exception {
+ public void testReRankQParserPluginConstants() {
assertEquals(ReRankQParserPlugin.NAME, "rerank");
assertEquals(ReRankQParserPlugin.RERANK_QUERY, "reRankQuery");
@@ -60,7 +60,7 @@ public class TestReRankQParserPlugin extends SolrTestCaseJ4 {
}
@Test
- public void testReRankQueries() throws Exception {
+ public void testReRankQueries() {
assertU(delQ("*:*"));
assertU(commit());
@@ -726,7 +726,7 @@ public class TestReRankQParserPlugin extends SolrTestCaseJ4 {
}
@Test
- public void testOverRank() throws Exception {
+ public void testOverRank() {
assertU(delQ("*:*"));
assertU(commit());
@@ -854,8 +854,7 @@ public class TestReRankQParserPlugin extends SolrTestCaseJ4 {
}
@Test
- public void testRerankQueryParsingShouldFailWithoutMandatoryReRankQueryParameter()
- throws Exception {
+ public void testRerankQueryParsingShouldFailWithoutMandatoryReRankQueryParameter() {
assertU(delQ("*:*"));
assertU(commit());
@@ -900,7 +899,7 @@ public class TestReRankQParserPlugin extends SolrTestCaseJ4 {
}
@Test
- public void testReRankQueriesWithDefType() throws Exception {
+ public void testReRankQueriesWithDefType() {
assertU(delQ("*:*"));
assertU(commit());
@@ -947,7 +946,7 @@ public class TestReRankQParserPlugin extends SolrTestCaseJ4 {
}
@Test
- public void testMinExactCount() throws Exception {
+ public void testMinExactCount() {
assertU(delQ("*:*"));
assertU(commit());
diff --git a/solr/core/src/test/org/apache/solr/search/TestSearcherReuse.java b/solr/core/src/test/org/apache/solr/search/TestSearcherReuse.java
index d6839a6bd96..235f5531390 100644
--- a/solr/core/src/test/org/apache/solr/search/TestSearcherReuse.java
+++ b/solr/core/src/test/org/apache/solr/search/TestSearcherReuse.java
@@ -69,7 +69,7 @@ public class TestSearcherReuse extends SolrTestCaseJ4 {
}
@AfterClass
- private static void afterClass() throws Exception {
+ private static void afterClass() {
solrHome = null;
}
diff --git a/solr/core/src/test/org/apache/solr/search/TestSolr4Spatial.java b/solr/core/src/test/org/apache/solr/search/TestSolr4Spatial.java
index 597553553d0..2649d760420 100644
--- a/solr/core/src/test/org/apache/solr/search/TestSolr4Spatial.java
+++ b/solr/core/src/test/org/apache/solr/search/TestSolr4Spatial.java
@@ -207,7 +207,7 @@ public class TestSolr4Spatial extends SolrTestCaseJ4 {
}
@Test
- public void checkResultFormat() throws Exception {
+ public void checkResultFormat() {
// Check input and output format is the same
String IN = "89.9,-130"; // lat,lon
String OUT = IN; // IDENTICAL!
@@ -572,7 +572,7 @@ public class TestSolr4Spatial extends SolrTestCaseJ4 {
}
@Test
- public void testBadScoreParam() throws Exception {
+ public void testBadScoreParam() {
assertQEx(
"expect friendly error message",
"none",
@@ -581,7 +581,7 @@ public class TestSolr4Spatial extends SolrTestCaseJ4 {
}
@Test
- public void testSpatialConfig() throws Exception {
+ public void testSpatialConfig() {
try (SolrCore core = h.getCoreInc()) {
IndexSchema schema = core.getLatestSchema();
diff --git a/solr/core/src/test/org/apache/solr/search/TestSolr4Spatial2.java b/solr/core/src/test/org/apache/solr/search/TestSolr4Spatial2.java
index 7bb754ae81e..e8683b0bd75 100644
--- a/solr/core/src/test/org/apache/solr/search/TestSolr4Spatial2.java
+++ b/solr/core/src/test/org/apache/solr/search/TestSolr4Spatial2.java
@@ -146,7 +146,7 @@ public class TestSolr4Spatial2 extends SolrTestCaseJ4 {
}
@Test
- public void testBadScoreParam() throws Exception {
+ public void testBadScoreParam() {
String fieldName = "bbox";
assertQEx(
"expect friendly error message",
diff --git a/solr/core/src/test/org/apache/solr/search/TestSolrCoreParser.java b/solr/core/src/test/org/apache/solr/search/TestSolrCoreParser.java
index c54bc49444b..b2a909fca0c 100644
--- a/solr/core/src/test/org/apache/solr/search/TestSolrCoreParser.java
+++ b/solr/core/src/test/org/apache/solr/search/TestSolrCoreParser.java
@@ -17,7 +17,6 @@
package org.apache.solr.search;
import java.io.ByteArrayInputStream;
-import java.io.IOException;
import java.io.InputStream;
import java.nio.charset.StandardCharsets;
import org.apache.lucene.analysis.Analyzer;
@@ -68,13 +67,13 @@ public class TestSolrCoreParser extends SolrTestCaseJ4 {
return solrCoreParser;
}
- private Query parseXmlString(String xml) throws IOException, ParserException {
+ private Query parseXmlString(String xml) throws ParserException {
final byte[] xmlBytes = xml.getBytes(StandardCharsets.UTF_8);
final InputStream xmlStream = new ByteArrayInputStream(xmlBytes);
return solrCoreParser().parse(xmlStream);
}
- private Query parseHandyQuery(String lhsXml, String rhsXml) throws IOException, ParserException {
+ private Query parseHandyQuery(String lhsXml, String rhsXml) throws ParserException {
final String xml =
"<HandyQuery>"
+ "<Left>"
@@ -87,17 +86,17 @@ public class TestSolrCoreParser extends SolrTestCaseJ4 {
return parseXmlString(xml);
}
- public void testHello() throws IOException, ParserException {
+ public void testHello() throws ParserException {
final Query query = parseXmlString("<HelloQuery/>");
assertTrue(query instanceof MatchAllDocsQuery);
}
- public void testGoodbye() throws IOException, ParserException {
+ public void testGoodbye() throws ParserException {
final Query query = parseXmlString("<GoodbyeQuery/>");
assertTrue(query instanceof MatchNoDocsQuery);
}
- public void testApacheLuceneSolr() throws IOException, ParserException {
+ public void testApacheLuceneSolr() throws ParserException {
final String fieldName = "contents";
final Query query = parseXmlString("<ApacheLuceneSolr fieldName='" + fieldName + "'/>");
checkApacheLuceneSolr(query, fieldName);
@@ -116,7 +115,7 @@ public class TestSolrCoreParser extends SolrTestCaseJ4 {
}
// test custom query (HandyQueryBuilder) wrapping a Query
- public void testHandyQuery() throws IOException, ParserException {
+ public void testHandyQuery() throws ParserException {
final String lhsXml = "<HelloQuery/>";
final String rhsXml = "<GoodbyeQuery/>";
final Query query = parseHandyQuery(lhsXml, rhsXml);
@@ -128,7 +127,7 @@ public class TestSolrCoreParser extends SolrTestCaseJ4 {
}
// test custom query (HandyQueryBuilder) wrapping a SpanQuery
- public void testHandySpanQuery() throws IOException, ParserException {
+ public void testHandySpanQuery() throws ParserException {
final String lhsXml =
"<SpanOr fieldName='contents'>"
+ "<SpanTerm>rain</SpanTerm>"
@@ -168,7 +167,7 @@ public class TestSolrCoreParser extends SolrTestCaseJ4 {
}
// test custom queries being wrapped in a Query or SpanQuery
- public void testCustomQueryWrapping() throws IOException, ParserException {
+ public void testCustomQueryWrapping() throws ParserException {
final boolean span = random().nextBoolean();
// the custom queries
final String fieldName = "contents";
diff --git a/solr/core/src/test/org/apache/solr/search/TestSolrFieldCacheBean.java b/solr/core/src/test/org/apache/solr/search/TestSolrFieldCacheBean.java
index 23246a95afc..2833902b831 100644
--- a/solr/core/src/test/org/apache/solr/search/TestSolrFieldCacheBean.java
+++ b/solr/core/src/test/org/apache/solr/search/TestSolrFieldCacheBean.java
@@ -39,7 +39,7 @@ public class TestSolrFieldCacheBean extends SolrTestCaseJ4 {
}
@Test
- public void testEntryList() throws Exception {
+ public void testEntryList() {
// ensure entries to FieldCache
assertU(adoc("id", "id0"));
assertU(commit());
diff --git a/solr/core/src/test/org/apache/solr/search/TestSolrJ.java b/solr/core/src/test/org/apache/solr/search/TestSolrJ.java
index b7136afb76a..d9d7fe27f45 100644
--- a/solr/core/src/test/org/apache/solr/search/TestSolrJ.java
+++ b/solr/core/src/test/org/apache/solr/search/TestSolrJ.java
@@ -31,7 +31,7 @@ import org.apache.solr.util.RTimer;
public class TestSolrJ extends SolrTestCaseJ4 {
- public void testSolrJ() throws Exception {
+ public void testSolrJ() {
// docs, producers, connections, sleep_time
// main(new String[] {"1000000","4", "1", "0"});
diff --git a/solr/core/src/test/org/apache/solr/search/TestSort.java b/solr/core/src/test/org/apache/solr/search/TestSort.java
index a0d92a2a45f..67c33afef35 100644
--- a/solr/core/src/test/org/apache/solr/search/TestSort.java
+++ b/solr/core/src/test/org/apache/solr/search/TestSort.java
@@ -97,7 +97,7 @@ public class TestSort extends SolrTestCaseJ4 {
}
}
- public void testRandomFieldNameSorts() throws Exception {
+ public void testRandomFieldNameSorts() {
SolrQueryRequest req = lrf.makeRequest("q", "*:*");
final int iters = atLeast(5000);
diff --git a/solr/core/src/test/org/apache/solr/search/TestStandardQParsers.java b/solr/core/src/test/org/apache/solr/search/TestStandardQParsers.java
index 8d96a232122..b7517e1c620 100644
--- a/solr/core/src/test/org/apache/solr/search/TestStandardQParsers.java
+++ b/solr/core/src/test/org/apache/solr/search/TestStandardQParsers.java
@@ -82,7 +82,7 @@ public class TestStandardQParsers extends SolrTestCase {
/** Test that "lucene" is the default query parser. */
@Test
- public void testDefaultQType() throws Exception {
+ public void testDefaultQType() {
assertEquals(LuceneQParserPlugin.NAME, QParserPlugin.DEFAULT_QTYPE);
assertEquals("lucene", LuceneQParserPlugin.NAME);
}
diff --git a/solr/core/src/test/org/apache/solr/search/TestXmlQParserPlugin.java b/solr/core/src/test/org/apache/solr/search/TestXmlQParserPlugin.java
index e522e5f5c42..b8ab4964018 100644
--- a/solr/core/src/test/org/apache/solr/search/TestXmlQParserPlugin.java
+++ b/solr/core/src/test/org/apache/solr/search/TestXmlQParserPlugin.java
@@ -40,26 +40,26 @@ public class TestXmlQParserPlugin extends SolrTestCaseJ4 {
}
@Test
- public void testHelloQuery() throws Exception {
+ public void testHelloQuery() {
final int numDocs = random().nextInt(10);
implTestQuery(numDocs, "<HelloQuery/>", numDocs);
}
@Test
- public void testGoodbyeQuery() throws Exception {
+ public void testGoodbyeQuery() {
final int numDocs = random().nextInt(10);
implTestQuery(numDocs, "<GoodbyeQuery/>", 0);
}
@Test
- public void testHandyQuery() throws Exception {
+ public void testHandyQuery() {
final int numDocs = random().nextInt(10);
final String q =
"<HandyQuery><Left><HelloQuery/></Left><Right><GoodbyeQuery/></Right></HandyQuery>";
implTestQuery(numDocs, q, numDocs);
}
- public void implTestQuery(int numDocs, String q, int expectedCount) throws Exception {
+ public void implTestQuery(int numDocs, String q, int expectedCount) {
// add some documents
for (int ii = 1; ii <= numDocs; ++ii) {
String[] doc = {"id", ii + "0"};
diff --git a/solr/core/src/test/org/apache/solr/search/facet/SpatialHeatmapFacetsTest.java b/solr/core/src/test/org/apache/solr/search/facet/SpatialHeatmapFacetsTest.java
index 94afeac277b..3ff77ef9434 100644
--- a/solr/core/src/test/org/apache/solr/search/facet/SpatialHeatmapFacetsTest.java
+++ b/solr/core/src/test/org/apache/solr/search/facet/SpatialHeatmapFacetsTest.java
@@ -34,7 +34,7 @@ public class SpatialHeatmapFacetsTest extends BaseDistributedSearchTestCase {
private static final String FIELD = "srpt_quad";
@BeforeClass
- public static void beforeSuperClass() throws Exception {
+ public static void beforeSuperClass() {
schemaString = "schema-spatial.xml";
configString = "solrconfig-basic.xml";
diff --git a/solr/core/src/test/org/apache/solr/search/facet/TestCloudJSONFacetJoinDomain.java b/solr/core/src/test/org/apache/solr/search/facet/TestCloudJSONFacetJoinDomain.java
index 289d4997133..344f1e25870 100644
--- a/solr/core/src/test/org/apache/solr/search/facet/TestCloudJSONFacetJoinDomain.java
+++ b/solr/core/src/test/org/apache/solr/search/facet/TestCloudJSONFacetJoinDomain.java
@@ -201,7 +201,7 @@ public class TestCloudJSONFacetJoinDomain extends SolrCloudTestCase {
}
/** Sanity check that malformed requests produce errors */
- public void testMalformedGivesError() throws Exception {
+ public void testMalformedGivesError() {
ignoreException(".*'join' domain change.*");
@@ -288,7 +288,7 @@ public class TestCloudJSONFacetJoinDomain extends SolrCloudTestCase {
}
}
- public void testSanityCheckDomainMethods() throws Exception {
+ public void testSanityCheckDomainMethods() {
{
final JoinDomain empty = new JoinDomain(null, null, null);
assertEquals(null, empty.toJSONFacetParamValue());
diff --git a/solr/core/src/test/org/apache/solr/search/facet/TestCloudJSONFacetSKGEquiv.java b/solr/core/src/test/org/apache/solr/search/facet/TestCloudJSONFacetSKGEquiv.java
index 767d4fe93cb..0437321921f 100644
--- a/solr/core/src/test/org/apache/solr/search/facet/TestCloudJSONFacetSKGEquiv.java
+++ b/solr/core/src/test/org/apache/solr/search/facet/TestCloudJSONFacetSKGEquiv.java
@@ -247,7 +247,7 @@ public class TestCloudJSONFacetSKGEquiv extends SolrCloudTestCase {
* Sanity check that our method of varying the <code>method</code> param works and can be verified
* by inspecting the debug output of basic requests.
*/
- public void testWhiteboxSanityMethodProcessorDebug() throws Exception {
+ public void testWhiteboxSanityMethodProcessorDebug() {
// NOTE: json.facet debugging output can be wonky, particularly when dealing with cloud
// so for these queries we keep it simple:
// - only one "top" facet per request
@@ -292,7 +292,7 @@ public class TestCloudJSONFacetSKGEquiv extends SolrCloudTestCase {
* </code> in conjunction with the <code>method</code> params works and can be verified by
* inspecting the debug output of basic requests.
*/
- public void testWhiteboxSanitySweepDebug() throws Exception {
+ public void testWhiteboxSanitySweepDebug() {
// NOTE: json.facet debugging output can be wonky, particularly when dealing with cloud
// so for these queries we keep it simple:
// - only one "top" facet per request
@@ -544,7 +544,7 @@ public class TestCloudJSONFacetSKGEquiv extends SolrCloudTestCase {
* pure random monstrosity. (ie: if something obvious gets broken, this test may fail faster and
* in a more obvious way then testRandom)
*/
- public void testBespoke() throws Exception {
+ public void testBespoke() {
{ // two trivial single level facets
Map<String, TermFacet> facets = new LinkedHashMap<>();
facets.put("str", new TermFacet(multiStrField(9), UNIQUE_FIELD_VALS, 0, null, null));
@@ -611,7 +611,7 @@ public class TestCloudJSONFacetSKGEquiv extends SolrCloudTestCase {
}
}
- public void testBespokeAllBuckets() throws Exception {
+ public void testBespokeAllBuckets() {
{ // single level facet w/sorting on skg and allBuckets
Map<String, TermFacet> facets = new LinkedHashMap<>();
facets.put(
@@ -622,7 +622,7 @@ public class TestCloudJSONFacetSKGEquiv extends SolrCloudTestCase {
}
}
- public void testBespokePrefix() throws Exception {
+ public void testBespokePrefix() {
{ // trivial single level facet w/ prefix
Map<String, TermFacet> facets = new LinkedHashMap<>();
facets.put(
@@ -644,7 +644,7 @@ public class TestCloudJSONFacetSKGEquiv extends SolrCloudTestCase {
* params/options. This is more complex then {@link #testBespoke} but should still be easier to
* trace/debug then a pure random monstrosity.
*/
- public void testBespokeStructures() throws Exception {
+ public void testBespokeStructures() {
// we don't need to test every field, just make sure we test enough fields to hit every suffix..
final int maxFacetFieldNum =
Collections.max(
@@ -774,8 +774,7 @@ public class TestCloudJSONFacetSKGEquiv extends SolrCloudTestCase {
final Map<String, TermFacet> facets,
final String query,
final String foreQ,
- final String backQ)
- throws SolrServerException, IOException {
+ final String backQ) {
final SolrParams basicParams =
params(
"rows",
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 7414522f0a3..245fb7ee2f8 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
@@ -110,13 +110,13 @@ public class TestJsonFacetRefinement extends SolrTestCaseHS {
ObjectBuilder ob =
new ObjectBuilder(parser) {
@Override
- public Object newObject() throws IOException {
+ public Object newObject() {
return new SimpleOrderedMap<>();
}
@Override
@SuppressWarnings("unchecked")
- public void addKeyVal(Object map, Object key, Object val) throws IOException {
+ public void addKeyVal(Object map, Object key, Object val) {
((SimpleOrderedMap<Object>) map).add(key.toString(), val);
}
};
diff --git a/solr/core/src/test/org/apache/solr/search/facet/TestJsonFacetsStatsParsing.java b/solr/core/src/test/org/apache/solr/search/facet/TestJsonFacetsStatsParsing.java
index 0ef08dd749b..876a4077531 100644
--- a/solr/core/src/test/org/apache/solr/search/facet/TestJsonFacetsStatsParsing.java
+++ b/solr/core/src/test/org/apache/solr/search/facet/TestJsonFacetsStatsParsing.java
@@ -38,7 +38,7 @@ public class TestJsonFacetsStatsParsing extends SolrTestCaseJ4 {
initCore("solrconfig-tlog.xml", "schema15.xml");
}
- public void testSortEquality() throws Exception {
+ public void testSortEquality() {
assertEquals(
new FacetRequest.FacetSort("count", FacetRequest.SortDirection.desc),
FacetRequest.FacetSort.COUNT_DESC);
diff --git a/solr/core/src/test/org/apache/solr/search/facet/TestJsonFacetsWithNestedObjects.java b/solr/core/src/test/org/apache/solr/search/facet/TestJsonFacetsWithNestedObjects.java
index 802b1fa6b1b..b57fc84cf9b 100644
--- a/solr/core/src/test/org/apache/solr/search/facet/TestJsonFacetsWithNestedObjects.java
+++ b/solr/core/src/test/org/apache/solr/search/facet/TestJsonFacetsWithNestedObjects.java
@@ -16,9 +16,7 @@
*/
package org.apache.solr.search.facet;
-import java.io.IOException;
import org.apache.solr.SolrTestCaseHS;
-import org.apache.solr.client.solrj.SolrServerException;
import org.apache.solr.common.SolrInputDocument;
import org.apache.solr.common.params.ModifiableSolrParams;
import org.junit.BeforeClass;
@@ -37,8 +35,7 @@ public class TestJsonFacetsWithNestedObjects extends SolrTestCaseHS {
indexDocs(client);
}
- private static void indexDocs(final Client client)
- throws IOException, SolrServerException, Exception {
+ private static void indexDocs(final Client client) throws Exception {
client.deleteByQuery("*:*", null);
SolrInputDocument book1 =
diff --git a/solr/core/src/test/org/apache/solr/search/function/SortByFunctionTest.java b/solr/core/src/test/org/apache/solr/search/function/SortByFunctionTest.java
index b79b37ff45e..c65f03cb2ea 100644
--- a/solr/core/src/test/org/apache/solr/search/function/SortByFunctionTest.java
+++ b/solr/core/src/test/org/apache/solr/search/function/SortByFunctionTest.java
@@ -133,7 +133,7 @@ public class SortByFunctionTest extends SolrTestCaseJ4 {
"//result/doc[4]/str[@name='id'][.='3']");
}
- public void testSortJoinDocFreq() throws Exception {
+ public void testSortJoinDocFreq() {
assertU(
adoc(
"id",
@@ -191,7 +191,7 @@ public class SortByFunctionTest extends SolrTestCaseJ4 {
*
* @see #getFieldFunctionClausesToTest
*/
- public void testFieldSortSpecifiedAsFunction() throws Exception {
+ public void testFieldSortSpecifiedAsFunction() {
final long A = Long.MIN_VALUE;
final long B = A + 1L;
final long C = B + 1L;
diff --git a/solr/core/src/test/org/apache/solr/search/function/TestFunctionQuery.java b/solr/core/src/test/org/apache/solr/search/function/TestFunctionQuery.java
index 24950f319b5..22f4de8dbe2 100644
--- a/solr/core/src/test/org/apache/solr/search/function/TestFunctionQuery.java
+++ b/solr/core/src/test/org/apache/solr/search/function/TestFunctionQuery.java
@@ -286,7 +286,7 @@ public class TestFunctionQuery extends SolrTestCaseJ4 {
}
@Test
- public void testExternalFileFieldStringKeys() throws Exception {
+ public void testExternalFileFieldStringKeys() {
clearIndex();
final String extField = "foo_extfs";
@@ -300,7 +300,7 @@ public class TestFunctionQuery extends SolrTestCaseJ4 {
}
@Test
- public void testExternalFileFieldNumericKey() throws Exception {
+ public void testExternalFileFieldNumericKey() {
clearIndex();
final String extField = "eff_trie";
@@ -314,7 +314,7 @@ public class TestFunctionQuery extends SolrTestCaseJ4 {
}
@Test
- public void testOrdAndRordOverPointsField() throws Exception {
+ public void testOrdAndRordOverPointsField() {
assumeTrue("Skipping test when points=false", Boolean.getBoolean(NUMERIC_POINTS_SYSPROP));
clearIndex();
@@ -338,7 +338,7 @@ public class TestFunctionQuery extends SolrTestCaseJ4 {
}
@Test
- public void testGeneral() throws Exception {
+ public void testGeneral() {
clearIndex();
assertU(
@@ -655,7 +655,7 @@ public class TestFunctionQuery extends SolrTestCaseJ4 {
/** test collection-level term stats (new in 4.x indexes) */
@Test
- public void testTotalTermFreq() throws Exception {
+ public void testTotalTermFreq() {
clearIndex();
assertU(
@@ -896,7 +896,7 @@ public class TestFunctionQuery extends SolrTestCaseJ4 {
}
@Test
- public void testDegreeRads() throws Exception {
+ public void testDegreeRads() {
clearIndex();
assertU(adoc("id", "1", "x_td", "0", "y_td", "0"));
@@ -926,7 +926,7 @@ public class TestFunctionQuery extends SolrTestCaseJ4 {
}
@Test
- public void testStrDistance() throws Exception {
+ public void testStrDistance() {
clearIndex();
assertU(adoc("id", "1", "x_s", "foil"));
@@ -969,7 +969,7 @@ public class TestFunctionQuery extends SolrTestCaseJ4 {
"//float[@name='score']='0.0'");
}
- public void dofunc(String func, double val) throws Exception {
+ public void dofunc(String func, double val) {
// String sval = Double.toString(val);
String sval = Float.toString((float) val);
@@ -1240,7 +1240,7 @@ public class TestFunctionQuery extends SolrTestCaseJ4 {
}
@Test
- public void testMissingFieldFunctionBehavior() throws Exception {
+ public void testMissingFieldFunctionBehavior() {
clearIndex();
// add a doc that has no values in any interesting fields
assertU(adoc("id", "1"));
diff --git a/solr/core/src/test/org/apache/solr/search/function/TestMinMaxOnMultiValuedField.java b/solr/core/src/test/org/apache/solr/search/function/TestMinMaxOnMultiValuedField.java
index f9593f195d3..31434bf907f 100644
--- a/solr/core/src/test/org/apache/solr/search/function/TestMinMaxOnMultiValuedField.java
+++ b/solr/core/src/test/org/apache/solr/search/function/TestMinMaxOnMultiValuedField.java
@@ -118,15 +118,15 @@ public class TestMinMaxOnMultiValuedField extends SolrTestCaseJ4 {
assertU(commit());
}
- public void testBasics() throws Exception {
+ public void testBasics() {
testBasics("val_tis_dv", "val_tls_dv", "val_tfs_dv", "val_tds_dv");
testBasics("val_tis_ni_dv", "val_tls_ni_dv", "val_tfs_ni_dv", "val_tds_ni_dv");
testBasics("val_is_p", "val_ls_p", "val_fs_p", "val_ds_p");
testBasics("val_is_ni_p", "val_ls_ni_p", "val_fs_ni_p", "val_ds_ni_p");
}
- private void testBasics(String intField, String longField, String floatField, String doubleField)
- throws Exception {
+ private void testBasics(
+ String intField, String longField, String floatField, String doubleField) {
assertTrue(
"Unexpected int field",
h.getCore().getLatestSchema().getField(intField).getType() instanceof IntValueFieldType);
diff --git a/solr/core/src/test/org/apache/solr/search/function/distance/DistanceFunctionTest.java b/solr/core/src/test/org/apache/solr/search/function/distance/DistanceFunctionTest.java
index 2d0a655b2d8..5fd3ebcd0d0 100644
--- a/solr/core/src/test/org/apache/solr/search/function/distance/DistanceFunctionTest.java
+++ b/solr/core/src/test/org/apache/solr/search/function/distance/DistanceFunctionTest.java
@@ -29,7 +29,7 @@ public class DistanceFunctionTest extends SolrTestCaseJ4 {
}
@Test
- public void testHaversine() throws Exception {
+ public void testHaversine() {
clearIndex();
assertU(adoc("id", "1", "x_td", "0", "y_td", "0"));
assertU(adoc("id", "2", "x_td", "0", "y_td", String.valueOf(Math.PI / 2)));
@@ -192,7 +192,7 @@ public class DistanceFunctionTest extends SolrTestCaseJ4 {
}
@Test
- public void testVector() throws Exception {
+ public void testVector() {
clearIndex();
assertU(adoc("id", "1", "x_td", "0", "y_td", "0", "z_td", "0", "w_td", "0"));
assertU(adoc("id", "2", "x_td", "0", "y_td", "1", "z_td", "0", "w_td", "0"));
diff --git a/solr/core/src/test/org/apache/solr/search/join/BJQParserTest.java b/solr/core/src/test/org/apache/solr/search/join/BJQParserTest.java
index bde3716177c..ec0d54d435c 100644
--- a/solr/core/src/test/org/apache/solr/search/join/BJQParserTest.java
+++ b/solr/core/src/test/org/apache/solr/search/join/BJQParserTest.java
@@ -52,7 +52,7 @@ public class BJQParserTest extends SolrTestCaseJ4 {
createIndex();
}
- public static void createIndex() throws IOException, Exception {
+ public static void createIndex() throws IOException {
int i = 0;
List<List<String[]>> blocks = createBlocks();
for (List<String[]> block : blocks) {
@@ -141,7 +141,7 @@ public class BJQParserTest extends SolrTestCaseJ4 {
}
@Test
- public void testFull() throws IOException, Exception {
+ public void testFull() {
String childb = "{!parent which=\"parent_s:[* TO *]\"}child_s:l";
assertQ(req("q", childb), sixParents);
}
@@ -158,12 +158,12 @@ public class BJQParserTest extends SolrTestCaseJ4 {
};
@Test
- public void testJustParentsFilter() throws IOException {
+ public void testJustParentsFilter() {
assertQ(req("q", "{!parent which=\"parent_s:[* TO *]\"}"), sixParents);
}
@Test
- public void testJustParentsFilterInChild() throws IOException {
+ public void testJustParentsFilterInChild() {
assertQ(
req(
"q",
@@ -225,7 +225,7 @@ public class BJQParserTest extends SolrTestCaseJ4 {
beParents);
}
- public void testScoreNoneScoringForParent() throws Exception {
+ public void testScoreNoneScoringForParent() {
assertQ(
"score=none yields 0.0 score",
req(
@@ -239,7 +239,7 @@ public class BJQParserTest extends SolrTestCaseJ4 {
"(//float[@name='score'])[" + (random().nextInt(6) + 1) + "]=0.0");
}
- public void testWrongScoreExceptionForParent() throws Exception {
+ public void testWrongScoreExceptionForParent() {
final String aMode = ScoreMode.values()[random().nextInt(ScoreMode.values().length)].name();
final String wrongMode =
rarely()
@@ -320,7 +320,7 @@ public class BJQParserTest extends SolrTestCaseJ4 {
}
@Test
- public void testIntersectParentBqChildBq() throws IOException {
+ public void testIntersectParentBqChildBq() {
assertQ(
req(
@@ -334,7 +334,7 @@ public class BJQParserTest extends SolrTestCaseJ4 {
}
@Test
- public void testGrandChildren() throws IOException {
+ public void testGrandChildren() {
assertQ(
req(
"q",
@@ -387,7 +387,7 @@ public class BJQParserTest extends SolrTestCaseJ4 {
}
@Test
- public void testCacheHit() throws IOException {
+ public void testCacheHit() {
MetricsMap parentFilterCache =
(MetricsMap)
diff --git a/solr/core/src/test/org/apache/solr/search/join/GraphQueryTest.java b/solr/core/src/test/org/apache/solr/search/join/GraphQueryTest.java
index 62b9c116e91..7eeda40feaa 100644
--- a/solr/core/src/test/org/apache/solr/search/join/GraphQueryTest.java
+++ b/solr/core/src/test/org/apache/solr/search/join/GraphQueryTest.java
@@ -143,7 +143,7 @@ public class GraphQueryTest extends SolrTestCaseJ4 {
}
@Test
- public void testGraphQueryParserValidation() throws Exception {
+ public void testGraphQueryParserValidation() {
// from schema field existence
doGraphQuery(
params(
@@ -169,7 +169,7 @@ public class GraphQueryTest extends SolrTestCaseJ4 {
String.valueOf(SolrException.ErrorCode.BAD_REQUEST.code)));
}
- public void doGraphQuery(SolrParams p) throws Exception {
+ public void doGraphQuery(SolrParams p) {
String message = p.get("message");
int errorCode = p.getInt("errorCode", SolrException.ErrorCode.UNKNOWN.code);
diff --git a/solr/core/src/test/org/apache/solr/search/join/TestCloudNestedDocsSort.java b/solr/core/src/test/org/apache/solr/search/join/TestCloudNestedDocsSort.java
index a5f373b7132..aaae5cdc517 100644
--- a/solr/core/src/test/org/apache/solr/search/join/TestCloudNestedDocsSort.java
+++ b/solr/core/src/test/org/apache/solr/search/join/TestCloudNestedDocsSort.java
@@ -130,7 +130,7 @@ public class TestCloudNestedDocsSort extends SolrCloudTestCase {
}
@AfterClass
- public static void cleanUpAfterClass() throws Exception {
+ public static void cleanUpAfterClass() {
client = null;
}
diff --git a/solr/core/src/test/org/apache/solr/search/mlt/CloudMLTQParserTest.java b/solr/core/src/test/org/apache/solr/search/mlt/CloudMLTQParserTest.java
index 3e55908d627..6c6b03c07e8 100644
--- a/solr/core/src/test/org/apache/solr/search/mlt/CloudMLTQParserTest.java
+++ b/solr/core/src/test/org/apache/solr/search/mlt/CloudMLTQParserTest.java
@@ -16,7 +16,6 @@
*/
package org.apache.solr.search.mlt;
-import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import org.apache.solr.client.solrj.SolrQuery;
@@ -336,7 +335,7 @@ public class CloudMLTQParserTest extends SolrCloudTestCase {
assertArrayEquals(expectedIds, actualIds);
}
- public void testInvalidSourceDocument() throws IOException {
+ public void testInvalidSourceDocument() {
SolrException e =
expectThrows(
SolrException.class,
diff --git a/solr/core/src/test/org/apache/solr/search/similarities/TestDFRSimilarityFactory.java b/solr/core/src/test/org/apache/solr/search/similarities/TestDFRSimilarityFactory.java
index eccd721e936..6f2fbea2242 100644
--- a/solr/core/src/test/org/apache/solr/search/similarities/TestDFRSimilarityFactory.java
+++ b/solr/core/src/test/org/apache/solr/search/similarities/TestDFRSimilarityFactory.java
@@ -56,7 +56,7 @@ public class TestDFRSimilarityFactory extends BaseSimilarityTestCase {
}
/** LUCENE-3566 */
- public void testParameterC() throws Exception {
+ public void testParameterC() {
Similarity sim = getSimilarity("text_paramc");
assertEquals(DFRSimilarity.class, sim.getClass());
DFRSimilarity dfr = (DFRSimilarity) sim;
diff --git a/solr/core/src/test/org/apache/solr/search/similarities/TestPerFieldSimilarity.java b/solr/core/src/test/org/apache/solr/search/similarities/TestPerFieldSimilarity.java
index 32db6032970..4b0a5a9412e 100644
--- a/solr/core/src/test/org/apache/solr/search/similarities/TestPerFieldSimilarity.java
+++ b/solr/core/src/test/org/apache/solr/search/similarities/TestPerFieldSimilarity.java
@@ -35,19 +35,19 @@ public class TestPerFieldSimilarity extends BaseSimilarityTestCase {
}
/** ... and for a dynamic field */
- public void testDirectDynamic() throws Exception {
+ public void testDirectDynamic() {
assertEquals(SweetSpotSimilarity.class, getSimilarity("text_sim1").getClass());
}
/** test a field where a configurable sim factory is defined */
- public void testFactory() throws Exception {
+ public void testFactory() {
Similarity sim = getSimilarity("sim2text");
assertEquals(MockConfigurableSimilarity.class, sim.getClass());
assertEquals("is there an echo?", ((MockConfigurableSimilarity) sim).getPassthrough());
}
/** ... and for a dynamic field */
- public void testFactoryDynamic() throws Exception {
+ public void testFactoryDynamic() {
Similarity sim = getSimilarity("text_sim2");
assertEquals(MockConfigurableSimilarity.class, sim.getClass());
assertEquals("is there an echo?", ((MockConfigurableSimilarity) sim).getPassthrough());
@@ -61,13 +61,13 @@ public class TestPerFieldSimilarity extends BaseSimilarityTestCase {
}
/** ... and for a dynamic field */
- public void testDefaultsDynamic() throws Exception {
+ public void testDefaultsDynamic() {
Similarity sim = getSimilarity("text_sim3");
assertEquals(BM25Similarity.class, sim.getClass());
}
/** test a field that does not exist */
- public void testNonexistent() throws Exception {
+ public void testNonexistent() {
Similarity sim = getSimilarity("sdfdsfdsfdswr5fsdfdsfdsfs");
assertEquals(BM25Similarity.class, sim.getClass());
}
diff --git a/solr/core/src/test/org/apache/solr/search/similarities/TestPerFieldSimilarityWithDefaultOverride.java b/solr/core/src/test/org/apache/solr/search/similarities/TestPerFieldSimilarityWithDefaultOverride.java
index 2e65cf1375e..d2c5b0689ac 100644
--- a/solr/core/src/test/org/apache/solr/search/similarities/TestPerFieldSimilarityWithDefaultOverride.java
+++ b/solr/core/src/test/org/apache/solr/search/similarities/TestPerFieldSimilarityWithDefaultOverride.java
@@ -38,18 +38,18 @@ public class TestPerFieldSimilarityWithDefaultOverride extends BaseSimilarityTes
}
/** ... and for a dynamic field */
- public void testDirectDynamic() throws Exception {
+ public void testDirectDynamic() {
assertNotNull(getSimilarity("text_sim1", SweetSpotSimilarity.class));
}
/** test a field where a configurable sim factory is explicitly defined */
- public void testDirectFactory() throws Exception {
+ public void testDirectFactory() {
MockConfigurableSimilarity sim = getSimilarity("sim2text", MockConfigurableSimilarity.class);
assertEquals("is there an echo?", sim.getPassthrough());
}
/** ... and for a dynamic field */
- public void testDirectFactoryDynamic() throws Exception {
+ public void testDirectFactoryDynamic() {
MockConfigurableSimilarity sim = getSimilarity("text_sim2", MockConfigurableSimilarity.class);
assertEquals("is there an echo?", sim.getPassthrough());
}
@@ -61,13 +61,13 @@ public class TestPerFieldSimilarityWithDefaultOverride extends BaseSimilarityTes
}
/** ... and for a dynamic field */
- public void testDefaultsDynamic() throws Exception {
+ public void testDefaultsDynamic() {
MockConfigurableSimilarity sim = getSimilarity("text_sim3", MockConfigurableSimilarity.class);
assertEquals("is there an echo?", sim.getPassthrough());
}
/** test a field that does not exist */
- public void testNonexistent() throws Exception {
+ public void testNonexistent() {
MockConfigurableSimilarity sim = getSimilarity("text_sim3", MockConfigurableSimilarity.class);
assertEquals("is there an echo?", sim.getPassthrough());
}
diff --git a/solr/core/src/test/org/apache/solr/security/AuditLoggerIntegrationTest.java b/solr/core/src/test/org/apache/solr/security/AuditLoggerIntegrationTest.java
index ed5eed8eec6..daebf3e3d81 100644
--- a/solr/core/src/test/org/apache/solr/security/AuditLoggerIntegrationTest.java
+++ b/solr/core/src/test/org/apache/solr/security/AuditLoggerIntegrationTest.java
@@ -442,7 +442,7 @@ public class AuditLoggerIntegrationTest extends SolrCloudAuthTestCase {
/**
* @see #runThreeTestAdminCommands
*/
- private static void assertThreeTestAdminEvents(final List<AuditEvent> events) throws Exception {
+ private static void assertThreeTestAdminEvents(final List<AuditEvent> events) {
assertEquals(3, events.size()); // sanity check
assertAuditEvent(
diff --git a/solr/core/src/test/org/apache/solr/security/PKIAuthenticationIntegrationTest.java b/solr/core/src/test/org/apache/solr/security/PKIAuthenticationIntegrationTest.java
index 89fc9a49889..f5d124342b6 100644
--- a/solr/core/src/test/org/apache/solr/security/PKIAuthenticationIntegrationTest.java
+++ b/solr/core/src/test/org/apache/solr/security/PKIAuthenticationIntegrationTest.java
@@ -113,7 +113,7 @@ public class PKIAuthenticationIntegrationTest extends SolrCloudAuthTestCase {
}
@After
- public void distribTearDown() throws Exception {
+ public void distribTearDown() {
MockAuthenticationPlugin.predicate = null;
MockAuthorizationPlugin.predicate = null;
}
diff --git a/solr/core/src/test/org/apache/solr/security/SolrLogAuditLoggerPluginTest.java b/solr/core/src/test/org/apache/solr/security/SolrLogAuditLoggerPluginTest.java
index d0e9c155407..6685b25f340 100644
--- a/solr/core/src/test/org/apache/solr/security/SolrLogAuditLoggerPluginTest.java
+++ b/solr/core/src/test/org/apache/solr/security/SolrLogAuditLoggerPluginTest.java
@@ -20,7 +20,6 @@ package org.apache.solr.security;
import static org.apache.solr.security.AuditLoggerPluginTest.EVENT_ANONYMOUS;
import static org.apache.solr.security.AuditLoggerPluginTest.EVENT_AUTHENTICATED;
-import java.io.IOException;
import java.util.HashMap;
import org.apache.solr.SolrTestCaseJ4;
import org.apache.solr.common.SolrException;
@@ -42,7 +41,7 @@ public class SolrLogAuditLoggerPluginTest extends SolrTestCaseJ4 {
}
@Test(expected = SolrException.class)
- public void badConfig() throws IOException {
+ public void badConfig() {
config.put("invalid", "parameter");
plugin.init(config);
}
diff --git a/solr/core/src/test/org/apache/solr/servlet/CacheHeaderTestBase.java b/solr/core/src/test/org/apache/solr/servlet/CacheHeaderTestBase.java
index b63a6dccf13..76f0484ba59 100644
--- a/solr/core/src/test/org/apache/solr/servlet/CacheHeaderTestBase.java
+++ b/solr/core/src/test/org/apache/solr/servlet/CacheHeaderTestBase.java
@@ -17,7 +17,6 @@
package org.apache.solr.servlet;
import java.net.URI;
-import java.net.URISyntaxException;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import org.apache.http.HttpResponse;
@@ -35,8 +34,7 @@ import org.junit.Test;
public abstract class CacheHeaderTestBase extends SolrJettyTestBase {
- protected HttpRequestBase getSelectMethod(String method, String... params)
- throws URISyntaxException {
+ protected HttpRequestBase getSelectMethod(String method, String... params) {
HttpSolrClient client = (HttpSolrClient) getSolrClient();
HttpRequestBase m = null;
@@ -66,8 +64,7 @@ public abstract class CacheHeaderTestBase extends SolrJettyTestBase {
return m;
}
- protected HttpRequestBase getUpdateMethod(String method, String... params)
- throws URISyntaxException {
+ protected HttpRequestBase getUpdateMethod(String method, String... params) {
HttpSolrClient client = (HttpSolrClient) getSolrClient();
HttpRequestBase m = null;
diff --git a/solr/core/src/test/org/apache/solr/servlet/HttpSolrCallCloudTest.java b/solr/core/src/test/org/apache/solr/servlet/HttpSolrCallCloudTest.java
index 518e8ab4f28..e8c96890ce9 100644
--- a/solr/core/src/test/org/apache/solr/servlet/HttpSolrCallCloudTest.java
+++ b/solr/core/src/test/org/apache/solr/servlet/HttpSolrCallCloudTest.java
@@ -17,7 +17,6 @@
package org.apache.solr.servlet;
-import java.io.IOException;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.HashSet;
@@ -100,7 +99,7 @@ public class HttpSolrCallCloudTest extends SolrCloudTestCase {
}
@Override
- public ServletOutputStream getOutputStream() throws IOException {
+ public ServletOutputStream getOutputStream() {
return new ServletOutputStream() {
@Override
public boolean isReady() {
@@ -111,7 +110,7 @@ public class HttpSolrCallCloudTest extends SolrCloudTestCase {
public void setWriteListener(WriteListener writeListener) {}
@Override
- public void write(int b) throws IOException {}
+ public void write(int b) {}
};
}
@@ -150,7 +149,7 @@ public class HttpSolrCallCloudTest extends SolrCloudTestCase {
}
@Override
- public ServletInputStream getInputStream() throws IOException {
+ public ServletInputStream getInputStream() {
return new ServletInputStream() {
@Override
public boolean isFinished() {
@@ -166,7 +165,7 @@ public class HttpSolrCallCloudTest extends SolrCloudTestCase {
public void setReadListener(ReadListener readListener) {}
@Override
- public int read() throws IOException {
+ public int read() {
return 0;
}
};
diff --git a/solr/core/src/test/org/apache/solr/servlet/ResponseHeaderTest.java b/solr/core/src/test/org/apache/solr/servlet/ResponseHeaderTest.java
index dd8c714b870..7bcbaa5fc99 100644
--- a/solr/core/src/test/org/apache/solr/servlet/ResponseHeaderTest.java
+++ b/solr/core/src/test/org/apache/solr/servlet/ResponseHeaderTest.java
@@ -26,7 +26,6 @@ import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.solr.SolrJettyTestBase;
import org.apache.solr.SolrTestCaseJ4;
-import org.apache.solr.client.solrj.SolrServerException;
import org.apache.solr.client.solrj.impl.HttpSolrClient;
import org.apache.solr.handler.component.ResponseBuilder;
import org.apache.solr.handler.component.SearchComponent;
@@ -57,7 +56,7 @@ public class ResponseHeaderTest extends SolrJettyTestBase {
}
@Test
- public void testHttpResponse() throws SolrServerException, IOException {
+ public void testHttpResponse() throws IOException {
HttpSolrClient client = (HttpSolrClient) getSolrClient();
HttpClient httpClient = client.getHttpClient();
URI uri = URI.create(client.getBaseURL() + "/withHeaders?q=*:*");
diff --git a/solr/core/src/test/org/apache/solr/servlet/SolrRequestParserTest.java b/solr/core/src/test/org/apache/solr/servlet/SolrRequestParserTest.java
index d2a57feb6f9..690920f4d83 100644
--- a/solr/core/src/test/org/apache/solr/servlet/SolrRequestParserTest.java
+++ b/solr/core/src/test/org/apache/solr/servlet/SolrRequestParserTest.java
@@ -171,7 +171,7 @@ public class SolrRequestParserTest extends SolrTestCaseJ4 {
}
@Test
- public void testUrlParamParsing() throws Exception {
+ public void testUrlParamParsing() {
final String[][] teststr =
new String[][] {
{"this is simple", "this%20is%20simple"},
diff --git a/solr/core/src/test/org/apache/solr/spelling/ConjunctionSolrSpellCheckerTest.java b/solr/core/src/test/org/apache/solr/spelling/ConjunctionSolrSpellCheckerTest.java
index ec5f7b5249f..e74731217e4 100644
--- a/solr/core/src/test/org/apache/solr/spelling/ConjunctionSolrSpellCheckerTest.java
+++ b/solr/core/src/test/org/apache/solr/spelling/ConjunctionSolrSpellCheckerTest.java
@@ -90,7 +90,7 @@ public class ConjunctionSolrSpellCheckerTest extends SolrTestCase {
public void build(SolrCore core, SolrIndexSearcher searcher) throws IOException {}
@Override
- public SpellingResult getSuggestions(SpellingOptions options) throws IOException {
+ public SpellingResult getSuggestions(SpellingOptions options) {
return null;
}
}
diff --git a/solr/core/src/test/org/apache/solr/spelling/DirectSolrSpellCheckerTest.java b/solr/core/src/test/org/apache/solr/spelling/DirectSolrSpellCheckerTest.java
index d272cf61b36..36d065f062d 100644
--- a/solr/core/src/test/org/apache/solr/spelling/DirectSolrSpellCheckerTest.java
+++ b/solr/core/src/test/org/apache/solr/spelling/DirectSolrSpellCheckerTest.java
@@ -99,7 +99,7 @@ public class DirectSolrSpellCheckerTest extends SolrTestCaseJ4 {
}
@Test
- public void testOnlyMorePopularWithExtendedResults() throws Exception {
+ public void testOnlyMorePopularWithExtendedResults() {
assertQ(
req(
"q",
diff --git a/solr/core/src/test/org/apache/solr/spelling/IndexBasedSpellCheckerTest.java b/solr/core/src/test/org/apache/solr/spelling/IndexBasedSpellCheckerTest.java
index 85020ed8bb3..6a57c069af7 100644
--- a/solr/core/src/test/org/apache/solr/spelling/IndexBasedSpellCheckerTest.java
+++ b/solr/core/src/test/org/apache/solr/spelling/IndexBasedSpellCheckerTest.java
@@ -81,7 +81,7 @@ public class IndexBasedSpellCheckerTest extends SolrTestCaseJ4 {
}
@Test
- public void testComparator() throws Exception {
+ public void testComparator() {
SpellCheckComponent component =
(SpellCheckComponent) h.getCore().getSearchComponent("spellcheck");
assertNotNull(component);
diff --git a/solr/core/src/test/org/apache/solr/spelling/SpellCheckCollatorTest.java b/solr/core/src/test/org/apache/solr/spelling/SpellCheckCollatorTest.java
index cac6b5d0df3..3792c2eaac7 100644
--- a/solr/core/src/test/org/apache/solr/spelling/SpellCheckCollatorTest.java
+++ b/solr/core/src/test/org/apache/solr/spelling/SpellCheckCollatorTest.java
@@ -137,7 +137,7 @@ public class SpellCheckCollatorTest extends SolrTestCaseJ4 {
@Test
@SuppressWarnings({"unchecked", "rawtypes"})
- public void testCollationWithRangeQuery() throws Exception {
+ public void testCollationWithRangeQuery() {
SolrCore core = h.getCore();
SearchComponent speller = core.getSearchComponent("spellcheck");
assertTrue("speller is null and it shouldn't be", speller != null);
@@ -170,7 +170,7 @@ public class SpellCheckCollatorTest extends SolrTestCaseJ4 {
@Test
@SuppressWarnings({"unchecked", "rawtypes"})
- public void testCollationWithHypens() throws Exception {
+ public void testCollationWithHypens() {
SolrCore core = h.getCore();
SearchComponent speller = core.getSearchComponent("spellcheck");
assertTrue("speller is null and it shouldn't be", speller != null);
@@ -220,7 +220,7 @@ public class SpellCheckCollatorTest extends SolrTestCaseJ4 {
}
}
- public void testCollateWithOverride() throws Exception {
+ public void testCollateWithOverride() {
assertQ(
req(
SpellCheckComponent.COMPONENT_NAME,
@@ -277,7 +277,7 @@ public class SpellCheckCollatorTest extends SolrTestCaseJ4 {
@Test
@SuppressWarnings({"unchecked", "rawtypes"})
- public void testCollateWithFilter() throws Exception {
+ public void testCollateWithFilter() {
SolrCore core = h.getCore();
SearchComponent speller = core.getSearchComponent("spellcheck");
assertTrue("speller is null and it shouldn't be", speller != null);
@@ -313,7 +313,7 @@ public class SpellCheckCollatorTest extends SolrTestCaseJ4 {
@Test
@SuppressWarnings({"unchecked", "rawtypes"})
- public void testCollateWithMultipleRequestHandlers() throws Exception {
+ public void testCollateWithMultipleRequestHandlers() {
SolrCore core = h.getCore();
SearchComponent speller = core.getSearchComponent("spellcheck");
assertTrue("speller is null and it shouldn't be", speller != null);
@@ -360,7 +360,7 @@ public class SpellCheckCollatorTest extends SolrTestCaseJ4 {
@Test
@SuppressWarnings({"unchecked", "rawtypes"})
- public void testExtendedCollate() throws Exception {
+ public void testExtendedCollate() {
SolrCore core = h.getCore();
SearchComponent speller = core.getSearchComponent("spellcheck");
assertTrue("speller is null and it shouldn't be", speller != null);
@@ -470,7 +470,7 @@ public class SpellCheckCollatorTest extends SolrTestCaseJ4 {
@Test
@SuppressWarnings({"unchecked", "rawtypes"})
- public void testCollateWithGrouping() throws Exception {
+ public void testCollateWithGrouping() {
SolrCore core = h.getCore();
SearchComponent speller = core.getSearchComponent("spellcheck");
assertTrue("speller is null and it shouldn't be", speller != null);
@@ -704,7 +704,7 @@ public class SpellCheckCollatorTest extends SolrTestCaseJ4 {
@Test
@SuppressWarnings({"unchecked", "rawtypes"})
- public void testZeroTries() throws Exception {
+ public void testZeroTries() {
SolrCore core = h.getCore();
SearchComponent speller = core.getSearchComponent("spellcheck");
assertTrue("speller is null and it shouldn't be", speller != null);
@@ -732,7 +732,7 @@ public class SpellCheckCollatorTest extends SolrTestCaseJ4 {
@Test
@SuppressWarnings({"unchecked", "rawtypes"})
- public void testWithCursorMark() throws Exception {
+ public void testWithCursorMark() {
SolrCore core = h.getCore();
SearchComponent speller = core.getSearchComponent("spellcheck");
assertTrue("speller is null and it shouldn't be", speller != null);
diff --git a/solr/core/src/test/org/apache/solr/spelling/SpellPossibilityIteratorTest.java b/solr/core/src/test/org/apache/solr/spelling/SpellPossibilityIteratorTest.java
index e2731146020..5e31b0f8ffe 100644
--- a/solr/core/src/test/org/apache/solr/spelling/SpellPossibilityIteratorTest.java
+++ b/solr/core/src/test/org/apache/solr/spelling/SpellPossibilityIteratorTest.java
@@ -86,7 +86,7 @@ public class SpellPossibilityIteratorTest extends SolrTestCaseJ4 {
}
@Test
- public void testScalability() throws Exception {
+ public void testScalability() {
Map<Token, LinkedHashMap<String, Integer>> lotsaSuggestions = new LinkedHashMap<>();
lotsaSuggestions.put(TOKEN_AYE, AYE);
lotsaSuggestions.put(TOKEN_BEE, BEE);
@@ -130,7 +130,7 @@ public class SpellPossibilityIteratorTest extends SolrTestCaseJ4 {
}
@Test
- public void testSpellPossibilityIterator() throws Exception {
+ public void testSpellPossibilityIterator() {
Map<Token, LinkedHashMap<String, Integer>> suggestions = new LinkedHashMap<>();
suggestions.put(TOKEN_AYE, AYE);
suggestions.put(TOKEN_BEE, BEE);
@@ -182,7 +182,7 @@ public class SpellPossibilityIteratorTest extends SolrTestCaseJ4 {
}
@Test
- public void testOverlappingTokens() throws Exception {
+ public void testOverlappingTokens() {
Map<Token, LinkedHashMap<String, Integer>> overlappingSuggestions = new LinkedHashMap<>();
overlappingSuggestions.put(TOKEN_AYE, AYE);
overlappingSuggestions.put(TOKEN_BEE, BEE);
diff --git a/solr/core/src/test/org/apache/solr/spelling/SpellingQueryConverterTest.java b/solr/core/src/test/org/apache/solr/spelling/SpellingQueryConverterTest.java
index fc379faae88..74140d2fcc0 100644
--- a/solr/core/src/test/org/apache/solr/spelling/SpellingQueryConverterTest.java
+++ b/solr/core/src/test/org/apache/solr/spelling/SpellingQueryConverterTest.java
@@ -42,7 +42,7 @@ public class SpellingQueryConverterTest extends SolrTestCase {
}
@Test
- public void testNumeric() throws Exception {
+ public void testNumeric() {
SpellingQueryConverter converter = new SpellingQueryConverter();
converter.init(new NamedList<>());
converter.setAnalyzer(new WhitespaceAnalyzer());
diff --git a/solr/core/src/test/org/apache/solr/spelling/TestSuggestSpellingConverter.java b/solr/core/src/test/org/apache/solr/spelling/TestSuggestSpellingConverter.java
index 81a65f2f0fa..9456aab93ba 100644
--- a/solr/core/src/test/org/apache/solr/spelling/TestSuggestSpellingConverter.java
+++ b/solr/core/src/test/org/apache/solr/spelling/TestSuggestSpellingConverter.java
@@ -16,7 +16,6 @@
*/
package org.apache.solr.spelling;
-import java.io.IOException;
import java.util.Collection;
import java.util.regex.Pattern;
import org.apache.lucene.analysis.Analyzer;
@@ -66,7 +65,7 @@ public class TestSuggestSpellingConverter extends BaseTokenStreamTestCase {
assertConvertsTo("Foo (field:bar) text_hi:हिन्दी ", new String[] {"foo bar हिन्दी"});
}
- public void assertConvertsTo(String text, String expected[]) throws IOException {
+ public void assertConvertsTo(String text, String expected[]) {
Collection<Token> tokens = converter.convert(text);
assertEquals(tokens.size(), expected.length);
int i = 0;
diff --git a/solr/core/src/test/org/apache/solr/spelling/suggest/RandomTestDictionaryFactory.java b/solr/core/src/test/org/apache/solr/spelling/suggest/RandomTestDictionaryFactory.java
index 69b6a234117..09f9f860427 100644
--- a/solr/core/src/test/org/apache/solr/spelling/suggest/RandomTestDictionaryFactory.java
+++ b/solr/core/src/test/org/apache/solr/spelling/suggest/RandomTestDictionaryFactory.java
@@ -84,7 +84,7 @@ public class RandomTestDictionaryFactory extends DictionaryFactory {
}
@Override
- public InputIterator getEntryIterator() throws IOException {
+ public InputIterator getEntryIterator() {
return new InputIterator.InputIteratorWrapper(new RandomByteRefIterator());
}
diff --git a/solr/core/src/test/org/apache/solr/spelling/suggest/SuggesterTest.java b/solr/core/src/test/org/apache/solr/spelling/suggest/SuggesterTest.java
index 64d4ad834d8..a11bcb8f758 100644
--- a/solr/core/src/test/org/apache/solr/spelling/suggest/SuggesterTest.java
+++ b/solr/core/src/test/org/apache/solr/spelling/suggest/SuggesterTest.java
@@ -60,7 +60,7 @@ public class SuggesterTest extends SolrTestCaseJ4 {
}
@Test
- public void testSuggestions() throws Exception {
+ public void testSuggestions() {
addDocs();
assertU(commit()); // configured to do a rebuild on commit
@@ -104,7 +104,7 @@ public class SuggesterTest extends SolrTestCaseJ4 {
}
@Test
- public void testRebuild() throws Exception {
+ public void testRebuild() {
addDocs();
assertU(commit());
assertQ(
@@ -134,7 +134,7 @@ public class SuggesterTest extends SolrTestCaseJ4 {
}
// SOLR-2726
- public void testAnalyzer() throws Exception {
+ public void testAnalyzer() {
Suggester suggester = new Suggester();
NamedList<Object> params = new NamedList<>();
params.add("field", "test_field");
diff --git a/solr/core/src/test/org/apache/solr/spelling/suggest/TestAnalyzeInfixSuggestions.java b/solr/core/src/test/org/apache/solr/spelling/suggest/TestAnalyzeInfixSuggestions.java
index 9f0d3064554..d42965d5d1f 100644
--- a/solr/core/src/test/org/apache/solr/spelling/suggest/TestAnalyzeInfixSuggestions.java
+++ b/solr/core/src/test/org/apache/solr/spelling/suggest/TestAnalyzeInfixSuggestions.java
@@ -71,7 +71,7 @@ public class TestAnalyzeInfixSuggestions extends SolrTestCaseJ4 {
"//lst[@name='suggest']/lst[@name='analyzing_infix_suggest_default']/lst[@name='high']/arr[@name='suggestions']/lst[1]/str[@name='term'][.='Japanese Autocomplete and Japanese <b>High</b>lighter broken']");
}
- public void testMultiple() throws Exception {
+ public void testMultiple() {
assertQ(
req("qt", URI_DEFAULT, "q", "japan", SpellingParams.SPELLCHECK_COUNT, "2"),
@@ -121,7 +121,7 @@ public class TestAnalyzeInfixSuggestions extends SolrTestCaseJ4 {
"//lst[@name='suggest']/lst[@name='analyzing_infix_suggest_default']/lst[@name='japanese ka']/arr[@name='suggestions']/lst[2]/str[@name='term'][.='Add decompose compound <b>Japanese</b> <b>Ka</b>takana token capability to Kuromoji']");
}
- public void testWithoutHighlight() throws Exception {
+ public void testWithoutHighlight() {
assertQ(
req(
"qt",
@@ -137,7 +137,7 @@ public class TestAnalyzeInfixSuggestions extends SolrTestCaseJ4 {
"//lst[@name='suggest']/lst[@name='analyzing_infix_suggest_without_highlight']/lst[@name='japan']/arr[@name='suggestions']/lst[2]/str[@name='term'][.='Add Japanese Kanji number normalization to Kuromoji']");
}
- public void testNotAllTermsRequired() throws Exception {
+ public void testNotAllTermsRequired() {
assertQ(
req(
"qt",
diff --git a/solr/core/src/test/org/apache/solr/spelling/suggest/TestFuzzyAnalyzedSuggestions.java b/solr/core/src/test/org/apache/solr/spelling/suggest/TestFuzzyAnalyzedSuggestions.java
index a10ca01e0fa..d6b5b7db933 100644
--- a/solr/core/src/test/org/apache/solr/spelling/suggest/TestFuzzyAnalyzedSuggestions.java
+++ b/solr/core/src/test/org/apache/solr/spelling/suggest/TestFuzzyAnalyzedSuggestions.java
@@ -69,7 +69,7 @@ public class TestFuzzyAnalyzedSuggestions extends SolrTestCaseJ4 {
"//lst[@name='spellcheck']/lst[@name='suggestions'][not(node())]");
}
- public void testWithMaxEdit2() throws Exception {
+ public void testWithMaxEdit2() {
assertQ(
req("qt", URI_MIN_EDIT_2, "q", "chagn", SpellingParams.SPELLCHECK_COUNT, "3"),
@@ -93,7 +93,7 @@ public class TestFuzzyAnalyzedSuggestions extends SolrTestCaseJ4 {
"//lst[@name='spellcheck']/lst[@name='suggestions']/lst[@name='chacn']/arr[@name='suggestion']/str[3][.='charge']");
}
- public void testWithNonFuzzyPrefix4() throws Exception {
+ public void testWithNonFuzzyPrefix4() {
// This test should not match charge, as the nonFuzzyPrefix has been set to 4
assertQ(
@@ -103,7 +103,7 @@ public class TestFuzzyAnalyzedSuggestions extends SolrTestCaseJ4 {
"//lst[@name='spellcheck']/lst[@name='suggestions']/lst[@name='chanr']/arr[@name='suggestion']/str[2][.='change']");
}
- public void testWithMinFuzzyLength2() throws Exception {
+ public void testWithMinFuzzyLength2() {
// This test should match chance as the minFuzzyLength parameter has been set to 2
assertQ(
diff --git a/solr/core/src/test/org/apache/solr/uninverting/TestFieldCacheSortRandom.java b/solr/core/src/test/org/apache/solr/uninverting/TestFieldCacheSortRandom.java
index 219d3675b04..17a8b1592a7 100644
--- a/solr/core/src/test/org/apache/solr/uninverting/TestFieldCacheSortRandom.java
+++ b/solr/core/src/test/org/apache/solr/uninverting/TestFieldCacheSortRandom.java
@@ -296,8 +296,7 @@ public class TestFieldCacheSortRandom extends SolrTestCase {
}
@Override
- public Weight createWeight(IndexSearcher searcher, ScoreMode scoreMode, float boost)
- throws IOException {
+ public Weight createWeight(IndexSearcher searcher, ScoreMode scoreMode, float boost) {
return new ConstantScoreWeight(this, boost) {
@Override
public Scorer scorer(LeafReaderContext context) throws IOException {
diff --git a/solr/core/src/test/org/apache/solr/uninverting/TestFieldCacheVsDocValues.java b/solr/core/src/test/org/apache/solr/uninverting/TestFieldCacheVsDocValues.java
index 746537c349c..32fd744ac8d 100644
--- a/solr/core/src/test/org/apache/solr/uninverting/TestFieldCacheVsDocValues.java
+++ b/solr/core/src/test/org/apache/solr/uninverting/TestFieldCacheVsDocValues.java
@@ -379,7 +379,7 @@ public class TestFieldCacheVsDocValues extends SolrTestCase {
abstract long next();
}
- private void assertEquals(Bits expected, Bits actual) throws Exception {
+ private void assertEquals(Bits expected, Bits actual) {
assertEquals(expected.length(), actual.length());
for (int i = 0; i < expected.length(); i++) {
assertEquals(expected.get(i), actual.get(i));
diff --git a/solr/core/src/test/org/apache/solr/update/DataDrivenBlockJoinTest.java b/solr/core/src/test/org/apache/solr/update/DataDrivenBlockJoinTest.java
index 777a72601ad..844fa618074 100644
--- a/solr/core/src/test/org/apache/solr/update/DataDrivenBlockJoinTest.java
+++ b/solr/core/src/test/org/apache/solr/update/DataDrivenBlockJoinTest.java
@@ -50,7 +50,7 @@ public class DataDrivenBlockJoinTest extends SolrTestCaseJ4 {
}
@Test
- public void testAddNestedDocuments() throws Exception {
+ public void testAddNestedDocuments() {
assertU(
"<add>"
+ " <doc>"
diff --git a/solr/core/src/test/org/apache/solr/update/DeleteByIdWithRouterFieldTest.java b/solr/core/src/test/org/apache/solr/update/DeleteByIdWithRouterFieldTest.java
index d0663bc90f8..1eae5c9443f 100644
--- a/solr/core/src/test/org/apache/solr/update/DeleteByIdWithRouterFieldTest.java
+++ b/solr/core/src/test/org/apache/solr/update/DeleteByIdWithRouterFieldTest.java
@@ -285,7 +285,7 @@ public class DeleteByIdWithRouterFieldTest extends SolrCloudTestCase {
* Test that {@link UpdateRequest#getRoutesToCollection} correctly populates routes for all
* deletes
*/
- public void testGlassBoxUpdateRequestRoutesToShards() throws Exception {
+ public void testGlassBoxUpdateRequestRoutesToShards() {
final DocCollection docCol = cluster.getSolrClient().getClusterState().getCollection(COLL);
// we don't need "real" urls for all replicas, just something we can use as lookup keys for
diff --git a/solr/core/src/test/org/apache/solr/update/DirectUpdateHandlerTest.java b/solr/core/src/test/org/apache/solr/update/DirectUpdateHandlerTest.java
index 079141cc92f..65a424cfb0b 100644
--- a/solr/core/src/test/org/apache/solr/update/DirectUpdateHandlerTest.java
+++ b/solr/core/src/test/org/apache/solr/update/DirectUpdateHandlerTest.java
@@ -82,7 +82,7 @@ public class DirectUpdateHandlerTest extends SolrTestCaseJ4 {
}
@Test
- public void testRequireUniqueKey() throws Exception {
+ public void testRequireUniqueKey() {
// Add a valid document
assertU(adoc("id", "1"));
@@ -97,7 +97,7 @@ public class DirectUpdateHandlerTest extends SolrTestCaseJ4 {
@Test
@SuppressWarnings({"unchecked"})
- public void testBasics() throws Exception {
+ public void testBasics() {
// get initial metrics
Map<String, Metric> metrics =
@@ -355,7 +355,7 @@ public class DirectUpdateHandlerTest extends SolrTestCaseJ4 {
}
@Test
- public void testExpungeDeletes() throws Exception {
+ public void testExpungeDeletes() {
assertU(adoc("id", "1"));
assertU(adoc("id", "2"));
assertU(commit());
@@ -441,7 +441,7 @@ public class DirectUpdateHandlerTest extends SolrTestCaseJ4 {
}
@Test
- public void testPostSoftCommitEvents() throws Exception {
+ public void testPostSoftCommitEvents() {
SolrCore core = h.getCore();
assert core != null;
DirectUpdateHandler2 updater = (DirectUpdateHandler2) core.getUpdateHandler();
diff --git a/solr/core/src/test/org/apache/solr/update/DocumentBuilderTest.java b/solr/core/src/test/org/apache/solr/update/DocumentBuilderTest.java
index cd5b7256a22..30d0bc2edb2 100644
--- a/solr/core/src/test/org/apache/solr/update/DocumentBuilderTest.java
+++ b/solr/core/src/test/org/apache/solr/update/DocumentBuilderTest.java
@@ -64,7 +64,7 @@ public class DocumentBuilderTest extends SolrTestCaseJ4 {
}
@Test
- public void testBuildDocument() throws Exception {
+ public void testBuildDocument() {
SolrCore core = h.getCore();
// undefined field
SolrInputDocument doc = new SolrInputDocument();
@@ -114,7 +114,7 @@ public class DocumentBuilderTest extends SolrTestCaseJ4 {
}
@Test
- public void testMultiField() throws Exception {
+ public void testMultiField() {
SolrCore core = h.getCore();
// make sure a null value is not indexed
diff --git a/solr/core/src/test/org/apache/solr/update/PeerSyncTest.java b/solr/core/src/test/org/apache/solr/update/PeerSyncTest.java
index ba3a7ba58bc..6c321758db1 100644
--- a/solr/core/src/test/org/apache/solr/update/PeerSyncTest.java
+++ b/solr/core/src/test/org/apache/solr/update/PeerSyncTest.java
@@ -440,7 +440,7 @@ public class PeerSyncTest extends BaseDistributedSearchTestCase {
assertEquals(docsAdded.size(), qacResponse.getResults().getNumFound());
}
- private static void handleVersionsWithRangesTests() throws Exception {
+ private static void handleVersionsWithRangesTests() {
testHandleVersionsWithRangesNoOther();
testHandleVersionsWithRangesSameOne();
testHandleVersionsWithRangesMissingOneOfTwo(false /* highestMissing */);
@@ -451,7 +451,7 @@ public class PeerSyncTest extends BaseDistributedSearchTestCase {
testHandleVersionsWithRangesMissingTwoRanges();
}
- private static void testHandleVersionsWithRangesNoOther() throws Exception {
+ private static void testHandleVersionsWithRangesNoOther() {
// no other, solitary us
for (boolean completeList : new boolean[] {false, true}) {
List<Long> otherVersions = Collections.emptyList();
@@ -467,7 +467,7 @@ public class PeerSyncTest extends BaseDistributedSearchTestCase {
}
}
- private static void testHandleVersionsWithRangesSameOne() throws Exception {
+ private static void testHandleVersionsWithRangesSameOne() {
for (boolean completeList : new boolean[] {false, true}) {
List<Long> otherVersions = Collections.singletonList(42L);
List<Long> ourUpdates = Collections.singletonList(42L);
@@ -482,8 +482,7 @@ public class PeerSyncTest extends BaseDistributedSearchTestCase {
}
}
- private static void testHandleVersionsWithRangesMissingOneOfTwo(boolean highestMissing)
- throws Exception {
+ private static void testHandleVersionsWithRangesMissingOneOfTwo(boolean highestMissing) {
for (boolean completeList : new boolean[] {false, true}) {
LinkedList<Long> otherVersions = new LinkedList<>(List.of(44L, 22L));
LinkedList<Long> ourUpdates = new LinkedList<>(otherVersions);
@@ -518,7 +517,7 @@ public class PeerSyncTest extends BaseDistributedSearchTestCase {
}
}
- private static void testHandleVersionsWithRangesMissingMiddleOfThree() throws Exception {
+ private static void testHandleVersionsWithRangesMissingMiddleOfThree() {
for (boolean completeList : new boolean[] {false, true}) {
List<Long> otherVersions = List.of(55L, 33L, 11L);
LinkedList<Long> ourUpdates = new LinkedList<>(otherVersions);
@@ -555,8 +554,7 @@ public class PeerSyncTest extends BaseDistributedSearchTestCase {
}
}
- private static void testHandleVersionsWithRangesMissingOneRange(boolean duplicateMiddle)
- throws Exception {
+ private static void testHandleVersionsWithRangesMissingOneRange(boolean duplicateMiddle) {
for (boolean completeList : new boolean[] {false, true}) {
List<Long> otherVersions =
duplicateMiddle
@@ -627,7 +625,7 @@ public class PeerSyncTest extends BaseDistributedSearchTestCase {
}
}
- private static void testHandleVersionsWithRangesMissingTwoRanges() throws Exception {
+ private static void testHandleVersionsWithRangesMissingTwoRanges() {
for (boolean completeList : new boolean[] {false, true}) {
LinkedList<Long> otherVersions =
new LinkedList<>(List.of(9L, 8L, 7L, 6L, 5L, 4L, 3L, 2L, 1L));
diff --git a/solr/core/src/test/org/apache/solr/update/SolrCmdDistributorTest.java b/solr/core/src/test/org/apache/solr/update/SolrCmdDistributorTest.java
index 16d4e9e48c2..92c38f248df 100644
--- a/solr/core/src/test/org/apache/solr/update/SolrCmdDistributorTest.java
+++ b/solr/core/src/test/org/apache/solr/update/SolrCmdDistributorTest.java
@@ -27,7 +27,6 @@ import java.util.List;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;
-import javax.xml.parsers.ParserConfigurationException;
import org.apache.solr.BaseDistributedSearchTestCase;
import org.apache.solr.client.solrj.SolrClient;
import org.apache.solr.client.solrj.SolrQuery;
@@ -61,7 +60,6 @@ import org.apache.solr.util.TestInjection;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
-import org.xml.sax.SAXException;
// See: https://issues.apache.org/jira/browse/SOLR-12028 Tests cannot remove files on Windows
// machines occasionally
@@ -90,7 +88,7 @@ public class SolrCmdDistributorTest extends BaseDistributedSearchTestCase {
private UpdateShardHandler updateShardHandler;
- public SolrCmdDistributorTest() throws ParserConfigurationException, IOException, SAXException {
+ public SolrCmdDistributorTest() {
updateShardHandler = new UpdateShardHandler(UpdateShardHandlerConfig.DEFAULT);
stress = 0;
@@ -916,7 +914,7 @@ public class SolrCmdDistributorTest extends BaseDistributedSearchTestCase {
}
}
- private void testStuckUpdates() throws Exception {
+ private void testStuckUpdates() {
TestInjection.directUpdateLatch = new CountDownLatch(1);
List<Node> nodes = new ArrayList<>();
ModifiableSolrParams params;
diff --git a/solr/core/src/test/org/apache/solr/update/SolrIndexMetricsTest.java b/solr/core/src/test/org/apache/solr/update/SolrIndexMetricsTest.java
index 73bc9c73028..55bc52cbf6d 100644
--- a/solr/core/src/test/org/apache/solr/update/SolrIndexMetricsTest.java
+++ b/solr/core/src/test/org/apache/solr/update/SolrIndexMetricsTest.java
@@ -31,7 +31,7 @@ import org.junit.Test;
public class SolrIndexMetricsTest extends SolrTestCaseJ4 {
@After
- public void afterMethod() throws Exception {
+ public void afterMethod() {
deleteCore();
}
diff --git a/solr/core/src/test/org/apache/solr/update/SolrIndexSplitterTest.java b/solr/core/src/test/org/apache/solr/update/SolrIndexSplitterTest.java
index 694628333cf..c538b89a52f 100644
--- a/solr/core/src/test/org/apache/solr/update/SolrIndexSplitterTest.java
+++ b/solr/core/src/test/org/apache/solr/update/SolrIndexSplitterTest.java
@@ -19,7 +19,6 @@ package org.apache.solr.update;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Lists;
import java.io.File;
-import java.io.UnsupportedEncodingException;
import java.lang.invoke.MethodHandles;
import java.nio.charset.StandardCharsets;
import java.util.List;
@@ -489,8 +488,7 @@ public class SolrIndexSplitterTest extends SolrTestCaseJ4 {
}
}
- private List<DocRouter.Range> getRanges(String id1, String id2)
- throws UnsupportedEncodingException {
+ private List<DocRouter.Range> getRanges(String id1, String id2) {
// find minHash/maxHash hash ranges
byte[] bytes = id1.getBytes(StandardCharsets.UTF_8);
int minHash = Hash.murmurhash3_x86_32(bytes, 0, bytes.length, 0);
diff --git a/solr/core/src/test/org/apache/solr/update/TestNestedUpdateProcessor.java b/solr/core/src/test/org/apache/solr/update/TestNestedUpdateProcessor.java
index 44809c8e637..23936339070 100644
--- a/solr/core/src/test/org/apache/solr/update/TestNestedUpdateProcessor.java
+++ b/solr/core/src/test/org/apache/solr/update/TestNestedUpdateProcessor.java
@@ -282,7 +282,7 @@ public class TestNestedUpdateProcessor extends SolrTestCaseJ4 {
*
* @see <a href="https://issues.apache.org/jira/browse/SOLR-14687">SOLR-14687</a>
*/
- public void testRandomNestPathQueryFiltering() throws Exception {
+ public void testRandomNestPathQueryFiltering() {
// First: build a bunch of complex randomly nested documents, with random "nest paths"
// re-use the same "path segments" at various levels of nested, so as to confuse things even
diff --git a/solr/core/src/test/org/apache/solr/update/UpdateParamsTest.java b/solr/core/src/test/org/apache/solr/update/UpdateParamsTest.java
index d4c26b7b4dc..986777bbfeb 100644
--- a/solr/core/src/test/org/apache/solr/update/UpdateParamsTest.java
+++ b/solr/core/src/test/org/apache/solr/update/UpdateParamsTest.java
@@ -34,7 +34,7 @@ public class UpdateParamsTest extends SolrTestCaseJ4 {
}
/** Tests that only update.chain and not update.processor works (SOLR-2105) */
- public void testUpdateProcessorParamDeprecationRemoved() throws Exception {
+ public void testUpdateProcessorParamDeprecationRemoved() {
SolrCore core = h.getCore();
UpdateRequestHandler handler = new UpdateRequestHandler();
diff --git a/solr/core/src/test/org/apache/solr/update/processor/AddSchemaFieldsUpdateProcessorFactoryTest.java b/solr/core/src/test/org/apache/solr/update/processor/AddSchemaFieldsUpdateProcessorFactoryTest.java
index 33256f3e1f5..e641c08561c 100644
--- a/solr/core/src/test/org/apache/solr/update/processor/AddSchemaFieldsUpdateProcessorFactoryTest.java
+++ b/solr/core/src/test/org/apache/solr/update/processor/AddSchemaFieldsUpdateProcessorFactoryTest.java
@@ -350,7 +350,7 @@ public class AddSchemaFieldsUpdateProcessorFactoryTest extends UpdateProcessorTe
}
@After
- private void deleteCoreAndTempSolrHomeDirectory() throws Exception {
+ private void deleteCoreAndTempSolrHomeDirectory() {
deleteCore();
}
}
diff --git a/solr/core/src/test/org/apache/solr/update/processor/CategoryRoutedAliasUpdateProcessorTest.java b/solr/core/src/test/org/apache/solr/update/processor/CategoryRoutedAliasUpdateProcessorTest.java
index 5a20c6cdfbf..4233a7e71a3 100644
--- a/solr/core/src/test/org/apache/solr/update/processor/CategoryRoutedAliasUpdateProcessorTest.java
+++ b/solr/core/src/test/org/apache/solr/update/processor/CategoryRoutedAliasUpdateProcessorTest.java
@@ -84,7 +84,7 @@ public class CategoryRoutedAliasUpdateProcessorTest extends RoutedAliasUpdatePro
}
@AfterClass
- public static void cleanUpAfterClass() throws Exception {
+ public static void cleanUpAfterClass() {
solrClient = null;
}
diff --git a/solr/core/src/test/org/apache/solr/update/processor/NestedAtomicUpdateTest.java b/solr/core/src/test/org/apache/solr/update/processor/NestedAtomicUpdateTest.java
index 2a292fc466c..007eba8d4d3 100644
--- a/solr/core/src/test/org/apache/solr/update/processor/NestedAtomicUpdateTest.java
+++ b/solr/core/src/test/org/apache/solr/update/processor/NestedAtomicUpdateTest.java
@@ -56,7 +56,7 @@ public class NestedAtomicUpdateTest extends SolrTestCaseJ4 {
}
@Test
- public void testMergeChildDoc() throws Exception {
+ public void testMergeChildDoc() {
SolrInputDocument newChildDoc = sdoc("id", "3", "cat_ss", "child");
SolrInputDocument addedDoc =
sdoc(
@@ -97,7 +97,7 @@ public class NestedAtomicUpdateTest extends SolrTestCaseJ4 {
}
@Test
- public void testMergeChildDocsWithSameId() throws Exception {
+ public void testMergeChildDocsWithSameId() {
SolrInputDocument existingChild = sdoc("id", "2", "cat_ss", "child");
SolrInputDocument existingDoc =
sdoc(
@@ -136,7 +136,7 @@ public class NestedAtomicUpdateTest extends SolrTestCaseJ4 {
}
@Test
- public void testMergeChildDocsWithSameAndNestedSet() throws Exception {
+ public void testMergeChildDocsWithSameAndNestedSet() {
SolrInputDocument existingChild = sdoc("id", "2", "cat_ss", "child");
SolrInputDocument existingDoc =
sdoc(
@@ -178,7 +178,7 @@ public class NestedAtomicUpdateTest extends SolrTestCaseJ4 {
}
@Test
- public void testMergeChildDocsWithMultipleChildDocs() throws Exception {
+ public void testMergeChildDocsWithMultipleChildDocs() {
SolrInputDocument existingChild = sdoc("id", "2", "cat_ss", "child");
SolrInputDocument nonMatchingExistingChild = sdoc("id", "3", "cat_ss", "other");
SolrInputDocument existingDoc =
@@ -218,7 +218,7 @@ public class NestedAtomicUpdateTest extends SolrTestCaseJ4 {
}
@Test
- public void testAtomicUpdateNonExistingChildException() throws Exception {
+ public void testAtomicUpdateNonExistingChildException() {
SolrInputDocument existingChild = sdoc("id", "2", "cat_ss", "child");
SolrInputDocument existingDoc =
sdoc(
@@ -1012,7 +1012,7 @@ public class NestedAtomicUpdateTest extends SolrTestCaseJ4 {
"/response/docs/[0]/cat_ss/[1]==\"ccc\"");
}
- public void testIncorrectlyUpdateChildDoc() throws Exception {
+ public void testIncorrectlyUpdateChildDoc() {
SolrInputDocument doc = sdoc("id", "1", "child", sdoc("id", "2"));
assertU(adoc(doc));
assertU(commit());
diff --git a/solr/core/src/test/org/apache/solr/update/processor/RegexBoostProcessorTest.java b/solr/core/src/test/org/apache/solr/update/processor/RegexBoostProcessorTest.java
index 2854f62ad4e..cd2f1dba572 100644
--- a/solr/core/src/test/org/apache/solr/update/processor/RegexBoostProcessorTest.java
+++ b/solr/core/src/test/org/apache/solr/update/processor/RegexBoostProcessorTest.java
@@ -54,7 +54,7 @@ public class RegexBoostProcessorTest extends SolrTestCaseJ4 {
}
@AfterClass
- public static void tearDownAfterClass() throws Exception {
+ public static void tearDownAfterClass() {
// null static members for gc
reProcessor = null;
_parser = null;
diff --git a/solr/core/src/test/org/apache/solr/update/processor/SignatureUpdateProcessorFactoryTest.java b/solr/core/src/test/org/apache/solr/update/processor/SignatureUpdateProcessorFactoryTest.java
index 398b9289ba8..4573145ab03 100644
--- a/solr/core/src/test/org/apache/solr/update/processor/SignatureUpdateProcessorFactoryTest.java
+++ b/solr/core/src/test/org/apache/solr/update/processor/SignatureUpdateProcessorFactoryTest.java
@@ -217,7 +217,7 @@ public class SignatureUpdateProcessorFactoryTest extends SolrTestCaseJ4 {
}
@Test
- public void testFailNonIndexedSigWithOverwriteDupes() throws Exception {
+ public void testFailNonIndexedSigWithOverwriteDupes() {
SolrCore core = h.getCore();
SignatureUpdateProcessorFactory f = new SignatureUpdateProcessorFactory();
NamedList<String> initArgs = new NamedList<>();
diff --git a/solr/core/src/test/org/apache/solr/update/processor/TolerantUpdateProcessorTest.java b/solr/core/src/test/org/apache/solr/update/processor/TolerantUpdateProcessorTest.java
index 6c679f1585a..dc6bbfbc5de 100644
--- a/solr/core/src/test/org/apache/solr/update/processor/TolerantUpdateProcessorTest.java
+++ b/solr/core/src/test/org/apache/solr/update/processor/TolerantUpdateProcessorTest.java
@@ -215,7 +215,7 @@ public class TolerantUpdateProcessorTest extends UpdateProcessorTestBase {
}
@Test
- public void testMaxErrorsThrowsException() throws IOException {
+ public void testMaxErrorsThrowsException() {
ModifiableSolrParams requestParams = new ModifiableSolrParams();
requestParams.add("maxErrors", "5");
@@ -246,7 +246,7 @@ public class TolerantUpdateProcessorTest extends UpdateProcessorTestBase {
}
@Test
- public void testMaxErrors0() throws IOException {
+ public void testMaxErrors0() {
// make the TolerantUpdateProcessor intolerant
List<SolrInputDocument> smallBatch = docs.subList(0, 2);
ModifiableSolrParams requestParams = new ModifiableSolrParams();
diff --git a/solr/core/src/test/org/apache/solr/update/processor/UpdateRequestProcessorFactoryTest.java b/solr/core/src/test/org/apache/solr/update/processor/UpdateRequestProcessorFactoryTest.java
index 3f1f9d82e36..e8d32d10c57 100644
--- a/solr/core/src/test/org/apache/solr/update/processor/UpdateRequestProcessorFactoryTest.java
+++ b/solr/core/src/test/org/apache/solr/update/processor/UpdateRequestProcessorFactoryTest.java
@@ -54,7 +54,7 @@ public class UpdateRequestProcessorFactoryTest extends SolrTestCaseJ4 {
assertTrue(l.get(0) instanceof TemplateUpdateProcessorFactory);
}
- public void testConfiguration() throws Exception {
+ public void testConfiguration() {
SolrCore core = h.getCore();
// make sure it loaded the factories
@@ -85,7 +85,7 @@ public class UpdateRequestProcessorFactoryTest extends SolrTestCaseJ4 {
assertEquals("{name={n8=88, n9=99}}", link.args.toString());
}
- public void testUpdateDistribChainSkipping() throws Exception {
+ public void testUpdateDistribChainSkipping() {
// a key part of this test is verifying that LogUpdateProcessor is found in all chains because
// it is a @RunAlways processor -- but in order for that to work, we have to sanity check that
diff --git a/solr/core/src/test/org/apache/solr/util/CircularListTest.java b/solr/core/src/test/org/apache/solr/util/CircularListTest.java
index 7708282058a..4906e970db2 100644
--- a/solr/core/src/test/org/apache/solr/util/CircularListTest.java
+++ b/solr/core/src/test/org/apache/solr/util/CircularListTest.java
@@ -16,7 +16,6 @@
*/
package org.apache.solr.util;
-import java.io.IOException;
import org.apache.solr.SolrTestCase;
import org.apache.solr.logging.CircularList;
import org.junit.Test;
@@ -25,7 +24,7 @@ import org.junit.Test;
public class CircularListTest extends SolrTestCase {
@Test
- public void testCircularList() throws IOException {
+ public void testCircularList() {
CircularList<Integer> list = new CircularList<>(10);
for (int i = 0; i < 10; i++) {
list.add(i);
diff --git a/solr/core/src/test/org/apache/solr/util/DateMathParserTest.java b/solr/core/src/test/org/apache/solr/util/DateMathParserTest.java
index 2c249b44657..742a30becac 100644
--- a/solr/core/src/test/org/apache/solr/util/DateMathParserTest.java
+++ b/solr/core/src/test/org/apache/solr/util/DateMathParserTest.java
@@ -295,7 +295,7 @@ public class DateMathParserTest extends SolrTestCaseJ4 {
assertMath("2001-11-03T23:00:00.000", p, "+4MONTH/DAY");
}
- public void testParseMathExceptions() throws Exception {
+ public void testParseMathExceptions() {
DateMathParser p = new DateMathParser(UTC);
setNow(p, "1234-07-04T12:08:56.235");
@@ -365,7 +365,7 @@ public class DateMathParserTest extends SolrTestCaseJ4 {
}
/** Using dates in the canonical format, verify that parsing+formatting is an identify function */
- public void testRoundTrip() throws Exception {
+ public void testRoundTrip() {
// NOTE: the 2nd arg is what the round trip result looks like (may be null if same as input)
assertParseFormatEquals(
@@ -412,7 +412,7 @@ public class DateMathParserTest extends SolrTestCaseJ4 {
assertParseFormatEquals("-12021-12-01T02:02:02Z", null);
}
- public void testParseLenient() throws Exception {
+ public void testParseLenient() {
// dates that only parse thanks to lenient mode of DateTimeFormatter
assertParseFormatEquals(
"10995-12-31T23:59:59.990Z", "+10995-12-31T23:59:59.990Z"); // missing '+' 5 digit year
diff --git a/solr/core/src/test/org/apache/solr/util/DistanceUnitsTest.java b/solr/core/src/test/org/apache/solr/util/DistanceUnitsTest.java
index dc439b752e7..5ce261e4755 100644
--- a/solr/core/src/test/org/apache/solr/util/DistanceUnitsTest.java
+++ b/solr/core/src/test/org/apache/solr/util/DistanceUnitsTest.java
@@ -21,7 +21,7 @@ import org.locationtech.spatial4j.distance.DistanceUtils;
public class DistanceUnitsTest extends SolrTestCase {
- public void testAddNewUnits() throws Exception {
+ public void testAddNewUnits() {
DistanceUnits.addUnits("lightyears", 6.73430542e-12, 9.4605284e12 * DistanceUtils.KM_TO_DEG);
assertTrue(DistanceUnits.getSupportedUnits().contains("lightyears"));
}
diff --git a/solr/core/src/test/org/apache/solr/util/SolrPluginUtilsTest.java b/solr/core/src/test/org/apache/solr/util/SolrPluginUtilsTest.java
index 6b917bba506..88b2c2db0d0 100644
--- a/solr/core/src/test/org/apache/solr/util/SolrPluginUtilsTest.java
+++ b/solr/core/src/test/org/apache/solr/util/SolrPluginUtilsTest.java
@@ -96,7 +96,7 @@ public class SolrPluginUtilsTest extends SolrTestCaseJ4 {
}
@Test
- public void testParseFieldBoosts() throws Exception {
+ public void testParseFieldBoosts() {
Map<String, Float> e1 = new HashMap<>();
e1.put("fieldOne", 2.3f);
diff --git a/solr/core/src/test/org/apache/solr/util/TestSolrCLIRunExample.java b/solr/core/src/test/org/apache/solr/util/TestSolrCLIRunExample.java
index 8dbc5b75225..a2d24128d6d 100644
--- a/solr/core/src/test/org/apache/solr/util/TestSolrCLIRunExample.java
+++ b/solr/core/src/test/org/apache/solr/util/TestSolrCLIRunExample.java
@@ -70,7 +70,7 @@ public class TestSolrCLIRunExample extends SolrTestCaseJ4 {
}
@AfterClass
- public static void cleanupDirectoryFactory() throws IOException {
+ public static void cleanupDirectoryFactory() {
System.clearProperty("solr.directoryFactory");
}
diff --git a/solr/core/src/test/org/apache/solr/util/TimeZoneUtilsTest.java b/solr/core/src/test/org/apache/solr/util/TimeZoneUtilsTest.java
index ed7ab79ec2a..7f214ada8fb 100644
--- a/solr/core/src/test/org/apache/solr/util/TimeZoneUtilsTest.java
+++ b/solr/core/src/test/org/apache/solr/util/TimeZoneUtilsTest.java
@@ -40,7 +40,7 @@ public class TimeZoneUtilsTest extends SolrTestCase {
label + ": " + expected.toString() + " [[NOT SAME RULES]] " + actual.toString(), same);
}
- public void testValidIds() throws Exception {
+ public void testValidIds() {
final Set<String> idsTested = new HashSet<>();
@@ -63,7 +63,7 @@ public class TimeZoneUtilsTest extends SolrTestCase {
idsTested.size());
}
- public void testCustom() throws Exception {
+ public void testCustom() {
for (String input :
new String[] {
@@ -88,7 +88,7 @@ public class TimeZoneUtilsTest extends SolrTestCase {
}
}
- public void testStupidIKnowButIDontTrustTheJVM() throws Exception {
+ public void testStupidIKnowButIDontTrustTheJVM() {
for (String input :
new String[] {
@@ -113,7 +113,7 @@ public class TimeZoneUtilsTest extends SolrTestCase {
}
}
- public void testInvalidInput() throws Exception {
+ public void testInvalidInput() {
final String giberish = "giberish";
assumeFalse(
diff --git a/solr/core/src/test/org/apache/solr/util/configuration/providers/EnvSSLCredentialProviderTest.java b/solr/core/src/test/org/apache/solr/util/configuration/providers/EnvSSLCredentialProviderTest.java
index 947c5e083e6..dfb0d3573f0 100644
--- a/solr/core/src/test/org/apache/solr/util/configuration/providers/EnvSSLCredentialProviderTest.java
+++ b/solr/core/src/test/org/apache/solr/util/configuration/providers/EnvSSLCredentialProviderTest.java
@@ -30,7 +30,7 @@ import org.junit.Test;
public class EnvSSLCredentialProviderTest {
@Test
- public void testGetCredentials() throws Exception {
+ public void testGetCredentials() {
int cnt = 0;
Map<String, String> envvars =
ImmutableMap.of(
@@ -49,7 +49,7 @@ public class EnvSSLCredentialProviderTest {
}
@Test
- public void testGetCredentialsWithEnvVars() throws Exception {
+ public void testGetCredentialsWithEnvVars() {
EnvSSLCredentialProvider sut = new EnvSSLCredentialProvider();
// assuming not to fail
sut.getCredential(SSLCredentialProvider.CredentialType.SSL_KEY_STORE_PASSWORD);
diff --git a/solr/core/src/test/org/apache/solr/util/configuration/providers/SysPropSSLCredentialProviderTest.java b/solr/core/src/test/org/apache/solr/util/configuration/providers/SysPropSSLCredentialProviderTest.java
index b3681a7affc..a003aa91a10 100644
--- a/solr/core/src/test/org/apache/solr/util/configuration/providers/SysPropSSLCredentialProviderTest.java
+++ b/solr/core/src/test/org/apache/solr/util/configuration/providers/SysPropSSLCredentialProviderTest.java
@@ -41,7 +41,7 @@ public class SysPropSSLCredentialProviderTest {
SSLConfigurations.SysProps.SSL_CLIENT_TRUST_STORE_PASSWORD);
@Test
- public void testGetCredentials() throws Exception {
+ public void testGetCredentials() {
int cnt = 0;
SysPropSSLCredentialProvider sut = new SysPropSSLCredentialProvider();
for (Map.Entry<SSLCredentialProvider.CredentialType, String> set :
@@ -53,7 +53,7 @@ public class SysPropSSLCredentialProviderTest {
}
@Test
- public void testGetCredentialsWithoutSetup() throws Exception {
+ public void testGetCredentialsWithoutSetup() {
SysPropSSLCredentialProvider sut = new SysPropSSLCredentialProvider();
// assuming not to fail
sut.getCredential(SSLCredentialProvider.CredentialType.SSL_KEY_STORE_PASSWORD);