You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ma...@apache.org on 2021/02/10 23:52:44 UTC

[lucene-solr] branch reference_impl_dev updated (df57463 -> 0e59ebb)

This is an automated email from the ASF dual-hosted git repository.

markrmiller pushed a change to branch reference_impl_dev
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git.


    from df57463  @1339 Fix MoveReplicaTest perf issue.
     new 59fe24c  @1340 We only proxy to other nodes by collection, not core.
     new da3a67b  @1341 Finishing moving to http2 client in final spots, clean up proxy forwarding more and some other things.
     new 0e59ebb  @1342 Lighten up our test class model, the fields are punishing with randomized testing framework and it's something to move away from for a few reasons.

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../org/apache/lucene/util/LuceneTestCase.java     |  28 +-
 .../lucene/util/TestRuleTemporaryFilesCleanup.java |  15 +-
 .../analysis/TestFoldingMultitermExtrasQuery.java  |   5 +-
 .../apache/solr/schema/TestICUCollationField.java  |   7 +-
 .../schema/TestICUCollationFieldDocValues.java     |   7 +-
 .../solr/schema/TestICUCollationFieldOptions.java  |   5 +-
 ...ExtractNamedEntitiesUpdateProcessorFactory.java |   5 +-
 .../solr/analytics/ExpressionFactoryTest.java      |   5 +-
 .../solr/analytics/SolrAnalyticsTestCase.java      |   3 +-
 .../legacy/LegacyAbstractAnalyticsCloudTest.java   |   3 +-
 .../legacy/expression/LegacyExpressionTest.java    |   3 +-
 .../legacy/expression/LegacyFunctionTest.java      |   6 +-
 .../clustering/carrot2/CarrotClusteringEngine.java |  20 +-
 .../clustering/AbstractClusteringTestCase.java     |   5 +-
 .../DistributedClusteringComponentTest.java        |   3 +-
 .../dataimport/TestTikaEntityProcessor.java        |  21 +-
 .../solr/handler/dataimport/DataImportHandler.java |  28 +-
 .../apache/solr/handler/dataimport/DocBuilder.java |  20 +-
 .../solr/handler/dataimport/ScriptTransformer.java |  23 +-
 .../AbstractDataImportHandlerTestCase.java         |   7 +-
 .../AbstractSqlEntityProcessorTestCase.java        |   3 +-
 .../dataimport/TestContentStreamDataSource.java    |  11 +-
 .../solr/handler/dataimport/TestDocBuilder2.java   |   3 +-
 .../dataimport/TestFileListEntityProcessor.java    |   9 +-
 .../TestFileListWithLineEntityProcessor.java       |   4 +-
 .../dataimport/TestHierarchicalDocBuilder.java     |  10 +-
 .../handler/dataimport/TestJdbcDataSource.java     |  13 +-
 .../dataimport/TestJdbcDataSourceConvertType.java  |   6 +-
 .../dataimport/TestNonWritablePersistFile.java     |  12 +-
 .../handler/dataimport/TestScriptTransformer.java  |  24 +-
 .../dataimport/TestSimplePropertiesWriter.java     |   3 +-
 .../TestSolrEntityProcessorEndToEnd.java           |  11 +-
 .../dataimport/TestXPathEntityProcessor.java       |   5 +-
 .../handler/dataimport/TestXPathRecordReader.java  |   7 +-
 .../handler/dataimport/TestZKPropertiesWriter.java |   5 +-
 .../extraction/ExtractingRequestHandlerTest.java   |  34 +-
 .../handler/extraction/TestXLSXResponseWriter.java |   3 +-
 .../apache/solr/jaeger/TestJaegerConfigurator.java |  22 +-
 ...geIdentifierUpdateProcessorFactoryTestCase.java |   3 +-
 .../apache/solr/ltr/search/LTRQParserPlugin.java   |   2 +-
 .../org/apache/solr/ltr/TestLTRQParserPlugin.java  |  11 +-
 .../apache/solr/ltr/TestLTRReRankingPipeline.java  |  41 +--
 .../org/apache/solr/ltr/TestLTRScoringQuery.java   |  48 +--
 .../test/org/apache/solr/ltr/TestRerankBase.java   |   6 +-
 .../solr/ltr/TestSelectiveWeightCreation.java      |  18 +-
 .../solr/ltr/feature/TestExternalFeatures.java     |  15 +-
 .../apache/solr/ltr/feature/TestValueFeature.java  |   5 +-
 .../org/apache/solr/ltr/model/TestLinearModel.java |  27 +-
 .../ltr/model/TestMultipleAdditiveTreesModel.java  |  46 ++-
 .../solr/ltr/model/TestNeuralNetworkModel.java     |  26 +-
 .../apache/solr/ltr/model/TestWrapperModel.java    |  11 +-
 .../apache/solr/ltr/norm/TestMinMaxNormalizer.java |   4 +-
 .../solr/ltr/norm/TestStandardNormalizer.java      |   8 +-
 .../ltr/store/rest/TestManagedFeatureStore.java    |   3 +-
 .../prometheus/PrometheusExporterTestBase.java     |   5 +-
 .../scraper/SolrStandaloneScraperTest.java         |   7 +-
 .../org/apache/solr/prometheus/utils/Helpers.java  |   4 +-
 .../solr/velocity/VelocityResponseWriterTest.java  |  16 +-
 .../src/java/org/apache/solr/api/V2HttpCall.java   |  38 +--
 .../client/solrj/embedded/JettySolrRunner.java     |  15 +-
 .../src/java/org/apache/solr/cloud/Overseer.java   |   5 +-
 .../org/apache/solr/cloud/ReplicateFromLeader.java |   1 -
 .../java/org/apache/solr/cloud/ZkController.java   |   2 +-
 .../solr/cloud/api/collections/CreateShardCmd.java |  75 +++--
 .../api/collections/DimensionalRoutedAlias.java    |   2 +-
 .../solr/cloud/api/collections/MoveReplicaCmd.java |  36 ++-
 .../solr/cloud/api/collections/RoutedAlias.java    |   2 +-
 .../cloud/api/collections/TimeRoutedAlias.java     |   3 +-
 .../apache/solr/core/CachingDirectoryFactory.java  |   1 -
 .../java/org/apache/solr/core/CoreContainer.java   |   1 -
 .../apache/solr/core/StandardDirectoryFactory.java |   1 -
 .../apache/solr/filestore/DistribPackageStore.java |   6 +-
 .../java/org/apache/solr/handler/BlobHandler.java  |  42 ++-
 .../org/apache/solr/handler/CalciteJDBCStream.java |  50 +--
 .../handler/component/RealTimeGetComponent.java    |   1 -
 .../org/apache/solr/handler/loader/JsonLoader.java |  42 ++-
 .../solr/highlight/DefaultSolrHighlighter.java     |  65 ++--
 .../apache/solr/logging/log4j2/Log4j2Watcher.java  |   4 +-
 .../packagemanager/DefaultPackageRepository.java   |   7 +-
 .../apache/solr/packagemanager/PackageManager.java |  16 +-
 .../apache/solr/packagemanager/PackageUtils.java   |  26 +-
 .../solr/packagemanager/RepositoryManager.java     |  11 +-
 .../org/apache/solr/request/IntervalFacets.java    |  36 ++-
 .../apache/solr/request/LocalSolrQueryRequest.java |   2 +-
 .../java/org/apache/solr/request/SimpleFacets.java |  43 ++-
 .../apache/solr/response/JSONResponseWriter.java   |   5 +-
 .../analysis/ManagedSynonymFilterFactory.java      |   5 +-
 .../src/java/org/apache/solr/schema/BoolField.java | 142 ++++----
 .../apache/solr/schema/JsonPreAnalyzedParser.java  |   2 +-
 .../org/apache/solr/schema/RandomSortField.java    | 104 +++---
 .../solr/schema/RptWithGeometrySpatialField.java   |  79 +++--
 .../org/apache/solr/search/BoolQParserPlugin.java  |  58 ++--
 .../org/apache/solr/search/BoostQParserPlugin.java |  74 +++--
 .../solr/search/CollapsingQParserPlugin.java       |  44 ++-
 .../apache/solr/search/ExportQParserPlugin.java    |   2 +-
 .../solr/search/FloatPayloadValueSource.java       |  94 +++---
 .../solr/search/PayloadScoreQParserPlugin.java     |  74 +++--
 .../apache/solr/search/PrefixQParserPlugin.java    |  20 +-
 .../org/apache/solr/search/RawQParserPlugin.java   |  18 +-
 .../apache/solr/search/ReRankQParserPlugin.java    |   2 +-
 .../apache/solr/search/SwitchQParserPlugin.java    |  66 ++--
 .../org/apache/solr/search/TermQParserPlugin.java  |  40 ++-
 .../org/apache/solr/search/TermsQParserPlugin.java |  94 +++---
 .../org/apache/solr/search/TopLevelJoinQuery.java  |  75 +++--
 .../java/org/apache/solr/search/facet/AvgAgg.java  |   6 +-
 .../org/apache/solr/search/facet/CountValsAgg.java |   8 +-
 .../org/apache/solr/search/facet/DocValuesAcc.java |   4 +-
 .../org/apache/solr/search/facet/FacetModule.java  |   2 +-
 .../org/apache/solr/search/facet/MinMaxAgg.java    |   2 +-
 .../org/apache/solr/search/facet/MissingAgg.java   |   2 +-
 .../org/apache/solr/search/facet/SumsqAgg.java     |   2 +-
 .../search/function/ReverseOrdFieldSource.java     |  38 ++-
 .../solr/search/join/ScoreJoinQParserPlugin.java   | 122 +++----
 .../apache/solr/search/mlt/CloudMLTQParser.java    |   8 +-
 .../org/apache/solr/security/BasicAuthPlugin.java  |   2 +-
 .../solr/security/PKIAuthenticationPlugin.java     |  12 +-
 .../java/org/apache/solr/servlet/HttpSolrCall.java |  29 +-
 .../apache/solr/servlet/SolrDispatchFilter.java    |   4 +-
 .../suggest/fst/AnalyzingInfixLookupFactory.java   |  46 +--
 .../suggest/fst/BlendedInfixLookupFactory.java     |  48 +--
 .../apache/solr/uninverting/FieldCacheImpl.java    | 154 +++++----
 .../apache/solr/uninverting/UninvertingReader.java |  20 +-
 .../org/apache/solr/update/TransactionLog.java     |   5 +-
 .../org/apache/solr/update/UpdateShardHandler.java |  15 -
 .../processor/DistributedZkUpdateProcessor.java    |   1 -
 .../processor/UUIDUpdateProcessorFactory.java      |  18 +-
 .../src/java/org/apache/solr/util/PackageTool.java |  10 +-
 .../src/java/org/apache/solr/util/SolrCLI.java     |  77 +++--
 .../apache/solr/AnalysisAfterCoreReloadTest.java   |   4 +-
 .../org/apache/solr/BasicFunctionalityTest.java    |  45 +--
 .../src/test/org/apache/solr/CursorPagingTest.java |  13 +-
 .../solr/DistributedIntervalFacetingTest.java      |   4 +-
 .../apache/solr/HelloWorldSolrCloudTestCase.java   |   2 +-
 .../test/org/apache/solr/SolrTestCaseJ4Test.java   |  12 +-
 .../test/org/apache/solr/TestCrossCoreJoin.java    |   2 +-
 .../solr/TestCursorMarkWithoutUniqueKey.java       |   6 +-
 .../org/apache/solr/TestDistributedGrouping.java   |   5 +-
 .../org/apache/solr/TestDistributedSearch.java     |  14 +-
 .../test/org/apache/solr/TestGroupingSearch.java   |   8 +-
 solr/core/src/test/org/apache/solr/TestJoin.java   |  15 +-
 .../test/org/apache/solr/TestRandomDVFaceting.java |   5 +-
 .../test/org/apache/solr/TestRandomFaceting.java   |   2 +-
 .../org/apache/solr/TestSolrCoreProperties.java    |   8 +-
 .../test/org/apache/solr/TestTolerantSearch.java   |  30 +-
 solr/core/src/test/org/apache/solr/TestTrie.java   |   3 +-
 .../analysis/ProtectedTermFilterFactoryTest.java   |   3 +-
 .../analysis/TestWordDelimiterFilterFactory.java   |   4 +-
 .../solr/backcompat/TestLuceneIndexBackCompat.java |   7 +-
 .../TestEmbeddedSolrServerAdminHandler.java        |   5 +-
 .../TestEmbeddedSolrServerConstructors.java        |  12 +-
 .../embedded/TestEmbeddedSolrServerSchemaAPI.java  |  14 +-
 .../client/solrj/embedded/TestJettySolrRunner.java |   9 +-
 .../test/org/apache/solr/cloud/AddReplicaTest.java |   4 +-
 .../apache/solr/cloud/AliasIntegrationTest.java    |  30 +-
 .../cloud/AssignBackwardCompatibilityTest.java     |   3 +-
 .../apache/solr/cloud/BasicDistributedZk2Test.java |  12 +-
 .../apache/solr/cloud/BasicDistributedZkTest.java  |  15 +-
 ...aosMonkeyNothingIsSafeWithPullReplicasTest.java |   4 +-
 .../solr/cloud/ChaosMonkeyShardSplitTest.java      |   5 +-
 .../org/apache/solr/cloud/CleanupOldIndexTest.java |   4 +-
 .../cloud/CloudExitableDirectoryReaderTest.java    |   5 +-
 .../apache/solr/cloud/ClusterStateUpdateTest.java  |   3 +-
 .../org/apache/solr/cloud/CollectionPropsTest.java |   9 +-
 .../solr/cloud/CollectionStateZnodeTest.java       |   3 +-
 .../apache/solr/cloud/CollectionsAPISolrJTest.java |  20 +-
 .../cloud/ConcurrentCreateRoutedAliasTest.java     |   3 +-
 .../org/apache/solr/cloud/ConfigSetsAPITest.java   |  10 +-
 .../solr/cloud/CreateCollectionCleanupTest.java    |  12 +-
 .../apache/solr/cloud/CreateRoutedAliasTest.java   |  17 +-
 .../solr/cloud/DeleteInactiveReplicaTest.java      |   4 +-
 .../cloud/DeleteLastCustomShardedReplicaTest.java  |   4 +-
 .../test/org/apache/solr/cloud/DeleteNodeTest.java |   7 +-
 .../org/apache/solr/cloud/DeleteReplicaTest.java   |  14 +-
 .../org/apache/solr/cloud/DeleteShardTest.java     |   8 +-
 .../org/apache/solr/cloud/DeleteStatusTest.java    |   3 +-
 .../apache/solr/cloud/DistribCursorPagingTest.java |   5 +-
 .../DistribDocExpirationUpdateProcessorTest.java   |  17 +-
 .../solr/cloud/DistribJoinFromCollectionTest.java  |   3 +-
 .../solr/cloud/DistributedVersionInfoTest.java     |   3 +-
 .../apache/solr/cloud/DocValuesNotIndexedTest.java |   3 +-
 .../org/apache/solr/cloud/ForceLeaderTest.java     |   5 +-
 .../solr/cloud/FullSolrCloudDistribCmdsTest.java   |  12 +-
 .../solr/cloud/LeaderElectionContextKeyTest.java   |   3 +-
 .../solr/cloud/LeaderElectionIntegrationTest.java  |   3 +-
 .../org/apache/solr/cloud/LeaderElectionTest.java  |   5 +-
 .../apache/solr/cloud/LeaderTragicEventTest.java   |   3 +-
 .../solr/cloud/LeaderVoteWaitTimeoutTest.java      |   9 +-
 .../solr/cloud/MetricsHistoryIntegrationTest.java  |   4 +-
 .../MetricsHistoryWithAuthIntegrationTest.java     |   3 +-
 .../org/apache/solr/cloud/MigrateRouteKeyTest.java |   7 +-
 .../solr/cloud/MissingSegmentRecoveryTest.java     |   3 +-
 .../solr/cloud/MoveReplicaHDFSFailoverTest.java    |   7 +-
 .../org/apache/solr/cloud/MoveReplicaHDFSTest.java |   5 +-
 .../org/apache/solr/cloud/MoveReplicaTest.java     |  19 +-
 .../solr/cloud/NestedShardedAtomicUpdateTest.java  |   6 +-
 .../OutOfBoxZkACLAndCredentialsProvidersTest.java  |  10 +-
 ...OverriddenZkACLAndCredentialsProvidersTest.java |   9 +-
 .../solr/cloud/OverseerModifyCollectionTest.java   |   9 +-
 .../org/apache/solr/cloud/OverseerRolesTest.java   |   3 +-
 .../org/apache/solr/cloud/OverseerStatusTest.java  |   6 +-
 .../test/org/apache/solr/cloud/OverseerTest.java   |   5 +-
 .../apache/solr/cloud/PackageManagerCLITest.java   |   7 +-
 .../test/org/apache/solr/cloud/RecoveryZkTest.java |   3 +-
 .../apache/solr/cloud/ReindexCollectionTest.java   |   7 +-
 .../apache/solr/cloud/RemoteQueryErrorTest.java    |   6 +-
 .../org/apache/solr/cloud/ReplaceNodeTest.java     |  21 +-
 .../apache/solr/cloud/ReplicationFactorTest.java   |   2 +-
 .../apache/solr/cloud/SaslZkACLProviderTest.java   |  20 +-
 .../cloud/SharedFSAutoReplicaFailoverTest.java     |   3 +-
 .../org/apache/solr/cloud/SolrCLIZkUtilsTest.java  |  33 +-
 .../apache/solr/cloud/SolrCloudBridgeTestCase.java |   5 +-
 .../org/apache/solr/cloud/SolrXmlInZkTest.java     |  12 +-
 .../test/org/apache/solr/cloud/SplitShardTest.java |   3 +-
 .../solr/cloud/SystemCollectionCompatTest.java     |   3 +-
 .../solr/cloud/TestAuthenticationFramework.java    |   7 +-
 .../apache/solr/cloud/TestBaseStatsCacheCloud.java |   3 +-
 .../apache/solr/cloud/TestCloudConsistency.java    |  48 ++-
 .../apache/solr/cloud/TestCloudDeleteByQuery.java  |   3 +-
 .../apache/solr/cloud/TestCloudInspectUtil.java    |   6 +-
 .../TestCloudPhrasesIdentificationComponent.java   |  12 +-
 .../org/apache/solr/cloud/TestCloudPivotFacet.java |  21 +-
 .../solr/cloud/TestCloudPseudoReturnFields.java    |   9 +-
 .../org/apache/solr/cloud/TestCloudRecovery.java   |   3 +-
 .../org/apache/solr/cloud/TestCloudRecovery2.java  |   4 +-
 .../solr/cloud/TestCloudSearcherWarming.java       |   3 +-
 .../org/apache/solr/cloud/TestConfigSetsAPI.java   |  31 +-
 .../solr/cloud/TestConfigSetsAPIExclusivity.java   |   8 +-
 .../solr/cloud/TestConfigSetsAPIZkFailure.java     |  13 +-
 .../cloud/TestDeleteCollectionOnDownNodes.java     |   3 +-
 .../org/apache/solr/cloud/TestDistributedMap.java  |   5 +-
 .../solr/cloud/TestDownShardTolerantSearch.java    |   6 +-
 .../cloud/TestExclusionRuleCollectionAccess.java   |   3 +-
 .../cloud/TestLeaderElectionWithEmptyReplica.java  |   3 +-
 .../solr/cloud/TestLeaderElectionZkExpiry.java     |   5 +-
 .../solr/cloud/TestMiniSolrCloudClusterSSL.java    |  51 +--
 .../org/apache/solr/cloud/TestPrepRecovery.java    |   9 +-
 .../org/apache/solr/cloud/TestPullReplica.java     |  24 +-
 .../solr/cloud/TestPullReplicaErrorHandling.java   |  14 +-
 .../solr/cloud/TestQueryingOnDownCollection.java   |   8 +-
 .../apache/solr/cloud/TestRandomFlRTGCloud.java    |  16 +-
 .../apache/solr/cloud/TestRebalanceLeaders.java    |   3 +-
 .../apache/solr/cloud/TestRequestForwarding.java   |   5 +-
 .../apache/solr/cloud/TestSSLRandomization.java    |   7 +-
 .../org/apache/solr/cloud/TestSegmentSorting.java  |   7 +-
 .../solr/cloud/TestSkipOverseerOperations.java     |   3 +-
 .../cloud/TestSolrCloudWithDelegationTokens.java   |   7 +-
 .../solr/cloud/TestSolrCloudWithKerberosAlt.java   |   5 +-
 .../TestSolrCloudWithSecureImpersonation.java      |  44 +--
 .../cloud/TestStressCloudBlindAtomicUpdates.java   |  18 +-
 .../solr/cloud/TestStressInPlaceUpdates.java       |   3 +-
 .../org/apache/solr/cloud/TestStressLiveNodes.java |   3 +-
 .../solr/cloud/TestTlogReplayVsRecovery.java       |  26 +-
 .../org/apache/solr/cloud/TestTlogReplica.java     |  10 +-
 .../cloud/TestTolerantUpdateProcessorCloud.java    |  17 +-
 .../TestTolerantUpdateProcessorRandomCloud.java    |  12 +-
 .../cloud/TestWaitForStateWithJettyShutdowns.java  |   8 +-
 .../solr/cloud/TriLevelCompositeIdRoutingTest.java |  11 +-
 .../apache/solr/cloud/UnloadDistributedZkTest.java |   9 +-
 .../VMParamsZkACLAndCredentialsProvidersTest.java  |   9 +-
 .../src/test/org/apache/solr/cloud/ZkCLITest.java  |  24 +-
 .../org/apache/solr/cloud/ZkControllerTest.java    |  13 +-
 .../test/org/apache/solr/cloud/ZkFailoverTest.java |   3 +-
 .../org/apache/solr/cloud/ZkShardTermsTest.java    |   5 +-
 .../org/apache/solr/cloud/ZkSolrClientTest.java    |  12 +-
 .../AbstractCloudBackupRestoreTestCase.java        |   3 +-
 .../AsyncCallRequestStatusResponseTest.java        |   3 +-
 .../api/collections/CollectionReloadTest.java      |   3 +-
 .../collections/CollectionTooManyReplicasTest.java |  13 +-
 .../CollectionsAPIAsyncDistributedZkTest.java      |   5 +-
 .../CollectionsAPIDistClusterPerZkTest.java        |  18 +-
 .../CollectionsAPIDistributedZkTest.java           |  37 ++-
 .../ConcurrentDeleteAndCreateCollectionTest.java   |   7 +-
 .../CreateCollectionsIndexAndRestartTest.java      |   6 +-
 .../api/collections/CustomCollectionTest.java      |   3 +-
 .../HdfsCollectionsAPIDistributedZkTest.java       |   3 +-
 .../solr/cloud/api/collections/ShardSplitTest.java |  31 +-
 .../SimpleCollectionCreateDeleteTest.java          |   2 +-
 .../cloud/api/collections/SplitByPrefixTest.java   |   3 +-
 .../cloud/api/collections/TestCollectionAPI.java   |   9 +-
 .../TestCollectionsAPIViaSolrCloudCluster.java     |   7 +-
 .../collections/TestHdfsCloudBackupRestore.java    |   7 +-
 .../collections/TestLocalFSCloudBackupRestore.java |   9 +-
 .../solr/cloud/hdfs/HDFSCollectionsAPITest.java    |   5 +-
 .../cloud/hdfs/HdfsBasicDistributedZk2Test.java    |   3 +-
 .../cloud/hdfs/HdfsBasicDistributedZkTest.java     |   3 +-
 .../hdfs/HdfsChaosMonkeyNothingIsSafeTest.java     |   3 +-
 .../cloud/hdfs/HdfsChaosMonkeySafeLeaderTest.java  |   3 +-
 .../apache/solr/cloud/hdfs/HdfsNNFailoverTest.java |   3 +-
 .../solr/cloud/hdfs/HdfsRecoverLeaseTest.java      |   3 +-
 .../apache/solr/cloud/hdfs/HdfsRecoveryZkTest.java |   5 +-
 .../cloud/hdfs/HdfsRestartWhileUpdatingTest.java   |   3 +-
 .../apache/solr/cloud/hdfs/HdfsSyncSliceTest.java  |   3 +-
 .../apache/solr/cloud/hdfs/HdfsThreadLeakTest.java |   3 +-
 .../HdfsTlogReplayBufferedWhileIndexingTest.java   |   3 +-
 .../cloud/hdfs/HdfsUnloadDistributedZkTest.java    |   3 +-
 .../hdfs/HdfsWriteToMultipleCollectionsTest.java   |   3 +-
 .../org/apache/solr/cloud/hdfs/StressHdfsTest.java |   3 +-
 .../overseer/ZkCollectionPropsCachingTest.java     |   3 +-
 .../apache/solr/core/AlternateDirectoryTest.java   |   3 +-
 .../apache/solr/core/BlobRepositoryCloudTest.java  |   3 +-
 .../test/org/apache/solr/core/CoreSorterTest.java  |   3 +-
 .../org/apache/solr/core/DirectoryFactoryTest.java |   3 +-
 .../apache/solr/core/HdfsDirectoryFactoryTest.java |   5 +-
 .../org/apache/solr/core/QueryResultKeyTest.java   |   3 +-
 .../org/apache/solr/core/ResourceLoaderTest.java   |  16 +-
 .../solr/core/SolrCoreCheckLockOnStartupTest.java  |   5 +-
 .../solr/core/TestBackupRepositoryFactory.java     |   5 +-
 .../test/org/apache/solr/core/TestBadConfig.java   |   3 +-
 .../org/apache/solr/core/TestCodecSupport.java     |   9 +-
 .../src/test/org/apache/solr/core/TestConfig.java  |  18 +-
 .../apache/solr/core/TestConfigSetImmutable.java   |   5 +-
 .../apache/solr/core/TestConfigSetProperties.java  |   8 +-
 .../test/org/apache/solr/core/TestConfigSets.java  |  16 +-
 .../org/apache/solr/core/TestCoreContainer.java    |  40 +--
 .../org/apache/solr/core/TestCoreDiscovery.java    |  58 ++--
 .../apache/solr/core/TestCorePropertiesReload.java |   5 +-
 .../org/apache/solr/core/TestDirectoryFactory.java |   3 +-
 .../test/org/apache/solr/core/TestLazyCores.java   |  21 +-
 .../apache/solr/core/TestMergePolicyConfig.java    |   3 +-
 .../apache/solr/core/TestReloadAndDeleteDocs.java  |   3 +-
 .../apache/solr/core/TestShardHandlerFactory.java  |   3 +-
 .../apache/solr/core/TestSolrConfigHandler.java    |   7 +-
 .../apache/solr/core/TestSolrDeletionPolicy1.java  |   3 +-
 .../org/apache/solr/core/TestSolrIndexConfig.java  |   6 +-
 .../src/test/org/apache/solr/core/TestSolrXml.java |   7 +-
 .../repository/HdfsBackupRepositoryTest.java       |  16 +-
 .../core/snapshots/TestSolrCloudSnapshots.java     |  11 +-
 .../solr/core/snapshots/TestSolrCoreSnapshots.java |   5 +-
 .../solr/filestore/TestDistribPackageStore.java    |  23 +-
 .../handler/FieldAnalysisRequestHandlerTest.java   |   3 +-
 .../org/apache/solr/handler/JsonLoaderTest.java    |  14 +-
 .../solr/handler/MoreLikeThisHandlerTest.java      |   6 +-
 .../solr/handler/PingRequestHandlerTest.java       |   8 +-
 .../org/apache/solr/handler/TestCSVLoader.java     |   3 +-
 .../org/apache/solr/handler/TestCoreBackup.java    |   7 +-
 .../solr/handler/TestHdfsBackupRestoreCore.java    |   7 +-
 .../solr/handler/TestReplicationHandler.java       |  24 +-
 .../solr/handler/TestReplicationHandlerBackup.java |   5 +-
 .../TestReplicationHandlerDiskOverFlow.java        |   5 +-
 .../org/apache/solr/handler/TestReqParamsAPI.java  |   3 +-
 .../org/apache/solr/handler/TestRestoreCore.java   |  26 +-
 .../org/apache/solr/handler/TestSQLHandler.java    |   5 +-
 .../solr/handler/TestSQLHandlerNonCloud.java       |   6 +-
 .../solr/handler/TestStressThreadBackup.java       |   7 +-
 .../solr/handler/TestSystemCollAutoCreate.java     |   1 -
 .../apache/solr/handler/V2ApiIntegrationTest.java  |  13 +-
 .../org/apache/solr/handler/V2StandaloneTest.java  |   7 +-
 .../solr/handler/XmlUpdateRequestHandlerTest.java  |   3 +-
 .../solr/handler/XsltUpdateRequestHandlerTest.java |   3 +-
 .../solr/handler/admin/AdminHandlersProxyTest.java |   3 +-
 .../handler/admin/CoreAdminCreateDiscoverTest.java |   5 +-
 .../solr/handler/admin/CoreAdminHandlerTest.java   |  34 +-
 .../solr/handler/admin/CoreAdminOperationTest.java |  93 +++---
 .../handler/admin/CoreAdminRequestStatusTest.java  |   3 +-
 .../admin/CoreMergeIndexesAdminHandlerTest.java    |  10 +-
 .../solr/handler/admin/DaemonStreamApiTest.java    |   5 +-
 .../solr/handler/admin/HealthCheckHandlerTest.java |  11 +-
 .../solr/handler/admin/IndexSizeEstimatorTest.java |   3 +-
 .../apache/solr/handler/admin/InfoHandlerTest.java |   8 +-
 .../solr/handler/admin/LoggingHandlerTest.java     |   3 +-
 .../solr/handler/admin/MBeansHandlerTest.java      |   3 +-
 .../handler/admin/MetricsHistoryHandlerTest.java   |   3 +-
 .../handler/admin/ShowFileRequestHandlerTest.java  |   3 +-
 .../solr/handler/admin/SplitHandlerTest.java       |   3 +-
 .../solr/handler/admin/StatsReloadRaceTest.java    |   6 +-
 .../solr/handler/admin/TestCollectionAPIs.java     |   5 +-
 .../solr/handler/admin/ZookeeperReadAPITest.java   |  15 +-
 .../handler/admin/ZookeeperStatusHandlerTest.java  |   3 +-
 .../component/CustomHighlightComponentTest.java    |   3 +-
 .../component/DistributedDebugComponentTest.java   |   8 +-
 .../component/DistributedExpandComponentTest.java  |   3 +-
 .../component/DistributedFacetExistsSmallTest.java |   3 +-
 .../DistributedQueryComponentOptimizationTest.java |  10 +-
 .../DistributedQueryElevationComponentTest.java    |   6 +-
 .../component/DistributedTermsComponentTest.java   |   2 +-
 .../handler/component/InfixSuggestersTest.java     |   5 +-
 .../PhrasesIdentificationComponentTest.java        |   9 +-
 .../component/QueryElevationComponentTest.java     |   3 +-
 .../solr/handler/component/SearchHandlerTest.java  |  18 +-
 .../handler/component/ShardsWhitelistTest.java     |   6 +-
 .../handler/component/SpellCheckComponentTest.java |  33 +-
 .../solr/handler/component/StatsComponentTest.java |  21 +-
 .../SuggestComponentContextFilterQueryTest.java    |   7 +-
 .../handler/component/SuggestComponentTest.java    |   2 +-
 .../TermVectorComponentDistributedTest.java        |   3 +-
 .../TestDistributedStatsComponentCardinality.java  |   3 +-
 .../handler/component/TestExpandComponent.java     |  20 +-
 .../component/TestHttpShardHandlerFactory.java     |  14 +-
 .../handler/component/TestPivotHelperCode.java     |   5 +-
 .../solr/handler/export/TestExportWriter.java      |  11 +-
 .../solr/handler/tagger/RandomizedTaggerTest.java  |   3 +-
 .../apache/solr/handler/tagger/Tagger2Test.java    |   3 +-
 .../org/apache/solr/highlight/HighlighterTest.java |   3 +-
 .../highlight/TestPostingsSolrHighlighter.java     |   4 +-
 .../solr/highlight/TestUnifiedSolrHighlighter.java |   6 +-
 .../solr/index/TestSlowCompositeReaderWrapper.java |  12 +-
 .../solr/index/WrapperMergePolicyFactoryTest.java  |   4 +-
 .../apache/solr/index/hdfs/CheckHdfsIndexTest.java |   3 +-
 .../apache/solr/internal/csv/CharBufferTest.java   |   4 +-
 .../org/apache/solr/legacy/TestLegacyField.java    |  25 +-
 .../apache/solr/legacy/TestLegacyNumericUtils.java |   9 +-
 .../org/apache/solr/legacy/TestLegacyTerms.java    |  17 +-
 .../legacy/TestMultiValuedNumericRangeQuery.java   |  14 +-
 .../solr/legacy/TestNumericRangeQuery32.java       |  17 +-
 .../solr/legacy/TestNumericRangeQuery64.java       |  18 +-
 .../org/apache/solr/metrics/JvmMetricsTest.java    |   7 +-
 .../org/apache/solr/metrics/MetricsConfigTest.java |   5 +-
 .../solr/metrics/SolrMetricsIntegrationTest.java   |   3 +-
 .../reporters/SolrGraphiteReporterTest.java        |   3 +-
 .../reporters/SolrJmxReporterCloudTest.java        |   3 +-
 .../metrics/reporters/SolrSlf4jReporterTest.java   |   3 +-
 .../reporters/solr/SolrCloudReportersTest.java     |   8 +-
 .../metrics/rrd/SolrRrdBackendFactoryTest.java     |   3 +-
 .../src/test/org/apache/solr/pkg/TestPackages.java |  15 +-
 .../org/apache/solr/request/SimpleFacetsTest.java  |  35 +-
 .../test/org/apache/solr/request/TestFaceting.java |   7 +-
 .../apache/solr/request/TestIntervalFaceting.java  |  33 +-
 .../apache/solr/request/TestRemoteStreaming.java   |   8 +-
 .../org/apache/solr/request/TestStreamBody.java    |   7 +-
 .../solr/request/TestUnInvertedFieldException.java |   5 +-
 .../org/apache/solr/response/SmileWriterTest.java  |   3 +-
 .../response/TestJavabinTupleStreamParser.java     |   3 +-
 .../transform/TestChildDocTransformer.java         |  16 +-
 .../TestChildDocTransformerHierarchy.java          |  13 +-
 .../transform/TestSubQueryTransformer.java         |  10 +-
 .../transform/TestSubQueryTransformerDistrib.java  |  12 +-
 .../org/apache/solr/rest/SolrRestletTestBase.java  |  10 +-
 .../solr/rest/TestManagedResourceStorage.java      |   3 +-
 .../test/org/apache/solr/rest/TestRestManager.java |   3 +-
 .../apache/solr/rest/schema/TestBulkSchemaAPI.java |   7 +-
 .../schema/TestSerializedLuceneMatchVersion.java   |   3 +-
 .../rest/schema/TestUniqueKeyFieldResource.java    |   2 -
 .../analysis/TestManagedStopFilterFactory.java     |   5 +-
 .../analysis/TestManagedSynonymFilterFactory.java  |   5 +-
 .../TestManagedSynonymGraphFilterFactory.java      |   5 +-
 .../apache/solr/schema/ChangedSchemaMergeTest.java |   8 +-
 .../test/org/apache/solr/schema/CopyFieldTest.java |  18 +-
 .../apache/solr/schema/CurrencyFieldTypeTest.java  |  26 +-
 .../test/org/apache/solr/schema/DateFieldTest.java |   3 +-
 .../org/apache/solr/schema/DocValuesMultiTest.java |   3 +-
 .../test/org/apache/solr/schema/DocValuesTest.java |   5 +-
 .../test/org/apache/solr/schema/EnumFieldTest.java |  45 +--
 .../solr/schema/ExternalFileFieldSortTest.java     |   7 +-
 .../schema/ManagedSchemaRoundRobinCloudTest.java   |   4 +-
 .../schema/OpenExchangeRatesOrgProviderTest.java   |   4 +-
 .../PreAnalyzedFieldManagedSchemaCloudTest.java    |   3 +-
 .../apache/solr/schema/PreAnalyzedFieldTest.java   |   3 +-
 .../apache/solr/schema/PrimitiveFieldTypeTest.java |   5 +-
 .../apache/solr/schema/SchemaApiFailureTest.java   |   4 +-
 .../solr/schema/SpatialRPTFieldTypeTest.java       |  10 +-
 .../org/apache/solr/schema/TestBinaryField.java    |   9 +-
 .../org/apache/solr/schema/TestCollationField.java |   9 +-
 .../solr/schema/TestCollationFieldDocValues.java   |   9 +-
 .../org/apache/solr/schema/TestManagedSchema.java  |   5 +-
 .../apache/solr/schema/TestManagedSchemaAPI.java   |   3 +-
 .../solr/schema/TestManagedSchemaThreadSafety.java |  10 +-
 .../org/apache/solr/schema/TestPointFields.java    |  38 +--
 .../org/apache/solr/schema/TestPointFields2.java   | 105 +++---
 .../solr/schema/TestSchemalessBufferedUpdates.java |   5 +-
 .../apache/solr/schema/TestSortableTextField.java  |   8 +-
 .../test/org/apache/solr/schema/TestTextField.java |   3 +-
 .../solr/schema/TestUseDocValuesAsStored.java      |   8 +-
 .../solr/schema/TestUseDocValuesAsStored2.java     |   5 +-
 .../solr/search/CurrencyRangeFacetCloudTest.java   |  18 +-
 .../org/apache/solr/search/CursorMarkTest.java     |   5 +-
 .../org/apache/solr/search/FuzzySearchTest.java    |   6 +-
 .../org/apache/solr/search/QueryEqualityTest.java  |  31 +-
 .../org/apache/solr/search/QueryParsingTest.java   |  17 +-
 .../org/apache/solr/search/ReturnFieldsTest.java   |   3 +-
 .../org/apache/solr/search/SpatialFilterTest.java  |   5 +-
 .../solr/search/TestAddFieldRealTimeGet.java       |   5 +-
 .../org/apache/solr/search/TestCaffeineCache.java  |   3 +-
 .../solr/search/TestCollapseQParserPlugin.java     |  19 +-
 .../solr/search/TestExtendedDismaxParser.java      |  17 +-
 .../apache/solr/search/TestFilteredDocIdSet.java   |  13 +-
 .../test/org/apache/solr/search/TestFiltering.java |   7 +-
 .../solr/search/TestFoldingMultitermQuery.java     |   5 +-
 .../apache/solr/search/TestHashQParserPlugin.java  |   5 +-
 .../org/apache/solr/search/TestIndexSearcher.java  |   3 +-
 .../org/apache/solr/search/TestMissingGroups.java  |   7 +-
 .../apache/solr/search/TestPseudoReturnFields.java |   5 +-
 .../org/apache/solr/search/TestQueryTypes.java     |   8 +-
 .../search/TestRandomCollapseQParserPlugin.java    |   5 +-
 .../org/apache/solr/search/TestRangeQuery.java     |  64 ++--
 .../solr/search/TestReRankQParserPlugin.java       |   3 +-
 .../org/apache/solr/search/TestRealTimeGet.java    |  50 ++-
 .../test/org/apache/solr/search/TestRecovery.java  |   2 +-
 .../org/apache/solr/search/TestRecoveryHdfs.java   |   3 +-
 .../test/org/apache/solr/search/TestReload.java    |   3 +-
 .../org/apache/solr/search/TestSearcherReuse.java  |   7 +-
 .../org/apache/solr/search/TestSolr4Spatial.java   |  11 +-
 .../org/apache/solr/search/TestSolr4Spatial2.java  |   3 +-
 .../apache/solr/search/TestSolrQueryParser.java    |  33 +-
 .../src/test/org/apache/solr/search/TestSort.java  |   3 +-
 .../org/apache/solr/search/TestStressLucene.java   |   6 +-
 .../org/apache/solr/search/TestStressRecovery.java |   5 +-
 .../test/org/apache/solr/search/TestTrieFacet.java |   3 +-
 .../solr/search/facet/RangeFacetCloudTest.java     |  11 +-
 .../search/facet/SpatialHeatmapFacetsTest.java     |   2 +-
 .../search/facet/TestCloudJSONFacetJoinDomain.java |  26 +-
 .../solr/search/facet/TestCloudJSONFacetSKG.java   |  25 +-
 .../search/facet/TestCloudJSONFacetSKGEquiv.java   |  22 +-
 .../solr/search/facet/TestJsonFacetErrors.java     |  37 +--
 .../solr/search/facet/TestJsonFacetRefinement.java |   7 +-
 .../apache/solr/search/facet/TestJsonFacets.java   |  30 +-
 .../facet/TestJsonFacetsWithNestedObjects.java     |   4 +-
 .../solr/search/function/TestFunctionQuery.java    |   8 +-
 .../function/TestMinMaxOnMultiValuedField.java     |   8 +-
 .../apache/solr/search/function/TestOrdValues.java |  15 +-
 .../org/apache/solr/search/join/BJQParserTest.java |   7 +-
 .../solr/search/join/TestCloudNestedDocsSort.java  |  16 +-
 .../solr/search/join/TestScoreJoinQPNoScore.java   |   6 +-
 .../org/apache/solr/search/join/XCJFQueryTest.java |   9 +-
 .../apache/solr/search/json/TestJsonRequest.java   |   3 +-
 .../solr/search/mlt/CloudMLTQParserTest.java       |   6 +-
 .../TestSweetSpotSimilarityFactory.java            |   9 +-
 .../solr/search/stats/TestDefaultStatsCache.java   |   4 +-
 .../apache/solr/search/stats/TestDistribIDF.java   |  12 +-
 .../solr/security/AuditLoggerIntegrationTest.java  |  42 +--
 .../solr/security/BasicAuthIntegrationTest.java    |  21 +-
 .../solr/security/BasicAuthOnSingleNodeTest.java   |   3 +-
 .../solr/security/BasicAuthStandaloneTest.java     |   5 +-
 .../security/JWTAuthPluginIntegrationTest.java     |   9 +-
 .../apache/solr/security/JWTAuthPluginTest.java    |  11 +-
 .../apache/solr/security/JWTIssuerConfigTest.java  |   6 +-
 .../security/PKIAuthenticationIntegrationTest.java |   3 +-
 .../solr/security/TestAuthorizationFramework.java  |   3 +-
 .../hadoop/TestDelegationWithHadoopAuth.java       |   6 +-
 .../hadoop/TestImpersonationWithHadoopAuth.java    |  20 +-
 .../hadoop/TestSolrCloudWithHadoopAuthPlugin.java  |   7 +-
 .../security/hadoop/TestZkAclsWithHadoopAuth.java  |   5 +-
 .../org/apache/solr/servlet/CacheHeaderTest.java   |   5 +-
 .../solr/servlet/DirectSolrConnectionTest.java     |   3 +-
 .../solr/servlet/HttpSolrCallGetCoreTest.java      |   3 +-
 .../org/apache/solr/servlet/NoCacheHeaderTest.java |   3 +-
 .../apache/solr/servlet/ResponseHeaderTest.java    |   6 +-
 .../apache/solr/servlet/SolrRequestParserTest.java |  12 +-
 .../spelling/ConjunctionSolrSpellCheckerTest.java  |   3 +-
 .../solr/spelling/FileBasedSpellCheckerTest.java   |   6 +-
 .../solr/spelling/IndexBasedSpellCheckerTest.java  |  12 +-
 .../solr/spelling/SpellCheckCollatorTest.java      |   3 +-
 .../solr/spelling/suggest/SuggesterTest.java       |   1 -
 .../solr/store/blockcache/BlockDirectoryTest.java  |   3 +-
 .../apache/solr/store/hdfs/HdfsDirectoryTest.java  |  23 +-
 .../solr/store/hdfs/HdfsLockFactoryTest.java       |   3 +-
 .../apache/solr/uninverting/TestDocTermOrds.java   |  78 ++---
 .../uninverting/TestDocTermOrdsUninvertLimit.java  |  12 +-
 .../apache/solr/uninverting/TestFieldCache.java    | 100 +++---
 .../solr/uninverting/TestFieldCacheReopen.java     |  10 +-
 .../solr/uninverting/TestFieldCacheSort.java       | 295 +++++++++--------
 .../solr/uninverting/TestFieldCacheSortRandom.java |  10 +-
 .../uninverting/TestFieldCacheVsDocValues.java     |  46 +--
 .../uninverting/TestFieldCacheWithThreads.java     |  12 +-
 .../solr/uninverting/TestLegacyFieldCache.java     |  50 +--
 .../solr/uninverting/TestNumericTerms32.java       |  12 +-
 .../solr/uninverting/TestNumericTerms64.java       |  12 +-
 .../solr/uninverting/TestUninvertingReader.java    |  32 +-
 .../org/apache/solr/update/AddBlockUpdateTest.java |  13 +-
 .../solr/update/AnalysisErrorHandlingTest.java     |   5 +-
 .../solr/update/DataDrivenBlockJoinTest.java       |   5 +-
 .../apache/solr/update/DocumentBuilderTest.java    |  18 +-
 .../test/org/apache/solr/update/PeerSyncTest.java  |   3 +-
 .../org/apache/solr/update/SoftAutoCommitTest.java |   2 +-
 .../apache/solr/update/SolrIndexConfigTest.java    |  11 +-
 .../apache/solr/update/SolrIndexSplitterTest.java  |   9 +-
 .../solr/update/TestAtomicUpdateErrorCases.java    |   9 +-
 .../org/apache/solr/update/TestHdfsUpdateLog.java  |   3 +-
 .../update/TestInPlaceUpdateWithRouteField.java    |   3 +-
 .../solr/update/TestInPlaceUpdatesDistrib.java     |  13 +-
 .../solr/update/TestInPlaceUpdatesStandalone.java  |  16 +-
 .../test/org/apache/solr/update/TestUpdate.java    |  15 +-
 .../org/apache/solr/update/TransactionLogTest.java |   5 +-
 .../test/org/apache/solr/update/UpdateLogTest.java |  10 +-
 .../AbstractAtomicUpdatesMultivalueTestBase.java   |  13 +-
 .../AddSchemaFieldsUpdateProcessorFactoryTest.java |  10 +-
 .../processor/AtomicUpdateRemovalJavabinTest.java  |   3 +-
 .../CategoryRoutedAliasUpdateProcessorTest.java    |  28 +-
 .../ClassificationUpdateProcessorTest.java         |  11 +-
 .../DimensionalRoutedAliasUpdateProcessorTest.java |   9 +-
 .../DocExpirationUpdateProcessorFactoryTest.java   |   5 +-
 .../IgnoreLargeDocumentProcessorFactoryTest.java   |   3 +-
 .../processor/RoutedAliasUpdateProcessorTest.java  |   3 +-
 .../solr/update/processor/ScriptEngineTest.java    |   3 +-
 .../SignatureUpdateProcessorFactoryTest.java       |   3 +-
 .../StatelessScriptUpdateProcessorFactoryTest.java |  21 +-
 .../processor/TemplateUpdateProcessorTest.java     |   3 +-
 .../processor/TestDocBasedVersionConstraints.java  |  68 ++--
 .../TimeRoutedAliasUpdateProcessorTest.java        |  33 +-
 .../processor/TolerantUpdateProcessorTest.java     |  15 +-
 .../UpdateRequestProcessorFactoryTest.java         |   3 +-
 .../test/org/apache/solr/util/AuthToolTest.java    |   5 +-
 .../org/apache/solr/util/DateMathParserTest.java   |  12 +-
 .../org/apache/solr/util/OrderedExecutorTest.java  |   3 +-
 .../org/apache/solr/util/SimplePostToolTest.java   |   3 +-
 .../org/apache/solr/util/SolrPluginUtilsTest.java  |  15 +-
 .../test/org/apache/solr/util/TestExportTool.java  |   8 +-
 .../org/apache/solr/util/TestSafeXMLParsing.java   |   3 +-
 .../apache/solr/util/TestSolrCLIRunExample.java    |  15 +-
 .../org/apache/solr/util/TestSystemIdResolver.java |  10 +-
 .../org/apache/solr/util/TestTestInjection.java    |   5 +-
 .../org/apache/solr/util/TimeZoneUtilsTest.java    |   5 +-
 .../test/org/apache/solr/util/UtilsToolTest.java   |   3 +-
 .../BigEndianAscendingWordDeserializerTest.java    |  13 +-
 .../hll/BigEndianAscendingWordSerializerTest.java  |  20 +-
 .../apache/solr/util/hll/HLLSerializationTest.java |  17 +-
 .../solr/util/tracing/TestDistributedTracing.java  |   5 +-
 solr/server/resources/log4j2.xml                   |   2 +-
 .../org/apache/solr/cli/ClusterStateCommand.java   |  16 +-
 .../client/solrj/cloud/DelegatingCloudManager.java |   5 -
 .../solr/client/solrj/cloud/SolrCloudManager.java  |   3 -
 .../client/solrj/impl/BinaryRequestWriter.java     |  30 +-
 .../solr/client/solrj/impl/HttpSolrClient.java     |  62 ++--
 .../client/solrj/impl/SolrClientCloudManager.java  |  84 +----
 .../solrj/impl/SolrClientNodeStateProvider.java    |  14 +-
 .../client/solrj/io/eval/PairSortEvaluator.java    |   2 +-
 .../solrj/io/stream/CartesianProductStream.java    |   2 +-
 .../client/solrj/io/stream/ParallelListStream.java |   2 +-
 .../solrj/request/ContentStreamUpdateRequest.java  |  43 +--
 .../solrj/request/StreamingUpdateRequest.java      |  35 +-
 .../org/apache/solr/common/IteratorWriter.java     |  26 +-
 .../src/java/org/apache/solr/common/MapWriter.java |  70 ++--
 .../solr/common/cloud/ConnectionManager.java       |   7 +-
 .../org/apache/solr/common/cloud/DocRouter.java    |   4 +-
 .../org/apache/solr/common/cloud/SolrZkClient.java |  44 ++-
 .../apache/solr/common/cloud/ZkCmdExecutor.java    |   3 +-
 .../org/apache/solr/common/util/JavaBinCodec.java  |  94 +++---
 .../java/org/apache/solr/common/util/Utils.java    |  99 +++---
 .../ref_guide_examples/JsonRequestApiTest.java     |   3 +-
 .../client/solrj/MergeIndexesExampleTestBase.java  |   7 +-
 .../apache/solr/client/solrj/SolrExampleTests.java |  33 +-
 .../solr/client/solrj/SolrExampleTestsBase.java    |   4 +-
 .../client/solrj/SolrSchemalessExampleTest.java    |   3 +-
 .../solr/client/solrj/TestLBHttp2SolrClient.java   |   9 +-
 .../solr/client/solrj/TestLBHttpSolrClient.java    |  18 +-
 .../solr/client/solrj/TestSolrJErrorHandling.java  |   7 +-
 .../AbstractEmbeddedSolrServerTestCase.java        |   9 +-
 .../client/solrj/embedded/JettyWebappTest.java     |   7 +-
 .../solrj/embedded/SolrExampleJettyTest.java       |  34 +-
 .../client/solrj/embedded/TestSolrProperties.java  |  13 +-
 .../client/solrj/impl/BasicHttpSolrClientTest.java |   7 +-
 .../impl/CloudHttp2SolrClientBadInputTest.java     |   2 +-
 .../solrj/impl/CloudHttp2SolrClientRetryTest.java  |   6 +-
 .../solrj/impl/CloudHttp2SolrClientTest.java       |  20 +-
 .../solrj/impl/CloudSolrClientBadInputTest.java    |   2 +-
 .../solrj/impl/CloudSolrClientRetryTest.java       |   5 +-
 .../client/solrj/impl/CloudSolrClientTest.java     |  13 +-
 ...oncurrentUpdateHttp2SolrClientBadInputTest.java |   2 +-
 .../impl/ConcurrentUpdateHttp2SolrClientTest.java  |   5 +-
 .../ConcurrentUpdateSolrClientBadInputTest.java    |   2 +-
 .../ConcurrentUpdateSolrClientBuilderTest.java     |   3 +-
 .../impl/Http2SolrClientCompatibilityTest.java     |   3 +-
 .../client/solrj/impl/Http2SolrClientTest.java     |  41 +--
 .../solrj/impl/HttpSolrClientBadInputTest.java     |   7 +-
 .../solrj/impl/HttpSolrClientConPoolTest.java      |   5 +-
 .../solrj/impl/LBHttpSolrClientBadInputTest.java   |   4 +-
 .../solrj/impl/SolrPortAwareCookieSpecTest.java    |  20 +-
 .../solrj/impl/TestCloudSolrClientConnections.java |  18 +-
 .../client/solrj/io/graph/GraphExpressionTest.java |   3 +-
 .../solr/client/solrj/io/graph/GraphTest.java      |   3 +-
 .../apache/solr/client/solrj/io/sql/JdbcTest.java  |   3 +-
 .../solrj/io/stream/CloudAuthStreamTest.java       |  80 ++---
 .../client/solrj/io/stream/JDBCStreamTest.java     |   6 +-
 .../client/solrj/io/stream/MathExpressionTest.java |   5 +-
 .../solrj/io/stream/SelectWithEvaluatorsTest.java  |   6 +-
 .../solrj/io/stream/StreamDecoratorTest.java       |  19 +-
 .../solrj/io/stream/StreamExpressionTest.java      |  15 +-
 .../solr/client/solrj/io/stream/StreamingTest.java |  35 +-
 .../solr/client/solrj/request/Schema2Test.java     |  15 +-
 .../solr/client/solrj/request/SchemaTest.java      |  15 +-
 .../solr/client/solrj/request/SolrPingTest.java    |   5 +-
 .../solrj/request/TestCollectionAdminRequest.java  |  11 +-
 .../solrj/request/TestConfigSetAdminRequest.java   |   3 +-
 .../solr/client/solrj/request/TestCoreAdmin.java   |  21 +-
 .../solr/client/solrj/request/TestV2Request.java   |   3 +-
 ...DirectJsonQueryRequestFacetingEmbeddedTest.java |   3 +-
 ...ectJsonQueryRequestFacetingIntegrationTest.java |   3 +-
 .../client/solrj/request/json/DomainMapTest.java   |  15 +-
 .../solrj/request/json/HeatmapFacetMapTest.java    |  15 +-
 .../JsonQueryRequestFacetingIntegrationTest.java   |   3 +-
 .../json/JsonQueryRequestIntegrationTest.java      |   3 +-
 .../request/json/JsonQueryRequestUnitTest.java     |  33 +-
 .../solrj/request/json/QueryFacetMapTest.java      |   3 +-
 .../solrj/request/json/RangeFacetMapTest.java      |   9 +-
 .../solrj/request/json/TermsFacetMapTest.java      |  15 +-
 .../response/TestDelegationTokenResponse.java      |   9 +-
 .../solrj/response/TestSpellCheckResponse.java     |   3 +-
 .../solr/common/TestToleratedUpdateError.java      |  11 +-
 .../apache/solr/common/cloud/SolrZkClientTest.java |  19 +-
 .../cloud/TestCloudCollectionsListeners.java       |   3 +-
 .../common/cloud/TestCollectionStateWatchers.java  |   7 +-
 .../common/cloud/TestDocCollectionWatcher.java     |   7 +-
 .../solr/common/cloud/TestZkConfigManager.java     |  11 +-
 .../apache/solr/common/params/ShardParamsTest.java |   3 +-
 .../apache/solr/common/util/ContentStreamTest.java |  13 +-
 .../apache/solr/common/util/JsonValidatorTest.java |   7 +-
 .../org/apache/solr/common/util/NamedListTest.java |   3 +-
 .../apache/solr/common/util/TestJavaBinCodec.java  |  10 +-
 .../solr/common/util/TestJsonRecordReader.java     |   3 +-
 .../solr/common/util/TestValidatingJsonMap.java    |   3 +-
 .../src/test/org/noggit/TestObjectBuilder.java     |  11 +-
 .../org/apache/solr}/AbstractBeforeAfterRule.java  |   2 +-
 .../apache/solr/BaseDistributedSearchTestCase.java |   9 +-
 .../java/org/apache/solr/SolrJettyTestBase.java    |   4 +-
 .../src/java/org/apache/solr/SolrTestCase.java     | 358 ++++++++++-----------
 .../src/java/org/apache/solr/SolrTestCaseHS.java   |   6 +-
 .../src/java/org/apache/solr/SolrTestCaseJ4.java   |  65 ++--
 .../src/java/org/apache/solr/SolrTestCaseUtil.java |  23 ++
 .../src/java/org/apache/solr/SolrTestUtil.java     | 277 ++++++++++++++++
 .../solr}/TestRuleSetupAndRestoreClassEnv.java     |  65 ++--
 .../solr}/TestRuleTemporaryFilesCleanup.java       |  57 ++--
 .../solr/cloud/AbstractFullDistribZkTestBase.java  |  14 +-
 .../org/apache/solr/cloud/AbstractZkTestCase.java  |   7 +-
 .../apache/solr/cloud/MultiSolrCloudTestCase.java  |   5 +-
 .../org/apache/solr/cloud/SolrCloudTestCase.java   |   4 +-
 .../java/org/apache/solr/cloud/ZkTestServer.java   |   4 +-
 .../solr/util/RevertDefaultThreadHandlerRule.java  |  38 ++-
 .../org/apache/solr/cloud/JettySolrRunnerTest.java |   6 +-
 .../solr/cloud/MiniSolrCloudClusterTest.java       |   3 +-
 718 files changed, 5738 insertions(+), 4746 deletions(-)
 copy {lucene/test-framework/src/java/org/apache/lucene/util => solr/test-framework/src/java/org/apache/solr}/AbstractBeforeAfterRule.java (98%)
 create mode 100644 solr/test-framework/src/java/org/apache/solr/SolrTestCaseUtil.java
 create mode 100644 solr/test-framework/src/java/org/apache/solr/SolrTestUtil.java
 copy {lucene/test-framework/src/java/org/apache/lucene/util => solr/test-framework/src/java/org/apache/solr}/TestRuleSetupAndRestoreClassEnv.java (88%)
 copy {lucene/test-framework/src/java/org/apache/lucene/util => solr/test-framework/src/java/org/apache/solr}/TestRuleTemporaryFilesCleanup.java (86%)


[lucene-solr] 03/03: @1342 Lighten up our test class model, the fields are punishing with randomized testing framework and it's something to move away from for a few reasons.

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

markrmiller pushed a commit to branch reference_impl_dev
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git

commit 0e59ebb01df42f90d1694c4e4f80b62efe424576
Author: markrmiller@gmail.com <ma...@gmail.com>
AuthorDate: Wed Feb 10 17:52:09 2021 -0600

    @1342 Lighten up our test class model, the fields are punishing with randomized testing framework and it's something to move away from for a few reasons.
---
 .../org/apache/lucene/util/LuceneTestCase.java     |  28 +-
 .../lucene/util/TestRuleTemporaryFilesCleanup.java |  15 +-
 .../analysis/TestFoldingMultitermExtrasQuery.java  |   5 +-
 .../apache/solr/schema/TestICUCollationField.java  |   7 +-
 .../schema/TestICUCollationFieldDocValues.java     |   7 +-
 .../solr/schema/TestICUCollationFieldOptions.java  |   5 +-
 ...ExtractNamedEntitiesUpdateProcessorFactory.java |   5 +-
 .../solr/analytics/ExpressionFactoryTest.java      |   5 +-
 .../solr/analytics/SolrAnalyticsTestCase.java      |   3 +-
 .../legacy/LegacyAbstractAnalyticsCloudTest.java   |   3 +-
 .../legacy/expression/LegacyExpressionTest.java    |   3 +-
 .../legacy/expression/LegacyFunctionTest.java      |   6 +-
 .../clustering/carrot2/CarrotClusteringEngine.java |  20 +-
 .../clustering/AbstractClusteringTestCase.java     |   5 +-
 .../DistributedClusteringComponentTest.java        |   3 +-
 .../dataimport/TestTikaEntityProcessor.java        |  21 +-
 .../solr/handler/dataimport/DataImportHandler.java |  28 +-
 .../apache/solr/handler/dataimport/DocBuilder.java |  20 +-
 .../solr/handler/dataimport/ScriptTransformer.java |  23 +-
 .../AbstractDataImportHandlerTestCase.java         |   7 +-
 .../AbstractSqlEntityProcessorTestCase.java        |   3 +-
 .../dataimport/TestContentStreamDataSource.java    |  11 +-
 .../solr/handler/dataimport/TestDocBuilder2.java   |   3 +-
 .../dataimport/TestFileListEntityProcessor.java    |   9 +-
 .../TestFileListWithLineEntityProcessor.java       |   4 +-
 .../dataimport/TestHierarchicalDocBuilder.java     |  10 +-
 .../handler/dataimport/TestJdbcDataSource.java     |  13 +-
 .../dataimport/TestJdbcDataSourceConvertType.java  |   6 +-
 .../dataimport/TestNonWritablePersistFile.java     |  12 +-
 .../handler/dataimport/TestScriptTransformer.java  |  24 +-
 .../dataimport/TestSimplePropertiesWriter.java     |   3 +-
 .../TestSolrEntityProcessorEndToEnd.java           |  11 +-
 .../dataimport/TestXPathEntityProcessor.java       |   5 +-
 .../handler/dataimport/TestXPathRecordReader.java  |   7 +-
 .../handler/dataimport/TestZKPropertiesWriter.java |   5 +-
 .../extraction/ExtractingRequestHandlerTest.java   |  34 +-
 .../handler/extraction/TestXLSXResponseWriter.java |   3 +-
 .../apache/solr/jaeger/TestJaegerConfigurator.java |  22 +-
 ...geIdentifierUpdateProcessorFactoryTestCase.java |   3 +-
 .../apache/solr/ltr/search/LTRQParserPlugin.java   |   2 +-
 .../org/apache/solr/ltr/TestLTRQParserPlugin.java  |  11 +-
 .../apache/solr/ltr/TestLTRReRankingPipeline.java  |  41 +--
 .../org/apache/solr/ltr/TestLTRScoringQuery.java   |  48 +--
 .../test/org/apache/solr/ltr/TestRerankBase.java   |   6 +-
 .../solr/ltr/TestSelectiveWeightCreation.java      |  18 +-
 .../solr/ltr/feature/TestExternalFeatures.java     |  15 +-
 .../apache/solr/ltr/feature/TestValueFeature.java  |   5 +-
 .../org/apache/solr/ltr/model/TestLinearModel.java |  27 +-
 .../ltr/model/TestMultipleAdditiveTreesModel.java  |  46 ++-
 .../solr/ltr/model/TestNeuralNetworkModel.java     |  26 +-
 .../apache/solr/ltr/model/TestWrapperModel.java    |  11 +-
 .../apache/solr/ltr/norm/TestMinMaxNormalizer.java |   4 +-
 .../solr/ltr/norm/TestStandardNormalizer.java      |   8 +-
 .../ltr/store/rest/TestManagedFeatureStore.java    |   3 +-
 .../prometheus/PrometheusExporterTestBase.java     |   5 +-
 .../scraper/SolrStandaloneScraperTest.java         |   7 +-
 .../org/apache/solr/prometheus/utils/Helpers.java  |   4 +-
 .../solr/velocity/VelocityResponseWriterTest.java  |  16 +-
 .../src/java/org/apache/solr/cloud/Overseer.java   |   1 -
 .../org/apache/solr/cloud/ReplicateFromLeader.java |   1 -
 .../solr/cloud/api/collections/CreateShardCmd.java |  75 +++--
 .../api/collections/DimensionalRoutedAlias.java    |   2 +-
 .../solr/cloud/api/collections/MoveReplicaCmd.java |  36 ++-
 .../solr/cloud/api/collections/RoutedAlias.java    |   2 +-
 .../cloud/api/collections/TimeRoutedAlias.java     |   3 +-
 .../apache/solr/core/CachingDirectoryFactory.java  |   1 -
 .../java/org/apache/solr/core/CoreContainer.java   |   1 -
 .../apache/solr/core/StandardDirectoryFactory.java |   1 -
 .../java/org/apache/solr/handler/BlobHandler.java  |  42 ++-
 .../org/apache/solr/handler/CalciteJDBCStream.java |  50 +--
 .../handler/component/RealTimeGetComponent.java    |   1 -
 .../org/apache/solr/handler/loader/JsonLoader.java |  42 ++-
 .../solr/highlight/DefaultSolrHighlighter.java     |  65 ++--
 .../apache/solr/logging/log4j2/Log4j2Watcher.java  |   4 +-
 .../org/apache/solr/request/IntervalFacets.java    |  36 ++-
 .../apache/solr/request/LocalSolrQueryRequest.java |   2 +-
 .../java/org/apache/solr/request/SimpleFacets.java |  43 ++-
 .../apache/solr/response/JSONResponseWriter.java   |   5 +-
 .../analysis/ManagedSynonymFilterFactory.java      |   5 +-
 .../src/java/org/apache/solr/schema/BoolField.java | 142 ++++----
 .../org/apache/solr/schema/RandomSortField.java    | 104 +++---
 .../solr/schema/RptWithGeometrySpatialField.java   |  79 +++--
 .../org/apache/solr/search/BoolQParserPlugin.java  |  58 ++--
 .../org/apache/solr/search/BoostQParserPlugin.java |  74 +++--
 .../solr/search/CollapsingQParserPlugin.java       |  44 ++-
 .../apache/solr/search/ExportQParserPlugin.java    |   2 +-
 .../solr/search/FloatPayloadValueSource.java       |  94 +++---
 .../solr/search/PayloadScoreQParserPlugin.java     |  74 +++--
 .../apache/solr/search/PrefixQParserPlugin.java    |  20 +-
 .../org/apache/solr/search/RawQParserPlugin.java   |  18 +-
 .../apache/solr/search/ReRankQParserPlugin.java    |   2 +-
 .../apache/solr/search/SwitchQParserPlugin.java    |  66 ++--
 .../org/apache/solr/search/TermQParserPlugin.java  |  40 ++-
 .../org/apache/solr/search/TermsQParserPlugin.java |  94 +++---
 .../org/apache/solr/search/TopLevelJoinQuery.java  |  75 +++--
 .../java/org/apache/solr/search/facet/AvgAgg.java  |   6 +-
 .../org/apache/solr/search/facet/CountValsAgg.java |   8 +-
 .../org/apache/solr/search/facet/DocValuesAcc.java |   4 +-
 .../org/apache/solr/search/facet/FacetModule.java  |   2 +-
 .../org/apache/solr/search/facet/MinMaxAgg.java    |   2 +-
 .../org/apache/solr/search/facet/MissingAgg.java   |   2 +-
 .../org/apache/solr/search/facet/SumsqAgg.java     |   2 +-
 .../search/function/ReverseOrdFieldSource.java     |  38 ++-
 .../solr/search/join/ScoreJoinQParserPlugin.java   | 122 +++----
 .../apache/solr/search/mlt/CloudMLTQParser.java    |   8 +-
 .../org/apache/solr/security/BasicAuthPlugin.java  |   2 +-
 .../suggest/fst/AnalyzingInfixLookupFactory.java   |  46 +--
 .../suggest/fst/BlendedInfixLookupFactory.java     |  48 +--
 .../apache/solr/uninverting/FieldCacheImpl.java    | 154 +++++----
 .../apache/solr/uninverting/UninvertingReader.java |  20 +-
 .../org/apache/solr/update/TransactionLog.java     |   5 +-
 .../processor/DistributedZkUpdateProcessor.java    |   1 -
 .../processor/UUIDUpdateProcessorFactory.java      |  18 +-
 .../apache/solr/AnalysisAfterCoreReloadTest.java   |   4 +-
 .../org/apache/solr/BasicFunctionalityTest.java    |  45 +--
 .../src/test/org/apache/solr/CursorPagingTest.java |  13 +-
 .../solr/DistributedIntervalFacetingTest.java      |   4 +-
 .../apache/solr/HelloWorldSolrCloudTestCase.java   |   2 +-
 .../test/org/apache/solr/SolrTestCaseJ4Test.java   |  12 +-
 .../test/org/apache/solr/TestCrossCoreJoin.java    |   2 +-
 .../solr/TestCursorMarkWithoutUniqueKey.java       |   6 +-
 .../org/apache/solr/TestDistributedGrouping.java   |   5 +-
 .../org/apache/solr/TestDistributedSearch.java     |  14 +-
 .../test/org/apache/solr/TestGroupingSearch.java   |   8 +-
 solr/core/src/test/org/apache/solr/TestJoin.java   |  15 +-
 .../test/org/apache/solr/TestRandomDVFaceting.java |   5 +-
 .../test/org/apache/solr/TestRandomFaceting.java   |   2 +-
 .../org/apache/solr/TestSolrCoreProperties.java    |   8 +-
 .../test/org/apache/solr/TestTolerantSearch.java   |  30 +-
 solr/core/src/test/org/apache/solr/TestTrie.java   |   3 +-
 .../analysis/ProtectedTermFilterFactoryTest.java   |   3 +-
 .../analysis/TestWordDelimiterFilterFactory.java   |   4 +-
 .../solr/backcompat/TestLuceneIndexBackCompat.java |   7 +-
 .../TestEmbeddedSolrServerAdminHandler.java        |   5 +-
 .../TestEmbeddedSolrServerConstructors.java        |  12 +-
 .../embedded/TestEmbeddedSolrServerSchemaAPI.java  |  14 +-
 .../client/solrj/embedded/TestJettySolrRunner.java |   9 +-
 .../test/org/apache/solr/cloud/AddReplicaTest.java |   4 +-
 .../apache/solr/cloud/AliasIntegrationTest.java    |  30 +-
 .../cloud/AssignBackwardCompatibilityTest.java     |   3 +-
 .../apache/solr/cloud/BasicDistributedZk2Test.java |  12 +-
 .../apache/solr/cloud/BasicDistributedZkTest.java  |  15 +-
 ...aosMonkeyNothingIsSafeWithPullReplicasTest.java |   4 +-
 .../solr/cloud/ChaosMonkeyShardSplitTest.java      |   5 +-
 .../org/apache/solr/cloud/CleanupOldIndexTest.java |   4 +-
 .../cloud/CloudExitableDirectoryReaderTest.java    |   5 +-
 .../apache/solr/cloud/ClusterStateUpdateTest.java  |   3 +-
 .../org/apache/solr/cloud/CollectionPropsTest.java |   9 +-
 .../solr/cloud/CollectionStateZnodeTest.java       |   3 +-
 .../apache/solr/cloud/CollectionsAPISolrJTest.java |  20 +-
 .../cloud/ConcurrentCreateRoutedAliasTest.java     |   3 +-
 .../org/apache/solr/cloud/ConfigSetsAPITest.java   |  10 +-
 .../solr/cloud/CreateCollectionCleanupTest.java    |  12 +-
 .../apache/solr/cloud/CreateRoutedAliasTest.java   |  17 +-
 .../solr/cloud/DeleteInactiveReplicaTest.java      |   4 +-
 .../cloud/DeleteLastCustomShardedReplicaTest.java  |   4 +-
 .../test/org/apache/solr/cloud/DeleteNodeTest.java |   7 +-
 .../org/apache/solr/cloud/DeleteReplicaTest.java   |  14 +-
 .../org/apache/solr/cloud/DeleteShardTest.java     |   8 +-
 .../org/apache/solr/cloud/DeleteStatusTest.java    |   3 +-
 .../apache/solr/cloud/DistribCursorPagingTest.java |   5 +-
 .../DistribDocExpirationUpdateProcessorTest.java   |  17 +-
 .../solr/cloud/DistribJoinFromCollectionTest.java  |   3 +-
 .../solr/cloud/DistributedVersionInfoTest.java     |   3 +-
 .../apache/solr/cloud/DocValuesNotIndexedTest.java |   3 +-
 .../org/apache/solr/cloud/ForceLeaderTest.java     |   5 +-
 .../solr/cloud/FullSolrCloudDistribCmdsTest.java   |  12 +-
 .../solr/cloud/LeaderElectionContextKeyTest.java   |   3 +-
 .../solr/cloud/LeaderElectionIntegrationTest.java  |   3 +-
 .../org/apache/solr/cloud/LeaderElectionTest.java  |   5 +-
 .../apache/solr/cloud/LeaderTragicEventTest.java   |   3 +-
 .../solr/cloud/LeaderVoteWaitTimeoutTest.java      |   9 +-
 .../solr/cloud/MetricsHistoryIntegrationTest.java  |   4 +-
 .../MetricsHistoryWithAuthIntegrationTest.java     |   3 +-
 .../org/apache/solr/cloud/MigrateRouteKeyTest.java |   7 +-
 .../solr/cloud/MissingSegmentRecoveryTest.java     |   3 +-
 .../solr/cloud/MoveReplicaHDFSFailoverTest.java    |   7 +-
 .../org/apache/solr/cloud/MoveReplicaHDFSTest.java |   5 +-
 .../org/apache/solr/cloud/MoveReplicaTest.java     |  17 +-
 .../solr/cloud/NestedShardedAtomicUpdateTest.java  |   6 +-
 .../OutOfBoxZkACLAndCredentialsProvidersTest.java  |  10 +-
 ...OverriddenZkACLAndCredentialsProvidersTest.java |   9 +-
 .../solr/cloud/OverseerModifyCollectionTest.java   |   9 +-
 .../org/apache/solr/cloud/OverseerRolesTest.java   |   3 +-
 .../org/apache/solr/cloud/OverseerStatusTest.java  |   6 +-
 .../test/org/apache/solr/cloud/OverseerTest.java   |   5 +-
 .../apache/solr/cloud/PackageManagerCLITest.java   |   7 +-
 .../test/org/apache/solr/cloud/RecoveryZkTest.java |   3 +-
 .../apache/solr/cloud/ReindexCollectionTest.java   |   7 +-
 .../apache/solr/cloud/RemoteQueryErrorTest.java    |   6 +-
 .../org/apache/solr/cloud/ReplaceNodeTest.java     |  21 +-
 .../apache/solr/cloud/ReplicationFactorTest.java   |   2 +-
 .../apache/solr/cloud/SaslZkACLProviderTest.java   |  20 +-
 .../cloud/SharedFSAutoReplicaFailoverTest.java     |   3 +-
 .../org/apache/solr/cloud/SolrCLIZkUtilsTest.java  |  33 +-
 .../apache/solr/cloud/SolrCloudBridgeTestCase.java |   5 +-
 .../org/apache/solr/cloud/SolrXmlInZkTest.java     |  12 +-
 .../test/org/apache/solr/cloud/SplitShardTest.java |   3 +-
 .../solr/cloud/SystemCollectionCompatTest.java     |   3 +-
 .../solr/cloud/TestAuthenticationFramework.java    |   7 +-
 .../apache/solr/cloud/TestBaseStatsCacheCloud.java |   3 +-
 .../apache/solr/cloud/TestCloudConsistency.java    |  48 ++-
 .../apache/solr/cloud/TestCloudDeleteByQuery.java  |   3 +-
 .../apache/solr/cloud/TestCloudInspectUtil.java    |   6 +-
 .../TestCloudPhrasesIdentificationComponent.java   |  12 +-
 .../org/apache/solr/cloud/TestCloudPivotFacet.java |  21 +-
 .../solr/cloud/TestCloudPseudoReturnFields.java    |   9 +-
 .../org/apache/solr/cloud/TestCloudRecovery.java   |   3 +-
 .../org/apache/solr/cloud/TestCloudRecovery2.java  |   4 +-
 .../solr/cloud/TestCloudSearcherWarming.java       |   3 +-
 .../org/apache/solr/cloud/TestConfigSetsAPI.java   |  31 +-
 .../solr/cloud/TestConfigSetsAPIExclusivity.java   |   8 +-
 .../solr/cloud/TestConfigSetsAPIZkFailure.java     |  13 +-
 .../cloud/TestDeleteCollectionOnDownNodes.java     |   3 +-
 .../org/apache/solr/cloud/TestDistributedMap.java  |   5 +-
 .../solr/cloud/TestDownShardTolerantSearch.java    |   6 +-
 .../cloud/TestExclusionRuleCollectionAccess.java   |   3 +-
 .../cloud/TestLeaderElectionWithEmptyReplica.java  |   3 +-
 .../solr/cloud/TestLeaderElectionZkExpiry.java     |   5 +-
 .../solr/cloud/TestMiniSolrCloudClusterSSL.java    |  51 +--
 .../org/apache/solr/cloud/TestPrepRecovery.java    |   9 +-
 .../org/apache/solr/cloud/TestPullReplica.java     |  24 +-
 .../solr/cloud/TestPullReplicaErrorHandling.java   |  14 +-
 .../solr/cloud/TestQueryingOnDownCollection.java   |   8 +-
 .../apache/solr/cloud/TestRandomFlRTGCloud.java    |  16 +-
 .../apache/solr/cloud/TestRebalanceLeaders.java    |   3 +-
 .../apache/solr/cloud/TestRequestForwarding.java   |   5 +-
 .../apache/solr/cloud/TestSSLRandomization.java    |   7 +-
 .../org/apache/solr/cloud/TestSegmentSorting.java  |   7 +-
 .../solr/cloud/TestSkipOverseerOperations.java     |   3 +-
 .../cloud/TestSolrCloudWithDelegationTokens.java   |   7 +-
 .../solr/cloud/TestSolrCloudWithKerberosAlt.java   |   5 +-
 .../TestSolrCloudWithSecureImpersonation.java      |  44 +--
 .../cloud/TestStressCloudBlindAtomicUpdates.java   |  18 +-
 .../solr/cloud/TestStressInPlaceUpdates.java       |   3 +-
 .../org/apache/solr/cloud/TestStressLiveNodes.java |   3 +-
 .../solr/cloud/TestTlogReplayVsRecovery.java       |  26 +-
 .../org/apache/solr/cloud/TestTlogReplica.java     |  10 +-
 .../cloud/TestTolerantUpdateProcessorCloud.java    |  17 +-
 .../TestTolerantUpdateProcessorRandomCloud.java    |  12 +-
 .../cloud/TestWaitForStateWithJettyShutdowns.java  |   8 +-
 .../solr/cloud/TriLevelCompositeIdRoutingTest.java |  11 +-
 .../apache/solr/cloud/UnloadDistributedZkTest.java |   9 +-
 .../VMParamsZkACLAndCredentialsProvidersTest.java  |   9 +-
 .../src/test/org/apache/solr/cloud/ZkCLITest.java  |  24 +-
 .../org/apache/solr/cloud/ZkControllerTest.java    |  13 +-
 .../test/org/apache/solr/cloud/ZkFailoverTest.java |   3 +-
 .../org/apache/solr/cloud/ZkShardTermsTest.java    |   5 +-
 .../org/apache/solr/cloud/ZkSolrClientTest.java    |  12 +-
 .../AbstractCloudBackupRestoreTestCase.java        |   3 +-
 .../AsyncCallRequestStatusResponseTest.java        |   3 +-
 .../api/collections/CollectionReloadTest.java      |   3 +-
 .../collections/CollectionTooManyReplicasTest.java |  13 +-
 .../CollectionsAPIAsyncDistributedZkTest.java      |   5 +-
 .../CollectionsAPIDistClusterPerZkTest.java        |  16 +-
 .../CollectionsAPIDistributedZkTest.java           |  23 +-
 .../ConcurrentDeleteAndCreateCollectionTest.java   |   7 +-
 .../CreateCollectionsIndexAndRestartTest.java      |   3 +-
 .../api/collections/CustomCollectionTest.java      |   3 +-
 .../HdfsCollectionsAPIDistributedZkTest.java       |   3 +-
 .../solr/cloud/api/collections/ShardSplitTest.java |  31 +-
 .../cloud/api/collections/SplitByPrefixTest.java   |   3 +-
 .../cloud/api/collections/TestCollectionAPI.java   |   9 +-
 .../TestCollectionsAPIViaSolrCloudCluster.java     |   7 +-
 .../collections/TestHdfsCloudBackupRestore.java    |   7 +-
 .../collections/TestLocalFSCloudBackupRestore.java |   9 +-
 .../solr/cloud/hdfs/HDFSCollectionsAPITest.java    |   5 +-
 .../cloud/hdfs/HdfsBasicDistributedZk2Test.java    |   3 +-
 .../cloud/hdfs/HdfsBasicDistributedZkTest.java     |   3 +-
 .../hdfs/HdfsChaosMonkeyNothingIsSafeTest.java     |   3 +-
 .../cloud/hdfs/HdfsChaosMonkeySafeLeaderTest.java  |   3 +-
 .../apache/solr/cloud/hdfs/HdfsNNFailoverTest.java |   3 +-
 .../solr/cloud/hdfs/HdfsRecoverLeaseTest.java      |   3 +-
 .../apache/solr/cloud/hdfs/HdfsRecoveryZkTest.java |   5 +-
 .../cloud/hdfs/HdfsRestartWhileUpdatingTest.java   |   3 +-
 .../apache/solr/cloud/hdfs/HdfsSyncSliceTest.java  |   3 +-
 .../apache/solr/cloud/hdfs/HdfsThreadLeakTest.java |   3 +-
 .../HdfsTlogReplayBufferedWhileIndexingTest.java   |   3 +-
 .../cloud/hdfs/HdfsUnloadDistributedZkTest.java    |   3 +-
 .../hdfs/HdfsWriteToMultipleCollectionsTest.java   |   3 +-
 .../org/apache/solr/cloud/hdfs/StressHdfsTest.java |   3 +-
 .../overseer/ZkCollectionPropsCachingTest.java     |   3 +-
 .../apache/solr/core/AlternateDirectoryTest.java   |   3 +-
 .../apache/solr/core/BlobRepositoryCloudTest.java  |   3 +-
 .../test/org/apache/solr/core/CoreSorterTest.java  |   3 +-
 .../org/apache/solr/core/DirectoryFactoryTest.java |   3 +-
 .../apache/solr/core/HdfsDirectoryFactoryTest.java |   5 +-
 .../org/apache/solr/core/QueryResultKeyTest.java   |   3 +-
 .../org/apache/solr/core/ResourceLoaderTest.java   |  16 +-
 .../solr/core/SolrCoreCheckLockOnStartupTest.java  |   5 +-
 .../solr/core/TestBackupRepositoryFactory.java     |   5 +-
 .../test/org/apache/solr/core/TestBadConfig.java   |   3 +-
 .../org/apache/solr/core/TestCodecSupport.java     |   9 +-
 .../src/test/org/apache/solr/core/TestConfig.java  |  18 +-
 .../apache/solr/core/TestConfigSetImmutable.java   |   5 +-
 .../apache/solr/core/TestConfigSetProperties.java  |   8 +-
 .../test/org/apache/solr/core/TestConfigSets.java  |  16 +-
 .../org/apache/solr/core/TestCoreContainer.java    |  40 +--
 .../org/apache/solr/core/TestCoreDiscovery.java    |  58 ++--
 .../apache/solr/core/TestCorePropertiesReload.java |   5 +-
 .../org/apache/solr/core/TestDirectoryFactory.java |   3 +-
 .../test/org/apache/solr/core/TestLazyCores.java   |  21 +-
 .../apache/solr/core/TestMergePolicyConfig.java    |   3 +-
 .../apache/solr/core/TestReloadAndDeleteDocs.java  |   3 +-
 .../apache/solr/core/TestShardHandlerFactory.java  |   3 +-
 .../apache/solr/core/TestSolrConfigHandler.java    |   7 +-
 .../apache/solr/core/TestSolrDeletionPolicy1.java  |   3 +-
 .../org/apache/solr/core/TestSolrIndexConfig.java  |   6 +-
 .../src/test/org/apache/solr/core/TestSolrXml.java |   7 +-
 .../repository/HdfsBackupRepositoryTest.java       |  16 +-
 .../core/snapshots/TestSolrCloudSnapshots.java     |  11 +-
 .../solr/core/snapshots/TestSolrCoreSnapshots.java |   5 +-
 .../solr/filestore/TestDistribPackageStore.java    |   3 +-
 .../handler/FieldAnalysisRequestHandlerTest.java   |   3 +-
 .../org/apache/solr/handler/JsonLoaderTest.java    |  14 +-
 .../solr/handler/MoreLikeThisHandlerTest.java      |   6 +-
 .../solr/handler/PingRequestHandlerTest.java       |   8 +-
 .../org/apache/solr/handler/TestCSVLoader.java     |   3 +-
 .../org/apache/solr/handler/TestCoreBackup.java    |   7 +-
 .../solr/handler/TestHdfsBackupRestoreCore.java    |   7 +-
 .../solr/handler/TestReplicationHandler.java       |  24 +-
 .../solr/handler/TestReplicationHandlerBackup.java |   5 +-
 .../TestReplicationHandlerDiskOverFlow.java        |   5 +-
 .../org/apache/solr/handler/TestReqParamsAPI.java  |   3 +-
 .../org/apache/solr/handler/TestRestoreCore.java   |  26 +-
 .../org/apache/solr/handler/TestSQLHandler.java    |   5 +-
 .../solr/handler/TestSQLHandlerNonCloud.java       |   6 +-
 .../solr/handler/TestStressThreadBackup.java       |   7 +-
 .../solr/handler/TestSystemCollAutoCreate.java     |   1 -
 .../apache/solr/handler/V2ApiIntegrationTest.java  |  13 +-
 .../org/apache/solr/handler/V2StandaloneTest.java  |   7 +-
 .../solr/handler/XmlUpdateRequestHandlerTest.java  |   3 +-
 .../solr/handler/XsltUpdateRequestHandlerTest.java |   3 +-
 .../solr/handler/admin/AdminHandlersProxyTest.java |   3 +-
 .../handler/admin/CoreAdminCreateDiscoverTest.java |   5 +-
 .../solr/handler/admin/CoreAdminHandlerTest.java   |  34 +-
 .../solr/handler/admin/CoreAdminOperationTest.java |  93 +++---
 .../handler/admin/CoreAdminRequestStatusTest.java  |   3 +-
 .../admin/CoreMergeIndexesAdminHandlerTest.java    |  10 +-
 .../solr/handler/admin/DaemonStreamApiTest.java    |   5 +-
 .../solr/handler/admin/HealthCheckHandlerTest.java |  11 +-
 .../solr/handler/admin/IndexSizeEstimatorTest.java |   3 +-
 .../apache/solr/handler/admin/InfoHandlerTest.java |   8 +-
 .../solr/handler/admin/LoggingHandlerTest.java     |   3 +-
 .../solr/handler/admin/MBeansHandlerTest.java      |   3 +-
 .../handler/admin/MetricsHistoryHandlerTest.java   |   3 +-
 .../handler/admin/ShowFileRequestHandlerTest.java  |   3 +-
 .../solr/handler/admin/SplitHandlerTest.java       |   3 +-
 .../solr/handler/admin/StatsReloadRaceTest.java    |   6 +-
 .../solr/handler/admin/TestCollectionAPIs.java     |   5 +-
 .../solr/handler/admin/ZookeeperReadAPITest.java   |   3 +-
 .../handler/admin/ZookeeperStatusHandlerTest.java  |   3 +-
 .../component/CustomHighlightComponentTest.java    |   3 +-
 .../component/DistributedDebugComponentTest.java   |   8 +-
 .../component/DistributedExpandComponentTest.java  |   3 +-
 .../component/DistributedFacetExistsSmallTest.java |   3 +-
 .../DistributedQueryComponentOptimizationTest.java |  10 +-
 .../DistributedQueryElevationComponentTest.java    |   6 +-
 .../component/DistributedTermsComponentTest.java   |   2 +-
 .../handler/component/InfixSuggestersTest.java     |   5 +-
 .../PhrasesIdentificationComponentTest.java        |   9 +-
 .../component/QueryElevationComponentTest.java     |   3 +-
 .../solr/handler/component/SearchHandlerTest.java  |  18 +-
 .../handler/component/ShardsWhitelistTest.java     |   6 +-
 .../handler/component/SpellCheckComponentTest.java |  33 +-
 .../solr/handler/component/StatsComponentTest.java |  21 +-
 .../SuggestComponentContextFilterQueryTest.java    |   7 +-
 .../handler/component/SuggestComponentTest.java    |   2 +-
 .../TermVectorComponentDistributedTest.java        |   3 +-
 .../TestDistributedStatsComponentCardinality.java  |   3 +-
 .../handler/component/TestExpandComponent.java     |  20 +-
 .../component/TestHttpShardHandlerFactory.java     |  14 +-
 .../handler/component/TestPivotHelperCode.java     |   5 +-
 .../solr/handler/export/TestExportWriter.java      |  11 +-
 .../solr/handler/tagger/RandomizedTaggerTest.java  |   3 +-
 .../apache/solr/handler/tagger/Tagger2Test.java    |   3 +-
 .../org/apache/solr/highlight/HighlighterTest.java |   3 +-
 .../highlight/TestPostingsSolrHighlighter.java     |   4 +-
 .../solr/highlight/TestUnifiedSolrHighlighter.java |   6 +-
 .../solr/index/TestSlowCompositeReaderWrapper.java |  12 +-
 .../solr/index/WrapperMergePolicyFactoryTest.java  |   4 +-
 .../apache/solr/index/hdfs/CheckHdfsIndexTest.java |   3 +-
 .../apache/solr/internal/csv/CharBufferTest.java   |   4 +-
 .../org/apache/solr/legacy/TestLegacyField.java    |  25 +-
 .../apache/solr/legacy/TestLegacyNumericUtils.java |   9 +-
 .../org/apache/solr/legacy/TestLegacyTerms.java    |  17 +-
 .../legacy/TestMultiValuedNumericRangeQuery.java   |  14 +-
 .../solr/legacy/TestNumericRangeQuery32.java       |  17 +-
 .../solr/legacy/TestNumericRangeQuery64.java       |  18 +-
 .../org/apache/solr/metrics/JvmMetricsTest.java    |   7 +-
 .../org/apache/solr/metrics/MetricsConfigTest.java |   5 +-
 .../solr/metrics/SolrMetricsIntegrationTest.java   |   3 +-
 .../reporters/SolrGraphiteReporterTest.java        |   3 +-
 .../reporters/SolrJmxReporterCloudTest.java        |   3 +-
 .../metrics/reporters/SolrSlf4jReporterTest.java   |   3 +-
 .../reporters/solr/SolrCloudReportersTest.java     |   8 +-
 .../metrics/rrd/SolrRrdBackendFactoryTest.java     |   3 +-
 .../src/test/org/apache/solr/pkg/TestPackages.java |   5 +-
 .../org/apache/solr/request/SimpleFacetsTest.java  |  35 +-
 .../test/org/apache/solr/request/TestFaceting.java |   7 +-
 .../apache/solr/request/TestIntervalFaceting.java  |  33 +-
 .../apache/solr/request/TestRemoteStreaming.java   |   8 +-
 .../org/apache/solr/request/TestStreamBody.java    |   7 +-
 .../solr/request/TestUnInvertedFieldException.java |   5 +-
 .../org/apache/solr/response/SmileWriterTest.java  |   3 +-
 .../response/TestJavabinTupleStreamParser.java     |   3 +-
 .../transform/TestChildDocTransformer.java         |  16 +-
 .../TestChildDocTransformerHierarchy.java          |  13 +-
 .../transform/TestSubQueryTransformer.java         |  10 +-
 .../transform/TestSubQueryTransformerDistrib.java  |  12 +-
 .../org/apache/solr/rest/SolrRestletTestBase.java  |  10 +-
 .../solr/rest/TestManagedResourceStorage.java      |   3 +-
 .../test/org/apache/solr/rest/TestRestManager.java |   3 +-
 .../apache/solr/rest/schema/TestBulkSchemaAPI.java |   7 +-
 .../schema/TestSerializedLuceneMatchVersion.java   |   3 +-
 .../rest/schema/TestUniqueKeyFieldResource.java    |   2 -
 .../analysis/TestManagedStopFilterFactory.java     |   5 +-
 .../analysis/TestManagedSynonymFilterFactory.java  |   5 +-
 .../TestManagedSynonymGraphFilterFactory.java      |   5 +-
 .../apache/solr/schema/ChangedSchemaMergeTest.java |   8 +-
 .../test/org/apache/solr/schema/CopyFieldTest.java |  18 +-
 .../apache/solr/schema/CurrencyFieldTypeTest.java  |  26 +-
 .../test/org/apache/solr/schema/DateFieldTest.java |   3 +-
 .../org/apache/solr/schema/DocValuesMultiTest.java |   3 +-
 .../test/org/apache/solr/schema/DocValuesTest.java |   5 +-
 .../test/org/apache/solr/schema/EnumFieldTest.java |  45 +--
 .../solr/schema/ExternalFileFieldSortTest.java     |   7 +-
 .../schema/ManagedSchemaRoundRobinCloudTest.java   |   4 +-
 .../schema/OpenExchangeRatesOrgProviderTest.java   |   4 +-
 .../PreAnalyzedFieldManagedSchemaCloudTest.java    |   3 +-
 .../apache/solr/schema/PreAnalyzedFieldTest.java   |   3 +-
 .../apache/solr/schema/PrimitiveFieldTypeTest.java |   5 +-
 .../apache/solr/schema/SchemaApiFailureTest.java   |   4 +-
 .../solr/schema/SpatialRPTFieldTypeTest.java       |  10 +-
 .../org/apache/solr/schema/TestBinaryField.java    |   9 +-
 .../org/apache/solr/schema/TestCollationField.java |   9 +-
 .../solr/schema/TestCollationFieldDocValues.java   |   9 +-
 .../org/apache/solr/schema/TestManagedSchema.java  |   5 +-
 .../apache/solr/schema/TestManagedSchemaAPI.java   |   3 +-
 .../solr/schema/TestManagedSchemaThreadSafety.java |  10 +-
 .../org/apache/solr/schema/TestPointFields.java    |  38 +--
 .../org/apache/solr/schema/TestPointFields2.java   | 105 +++---
 .../solr/schema/TestSchemalessBufferedUpdates.java |   5 +-
 .../apache/solr/schema/TestSortableTextField.java  |   8 +-
 .../test/org/apache/solr/schema/TestTextField.java |   3 +-
 .../solr/schema/TestUseDocValuesAsStored.java      |   8 +-
 .../solr/schema/TestUseDocValuesAsStored2.java     |   5 +-
 .../solr/search/CurrencyRangeFacetCloudTest.java   |  18 +-
 .../org/apache/solr/search/CursorMarkTest.java     |   5 +-
 .../org/apache/solr/search/FuzzySearchTest.java    |   6 +-
 .../org/apache/solr/search/QueryEqualityTest.java  |  31 +-
 .../org/apache/solr/search/QueryParsingTest.java   |  17 +-
 .../org/apache/solr/search/ReturnFieldsTest.java   |   3 +-
 .../org/apache/solr/search/SpatialFilterTest.java  |   5 +-
 .../solr/search/TestAddFieldRealTimeGet.java       |   5 +-
 .../org/apache/solr/search/TestCaffeineCache.java  |   3 +-
 .../solr/search/TestCollapseQParserPlugin.java     |  19 +-
 .../solr/search/TestExtendedDismaxParser.java      |  17 +-
 .../apache/solr/search/TestFilteredDocIdSet.java   |  13 +-
 .../test/org/apache/solr/search/TestFiltering.java |   7 +-
 .../solr/search/TestFoldingMultitermQuery.java     |   5 +-
 .../apache/solr/search/TestHashQParserPlugin.java  |   5 +-
 .../org/apache/solr/search/TestIndexSearcher.java  |   3 +-
 .../org/apache/solr/search/TestMissingGroups.java  |   7 +-
 .../apache/solr/search/TestPseudoReturnFields.java |   5 +-
 .../org/apache/solr/search/TestQueryTypes.java     |   8 +-
 .../search/TestRandomCollapseQParserPlugin.java    |   5 +-
 .../org/apache/solr/search/TestRangeQuery.java     |  64 ++--
 .../solr/search/TestReRankQParserPlugin.java       |   3 +-
 .../org/apache/solr/search/TestRealTimeGet.java    |  50 ++-
 .../test/org/apache/solr/search/TestRecovery.java  |   2 +-
 .../org/apache/solr/search/TestRecoveryHdfs.java   |   3 +-
 .../test/org/apache/solr/search/TestReload.java    |   3 +-
 .../org/apache/solr/search/TestSearcherReuse.java  |   7 +-
 .../org/apache/solr/search/TestSolr4Spatial.java   |  11 +-
 .../org/apache/solr/search/TestSolr4Spatial2.java  |   3 +-
 .../apache/solr/search/TestSolrQueryParser.java    |  33 +-
 .../src/test/org/apache/solr/search/TestSort.java  |   3 +-
 .../org/apache/solr/search/TestStressLucene.java   |   6 +-
 .../org/apache/solr/search/TestStressRecovery.java |   5 +-
 .../test/org/apache/solr/search/TestTrieFacet.java |   3 +-
 .../solr/search/facet/RangeFacetCloudTest.java     |  11 +-
 .../search/facet/SpatialHeatmapFacetsTest.java     |   2 +-
 .../search/facet/TestCloudJSONFacetJoinDomain.java |  26 +-
 .../solr/search/facet/TestCloudJSONFacetSKG.java   |  25 +-
 .../search/facet/TestCloudJSONFacetSKGEquiv.java   |  22 +-
 .../solr/search/facet/TestJsonFacetErrors.java     |  37 +--
 .../solr/search/facet/TestJsonFacetRefinement.java |   7 +-
 .../apache/solr/search/facet/TestJsonFacets.java   |  30 +-
 .../facet/TestJsonFacetsWithNestedObjects.java     |   4 +-
 .../solr/search/function/TestFunctionQuery.java    |   8 +-
 .../function/TestMinMaxOnMultiValuedField.java     |   8 +-
 .../apache/solr/search/function/TestOrdValues.java |  15 +-
 .../org/apache/solr/search/join/BJQParserTest.java |   7 +-
 .../solr/search/join/TestCloudNestedDocsSort.java  |  16 +-
 .../solr/search/join/TestScoreJoinQPNoScore.java   |   6 +-
 .../org/apache/solr/search/join/XCJFQueryTest.java |   9 +-
 .../apache/solr/search/json/TestJsonRequest.java   |   3 +-
 .../solr/search/mlt/CloudMLTQParserTest.java       |   6 +-
 .../TestSweetSpotSimilarityFactory.java            |   9 +-
 .../solr/search/stats/TestDefaultStatsCache.java   |   4 +-
 .../apache/solr/search/stats/TestDistribIDF.java   |  12 +-
 .../solr/security/AuditLoggerIntegrationTest.java  |  42 +--
 .../solr/security/BasicAuthIntegrationTest.java    |  21 +-
 .../solr/security/BasicAuthOnSingleNodeTest.java   |   3 +-
 .../solr/security/BasicAuthStandaloneTest.java     |   5 +-
 .../security/JWTAuthPluginIntegrationTest.java     |   9 +-
 .../apache/solr/security/JWTAuthPluginTest.java    |  11 +-
 .../apache/solr/security/JWTIssuerConfigTest.java  |   6 +-
 .../security/PKIAuthenticationIntegrationTest.java |   3 +-
 .../solr/security/TestAuthorizationFramework.java  |   3 +-
 .../hadoop/TestDelegationWithHadoopAuth.java       |   6 +-
 .../hadoop/TestImpersonationWithHadoopAuth.java    |  20 +-
 .../hadoop/TestSolrCloudWithHadoopAuthPlugin.java  |   7 +-
 .../security/hadoop/TestZkAclsWithHadoopAuth.java  |   5 +-
 .../org/apache/solr/servlet/CacheHeaderTest.java   |   5 +-
 .../solr/servlet/DirectSolrConnectionTest.java     |   3 +-
 .../solr/servlet/HttpSolrCallGetCoreTest.java      |   3 +-
 .../org/apache/solr/servlet/NoCacheHeaderTest.java |   3 +-
 .../apache/solr/servlet/ResponseHeaderTest.java    |   6 +-
 .../apache/solr/servlet/SolrRequestParserTest.java |  12 +-
 .../spelling/ConjunctionSolrSpellCheckerTest.java  |   3 +-
 .../solr/spelling/FileBasedSpellCheckerTest.java   |   6 +-
 .../solr/spelling/IndexBasedSpellCheckerTest.java  |  12 +-
 .../solr/spelling/SpellCheckCollatorTest.java      |   3 +-
 .../solr/spelling/suggest/SuggesterTest.java       |   1 -
 .../solr/store/blockcache/BlockDirectoryTest.java  |   3 +-
 .../apache/solr/store/hdfs/HdfsDirectoryTest.java  |  23 +-
 .../solr/store/hdfs/HdfsLockFactoryTest.java       |   3 +-
 .../apache/solr/uninverting/TestDocTermOrds.java   |  78 ++---
 .../uninverting/TestDocTermOrdsUninvertLimit.java  |  12 +-
 .../apache/solr/uninverting/TestFieldCache.java    | 100 +++---
 .../solr/uninverting/TestFieldCacheReopen.java     |  10 +-
 .../solr/uninverting/TestFieldCacheSort.java       | 295 +++++++++--------
 .../solr/uninverting/TestFieldCacheSortRandom.java |  10 +-
 .../uninverting/TestFieldCacheVsDocValues.java     |  46 +--
 .../uninverting/TestFieldCacheWithThreads.java     |  12 +-
 .../solr/uninverting/TestLegacyFieldCache.java     |  50 +--
 .../solr/uninverting/TestNumericTerms32.java       |  12 +-
 .../solr/uninverting/TestNumericTerms64.java       |  12 +-
 .../solr/uninverting/TestUninvertingReader.java    |  32 +-
 .../org/apache/solr/update/AddBlockUpdateTest.java |  13 +-
 .../solr/update/AnalysisErrorHandlingTest.java     |   5 +-
 .../solr/update/DataDrivenBlockJoinTest.java       |   5 +-
 .../apache/solr/update/DocumentBuilderTest.java    |  18 +-
 .../test/org/apache/solr/update/PeerSyncTest.java  |   3 +-
 .../org/apache/solr/update/SoftAutoCommitTest.java |   2 +-
 .../apache/solr/update/SolrIndexConfigTest.java    |  11 +-
 .../apache/solr/update/SolrIndexSplitterTest.java  |   9 +-
 .../solr/update/TestAtomicUpdateErrorCases.java    |   9 +-
 .../org/apache/solr/update/TestHdfsUpdateLog.java  |   3 +-
 .../update/TestInPlaceUpdateWithRouteField.java    |   3 +-
 .../solr/update/TestInPlaceUpdatesDistrib.java     |  13 +-
 .../solr/update/TestInPlaceUpdatesStandalone.java  |  16 +-
 .../test/org/apache/solr/update/TestUpdate.java    |  15 +-
 .../org/apache/solr/update/TransactionLogTest.java |   5 +-
 .../test/org/apache/solr/update/UpdateLogTest.java |  10 +-
 .../AbstractAtomicUpdatesMultivalueTestBase.java   |  13 +-
 .../AddSchemaFieldsUpdateProcessorFactoryTest.java |  10 +-
 .../processor/AtomicUpdateRemovalJavabinTest.java  |   3 +-
 .../CategoryRoutedAliasUpdateProcessorTest.java    |  28 +-
 .../ClassificationUpdateProcessorTest.java         |  11 +-
 .../DimensionalRoutedAliasUpdateProcessorTest.java |   9 +-
 .../DocExpirationUpdateProcessorFactoryTest.java   |   5 +-
 .../IgnoreLargeDocumentProcessorFactoryTest.java   |   3 +-
 .../processor/RoutedAliasUpdateProcessorTest.java  |   3 +-
 .../solr/update/processor/ScriptEngineTest.java    |   3 +-
 .../SignatureUpdateProcessorFactoryTest.java       |   3 +-
 .../StatelessScriptUpdateProcessorFactoryTest.java |  21 +-
 .../processor/TemplateUpdateProcessorTest.java     |   3 +-
 .../processor/TestDocBasedVersionConstraints.java  |  68 ++--
 .../TimeRoutedAliasUpdateProcessorTest.java        |  33 +-
 .../processor/TolerantUpdateProcessorTest.java     |  15 +-
 .../UpdateRequestProcessorFactoryTest.java         |   3 +-
 .../test/org/apache/solr/util/AuthToolTest.java    |   5 +-
 .../org/apache/solr/util/DateMathParserTest.java   |  12 +-
 .../org/apache/solr/util/OrderedExecutorTest.java  |   3 +-
 .../org/apache/solr/util/SimplePostToolTest.java   |   3 +-
 .../org/apache/solr/util/SolrPluginUtilsTest.java  |  15 +-
 .../test/org/apache/solr/util/TestExportTool.java  |   8 +-
 .../org/apache/solr/util/TestSafeXMLParsing.java   |   3 +-
 .../apache/solr/util/TestSolrCLIRunExample.java    |  15 +-
 .../org/apache/solr/util/TestSystemIdResolver.java |  10 +-
 .../org/apache/solr/util/TestTestInjection.java    |   5 +-
 .../org/apache/solr/util/TimeZoneUtilsTest.java    |   5 +-
 .../test/org/apache/solr/util/UtilsToolTest.java   |   3 +-
 .../BigEndianAscendingWordDeserializerTest.java    |  13 +-
 .../hll/BigEndianAscendingWordSerializerTest.java  |  20 +-
 .../apache/solr/util/hll/HLLSerializationTest.java |  17 +-
 .../solr/util/tracing/TestDistributedTracing.java  |   5 +-
 .../client/solrj/impl/BinaryRequestWriter.java     |  30 +-
 .../solr/client/solrj/impl/HttpSolrClient.java     |  62 ++--
 .../client/solrj/io/eval/PairSortEvaluator.java    |   2 +-
 .../solrj/io/stream/CartesianProductStream.java    |   2 +-
 .../client/solrj/io/stream/ParallelListStream.java |   2 +-
 .../solrj/request/ContentStreamUpdateRequest.java  |  43 +--
 .../solrj/request/StreamingUpdateRequest.java      |  35 +-
 .../org/apache/solr/common/IteratorWriter.java     |  26 +-
 .../src/java/org/apache/solr/common/MapWriter.java |  70 ++--
 .../solr/common/cloud/ConnectionManager.java       |   1 -
 .../org/apache/solr/common/util/JavaBinCodec.java  |  94 +++---
 .../ref_guide_examples/JsonRequestApiTest.java     |   3 +-
 .../client/solrj/MergeIndexesExampleTestBase.java  |   7 +-
 .../apache/solr/client/solrj/SolrExampleTests.java |  33 +-
 .../solr/client/solrj/SolrExampleTestsBase.java    |   4 +-
 .../client/solrj/SolrSchemalessExampleTest.java    |   3 +-
 .../solr/client/solrj/TestLBHttp2SolrClient.java   |   9 +-
 .../solr/client/solrj/TestLBHttpSolrClient.java    |  18 +-
 .../solr/client/solrj/TestSolrJErrorHandling.java  |   7 +-
 .../AbstractEmbeddedSolrServerTestCase.java        |   9 +-
 .../client/solrj/embedded/JettyWebappTest.java     |   7 +-
 .../solrj/embedded/SolrExampleJettyTest.java       |  34 +-
 .../client/solrj/embedded/TestSolrProperties.java  |  13 +-
 .../client/solrj/impl/BasicHttpSolrClientTest.java |   7 +-
 .../impl/CloudHttp2SolrClientBadInputTest.java     |   2 +-
 .../solrj/impl/CloudHttp2SolrClientRetryTest.java  |   6 +-
 .../solrj/impl/CloudHttp2SolrClientTest.java       |  20 +-
 .../solrj/impl/CloudSolrClientBadInputTest.java    |   2 +-
 .../solrj/impl/CloudSolrClientRetryTest.java       |   5 +-
 .../client/solrj/impl/CloudSolrClientTest.java     |  13 +-
 ...oncurrentUpdateHttp2SolrClientBadInputTest.java |   2 +-
 .../impl/ConcurrentUpdateHttp2SolrClientTest.java  |   5 +-
 .../ConcurrentUpdateSolrClientBadInputTest.java    |   2 +-
 .../ConcurrentUpdateSolrClientBuilderTest.java     |   3 +-
 .../impl/Http2SolrClientCompatibilityTest.java     |   3 +-
 .../client/solrj/impl/Http2SolrClientTest.java     |  41 +--
 .../solrj/impl/HttpSolrClientBadInputTest.java     |   7 +-
 .../solrj/impl/HttpSolrClientConPoolTest.java      |   5 +-
 .../solrj/impl/LBHttpSolrClientBadInputTest.java   |   4 +-
 .../solrj/impl/SolrPortAwareCookieSpecTest.java    |  20 +-
 .../solrj/impl/TestCloudSolrClientConnections.java |  18 +-
 .../client/solrj/io/graph/GraphExpressionTest.java |   3 +-
 .../solr/client/solrj/io/graph/GraphTest.java      |   3 +-
 .../apache/solr/client/solrj/io/sql/JdbcTest.java  |   3 +-
 .../solrj/io/stream/CloudAuthStreamTest.java       |  80 ++---
 .../client/solrj/io/stream/JDBCStreamTest.java     |   6 +-
 .../client/solrj/io/stream/MathExpressionTest.java |   5 +-
 .../solrj/io/stream/SelectWithEvaluatorsTest.java  |   6 +-
 .../solrj/io/stream/StreamDecoratorTest.java       |  19 +-
 .../solrj/io/stream/StreamExpressionTest.java      |  15 +-
 .../solr/client/solrj/io/stream/StreamingTest.java |  35 +-
 .../solr/client/solrj/request/Schema2Test.java     |  15 +-
 .../solr/client/solrj/request/SchemaTest.java      |  15 +-
 .../solr/client/solrj/request/SolrPingTest.java    |   5 +-
 .../solrj/request/TestCollectionAdminRequest.java  |  11 +-
 .../solrj/request/TestConfigSetAdminRequest.java   |   3 +-
 .../solr/client/solrj/request/TestCoreAdmin.java   |  21 +-
 .../solr/client/solrj/request/TestV2Request.java   |   3 +-
 ...DirectJsonQueryRequestFacetingEmbeddedTest.java |   3 +-
 ...ectJsonQueryRequestFacetingIntegrationTest.java |   3 +-
 .../client/solrj/request/json/DomainMapTest.java   |  15 +-
 .../solrj/request/json/HeatmapFacetMapTest.java    |  15 +-
 .../JsonQueryRequestFacetingIntegrationTest.java   |   3 +-
 .../json/JsonQueryRequestIntegrationTest.java      |   3 +-
 .../request/json/JsonQueryRequestUnitTest.java     |  33 +-
 .../solrj/request/json/QueryFacetMapTest.java      |   3 +-
 .../solrj/request/json/RangeFacetMapTest.java      |   9 +-
 .../solrj/request/json/TermsFacetMapTest.java      |  15 +-
 .../response/TestDelegationTokenResponse.java      |   9 +-
 .../solrj/response/TestSpellCheckResponse.java     |   3 +-
 .../solr/common/TestToleratedUpdateError.java      |  11 +-
 .../apache/solr/common/cloud/SolrZkClientTest.java |  19 +-
 .../cloud/TestCloudCollectionsListeners.java       |   3 +-
 .../common/cloud/TestCollectionStateWatchers.java  |   7 +-
 .../common/cloud/TestDocCollectionWatcher.java     |   7 +-
 .../solr/common/cloud/TestZkConfigManager.java     |  11 +-
 .../apache/solr/common/params/ShardParamsTest.java |   3 +-
 .../apache/solr/common/util/ContentStreamTest.java |  13 +-
 .../apache/solr/common/util/JsonValidatorTest.java |   7 +-
 .../org/apache/solr/common/util/NamedListTest.java |   3 +-
 .../apache/solr/common/util/TestJavaBinCodec.java  |  10 +-
 .../solr/common/util/TestJsonRecordReader.java     |   3 +-
 .../solr/common/util/TestValidatingJsonMap.java    |   3 +-
 .../src/test/org/noggit/TestObjectBuilder.java     |  11 +-
 .../org/apache/solr/AbstractBeforeAfterRule.java   |  63 ++++
 .../apache/solr/BaseDistributedSearchTestCase.java |   9 +-
 .../java/org/apache/solr/SolrJettyTestBase.java    |   4 +-
 .../src/java/org/apache/solr/SolrTestCase.java     | 358 ++++++++++-----------
 .../src/java/org/apache/solr/SolrTestCaseHS.java   |   6 +-
 .../src/java/org/apache/solr/SolrTestCaseJ4.java   |  65 ++--
 .../src/java/org/apache/solr/SolrTestCaseUtil.java |  23 ++
 .../src/java/org/apache/solr/SolrTestUtil.java     | 277 ++++++++++++++++
 .../solr/TestRuleSetupAndRestoreClassEnv.java      | 309 ++++++++++++++++++
 .../solr}/TestRuleTemporaryFilesCleanup.java       |  57 ++--
 .../solr/cloud/AbstractFullDistribZkTestBase.java  |  14 +-
 .../org/apache/solr/cloud/AbstractZkTestCase.java  |   7 +-
 .../apache/solr/cloud/MultiSolrCloudTestCase.java  |   5 +-
 .../org/apache/solr/cloud/SolrCloudTestCase.java   |   4 +-
 .../java/org/apache/solr/cloud/ZkTestServer.java   |   4 +-
 .../solr/util/RevertDefaultThreadHandlerRule.java  |  38 ++-
 .../org/apache/solr/cloud/JettySolrRunnerTest.java |   6 +-
 .../solr/cloud/MiniSolrCloudClusterTest.java       |   3 +-
 692 files changed, 5797 insertions(+), 4373 deletions(-)

diff --git a/lucene/test-framework/src/java/org/apache/lucene/util/LuceneTestCase.java b/lucene/test-framework/src/java/org/apache/lucene/util/LuceneTestCase.java
index 18a3850..b42807d 100644
--- a/lucene/test-framework/src/java/org/apache/lucene/util/LuceneTestCase.java
+++ b/lucene/test-framework/src/java/org/apache/lucene/util/LuceneTestCase.java
@@ -87,6 +87,7 @@ import org.apache.lucene.search.LRUQueryCache;
 import org.apache.lucene.search.Query;
 import org.apache.lucene.search.QueryCache;
 import org.apache.lucene.search.QueryCachingPolicy;
+import org.apache.lucene.search.similarities.BM25Similarity;
 import org.apache.lucene.store.BaseDirectoryWrapper;
 import org.apache.lucene.store.ByteBuffersDirectory;
 import org.apache.lucene.store.Directory;
@@ -686,12 +687,12 @@ public abstract class LuceneTestCase extends Assert {
 
   private static final Map<String,FieldType> fieldToType = new HashMap<String,FieldType>();
 
-  enum LiveIWCFlushMode {BY_RAM, BY_DOCS, EITHER};
+  public enum LiveIWCFlushMode {BY_RAM, BY_DOCS, EITHER}; // MRM TODO:
 
   /** Set by TestRuleSetupAndRestoreClassEnv */
   static LiveIWCFlushMode liveIWCFlushMode;
 
-  static void setLiveIWCFlushMode(LiveIWCFlushMode flushMode) {
+  public static void setLiveIWCFlushMode(LiveIWCFlushMode flushMode) {
     liveIWCFlushMode = flushMode;
   }
 
@@ -935,7 +936,9 @@ public abstract class LuceneTestCase extends Assert {
   /** create a new index writer config with random defaults using the specified random */
   public static IndexWriterConfig newIndexWriterConfig(Random r, Analyzer a) {
     IndexWriterConfig c = new IndexWriterConfig(a);
-    c.setSimilarity(classEnvRule.similarity);
+    if (classEnvRule.similarity != null) {
+      c.setSimilarity(classEnvRule.similarity); // TODO: get sim from our classEnvRule instead of LuceneTestCase's
+    }
     if (VERBOSE) {
       // Even though TestRuleSetupAndRestoreClassEnv calls
       // InfoStream.setDefault, we do it again here so that
@@ -1062,9 +1065,11 @@ public abstract class LuceneTestCase extends Assert {
       return new MockRandomMergePolicy(r);
     } else if (r.nextBoolean()) {
       return newTieredMergePolicy(r);
-    } else if (rarely(r) ) { 
-      return newAlcoholicMergePolicy(r, classEnvRule.timeZone);
     }
+    // MRM TODO: need time stuff setup correctly with our SolrTestCase.classEnvRule, not LuceneTestCase
+//    else if (rarely(r) ) {
+//      return newAlcoholicMergePolicy(r, classEnvRule.timeZone);
+//    }
     return newLogMergePolicy(r);
   }
 
@@ -1927,7 +1932,11 @@ public abstract class LuceneTestCase extends Assert {
       } else {
         ret = random.nextBoolean() ? new IndexSearcher(r) : new IndexSearcher(r.getContext());
       }
-      ret.setSimilarity(classEnvRule.similarity);
+      if (classEnvRule.similarity != null) {
+        ret.setSimilarity(classEnvRule.similarity);
+      } else {
+        ret.setSimilarity(new BM25Similarity());
+      }
       return ret;
     } else {
       int threads = 0;
@@ -1967,7 +1976,12 @@ public abstract class LuceneTestCase extends Assert {
             ? new IndexSearcher(r, ex)
             : new IndexSearcher(r.getContext(), ex);
       }
-      ret.setSimilarity(classEnvRule.similarity);
+
+      if (classEnvRule.similarity != null) {
+        ret.setSimilarity(classEnvRule.similarity);
+      } else {
+        ret.setSimilarity(new BM25Similarity());
+      }
       ret.setQueryCachingPolicy(MAYBE_CACHE_POLICY);
       return ret;
     }
diff --git a/lucene/test-framework/src/java/org/apache/lucene/util/TestRuleTemporaryFilesCleanup.java b/lucene/test-framework/src/java/org/apache/lucene/util/TestRuleTemporaryFilesCleanup.java
index 4867554..72efc17 100644
--- a/lucene/test-framework/src/java/org/apache/lucene/util/TestRuleTemporaryFilesCleanup.java
+++ b/lucene/test-framework/src/java/org/apache/lucene/util/TestRuleTemporaryFilesCleanup.java
@@ -108,10 +108,6 @@ final class TestRuleTemporaryFilesCleanup extends TestRuleAdapter {
   @Override
   protected void before() throws Throwable {
     super.before();
-
-    assert tempDirBase == null;
-    fileSystem = initializeFileSystem();
-    javaTempDir = initializeJavaTempDir();
   }
   
   // os/config-independent limit for too many open files
@@ -224,7 +220,7 @@ final class TestRuleTemporaryFilesCleanup extends TestRuleAdapter {
         }
         throw e;
       }
-      if (fileSystem != FileSystems.getDefault()) {
+      if (fileSystem != FileSystems.getDefault() && fileSystem != null) {
         fileSystem.close();
       }
     } else {
@@ -236,6 +232,14 @@ final class TestRuleTemporaryFilesCleanup extends TestRuleAdapter {
   
   Path getPerTestClassTempDir() {
     if (tempDirBase == null) {
+
+      fileSystem = initializeFileSystem();
+      try {
+        javaTempDir = initializeJavaTempDir();
+      } catch (IOException e) {
+        throw new RuntimeException(e);
+      }
+
       RandomizedContext ctx = RandomizedContext.current();
       Class<?> clazz = ctx.getTargetClass();
       String prefix = clazz.getName();
@@ -260,6 +264,7 @@ final class TestRuleTemporaryFilesCleanup extends TestRuleAdapter {
       } while (!success);
 
       tempDirBase = f;
+
       registerToRemoveAfterSuite(tempDirBase);
     }
     return tempDirBase;
diff --git a/solr/contrib/analysis-extras/src/test/org/apache/solr/analysis/TestFoldingMultitermExtrasQuery.java b/solr/contrib/analysis-extras/src/test/org/apache/solr/analysis/TestFoldingMultitermExtrasQuery.java
index b2cdbc2..bf89e1b 100644
--- a/solr/contrib/analysis-extras/src/test/org/apache/solr/analysis/TestFoldingMultitermExtrasQuery.java
+++ b/solr/contrib/analysis-extras/src/test/org/apache/solr/analysis/TestFoldingMultitermExtrasQuery.java
@@ -20,6 +20,7 @@ import java.io.File;
 
 import org.apache.commons.io.FileUtils;
 import org.apache.solr.SolrTestCaseJ4;
+import org.apache.solr.SolrTestUtil;
 import org.junit.BeforeClass;
 import org.junit.Test;
 
@@ -32,8 +33,8 @@ public class TestFoldingMultitermExtrasQuery extends SolrTestCaseJ4 {
 
   @BeforeClass
   public static void beforeTests() throws Exception {
-    File testHome = createTempDir().toFile();
-    FileUtils.copyDirectory(getFile("analysis-extras/solr"), testHome);
+    File testHome = SolrTestUtil.createTempDir().toFile();
+    FileUtils.copyDirectory(SolrTestUtil.getFile("analysis-extras/solr"), testHome);
     initCore("solrconfig-icucollate.xml","schema-folding-extra.xml", testHome.getAbsolutePath());
 
     int idx = 1;
diff --git a/solr/contrib/analysis-extras/src/test/org/apache/solr/schema/TestICUCollationField.java b/solr/contrib/analysis-extras/src/test/org/apache/solr/schema/TestICUCollationField.java
index f164080..a843882 100644
--- a/solr/contrib/analysis-extras/src/test/org/apache/solr/schema/TestICUCollationField.java
+++ b/solr/contrib/analysis-extras/src/test/org/apache/solr/schema/TestICUCollationField.java
@@ -25,6 +25,7 @@ import org.apache.lucene.analysis.util.FilesystemResourceLoader;
 import org.apache.lucene.analysis.util.ResourceLoader;
 import org.apache.lucene.analysis.util.StringMockResourceLoader;
 import org.apache.solr.SolrTestCaseJ4;
+import org.apache.solr.SolrTestUtil;
 import org.junit.BeforeClass;
 
 import com.ibm.icu.text.Collator;
@@ -63,15 +64,15 @@ public class TestICUCollationField extends SolrTestCaseJ4 {
    * So it's preferable to create this file on-the-fly.
    */
   public static String setupSolrHome() throws Exception {
-    String tmpFile = createTempDir().toFile().getAbsolutePath();
+    String tmpFile = SolrTestUtil.createTempDir().toFile().getAbsolutePath();
     // make data and conf dirs
     new File(tmpFile  + "/collection1", "data").mkdirs();
     File confDir = new File(tmpFile + "/collection1", "conf");
     confDir.mkdirs();
     
     // copy over configuration files
-    FileUtils.copyFile(getFile("analysis-extras/solr/collection1/conf/solrconfig-icucollate.xml"), new File(confDir, "solrconfig.xml"));
-    FileUtils.copyFile(getFile("analysis-extras/solr/collection1/conf/schema-icucollate.xml"), new File(confDir, "schema.xml"));
+    FileUtils.copyFile(SolrTestUtil.getFile("analysis-extras/solr/collection1/conf/solrconfig-icucollate.xml"), new File(confDir, "solrconfig.xml"));
+    FileUtils.copyFile(SolrTestUtil.getFile("analysis-extras/solr/collection1/conf/schema-icucollate.xml"), new File(confDir, "schema.xml"));
     
     // generate custom collation rules (DIN 5007-2), saving to customrules.dat
     RuleBasedCollator baseCollator = (RuleBasedCollator) Collator.getInstance(new ULocale("de", "DE"));
diff --git a/solr/contrib/analysis-extras/src/test/org/apache/solr/schema/TestICUCollationFieldDocValues.java b/solr/contrib/analysis-extras/src/test/org/apache/solr/schema/TestICUCollationFieldDocValues.java
index 57b403a..ae84c50 100644
--- a/solr/contrib/analysis-extras/src/test/org/apache/solr/schema/TestICUCollationFieldDocValues.java
+++ b/solr/contrib/analysis-extras/src/test/org/apache/solr/schema/TestICUCollationFieldDocValues.java
@@ -22,6 +22,7 @@ import java.io.FileOutputStream;
 import org.apache.commons.io.FileUtils;
 import org.apache.commons.io.IOUtils;
 import org.apache.solr.SolrTestCaseJ4;
+import org.apache.solr.SolrTestUtil;
 import org.junit.BeforeClass;
 
 import com.ibm.icu.text.Collator;
@@ -60,7 +61,7 @@ public class TestICUCollationFieldDocValues extends SolrTestCaseJ4 {
    * So it's preferable to create this file on-the-fly.
    */
   public static String setupSolrHome() throws Exception {
-    File tmpFile = createTempDir().toFile();
+    File tmpFile = SolrTestUtil.createTempDir().toFile();
     
     // make data and conf dirs
     new File(tmpFile + "/collection1", "data").mkdirs();
@@ -68,8 +69,8 @@ public class TestICUCollationFieldDocValues extends SolrTestCaseJ4 {
     confDir.mkdirs();
     
     // copy over configuration files
-    FileUtils.copyFile(getFile("analysis-extras/solr/collection1/conf/solrconfig-icucollate.xml"), new File(confDir, "solrconfig.xml"));
-    FileUtils.copyFile(getFile("analysis-extras/solr/collection1/conf/schema-icucollate-dv.xml"), new File(confDir, "schema.xml"));
+    FileUtils.copyFile(SolrTestUtil.getFile("analysis-extras/solr/collection1/conf/solrconfig-icucollate.xml"), new File(confDir, "solrconfig.xml"));
+    FileUtils.copyFile(SolrTestUtil.getFile("analysis-extras/solr/collection1/conf/schema-icucollate-dv.xml"), new File(confDir, "schema.xml"));
     
     // generate custom collation rules (DIN 5007-2), saving to customrules.dat
     RuleBasedCollator baseCollator = (RuleBasedCollator) Collator.getInstance(new ULocale("de", "DE"));
diff --git a/solr/contrib/analysis-extras/src/test/org/apache/solr/schema/TestICUCollationFieldOptions.java b/solr/contrib/analysis-extras/src/test/org/apache/solr/schema/TestICUCollationFieldOptions.java
index 0b198b7..18ef453 100644
--- a/solr/contrib/analysis-extras/src/test/org/apache/solr/schema/TestICUCollationFieldOptions.java
+++ b/solr/contrib/analysis-extras/src/test/org/apache/solr/schema/TestICUCollationFieldOptions.java
@@ -18,6 +18,7 @@ package org.apache.solr.schema;
 
 import org.apache.commons.io.FileUtils;
 import org.apache.solr.SolrTestCaseJ4;
+import org.apache.solr.SolrTestUtil;
 import org.junit.BeforeClass;
 
 import java.io.File;
@@ -28,8 +29,8 @@ import java.io.File;
 public class TestICUCollationFieldOptions extends SolrTestCaseJ4 {
   @BeforeClass
   public static void beforeClass() throws Exception {
-    File testHome = createTempDir().toFile();
-    FileUtils.copyDirectory(getFile("analysis-extras/solr"), testHome);
+    File testHome = SolrTestUtil.createTempDir().toFile();
+    FileUtils.copyDirectory(SolrTestUtil.getFile("analysis-extras/solr"), testHome);
     initCore("solrconfig-icucollate.xml","schema-icucollateoptions.xml", testHome.getAbsolutePath());
     // add some docs
     assertU(adoc("id", "1", "text", "foo-bar"));
diff --git a/solr/contrib/analysis-extras/src/test/org/apache/solr/update/processor/TestOpenNLPExtractNamedEntitiesUpdateProcessorFactory.java b/solr/contrib/analysis-extras/src/test/org/apache/solr/update/processor/TestOpenNLPExtractNamedEntitiesUpdateProcessorFactory.java
index 851fea0..771d959 100644
--- a/solr/contrib/analysis-extras/src/test/org/apache/solr/update/processor/TestOpenNLPExtractNamedEntitiesUpdateProcessorFactory.java
+++ b/solr/contrib/analysis-extras/src/test/org/apache/solr/update/processor/TestOpenNLPExtractNamedEntitiesUpdateProcessorFactory.java
@@ -21,6 +21,7 @@ import java.io.File;
 import java.util.Arrays;
 
 import org.apache.commons.io.FileUtils;
+import org.apache.solr.SolrTestUtil;
 import org.apache.solr.common.SolrInputDocument;
 import org.junit.BeforeClass;
 import org.junit.Test;
@@ -29,8 +30,8 @@ public class TestOpenNLPExtractNamedEntitiesUpdateProcessorFactory extends Updat
 
   @BeforeClass
   public static void beforeClass() throws Exception {
-    File testHome = createTempDir().toFile();
-    FileUtils.copyDirectory(getFile("analysis-extras/solr"), testHome);
+    File testHome = SolrTestUtil.createTempDir().toFile();
+    FileUtils.copyDirectory(SolrTestUtil.getFile("analysis-extras/solr"), testHome);
     initCore("solrconfig-opennlp-extract.xml", "schema-opennlp-extract.xml", testHome.getAbsolutePath());
   }
 
diff --git a/solr/contrib/analytics/src/test/org/apache/solr/analytics/ExpressionFactoryTest.java b/solr/contrib/analytics/src/test/org/apache/solr/analytics/ExpressionFactoryTest.java
index 25cd19b..f9b272a 100644
--- a/solr/contrib/analytics/src/test/org/apache/solr/analytics/ExpressionFactoryTest.java
+++ b/solr/contrib/analytics/src/test/org/apache/solr/analytics/ExpressionFactoryTest.java
@@ -20,6 +20,7 @@ import java.util.Arrays;
 import java.util.HashSet;
 import java.util.Set;
 
+import org.apache.lucene.util.LuceneTestCase;
 import org.apache.solr.SolrTestCaseJ4;
 import org.apache.solr.analytics.function.ReductionCollectionManager;
 import org.apache.solr.analytics.value.constant.ConstantValue;
@@ -72,7 +73,7 @@ public class ExpressionFactoryTest extends SolrTestCaseJ4 {
   }
 
   @Test
-  @Nightly
+  @LuceneTestCase.Nightly
   public void userDefinedVariableFunctionTest() {
     ExpressionFactory fact = getExpressionFactory();
 
@@ -176,7 +177,7 @@ public class ExpressionFactoryTest extends SolrTestCaseJ4 {
   }
 
   @Test
-  @Nightly
+  @LuceneTestCase.Nightly
   public void reductionManagerCreationTest() {
     ExpressionFactory fact = getExpressionFactory();
 
diff --git a/solr/contrib/analytics/src/test/org/apache/solr/analytics/SolrAnalyticsTestCase.java b/solr/contrib/analytics/src/test/org/apache/solr/analytics/SolrAnalyticsTestCase.java
index 3d5f25d..94757b3 100644
--- a/solr/contrib/analytics/src/test/org/apache/solr/analytics/SolrAnalyticsTestCase.java
+++ b/solr/contrib/analytics/src/test/org/apache/solr/analytics/SolrAnalyticsTestCase.java
@@ -28,6 +28,7 @@ import java.util.stream.Collectors;
 
 import org.apache.solr.JSONTestUtil;
 import org.apache.solr.SolrTestCaseJ4;
+import org.apache.solr.SolrTestUtil;
 import org.apache.solr.client.solrj.SolrServerException;
 import org.apache.solr.client.solrj.request.CollectionAdminRequest;
 import org.apache.solr.client.solrj.request.QueryRequest;
@@ -56,7 +57,7 @@ public class SolrAnalyticsTestCase extends SolrCloudTestCase {
 
     // Solr Cloud
     configureCluster(4)
-        .addConfig("conf", configset("cloud-analytics"))
+        .addConfig("conf", SolrTestUtil.configset("cloud-analytics"))
         .configure();
 
     CollectionAdminRequest.createCollection(COLLECTIONORALIAS, "conf", 2, 1).process(cluster.getSolrClient());
diff --git a/solr/contrib/analytics/src/test/org/apache/solr/analytics/legacy/LegacyAbstractAnalyticsCloudTest.java b/solr/contrib/analytics/src/test/org/apache/solr/analytics/legacy/LegacyAbstractAnalyticsCloudTest.java
index 8fbf4ef..36004e3 100644
--- a/solr/contrib/analytics/src/test/org/apache/solr/analytics/legacy/LegacyAbstractAnalyticsCloudTest.java
+++ b/solr/contrib/analytics/src/test/org/apache/solr/analytics/legacy/LegacyAbstractAnalyticsCloudTest.java
@@ -22,6 +22,7 @@ import java.util.Collections;
 import java.util.HashSet;
 import java.util.concurrent.TimeoutException;
 
+import org.apache.solr.SolrTestUtil;
 import org.apache.solr.analytics.util.AnalyticsResponseHeadings;
 import org.apache.solr.analytics.util.MedianCalculator;
 import org.apache.solr.analytics.util.OrdinalCalculator;
@@ -45,7 +46,7 @@ public class LegacyAbstractAnalyticsCloudTest extends SolrCloudTestCase {
   @BeforeClass
   public static void setupCollection() throws Exception {
     configureCluster(4)
-        .addConfig("conf", configset("cloud-analytics"))
+        .addConfig("conf", SolrTestUtil.configset("cloud-analytics"))
         .configure();
 
     CollectionAdminRequest.createCollection(COLLECTIONORALIAS, "conf", 2, 1).process(cluster.getSolrClient());
diff --git a/solr/contrib/analytics/src/test/org/apache/solr/analytics/legacy/expression/LegacyExpressionTest.java b/solr/contrib/analytics/src/test/org/apache/solr/analytics/legacy/expression/LegacyExpressionTest.java
index 89fe2c7..dc561ea 100644
--- a/solr/contrib/analytics/src/test/org/apache/solr/analytics/legacy/expression/LegacyExpressionTest.java
+++ b/solr/contrib/analytics/src/test/org/apache/solr/analytics/legacy/expression/LegacyExpressionTest.java
@@ -19,6 +19,7 @@ package org.apache.solr.analytics.legacy.expression;
 import java.time.Instant;
 import java.util.Date;
 
+import org.apache.lucene.util.LuceneTestCase;
 import org.apache.solr.analytics.legacy.LegacyAbstractAnalyticsTest;
 import org.apache.solr.util.DateMathParser;
 import org.junit.BeforeClass;
@@ -51,7 +52,7 @@ public class LegacyExpressionTest extends LegacyAbstractAnalyticsTest {
       assertU(adoc("id", "1000" + j, "int_id", "" + i, "long_ld", "" + l, "float_fd", "" + f,
           "double_dd", "" + d, "date_dtd", dt, "string_sd", s));
 
-      if (usually()) {
+      if (LuceneTestCase.usually()) {
         assertU(commit()); // to have several segments
       }
     }
diff --git a/solr/contrib/analytics/src/test/org/apache/solr/analytics/legacy/expression/LegacyFunctionTest.java b/solr/contrib/analytics/src/test/org/apache/solr/analytics/legacy/expression/LegacyFunctionTest.java
index bdb12df..c48f751 100644
--- a/solr/contrib/analytics/src/test/org/apache/solr/analytics/legacy/expression/LegacyFunctionTest.java
+++ b/solr/contrib/analytics/src/test/org/apache/solr/analytics/legacy/expression/LegacyFunctionTest.java
@@ -17,13 +17,13 @@
 package org.apache.solr.analytics.legacy.expression;
 
 
+import org.apache.lucene.util.LuceneTestCase;
 import org.apache.solr.analytics.legacy.LegacyAbstractAnalyticsTest;
 import org.apache.solr.analytics.legacy.facet.LegacyAbstractAnalyticsFacetTest;
-import org.apache.solr.common.util.IOUtils;
-import org.apache.solr.request.SolrQueryRequest;
 import org.junit.BeforeClass;
 import org.junit.Test;
 
+@LuceneTestCase.Nightly
 public class LegacyFunctionTest extends LegacyAbstractAnalyticsTest {
   static String fileName = "functions.txt";
 
@@ -73,7 +73,7 @@ public class LegacyFunctionTest extends LegacyAbstractAnalyticsTest {
             "concat_first_sd", concat_first, "concat_second_sd", concat_second, "miss_dd", ""+d0 )));
 
 
-      if (usually()) {
+      if (LuceneTestCase.usually()) {
         assertU(commit()); // to have several segments
       }
     }
diff --git a/solr/contrib/clustering/src/java/org/apache/solr/handler/clustering/carrot2/CarrotClusteringEngine.java b/solr/contrib/clustering/src/java/org/apache/solr/handler/clustering/carrot2/CarrotClusteringEngine.java
index 8e1f625..5399b55 100644
--- a/solr/contrib/clustering/src/java/org/apache/solr/handler/clustering/carrot2/CarrotClusteringEngine.java
+++ b/solr/contrib/clustering/src/java/org/apache/solr/handler/clustering/carrot2/CarrotClusteringEngine.java
@@ -332,12 +332,7 @@ public class CarrotClusteringEngine extends SearchClusteringEngine {
         args.put(HighlightParams.SIMPLE_POST, "");
         args.put(HighlightParams.FRAGSIZE, solrParams.getInt(CarrotParams.SUMMARY_FRAGSIZE, solrParams.getInt(HighlightParams.FRAGSIZE, 100)));
         args.put(HighlightParams.SNIPPETS, solrParams.getInt(CarrotParams.SUMMARY_SNIPPETS, solrParams.getInt(HighlightParams.SNIPPETS, 1)));
-        req = new LocalSolrQueryRequest(core, query.toString(), "", 0, 1, args) {
-          @Override
-          public SolrIndexSearcher getSearcher() {
-            return sreq.getSearcher();
-          }
-        };
+        req = new MyLocalSolrQueryRequest(core, query, args, sreq);
       } else {
         log.warn("No highlighter configured, cannot produce summary");
         produceSummary = false;
@@ -562,4 +557,17 @@ public class CarrotClusteringEngine extends SearchClusteringEngine {
     }
   }
 
+  private static class MyLocalSolrQueryRequest extends LocalSolrQueryRequest {
+    private final SolrQueryRequest sreq;
+
+    public MyLocalSolrQueryRequest(SolrCore core, Query query, Map<String,Object> args, SolrQueryRequest sreq) {
+      super(core, query.toString(), "", 0, 1, args);
+      this.sreq = sreq;
+    }
+
+    @Override
+    public SolrIndexSearcher getSearcher() {
+      return sreq.getSearcher();
+    }
+  }
 }
diff --git a/solr/contrib/clustering/src/test/org/apache/solr/handler/clustering/AbstractClusteringTestCase.java b/solr/contrib/clustering/src/test/org/apache/solr/handler/clustering/AbstractClusteringTestCase.java
index ca2f424..912edf2 100644
--- a/solr/contrib/clustering/src/test/org/apache/solr/handler/clustering/AbstractClusteringTestCase.java
+++ b/solr/contrib/clustering/src/test/org/apache/solr/handler/clustering/AbstractClusteringTestCase.java
@@ -20,6 +20,7 @@ import java.util.Map;
 
 import org.apache.commons.io.FileUtils;
 import org.apache.solr.SolrTestCaseJ4;
+import org.apache.solr.SolrTestUtil;
 import org.apache.solr.common.SolrInputDocument;
 import org.junit.BeforeClass;
 
@@ -32,8 +33,8 @@ public abstract class AbstractClusteringTestCase extends SolrTestCaseJ4 {
 
   @BeforeClass
   public static void beforeClass() throws Exception {
-    File testHome = createTempDir().toFile();
-    FileUtils.copyDirectory(getFile("clustering/solr"), testHome);
+    File testHome = SolrTestUtil.createTempDir().toFile();
+    FileUtils.copyDirectory(SolrTestUtil.getFile("clustering/solr"), testHome);
     initCore("solrconfig.xml", "schema.xml", testHome.getAbsolutePath());
     numberOfDocs = 0;
     for (String[] doc : DOCUMENTS) {
diff --git a/solr/contrib/clustering/src/test/org/apache/solr/handler/clustering/DistributedClusteringComponentTest.java b/solr/contrib/clustering/src/test/org/apache/solr/handler/clustering/DistributedClusteringComponentTest.java
index 889eb48..f8aee37 100644
--- a/solr/contrib/clustering/src/test/org/apache/solr/handler/clustering/DistributedClusteringComponentTest.java
+++ b/solr/contrib/clustering/src/test/org/apache/solr/handler/clustering/DistributedClusteringComponentTest.java
@@ -18,6 +18,7 @@ package org.apache.solr.handler.clustering;
 
 import org.apache.solr.BaseDistributedSearchTestCase;
 import org.apache.solr.SolrTestCase;
+import org.apache.solr.SolrTestUtil;
 import org.apache.solr.common.params.CommonParams;
 import org.junit.Ignore;
 import org.junit.Test;
@@ -29,7 +30,7 @@ public class DistributedClusteringComponentTest extends
 
   @Override
   public String getSolrHome() {
-    return getFile("clustering/solr/collection1").getParent();
+    return SolrTestUtil.getFile("clustering/solr/collection1").getParent();
   }
 
   @Test
diff --git a/solr/contrib/dataimporthandler-extras/src/test/org/apache/solr/handler/dataimport/TestTikaEntityProcessor.java b/solr/contrib/dataimporthandler-extras/src/test/org/apache/solr/handler/dataimport/TestTikaEntityProcessor.java
index bdb16a3..a8c0523 100644
--- a/solr/contrib/dataimporthandler-extras/src/test/org/apache/solr/handler/dataimport/TestTikaEntityProcessor.java
+++ b/solr/contrib/dataimporthandler-extras/src/test/org/apache/solr/handler/dataimport/TestTikaEntityProcessor.java
@@ -17,6 +17,7 @@
 package org.apache.solr.handler.dataimport;
 
 import org.apache.lucene.util.LuceneTestCase;
+import org.apache.solr.SolrTestUtil;
 import org.junit.BeforeClass;
 import org.junit.Test;
 
@@ -32,7 +33,7 @@ public class TestTikaEntityProcessor extends AbstractDataImportHandlerTestCase {
   "<dataConfig>" +
   "  <dataSource type=\"BinFileDataSource\"/>" +
   "  <document>" +
-  "    <entity name=\"Tika\" processor=\"TikaEntityProcessor\" url=\"" + getFile("dihextras/solr-word.pdf").getAbsolutePath() + "\" >" +
+  "    <entity name=\"Tika\" processor=\"TikaEntityProcessor\" url=\"" + SolrTestUtil.getFile("dihextras/solr-word.pdf").getAbsolutePath() + "\" >" +
   "      <field column=\"Author\" meta=\"true\" name=\"author\"/>" +
   "      <field column=\"title\" meta=\"true\" name=\"title\"/>" +
   "      <field column=\"text\"/>" +
@@ -44,10 +45,10 @@ public class TestTikaEntityProcessor extends AbstractDataImportHandlerTestCase {
       "<dataConfig>" +
           "  <dataSource type=\"BinFileDataSource\"/>" +
           "  <document>" +
-          "    <entity name=\"Tika\" onError=\"skip\"  processor=\"TikaEntityProcessor\" url=\"" + getFile("dihextras/bad.doc").getAbsolutePath() + "\" >" +
+          "    <entity name=\"Tika\" onError=\"skip\"  processor=\"TikaEntityProcessor\" url=\"" + SolrTestUtil.getFile("dihextras/bad.doc").getAbsolutePath() + "\" >" +
           "<field column=\"content\" name=\"text\"/>" +
           " </entity>" +
-          " <entity name=\"Tika\" processor=\"TikaEntityProcessor\" url=\"" + getFile("dihextras/solr-word.pdf").getAbsolutePath() + "\" >" +
+          " <entity name=\"Tika\" processor=\"TikaEntityProcessor\" url=\"" + SolrTestUtil.getFile("dihextras/solr-word.pdf").getAbsolutePath() + "\" >" +
           "      <field column=\"text\"/>" +
           "</entity>" +
           "  </document>" +
@@ -57,8 +58,7 @@ public class TestTikaEntityProcessor extends AbstractDataImportHandlerTestCase {
       "<dataConfig>" +
           "  <dataSource type=\"BinFileDataSource\"/>" +
           "  <document>" +
-          "    <entity name=\"Tika\" processor=\"TikaEntityProcessor\" url=\"" +
-          getFile("dihextras/test_jpeg.jpg").getAbsolutePath() + "\" spatialMetadataField=\"home\">" +
+          "    <entity name=\"Tika\" processor=\"TikaEntityProcessor\" url=\"" + SolrTestUtil.getFile("dihextras/test_jpeg.jpg").getAbsolutePath() + "\" spatialMetadataField=\"home\">" +
           "      <field column=\"text\"/>" +
           "     </entity>" +
           "  </document>" +
@@ -68,7 +68,7 @@ public class TestTikaEntityProcessor extends AbstractDataImportHandlerTestCase {
       "<dataConfig>" +
           "  <dataSource type=\"BinFileDataSource\"/>" +
           "  <document>" +
-          "    <entity name=\"Tika\" processor=\"TikaEntityProcessor\" url=\"" + getFile("dihextras/test_vsdx.vsdx").getAbsolutePath() + "\" >" +
+          "    <entity name=\"Tika\" processor=\"TikaEntityProcessor\" url=\"" + SolrTestUtil.getFile("dihextras/test_vsdx.vsdx").getAbsolutePath() + "\" >" +
           "      <field column=\"text\"/>" +
           "     </entity>" +
           "  </document>" +
@@ -118,9 +118,9 @@ public class TestTikaEntityProcessor extends AbstractDataImportHandlerTestCase {
 
   @BeforeClass
   public static void beforeClass() throws Exception {
-    assumeFalse("This test fails on UNIX with Turkish default locale (https://issues.apache.org/jira/browse/SOLR-6387)",
+    LuceneTestCase.assumeFalse("This test fails on UNIX with Turkish default locale (https://issues.apache.org/jira/browse/SOLR-6387)",
         new Locale("tr").getLanguage().equals(Locale.getDefault().getLanguage()));
-    initCore("dataimport-solrconfig.xml", "dataimport-schema-no-unique-key.xml", getFile("dihextras/solr").getAbsolutePath());
+    initCore("dataimport-solrconfig.xml", "dataimport-schema-no-unique-key.xml", SolrTestUtil.getFile("dihextras/solr").getAbsolutePath());
   }
 
   @Test
@@ -177,7 +177,7 @@ public class TestTikaEntityProcessor extends AbstractDataImportHandlerTestCase {
             "  <dataSource type='BinFileDataSource'/>" +
             "  <document>" +
             "    <entity name='Tika' format='xml' processor='TikaEntityProcessor' " +
-            "       url='" + getFile("dihextras/structured.html").getAbsolutePath() + "' " +
+            "       url='" + SolrTestUtil.getFile("dihextras/structured.html").getAbsolutePath() + "' " +
             ((htmlMapper == null) ? "" : (" htmlMapper='" + htmlMapper + "'")) + ">" +
             "      <field column='text'/>" +
             "     </entity>" +
@@ -210,8 +210,7 @@ public class TestTikaEntityProcessor extends AbstractDataImportHandlerTestCase {
         "<dataConfig>" +
             "  <dataSource type=\"BinFileDataSource\"/>" +
             "  <document>" +
-            "    <entity name=\"Tika\" processor=\"TikaEntityProcessor\" url=\"" +
-                    getFile("dihextras/test_recursive_embedded.docx").getAbsolutePath() + "\" " +
+            "    <entity name=\"Tika\" processor=\"TikaEntityProcessor\" url=\"" + SolrTestUtil.getFile("dihextras/test_recursive_embedded.docx").getAbsolutePath() + "\" " +
             "       extractEmbedded=\""+extractEmbedded+"\">" +
             "      <field column=\"Author\" meta=\"true\" name=\"author\"/>" +
             "      <field column=\"title\" meta=\"true\" name=\"title\"/>" +
diff --git a/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/DataImportHandler.java b/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/DataImportHandler.java
index a657ab4..29b04c4 100644
--- a/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/DataImportHandler.java
+++ b/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/DataImportHandler.java
@@ -262,17 +262,7 @@ public class DataImportHandler extends RequestHandlerBase implements
             "Unable to load Writer implementation:" + writerClassStr, e);
       }
     } else {
-      return new SolrWriter(processor, req) {
-        @Override
-        public boolean upload(SolrInputDocument document) {
-          try {
-            return super.upload(document);
-          } catch (RuntimeException e) {
-            log.error("Exception while adding: {}", document, e);
-            return false;
-          }
-        }
-      };
+      return new MySolrWriter(processor, req);
     }
   }
 
@@ -312,4 +302,20 @@ public class DataImportHandler extends RequestHandlerBase implements
   }
 
   public static final String ENABLE_DEBUG = "enableDebug";
+
+  private static class MySolrWriter extends SolrWriter {
+    public MySolrWriter(UpdateRequestProcessor processor, SolrQueryRequest req) {
+      super(processor, req);
+    }
+
+    @Override
+    public boolean upload(SolrInputDocument document) {
+      try {
+        return super.upload(document);
+      } catch (RuntimeException e) {
+        log.error("Exception while adding: {}", document, e);
+        return false;
+      }
+    }
+  }
 }
diff --git a/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/DocBuilder.java b/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/DocBuilder.java
index 0f8dd6e..7c5e3c7 100644
--- a/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/DocBuilder.java
+++ b/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/DocBuilder.java
@@ -184,12 +184,7 @@ public class DocBuilder {
       dataImporter.store(DataImporter.STATUS_MSGS, statusMessages);
       config = dataImporter.getConfig();
       final AtomicLong startTime = new AtomicLong(System.nanoTime());
-      statusMessages.put(TIME_ELAPSED, new Object() {
-        @Override
-        public String toString() {
-          return getTimeElapsedSince(startTime.get());
-        }
-      });
+      statusMessages.put(TIME_ELAPSED, new MyObject(startTime));
 
       statusMessages.put(DataImporter.MSG.TOTAL_QUERIES_EXECUTED,
               importStatistics.queryCount);
@@ -1001,4 +996,17 @@ public class DocBuilder {
 
   public static final String LAST_INDEX_TIME = "last_index_time";
   public static final String INDEX_START_TIME = "index_start_time";
+
+  private static class MyObject {
+    private final AtomicLong startTime;
+
+    public MyObject(AtomicLong startTime) {
+      this.startTime = startTime;
+    }
+
+    @Override
+    public String toString() {
+      return getTimeElapsedSince(startTime.get());
+    }
+  }
 }
diff --git a/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/ScriptTransformer.java b/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/ScriptTransformer.java
index fe848b1..2841f6c 100644
--- a/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/ScriptTransformer.java
+++ b/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/ScriptTransformer.java
@@ -100,13 +100,7 @@ public class ScriptTransformer extends Transformer {
     }
     try {
       try {
-        AccessController.doPrivileged(new PrivilegedExceptionAction<Void>() {
-          @Override
-          public Void run() throws ScriptException  {
-            scriptEngine.eval(scriptText);
-            return null;
-          }
-        }, SCRIPT_SANDBOX);
+        AccessController.doPrivileged(new VoidPrivilegedExceptionAction(scriptEngine, scriptText), SCRIPT_SANDBOX);
       } catch (PrivilegedActionException e) {
         throw (ScriptException) e.getException();
       }
@@ -128,4 +122,19 @@ public class ScriptTransformer extends Transformer {
   private static final AccessControlContext SCRIPT_SANDBOX =
       new AccessControlContext(new ProtectionDomain[] { new ProtectionDomain(null, null) });
 
+  private static class VoidPrivilegedExceptionAction implements PrivilegedExceptionAction<Void> {
+    private final ScriptEngine scriptEngine;
+    private final String scriptText;
+
+    public VoidPrivilegedExceptionAction(ScriptEngine scriptEngine, String scriptText) {
+      this.scriptEngine = scriptEngine;
+      this.scriptText = scriptText;
+    }
+
+    @Override
+    public Void run() throws ScriptException {
+      scriptEngine.eval(scriptText);
+      return null;
+    }
+  }
 }
diff --git a/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/AbstractDataImportHandlerTestCase.java b/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/AbstractDataImportHandlerTestCase.java
index ff8cbdc..9c7e6a1 100644
--- a/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/AbstractDataImportHandlerTestCase.java
+++ b/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/AbstractDataImportHandlerTestCase.java
@@ -25,6 +25,7 @@ import java.util.Map;
 
 import org.apache.commons.io.FileUtils;
 import org.apache.solr.SolrTestCaseJ4;
+import org.apache.solr.SolrTestUtil;
 import org.apache.solr.common.util.NamedList;
 import org.apache.solr.common.util.SuppressForbidden;
 import org.apache.solr.common.util.Utils;
@@ -56,8 +57,8 @@ public abstract class AbstractDataImportHandlerTestCase extends
 
   // note, a little twisted that we shadow this static method
   public static void initCore(String config, String schema) throws Exception {
-    File testHome = createTempDir("core-home").toFile();
-    FileUtils.copyDirectory(getFile("dih/solr"), testHome);
+    File testHome = SolrTestUtil.createTempDir("core-home").toFile();
+    FileUtils.copyDirectory(SolrTestUtil.getFile("dih/solr"), testHome);
     initCore(config, schema, testHome.getAbsolutePath());
   }
 
@@ -96,7 +97,7 @@ public abstract class AbstractDataImportHandlerTestCase extends
    */
   protected File redirectTempProperties(DataImporter di) {
     try {
-      File tempFile = createTempFile().toFile();
+      File tempFile = SolrTestUtil.createTempFile().toFile();
       di.getConfig().getPropertyWriter().getParameters()
         .put(SimplePropertiesWriter.FILENAME, tempFile.getAbsolutePath());
       return tempFile;
diff --git a/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/AbstractSqlEntityProcessorTestCase.java b/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/AbstractSqlEntityProcessorTestCase.java
index ee5ec82..6a2b91e 100644
--- a/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/AbstractSqlEntityProcessorTestCase.java
+++ b/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/AbstractSqlEntityProcessorTestCase.java
@@ -17,6 +17,7 @@
 package org.apache.solr.handler.dataimport;
 
 import junit.framework.Assert;
+import org.apache.solr.SolrTestUtil;
 import org.apache.solr.common.util.SuppressForbidden;
 import org.junit.After;
 import org.junit.Before;
@@ -67,7 +68,7 @@ public abstract class AbstractSqlEntityProcessorTestCase extends
   
   @Before
   public void beforeSqlEntitiyProcessorTestCase() throws Exception {
-    File tmpdir = createTempDir().toFile();
+    File tmpdir = SolrTestUtil.createTempDir().toFile();
     fileLocation = tmpdir.getPath();
     fileName = "the.properties";
   } 
diff --git a/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestContentStreamDataSource.java b/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestContentStreamDataSource.java
index 0d1c474..0074dc7 100644
--- a/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestContentStreamDataSource.java
+++ b/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestContentStreamDataSource.java
@@ -18,6 +18,7 @@ package org.apache.solr.handler.dataimport;
 
 import org.apache.commons.io.FileUtils;
 import org.apache.lucene.util.LuceneTestCase;
+import org.apache.solr.SolrTestUtil;
 import org.apache.solr.client.solrj.embedded.JettySolrRunner;
 import org.apache.solr.client.solrj.impl.Http2SolrClient;
 import org.apache.solr.client.solrj.request.DirectXmlRequest;
@@ -156,7 +157,7 @@ public class TestContentStreamDataSource extends AbstractDataImportHandlerTestCa
 
 
     public void setUp() throws Exception {
-      homeDir = createTempDir("inst").toFile();
+      homeDir = SolrTestUtil.createTempDir("inst").toFile();
       dataDir = new File(homeDir + "/collection1", "data");
       confDir = new File(homeDir + "/collection1", "conf");
 
@@ -164,14 +165,14 @@ public class TestContentStreamDataSource extends AbstractDataImportHandlerTestCa
       dataDir.mkdirs();
       confDir.mkdirs();
 
-      FileUtils.copyFile(getFile(getSolrXmlFile()), new File(homeDir, "solr.xml"));
+      FileUtils.copyFile(SolrTestUtil.getFile(getSolrXmlFile()), new File(homeDir, "solr.xml"));
       File f = new File(confDir, "solrconfig.xml");
-      FileUtils.copyFile(getFile(getSolrConfigFile()), f);
+      FileUtils.copyFile(SolrTestUtil.getFile(getSolrConfigFile()), f);
       f = new File(confDir, "schema.xml");
 
-      FileUtils.copyFile(getFile(getSchemaFile()), f);
+      FileUtils.copyFile(SolrTestUtil.getFile(getSchemaFile()), f);
       f = new File(confDir, "data-config.xml");
-      FileUtils.copyFile(getFile(CONF_DIR + "dataconfig-contentstream.xml"), f);
+      FileUtils.copyFile(SolrTestUtil.getFile(CONF_DIR + "dataconfig-contentstream.xml"), f);
 
       Files.createFile(homeDir.toPath().resolve("collection1/core.properties"));
     }
diff --git a/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestDocBuilder2.java b/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestDocBuilder2.java
index 7cc3a0c..aae0232 100644
--- a/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestDocBuilder2.java
+++ b/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestDocBuilder2.java
@@ -21,6 +21,7 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
 
+import org.apache.solr.SolrTestUtil;
 import org.apache.solr.request.LocalSolrQueryRequest;
 import org.junit.BeforeClass;
 import org.junit.Ignore;
@@ -278,7 +279,7 @@ public class TestDocBuilder2 extends AbstractDataImportHandlerTestCase {
   @Test
   @Ignore("Fix Me. See SOLR-4103.")
   public void testFileListEntityProcessor_lastIndexTime() throws Exception  {
-    File tmpdir = createTempDir().toFile();
+    File tmpdir = SolrTestUtil.createTempDir().toFile();
 
     @SuppressWarnings({"unchecked"})
     Map<String, String> params = createMap("baseDir", tmpdir.getAbsolutePath());
diff --git a/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestFileListEntityProcessor.java b/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestFileListEntityProcessor.java
index c4b4ab0..b10c9d1 100644
--- a/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestFileListEntityProcessor.java
+++ b/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestFileListEntityProcessor.java
@@ -29,6 +29,7 @@ import java.util.Locale;
 import java.util.Map;
 import java.util.Set;
 
+import org.apache.solr.SolrTestUtil;
 import org.apache.solr.common.util.SuppressForbidden;
 import org.junit.Test;
 
@@ -45,7 +46,7 @@ public class TestFileListEntityProcessor extends AbstractDataImportHandlerTestCa
   @Test
   @SuppressWarnings("unchecked")
   public void testSimple() throws IOException {
-    File tmpdir = createTempDir().toFile();
+    File tmpdir = SolrTestUtil.createTempDir().toFile();
 
     createFile(tmpdir, "a.xml", "a.xml".getBytes(StandardCharsets.UTF_8), false);
     createFile(tmpdir, "b.xml", "b.xml".getBytes(StandardCharsets.UTF_8), false);
@@ -71,7 +72,7 @@ public class TestFileListEntityProcessor extends AbstractDataImportHandlerTestCa
   @Test
   @SuppressWarnings({"unchecked"})
   public void testBiggerSmallerFiles() throws IOException {
-    File tmpdir = createTempDir().toFile();
+    File tmpdir = SolrTestUtil.createTempDir().toFile();
 
     long minLength = Long.MAX_VALUE;
     String smallestFile = "";
@@ -142,7 +143,7 @@ public class TestFileListEntityProcessor extends AbstractDataImportHandlerTestCa
   @Test
   @SuppressWarnings({"unchecked"})
   public void testNTOT() throws IOException {
-    File tmpdir = createTempDir().toFile();
+    File tmpdir = SolrTestUtil.createTempDir().toFile();
 
     createFile(tmpdir, "a.xml", "a.xml".getBytes(StandardCharsets.UTF_8), true);
     createFile(tmpdir, "b.xml", "b.xml".getBytes(StandardCharsets.UTF_8), true);
@@ -177,7 +178,7 @@ public class TestFileListEntityProcessor extends AbstractDataImportHandlerTestCa
 
   @Test
   public void testRECURSION() throws IOException {
-    File tmpdir = createTempDir().toFile();
+    File tmpdir = SolrTestUtil.createTempDir().toFile();
     File childdir = new File(tmpdir + "/child" );
     childdir.mkdir();
     createFile(childdir, "a.xml", "a.xml".getBytes(StandardCharsets.UTF_8), true);
diff --git a/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestFileListWithLineEntityProcessor.java b/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestFileListWithLineEntityProcessor.java
index 618c89e..1415d65 100644
--- a/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestFileListWithLineEntityProcessor.java
+++ b/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestFileListWithLineEntityProcessor.java
@@ -19,7 +19,7 @@ package org.apache.solr.handler.dataimport;
 import java.io.File;
 import java.nio.charset.StandardCharsets;
 
-import org.apache.lucene.util.LuceneTestCase;
+import org.apache.solr.SolrTestUtil;
 import org.apache.solr.request.LocalSolrQueryRequest;
 import org.junit.BeforeClass;
 
@@ -30,7 +30,7 @@ public class TestFileListWithLineEntityProcessor extends AbstractDataImportHandl
   }
   
   public void test() throws Exception {
-    File tmpdir = createTempDir(LuceneTestCase.getTestClass().getSimpleName()).toFile();
+    File tmpdir = SolrTestUtil.createTempDir(SolrTestUtil.getTestName()).toFile();
     createFile(tmpdir, "a.txt", "a line one\na line two\na line three".getBytes(StandardCharsets.UTF_8), false);
     createFile(tmpdir, "b.txt", "b line one\nb line two".getBytes(StandardCharsets.UTF_8), false);
     createFile(tmpdir, "c.txt", "c line one\nc line two\nc line three\nc line four".getBytes(StandardCharsets.UTF_8), false);
diff --git a/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestHierarchicalDocBuilder.java b/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestHierarchicalDocBuilder.java
index 9a230be..901f714 100644
--- a/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestHierarchicalDocBuilder.java
+++ b/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestHierarchicalDocBuilder.java
@@ -35,6 +35,8 @@ import org.apache.lucene.search.join.BitSetProducer;
 import org.apache.lucene.search.join.QueryBitSetProducer;
 import org.apache.lucene.search.join.ScoreMode;
 import org.apache.lucene.search.join.ToParentBlockJoinQuery;
+import org.apache.lucene.util.LuceneTestCase;
+import org.apache.solr.SolrTestUtil;
 import org.apache.solr.common.util.StrUtils;
 import org.apache.solr.handler.dataimport.config.ConfigNameConstants;
 import org.apache.solr.request.SolrQueryRequest;
@@ -111,7 +113,7 @@ public class TestHierarchicalDocBuilder extends AbstractDataImportHandlerTestCas
   }
 
   @Test
-  @AwaitsFix(bugUrl = "https://issues.apache.org/jira/browse/SOLR-12801") // this test fails easily under beasting
+  @LuceneTestCase.AwaitsFix(bugUrl = "https://issues.apache.org/jira/browse/SOLR-12801") // this test fails easily under beasting
   public void testThreeLevelHierarchy() throws Exception {
     int parentsNum = 3; //fixed for simplicity of test
     int childrenNum = 0;
@@ -137,7 +139,7 @@ public class TestHierarchicalDocBuilder extends AbstractDataImportHandlerTestCas
     final String childId = childrenIds.get(0);
     String description = "grandchild of first parent, child of " + childId + " child";
     select = "select * from GRANDCHILD where parent_id='" + childId + "'";
-    List<String> grandChildrenIds = createDataIterator(select, grandChildType, description, atLeast(2));
+    List<String> grandChildrenIds = createDataIterator(select, grandChildType, description, SolrTestUtil.atLeast(2));
     grandChildrenNum += grandChildrenIds.size();
     
     // grand children of first parent second child
@@ -146,7 +148,7 @@ public class TestHierarchicalDocBuilder extends AbstractDataImportHandlerTestCas
       description = "grandchild of first parent, child of " + childId2 + " child";
       select = "select * from GRANDCHILD where parent_id='" + childId2 + "'";
     }
-    final List<String> grandChildrenIds2 = createDataIterator(select, grandChildType, description, atLeast(2));
+    final List<String> grandChildrenIds2 = createDataIterator(select, grandChildType, description, SolrTestUtil.atLeast(2));
     grandChildrenNum += grandChildrenIds2.size();
     
     List<String> allGrandChildrenIds = new ArrayList<>(grandChildrenIds);
@@ -156,7 +158,7 @@ public class TestHierarchicalDocBuilder extends AbstractDataImportHandlerTestCas
     
     // parent 2 children (no grand children)   
     select = "select * from CHILD where parent_id='" + parentId2 + "'";
-    childrenIds = createDataIterator(select, childType, "child of second parent", atLeast(2));
+    childrenIds = createDataIterator(select, childType, "child of second parent", SolrTestUtil.atLeast(2));
     childrenNum += childrenIds.size();
     
     // parent 3 has no children and grand children
diff --git a/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestJdbcDataSource.java b/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestJdbcDataSource.java
index 5d89c19..274a271 100644
--- a/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestJdbcDataSource.java
+++ b/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestJdbcDataSource.java
@@ -34,6 +34,8 @@ import java.util.List;
 import java.util.Map;
 import java.util.Properties;
 
+import org.apache.solr.SolrTestCaseUtil;
+import org.apache.solr.SolrTestUtil;
 import org.apache.solr.common.util.SuppressForbidden;
 import org.apache.solr.handler.dataimport.JdbcDataSource.ResultSetIterator;
 import org.junit.After;
@@ -211,8 +213,7 @@ public class TestJdbcDataSource extends AbstractDataImportHandlerTestCase {
     SQLException sqlException = new SQLException("fake");
     when(dataSource.getConnection()).thenThrow(sqlException);
 
-    SQLException ex = expectThrows(SQLException.class,
-        () -> jdbcDataSource.createConnectionFactory(context, props).call());
+    SQLException ex = SolrTestCaseUtil.expectThrows(SQLException.class, () -> jdbcDataSource.createConnectionFactory(context, props).call());
     assertSame(sqlException, ex);
 
     verify(dataSource).getConnection();
@@ -228,8 +229,7 @@ public class TestJdbcDataSource extends AbstractDataImportHandlerTestCase {
     when(dataSource.getConnection()).thenReturn(connection);
     doThrow(sqlException).when(connection).setAutoCommit(false);
 
-    DataImportHandlerException ex = expectThrows(DataImportHandlerException.class,
-        () -> jdbcDataSource.createConnectionFactory(context, props).call());
+    DataImportHandlerException ex = SolrTestCaseUtil.expectThrows(DataImportHandlerException.class, () -> jdbcDataSource.createConnectionFactory(context, props).call());
     assertSame(sqlException, ex.getCause());
 
     verify(dataSource).getConnection();
@@ -252,8 +252,7 @@ public class TestJdbcDataSource extends AbstractDataImportHandlerTestCase {
         .thenReturn(statement);
     when(statement.execute("query")).thenThrow(sqlException);
 
-    DataImportHandlerException ex = expectThrows(DataImportHandlerException.class,
-        () -> jdbcDataSource.getData("query"));
+    DataImportHandlerException ex = SolrTestCaseUtil.expectThrows(DataImportHandlerException.class, () -> jdbcDataSource.getData("query"));
     assertSame(sqlException, ex.getCause());
 
     verify(dataSource).getConnection();
@@ -597,7 +596,7 @@ public class TestJdbcDataSource extends AbstractDataImportHandlerTestCase {
   }
   
   private String createEncryptionKeyFile() throws IOException {
-    File tmpdir = createTempDir().toFile();
+    File tmpdir = SolrTestUtil.createTempDir().toFile();
     byte[] content = "secret".getBytes(StandardCharsets.UTF_8);
     createFile(tmpdir, "enckeyfile.txt", content, false);
     return new File(tmpdir, "enckeyfile.txt").getAbsolutePath();
diff --git a/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestJdbcDataSourceConvertType.java b/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestJdbcDataSourceConvertType.java
index e4576c8..e5d77b3 100644
--- a/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestJdbcDataSourceConvertType.java
+++ b/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestJdbcDataSourceConvertType.java
@@ -16,10 +16,6 @@
  */
 package org.apache.solr.handler.dataimport;
 
-import com.carrotsearch.randomizedtesting.annotations.ThreadLeakAction;
-import com.carrotsearch.randomizedtesting.annotations.ThreadLeakLingering;
-import com.carrotsearch.randomizedtesting.annotations.ThreadLeakScope;
-import com.carrotsearch.randomizedtesting.annotations.ThreadLeakZombies;
 import org.apache.lucene.util.LuceneTestCase;
 import org.junit.BeforeClass;
 
@@ -43,7 +39,7 @@ public class TestJdbcDataSourceConvertType extends AbstractDataImportHandlerTest
 
   public void testConvertType() throws Throwable {
     final Locale loc = Locale.getDefault();
-    assumeFalse("Derby is not happy with locale sr-Latn-*",
+    LuceneTestCase.assumeFalse("Derby is not happy with locale sr-Latn-*",
         Objects.equals(new Locale("sr").getLanguage(), loc.getLanguage()) &&
         Objects.equals("Latn", loc.getScript()));
 
diff --git a/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestNonWritablePersistFile.java b/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestNonWritablePersistFile.java
index ee8979b..5a88390 100644
--- a/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestNonWritablePersistFile.java
+++ b/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestNonWritablePersistFile.java
@@ -21,6 +21,8 @@ import java.util.ArrayList;
 import java.util.List;
 
 import org.apache.commons.io.FileUtils;
+import org.apache.lucene.util.LuceneTestCase;
+import org.apache.solr.SolrTestUtil;
 import org.apache.solr.core.SolrCore;
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
@@ -55,8 +57,8 @@ public class TestNonWritablePersistFile extends AbstractDataImportHandlerTestCas
 
   @BeforeClass
   public static void createTempSolrHomeAndCore() throws Exception {
-    tmpSolrHome = createTempDir().toFile().getAbsolutePath();
-    FileUtils.copyDirectory(getFile("dih/solr"), new File(tmpSolrHome).getAbsoluteFile());
+    tmpSolrHome = SolrTestUtil.createTempDir().toFile().getAbsolutePath();
+    FileUtils.copyDirectory(SolrTestUtil.getFile("dih/solr"), new File(tmpSolrHome).getAbsoluteFile());
     initCore("dataimport-solrconfig.xml", "dataimport-schema.xml", 
              new File(tmpSolrHome).getAbsolutePath());
     
@@ -70,9 +72,9 @@ public class TestNonWritablePersistFile extends AbstractDataImportHandlerTestCas
     filePath += "dataimport.properties";
     f = new File(filePath);
     // execute the test only if we are able to set file to read only mode
-    assumeTrue("No dataimport.properties file", f.exists() || f.createNewFile());
-    assumeTrue("dataimport.properties can't be set read only", f.setReadOnly());
-    assumeFalse("dataimport.properties is still writable even though " + 
+    LuceneTestCase.assumeTrue("No dataimport.properties file", f.exists() || f.createNewFile());
+    LuceneTestCase.assumeTrue("dataimport.properties can't be set read only", f.setReadOnly());
+    LuceneTestCase.assumeFalse("dataimport.properties is still writable even though " +
                 "marked readonly - test running as superuser?", f.canWrite());
   }
   
diff --git a/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestScriptTransformer.java b/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestScriptTransformer.java
index 44418ea..bd62b83 100644
--- a/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestScriptTransformer.java
+++ b/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestScriptTransformer.java
@@ -16,6 +16,8 @@
  */
 package org.apache.solr.handler.dataimport;
 
+import org.apache.lucene.util.LuceneTestCase;
+import org.apache.solr.SolrTestCaseUtil;
 import org.apache.solr.handler.dataimport.config.DIHConfiguration;
 import org.apache.xerces.jaxp.DocumentBuilderFactoryImpl;
 import org.junit.Test;
@@ -50,8 +52,8 @@ public class TestScriptTransformer extends AbstractDataImportHandlerTestCase {
       sep.init(context);
       sep.applyTransformer(map);
       assertEquals("Hello Scott", map.get("name").toString());
-    } catch (DataImportHandlerException e) {    
-      assumeFalse("This JVM does not have JavaScript installed.  Test Skipped.", e
+    } catch (DataImportHandlerException e) {
+      LuceneTestCase.assumeFalse("This JVM does not have JavaScript installed.  Test Skipped.", e
           .getMessage().startsWith("Cannot load Script Engine for language"));
       throw e;
     }
@@ -59,7 +61,7 @@ public class TestScriptTransformer extends AbstractDataImportHandlerTestCase {
 
   @Test
   public void testEvil() {
-    assumeTrue("This test only works with security manager", System.getSecurityManager() != null);
+    LuceneTestCase.assumeTrue("This test only works with security manager", System.getSecurityManager() != null);
     String script = "function f1(row) {"
             + "var os = Packages.java.lang.System.getProperty('os.name');"
             + "row.put('name', os);"
@@ -71,10 +73,10 @@ public class TestScriptTransformer extends AbstractDataImportHandlerTestCase {
     map.put("name", "Scott");
     EntityProcessorWrapper sep = new EntityProcessorWrapper(new SqlEntityProcessor(), null, null);
     sep.init(context);
-    DataImportHandlerException expected = expectThrows(DataImportHandlerException.class, () -> {
+    DataImportHandlerException expected = SolrTestCaseUtil.expectThrows(DataImportHandlerException.class, () -> {
       sep.applyTransformer(map);
     });
-    assumeFalse("This JVM does not have JavaScript installed.  Test Skipped.",
+    LuceneTestCase.assumeFalse("This JVM does not have JavaScript installed.  Test Skipped.",
         expected.getMessage().startsWith("Cannot load Script Engine for language"));
     assertTrue(expected.getCause().toString(), SecurityException.class.isAssignableFrom(expected.getCause().getClass()));
   }
@@ -105,8 +107,8 @@ public class TestScriptTransformer extends AbstractDataImportHandlerTestCase {
       sep.init(context);
       sep.applyTransformer(map);
       assertEquals("Hello Scott", map.get("name").toString());
-    } catch (DataImportHandlerException e) {   
-      assumeFalse("This JVM does not have JavaScript installed.  Test Skipped.", e
+    } catch (DataImportHandlerException e) {
+      LuceneTestCase.assumeFalse("This JVM does not have JavaScript installed.  Test Skipped.", e
           .getMessage().startsWith("Cannot load Script Engine for language"));
       throw e;
     }
@@ -121,8 +123,8 @@ public class TestScriptTransformer extends AbstractDataImportHandlerTestCase {
       DataImporter di = new DataImporter();
       DIHConfiguration dc = di.readFromXml(document);
       assertTrue(dc.getScript().getText().indexOf("checkNextToken") > -1);
-    } catch (DataImportHandlerException e) {    
-      assumeFalse("This JVM does not have JavaScript installed.  Test Skipped.", e
+    } catch (DataImportHandlerException e) {
+      LuceneTestCase.assumeFalse("This JVM does not have JavaScript installed.  Test Skipped.", e
           .getMessage().startsWith("Cannot load Script Engine for language"));
       throw e;
     }
@@ -150,8 +152,8 @@ public class TestScriptTransformer extends AbstractDataImportHandlerTestCase {
       map.put("nextToken", "");
       sep.applyTransformer(map);
       assertNull(map.get("$hasMore"));
-    } catch (DataImportHandlerException e) {    
-      assumeFalse("This JVM does not have JavaScript installed.  Test Skipped.", e
+    } catch (DataImportHandlerException e) {
+      LuceneTestCase.assumeFalse("This JVM does not have JavaScript installed.  Test Skipped.", e
           .getMessage().startsWith("Cannot load Script Engine for language"));
       throw e;
     }
diff --git a/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestSimplePropertiesWriter.java b/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestSimplePropertiesWriter.java
index 7f42abe..eca2110 100644
--- a/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestSimplePropertiesWriter.java
+++ b/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestSimplePropertiesWriter.java
@@ -27,6 +27,7 @@ import java.util.Locale;
 import java.util.Map;
 
 import org.apache.lucene.util.LuceneTestCase;
+import org.apache.solr.SolrTestUtil;
 import org.apache.solr.common.util.SuppressForbidden;
 import org.junit.Before;
 import org.junit.Test;
@@ -46,7 +47,7 @@ public class TestSimplePropertiesWriter extends AbstractDIHJdbcTestCase {
   
   @Before
   public void spwBefore() throws Exception {
-    fileLocation = createTempDir().toFile().getAbsolutePath();
+    fileLocation = SolrTestUtil.createTempDir().toFile().getAbsolutePath();
     fileName = "the.properties";
   }
 
diff --git a/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestSolrEntityProcessorEndToEnd.java b/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestSolrEntityProcessorEndToEnd.java
index 1ba9469..4600089 100644
--- a/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestSolrEntityProcessorEndToEnd.java
+++ b/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestSolrEntityProcessorEndToEnd.java
@@ -32,6 +32,7 @@ import java.util.Properties;
 import org.apache.commons.io.FileUtils;
 import org.apache.lucene.util.IOUtils;
 import org.apache.lucene.util.LuceneTestCase;
+import org.apache.solr.SolrTestUtil;
 import org.apache.solr.client.solrj.SolrServerException;
 import org.apache.solr.client.solrj.embedded.JettySolrRunner;
 import org.apache.solr.client.solrj.impl.Http2SolrClient;
@@ -340,7 +341,7 @@ public class TestSolrEntityProcessorEndToEnd extends AbstractDataImportHandlerTe
     }
 
     public void setUp() throws Exception {
-      homeDir = createTempDir().toFile();
+      homeDir = SolrTestUtil.createTempDir().toFile();
       dataDir = new File(homeDir + "/collection1", "data");
       confDir = new File(homeDir + "/collection1", "conf");
       
@@ -348,14 +349,14 @@ public class TestSolrEntityProcessorEndToEnd extends AbstractDataImportHandlerTe
       dataDir.mkdirs();
       confDir.mkdirs();
 
-      FileUtils.copyFile(getFile(getSolrXmlFile()), new File(homeDir, "solr.xml"));
+      FileUtils.copyFile(SolrTestUtil.getFile(getSolrXmlFile()), new File(homeDir, "solr.xml"));
       File f = new File(confDir, "solrconfig.xml");
-      FileUtils.copyFile(getFile(getSolrConfigFile()), f);
+      FileUtils.copyFile(SolrTestUtil.getFile(getSolrConfigFile()), f);
       f = new File(confDir, "schema.xml");
       
-      FileUtils.copyFile(getFile(getSchemaFile()), f);
+      FileUtils.copyFile(SolrTestUtil.getFile(getSchemaFile()), f);
       f = new File(confDir, "data-config.xml");
-      FileUtils.copyFile(getFile(SOURCE_CONF_DIR + "dataconfig-contentstream.xml"), f);
+      FileUtils.copyFile(SolrTestUtil.getFile(SOURCE_CONF_DIR + "dataconfig-contentstream.xml"), f);
 
       Files.createFile(confDir.toPath().resolve("../core.properties"));
     }
diff --git a/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestXPathEntityProcessor.java b/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestXPathEntityProcessor.java
index e2200ea..cf7b9dc 100644
--- a/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestXPathEntityProcessor.java
+++ b/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestXPathEntityProcessor.java
@@ -26,6 +26,7 @@ import java.util.Map;
 import java.util.Properties;
 import java.util.concurrent.TimeUnit;
 
+import org.apache.solr.SolrTestUtil;
 import org.junit.Test;
 
 /**
@@ -44,7 +45,7 @@ public class TestXPathEntityProcessor extends AbstractDataImportHandlerTestCase
   @Test
   @SuppressWarnings({"unchecked"})
   public void withFieldsAndXpath() throws Exception {
-    File tmpdir = createTempDir().toFile();
+    File tmpdir = SolrTestUtil.createTempDir().toFile();
     
     createFile(tmpdir, "x.xsl", xsl.getBytes(StandardCharsets.UTF_8), false);
     @SuppressWarnings({"rawtypes"})
@@ -346,7 +347,7 @@ public class TestXPathEntityProcessor extends AbstractDataImportHandlerTestCase
   @Test
   @SuppressWarnings({"unchecked"})
   public void withDefaultSolrAndXsl() throws Exception {
-    File tmpdir = createTempDir().toFile();
+    File tmpdir = SolrTestUtil.createTempDir().toFile();
     AbstractDataImportHandlerTestCase.createFile(tmpdir, "x.xsl", xsl.getBytes(StandardCharsets.UTF_8),
             false);
 
diff --git a/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestXPathRecordReader.java b/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestXPathRecordReader.java
index fe8c657..6337d16 100644
--- a/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestXPathRecordReader.java
+++ b/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestXPathRecordReader.java
@@ -21,6 +21,7 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
 
+import org.apache.solr.SolrTestCaseUtil;
 import org.junit.Test;
 
 /**
@@ -361,11 +362,11 @@ public class TestXPathRecordReader extends AbstractDataImportHandlerTestCase {
 
   @Test
   public void testUnsupportedXPaths() {
-    RuntimeException ex = expectThrows(RuntimeException.class, () -> new XPathRecordReader("//b"));
+    RuntimeException ex = SolrTestCaseUtil.expectThrows(RuntimeException.class, () -> new XPathRecordReader("//b"));
     assertEquals("forEach cannot start with '//': //b", ex.getMessage());
 
     XPathRecordReader rr = new XPathRecordReader("/anyd/contenido");
-    ex = expectThrows(RuntimeException.class, () -> rr.addField("bold", "b", false));
+    ex = SolrTestCaseUtil.expectThrows(RuntimeException.class, () -> rr.addField("bold", "b", false));
     assertEquals("xpath must start with '/' : b", ex.getMessage());
   }
 
@@ -585,7 +586,7 @@ public class TestXPathRecordReader extends AbstractDataImportHandlerTestCase {
     XPathRecordReader rr = new XPathRecordReader("/root/node");
     rr.addField("id", "/root/node/id", true);
     rr.addField("desc", "/root/node/desc", true);
-    RuntimeException e = expectThrows(RuntimeException.class, () -> rr.getAllRecords(new StringReader(malformedXml)));
+    RuntimeException e = SolrTestCaseUtil.expectThrows(RuntimeException.class, () -> rr.getAllRecords(new StringReader(malformedXml)));
     assertTrue(e.getMessage().contains("Unexpected close tag </id>"));
  }
 }
diff --git a/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestZKPropertiesWriter.java b/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestZKPropertiesWriter.java
index 2ed9d8e..4d686f9 100644
--- a/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestZKPropertiesWriter.java
+++ b/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestZKPropertiesWriter.java
@@ -27,6 +27,7 @@ import java.util.List;
 import java.util.Locale;
 import java.util.Map;
 
+import org.apache.solr.SolrTestUtil;
 import org.apache.solr.cloud.ZkTestServer;
 import org.apache.solr.common.params.ModifiableSolrParams;
 import org.apache.solr.common.util.SuppressForbidden;
@@ -56,7 +57,7 @@ public class TestZKPropertiesWriter extends AbstractDataImportHandlerTestCase {
 
   @BeforeClass
   public static void dihZk_beforeClass() throws Exception {
-    zkDir = createTempDir("zkData");
+    zkDir = SolrTestUtil.createTempDir("zkData");
     zkServer = new ZkTestServer(zkDir);
     zkServer.run();
 
@@ -70,7 +71,7 @@ public class TestZKPropertiesWriter extends AbstractDataImportHandlerTestCase {
 //        "dataimport-solrconfig.xml", "dataimport-schema.xml");
 
     //initCore("solrconfig.xml", "schema.xml", getFile("dih/solr").getAbsolutePath());
-    cc = createDefaultCoreContainer(getFile("dih/solr").toPath());
+    cc = createDefaultCoreContainer(SolrTestUtil.getFile("dih/solr").toPath());
   }
 
   @Before
diff --git a/solr/contrib/extraction/src/test/org/apache/solr/handler/extraction/ExtractingRequestHandlerTest.java b/solr/contrib/extraction/src/test/org/apache/solr/handler/extraction/ExtractingRequestHandlerTest.java
index 978e9fd..6487a8c 100644
--- a/solr/contrib/extraction/src/test/org/apache/solr/handler/extraction/ExtractingRequestHandlerTest.java
+++ b/solr/contrib/extraction/src/test/org/apache/solr/handler/extraction/ExtractingRequestHandlerTest.java
@@ -21,7 +21,10 @@ import java.util.List;
 import java.util.Locale;
 import java.util.TimeZone;
 
+import org.apache.lucene.util.LuceneTestCase;
 import org.apache.solr.SolrTestCaseJ4;
+import org.apache.solr.SolrTestCaseUtil;
+import org.apache.solr.SolrTestUtil;
 import org.apache.solr.common.SolrException;
 import org.apache.solr.common.util.ContentStream;
 import org.apache.solr.common.util.ContentStreamBase;
@@ -50,10 +53,10 @@ public class ExtractingRequestHandlerTest extends SolrTestCaseJ4 {
     if (!tzDisplayName.matches("[A-Za-z]{3,}([+-]\\d\\d(:\\d\\d)?)?")) {
       assertTrue("Is some other JVM affected?  Or bad regex? TzDisplayName: " + tzDisplayName,
           System.getProperty("java.version").startsWith("11"));
-      assumeTrue("SOLR-12759 JDK 11 (1st release) and Tika 1.x can result in extracting dates in a bad format.", false);
+      LuceneTestCase.assumeTrue("SOLR-12759 JDK 11 (1st release) and Tika 1.x can result in extracting dates in a bad format.", false);
     }
 
-    initCore("solrconfig.xml", "schema.xml", getFile("extraction/solr").getAbsolutePath());
+    initCore("solrconfig.xml", "schema.xml", SolrTestUtil.getFile("extraction/solr").getAbsolutePath());
   }
 
   @Override
@@ -237,11 +240,8 @@ public class ExtractingRequestHandlerTest extends SolrTestCaseJ4 {
     try {
       ignoreException("unknown field 'a'");
       ignoreException("unknown field 'meta'");  // TODO: should this exception be happening?
-      expectThrows(SolrException.class, () -> {
-        loadLocal("extraction/simple.html",
-            "literal.id", "simple2",
-            "lowernames", "true",
-            "captureAttr", "true",
+      SolrTestCaseUtil.expectThrows(SolrException.class, () -> {
+        loadLocal("extraction/simple.html", "literal.id", "simple2", "lowernames", "true", "captureAttr", "true",
             //"fmap.content_type", "abcxyz",
             "commit", "true"  // test immediate commit
         );
@@ -463,7 +463,7 @@ public class ExtractingRequestHandlerTest extends SolrTestCaseJ4 {
     BufferingRequestProcessor p = new BufferingRequestProcessor(null);
 
     ExtractingDocumentLoader loader = (ExtractingDocumentLoader) handler.newLoader(req, p);
-    loader.load(req, rsp, new ContentStreamBase.FileStream(getFile("extraction/version_control.txt")),p);
+    loader.load(req, rsp, new ContentStreamBase.FileStream(SolrTestUtil.getFile("extraction/version_control.txt")),p);
 
     AddUpdateCommand add = p.addCommands.get(0);
     assertEquals(200, add.commitWithin);
@@ -570,7 +570,7 @@ public class ExtractingRequestHandlerTest extends SolrTestCaseJ4 {
     core.close();
     assertTrue("handler is null and it shouldn't be", handler != null);
 
-    expectThrows(Exception.class, () -> {
+    SolrTestCaseUtil.expectThrows(Exception.class, () -> {
       loadLocal("extraction/password-is-solrcell.docx", "literal.id", "one");
     });
     assertU(commit());
@@ -601,20 +601,14 @@ public class ExtractingRequestHandlerTest extends SolrTestCaseJ4 {
     core.close();
     assertTrue("handler is null and it shouldn't be", handler != null);
 
-    expectThrows(Exception.class, () -> {
+    SolrTestCaseUtil.expectThrows(Exception.class, () -> {
       // Load plain text specifying another mime type, should fail
-      loadLocal("extraction/version_control.txt",
-          "literal.id", "one",
-          ExtractingParams.STREAM_TYPE, "application/pdf"
-      );
+      loadLocal("extraction/version_control.txt", "literal.id", "one", ExtractingParams.STREAM_TYPE, "application/pdf");
     });
 
-    expectThrows(Exception.class, () -> {
+    SolrTestCaseUtil.expectThrows(Exception.class, () -> {
       // Load plain text specifying non existing mimetype, should fail
-      loadLocal("extraction/version_control.txt",
-          "literal.id", "one",
-          ExtractingParams.STREAM_TYPE, "foo/bar"
-      );
+      loadLocal("extraction/version_control.txt", "literal.id", "one", ExtractingParams.STREAM_TYPE, "foo/bar");
     });
   }
 
@@ -779,7 +773,7 @@ public class ExtractingRequestHandlerTest extends SolrTestCaseJ4 {
       // TODO: stop using locally defined streams once stream.file and
       // stream.body work everywhere
       List<ContentStream> cs = new ArrayList<>();
-      cs.add(new ContentStreamBase.FileStream(getFile(filename)));
+      cs.add(new ContentStreamBase.FileStream(SolrTestUtil.getFile(filename)));
       req.setContentStreams(cs);
       return h.queryAndResponse(handler, req);
     } finally {
diff --git a/solr/contrib/extraction/src/test/org/apache/solr/handler/extraction/TestXLSXResponseWriter.java b/solr/contrib/extraction/src/test/org/apache/solr/handler/extraction/TestXLSXResponseWriter.java
index 84be003..49b5289 100644
--- a/solr/contrib/extraction/src/test/org/apache/solr/handler/extraction/TestXLSXResponseWriter.java
+++ b/solr/contrib/extraction/src/test/org/apache/solr/handler/extraction/TestXLSXResponseWriter.java
@@ -30,6 +30,7 @@ import org.apache.poi.ss.usermodel.Row;
 import org.apache.poi.xssf.usermodel.XSSFSheet;
 import org.apache.poi.xssf.usermodel.XSSFWorkbook;
 import org.apache.solr.SolrTestCaseJ4;
+import org.apache.solr.SolrTestUtil;
 import org.apache.solr.common.SolrDocument;
 import org.apache.solr.common.SolrDocumentList;
 import org.apache.solr.core.SolrCore;
@@ -50,7 +51,7 @@ public class TestXLSXResponseWriter extends SolrTestCaseJ4 {
   @BeforeClass
   public static void beforeClass() throws Exception {
     System.setProperty("enable.update.log", "false");
-    initCore("solrconfig.xml","schema.xml",getFile("extraction/solr").getAbsolutePath());
+    initCore("solrconfig.xml","schema.xml", SolrTestUtil.getFile("extraction/solr").getAbsolutePath());
     createIndex();
     //find a reference to the default response writer so we can redirect its output later
     SolrCore testCore = h.getCore();
diff --git a/solr/contrib/jaegertracer-configurator/src/test/org/apache/solr/jaeger/TestJaegerConfigurator.java b/solr/contrib/jaegertracer-configurator/src/test/org/apache/solr/jaeger/TestJaegerConfigurator.java
index 9e4d995..dd159fe 100644
--- a/solr/contrib/jaegertracer-configurator/src/test/org/apache/solr/jaeger/TestJaegerConfigurator.java
+++ b/solr/contrib/jaegertracer-configurator/src/test/org/apache/solr/jaeger/TestJaegerConfigurator.java
@@ -22,6 +22,8 @@ import java.io.IOException;
 import java.util.concurrent.TimeUnit;
 
 import org.apache.solr.SolrTestCaseJ4;
+import org.apache.solr.SolrTestCaseUtil;
+import org.apache.solr.SolrTestUtil;
 import org.apache.solr.client.solrj.SolrQuery;
 import org.apache.solr.client.solrj.request.CollectionAdminRequest;
 import org.apache.solr.client.solrj.request.UpdateRequest;
@@ -47,9 +49,9 @@ public class TestJaegerConfigurator extends SolrTestCaseJ4 {
 
   @Test
   public void testInjected() throws Exception{
-    MiniSolrCloudCluster cluster = new SolrCloudTestCase.Builder(2, createTempDir())
-        .addConfig("config", TEST_PATH().resolve("collection1").resolve("conf"))
-        .withSolrXml(getFile("solr/solr.xml").toPath())
+    MiniSolrCloudCluster cluster = new SolrCloudTestCase.Builder(2, SolrTestUtil.createTempDir())
+        .addConfig("config", SolrTestUtil.TEST_PATH().resolve("collection1").resolve("conf"))
+        .withSolrXml(SolrTestUtil.getFile("solr/solr.xml").toPath())
         .build();
     CollectionAdminRequest.setClusterProperty(ZkStateReader.SAMPLE_PERCENTAGE, "100.0")
         .process(cluster.getSolrClient());
@@ -74,11 +76,11 @@ public class TestJaegerConfigurator extends SolrTestCaseJ4 {
   public void testRequiredParameters() throws IOException {
     JaegerTracerConfigurator configurator = new JaegerTracerConfigurator();
     NamedList initArgs = new NamedList();
-    IllegalArgumentException exc = expectThrows(IllegalArgumentException.class, () -> configurator.init(initArgs));
+    IllegalArgumentException exc = SolrTestCaseUtil.expectThrows(IllegalArgumentException.class, () -> configurator.init(initArgs));
     assertTrue(exc.getMessage().contains(AGENT_HOST) || exc.getMessage().contains(AGENT_PORT));
     initArgs.add(AGENT_HOST, "localhost");
 
-    exc = expectThrows(IllegalArgumentException.class, () -> configurator.init(initArgs));
+    exc = SolrTestCaseUtil.expectThrows(IllegalArgumentException.class, () -> configurator.init(initArgs));
     assertTrue(exc.getMessage().contains(AGENT_PORT));
     initArgs.add(AGENT_PORT, 5775);
 
@@ -100,34 +102,34 @@ public class TestJaegerConfigurator extends SolrTestCaseJ4 {
     initArgs.add(AGENT_HOST, 100);
     initArgs.add(AGENT_PORT, 5775);
 
-    IllegalArgumentException exc = expectThrows(IllegalArgumentException.class, () -> configurator.init(initArgs));
+    IllegalArgumentException exc = SolrTestCaseUtil.expectThrows(IllegalArgumentException.class, () -> configurator.init(initArgs));
     assertTrue(exc.getMessage().contains(AGENT_HOST));
 
     initArgs.clear();
     initArgs.add(AGENT_HOST, "localhost");
     initArgs.add(AGENT_PORT, "5775");
-    exc = expectThrows(IllegalArgumentException.class, () -> configurator.init(initArgs));
+    exc = SolrTestCaseUtil.expectThrows(IllegalArgumentException.class, () -> configurator.init(initArgs));
     assertTrue(exc.getMessage().contains(AGENT_PORT));
 
     initArgs.clear();
     initArgs.add(AGENT_HOST, "localhost");
     initArgs.add(AGENT_PORT, 5775);
     initArgs.add(LOG_SPANS, 10);
-    SolrException solrExc = expectThrows(SolrException.class, () -> configurator.init(initArgs));
+    SolrException solrExc = SolrTestCaseUtil.expectThrows(SolrException.class, () -> configurator.init(initArgs));
     assertTrue(solrExc.getMessage().contains(LOG_SPANS));
 
     initArgs.clear();
     initArgs.add(AGENT_HOST, "localhost");
     initArgs.add(AGENT_PORT, 5775);
     initArgs.add(FLUSH_INTERVAL, "10");
-    exc = expectThrows(IllegalArgumentException.class, () -> configurator.init(initArgs));
+    exc = SolrTestCaseUtil.expectThrows(IllegalArgumentException.class, () -> configurator.init(initArgs));
     assertTrue(exc.getMessage().contains(FLUSH_INTERVAL));
 
     initArgs.clear();
     initArgs.add(AGENT_HOST, "localhost");
     initArgs.add(AGENT_PORT, 5775);
     initArgs.add(MAX_QUEUE_SIZE, "10");
-    exc = expectThrows(IllegalArgumentException.class, () -> configurator.init(initArgs));
+    exc = SolrTestCaseUtil.expectThrows(IllegalArgumentException.class, () -> configurator.init(initArgs));
     assertTrue(exc.getMessage().contains(MAX_QUEUE_SIZE));
 
   }
diff --git a/solr/contrib/langid/src/test/org/apache/solr/update/processor/LanguageIdentifierUpdateProcessorFactoryTestCase.java b/solr/contrib/langid/src/test/org/apache/solr/update/processor/LanguageIdentifierUpdateProcessorFactoryTestCase.java
index 5f8232f..3fb9e6b 100644
--- a/solr/contrib/langid/src/test/org/apache/solr/update/processor/LanguageIdentifierUpdateProcessorFactoryTestCase.java
+++ b/solr/contrib/langid/src/test/org/apache/solr/update/processor/LanguageIdentifierUpdateProcessorFactoryTestCase.java
@@ -20,6 +20,7 @@ import java.util.ArrayList;
 import java.util.List;
 
 import org.apache.solr.SolrTestCaseJ4;
+import org.apache.solr.SolrTestUtil;
 import org.apache.solr.common.SolrInputDocument;
 import org.apache.solr.common.params.ModifiableSolrParams;
 import org.apache.solr.core.SolrCore;
@@ -37,7 +38,7 @@ public abstract class LanguageIdentifierUpdateProcessorFactoryTestCase extends S
 
   @BeforeClass
   public static void beforeClass() throws Exception {
-    initCore("solrconfig-languageidentifier.xml", "schema.xml", getFile("langid/solr").getAbsolutePath());
+    initCore("solrconfig-languageidentifier.xml", "schema.xml", SolrTestUtil.getFile("langid/solr").getAbsolutePath());
     SolrCore core = h.getCore();
     UpdateRequestProcessorChain chained = core.getUpdateProcessingChain("lang_id_tika");
     assertNotNull(chained);
diff --git a/solr/contrib/ltr/src/java/org/apache/solr/ltr/search/LTRQParserPlugin.java b/solr/contrib/ltr/src/java/org/apache/solr/ltr/search/LTRQParserPlugin.java
index a834165..f30c1fb 100644
--- a/solr/contrib/ltr/src/java/org/apache/solr/ltr/search/LTRQParserPlugin.java
+++ b/solr/contrib/ltr/src/java/org/apache/solr/ltr/search/LTRQParserPlugin.java
@@ -193,7 +193,7 @@ public class LTRQParserPlugin extends QParserPlugin implements ResourceLoaderAwa
    * A learning to rank Query, will incapsulate a learning to rank model, and delegate to it the rescoring
    * of the documents.
    **/
-  public class LTRQuery extends AbstractReRankQuery {
+  public static class LTRQuery extends AbstractReRankQuery {
     private final LTRScoringQuery scoringQuery;
 
     public LTRQuery(LTRScoringQuery scoringQuery, int reRankDocs) {
diff --git a/solr/contrib/ltr/src/test/org/apache/solr/ltr/TestLTRQParserPlugin.java b/solr/contrib/ltr/src/test/org/apache/solr/ltr/TestLTRQParserPlugin.java
index df7d9a5..05f2ed5 100644
--- a/solr/contrib/ltr/src/test/org/apache/solr/ltr/TestLTRQParserPlugin.java
+++ b/solr/contrib/ltr/src/test/org/apache/solr/ltr/TestLTRQParserPlugin.java
@@ -16,6 +16,7 @@
  */
 package org.apache.solr.ltr;
 
+import org.apache.lucene.util.LuceneTestCase;
 import org.apache.solr.client.solrj.SolrQuery;
 import org.junit.After;
 import org.junit.Before;
@@ -41,7 +42,7 @@ public class TestLTRQParserPlugin extends TestRerankBase {
   }
 
   @Test
-  @Nightly
+  @LuceneTestCase.Nightly
   public void ltrModelIdMissingTest() throws Exception {
     final String solrQuery = "_query_:{!edismax qf='title' mm=100% v='bloomberg' tie=0.1}";
     final SolrQuery query = new SolrQuery();
@@ -56,7 +57,7 @@ public class TestLTRQParserPlugin extends TestRerankBase {
   }
 
   @Test
-  @Nightly
+  @LuceneTestCase.Nightly
   public void ltrModelIdDoesNotExistTest() throws Exception {
     final String solrQuery = "_query_:{!edismax qf='title' mm=100% v='bloomberg' tie=0.1}";
     final SolrQuery query = new SolrQuery();
@@ -71,7 +72,7 @@ public class TestLTRQParserPlugin extends TestRerankBase {
   }
 
   @Test
-  @Nightly
+  @LuceneTestCase.Nightly
   public void ltrBadRerankDocsTest() throws Exception {
     final String solrQuery = "_query_:{!edismax qf='title' mm=100% v='bloomberg' tie=0.1}";
     final SolrQuery query = new SolrQuery();
@@ -86,7 +87,7 @@ public class TestLTRQParserPlugin extends TestRerankBase {
   }
 
   @Test
-  @Nightly
+  @LuceneTestCase.Nightly
   public void ltrMoreResultsThanReRankedTest() throws Exception {
     final String solrQuery = "_query_:{!edismax qf='title' mm=100% v='bloomberg' tie=0.1}";
     final SolrQuery query = new SolrQuery();
@@ -120,7 +121,7 @@ public class TestLTRQParserPlugin extends TestRerankBase {
   }
 
   @Test
-  @Nightly
+  @LuceneTestCase.Nightly
   public void ltrNoResultsTest() throws Exception {
     final SolrQuery query = new SolrQuery();
     query.setQuery("title:bloomberg23");
diff --git a/solr/contrib/ltr/src/test/org/apache/solr/ltr/TestLTRReRankingPipeline.java b/solr/contrib/ltr/src/test/org/apache/solr/ltr/TestLTRReRankingPipeline.java
index 039a881..e23229a 100644
--- a/solr/contrib/ltr/src/test/org/apache/solr/ltr/TestLTRReRankingPipeline.java
+++ b/solr/contrib/ltr/src/test/org/apache/solr/ltr/TestLTRReRankingPipeline.java
@@ -41,6 +41,7 @@ import org.apache.lucene.search.ScoreMode;
 import org.apache.lucene.search.TermQuery;
 import org.apache.lucene.search.TopDocs;
 import org.apache.lucene.store.Directory;
+import org.apache.lucene.util.LuceneTestCase;
 import org.apache.solr.SolrTestCase;
 import org.apache.solr.core.SolrResourceLoader;
 import org.apache.solr.ltr.feature.Feature;
@@ -63,7 +64,7 @@ public class TestLTRReRankingPipeline extends SolrTestCase {
     final boolean wrapWithAssertions = false;
      // 'no' to asserting wrap because lucene AssertingWeight
      // cannot be cast to solr LTRScoringQuery$ModelWeight
-    final IndexSearcher searcher = newSearcher(r, maybeWrap, wrapWithAssertions);
+    final IndexSearcher searcher = LuceneTestCase.newSearcher(r, maybeWrap, wrapWithAssertions);
 
     return searcher;
   }
@@ -107,22 +108,22 @@ public class TestLTRReRankingPipeline extends SolrTestCase {
 
   @Test
   public void testRescorer() throws IOException {
-    final Directory dir = newDirectory();
+    final Directory dir = LuceneTestCase.newDirectory();
     final RandomIndexWriter w = new RandomIndexWriter(random(), dir);
 
     Document doc = new Document();
-    doc.add(newStringField("id", "0", Field.Store.YES));
-    doc.add(newTextField("field", "wizard the the the the the oz",
+    doc.add(LuceneTestCase.newStringField("id", "0", Field.Store.YES));
+    doc.add(LuceneTestCase.newTextField("field", "wizard the the the the the oz",
         Field.Store.NO));
-    doc.add(newStringField("final-score", "F", Field.Store.YES)); // TODO: change to numeric field
+    doc.add(LuceneTestCase.newStringField("final-score", "F", Field.Store.YES)); // TODO: change to numeric field
 
     w.addDocument(doc);
     doc = new Document();
-    doc.add(newStringField("id", "1", Field.Store.YES));
+    doc.add(LuceneTestCase.newStringField("id", "1", Field.Store.YES));
     // 1 extra token, but wizard and oz are close;
-    doc.add(newTextField("field", "wizard oz the the the the the the",
+    doc.add(LuceneTestCase.newTextField("field", "wizard oz the the the the the the",
         Field.Store.NO));
-    doc.add(newStringField("final-score", "T", Field.Store.YES)); // TODO: change to numeric field
+    doc.add(LuceneTestCase.newStringField("final-score", "T", Field.Store.YES)); // TODO: change to numeric field
     w.addDocument(doc);
 
     final IndexReader r = w.getReader();
@@ -161,37 +162,37 @@ public class TestLTRReRankingPipeline extends SolrTestCase {
 
   }
 
-  @AwaitsFix(bugUrl = "https://issues.apache.org/jira/browse/SOLR-11134")
+  @LuceneTestCase.AwaitsFix(bugUrl = "https://issues.apache.org/jira/browse/SOLR-11134")
   @Test
   public void testDifferentTopN() throws IOException {
-    final Directory dir = newDirectory();
+    final Directory dir = LuceneTestCase.newDirectory();
     final RandomIndexWriter w = new RandomIndexWriter(random(), dir);
 
     Document doc = new Document();
-    doc.add(newStringField("id", "0", Field.Store.YES));
-    doc.add(newTextField("field", "wizard oz oz oz oz oz", Field.Store.NO));
+    doc.add(LuceneTestCase.newStringField("id", "0", Field.Store.YES));
+    doc.add(LuceneTestCase.newTextField("field", "wizard oz oz oz oz oz", Field.Store.NO));
     doc.add(new FloatDocValuesField("final-score", 1.0f));
     w.addDocument(doc);
 
     doc = new Document();
-    doc.add(newStringField("id", "1", Field.Store.YES));
-    doc.add(newTextField("field", "wizard oz oz oz oz the", Field.Store.NO));
+    doc.add(LuceneTestCase.newStringField("id", "1", Field.Store.YES));
+    doc.add(LuceneTestCase.newTextField("field", "wizard oz oz oz oz the", Field.Store.NO));
     doc.add(new FloatDocValuesField("final-score", 2.0f));
     w.addDocument(doc);
     doc = new Document();
-    doc.add(newStringField("id", "2", Field.Store.YES));
-    doc.add(newTextField("field", "wizard oz oz oz the the ", Field.Store.NO));
+    doc.add(LuceneTestCase.newStringField("id", "2", Field.Store.YES));
+    doc.add(LuceneTestCase.newTextField("field", "wizard oz oz oz the the ", Field.Store.NO));
     doc.add(new FloatDocValuesField("final-score", 3.0f));
     w.addDocument(doc);
     doc = new Document();
-    doc.add(newStringField("id", "3", Field.Store.YES));
-    doc.add(newTextField("field", "wizard oz oz the the the the ",
+    doc.add(LuceneTestCase.newStringField("id", "3", Field.Store.YES));
+    doc.add(LuceneTestCase.newTextField("field", "wizard oz oz the the the the ",
         Field.Store.NO));
     doc.add(new FloatDocValuesField("final-score", 4.0f));
     w.addDocument(doc);
     doc = new Document();
-    doc.add(newStringField("id", "4", Field.Store.YES));
-    doc.add(newTextField("field", "wizard oz the the the the the the",
+    doc.add(LuceneTestCase.newStringField("id", "4", Field.Store.YES));
+    doc.add(LuceneTestCase.newTextField("field", "wizard oz the the the the the the",
         Field.Store.NO));
     doc.add(new FloatDocValuesField("final-score", 5.0f));
     w.addDocument(doc);
diff --git a/solr/contrib/ltr/src/test/org/apache/solr/ltr/TestLTRScoringQuery.java b/solr/contrib/ltr/src/test/org/apache/solr/ltr/TestLTRScoringQuery.java
index b93a21a..bef198c 100644
--- a/solr/contrib/ltr/src/test/org/apache/solr/ltr/TestLTRScoringQuery.java
+++ b/solr/contrib/ltr/src/test/org/apache/solr/ltr/TestLTRScoringQuery.java
@@ -41,6 +41,7 @@ import org.apache.lucene.search.TermQuery;
 import org.apache.lucene.search.TopDocs;
 import org.apache.lucene.search.Weight;
 import org.apache.lucene.store.Directory;
+import org.apache.lucene.util.LuceneTestCase;
 import org.apache.solr.SolrTestCase;
 import org.apache.solr.core.SolrResourceLoader;
 import org.apache.solr.ltr.feature.Feature;
@@ -56,7 +57,7 @@ import org.junit.Test;
 public class TestLTRScoringQuery extends SolrTestCase {
 
   private IndexSearcher getSearcher(IndexReader r) {
-    final IndexSearcher searcher = newSearcher(r, false, false);
+    final IndexSearcher searcher = LuceneTestCase.newSearcher(r, false, false);
     return searcher;
   }
 
@@ -172,20 +173,20 @@ public class TestLTRScoringQuery extends SolrTestCase {
 
   @Test
   public void testLTRScoringQuery() throws IOException, ModelException {
-    final Directory dir = newDirectory();
+    final Directory dir = LuceneTestCase.newDirectory();
     final RandomIndexWriter w = new RandomIndexWriter(random(), dir);
 
     Document doc = new Document();
-    doc.add(newStringField("id", "0", Field.Store.YES));
-    doc.add(newTextField("field", "wizard the the the the the oz",
+    doc.add(LuceneTestCase.newStringField("id", "0", Field.Store.YES));
+    doc.add(LuceneTestCase.newTextField("field", "wizard the the the the the oz",
         Field.Store.NO));
     doc.add(new FloatDocValuesField("final-score", 1.0f));
 
     w.addDocument(doc);
     doc = new Document();
-    doc.add(newStringField("id", "1", Field.Store.YES));
+    doc.add(LuceneTestCase.newStringField("id", "1", Field.Store.YES));
     // 1 extra token, but wizard and oz are close;
-    doc.add(newTextField("field", "wizard oz the the the the the the",
+    doc.add(LuceneTestCase.newTextField("field", "wizard oz the the the the the the",
         Field.Store.NO));
     doc.add(new FloatDocValuesField("final-score", 2.0f));
     w.addDocument(doc);
@@ -269,23 +270,7 @@ public class TestLTRScoringQuery extends SolrTestCase {
 
     // test normalizers
     features = makeFilterFeatures(mixPositions);
-    final Normalizer norm = new Normalizer() {
-
-      @Override
-      public float normalize(float value) {
-        return 42.42f;
-      }
-
-      @Override
-      public LinkedHashMap<String,Object> paramsToMap() {
-        return null;
-      }
-
-      @Override
-      protected void validate() throws NormalizerException {
-      }
-
-    };
+    final Normalizer norm = new MyNormalizer();
     norms =
         new ArrayList<Normalizer>(
             Collections.nCopies(features.size(),norm));
@@ -306,4 +291,21 @@ public class TestLTRScoringQuery extends SolrTestCase {
 
   }
 
+  private static class MyNormalizer extends Normalizer {
+
+    @Override
+    public float normalize(float value) {
+      return 42.42f;
+    }
+
+    @Override
+    public LinkedHashMap<String,Object> paramsToMap() {
+      return null;
+    }
+
+    @Override
+    protected void validate() throws NormalizerException {
+    }
+
+  }
 }
diff --git a/solr/contrib/ltr/src/test/org/apache/solr/ltr/TestRerankBase.java b/solr/contrib/ltr/src/test/org/apache/solr/ltr/TestRerankBase.java
index 7b6db02..99f5967 100644
--- a/solr/contrib/ltr/src/test/org/apache/solr/ltr/TestRerankBase.java
+++ b/solr/contrib/ltr/src/test/org/apache/solr/ltr/TestRerankBase.java
@@ -32,7 +32,7 @@ import java.util.SortedMap;
 import java.util.TreeMap;
 
 import org.apache.commons.io.FileUtils;
-import org.apache.solr.client.solrj.embedded.JettySolrRunner;
+import org.apache.solr.SolrTestUtil;
 import org.apache.solr.common.params.CommonParams;
 import org.apache.solr.common.util.ContentStream;
 import org.apache.solr.common.util.ContentStreamBase;
@@ -139,10 +139,10 @@ public class TestRerankBase extends RestTestBase {
   protected static SortedMap<ServletHolder,String>  setupTestInit(
       String solrconfig, String schema,
       boolean isPersistent) throws Exception {
-    tmpSolrHome = createTempDir().toFile();
+    tmpSolrHome = SolrTestUtil.createTempDir().toFile();
     tmpConfDir = new File(tmpSolrHome, CONF_DIR);
     tmpConfDir.deleteOnExit();
-    FileUtils.copyDirectory(new File(TEST_HOME()),
+    FileUtils.copyDirectory(new File(SolrTestUtil.TEST_HOME()),
         tmpSolrHome.getAbsoluteFile());
 
     final File fstore = new File(tmpConfDir, FEATURE_FILE_NAME);
diff --git a/solr/contrib/ltr/src/test/org/apache/solr/ltr/TestSelectiveWeightCreation.java b/solr/contrib/ltr/src/test/org/apache/solr/ltr/TestSelectiveWeightCreation.java
index e6bea7a..84893aa 100644
--- a/solr/contrib/ltr/src/test/org/apache/solr/ltr/TestSelectiveWeightCreation.java
+++ b/solr/contrib/ltr/src/test/org/apache/solr/ltr/TestSelectiveWeightCreation.java
@@ -39,6 +39,7 @@ import org.apache.lucene.search.TermQuery;
 import org.apache.lucene.search.TopDocs;
 import org.apache.lucene.search.Weight;
 import org.apache.lucene.store.Directory;
+import org.apache.lucene.util.LuceneTestCase;
 import org.apache.solr.client.solrj.SolrQuery;
 import org.apache.solr.ltr.feature.Feature;
 import org.apache.solr.ltr.feature.ValueFeature;
@@ -49,12 +50,11 @@ import org.apache.solr.ltr.norm.IdentityNormalizer;
 import org.apache.solr.ltr.norm.Normalizer;
 import org.junit.After;
 import org.junit.Before;;
-import org.junit.Ignore;
 import org.junit.Test;
 
 public class TestSelectiveWeightCreation extends TestRerankBase {
   private IndexSearcher getSearcher(IndexReader r) {
-    final IndexSearcher searcher = newSearcher(r, false, false);
+    final IndexSearcher searcher = LuceneTestCase.newSearcher(r, false, false);
     return searcher;
   }
 
@@ -118,22 +118,22 @@ public class TestSelectiveWeightCreation extends TestRerankBase {
   }
 
   @Test
-  @Nightly
+  @LuceneTestCase.Nightly
   public void testScoringQueryWeightCreation() throws IOException, ModelException {
-    final Directory dir = newDirectory();
+    final Directory dir = LuceneTestCase.newDirectory();
     final RandomIndexWriter w = new RandomIndexWriter(random(), dir);
 
     Document doc = new Document();
-    doc.add(newStringField("id", "10", Field.Store.YES));
-    doc.add(newTextField("field", "wizard the the the the the oz",
+    doc.add(LuceneTestCase.newStringField("id", "10", Field.Store.YES));
+    doc.add(LuceneTestCase.newTextField("field", "wizard the the the the the oz",
         Field.Store.NO));
     doc.add(new FloatDocValuesField("final-score", 1.0f));
 
     w.addDocument(doc);
     doc = new Document();
-    doc.add(newStringField("id", "11", Field.Store.YES));
+    doc.add(LuceneTestCase.newStringField("id", "11", Field.Store.YES));
     // 1 extra token, but wizard and oz are close;
-    doc.add(newTextField("field", "wizard oz the the the the the the",
+    doc.add(LuceneTestCase.newTextField("field", "wizard oz the the the the the the",
         Field.Store.NO));
     doc.add(new FloatDocValuesField("final-score", 2.0f));
     w.addDocument(doc);
@@ -204,7 +204,7 @@ public class TestSelectiveWeightCreation extends TestRerankBase {
 
 
   @Test
-  @Nightly
+  @LuceneTestCase.Nightly
   public void testSelectiveWeightsRequestFeaturesFromDifferentStore() throws Exception {
 
 //    final String docs0fv_sparse = FeatureLoggerTestUtils.toFeatureVector(
diff --git a/solr/contrib/ltr/src/test/org/apache/solr/ltr/feature/TestExternalFeatures.java b/solr/contrib/ltr/src/test/org/apache/solr/ltr/feature/TestExternalFeatures.java
index f42cebd..f94711c 100644
--- a/solr/contrib/ltr/src/test/org/apache/solr/ltr/feature/TestExternalFeatures.java
+++ b/solr/contrib/ltr/src/test/org/apache/solr/ltr/feature/TestExternalFeatures.java
@@ -16,6 +16,7 @@
  */
 package org.apache.solr.ltr.feature;
 
+import org.apache.lucene.util.LuceneTestCase;
 import org.apache.solr.client.solrj.SolrQuery;
 import org.apache.solr.ltr.FeatureLoggerTestUtils;
 import org.apache.solr.ltr.TestRerankBase;
@@ -52,7 +53,7 @@ public class TestExternalFeatures extends TestRerankBase {
   }
 
   @Test
-  @Nightly
+  @LuceneTestCase.Nightly
   public void testEfiInTransformerShouldNotChangeOrderOfRerankedResults() throws Exception {
     final SolrQuery query = new SolrQuery();
     query.setQuery("*:*");
@@ -88,7 +89,7 @@ public class TestExternalFeatures extends TestRerankBase {
   }
 
   @Test
-  @Nightly
+  @LuceneTestCase.Nightly
   public void testFeaturesUseStopwordQueryReturnEmptyFeatureVector() throws Exception {
     final SolrQuery query = new SolrQuery();
     query.setQuery("*:*");
@@ -110,7 +111,7 @@ public class TestExternalFeatures extends TestRerankBase {
   }
 
   @Test
-  @Nightly
+  @LuceneTestCase.Nightly
   public void testEfiFeatureExtraction() throws Exception {
     final SolrQuery query = new SolrQuery();
     query.setQuery("*:*");
@@ -136,7 +137,7 @@ public class TestExternalFeatures extends TestRerankBase {
   }
 
   @Test
-  @Nightly
+  @LuceneTestCase.Nightly
   public void featureExtraction_valueFeatureImplicitlyNotRequired_shouldNotScoreFeature() throws Exception {
     final SolrQuery query = new SolrQuery();
     query.setQuery("*:*");
@@ -157,7 +158,7 @@ public class TestExternalFeatures extends TestRerankBase {
   }
 
   @Test
-  @Nightly
+  @LuceneTestCase.Nightly
   public void featureExtraction_valueFeatureExplicitlyNotRequired_shouldNotScoreFeature() throws Exception {
     final SolrQuery query = new SolrQuery();
     query.setQuery("*:*");
@@ -178,7 +179,7 @@ public class TestExternalFeatures extends TestRerankBase {
   }
 
   @Test
-  @Nightly
+  @LuceneTestCase.Nightly
   public void featureExtraction_valueFeatureRequired_shouldThrowException() throws Exception {
     final SolrQuery query = new SolrQuery();
     query.setQuery("*:*");
@@ -191,7 +192,7 @@ public class TestExternalFeatures extends TestRerankBase {
   }
 
   @Test
-  @Nightly
+  @LuceneTestCase.Nightly
   public void featureExtraction_valueFeatureRequiredInFq_shouldThrowException() throws Exception {
     final String userTitlePhrase1 = "userTitlePhrase1";
     final String userTitlePhrase2 = "userTitlePhrase2";
diff --git a/solr/contrib/ltr/src/test/org/apache/solr/ltr/feature/TestValueFeature.java b/solr/contrib/ltr/src/test/org/apache/solr/ltr/feature/TestValueFeature.java
index 52f4e43..30a6435 100644
--- a/solr/contrib/ltr/src/test/org/apache/solr/ltr/feature/TestValueFeature.java
+++ b/solr/contrib/ltr/src/test/org/apache/solr/ltr/feature/TestValueFeature.java
@@ -19,6 +19,7 @@ package org.apache.solr.ltr.feature;
 import java.util.LinkedHashMap;
 
 import org.apache.lucene.util.LuceneTestCase;
+import org.apache.solr.SolrTestCaseUtil;
 import org.apache.solr.client.solrj.SolrQuery;
 import org.apache.solr.ltr.TestRerankBase;
 import org.apache.solr.ltr.model.LinearModel;
@@ -53,7 +54,7 @@ public class TestValueFeature extends TestRerankBase {
   public void testValueFeatureWithEmptyValue() throws Exception {
     final RuntimeException expectedException =
         new RuntimeException("mismatch: '0'!='500' @ responseHeader/status");
-    RuntimeException e = expectThrows(RuntimeException.class, () -> {
+    RuntimeException e = SolrTestCaseUtil.expectThrows(RuntimeException.class, () -> {
       loadFeature("c2", ValueFeature.class.getName(), "{\"value\":\"\"}");
     });
     assertEquals(expectedException.toString(), e.toString());
@@ -63,7 +64,7 @@ public class TestValueFeature extends TestRerankBase {
   public void testValueFeatureWithWhitespaceValue() throws Exception {
     final RuntimeException expectedException =
         new RuntimeException("mismatch: '0'!='500' @ responseHeader/status");
-    RuntimeException e = expectThrows(RuntimeException.class, () -> {
+    RuntimeException e = SolrTestCaseUtil.expectThrows(RuntimeException.class, () -> {
       loadFeature("c2", ValueFeature.class.getName(), "{\"value\":\" \"}");
     });
     assertEquals(expectedException.toString(), e.toString());
diff --git a/solr/contrib/ltr/src/test/org/apache/solr/ltr/model/TestLinearModel.java b/solr/contrib/ltr/src/test/org/apache/solr/ltr/model/TestLinearModel.java
index c9abced..72dc1e1 100644
--- a/solr/contrib/ltr/src/test/org/apache/solr/ltr/model/TestLinearModel.java
+++ b/solr/contrib/ltr/src/test/org/apache/solr/ltr/model/TestLinearModel.java
@@ -24,6 +24,7 @@ import java.util.List;
 import java.util.Map;
 
 import org.apache.lucene.util.LuceneTestCase;
+import org.apache.solr.SolrTestCaseUtil;
 import org.apache.solr.common.SolrException;
 import org.apache.solr.core.SolrResourceLoader;
 import org.apache.solr.ltr.TestRerankBase;
@@ -108,9 +109,8 @@ public class TestLinearModel extends TestRerankBase {
         {"constant1", "constant5"});
     final List<Normalizer> norms =
         new ArrayList<>(Collections.nCopies(features.size(),IdentityNormalizer.INSTANCE));
-    ModelException ex = expectThrows(ModelException.class, () -> {
-      createLinearModel("test2",
-          features, norms, "test", fstore.getFeatures(), null);
+    ModelException ex = SolrTestCaseUtil.expectThrows(ModelException.class, () -> {
+      createLinearModel("test2", features, norms, "test", fstore.getFeatures(), null);
     });
     assertEquals(expectedException.toString(), ex.toString());
   }
@@ -131,9 +131,8 @@ public class TestLinearModel extends TestRerankBase {
 
     Map<String,Object> params = new HashMap<>();
     params.put("weights", weights);
-    SolrException ex = expectThrows(SolrException.class, () -> {
-      final LTRScoringModel ltrScoringModel = createLinearModel("test3",
-          features, norms, "test", fstore.getFeatures(), params);
+    SolrException ex = SolrTestCaseUtil.expectThrows(SolrException.class, () -> {
+      final LTRScoringModel ltrScoringModel = createLinearModel("test3", features, norms, "test", fstore.getFeatures(), params);
       store.addModel(ltrScoringModel);
       final LTRScoringModel m = store.getModel("test3");
       assertEquals(ltrScoringModel, m);
@@ -156,9 +155,8 @@ public class TestLinearModel extends TestRerankBase {
 
     Map<String,Object> params = new HashMap<>();
     params.put("weights", weights);
-    ModelException ex = expectThrows(ModelException.class, () -> {
-      final LTRScoringModel ltrScoringModel = createLinearModel("test4",
-          features, norms, "test", fstore.getFeatures(), params);
+    ModelException ex = SolrTestCaseUtil.expectThrows(ModelException.class, () -> {
+      final LTRScoringModel ltrScoringModel = createLinearModel("test4", features, norms, "test", fstore.getFeatures(), params);
       store.addModel(ltrScoringModel);
     });
     assertEquals(expectedException.toString(), ex.toString());
@@ -180,9 +178,8 @@ public class TestLinearModel extends TestRerankBase {
 
     Map<String,Object> params = new HashMap<>();
     params.put("weights", weights);
-    ModelException ex = expectThrows(ModelException.class, () -> {
-      createLinearModel("test5",
-          features, norms, "test", fstore.getFeatures(), params);
+    ModelException ex = SolrTestCaseUtil.expectThrows(ModelException.class, () -> {
+      createLinearModel("test5", features, norms, "test", fstore.getFeatures(), params);
     });
     assertEquals(expectedException.toString(), ex.toString());
   }
@@ -200,10 +197,8 @@ public class TestLinearModel extends TestRerankBase {
 
     Map<String,Object> params = new HashMap<>();
     params.put("weights", weights);
-    ModelException ex = expectThrows(ModelException.class, () -> {
-      final LTRScoringModel ltrScoringModel = createLinearModel("test6",
-          features, norms, "test", fstore.getFeatures(),
-          params);
+    ModelException ex = SolrTestCaseUtil.expectThrows(ModelException.class, () -> {
+      final LTRScoringModel ltrScoringModel = createLinearModel("test6", features, norms, "test", fstore.getFeatures(), params);
       store.addModel(ltrScoringModel);
     });
     assertEquals(expectedException.toString(), ex.toString());
diff --git a/solr/contrib/ltr/src/test/org/apache/solr/ltr/model/TestMultipleAdditiveTreesModel.java b/solr/contrib/ltr/src/test/org/apache/solr/ltr/model/TestMultipleAdditiveTreesModel.java
index c3a8f5b..db9fd37 100644
--- a/solr/contrib/ltr/src/test/org/apache/solr/ltr/model/TestMultipleAdditiveTreesModel.java
+++ b/solr/contrib/ltr/src/test/org/apache/solr/ltr/model/TestMultipleAdditiveTreesModel.java
@@ -17,6 +17,7 @@
 package org.apache.solr.ltr.model;
 
 import org.apache.lucene.util.LuceneTestCase;
+import org.apache.solr.SolrTestCaseUtil;
 import org.apache.solr.client.solrj.SolrQuery;
 import org.apache.solr.ltr.TestRerankBase;
 import org.junit.After;
@@ -124,9 +125,8 @@ public class TestMultipleAdditiveTreesModel extends TestRerankBase {
   public void multipleAdditiveTreesTestNoParams() throws Exception {
     final ModelException expectedException =
         new ModelException("no trees declared for model multipleadditivetreesmodel_no_params");
-    Exception ex = expectThrows(Exception.class, () -> {
-      createModelFromFiles("multipleadditivetreesmodel_no_params.json",
-          "multipleadditivetreesmodel_features.json");
+    Exception ex = SolrTestCaseUtil.expectThrows(Exception.class, () -> {
+      createModelFromFiles("multipleadditivetreesmodel_no_params.json", "multipleadditivetreesmodel_features.json");
     });
     Throwable rootError = getRootCause(ex);
     assertEquals(expectedException.toString(), rootError.toString());
@@ -136,9 +136,8 @@ public class TestMultipleAdditiveTreesModel extends TestRerankBase {
   public void multipleAdditiveTreesTestEmptyParams() throws Exception {
     final ModelException expectedException =
         new ModelException("no trees declared for model multipleadditivetreesmodel_no_trees");
-    Exception ex = expectThrows(Exception.class, () -> {
-      createModelFromFiles("multipleadditivetreesmodel_no_trees.json",
-          "multipleadditivetreesmodel_features.json");
+    Exception ex = SolrTestCaseUtil.expectThrows(Exception.class, () -> {
+      createModelFromFiles("multipleadditivetreesmodel_no_trees.json", "multipleadditivetreesmodel_features.json");
     });
     Throwable rootError = getRootCause(ex);
     assertEquals(expectedException.toString(), rootError.toString());
@@ -148,9 +147,8 @@ public class TestMultipleAdditiveTreesModel extends TestRerankBase {
   public void multipleAdditiveTreesTestNoWeight() throws Exception {
     final ModelException expectedException =
         new ModelException("MultipleAdditiveTreesModel tree doesn't contain a weight");
-    Exception ex = expectThrows(Exception.class, () -> {
-      createModelFromFiles("multipleadditivetreesmodel_no_weight.json",
-          "multipleadditivetreesmodel_features.json");
+    Exception ex = SolrTestCaseUtil.expectThrows(Exception.class, () -> {
+      createModelFromFiles("multipleadditivetreesmodel_no_weight.json", "multipleadditivetreesmodel_features.json");
     });
     Throwable rootError = getRootCause(ex);
     assertEquals(expectedException.toString(), rootError.toString());
@@ -160,9 +158,8 @@ public class TestMultipleAdditiveTreesModel extends TestRerankBase {
   public void multipleAdditiveTreesTestTreesParamDoesNotContatinTree() throws Exception {
     final ModelException expectedException =
         new ModelException("MultipleAdditiveTreesModel tree doesn't contain a tree");
-    Exception ex = expectThrows(Exception.class, () -> {
-      createModelFromFiles("multipleadditivetreesmodel_no_tree.json",
-          "multipleadditivetreesmodel_features.json");
+    Exception ex = SolrTestCaseUtil.expectThrows(Exception.class, () -> {
+      createModelFromFiles("multipleadditivetreesmodel_no_tree.json", "multipleadditivetreesmodel_features.json");
     });
     Throwable rootError = getRootCause(ex);
     assertEquals(expectedException.toString(), rootError.toString());
@@ -172,9 +169,8 @@ public class TestMultipleAdditiveTreesModel extends TestRerankBase {
   public void multipleAdditiveTreesTestNoFeaturesSpecified() throws Exception {
     final ModelException expectedException =
         new ModelException("no features declared for model multipleadditivetreesmodel_no_features");
-    Exception ex = expectThrows(Exception.class, () -> {
-      createModelFromFiles("multipleadditivetreesmodel_no_features.json",
-          "multipleadditivetreesmodel_features.json");
+    Exception ex = SolrTestCaseUtil.expectThrows(Exception.class, () -> {
+      createModelFromFiles("multipleadditivetreesmodel_no_features.json", "multipleadditivetreesmodel_features.json");
     });
     Throwable rootError = getRootCause(ex);
     assertEquals(expectedException.toString(), rootError.toString());
@@ -184,9 +180,8 @@ public class TestMultipleAdditiveTreesModel extends TestRerankBase {
   public void multipleAdditiveTreesTestNoRight() throws Exception {
     final ModelException expectedException =
         new ModelException("MultipleAdditiveTreesModel tree node is missing right");
-    Exception ex = expectThrows(Exception.class, () -> {
-      createModelFromFiles("multipleadditivetreesmodel_no_right.json",
-          "multipleadditivetreesmodel_features.json");
+    Exception ex = SolrTestCaseUtil.expectThrows(Exception.class, () -> {
+      createModelFromFiles("multipleadditivetreesmodel_no_right.json", "multipleadditivetreesmodel_features.json");
     });
     Throwable rootError = getRootCause(ex);
     assertEquals(expectedException.toString(), rootError.toString());
@@ -196,9 +191,8 @@ public class TestMultipleAdditiveTreesModel extends TestRerankBase {
   public void multipleAdditiveTreesTestNoLeft() throws Exception {
     final ModelException expectedException =
         new ModelException("MultipleAdditiveTreesModel tree node is missing left");
-    Exception ex = expectThrows(Exception.class, () -> {
-      createModelFromFiles("multipleadditivetreesmodel_no_left.json",
-          "multipleadditivetreesmodel_features.json");
+    Exception ex = SolrTestCaseUtil.expectThrows(Exception.class, () -> {
+      createModelFromFiles("multipleadditivetreesmodel_no_left.json", "multipleadditivetreesmodel_features.json");
     });
     Throwable rootError = getRootCause(ex);
     assertEquals(expectedException.toString(), rootError.toString());
@@ -208,9 +202,8 @@ public class TestMultipleAdditiveTreesModel extends TestRerankBase {
   public void multipleAdditiveTreesTestNoThreshold() throws Exception {
     final ModelException expectedException =
         new ModelException("MultipleAdditiveTreesModel tree node is missing threshold");
-    Exception ex = expectThrows(Exception.class, () -> {
-      createModelFromFiles("multipleadditivetreesmodel_no_threshold.json",
-          "multipleadditivetreesmodel_features.json");
+    Exception ex = SolrTestCaseUtil.expectThrows(Exception.class, () -> {
+      createModelFromFiles("multipleadditivetreesmodel_no_threshold.json", "multipleadditivetreesmodel_features.json");
     });
     Throwable rootError = getRootCause(ex);
     assertEquals(expectedException.toString(), rootError.toString());
@@ -221,9 +214,8 @@ public class TestMultipleAdditiveTreesModel extends TestRerankBase {
     final ModelException expectedException =
         new ModelException("MultipleAdditiveTreesModel tree node is leaf with left=-100.0 and right=75.0");
 
-    ModelException ex = expectThrows(ModelException.class, () -> {
-      createModelFromFiles("multipleadditivetreesmodel_no_feature.json",
-          "multipleadditivetreesmodel_features.json");
+    ModelException ex = SolrTestCaseUtil.expectThrows(ModelException.class, () -> {
+      createModelFromFiles("multipleadditivetreesmodel_no_feature.json", "multipleadditivetreesmodel_features.json");
     });
     assertEquals(expectedException.toString(), ex.toString());
   }
diff --git a/solr/contrib/ltr/src/test/org/apache/solr/ltr/model/TestNeuralNetworkModel.java b/solr/contrib/ltr/src/test/org/apache/solr/ltr/model/TestNeuralNetworkModel.java
index f542744..c9eb5bb 100644
--- a/solr/contrib/ltr/src/test/org/apache/solr/ltr/model/TestNeuralNetworkModel.java
+++ b/solr/contrib/ltr/src/test/org/apache/solr/ltr/model/TestNeuralNetworkModel.java
@@ -24,6 +24,7 @@ import java.util.Map;
 
 import org.apache.lucene.search.Explanation;
 import org.apache.lucene.util.LuceneTestCase;
+import org.apache.solr.SolrTestCaseUtil;
 import org.apache.solr.ltr.TestRerankBase;
 import org.apache.solr.ltr.feature.Feature;
 import org.apache.solr.ltr.norm.IdentityNormalizer;
@@ -207,9 +208,8 @@ public class TestNeuralNetworkModel extends TestRerankBase {
   public void badActivationTest() throws Exception {
     final ModelException expectedException =
             new ModelException("Invalid activation function (\"sig\") in layer 0 of model \"neuralnetworkmodel_bad_activation\".");
-    Exception ex = expectThrows(Exception.class, () -> {
-      createModelFromFiles("neuralnetworkmodel_bad_activation.json",
-          "neuralnetworkmodel_features.json");
+    Exception ex = SolrTestCaseUtil.expectThrows(Exception.class, () -> {
+      createModelFromFiles("neuralnetworkmodel_bad_activation.json", "neuralnetworkmodel_features.json");
     });
     Throwable rootError = getRootCause(ex);
     assertEquals(expectedException.toString(), rootError.toString());
@@ -220,9 +220,8 @@ public class TestNeuralNetworkModel extends TestRerankBase {
     final ModelException expectedException =
             new ModelException("Dimension mismatch in model \"neuralnetworkmodel_mismatch_bias\". " +
                                "Layer 0 has 2 bias weights but 3 weight matrix rows.");
-    Exception ex = expectThrows(Exception.class, () -> {
-      createModelFromFiles("neuralnetworkmodel_mismatch_bias.json",
-          "neuralnetworkmodel_features.json");
+    Exception ex = SolrTestCaseUtil.expectThrows(Exception.class, () -> {
+      createModelFromFiles("neuralnetworkmodel_mismatch_bias.json", "neuralnetworkmodel_features.json");
     });
     Throwable rootError = getRootCause(ex);
     assertEquals(expectedException.toString(), rootError.toString());
@@ -233,9 +232,8 @@ public class TestNeuralNetworkModel extends TestRerankBase {
     final ModelException expectedException =
         new ModelException("Dimension mismatch in model \"neuralnetworkmodel_mismatch_input\". The input has " +
                            "4 features, but the weight matrix for layer 0 has 3 columns.");
-    Exception ex = expectThrows(Exception.class,  () -> {
-      createModelFromFiles("neuralnetworkmodel_mismatch_input.json",
-          "neuralnetworkmodel_features.json");
+    Exception ex = SolrTestCaseUtil.expectThrows(Exception.class, () -> {
+      createModelFromFiles("neuralnetworkmodel_mismatch_input.json", "neuralnetworkmodel_features.json");
     });
     Throwable rootError = getRootCause(ex);
     assertEquals(expectedException.toString(), rootError.toString());
@@ -246,9 +244,8 @@ public class TestNeuralNetworkModel extends TestRerankBase {
     final ModelException expectedException =
         new ModelException("Dimension mismatch in model \"neuralnetworkmodel_mismatch_layers\". The weight matrix " +
                            "for layer 0 has 2 rows, but the weight matrix for layer 1 has 3 columns.");
-    Exception ex = expectThrows(Exception.class, () -> {
-      createModelFromFiles("neuralnetworkmodel_mismatch_layers.json",
-          "neuralnetworkmodel_features.json");
+    Exception ex = SolrTestCaseUtil.expectThrows(Exception.class, () -> {
+      createModelFromFiles("neuralnetworkmodel_mismatch_layers.json", "neuralnetworkmodel_features.json");
     });
     Throwable rootError = getRootCause(ex);
     assertEquals(expectedException.toString(), rootError.toString());
@@ -259,9 +256,8 @@ public class TestNeuralNetworkModel extends TestRerankBase {
     final ModelException expectedException =
         new ModelException("Dimension mismatch in model \"neuralnetworkmodel_too_many_rows\". " +
                            "Layer 1 has 1 bias weights but 2 weight matrix rows.");
-    Exception ex = expectThrows(Exception.class, () -> {
-      createModelFromFiles("neuralnetworkmodel_too_many_rows.json",
-          "neuralnetworkmodel_features.json");
+    Exception ex = SolrTestCaseUtil.expectThrows(Exception.class, () -> {
+      createModelFromFiles("neuralnetworkmodel_too_many_rows.json", "neuralnetworkmodel_features.json");
     });
     Throwable rootError = getRootCause(ex);
     assertEquals(expectedException.toString(), rootError.toString());
diff --git a/solr/contrib/ltr/src/test/org/apache/solr/ltr/model/TestWrapperModel.java b/solr/contrib/ltr/src/test/org/apache/solr/ltr/model/TestWrapperModel.java
index b31a6ba..3b25e3b 100644
--- a/solr/contrib/ltr/src/test/org/apache/solr/ltr/model/TestWrapperModel.java
+++ b/solr/contrib/ltr/src/test/org/apache/solr/ltr/model/TestWrapperModel.java
@@ -24,6 +24,7 @@ import java.util.Collections;
 import java.util.List;
 import java.util.Map;
 
+import org.apache.solr.SolrTestCaseUtil;
 import org.apache.solr.ltr.TestRerankBase;
 import org.apache.solr.ltr.feature.Feature;
 import org.apache.solr.ltr.feature.ValueFeature;
@@ -68,13 +69,13 @@ public class TestWrapperModel extends TestRerankBase {
     // wrapper model with features
     WrapperModel wrapperModelWithFeatures = new StubWrapperModel("testModel",
         Collections.singletonList(new ValueFeature("val", Collections.emptyMap())), Collections.emptyList());
-    ModelException e = expectThrows(ModelException.class, wrapperModelWithFeatures::validate);
+    ModelException e = SolrTestCaseUtil.expectThrows(ModelException.class, wrapperModelWithFeatures::validate);
     assertEquals("features must be empty for the wrapper model testModel", e.getMessage());
 
     // wrapper model with norms
     WrapperModel wrapperModelWithNorms = new StubWrapperModel("testModel",
         Collections.emptyList(), Collections.singletonList(IdentityNormalizer.INSTANCE));
-    e = expectThrows(ModelException.class, wrapperModelWithNorms::validate);
+    e = SolrTestCaseUtil.expectThrows(ModelException.class, wrapperModelWithNorms::validate);
     assertEquals("norms must be empty for the wrapper model testModel", e.getMessage());
 
     assumeWorkingMockito();
@@ -104,7 +105,7 @@ public class TestWrapperModel extends TestRerankBase {
                   IdentityNormalizer.INSTANCE,
                   IdentityNormalizer.INSTANCE)
               );
-      e = expectThrows(ModelException.class, () -> wrapperModel.updateModel(wrappedModel));
+      e = SolrTestCaseUtil.expectThrows(ModelException.class, () -> wrapperModel.updateModel(wrappedModel));
       assertEquals("wrapper feature store name (_DEFAULT_) must match the wrapped feature store name (wrappedFeatureStore)", e.getMessage());
     }
 
@@ -117,7 +118,7 @@ public class TestWrapperModel extends TestRerankBase {
                   IdentityNormalizer.INSTANCE,
                   IdentityNormalizer.INSTANCE)
               );
-      e = expectThrows(ModelException.class, () -> wrapperModel.updateModel(wrappedModel));
+      e = SolrTestCaseUtil.expectThrows(ModelException.class, () -> wrapperModel.updateModel(wrappedModel));
       assertEquals("no features declared for model testModel", e.getMessage());
     }
 
@@ -130,7 +131,7 @@ public class TestWrapperModel extends TestRerankBase {
                   new ValueFeature("v2", Collections.emptyMap())),
               Collections.emptyList()
               );
-      e = expectThrows(ModelException.class, () -> wrapperModel.updateModel(wrappedModel));
+      e = SolrTestCaseUtil.expectThrows(ModelException.class, () -> wrapperModel.updateModel(wrappedModel));
       assertEquals("counted 2 features and 0 norms in model testModel", e.getMessage());
     }
   }
diff --git a/solr/contrib/ltr/src/test/org/apache/solr/ltr/norm/TestMinMaxNormalizer.java b/solr/contrib/ltr/src/test/org/apache/solr/ltr/norm/TestMinMaxNormalizer.java
index fb50993..c492404 100644
--- a/solr/contrib/ltr/src/test/org/apache/solr/ltr/norm/TestMinMaxNormalizer.java
+++ b/solr/contrib/ltr/src/test/org/apache/solr/ltr/norm/TestMinMaxNormalizer.java
@@ -21,7 +21,7 @@ import java.util.HashMap;
 import java.util.Map;
 
 import org.apache.solr.SolrTestCase;
-import org.apache.solr.SolrTestCaseJ4;
+import org.apache.solr.SolrTestCaseUtil;
 import org.apache.solr.core.SolrResourceLoader;
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
@@ -102,7 +102,7 @@ public class TestMinMaxNormalizer extends SolrTestCase {
     final NormalizerException expectedException =
         new NormalizerException("MinMax Normalizer delta must not be zero "
             + "| min = 10.0,max = 10.0,delta = 0.0");
-    NormalizerException ex = SolrTestCaseJ4.expectThrows(NormalizerException.class,
+    NormalizerException ex = SolrTestCaseUtil.expectThrows(NormalizerException.class,
         () -> implTestMinMax(params, 10.0f, 10.0f)
     );
     assertEquals(expectedException.toString(), ex.toString());
diff --git a/solr/contrib/ltr/src/test/org/apache/solr/ltr/norm/TestStandardNormalizer.java b/solr/contrib/ltr/src/test/org/apache/solr/ltr/norm/TestStandardNormalizer.java
index bea3d28..9305ef4 100644
--- a/solr/contrib/ltr/src/test/org/apache/solr/ltr/norm/TestStandardNormalizer.java
+++ b/solr/contrib/ltr/src/test/org/apache/solr/ltr/norm/TestStandardNormalizer.java
@@ -21,7 +21,7 @@ import java.util.HashMap;
 import java.util.Map;
 
 import org.apache.solr.SolrTestCase;
-import org.apache.solr.SolrTestCaseJ4;
+import org.apache.solr.SolrTestCaseUtil;
 import org.apache.solr.core.SolrResourceLoader;
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
@@ -73,7 +73,7 @@ public class TestStandardNormalizer extends SolrTestCase {
     final NormalizerException expectedException =
         new NormalizerException("Standard Normalizer standard deviation must be positive "
             + "| avg = 0.0,std = 0.0");
-    NormalizerException ex = SolrTestCaseJ4.expectThrows(NormalizerException.class,
+    NormalizerException ex = SolrTestCaseUtil.expectThrows(NormalizerException.class,
         () -> implTestStandard(params, 0.0f, 0.0f)
     );
     assertEquals(expectedException.toString(), ex.toString());
@@ -87,7 +87,7 @@ public class TestStandardNormalizer extends SolrTestCase {
         new NormalizerException("Standard Normalizer standard deviation must be positive "
             + "| avg = 0.0,std = -1.0");
 
-    NormalizerException ex = SolrTestCaseJ4.expectThrows(NormalizerException.class,
+    NormalizerException ex = SolrTestCaseUtil.expectThrows(NormalizerException.class,
         () -> implTestStandard(params, 0.0f, -1f)
     );
     assertEquals(expectedException.toString(), ex.toString());
@@ -102,7 +102,7 @@ public class TestStandardNormalizer extends SolrTestCase {
         new NormalizerException("Standard Normalizer standard deviation must be positive "
             + "| avg = 1.0,std = 0.0");
 
-    NormalizerException ex = SolrTestCaseJ4.expectThrows(NormalizerException.class,
+    NormalizerException ex = SolrTestCaseUtil.expectThrows(NormalizerException.class,
         () -> implTestStandard(params, 1f, 0f)
     );
     assertEquals(expectedException.toString(), ex.toString());
diff --git a/solr/contrib/ltr/src/test/org/apache/solr/ltr/store/rest/TestManagedFeatureStore.java b/solr/contrib/ltr/src/test/org/apache/solr/ltr/store/rest/TestManagedFeatureStore.java
index 9257e9c..85b61e3 100644
--- a/solr/contrib/ltr/src/test/org/apache/solr/ltr/store/rest/TestManagedFeatureStore.java
+++ b/solr/contrib/ltr/src/test/org/apache/solr/ltr/store/rest/TestManagedFeatureStore.java
@@ -20,6 +20,7 @@ import java.util.HashMap;
 import java.util.Map;
 
 import org.apache.solr.SolrTestCaseJ4;
+import org.apache.solr.SolrTestCaseUtil;
 import org.apache.solr.ltr.feature.Feature;
 import org.apache.solr.ltr.feature.FeatureException;
 import org.apache.solr.ltr.feature.OriginalScoreFeature;
@@ -142,7 +143,7 @@ public class TestManagedFeatureStore extends SolrTestCaseJ4 {
     final String nonExistingClassName = "org.apache.solr.ltr.feature.LOLFeature";
     final ClassNotFoundException expectedException =
         new ClassNotFoundException(nonExistingClassName);
-    Exception ex = expectThrows(Exception.class, () -> {
+    Exception ex = SolrTestCaseUtil.expectThrows(Exception.class, () -> {
       fstore.addFeature(createMap("test", nonExistingClassName, null), "testFstore2");
     });
     Throwable rootError = getRootCause(ex);
diff --git a/solr/contrib/prometheus-exporter/src/test/org/apache/solr/prometheus/PrometheusExporterTestBase.java b/solr/contrib/prometheus-exporter/src/test/org/apache/solr/prometheus/PrometheusExporterTestBase.java
index 31d70cb..c2fba24 100644
--- a/solr/contrib/prometheus-exporter/src/test/org/apache/solr/prometheus/PrometheusExporterTestBase.java
+++ b/solr/contrib/prometheus-exporter/src/test/org/apache/solr/prometheus/PrometheusExporterTestBase.java
@@ -18,6 +18,7 @@
 package org.apache.solr.prometheus;
 
 import com.google.common.collect.ImmutableMap;
+import org.apache.solr.SolrTestUtil;
 import org.apache.solr.client.solrj.request.CollectionAdminRequest;
 import org.apache.solr.cloud.SolrCloudTestCase;
 import org.apache.solr.prometheus.utils.Helpers;
@@ -27,7 +28,7 @@ public class PrometheusExporterTestBase extends SolrCloudTestCase {
 
   public static final String COLLECTION = "collection1";
   public static final String CONF_NAME = COLLECTION + "_config";
-  public static final String CONF_DIR = getFile("solr/" + COLLECTION + "/conf").getAbsolutePath();
+  public static final String CONF_DIR = SolrTestUtil.getFile("solr/" + COLLECTION + "/conf").getAbsolutePath();
   public static final int NUM_SHARDS = 2;
   public static final int NUM_REPLICAS = 2;
   public static final int MAX_SHARDS_PER_NODE = 3;
@@ -60,7 +61,7 @@ public class PrometheusExporterTestBase extends SolrCloudTestCase {
   @BeforeClass
   public static void setupCluster() throws Exception {
     configureCluster(NUM_NODES)
-        .addConfig(CONF_NAME, getFile(CONF_DIR).toPath())
+        .addConfig(CONF_NAME, SolrTestUtil.getFile(CONF_DIR).toPath())
         .configure();
 
     CollectionAdminRequest
diff --git a/solr/contrib/prometheus-exporter/src/test/org/apache/solr/prometheus/scraper/SolrStandaloneScraperTest.java b/solr/contrib/prometheus-exporter/src/test/org/apache/solr/prometheus/scraper/SolrStandaloneScraperTest.java
index 144a413..a35530a 100644
--- a/solr/contrib/prometheus-exporter/src/test/org/apache/solr/prometheus/scraper/SolrStandaloneScraperTest.java
+++ b/solr/contrib/prometheus-exporter/src/test/org/apache/solr/prometheus/scraper/SolrStandaloneScraperTest.java
@@ -20,6 +20,7 @@ package org.apache.solr.prometheus.scraper;
 import io.prometheus.client.Collector;
 import org.apache.commons.io.FileUtils;
 import org.apache.lucene.util.LuceneTestCase;
+import org.apache.solr.SolrTestUtil;
 import org.apache.solr.client.solrj.impl.Http2SolrClient;
 import org.apache.solr.client.solrj.impl.NoOpResponseParser;
 import org.apache.solr.common.ParWork;
@@ -51,9 +52,9 @@ public class SolrStandaloneScraperTest extends RestTestBase {
 
   @Before
   public void setUp() throws Exception {
-    File tmpSolrHome = createTempDir().toFile();
+    File tmpSolrHome = SolrTestUtil.createTempDir().toFile();
 
-    FileUtils.copyDirectory(new File(TEST_HOME()), tmpSolrHome.getAbsoluteFile());
+    FileUtils.copyDirectory(new File(SolrTestUtil.TEST_HOME()), tmpSolrHome.getAbsoluteFile());
 
     createJettyAndHarness(
         tmpSolrHome.getAbsolutePath(),
@@ -64,7 +65,7 @@ public class SolrStandaloneScraperTest extends RestTestBase {
         null);
 
     executor = ParWork.getMyPerThreadExecutor();
-    configuration = Helpers.loadConfiguration(TEST_PATH().resolve("..").resolve("conf").resolve("prometheus-solr-exporter-scraper-test-config.xml").toString());
+    configuration = Helpers.loadConfiguration(SolrTestUtil.TEST_PATH().resolve("..").resolve("conf").resolve("prometheus-solr-exporter-scraper-test-config.xml").toString());
 
     solrClient = getHttpSolrClient(restTestHarness.getAdminURL());
     solrScraper = new SolrStandaloneScraper(solrClient, executor);
diff --git a/solr/contrib/prometheus-exporter/src/test/org/apache/solr/prometheus/utils/Helpers.java b/solr/contrib/prometheus-exporter/src/test/org/apache/solr/prometheus/utils/Helpers.java
index 5dcfb71..9f14129 100644
--- a/solr/contrib/prometheus-exporter/src/test/org/apache/solr/prometheus/utils/Helpers.java
+++ b/solr/contrib/prometheus-exporter/src/test/org/apache/solr/prometheus/utils/Helpers.java
@@ -23,7 +23,7 @@ import java.nio.file.Path;
 import java.nio.file.Paths;
 import java.util.Objects;
 
-import org.apache.solr.SolrTestCaseJ4;
+import org.apache.solr.SolrTestUtil;
 import org.apache.solr.client.solrj.SolrClient;
 import org.apache.solr.client.solrj.SolrServerException;
 import org.apache.solr.client.solrj.request.ContentStreamUpdateRequest;
@@ -44,7 +44,7 @@ public class Helpers {
   }
 
   public static void indexAllDocs(SolrClient client) throws IOException, SolrServerException {
-    File exampleDocsDir = new File(SolrTestCaseJ4.getFile("exampledocs").getAbsolutePath());
+    File exampleDocsDir = new File(SolrTestUtil.getFile("exampledocs").getAbsolutePath());
     File[] xmlFiles = Objects.requireNonNull(exampleDocsDir.listFiles((dir, name) -> name.endsWith(".xml")));
     for (File xml : xmlFiles) {
       ContentStreamUpdateRequest req = new ContentStreamUpdateRequest("/update");
diff --git a/solr/contrib/velocity/src/test/org/apache/solr/velocity/VelocityResponseWriterTest.java b/solr/contrib/velocity/src/test/org/apache/solr/velocity/VelocityResponseWriterTest.java
index ad37064..d39a38c 100644
--- a/solr/contrib/velocity/src/test/org/apache/solr/velocity/VelocityResponseWriterTest.java
+++ b/solr/contrib/velocity/src/test/org/apache/solr/velocity/VelocityResponseWriterTest.java
@@ -22,7 +22,9 @@ import java.io.StringWriter;
 import java.security.AccessControlException;
 import java.util.Properties;
 
+import org.apache.lucene.util.LuceneTestCase;
 import org.apache.solr.SolrTestCaseJ4;
+import org.apache.solr.SolrTestUtil;
 import org.apache.solr.common.SolrException;
 import org.apache.solr.common.util.NamedList;
 import org.apache.solr.request.SolrQueryRequest;
@@ -39,7 +41,7 @@ import org.junit.Test;
 public class VelocityResponseWriterTest extends SolrTestCaseJ4 {
   @BeforeClass
   public static void beforeClass() throws Exception {
-    initCore("solrconfig.xml", "schema.xml", getFile("velocity/solr").getAbsolutePath());
+    initCore("solrconfig.xml", "schema.xml", SolrTestUtil.getFile("velocity/solr").getAbsolutePath());
   }
 
   @AfterClass
@@ -63,7 +65,7 @@ public class VelocityResponseWriterTest extends SolrTestCaseJ4 {
   public void testSecureUberspector() throws Exception {
     VelocityResponseWriter vrw = new VelocityResponseWriter();
     NamedList<String> nl = new NamedList<>();
-    nl.add("template.base.dir", getFile("velocity").getAbsolutePath());
+    nl.add("template.base.dir", SolrTestUtil.getFile("velocity").getAbsolutePath());
     vrw.init(nl);
     SolrQueryRequest req = req(VelocityResponseWriter.TEMPLATE,"outside_the_box");
     SolrQueryResponse rsp = new SolrQueryResponse();
@@ -75,10 +77,10 @@ public class VelocityResponseWriterTest extends SolrTestCaseJ4 {
   @Test
   @Ignore("SOLR-14025: Velocity's SecureUberspector addresses this")
   public void testTemplateSandbox() throws Exception {
-    assumeTrue("This test only works with security manager", System.getSecurityManager() != null);
+    LuceneTestCase.assumeTrue("This test only works with security manager", System.getSecurityManager() != null);
     VelocityResponseWriter vrw = new VelocityResponseWriter();
     NamedList<String> nl = new NamedList<>();
-    nl.add("template.base.dir", getFile("velocity").getAbsolutePath());
+    nl.add("template.base.dir", SolrTestUtil.getFile("velocity").getAbsolutePath());
     vrw.init(nl);
     SolrQueryRequest req = req(VelocityResponseWriter.TEMPLATE,"outside_the_box");
     SolrQueryResponse rsp = new SolrQueryResponse();
@@ -96,10 +98,10 @@ public class VelocityResponseWriterTest extends SolrTestCaseJ4 {
   @Test
   @Ignore("SOLR-14025: Velocity's SecureUberspector addresses this")
   public void testSandboxIntersection() throws Exception {
-    assumeTrue("This test only works with security manager", System.getSecurityManager() != null);
+    LuceneTestCase.assumeTrue("This test only works with security manager", System.getSecurityManager() != null);
     VelocityResponseWriter vrw = new VelocityResponseWriter();
     NamedList<String> nl = new NamedList<>();
-    nl.add("template.base.dir", getFile("velocity").getAbsolutePath());
+    nl.add("template.base.dir", SolrTestUtil.getFile("velocity").getAbsolutePath());
     vrw.init(nl);
     SolrQueryRequest req = req(VelocityResponseWriter.TEMPLATE,"sandbox_intersection");
     SolrQueryResponse rsp = new SolrQueryResponse();
@@ -118,7 +120,7 @@ public class VelocityResponseWriterTest extends SolrTestCaseJ4 {
   public void testFileResourceLoader() throws Exception {
     VelocityResponseWriter vrw = new VelocityResponseWriter();
     NamedList<String> nl = new NamedList<>();
-    nl.add("template.base.dir", getFile("velocity").getAbsolutePath());
+    nl.add("template.base.dir", SolrTestUtil.getFile("velocity").getAbsolutePath());
     vrw.init(nl);
     SolrQueryRequest req = req(VelocityResponseWriter.TEMPLATE,"file");
     SolrQueryResponse rsp = new SolrQueryResponse();
diff --git a/solr/core/src/java/org/apache/solr/cloud/Overseer.java b/solr/core/src/java/org/apache/solr/cloud/Overseer.java
index f38d2da..0716783 100644
--- a/solr/core/src/java/org/apache/solr/cloud/Overseer.java
+++ b/solr/core/src/java/org/apache/solr/cloud/Overseer.java
@@ -74,7 +74,6 @@ import java.util.List;
 import java.util.Map;
 import java.util.Set;
 import java.util.concurrent.ExecutorService;
-import java.util.concurrent.LinkedBlockingQueue;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.locks.ReentrantLock;
 import java.util.function.BiConsumer;
diff --git a/solr/core/src/java/org/apache/solr/cloud/ReplicateFromLeader.java b/solr/core/src/java/org/apache/solr/cloud/ReplicateFromLeader.java
index eb6c062..0a941fd 100644
--- a/solr/core/src/java/org/apache/solr/cloud/ReplicateFromLeader.java
+++ b/solr/core/src/java/org/apache/solr/cloud/ReplicateFromLeader.java
@@ -31,7 +31,6 @@ import org.apache.solr.common.util.ObjectReleaseTracker;
 import org.apache.solr.core.CoreContainer;
 import org.apache.solr.core.SolrConfig;
 import org.apache.solr.core.SolrCore;
-import org.apache.solr.handler.IndexFetcher;
 import org.apache.solr.handler.ReplicationHandler;
 import org.apache.solr.request.LocalSolrQueryRequest;
 import org.apache.solr.request.SolrQueryRequest;
diff --git a/solr/core/src/java/org/apache/solr/cloud/api/collections/CreateShardCmd.java b/solr/core/src/java/org/apache/solr/cloud/api/collections/CreateShardCmd.java
index bb1d69b..e274390 100644
--- a/solr/core/src/java/org/apache/solr/cloud/api/collections/CreateShardCmd.java
+++ b/solr/core/src/java/org/apache/solr/cloud/api/collections/CreateShardCmd.java
@@ -146,44 +146,57 @@ public class CreateShardCmd implements OverseerCollectionMessageHandler.Cmd {
     log.info("Finished create command on all shards for collection: {}", collectionName);
     AddReplicaCmd.Response response = new AddReplicaCmd.Response();
 
-    response.asyncFinalRunner = new OverseerCollectionMessageHandler.Finalize() {
-      @Override
-      public AddReplicaCmd.Response call() {
-        try {
-          shardRequestTracker.processResponses(results, shardHandler, false, null, Collections.emptySet());
-        } catch (KeeperException e) {
-          log.error("", e);
-          throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, e);
-        } catch (InterruptedException e) {
-          ParWork.propagateInterrupt(e);
-          throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, e);
-        }
-        //  nocommit - put this in finalizer and finalizer after all calls to allow parallel and forward momentum
-
-        if (resp.asyncFinalRunner != null) {
-          try {
-            resp.asyncFinalRunner.call();
-          } catch (Exception e) {
-            log.error("Exception waiting for active replicas", e);
-          }
-        }
+    response.asyncFinalRunner = new MyFinalize(shardRequestTracker, results, shardHandler, resp);
 
-        @SuppressWarnings({"rawtypes"}) boolean failure = results.get("failure") != null && ((SimpleOrderedMap) results.get("failure")).size() > 0;
-        if (failure) {
+    response.clusterState = clusterState;
+    return response;
+  }
+
+  private static class MyFinalize implements OverseerCollectionMessageHandler.Finalize {
+    private final OverseerCollectionMessageHandler.ShardRequestTracker shardRequestTracker;
+    private final NamedList results;
+    private final ShardHandler shardHandler;
+    private final AddReplicaCmd.Response resp;
+
+    public MyFinalize(OverseerCollectionMessageHandler.ShardRequestTracker shardRequestTracker, NamedList results, ShardHandler shardHandler, AddReplicaCmd.Response resp) {
+      this.shardRequestTracker = shardRequestTracker;
+      this.results = results;
+      this.shardHandler = shardHandler;
+      this.resp = resp;
+    }
 
-        } else {
+    @Override
+    public AddReplicaCmd.Response call() {
+      try {
+        shardRequestTracker.processResponses(results, shardHandler, false, null, Collections.emptySet());
+      } catch (KeeperException e) {
+        log.error("", e);
+        throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, e);
+      } catch (InterruptedException e) {
+        ParWork.propagateInterrupt(e);
+        throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, e);
+      }
+      //  nocommit - put this in finalizer and finalizer after all calls to allow parallel and forward momentum
 
+      if (resp.asyncFinalRunner != null) {
+        try {
+          resp.asyncFinalRunner.call();
+        } catch (Exception e) {
+          log.error("Exception waiting for active replicas", e);
         }
+      }
+
+      @SuppressWarnings({"rawtypes"}) boolean failure = results.get("failure") != null && ((SimpleOrderedMap) results.get("failure")).size() > 0;
+      if (failure) {
+
+      } else {
 
-        //ocmh.zkStateReader.waitForActiveCollection(collectionName, 10, TimeUnit.SECONDS, shardNames.size(), finalReplicaPositions.size());
-        AddReplicaCmd.Response response = new AddReplicaCmd.Response();
-        return response;
       }
 
-    };
+      //ocmh.zkStateReader.waitForActiveCollection(collectionName, 10, TimeUnit.SECONDS, shardNames.size(), finalReplicaPositions.size());
+      AddReplicaCmd.Response response = new AddReplicaCmd.Response();
+      return response;
+    }
 
-    response.clusterState = clusterState;
-    return response;
   }
-
 }
diff --git a/solr/core/src/java/org/apache/solr/cloud/api/collections/DimensionalRoutedAlias.java b/solr/core/src/java/org/apache/solr/cloud/api/collections/DimensionalRoutedAlias.java
index 499642a..df9d583 100644
--- a/solr/core/src/java/org/apache/solr/cloud/api/collections/DimensionalRoutedAlias.java
+++ b/solr/core/src/java/org/apache/solr/cloud/api/collections/DimensionalRoutedAlias.java
@@ -185,7 +185,7 @@ public class DimensionalRoutedAlias extends RoutedAlias {
         max = subCol.getCreationType();
       }
     }
-    return new CandidateCollection(max,destCol.toString(),col2Create.toString());
+    return new CandidateCollection(max, destCol.toString(), col2Create.toString());
   }
 
   @Override
diff --git a/solr/core/src/java/org/apache/solr/cloud/api/collections/MoveReplicaCmd.java b/solr/core/src/java/org/apache/solr/cloud/api/collections/MoveReplicaCmd.java
index 9ec8ec1..65243d6 100644
--- a/solr/core/src/java/org/apache/solr/cloud/api/collections/MoveReplicaCmd.java
+++ b/solr/core/src/java/org/apache/solr/cloud/api/collections/MoveReplicaCmd.java
@@ -166,20 +166,7 @@ public class MoveReplicaCmd implements OverseerCollectionMessageHandler.Cmd {
     AddReplicaCmd.Response response = new AddReplicaCmd.Response();
 
     OverseerCollectionMessageHandler.Finalize finalizer = resp.asyncFinalRunner;
-    response.asyncFinalRunner = new OverseerCollectionMessageHandler.Finalize() {
-      @Override
-      public AddReplicaCmd.Response call() {
-        if (finalizer != null) {
-          try {
-            finalizer.call();
-          } catch (Exception e) {
-            log.error("Exception during MoveReplica", e);
-          }
-        }
-        AddReplicaCmd.Response response = new AddReplicaCmd.Response();
-        return response;
-      }
-    };
+    response.asyncFinalRunner = new MyFinalize(finalizer);
 
     response.clusterState = null;
 
@@ -343,4 +330,25 @@ public class MoveReplicaCmd implements OverseerCollectionMessageHandler.Cmd {
     
     return finalResponse;
   }
+
+  private static class MyFinalize implements OverseerCollectionMessageHandler.Finalize {
+    private final OverseerCollectionMessageHandler.Finalize finalizer;
+
+    public MyFinalize(OverseerCollectionMessageHandler.Finalize finalizer) {
+      this.finalizer = finalizer;
+    }
+
+    @Override
+    public AddReplicaCmd.Response call() {
+      if (finalizer != null) {
+        try {
+          finalizer.call();
+        } catch (Exception e) {
+          log.error("Exception during MoveReplica", e);
+        }
+      }
+      AddReplicaCmd.Response response = new AddReplicaCmd.Response();
+      return response;
+    }
+  }
 }
diff --git a/solr/core/src/java/org/apache/solr/cloud/api/collections/RoutedAlias.java b/solr/core/src/java/org/apache/solr/cloud/api/collections/RoutedAlias.java
index 30b5920..e207775 100644
--- a/solr/core/src/java/org/apache/solr/cloud/api/collections/RoutedAlias.java
+++ b/solr/core/src/java/org/apache/solr/cloud/api/collections/RoutedAlias.java
@@ -281,7 +281,7 @@ public abstract class RoutedAlias {
 
   abstract CandidateCollection findCandidateGivenValue(AddUpdateCommand cmd);
 
-  class CandidateCollection {
+  static class CandidateCollection {
     private final CreationType creationType;
     private final String destinationCollection;
     private final String creationCollection;
diff --git a/solr/core/src/java/org/apache/solr/cloud/api/collections/TimeRoutedAlias.java b/solr/core/src/java/org/apache/solr/cloud/api/collections/TimeRoutedAlias.java
index c4f168a..de71894 100644
--- a/solr/core/src/java/org/apache/solr/cloud/api/collections/TimeRoutedAlias.java
+++ b/solr/core/src/java/org/apache/solr/cloud/api/collections/TimeRoutedAlias.java
@@ -518,8 +518,7 @@ public class TimeRoutedAlias extends RoutedAlias {
               String destinationCollection = candidate.getDestinationCollection(); // dest doesn't change
               String creationCollection = calcNextCollection(mostRecentCol);
               return new CandidateCollection(ASYNC_PREEMPTIVE, // add next collection
-                  destinationCollection,
-                  creationCollection);
+                  destinationCollection, creationCollection);
             }
           }
           return candidate;
diff --git a/solr/core/src/java/org/apache/solr/core/CachingDirectoryFactory.java b/solr/core/src/java/org/apache/solr/core/CachingDirectoryFactory.java
index 789f53b..808a4de 100644
--- a/solr/core/src/java/org/apache/solr/core/CachingDirectoryFactory.java
+++ b/solr/core/src/java/org/apache/solr/core/CachingDirectoryFactory.java
@@ -19,7 +19,6 @@ package org.apache.solr.core;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.store.LockFactory;
 import org.apache.lucene.util.IOUtils;
-import org.apache.solr.common.AlreadyClosedException;
 import org.apache.solr.common.ParWork;
 import org.apache.solr.common.SolrException;
 import org.apache.solr.common.util.NamedList;
diff --git a/solr/core/src/java/org/apache/solr/core/CoreContainer.java b/solr/core/src/java/org/apache/solr/core/CoreContainer.java
index 03b9385..2208130 100644
--- a/solr/core/src/java/org/apache/solr/core/CoreContainer.java
+++ b/solr/core/src/java/org/apache/solr/core/CoreContainer.java
@@ -49,7 +49,6 @@ import org.apache.solr.common.cloud.ZkNodeProps;
 import org.apache.solr.common.cloud.ZkStateReader;
 import org.apache.solr.common.util.CloseTracker;
 import org.apache.solr.common.util.ExecutorUtil;
-import org.apache.solr.common.util.IOUtils;
 import org.apache.solr.common.util.ObjectCache;
 import org.apache.solr.common.util.ObjectReleaseTracker;
 import org.apache.solr.common.util.OrderedExecutor;
diff --git a/solr/core/src/java/org/apache/solr/core/StandardDirectoryFactory.java b/solr/core/src/java/org/apache/solr/core/StandardDirectoryFactory.java
index d9ab29a..b228ce3 100644
--- a/solr/core/src/java/org/apache/solr/core/StandardDirectoryFactory.java
+++ b/solr/core/src/java/org/apache/solr/core/StandardDirectoryFactory.java
@@ -29,7 +29,6 @@ import java.nio.file.StandardCopyOption;
 import java.util.Comparator;
 import java.util.Locale;
 
-import org.apache.commons.io.FileUtils;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.store.FSDirectory;
 import org.apache.lucene.store.IOContext;
diff --git a/solr/core/src/java/org/apache/solr/handler/BlobHandler.java b/solr/core/src/java/org/apache/solr/handler/BlobHandler.java
index 12ba2c0..05fcab2 100644
--- a/solr/core/src/java/org/apache/solr/handler/BlobHandler.java
+++ b/solr/core/src/java/org/apache/solr/handler/BlobHandler.java
@@ -173,22 +173,7 @@ public class BlobHandler extends RequestHandlerBase implements PluginInfoInitial
           QParser qparser = QParser.getParser(StrUtils.formatString(q, blobName, version), req);
           final TopDocs docs = req.getSearcher().search(qparser.parse(), 1, new Sort(new SortField("version", SortField.Type.LONG, true)));
           if (docs.totalHits.value > 0) {
-            rsp.add(ReplicationHandler.FILE_STREAM, new SolrCore.RawWriter() {
-
-              @Override
-              public void write(OutputStream os) throws IOException {
-                Document doc = req.getSearcher().doc(docs.scoreDocs[0].doc);
-                IndexableField sf = doc.getField("blob");
-                FieldType fieldType = req.getSchema().getField("blob").getType();
-                ByteBuffer buf = (ByteBuffer) fieldType.toObject(sf);
-                if (buf == null) {
-                  //should never happen unless a user wrote this document directly
-                  throw new SolrException(SolrException.ErrorCode.NOT_FOUND, "Invalid document . No field called blob");
-                } else {
-                  os.write(buf.array(), 0, buf.limit());
-                }
-              }
-            });
+            rsp.add(ReplicationHandler.FILE_STREAM, new MyRawWriter(req, docs));
 
           } else {
             throw new SolrException(SolrException.ErrorCode.NOT_FOUND,
@@ -313,4 +298,29 @@ public class BlobHandler extends RequestHandlerBase implements PluginInfoInitial
     }
 
   }
+
+  private static class MyRawWriter implements SolrCore.RawWriter {
+
+    private final SolrQueryRequest req;
+    private final TopDocs docs;
+
+    public MyRawWriter(SolrQueryRequest req, TopDocs docs) {
+      this.req = req;
+      this.docs = docs;
+    }
+
+    @Override
+    public void write(OutputStream os) throws IOException {
+      Document doc = req.getSearcher().doc(docs.scoreDocs[0].doc);
+      IndexableField sf = doc.getField("blob");
+      FieldType fieldType = req.getSchema().getField("blob").getType();
+      ByteBuffer buf = (ByteBuffer) fieldType.toObject(sf);
+      if (buf == null) {
+        //should never happen unless a user wrote this document directly
+        throw new SolrException(SolrException.ErrorCode.NOT_FOUND, "Invalid document . No field called blob");
+      } else {
+        os.write(buf.array(), 0, buf.limit());
+      }
+    }
+  }
 }
diff --git a/solr/core/src/java/org/apache/solr/handler/CalciteJDBCStream.java b/solr/core/src/java/org/apache/solr/handler/CalciteJDBCStream.java
index fd76cbf..c6e0705 100644
--- a/solr/core/src/java/org/apache/solr/handler/CalciteJDBCStream.java
+++ b/solr/core/src/java/org/apache/solr/handler/CalciteJDBCStream.java
@@ -49,28 +49,38 @@ public class CalciteJDBCStream extends JDBCStream {
       final String columnName = metadata.getColumnLabel(columnNumber);
       final String className = metadata.getColumnClassName(columnNumber);
       if (Array.class.getName().equals(className)) {
-        valueSelector = new ResultSetValueSelector() {
-          @Override
-          public Object selectValue(ResultSet resultSet) throws SQLException {
-            Object o = resultSet.getObject(columnNumber);
-            if (resultSet.wasNull()) {
-              return null;
-            }
-            if (o instanceof Array) {
-              Array array = (Array) o;
-              return array.getArray();
-            } else {
-              return o;
-            }
-          }
-
-          @Override
-          public String getColumnName() {
-            return columnName;
-          }
-        };
+        valueSelector = new MyResultSetValueSelector(columnNumber, columnName);
       }
     }
     return valueSelector;
   }
+
+  private static class MyResultSetValueSelector implements ResultSetValueSelector {
+    private final int columnNumber;
+    private final String columnName;
+
+    public MyResultSetValueSelector(int columnNumber, String columnName) {
+      this.columnNumber = columnNumber;
+      this.columnName = columnName;
+    }
+
+    @Override
+    public Object selectValue(ResultSet resultSet) throws SQLException {
+      Object o = resultSet.getObject(columnNumber);
+      if (resultSet.wasNull()) {
+        return null;
+      }
+      if (o instanceof Array) {
+        Array array = (Array) o;
+        return array.getArray();
+      } else {
+        return o;
+      }
+    }
+
+    @Override
+    public String getColumnName() {
+      return columnName;
+    }
+  }
 }
diff --git a/solr/core/src/java/org/apache/solr/handler/component/RealTimeGetComponent.java b/solr/core/src/java/org/apache/solr/handler/component/RealTimeGetComponent.java
index 2408a75..9427fff 100644
--- a/solr/core/src/java/org/apache/solr/handler/component/RealTimeGetComponent.java
+++ b/solr/core/src/java/org/apache/solr/handler/component/RealTimeGetComponent.java
@@ -48,7 +48,6 @@ import org.apache.lucene.util.BytesRef;
 import org.apache.lucene.util.BytesRefBuilder;
 import org.apache.solr.client.solrj.SolrResponse;
 import org.apache.solr.cloud.CloudDescriptor;
-import org.apache.solr.cloud.LeaderElector;
 import org.apache.solr.cloud.ZkController;
 import org.apache.solr.common.SolrDocument;
 import org.apache.solr.common.SolrDocumentBase;
diff --git a/solr/core/src/java/org/apache/solr/handler/loader/JsonLoader.java b/solr/core/src/java/org/apache/solr/handler/loader/JsonLoader.java
index 0f63fc4..1163d41 100644
--- a/solr/core/src/java/org/apache/solr/handler/loader/JsonLoader.java
+++ b/solr/core/src/java/org/apache/solr/handler/loader/JsonLoader.java
@@ -426,23 +426,7 @@ public class JsonLoader extends ContentStreamLoader {
       final Map<String, Object> map = (Map) ObjectBuilder.getVal(parser);
 
       // SolrParams currently expects string values...
-      SolrParams p = new SolrParams() {
-        @Override
-        public String get(String param) {
-          Object o = map.get(param);
-          return o == null ? null : o.toString();
-        }
-
-        @Override
-        public String[] getParams(String param) {
-          return new String[]{get(param)};
-        }
-
-        @Override
-        public Iterator<String> getParameterNamesIterator() {
-          return map.keySet().iterator();
-        }
-      };
+      SolrParams p = new MySolrParams(map);
 
       RequestHandlerUtils.validateCommitParams(p);
       p = SolrParams.wrapDefaults(p, req.getParams());   // default to the normal request params for commit options
@@ -640,6 +624,30 @@ public class JsonLoader extends ContentStreamLoader {
       }
       return val instanceof Map;
     }
+
+    private static class MySolrParams extends SolrParams {
+      private final Map<String,Object> map;
+
+      public MySolrParams(Map<String,Object> map) {
+        this.map = map;
+      }
+
+      @Override
+      public String get(String param) {
+        Object o = map.get(param);
+        return o == null ? null : o.toString();
+      }
+
+      @Override
+      public String[] getParams(String param) {
+        return new String[]{get(param)};
+      }
+
+      @Override
+      public Iterator<String> getParameterNamesIterator() {
+        return map.keySet().iterator();
+      }
+    }
   }
 
   @SuppressWarnings({"unchecked", "rawtypes"})
diff --git a/solr/core/src/java/org/apache/solr/highlight/DefaultSolrHighlighter.java b/solr/core/src/java/org/apache/solr/highlight/DefaultSolrHighlighter.java
index bb46574..9b32e21 100644
--- a/solr/core/src/java/org/apache/solr/highlight/DefaultSolrHighlighter.java
+++ b/solr/core/src/java/org/apache/solr/highlight/DefaultSolrHighlighter.java
@@ -248,13 +248,7 @@ public class DefaultSolrHighlighter extends SolrHighlighter implements PluginInf
    * @param request The SolrQueryRequest
    */
   protected QueryScorer getSpanQueryScorer(Query query, String fieldName, TokenStream tokenStream, SolrQueryRequest request) {
-    QueryScorer scorer = new QueryScorer(query,
-        request.getParams().getFieldBool(fieldName, HighlightParams.FIELD_MATCH, false) ? fieldName : null) {
-      @Override
-      protected WeightedSpanTermExtractor newTermExtractor(String defaultField) {
-        return new CustomSpanTermExtractor(defaultField);
-      }
-    };
+    QueryScorer scorer = new MyQueryScorer(query, request, fieldName);
     scorer.setExpandMultiTermQuery(request.getParams().getBool(HighlightParams.HIGHLIGHT_MULTI_TERM, true));
 
     boolean defaultPayloads = true;//overwritten below
@@ -502,28 +496,7 @@ public class DefaultSolrHighlighter extends SolrHighlighter implements PluginInf
       fieldHighlights = null;
     } else if (useFastVectorHighlighter(params, schemaField)) {
       if (fvhContainer.fieldQuery == null) {
-        FastVectorHighlighter fvh = new FastVectorHighlighter(
-            // FVH cannot process hl.usePhraseHighlighter parameter per-field basis
-            params.getBool(HighlightParams.USE_PHRASE_HIGHLIGHTER, true),
-            // FVH cannot process hl.requireFieldMatch parameter per-field basis
-            params.getBool(HighlightParams.FIELD_MATCH, false)) {
-          @Override
-          public FieldQuery getFieldQuery(Query query, IndexReader reader) throws IOException {
-            return new FieldQuery(query, reader, phraseHighlight, fieldMatch) {
-              @Override
-              protected void flatten(Query sourceQuery, IndexReader reader, Collection<Query> flatQueries, float boost) throws IOException {
-                if (sourceQuery instanceof ToParentBlockJoinQuery) {
-                  Query childQuery = ((ToParentBlockJoinQuery) sourceQuery).getChildQuery();
-                  if (childQuery != null) {
-                    flatten(childQuery, reader, flatQueries, boost);
-                  }
-                } else {
-                  super.flatten(sourceQuery, reader, flatQueries, boost);
-                }
-              }
-            };
-          }
-        };
+        FastVectorHighlighter fvh = new MyFastVectorHighlighter(params);
         fvh.setPhraseLimit(params.getInt(HighlightParams.PHRASE_LIMIT, SolrHighlighter.DEFAULT_PHRASE_LIMIT));
         fvhContainer.fvh = fvh;
         fvhContainer.fieldQuery = fvh.getFieldQuery(query, reader);
@@ -842,6 +815,40 @@ public class DefaultSolrHighlighter extends SolrHighlighter implements PluginInf
       this.fieldQuery = fieldQuery;
     }
   }
+
+  private static class MyQueryScorer extends QueryScorer {
+    public MyQueryScorer(Query query, SolrQueryRequest request, String fieldName) {
+      super(query, request.getParams().getFieldBool(fieldName, HighlightParams.FIELD_MATCH, false) ? fieldName : null);
+    }
+
+    @Override
+    protected WeightedSpanTermExtractor newTermExtractor(String defaultField) {
+      return new CustomSpanTermExtractor(defaultField);
+    }
+  }
+
+  private static class MyFastVectorHighlighter extends FastVectorHighlighter {
+    public MyFastVectorHighlighter(SolrParams params) {
+      super(params.getBool(HighlightParams.USE_PHRASE_HIGHLIGHTER, true), params.getBool(HighlightParams.FIELD_MATCH, false));
+    }
+
+    @Override
+    public FieldQuery getFieldQuery(Query query, IndexReader reader) throws IOException {
+      return new FieldQuery(query, reader, phraseHighlight, fieldMatch) {
+        @Override
+        protected void flatten(Query sourceQuery, IndexReader reader, Collection<Query> flatQueries, float boost) throws IOException {
+          if (sourceQuery instanceof ToParentBlockJoinQuery) {
+            Query childQuery = ((ToParentBlockJoinQuery) sourceQuery).getChildQuery();
+            if (childQuery != null) {
+              flatten(childQuery, reader, flatQueries, boost);
+            }
+          } else {
+            super.flatten(sourceQuery, reader, flatQueries, boost);
+          }
+        }
+      };
+    }
+  }
 }
 
 /** Orders Tokens in a window first by their startOffset ascending.
diff --git a/solr/core/src/java/org/apache/solr/logging/log4j2/Log4j2Watcher.java b/solr/core/src/java/org/apache/solr/logging/log4j2/Log4j2Watcher.java
index 4963503..433b168 100644
--- a/solr/core/src/java/org/apache/solr/logging/log4j2/Log4j2Watcher.java
+++ b/solr/core/src/java/org/apache/solr/logging/log4j2/Log4j2Watcher.java
@@ -48,7 +48,7 @@ public class Log4j2Watcher extends LogWatcher<LogEvent> {
   private final static String LOG4J2_WATCHER_APPENDER = "Log4j2WatcherAppender";
 
   @SuppressForbidden(reason = "class is specific to log4j2")
-  protected class Log4j2Appender extends AbstractAppender {
+  protected static class Log4j2Appender extends AbstractAppender {
 
     private Log4j2Watcher watcher;
     private ThresholdFilter filter;
@@ -78,7 +78,7 @@ public class Log4j2Watcher extends LogWatcher<LogEvent> {
   }
 
   @SuppressForbidden(reason = "class is specific to log4j2")
-  protected class Log4j2Info extends LoggerInfo {
+  protected static class Log4j2Info extends LoggerInfo {
     final Level level;
 
     Log4j2Info(String name, Level level) {
diff --git a/solr/core/src/java/org/apache/solr/request/IntervalFacets.java b/solr/core/src/java/org/apache/solr/request/IntervalFacets.java
index c864d03..ff04ea8 100644
--- a/solr/core/src/java/org/apache/solr/request/IntervalFacets.java
+++ b/solr/core/src/java/org/apache/solr/request/IntervalFacets.java
@@ -182,21 +182,11 @@ public class IntervalFacets implements Iterable<FacetInterval> {
             break;
           case FLOAT:
             // TODO: this bit flipping should probably be moved to tie-break in the PQ comparator
-            longs = new FilterNumericDocValues(DocValues.getNumeric(ctx.reader(), fieldName)) {
-              @Override
-              public long longValue() throws IOException {
-                return NumericUtils.sortableFloatBits((int)super.longValue());
-              }
-            };
+            longs = new MyFilterNumericDocValues(ctx, fieldName);
             break;
           case DOUBLE:
             // TODO: this bit flipping should probably be moved to tie-break in the PQ comparator
-            longs = new FilterNumericDocValues(DocValues.getNumeric(ctx.reader(), fieldName)) {
-              @Override
-              public long longValue() throws IOException {
-               return NumericUtils.sortableDoubleBits(super.longValue());
-              }
-            };
+            longs = new DoubleFilterNumericDocValues(ctx, fieldName);
             break;
           default:
             throw new AssertionError();
@@ -933,4 +923,26 @@ public class IntervalFacets implements Iterable<FacetInterval> {
       return startComparison;
     }
   }
+
+  private static class MyFilterNumericDocValues extends FilterNumericDocValues {
+    public MyFilterNumericDocValues(LeafReaderContext ctx, String fieldName) throws IOException {
+      super(DocValues.getNumeric(ctx.reader(), fieldName));
+    }
+
+    @Override
+    public long longValue() throws IOException {
+      return NumericUtils.sortableFloatBits((int)super.longValue());
+    }
+  }
+
+  private static class DoubleFilterNumericDocValues extends FilterNumericDocValues {
+    public DoubleFilterNumericDocValues(LeafReaderContext ctx, String fieldName) throws IOException {
+      super(DocValues.getNumeric(ctx.reader(), fieldName));
+    }
+
+    @Override
+    public long longValue() throws IOException {
+     return NumericUtils.sortableDoubleBits(super.longValue());
+    }
+  }
 }
diff --git a/solr/core/src/java/org/apache/solr/request/LocalSolrQueryRequest.java b/solr/core/src/java/org/apache/solr/request/LocalSolrQueryRequest.java
index aca4a6f..d63a056 100644
--- a/solr/core/src/java/org/apache/solr/request/LocalSolrQueryRequest.java
+++ b/solr/core/src/java/org/apache/solr/request/LocalSolrQueryRequest.java
@@ -120,7 +120,7 @@ public class LocalSolrQueryRequest extends SolrQueryRequestBase {
   public void setUserPrincipalName(String s) {
     this.userPrincipalName = s;
   }
-  private final class LocalPrincipal implements Principal {
+  private static final class LocalPrincipal implements Principal {
     private final String user;
     public LocalPrincipal(String user) {
       this.user = user;
diff --git a/solr/core/src/java/org/apache/solr/request/SimpleFacets.java b/solr/core/src/java/org/apache/solr/request/SimpleFacets.java
index 4884ca7..230f774 100644
--- a/solr/core/src/java/org/apache/solr/request/SimpleFacets.java
+++ b/solr/core/src/java/org/apache/solr/request/SimpleFacets.java
@@ -358,12 +358,7 @@ public class SimpleFacets {
 
     final Set<String> excludeTerms = new HashSet<>(StrUtils.splitSmart(exclude, ",", true));
 
-    return new Predicate<BytesRef>() {
-      @Override
-      public boolean test(BytesRef bytesRef) {
-        return !excludeTerms.contains(bytesRef.utf8ToString());
-      }
-    };
+    return new BytesRefPredicate(excludeTerms);
   }
 
   /**
@@ -765,13 +760,7 @@ public class SimpleFacets {
     if (sf != null && !sf.hasDocValues() && !sf.multiValued() && sf.getType().getNumberType() != null) {
       // it's a single-valued numeric field: we must currently create insanity :(
       // there isn't a GroupedFacetCollector that works on numerics right now...
-      return new FilterCollector(collector) {
-        @Override
-        public LeafCollector getLeafCollector(LeafReaderContext context) throws IOException {
-          LeafReader insane = Insanity.wrapInsanity(context.reader(), field);
-          return in.getLeafCollector(insane.getContext());
-        }
-      };
+      return new MyFilterCollector(collector, field);
     } else {
       return collector;
     }
@@ -1235,4 +1224,32 @@ public class SimpleFacets {
   public ResponseBuilder getResponseBuilder() {
     return rb;
   }
+
+  private static class BytesRefPredicate implements Predicate<BytesRef> {
+    private final Set<String> excludeTerms;
+
+    public BytesRefPredicate(Set<String> excludeTerms) {
+      this.excludeTerms = excludeTerms;
+    }
+
+    @Override
+    public boolean test(BytesRef bytesRef) {
+      return !excludeTerms.contains(bytesRef.utf8ToString());
+    }
+  }
+
+  private static class MyFilterCollector extends FilterCollector {
+    private final String field;
+
+    public MyFilterCollector(Collector collector, String field) {
+      super(collector);
+      this.field = field;
+    }
+
+    @Override
+    public LeafCollector getLeafCollector(LeafReaderContext context) throws IOException {
+      LeafReader insane = Insanity.wrapInsanity(context.reader(), field);
+      return in.getLeafCollector(insane.getContext());
+    }
+  }
 }
diff --git a/solr/core/src/java/org/apache/solr/response/JSONResponseWriter.java b/solr/core/src/java/org/apache/solr/response/JSONResponseWriter.java
index e89d15e..e7aef9d 100644
--- a/solr/core/src/java/org/apache/solr/response/JSONResponseWriter.java
+++ b/solr/core/src/java/org/apache/solr/response/JSONResponseWriter.java
@@ -55,8 +55,7 @@ public class JSONResponseWriter implements QueryResponseWriter {
 
     final JSONWriter w;
     if (namedListStyle.equals(JsonTextWriter.JSON_NL_ARROFNTV)) {
-      w = new ArrayOfNameTypeValueJSONWriter(
-          writer, req, rsp, wrapperFunction, namedListStyle, true);
+      w = new ArrayOfNameTypeValueJSONWriter(writer, req, rsp, wrapperFunction, namedListStyle, true);
     } else {
       w = new JSONWriter(
           writer, req, rsp, wrapperFunction, namedListStyle);
@@ -92,7 +91,7 @@ public class JSONResponseWriter implements QueryResponseWriter {
  *      {"name":"bar","type":"str","value":"foo"},
  *      {"name":null,"type":"float","value":3.4}]
  */
-class ArrayOfNameTypeValueJSONWriter extends JSONWriter {
+static class ArrayOfNameTypeValueJSONWriter extends JSONWriter {
   protected boolean writeTypeAndValueKey = false;
   private final boolean writeNullName;
 
diff --git a/solr/core/src/java/org/apache/solr/rest/schema/analysis/ManagedSynonymFilterFactory.java b/solr/core/src/java/org/apache/solr/rest/schema/analysis/ManagedSynonymFilterFactory.java
index b0f91f5..80596df 100644
--- a/solr/core/src/java/org/apache/solr/rest/schema/analysis/ManagedSynonymFilterFactory.java
+++ b/solr/core/src/java/org/apache/solr/rest/schema/analysis/ManagedSynonymFilterFactory.java
@@ -349,7 +349,7 @@ public class ManagedSynonymFilterFactory extends BaseManagedTokenFilterFactory {
    * mappings from the managed JSON in this class during SynonymMap
    * building.
    */
-  private class ManagedSynonymParser extends SynonymMap.Parser {
+  private static class ManagedSynonymParser extends SynonymMap.Parser {
 
     SynonymManager synonymManager;
     
@@ -426,8 +426,7 @@ public class ManagedSynonymFilterFactory extends BaseManagedTokenFilterFactory {
           (ResourceLoader loader, String cname, boolean dedup, Analyzer analyzer)
           throws IOException, ParseException {
 
-        ManagedSynonymParser parser =
-            new ManagedSynonymParser((SynonymManager)res, dedup, analyzer);
+        ManagedSynonymParser parser = new ManagedSynonymParser((SynonymManager) res, dedup, analyzer);
         // null is safe here because there's no actual parsing done against a input Reader
         parser.parse(null);
         return parser.build(); 
diff --git a/solr/core/src/java/org/apache/solr/schema/BoolField.java b/solr/core/src/java/org/apache/solr/schema/BoolField.java
index d9f9f0e..ceb495c 100644
--- a/solr/core/src/java/org/apache/solr/schema/BoolField.java
+++ b/solr/core/src/java/org/apache/solr/schema/BoolField.java
@@ -82,29 +82,7 @@ public class BoolField extends PrimitiveFieldType {
   protected final static Analyzer boolAnalyzer = new SolrAnalyzer() {
     @Override
     public TokenStreamComponents createComponents(String fieldName) {
-      Tokenizer tokenizer = new Tokenizer() {
-        final CharTermAttribute termAtt = addAttribute(CharTermAttribute.class);
-        boolean done = false;
-
-        @Override
-        public void reset() throws IOException {
-          super.reset();
-          done = false;
-        }
-
-        @Override
-        public boolean incrementToken() throws IOException {
-          clearAttributes();
-          if (done) return false;
-          done = true;
-          int ch = input.read();
-          if (ch==-1) return false;
-          termAtt.copyBuffer(
-                  ((ch=='t' || ch=='T' || ch=='1') ? TRUE_TOKEN : FALSE_TOKEN)
-                  ,0,1);
-          return true;
-        }
-      };
+      Tokenizer tokenizer = new MyTokenizer();
 
       return new TokenStreamComponents(tokenizer);
     }
@@ -248,48 +226,7 @@ public class BoolField extends PrimitiveFieldType {
 
       final int trueOrd = tord;
 
-      return new BoolDocValues(this) {
-
-        private int getOrdForDoc(int doc) throws IOException {
-          if (doc > sindex.docID()) {
-            sindex.advance(doc);
-          }
-          if (doc == sindex.docID()) {
-            return sindex.ordValue();
-          } else {
-            return -1;
-          }
-        }
-
-        @Override
-        public boolean boolVal(int doc) throws IOException {
-          return getOrdForDoc(doc) == trueOrd;
-        }
-
-        @Override
-        public boolean exists(int doc) throws IOException {
-          return getOrdForDoc(doc) != -1;
-        }
-
-        @Override
-        public ValueFiller getValueFiller() {
-          return new ValueFiller() {
-            private final MutableValueBool mval = new MutableValueBool();
-
-            @Override
-            public MutableValue getValue() {
-              return mval;
-            }
-
-            @Override
-            public void fillValue(int doc) throws IOException {
-              int ord = getOrdForDoc(doc);
-              mval.value = (ord == trueOrd);
-              mval.exists = (ord != -1);
-            }
-          };
-        }
-      };
+      return new MyBoolDocValues(sindex, trueOrd);
     }
 
     @Override
@@ -304,6 +241,81 @@ public class BoolField extends PrimitiveFieldType {
       return hcode + field.hashCode();
     }
 
+    private class MyBoolDocValues extends BoolDocValues {
+
+      private final SortedDocValues sindex;
+      private final int trueOrd;
+
+      public MyBoolDocValues(SortedDocValues sindex, int trueOrd) {
+        super(BoolFieldSource.this);
+        this.sindex = sindex;
+        this.trueOrd = trueOrd;
+      }
+
+      private int getOrdForDoc(int doc) throws IOException {
+        if (doc > sindex.docID()) {
+          sindex.advance(doc);
+        }
+        if (doc == sindex.docID()) {
+          return sindex.ordValue();
+        } else {
+          return -1;
+        }
+      }
+
+      @Override
+      public boolean boolVal(int doc) throws IOException {
+        return getOrdForDoc(doc) == trueOrd;
+      }
+
+      @Override
+      public boolean exists(int doc) throws IOException {
+        return getOrdForDoc(doc) != -1;
+      }
+
+      @Override
+      public ValueFiller getValueFiller() {
+        return new ValueFiller() {
+          private final MutableValueBool mval = new MutableValueBool();
+
+          @Override
+          public MutableValue getValue() {
+            return mval;
+          }
+
+          @Override
+          public void fillValue(int doc) throws IOException {
+            int ord = getOrdForDoc(doc);
+            mval.value = (ord == trueOrd);
+            mval.exists = (ord != -1);
+          }
+        };
+      }
+    }
+  }
+
+  private static class MyTokenizer extends Tokenizer {
+    final CharTermAttribute termAtt = addAttribute(CharTermAttribute.class);
+    boolean done = false;
+
+    @Override
+    public void reset() throws IOException {
+      super.reset();
+      done = false;
+    }
+
+    @Override
+    public boolean incrementToken() throws IOException {
+      clearAttributes();
+      if (done) return false;
+      done = true;
+      int ch = input.read();
+      if (ch==-1) return false;
+      termAtt.copyBuffer(
+              ((ch=='t' || ch=='T' || ch=='1') ? TRUE_TOKEN : FALSE_TOKEN)
+              ,0,1);
+      return true;
+    }
   }
 }
 
diff --git a/solr/core/src/java/org/apache/solr/schema/RandomSortField.java b/solr/core/src/java/org/apache/solr/schema/RandomSortField.java
index 44bb420..4e7a9b9 100644
--- a/solr/core/src/java/org/apache/solr/schema/RandomSortField.java
+++ b/solr/core/src/java/org/apache/solr/schema/RandomSortField.java
@@ -108,53 +108,7 @@ public class RandomSortField extends FieldType {
   private static FieldComparatorSource randomComparatorSource = new FieldComparatorSource() {
     @Override
     public FieldComparator<Integer> newComparator(final String fieldname, final int numHits, int sortPos, boolean reversed) {
-      return new SimpleFieldComparator<Integer>() {
-        int seed;
-        private final int[] values = new int[numHits];
-        int bottomVal;
-        int topVal;
-
-        @Override
-        public int compare(int slot1, int slot2) {
-          return values[slot1] - values[slot2];  // values will be positive... no overflow possible.
-        }
-
-        @Override
-        public void setBottom(int slot) {
-          bottomVal = values[slot];
-        }
-
-        @Override
-        public void setTopValue(Integer value) {
-          topVal = value.intValue();
-        }
-
-        @Override
-        public int compareBottom(int doc) {
-          return bottomVal - hash(doc+seed);
-        }
-
-        @Override
-        public void copy(int slot, int doc) {
-          values[slot] = hash(doc+seed);
-        }
-
-        @Override
-        protected void doSetNextReader(LeafReaderContext context) {
-          seed = getSeed(fieldname, context);
-        }
-
-        @Override
-        public Integer value(int slot) {
-          return values[slot];
-        }
-
-        @Override
-        public int compareTop(int doc) {
-          // values will be positive... no overflow possible.
-          return topVal - hash(doc+seed);
-        }
-      };
+      return new IntegerSimpleFieldComparator(numHits, fieldname);
     }
   };
 
@@ -195,6 +149,62 @@ public class RandomSortField extends FieldType {
       return field.hashCode();
     };
   }
+
+  private static class IntegerSimpleFieldComparator extends SimpleFieldComparator<Integer> {
+    private final int numHits;
+    private final String fieldname;
+    int seed;
+    private final int[] values;
+    int bottomVal;
+    int topVal;
+
+    public IntegerSimpleFieldComparator(int numHits, String fieldname) {
+      this.numHits = numHits;
+      this.fieldname = fieldname;
+      values = new int[numHits];
+    }
+
+    @Override
+    public int compare(int slot1, int slot2) {
+      return values[slot1] - values[slot2];  // values will be positive... no overflow possible.
+    }
+
+    @Override
+    public void setBottom(int slot) {
+      bottomVal = values[slot];
+    }
+
+    @Override
+    public void setTopValue(Integer value) {
+      topVal = value.intValue();
+    }
+
+    @Override
+    public int compareBottom(int doc) {
+      return bottomVal - hash(doc+seed);
+    }
+
+    @Override
+    public void copy(int slot, int doc) {
+      values[slot] = hash(doc+seed);
+    }
+
+    @Override
+    protected void doSetNextReader(LeafReaderContext context) {
+      seed = getSeed(fieldname, context);
+    }
+
+    @Override
+    public Integer value(int slot) {
+      return values[slot];
+    }
+
+    @Override
+    public int compareTop(int doc) {
+      // values will be positive... no overflow possible.
+      return topVal - hash(doc+seed);
+    }
+  }
 }
 
 
diff --git a/solr/core/src/java/org/apache/solr/schema/RptWithGeometrySpatialField.java b/solr/core/src/java/org/apache/solr/schema/RptWithGeometrySpatialField.java
index abb3f0d..a63257e 100644
--- a/solr/core/src/java/org/apache/solr/schema/RptWithGeometrySpatialField.java
+++ b/solr/core/src/java/org/apache/solr/schema/RptWithGeometrySpatialField.java
@@ -151,40 +151,7 @@ public class RptWithGeometrySpatialField extends AbstractSpatialFieldType<Compos
         return targetFuncValues; // no caching; no configured cache
       }
 
-      return new ShapeValues() {
-        int docId = -1;
-
-        @Override
-        public Shape value() throws IOException {
-          //lookup in cache
-          IndexReader.CacheHelper cacheHelper = readerContext.reader().getCoreCacheHelper();
-          if (cacheHelper == null) {
-            throw new IllegalStateException("Leaf " + readerContext.reader() + " is not suited for caching");
-          }
-          PerSegCacheKey key = new PerSegCacheKey(cacheHelper.getKey(), docId);
-          Shape shape = cache.computeIfAbsent(key, k -> {
-            try {
-              return targetFuncValues.value();
-            } catch (IOException e) {
-              return null;
-            }
-          });
-          if (shape != null) {
-            //optimize shape on a cache hit if possible. This must be thread-safe and it is.
-            if (shape instanceof JtsGeometry) {
-              ((JtsGeometry) shape).index(); // TODO would be nice if some day we didn't have to cast
-            }
-          }
-          return shape;
-        }
-
-        @Override
-        public boolean advanceExact(int doc) throws IOException {
-          this.docId = doc;
-          return targetFuncValues.advanceExact(doc);
-        }
-
-      };
+      return new MyShapeValues(readerContext, cache, targetFuncValues);
 
     }
 
@@ -193,6 +160,50 @@ public class RptWithGeometrySpatialField extends AbstractSpatialFieldType<Compos
       return targetValueSource.isCacheable(ctx);
     }
 
+    private static class MyShapeValues extends ShapeValues {
+      private final LeafReaderContext readerContext;
+      private final SolrCache<PerSegCacheKey,Shape> cache;
+      private final ShapeValues targetFuncValues;
+      int docId;
+
+      public MyShapeValues(LeafReaderContext readerContext, SolrCache<PerSegCacheKey,Shape> cache, ShapeValues targetFuncValues) {
+        this.readerContext = readerContext;
+        this.cache = cache;
+        this.targetFuncValues = targetFuncValues;
+        docId = -1;
+      }
+
+      @Override
+      public Shape value() throws IOException {
+        //lookup in cache
+        IndexReader.CacheHelper cacheHelper = readerContext.reader().getCoreCacheHelper();
+        if (cacheHelper == null) {
+          throw new IllegalStateException("Leaf " + readerContext.reader() + " is not suited for caching");
+        }
+        PerSegCacheKey key = new PerSegCacheKey(cacheHelper.getKey(), docId);
+        Shape shape = cache.computeIfAbsent(key, k -> {
+          try {
+            return targetFuncValues.value();
+          } catch (IOException e) {
+            return null;
+          }
+        });
+        if (shape != null) {
+          //optimize shape on a cache hit if possible. This must be thread-safe and it is.
+          if (shape instanceof JtsGeometry) {
+            ((JtsGeometry) shape).index(); // TODO would be nice if some day we didn't have to cast
+          }
+        }
+        return shape;
+      }
+
+      @Override
+      public boolean advanceExact(int doc) throws IOException {
+        this.docId = doc;
+        return targetFuncValues.advanceExact(doc);
+      }
+
+    }
   }
 
   public static final String CACHE_KEY_PREFIX = "perSegSpatialFieldCache_";//then field name
diff --git a/solr/core/src/java/org/apache/solr/search/BoolQParserPlugin.java b/solr/core/src/java/org/apache/solr/search/BoolQParserPlugin.java
index 04a9d5a..87d57e6 100644
--- a/solr/core/src/java/org/apache/solr/search/BoolQParserPlugin.java
+++ b/solr/core/src/java/org/apache/solr/search/BoolQParserPlugin.java
@@ -35,36 +35,42 @@ public class BoolQParserPlugin extends QParserPlugin {
 
   @Override
   public QParser createParser(String qstr, SolrParams localParams, SolrParams params, SolrQueryRequest req) {
-    return new QParser(qstr, localParams, params, req) {
-      @Override
-      public Query parse() throws SyntaxError {
-        BooleanQuery.Builder builder = new BooleanQuery.Builder();
-        SolrParams solrParams = SolrParams.wrapDefaults(localParams, params);
-        addQueries(builder, solrParams.getParams("must"), BooleanClause.Occur.MUST);
-        addQueries(builder, solrParams.getParams("must_not"), BooleanClause.Occur.MUST_NOT);
-        addQueries(builder, solrParams.getParams("filter"), BooleanClause.Occur.FILTER);
-        addQueries(builder, solrParams.getParams("should"), BooleanClause.Occur.SHOULD);
-        return builder.build();
-      }
+    return new MyQParser(qstr, localParams, params, req);
+  }
+
+  private static class MyQParser extends QParser {
+    public MyQParser(String qstr, SolrParams localParams, SolrParams params, SolrQueryRequest req) {
+      super(qstr, localParams, params, req);
+    }
+
+    @Override
+    public Query parse() throws SyntaxError {
+      BooleanQuery.Builder builder = new BooleanQuery.Builder();
+      SolrParams solrParams = SolrParams.wrapDefaults(localParams, params);
+      addQueries(builder, solrParams.getParams("must"), BooleanClause.Occur.MUST);
+      addQueries(builder, solrParams.getParams("must_not"), BooleanClause.Occur.MUST_NOT);
+      addQueries(builder, solrParams.getParams("filter"), BooleanClause.Occur.FILTER);
+      addQueries(builder, solrParams.getParams("should"), BooleanClause.Occur.SHOULD);
+      return builder.build();
+    }
 
-      private void addQueries(BooleanQuery.Builder builder, String[] subQueries, BooleanClause.Occur occur) throws SyntaxError {
-        if (subQueries != null) {
-          for (String subQuery : subQueries) {
-            final QParser subParser = subQuery(subQuery, null);
-            Query extQuery;
-            if (BooleanClause.Occur.FILTER.equals(occur)) {
-              extQuery = subParser.getQuery();
-              if (!(extQuery instanceof ExtendedQuery) || (
-                  ((ExtendedQuery) extQuery).getCache())) {
-                  extQuery = new FilterQuery(extQuery);
-              }
-            } else {
-              extQuery = subParser.parse();
+    private void addQueries(BooleanQuery.Builder builder, String[] subQueries, BooleanClause.Occur occur) throws SyntaxError {
+      if (subQueries != null) {
+        for (String subQuery : subQueries) {
+          final QParser subParser = subQuery(subQuery, null);
+          Query extQuery;
+          if (BooleanClause.Occur.FILTER.equals(occur)) {
+            extQuery = subParser.getQuery();
+            if (!(extQuery instanceof ExtendedQuery) || (
+                ((ExtendedQuery) extQuery).getCache())) {
+                extQuery = new FilterQuery(extQuery);
             }
-            builder.add(extQuery, occur);
+          } else {
+            extQuery = subParser.parse();
           }
+          builder.add(extQuery, occur);
         }
       }
-    };
+    }
   }
 }
diff --git a/solr/core/src/java/org/apache/solr/search/BoostQParserPlugin.java b/solr/core/src/java/org/apache/solr/search/BoostQParserPlugin.java
index 70e08a6..a84d56a 100644
--- a/solr/core/src/java/org/apache/solr/search/BoostQParserPlugin.java
+++ b/solr/core/src/java/org/apache/solr/search/BoostQParserPlugin.java
@@ -42,46 +42,50 @@ public class BoostQParserPlugin extends QParserPlugin {
 
   @Override
   public QParser createParser(String qstr, SolrParams localParams, SolrParams params, SolrQueryRequest req) {
-    return new QParser(qstr, localParams, params, req) {
-      QParser baseParser;
-      ValueSource vs;
-      String b;
+    return new MyQParser(qstr, localParams, params, req);
+  }
 
-      @Override
-      public Query parse() throws SyntaxError {
-        b = localParams.get(BOOSTFUNC);
-        baseParser = subQuery(localParams.get(QueryParsing.V), null);
-        Query q = baseParser.getQuery();
+  private static class MyQParser extends QParser {
+    QParser baseParser;
+    ValueSource vs;
+    String b;
 
-        if (b == null) return q;
-        Query bq = subQuery(b, FunctionQParserPlugin.NAME).getQuery();
-        if (bq instanceof FunctionQuery) {
-          vs = ((FunctionQuery)bq).getValueSource();
-        } else {
-          vs = new QueryValueSource(bq, 0.0f);
-        }
-        return FunctionScoreQuery.boostByValue(q, vs.asDoubleValuesSource());
-      }
+    public MyQParser(String qstr, SolrParams localParams, SolrParams params, SolrQueryRequest req) {
+      super(qstr, localParams, params, req);
+    }
 
+    @Override
+    public Query parse() throws SyntaxError {
+      b = localParams.get(BOOSTFUNC);
+      baseParser = subQuery(localParams.get(QueryParsing.V), null);
+      Query q = baseParser.getQuery();
 
-      @Override
-      public String[] getDefaultHighlightFields() {
-        return baseParser.getDefaultHighlightFields();
-      }
-                                           
-      @Override
-      public Query getHighlightQuery() throws SyntaxError {
-        return baseParser.getHighlightQuery();
+      if (b == null) return q;
+      Query bq = subQuery(b, FunctionQParserPlugin.NAME).getQuery();
+      if (bq instanceof FunctionQuery) {
+        vs = ((FunctionQuery)bq).getValueSource();
+      } else {
+        vs = new QueryValueSource(bq, 0.0f);
       }
+      return FunctionScoreQuery.boostByValue(q, vs.asDoubleValuesSource());
+    }
 
-      @Override
-      public void addDebugInfo(NamedList<Object> debugInfo) {
-        // encapsulate base debug info in a sub-list?
-        baseParser.addDebugInfo(debugInfo);
-        debugInfo.add("boost_str",b);
-        debugInfo.add("boost_parsed",vs);
-      }
-    };
-  }
+    @Override
+    public String[] getDefaultHighlightFields() {
+      return baseParser.getDefaultHighlightFields();
+    }
+
+    @Override
+    public Query getHighlightQuery() throws SyntaxError {
+      return baseParser.getHighlightQuery();
+    }
 
+    @Override
+    public void addDebugInfo(NamedList<Object> debugInfo) {
+      // encapsulate base debug info in a sub-list?
+      baseParser.addDebugInfo(debugInfo);
+      debugInfo.add("boost_str",b);
+      debugInfo.add("boost_parsed",vs);
+    }
+  }
 }
diff --git a/solr/core/src/java/org/apache/solr/search/CollapsingQParserPlugin.java b/solr/core/src/java/org/apache/solr/search/CollapsingQParserPlugin.java
index b9e8eb9..11fe017 100644
--- a/solr/core/src/java/org/apache/solr/search/CollapsingQParserPlugin.java
+++ b/solr/core/src/java/org/apache/solr/search/CollapsingQParserPlugin.java
@@ -1320,19 +1320,9 @@ public class CollapsingQParserPlugin extends QParserPlugin {
           @SuppressWarnings("resource")
           final LeafReader uninvertingReader = getTopFieldCacheReader(searcher, collapseField);
 
-          docValuesProducer = new EmptyDocValuesProducer() {
-              @Override
-              public SortedDocValues getSorted(FieldInfo ignored) throws IOException {
-                return uninvertingReader.getSortedDocValues(collapseField);
-              }
-            };
+          docValuesProducer = new MyEmptyDocValuesProducer(uninvertingReader, collapseField);
         } else {
-          docValuesProducer = new EmptyDocValuesProducer() {
-              @Override
-              public SortedDocValues getSorted(FieldInfo ignored) throws IOException {
-                return DocValues.getSorted(searcher.getSlowAtomicReader(), collapseField);
-              }
-            };
+          docValuesProducer = new NoHintEmptyDocValuesProducer(searcher, collapseField);
         }
       } else {
         if(HINT_TOP_FC.equals(hint)) {
@@ -1445,6 +1435,36 @@ public class CollapsingQParserPlugin extends QParserPlugin {
 
       }
     }
+
+    private static class MyEmptyDocValuesProducer extends EmptyDocValuesProducer {
+      private final LeafReader uninvertingReader;
+      private final String collapseField;
+
+      public MyEmptyDocValuesProducer(LeafReader uninvertingReader, String collapseField) {
+        this.uninvertingReader = uninvertingReader;
+        this.collapseField = collapseField;
+      }
+
+      @Override
+      public SortedDocValues getSorted(FieldInfo ignored) throws IOException {
+        return uninvertingReader.getSortedDocValues(collapseField);
+      }
+    }
+
+    private static class NoHintEmptyDocValuesProducer extends EmptyDocValuesProducer {
+      private final SolrIndexSearcher searcher;
+      private final String collapseField;
+
+      public NoHintEmptyDocValuesProducer(SolrIndexSearcher searcher, String collapseField) {
+        this.searcher = searcher;
+        this.collapseField = collapseField;
+      }
+
+      @Override
+      public SortedDocValues getSorted(FieldInfo ignored) throws IOException {
+        return DocValues.getSorted(searcher.getSlowAtomicReader(), collapseField);
+      }
+    }
   }
 
   public static final class CollapseScore {
diff --git a/solr/core/src/java/org/apache/solr/search/ExportQParserPlugin.java b/solr/core/src/java/org/apache/solr/search/ExportQParserPlugin.java
index 097f1fc..5102605 100644
--- a/solr/core/src/java/org/apache/solr/search/ExportQParserPlugin.java
+++ b/solr/core/src/java/org/apache/solr/search/ExportQParserPlugin.java
@@ -62,7 +62,7 @@ public class ExportQParserPlugin extends QParserPlugin {
     }
   }
 
-  public class ExportQuery extends RankQuery {
+  public static class ExportQuery extends RankQuery {
     private Query mainQuery;
     private Object id;
 
diff --git a/solr/core/src/java/org/apache/solr/search/FloatPayloadValueSource.java b/solr/core/src/java/org/apache/solr/search/FloatPayloadValueSource.java
index 0103d3d..47a8045 100644
--- a/solr/core/src/java/org/apache/solr/search/FloatPayloadValueSource.java
+++ b/solr/core/src/java/org/apache/solr/search/FloatPayloadValueSource.java
@@ -86,52 +86,7 @@ public class FloatPayloadValueSource extends ValueSource {
         if (docs == null) {
           // dummy PostingsEnum so floatVal() can work
           // when would this be called?  if field/val did not match?  this is called for every doc?  create once and cache?
-          docs = new PostingsEnum() {
-            @Override
-            public int freq() {
-              return 0;
-            }
-
-            @Override
-            public int nextPosition() throws IOException {
-              return -1;
-            }
-
-            @Override
-            public int startOffset() throws IOException {
-              return -1;
-            }
-
-            @Override
-            public int endOffset() throws IOException {
-              return -1;
-            }
-
-            @Override
-            public BytesRef getPayload() throws IOException {
-              return null;
-            }
-
-            @Override
-            public int docID() {
-              return DocIdSetIterator.NO_MORE_DOCS;
-            }
-
-            @Override
-            public int nextDoc() {
-              return DocIdSetIterator.NO_MORE_DOCS;
-            }
-
-            @Override
-            public int advance(int target) {
-              return DocIdSetIterator.NO_MORE_DOCS;
-            }
-
-            @Override
-            public long cost() {
-              return 0;
-            }
-          };
+          docs = new MyPostingsEnum();
         }
         atDoc = -1;
       }
@@ -223,4 +178,51 @@ public class FloatPayloadValueSource extends ValueSource {
     result = 31 * result + defaultValueSource.hashCode();
     return result;
   }
+
+  private static class MyPostingsEnum extends PostingsEnum {
+    @Override
+    public int freq() {
+      return 0;
+    }
+
+    @Override
+    public int nextPosition() throws IOException {
+      return -1;
+    }
+
+    @Override
+    public int startOffset() throws IOException {
+      return -1;
+    }
+
+    @Override
+    public int endOffset() throws IOException {
+      return -1;
+    }
+
+    @Override
+    public BytesRef getPayload() throws IOException {
+      return null;
+    }
+
+    @Override
+    public int docID() {
+      return DocIdSetIterator.NO_MORE_DOCS;
+    }
+
+    @Override
+    public int nextDoc() {
+      return DocIdSetIterator.NO_MORE_DOCS;
+    }
+
+    @Override
+    public int advance(int target) {
+      return DocIdSetIterator.NO_MORE_DOCS;
+    }
+
+    @Override
+    public long cost() {
+      return 0;
+    }
+  }
 }
diff --git a/solr/core/src/java/org/apache/solr/search/PayloadScoreQParserPlugin.java b/solr/core/src/java/org/apache/solr/search/PayloadScoreQParserPlugin.java
index 45f39c7..dcb9b4d 100644
--- a/solr/core/src/java/org/apache/solr/search/PayloadScoreQParserPlugin.java
+++ b/solr/core/src/java/org/apache/solr/search/PayloadScoreQParserPlugin.java
@@ -47,46 +47,52 @@ public class PayloadScoreQParserPlugin extends QParserPlugin {
 
   @Override
   public QParser createParser(String qstr, SolrParams localParams, SolrParams params, SolrQueryRequest req) {
-    return new QParser(qstr, localParams, params, req) {
-      @Override
-      public Query parse() throws SyntaxError {
-        String field = localParams.get(QueryParsing.F);
-        String value = localParams.get(QueryParsing.V);
-        String func = localParams.get("func");
-        String operator = localParams.get("operator", DEFAULT_OPERATOR);
-        if (!(operator.equalsIgnoreCase(DEFAULT_OPERATOR) || operator.equalsIgnoreCase("or"))) {
-          throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, "Supported operators are : or , phrase");
-        }
-        boolean includeSpanScore = localParams.getBool("includeSpanScore", false);
+    return new MyQParser(qstr, localParams, params, req);
+  }
 
-        if (field == null) {
-          throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, "'f' not specified");
-        }
+  private static class MyQParser extends QParser {
+    public MyQParser(String qstr, SolrParams localParams, SolrParams params, SolrQueryRequest req) {
+      super(qstr, localParams, params, req);
+    }
 
-        if (value == null) {
-          throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, "query string missing");
-        }
+    @Override
+    public Query parse() throws SyntaxError {
+      String field = localParams.get(QueryParsing.F);
+      String value = localParams.get(QueryParsing.V);
+      String func = localParams.get("func");
+      String operator = localParams.get("operator", DEFAULT_OPERATOR);
+      if (!(operator.equalsIgnoreCase(DEFAULT_OPERATOR) || operator.equalsIgnoreCase("or"))) {
+        throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, "Supported operators are : or , phrase");
+      }
+      boolean includeSpanScore = localParams.getBool("includeSpanScore", false);
 
-        FieldType ft = req.getCore().getLatestSchema().getFieldType(field);
-        Analyzer analyzer = ft.getQueryAnalyzer();
-        SpanQuery query;
-        try {
-          query = PayloadUtils.createSpanQuery(field, value, analyzer, operator);
-        } catch (IOException e) {
-          throw new SolrException(SolrException.ErrorCode.BAD_REQUEST,e);
-        }
+      if (field == null) {
+        throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, "'f' not specified");
+      }
 
-        if (query == null) {
-          throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, "SpanQuery is null");
-        }
+      if (value == null) {
+        throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, "query string missing");
+      }
 
-        // note: this query(/parser) does not support func=first; 'first' is a payload() value source feature only
-        PayloadFunction payloadFunction = PayloadUtils.getPayloadFunction(func);
-        if (payloadFunction == null) throw new SyntaxError("Unknown payload function: " + func);
+      FieldType ft = req.getCore().getLatestSchema().getFieldType(field);
+      Analyzer analyzer = ft.getQueryAnalyzer();
+      SpanQuery query;
+      try {
+        query = PayloadUtils.createSpanQuery(field, value, analyzer, operator);
+      } catch (IOException e) {
+        throw new SolrException(SolrException.ErrorCode.BAD_REQUEST,e);
+      }
 
-        PayloadDecoder payloadDecoder = req.getCore().getLatestSchema().getPayloadDecoder(field);
-        return new PayloadScoreQuery(query, payloadFunction, payloadDecoder, includeSpanScore);
+      if (query == null) {
+        throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, "SpanQuery is null");
       }
-    };
+
+      // note: this query(/parser) does not support func=first; 'first' is a payload() value source feature only
+      PayloadFunction payloadFunction = PayloadUtils.getPayloadFunction(func);
+      if (payloadFunction == null) throw new SyntaxError("Unknown payload function: " + func);
+
+      PayloadDecoder payloadDecoder = req.getCore().getLatestSchema().getPayloadDecoder(field);
+      return new PayloadScoreQuery(query, payloadFunction, payloadDecoder, includeSpanScore);
+    }
   }
 }
diff --git a/solr/core/src/java/org/apache/solr/search/PrefixQParserPlugin.java b/solr/core/src/java/org/apache/solr/search/PrefixQParserPlugin.java
index 8e52884..c32170a 100644
--- a/solr/core/src/java/org/apache/solr/search/PrefixQParserPlugin.java
+++ b/solr/core/src/java/org/apache/solr/search/PrefixQParserPlugin.java
@@ -33,13 +33,19 @@ public class PrefixQParserPlugin extends QParserPlugin {
 
   @Override
   public QParser createParser(String qstr, SolrParams localParams, SolrParams params, SolrQueryRequest req) {
-    return new QParser(qstr, localParams, params, req) {
-      @Override
-      public Query parse() {
-        SchemaField sf = req.getSchema().getField(localParams.get(QueryParsing.F));
-        return sf.getType().getPrefixQuery(this, sf, localParams.get(QueryParsing.V));
-      }
-    };
+    return new MyQParser(qstr, localParams, params, req);
+  }
+
+  private static class MyQParser extends QParser {
+    public MyQParser(String qstr, SolrParams localParams, SolrParams params, SolrQueryRequest req) {
+      super(qstr, localParams, params, req);
+    }
+
+    @Override
+    public Query parse() {
+      SchemaField sf = req.getSchema().getField(localParams.get(QueryParsing.F));
+      return sf.getType().getPrefixQuery(this, sf, localParams.get(QueryParsing.V));
+    }
   }
 }
 
diff --git a/solr/core/src/java/org/apache/solr/search/RawQParserPlugin.java b/solr/core/src/java/org/apache/solr/search/RawQParserPlugin.java
index c3d2dd2..30f6879 100644
--- a/solr/core/src/java/org/apache/solr/search/RawQParserPlugin.java
+++ b/solr/core/src/java/org/apache/solr/search/RawQParserPlugin.java
@@ -37,11 +37,17 @@ public class RawQParserPlugin extends QParserPlugin {
 
   @Override
   public QParser createParser(String qstr, SolrParams localParams, SolrParams params, SolrQueryRequest req) {
-    return new QParser(qstr, localParams, params, req) {
-      @Override
-      public Query parse() {
-        return new TermQuery(new Term(localParams.get(QueryParsing.F), localParams.get(QueryParsing.V)));
-      }
-    };
+    return new MyQParser(qstr, localParams, params, req);
+  }
+
+  private static class MyQParser extends QParser {
+    public MyQParser(String qstr, SolrParams localParams, SolrParams params, SolrQueryRequest req) {
+      super(qstr, localParams, params, req);
+    }
+
+    @Override
+    public Query parse() {
+      return new TermQuery(new Term(localParams.get(QueryParsing.F), localParams.get(QueryParsing.V)));
+    }
   }
 }
diff --git a/solr/core/src/java/org/apache/solr/search/ReRankQParserPlugin.java b/solr/core/src/java/org/apache/solr/search/ReRankQParserPlugin.java
index 221501b..b857737 100644
--- a/solr/core/src/java/org/apache/solr/search/ReRankQParserPlugin.java
+++ b/solr/core/src/java/org/apache/solr/search/ReRankQParserPlugin.java
@@ -92,7 +92,7 @@ public class ReRankQParserPlugin extends QParserPlugin {
     }
   }
 
-  private final class ReRankQuery extends AbstractReRankQuery {
+  private static final class ReRankQuery extends AbstractReRankQuery {
     final private Query reRankQuery;
     final private double reRankWeight;
 
diff --git a/solr/core/src/java/org/apache/solr/search/SwitchQParserPlugin.java b/solr/core/src/java/org/apache/solr/search/SwitchQParserPlugin.java
index d3ecddd..49f57f3 100644
--- a/solr/core/src/java/org/apache/solr/search/SwitchQParserPlugin.java
+++ b/solr/core/src/java/org/apache/solr/search/SwitchQParserPlugin.java
@@ -153,42 +153,48 @@ public class SwitchQParserPlugin extends QParserPlugin {
 
   @Override
   public QParser createParser(String qstr, SolrParams localParams, SolrParams params, SolrQueryRequest req) {
-    return new QParser(qstr, localParams, params, req) {
-      QParser subParser;
+    return new MyQParser(qstr, localParams, params, req);
+  }
 
-      @Override
-      public Query parse() throws SyntaxError {
-        String val = localParams.get(QueryParsing.V);
+  private static class MyQParser extends QParser {
+    QParser subParser;
 
-        // we don't want to wrapDefaults arround params, because then 
-        // clients could add their own switch options 
-        String subQ = localParams.get(SWITCH_DEFAULT);
-        subQ = StringUtils.isBlank(val)
-          ? localParams.get(SWITCH_CASE, subQ)
-          : localParams.get(SWITCH_CASE + "." + val.trim(), subQ);
+    public MyQParser(String qstr, SolrParams localParams, SolrParams params, SolrQueryRequest req) {
+      super(qstr, localParams, params, req);
+    }
 
-        if (null == subQ) {
-          throw new SyntaxError("No "+SWITCH_DEFAULT+", and no switch case matching specified query string: \"" + val + "\"");
-        }
+    @Override
+    public Query parse() throws SyntaxError {
+      String val = localParams.get(QueryParsing.V);
 
-        subParser = subQuery(subQ, null);
-        return subParser.getQuery();
-      }
+      // we don't want to wrapDefaults arround params, because then
+      // clients could add their own switch options
+      String subQ = localParams.get(SWITCH_DEFAULT);
+      subQ = StringUtils.isBlank(val)
+        ? localParams.get(SWITCH_CASE, subQ)
+        : localParams.get(SWITCH_CASE + "." + val.trim(), subQ);
 
-      @Override
-      public String[] getDefaultHighlightFields() {
-        return subParser.getDefaultHighlightFields();
-      }
-                                           
-      @Override
-      public Query getHighlightQuery() throws SyntaxError {
-        return subParser.getHighlightQuery();
+      if (null == subQ) {
+        throw new SyntaxError("No "+SWITCH_DEFAULT+", and no switch case matching specified query string: \"" + val + "\"");
       }
 
-      @Override
-      public void addDebugInfo(NamedList<Object> debugInfo) {
-        subParser.addDebugInfo(debugInfo);
-      }
-    };
+      subParser = subQuery(subQ, null);
+      return subParser.getQuery();
+    }
+
+    @Override
+    public String[] getDefaultHighlightFields() {
+      return subParser.getDefaultHighlightFields();
+    }
+
+    @Override
+    public Query getHighlightQuery() throws SyntaxError {
+      return subParser.getHighlightQuery();
+    }
+
+    @Override
+    public void addDebugInfo(NamedList<Object> debugInfo) {
+      subParser.addDebugInfo(debugInfo);
+    }
   }
 }
diff --git a/solr/core/src/java/org/apache/solr/search/TermQParserPlugin.java b/solr/core/src/java/org/apache/solr/search/TermQParserPlugin.java
index 89b3d28..cb4a5ce 100644
--- a/solr/core/src/java/org/apache/solr/search/TermQParserPlugin.java
+++ b/solr/core/src/java/org/apache/solr/search/TermQParserPlugin.java
@@ -44,26 +44,32 @@ public class TermQParserPlugin extends QParserPlugin {
 
   @Override
   public QParser createParser(String qstr, SolrParams localParams, SolrParams params, SolrQueryRequest req) {
-    return new QParser(qstr, localParams, params, req) {
-      @Override
-      public Query parse() {
-        String fname = localParams.get(QueryParsing.F);
-        FieldType ft = req.getSchema().getFieldTypeNoEx(fname);
-        String val = localParams.get(QueryParsing.V);
-        BytesRefBuilder term;
-        if (ft != null) {
-          if (ft.isPointField()) {
-            return ft.getFieldQuery(this, req.getSchema().getField(fname), val);
-          } else {
-            term = new BytesRefBuilder();
-            ft.readableToIndexed(val, term);
-          }
+    return new MyQParser(qstr, localParams, params, req);
+  }
+
+  private static class MyQParser extends QParser {
+    public MyQParser(String qstr, SolrParams localParams, SolrParams params, SolrQueryRequest req) {
+      super(qstr, localParams, params, req);
+    }
+
+    @Override
+    public Query parse() {
+      String fname = localParams.get(QueryParsing.F);
+      FieldType ft = req.getSchema().getFieldTypeNoEx(fname);
+      String val = localParams.get(QueryParsing.V);
+      BytesRefBuilder term;
+      if (ft != null) {
+        if (ft.isPointField()) {
+          return ft.getFieldQuery(this, req.getSchema().getField(fname), val);
         } else {
           term = new BytesRefBuilder();
-          term.copyChars(val);
+          ft.readableToIndexed(val, term);
         }
-        return new TermQuery(new Term(fname, term.get()));
+      } else {
+        term = new BytesRefBuilder();
+        term.copyChars(val);
       }
-    };
+      return new TermQuery(new Term(fname, term.get()));
+    }
   }
 }
diff --git a/solr/core/src/java/org/apache/solr/search/TermsQParserPlugin.java b/solr/core/src/java/org/apache/solr/search/TermsQParserPlugin.java
index 1d92b7c..78d52a0 100644
--- a/solr/core/src/java/org/apache/solr/search/TermsQParserPlugin.java
+++ b/solr/core/src/java/org/apache/solr/search/TermsQParserPlugin.java
@@ -119,50 +119,7 @@ public class TermsQParserPlugin extends QParserPlugin {
 
   @Override
   public QParser createParser(String qstr, SolrParams localParams, SolrParams params, SolrQueryRequest req) {
-    return new QParser(qstr, localParams, params, req) {
-      @Override
-      public Query parse() throws SyntaxError {
-        String fname = localParams.get(QueryParsing.F);
-        FieldType ft = req.getSchema().getFieldType(fname);
-        String separator = localParams.get(SEPARATOR, ",");
-        String qstr = localParams.get(QueryParsing.V);//never null
-        Method method = Method.valueOf(localParams.get(METHOD, Method.termsFilter.name()));
-        //TODO pick the default method based on various heuristics from benchmarks
-        //TODO pick the default using FieldType.getSetQuery
-
-        //if space then split on all whitespace & trim, otherwise strictly interpret
-        final boolean sepIsSpace = separator.equals(" ");
-        if (sepIsSpace)
-          qstr = qstr.trim();
-        if (qstr.length() == 0)
-          return new MatchNoDocsQuery();
-        final String[] splitVals = sepIsSpace ? qstr.split("\\s+") : qstr.split(Pattern.quote(separator), -1);
-        assert splitVals.length > 0;
-        
-        if (ft.isPointField()) {
-          if (localParams.get(METHOD) != null) {
-            throw new SolrException(SolrException.ErrorCode.BAD_REQUEST,
-                String.format(Locale.ROOT, "Method '%s' not supported in TermsQParser when using PointFields", localParams.get(METHOD)));
-          }
-          return ((PointField)ft).getSetQuery(this, req.getSchema().getField(fname), Arrays.asList(splitVals));
-        }
-
-        BytesRef[] bytesRefs = new BytesRef[splitVals.length];
-        BytesRefBuilder term = new BytesRefBuilder();
-        for (int i = 0; i < splitVals.length; i++) {
-          String stringVal = splitVals[i];
-          //logic same as TermQParserPlugin
-          if (ft != null) {
-            ft.readableToIndexed(stringVal, term);
-          } else {
-            term.copyChars(stringVal);
-          }
-          bytesRefs[i] = term.toBytesRef();
-        }
-
-        return method.makeFilter(fname, bytesRefs);
-      }
-    };
+    return new MyQParser(qstr, localParams, params, req);
   }
 
   private static class TopLevelDocValuesTermsQuery extends DocValuesTermsQuery {
@@ -260,4 +217,53 @@ public class TermsQParserPlugin extends QParserPlugin {
       return -(low + 1);  // key not found.
     }
   }
+
+  private static class MyQParser extends QParser {
+    public MyQParser(String qstr, SolrParams localParams, SolrParams params, SolrQueryRequest req) {
+      super(qstr, localParams, params, req);
+    }
+
+    @Override
+    public Query parse() throws SyntaxError {
+      String fname = localParams.get(QueryParsing.F);
+      FieldType ft = req.getSchema().getFieldType(fname);
+      String separator = localParams.get(SEPARATOR, ",");
+      String qstr = localParams.get(QueryParsing.V);//never null
+      Method method = Method.valueOf(localParams.get(METHOD, Method.termsFilter.name()));
+      //TODO pick the default method based on various heuristics from benchmarks
+      //TODO pick the default using FieldType.getSetQuery
+
+      //if space then split on all whitespace & trim, otherwise strictly interpret
+      final boolean sepIsSpace = separator.equals(" ");
+      if (sepIsSpace)
+        qstr = qstr.trim();
+      if (qstr.length() == 0)
+        return new MatchNoDocsQuery();
+      final String[] splitVals = sepIsSpace ? qstr.split("\\s+") : qstr.split(Pattern.quote(separator), -1);
+      assert splitVals.length > 0;
+
+      if (ft.isPointField()) {
+        if (localParams.get(METHOD) != null) {
+          throw new SolrException(SolrException.ErrorCode.BAD_REQUEST,
+              String.format(Locale.ROOT, "Method '%s' not supported in TermsQParser when using PointFields", localParams.get(METHOD)));
+        }
+        return ((PointField)ft).getSetQuery(this, req.getSchema().getField(fname), Arrays.asList(splitVals));
+      }
+
+      BytesRef[] bytesRefs = new BytesRef[splitVals.length];
+      BytesRefBuilder term = new BytesRefBuilder();
+      for (int i = 0; i < splitVals.length; i++) {
+        String stringVal = splitVals[i];
+        //logic same as TermQParserPlugin
+        if (ft != null) {
+          ft.readableToIndexed(stringVal, term);
+        } else {
+          term.copyChars(stringVal);
+        }
+        bytesRefs[i] = term.toBytesRef();
+      }
+
+      return method.makeFilter(fname, bytesRefs);
+    }
+  }
 }
diff --git a/solr/core/src/java/org/apache/solr/search/TopLevelJoinQuery.java b/solr/core/src/java/org/apache/solr/search/TopLevelJoinQuery.java
index 428c229..c7b5f0a 100644
--- a/solr/core/src/java/org/apache/solr/search/TopLevelJoinQuery.java
+++ b/solr/core/src/java/org/apache/solr/search/TopLevelJoinQuery.java
@@ -90,23 +90,7 @@ public class TopLevelJoinQuery extends JoinQuery {
           }
 
           final int docBase = context.docBase;
-          return new ConstantScoreScorer(this, this.score(), scoreMode, new TwoPhaseIterator(toApproximation) {
-            public boolean matches() throws IOException {
-              final boolean hasDoc = topLevelToDocValues.advanceExact(docBase + approximation.docID());
-              if (hasDoc) {
-                for (long ord = topLevelToDocValues.nextOrd(); ord != -1L; ord = topLevelToDocValues.nextOrd()) {
-                  if (toOrdBitSet.get(ord)) {
-                    return true;
-                  }
-                }
-              }
-              return false;
-            }
-
-            public float matchCost() {
-              return 10.0F;
-            }
-          });
+          return new ConstantScoreScorer(this, this.score(), scoreMode, new MyTwoPhaseIterator(toApproximation, topLevelToDocValues, docBase, toOrdBitSet));
 
         }
 
@@ -120,17 +104,7 @@ public class TopLevelJoinQuery extends JoinQuery {
   }
 
   private Weight createNoMatchesWeight(float boost) {
-    return new ConstantScoreWeight(this, boost) {
-      @Override
-      public Scorer scorer(LeafReaderContext context) throws IOException {
-        return null;
-      }
-
-      @Override
-      public boolean isCacheable(LeafReaderContext ctx) {
-        return false;
-      }
-    };
+    return new MyConstantScoreWeight(boost);
   }
 
   private SortedSetDocValues validateAndFetchDocValues(SolrIndexSearcher solrSearcher, String fieldName, String querySide) throws IOException {
@@ -218,4 +192,49 @@ public class TopLevelJoinQuery extends JoinQuery {
       this.upper = upper;
     }
   }
+
+  private static class MyTwoPhaseIterator extends TwoPhaseIterator {
+    private final SortedSetDocValues topLevelToDocValues;
+    private final int docBase;
+    private final LongBitSet toOrdBitSet;
+
+    public MyTwoPhaseIterator(DocIdSetIterator toApproximation, SortedSetDocValues topLevelToDocValues, int docBase, LongBitSet toOrdBitSet) {
+      super(toApproximation);
+      this.topLevelToDocValues = topLevelToDocValues;
+      this.docBase = docBase;
+      this.toOrdBitSet = toOrdBitSet;
+    }
+
+    public boolean matches() throws IOException {
+      final boolean hasDoc = topLevelToDocValues.advanceExact(docBase + approximation.docID());
+      if (hasDoc) {
+        for (long ord = topLevelToDocValues.nextOrd(); ord != -1L; ord = topLevelToDocValues.nextOrd()) {
+          if (toOrdBitSet.get(ord)) {
+            return true;
+          }
+        }
+      }
+      return false;
+    }
+
+    public float matchCost() {
+      return 10.0F;
+    }
+  }
+
+  private class MyConstantScoreWeight extends ConstantScoreWeight {
+    public MyConstantScoreWeight(float boost) {
+      super(TopLevelJoinQuery.this, boost);
+    }
+
+    @Override
+    public Scorer scorer(LeafReaderContext context) throws IOException {
+      return null;
+    }
+
+    @Override
+    public boolean isCacheable(LeafReaderContext ctx) {
+      return false;
+    }
+  }
 }
diff --git a/solr/core/src/java/org/apache/solr/search/facet/AvgAgg.java b/solr/core/src/java/org/apache/solr/search/facet/AvgAgg.java
index 7036c30..40b84ab 100644
--- a/solr/core/src/java/org/apache/solr/search/facet/AvgAgg.java
+++ b/solr/core/src/java/org/apache/solr/search/facet/AvgAgg.java
@@ -89,7 +89,7 @@ public class AvgAgg extends SimpleAggValueSource {
     }
   }
 
-  class AvgSortedNumericAcc extends DocValuesAcc.DoubleSortedNumericDVAcc {
+  static class AvgSortedNumericAcc extends DocValuesAcc.DoubleSortedNumericDVAcc {
     int[] counts;
 
     public AvgSortedNumericAcc(FacetContext fcontext, SchemaField sf, int numSlots) throws IOException {
@@ -140,7 +140,7 @@ public class AvgAgg extends SimpleAggValueSource {
     }
   }
 
-  class AvgSortedSetAcc extends DocValuesAcc.DoubleSortedSetDVAcc {
+  static class AvgSortedSetAcc extends DocValuesAcc.DoubleSortedSetDVAcc {
     int[] counts;
 
     public AvgSortedSetAcc(FacetContext fcontext, SchemaField sf, int numSlots) throws IOException {
@@ -195,7 +195,7 @@ public class AvgAgg extends SimpleAggValueSource {
     }
   }
 
-  class AvgUnInvertedFieldAcc extends UnInvertedFieldAcc.DoubleUnInvertedFieldAcc {
+  static class AvgUnInvertedFieldAcc extends UnInvertedFieldAcc.DoubleUnInvertedFieldAcc {
     int[] counts;
 
     public AvgUnInvertedFieldAcc(FacetContext fcontext, SchemaField sf, int numSlots) throws IOException {
diff --git a/solr/core/src/java/org/apache/solr/search/facet/CountValsAgg.java b/solr/core/src/java/org/apache/solr/search/facet/CountValsAgg.java
index 6415ff6..ac8d93b 100644
--- a/solr/core/src/java/org/apache/solr/search/facet/CountValsAgg.java
+++ b/solr/core/src/java/org/apache/solr/search/facet/CountValsAgg.java
@@ -67,7 +67,7 @@ public class CountValsAgg extends SimpleAggValueSource {
     return new FacetModule.FacetLongMerger();
   }
 
-  class CountValSlotAcc extends SlotAcc.LongFuncSlotAcc {
+  static class CountValSlotAcc extends SlotAcc.LongFuncSlotAcc {
 
     public CountValSlotAcc(ValueSource values, FacetContext fcontext, int numSlots) {
       super(values, fcontext, numSlots, 0);
@@ -81,7 +81,7 @@ public class CountValsAgg extends SimpleAggValueSource {
     }
   }
 
-  class CountSortedNumericDVAcc extends DocValuesAcc.LongSortedNumericDVAcc {
+  static class CountSortedNumericDVAcc extends DocValuesAcc.LongSortedNumericDVAcc {
 
     public CountSortedNumericDVAcc(FacetContext fcontext, SchemaField sf, int numSlots) throws IOException {
       super(fcontext, sf, numSlots, 0);
@@ -93,7 +93,7 @@ public class CountValsAgg extends SimpleAggValueSource {
     }
   }
 
-  class CountSortedSetDVAcc extends DocValuesAcc.LongSortedSetDVAcc {
+  static class CountSortedSetDVAcc extends DocValuesAcc.LongSortedSetDVAcc {
 
     public CountSortedSetDVAcc(FacetContext fcontext, SchemaField sf, int numSlots) throws IOException {
       super(fcontext, sf, numSlots, 0);
@@ -107,7 +107,7 @@ public class CountValsAgg extends SimpleAggValueSource {
     }
   }
 
-  class CountMultiValuedAcc extends UnInvertedFieldAcc {
+  static class CountMultiValuedAcc extends UnInvertedFieldAcc {
     private int currentSlot;
     long[] result;
 
diff --git a/solr/core/src/java/org/apache/solr/search/facet/DocValuesAcc.java b/solr/core/src/java/org/apache/solr/search/facet/DocValuesAcc.java
index 547040e..a656d9d 100644
--- a/solr/core/src/java/org/apache/solr/search/facet/DocValuesAcc.java
+++ b/solr/core/src/java/org/apache/solr/search/facet/DocValuesAcc.java
@@ -63,7 +63,7 @@ public abstract class DocValuesAcc extends SlotAcc {
   /**
    * Accumulator for {@link NumericDocValues}
    */
-  abstract class NumericDVAcc extends DocValuesAcc {
+  abstract static class NumericDVAcc extends DocValuesAcc {
     NumericDocValues values;
 
     public NumericDVAcc(FacetContext fcontext, SchemaField sf) throws IOException {
@@ -255,7 +255,7 @@ public abstract class DocValuesAcc extends SlotAcc {
   /**
    * Accumulator for {@link SortedDocValues}
    */
-  abstract class SortedDVAcc extends DocValuesAcc {
+  abstract static class SortedDVAcc extends DocValuesAcc {
     SortedDocValues values;
 
     public SortedDVAcc(FacetContext fcontext, SchemaField sf) throws IOException {
diff --git a/solr/core/src/java/org/apache/solr/search/facet/FacetModule.java b/solr/core/src/java/org/apache/solr/search/facet/FacetModule.java
index 42ed3de..f352cd7 100644
--- a/solr/core/src/java/org/apache/solr/search/facet/FacetModule.java
+++ b/solr/core/src/java/org/apache/solr/search/facet/FacetModule.java
@@ -337,7 +337,7 @@ public class FacetModule extends SearchComponent {
   // TODO: perhaps factor out some sort of root/parent facet object that doesn't depend
 // on stuff like ResponseBuilder, but contains request parameters,
 // root filter lists (for filter exclusions), etc?
-  class FacetComponentState {
+  static class FacetComponentState {
     ResponseBuilder rb;
     Map<String, Object> facetCommands;
     FacetRequest facetRequest;
diff --git a/solr/core/src/java/org/apache/solr/search/facet/MinMaxAgg.java b/solr/core/src/java/org/apache/solr/search/facet/MinMaxAgg.java
index 828fbe6..034a912 100644
--- a/solr/core/src/java/org/apache/solr/search/facet/MinMaxAgg.java
+++ b/solr/core/src/java/org/apache/solr/search/facet/MinMaxAgg.java
@@ -349,7 +349,7 @@ public class MinMaxAgg extends SimpleAggValueSource {
   }
 
 
-  abstract class OrdAcc extends SlotAcc {
+  abstract static class OrdAcc extends SlotAcc {
     final static int MISSING = -1;
     SchemaField field;
     int[] slotOrd;
diff --git a/solr/core/src/java/org/apache/solr/search/facet/MissingAgg.java b/solr/core/src/java/org/apache/solr/search/facet/MissingAgg.java
index b1b630a..3eae91d 100644
--- a/solr/core/src/java/org/apache/solr/search/facet/MissingAgg.java
+++ b/solr/core/src/java/org/apache/solr/search/facet/MissingAgg.java
@@ -64,7 +64,7 @@ public class MissingAgg extends SimpleAggValueSource {
     return new FacetModule.FacetLongMerger();
   }
 
-  class MissingSlotAcc extends SlotAcc.LongFuncSlotAcc {
+  static class MissingSlotAcc extends SlotAcc.LongFuncSlotAcc {
 
     public MissingSlotAcc(ValueSource values, FacetContext fcontext, int numSlots) {
       super(values, fcontext, numSlots, 0);
diff --git a/solr/core/src/java/org/apache/solr/search/facet/SumsqAgg.java b/solr/core/src/java/org/apache/solr/search/facet/SumsqAgg.java
index cecb9b8..320b009 100644
--- a/solr/core/src/java/org/apache/solr/search/facet/SumsqAgg.java
+++ b/solr/core/src/java/org/apache/solr/search/facet/SumsqAgg.java
@@ -99,7 +99,7 @@ public class SumsqAgg extends SimpleAggValueSource {
     }
   }
 
-  class SumSqUnInvertedFieldAcc extends UnInvertedFieldAcc.DoubleUnInvertedFieldAcc {
+  static class SumSqUnInvertedFieldAcc extends UnInvertedFieldAcc.DoubleUnInvertedFieldAcc {
 
     public SumSqUnInvertedFieldAcc(FacetContext fcontext, SchemaField sf, int numSlots) throws IOException {
       super(fcontext, sf, numSlots, 0);
diff --git a/solr/core/src/java/org/apache/solr/search/function/ReverseOrdFieldSource.java b/solr/core/src/java/org/apache/solr/search/function/ReverseOrdFieldSource.java
index a505709..4873542 100644
--- a/solr/core/src/java/org/apache/solr/search/function/ReverseOrdFieldSource.java
+++ b/solr/core/src/java/org/apache/solr/search/function/ReverseOrdFieldSource.java
@@ -104,19 +104,7 @@ public class ReverseOrdFieldSource extends ValueSource {
     final SortedDocValues sindex = SortedSetSelector.wrap(DocValues.getSortedSet(r, field), SortedSetSelector.Type.MIN);
     final int end = sindex.getValueCount();
 
-    return new IntDocValues(this) {
-      @Override
-      public int intVal(int doc) throws IOException {
-        if (doc+off > sindex.docID()) {
-          sindex.advance(doc+off);
-        }
-        if (doc+off == sindex.docID()) {
-          return (end - sindex.ordValue() - 1);
-        } else {
-          return end;
-        }
-      }
-    };
+    return new MyIntDocValues(off, sindex, end);
   }
 
   @Override
@@ -132,4 +120,28 @@ public class ReverseOrdFieldSource extends ValueSource {
     return hcode + field.hashCode();
   }
 
+  private class MyIntDocValues extends IntDocValues {
+    private final int off;
+    private final SortedDocValues sindex;
+    private final int end;
+
+    public MyIntDocValues(int off, SortedDocValues sindex, int end) {
+      super(ReverseOrdFieldSource.this);
+      this.off = off;
+      this.sindex = sindex;
+      this.end = end;
+    }
+
+    @Override
+    public int intVal(int doc) throws IOException {
+      if (doc+ off > sindex.docID()) {
+        sindex.advance(doc+ off);
+      }
+      if (doc+ off == sindex.docID()) {
+        return (end - sindex.ordValue() - 1);
+      } else {
+        return end;
+      }
+    }
+  }
 }
diff --git a/solr/core/src/java/org/apache/solr/search/join/ScoreJoinQParserPlugin.java b/solr/core/src/java/org/apache/solr/search/join/ScoreJoinQParserPlugin.java
index 064faee..3e2ae06 100644
--- a/solr/core/src/java/org/apache/solr/search/join/ScoreJoinQParserPlugin.java
+++ b/solr/core/src/java/org/apache/solr/search/join/ScoreJoinQParserPlugin.java
@@ -205,64 +205,7 @@ public class ScoreJoinQParserPlugin extends QParserPlugin {
 
   @Override
   public QParser createParser(String qstr, SolrParams localParams, SolrParams params, SolrQueryRequest req) {
-    return new QParser(qstr, localParams, params, req) {
-      @Override
-      public Query parse() throws SyntaxError {
-        final String fromField = localParams.get("from");
-        final String fromIndex = localParams.get("fromIndex");
-        final String toField = localParams.get("to");
-        final ScoreMode scoreMode = ScoreModeParser.parse(getParam(SCORE));
-
-        final String v = localParams.get(CommonParams.VALUE);
-
-        final Query q = createQuery(fromField, v, fromIndex, toField, scoreMode,
-            CommonParams.TRUE.equals(localParams.get("TESTenforceSameCoreAsAnotherOne")));
-
-        return q;
-      }
-
-      private Query createQuery(final String fromField, final String fromQueryStr,
-                                String fromIndex, final String toField, final ScoreMode scoreMode,
-                                boolean byPassShortCircutCheck) throws SyntaxError {
-
-        final String myCore = req.getCore().getCoreDescriptor().getName();
-
-        if (fromIndex != null && (!fromIndex.equals(myCore) || byPassShortCircutCheck)) {
-          CoreContainer container = req.getCore().getCoreContainer();
-
-          final String coreName = getCoreName(fromIndex, container);
-          final SolrCore fromCore = container.getCore(coreName);
-          RefCounted<SolrIndexSearcher> fromHolder = null;
-
-          if (fromCore == null) {
-            throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, "Cross-core join: no such core " + coreName);
-          }
-
-          long fromCoreOpenTime = 0;
-          LocalSolrQueryRequest otherReq = new LocalSolrQueryRequest(fromCore, params);
-
-          try {
-            QParser fromQueryParser = QParser.getParser(fromQueryStr, otherReq);
-            Query fromQuery = fromQueryParser.getQuery();
-
-            fromHolder = fromCore.getRegisteredSearcher();
-            if (fromHolder != null) {
-              fromCoreOpenTime = fromHolder.get().getOpenNanoTime();
-            }
-            return new OtherCoreJoinQuery(fromQuery, fromField, coreName, fromCoreOpenTime,
-                scoreMode, toField);
-          } finally {
-            otherReq.close();
-            fromCore.close();
-            if (fromHolder != null) fromHolder.decref();
-          }
-        } else {
-          QParser fromQueryParser = subQuery(fromQueryStr, null);
-          final Query fromQuery = fromQueryParser.getQuery();
-          return new SameCoreJoinQuery(fromQuery, fromField, toField, scoreMode);
-        }
-      }
-    };
+    return new MyQParser(qstr, localParams, params, req);
   }
 
   /**
@@ -332,6 +275,69 @@ public class ScoreJoinQParserPlugin extends QParserPlugin {
 
     return fromReplica;
   }
+
+  private static class MyQParser extends QParser {
+    public MyQParser(String qstr, SolrParams localParams, SolrParams params, SolrQueryRequest req) {
+      super(qstr, localParams, params, req);
+    }
+
+    @Override
+    public Query parse() throws SyntaxError {
+      final String fromField = localParams.get("from");
+      final String fromIndex = localParams.get("fromIndex");
+      final String toField = localParams.get("to");
+      final ScoreMode scoreMode = ScoreModeParser.parse(getParam(SCORE));
+
+      final String v = localParams.get(CommonParams.VALUE);
+
+      final Query q = createQuery(fromField, v, fromIndex, toField, scoreMode,
+          CommonParams.TRUE.equals(localParams.get("TESTenforceSameCoreAsAnotherOne")));
+
+      return q;
+    }
+
+    private Query createQuery(final String fromField, final String fromQueryStr,
+                              String fromIndex, final String toField, final ScoreMode scoreMode,
+                              boolean byPassShortCircutCheck) throws SyntaxError {
+
+      final String myCore = req.getCore().getCoreDescriptor().getName();
+
+      if (fromIndex != null && (!fromIndex.equals(myCore) || byPassShortCircutCheck)) {
+        CoreContainer container = req.getCore().getCoreContainer();
+
+        final String coreName = getCoreName(fromIndex, container);
+        final SolrCore fromCore = container.getCore(coreName);
+        RefCounted<SolrIndexSearcher> fromHolder = null;
+
+        if (fromCore == null) {
+          throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, "Cross-core join: no such core " + coreName);
+        }
+
+        long fromCoreOpenTime = 0;
+        LocalSolrQueryRequest otherReq = new LocalSolrQueryRequest(fromCore, params);
+
+        try {
+          QParser fromQueryParser = QParser.getParser(fromQueryStr, otherReq);
+          Query fromQuery = fromQueryParser.getQuery();
+
+          fromHolder = fromCore.getRegisteredSearcher();
+          if (fromHolder != null) {
+            fromCoreOpenTime = fromHolder.get().getOpenNanoTime();
+          }
+          return new OtherCoreJoinQuery(fromQuery, fromField, coreName, fromCoreOpenTime,
+              scoreMode, toField);
+        } finally {
+          otherReq.close();
+          fromCore.close();
+          if (fromHolder != null) fromHolder.decref();
+        }
+      } else {
+        QParser fromQueryParser = subQuery(fromQueryStr, null);
+        final Query fromQuery = fromQueryParser.getQuery();
+        return new SameCoreJoinQuery(fromQuery, fromField, toField, scoreMode);
+      }
+    }
+  }
 }
 
 
diff --git a/solr/core/src/java/org/apache/solr/search/mlt/CloudMLTQParser.java b/solr/core/src/java/org/apache/solr/search/mlt/CloudMLTQParser.java
index 70ce4e4..f9cfc62 100644
--- a/solr/core/src/java/org/apache/solr/search/mlt/CloudMLTQParser.java
+++ b/solr/core/src/java/org/apache/solr/search/mlt/CloudMLTQParser.java
@@ -186,8 +186,7 @@ public class CloudMLTQParser extends QParser {
     ModifiableSolrParams params = new ModifiableSolrParams();
     params.add(ID, id);
 
-    SolrQueryRequestBase request = new SolrQueryRequestBase(core, params) {
-    };
+    SolrQueryRequestBase request = new MySolrQueryRequestBase(core, params);
 
     core.getRequestHandler("/get").handleRequest(request, rsp);
     @SuppressWarnings({"rawtypes"})
@@ -209,4 +208,9 @@ public class CloudMLTQParser extends QParser {
     return new Term(field, bytesRefBuilder.toBytesRef());
   }
 
+  private static class MySolrQueryRequestBase extends SolrQueryRequestBase {
+    public MySolrQueryRequestBase(SolrCore core, ModifiableSolrParams params) {
+      super(core, params);
+    }
+  }
 }
diff --git a/solr/core/src/java/org/apache/solr/security/BasicAuthPlugin.java b/solr/core/src/java/org/apache/solr/security/BasicAuthPlugin.java
index 6d7bc0a..388ff85 100644
--- a/solr/core/src/java/org/apache/solr/security/BasicAuthPlugin.java
+++ b/solr/core/src/java/org/apache/solr/security/BasicAuthPlugin.java
@@ -269,7 +269,7 @@ public class BasicAuthPlugin extends AuthenticationPlugin implements ConfigEdita
   }
   
   @Contract(threading = ThreadingBehavior.IMMUTABLE)
-  private class BasicAuthUserPrincipal implements Principal, Serializable {
+  private static class BasicAuthUserPrincipal implements Principal, Serializable {
     private String username;
     private final String password;
 
diff --git a/solr/core/src/java/org/apache/solr/spelling/suggest/fst/AnalyzingInfixLookupFactory.java b/solr/core/src/java/org/apache/solr/spelling/suggest/fst/AnalyzingInfixLookupFactory.java
index 89df295..8d8ed2e 100644
--- a/solr/core/src/java/org/apache/solr/spelling/suggest/fst/AnalyzingInfixLookupFactory.java
+++ b/solr/core/src/java/org/apache/solr/spelling/suggest/fst/AnalyzingInfixLookupFactory.java
@@ -117,27 +117,7 @@ public class AnalyzingInfixLookupFactory extends LookupFactory {
     : AnalyzingInfixSuggester.DEFAULT_HIGHLIGHT;
 
     try {
-      return new AnalyzingInfixSuggester(FSDirectory.open(new File(indexPath).toPath()), indexAnalyzer,
-                                         queryAnalyzer, minPrefixChars, true, 
-                                         allTermsRequired, highlight) {
-        @Override
-        public List<LookupResult> lookup(CharSequence key, Set<BytesRef> contexts, int num, boolean allTermsRequired, boolean doHighlight) throws IOException {
-          List<LookupResult> res = super.lookup(key, contexts, num, allTermsRequired, doHighlight);
-          if (doHighlight) {
-            List<LookupResult> res2 = new ArrayList<>();
-            for(LookupResult hit : res) {
-              res2.add(new LookupResult(hit.highlightKey.toString(),
-                                        hit.highlightKey,
-                                        hit.value,
-                                        hit.payload,
-                                        hit.contexts));
-            }
-            res = res2;
-          }
-
-          return res;
-        }
-        };
+      return new MyAnalyzingInfixSuggester(indexPath, indexAnalyzer, queryAnalyzer, minPrefixChars, allTermsRequired, highlight);
     } catch (IOException e) {
       throw new RuntimeException(e);
     }
@@ -147,4 +127,28 @@ public class AnalyzingInfixLookupFactory extends LookupFactory {
   public String storeFileName() {
     return FILENAME;
   }
+
+  private static class MyAnalyzingInfixSuggester extends AnalyzingInfixSuggester {
+    public MyAnalyzingInfixSuggester(String indexPath, Analyzer indexAnalyzer, Analyzer queryAnalyzer, int minPrefixChars, boolean allTermsRequired, boolean highlight) throws IOException {
+      super(FSDirectory.open(new File(indexPath).toPath()), indexAnalyzer, queryAnalyzer, minPrefixChars, true, allTermsRequired, highlight);
+    }
+
+    @Override
+    public List<LookupResult> lookup(CharSequence key, Set<BytesRef> contexts, int num, boolean allTermsRequired, boolean doHighlight) throws IOException {
+      List<LookupResult> res = super.lookup(key, contexts, num, allTermsRequired, doHighlight);
+      if (doHighlight) {
+        List<LookupResult> res2 = new ArrayList<>();
+        for(LookupResult hit : res) {
+          res2.add(new LookupResult(hit.highlightKey.toString(),
+                                    hit.highlightKey,
+                                    hit.value,
+                                    hit.payload,
+                                    hit.contexts));
+        }
+        res = res2;
+      }
+
+      return res;
+    }
+  }
 }
diff --git a/solr/core/src/java/org/apache/solr/spelling/suggest/fst/BlendedInfixLookupFactory.java b/solr/core/src/java/org/apache/solr/spelling/suggest/fst/BlendedInfixLookupFactory.java
index 7ca5aaa..d553e44 100644
--- a/solr/core/src/java/org/apache/solr/spelling/suggest/fst/BlendedInfixLookupFactory.java
+++ b/solr/core/src/java/org/apache/solr/spelling/suggest/fst/BlendedInfixLookupFactory.java
@@ -113,28 +113,7 @@ public class BlendedInfixLookupFactory extends AnalyzingInfixLookupFactory {
     Double exponent = params.get(EXPONENT) == null ? null : Double.valueOf(params.get(EXPONENT).toString());
 
     try {
-      return new BlendedInfixSuggester(FSDirectory.open(new File(indexPath).toPath()),
-                                       indexAnalyzer, queryAnalyzer, minPrefixChars,
-                                       blenderType, numFactor, exponent, true,
-                                       allTermsRequired, highlight) {
-        @Override
-        public List<LookupResult> lookup(CharSequence key, Set<BytesRef> contexts, int num, boolean allTermsRequired, boolean doHighlight) throws IOException {
-          List<LookupResult> res = super.lookup(key, contexts, num, allTermsRequired, doHighlight);
-          if (doHighlight) {
-            List<LookupResult> res2 = new ArrayList<>();
-            for(LookupResult hit : res) {
-              res2.add(new LookupResult(hit.highlightKey.toString(),
-                                        hit.highlightKey,
-                                        hit.value,
-                                        hit.payload,
-                                        hit.contexts));
-            }
-            res = res2;
-          }
-
-          return res;
-        }
-      };
+      return new MyBlendedInfixSuggester(indexPath, indexAnalyzer, queryAnalyzer, minPrefixChars, blenderType, numFactor, exponent, allTermsRequired, highlight);
     } catch (IOException e) {
       throw new RuntimeException(e);
     }
@@ -153,4 +132,29 @@ public class BlendedInfixLookupFactory extends AnalyzingInfixLookupFactory {
     }
     return blenderType;
   }
+
+  private static class MyBlendedInfixSuggester extends BlendedInfixSuggester {
+    public MyBlendedInfixSuggester(String indexPath, Analyzer indexAnalyzer, Analyzer queryAnalyzer, int minPrefixChars, BlenderType blenderType, int numFactor, Double exponent,
+        boolean allTermsRequired, boolean highlight) throws IOException {
+      super(FSDirectory.open(new File(indexPath).toPath()), indexAnalyzer, queryAnalyzer, minPrefixChars, blenderType, numFactor, exponent, true, allTermsRequired, highlight);
+    }
+
+    @Override
+    public List<LookupResult> lookup(CharSequence key, Set<BytesRef> contexts, int num, boolean allTermsRequired, boolean doHighlight) throws IOException {
+      List<LookupResult> res = super.lookup(key, contexts, num, allTermsRequired, doHighlight);
+      if (doHighlight) {
+        List<LookupResult> res2 = new ArrayList<>();
+        for(LookupResult hit : res) {
+          res2.add(new LookupResult(hit.highlightKey.toString(),
+                                    hit.highlightKey,
+                                    hit.value,
+                                    hit.payload,
+                                    hit.contexts));
+        }
+        res = res2;
+      }
+
+      return res;
+    }
+  }
 }
diff --git a/solr/core/src/java/org/apache/solr/uninverting/FieldCacheImpl.java b/solr/core/src/java/org/apache/solr/uninverting/FieldCacheImpl.java
index e6e8fda..dcce167 100644
--- a/solr/core/src/java/org/apache/solr/uninverting/FieldCacheImpl.java
+++ b/solr/core/src/java/org/apache/solr/uninverting/FieldCacheImpl.java
@@ -507,18 +507,7 @@ public class FieldCacheImpl implements FieldCache {
       }
       
       // otherwise a no-op uninvert!
-      Uninvert u = new Uninvert(true) {
-        @Override
-        protected TermsEnum termsEnum(Terms terms) throws IOException {
-          throw new AssertionError();
-        }
-
-        @Override
-        protected void visitTerm(BytesRef term) {}
-
-        @Override
-        protected void visitDoc(int docID) {}
-      };
+      Uninvert u = new MyUninvert();
       u.uninvert(reader, field);
       return new BitsEntry(u.docsWithField);
     }
@@ -571,6 +560,23 @@ public class FieldCacheImpl implements FieldCache {
       }
       return new BitsEntry(res);
     }
+
+    private static class MyUninvert extends Uninvert {
+      public MyUninvert() {
+        super(true);
+      }
+
+      @Override
+      protected TermsEnum termsEnum(Terms terms) throws IOException {
+        throw new AssertionError();
+      }
+
+      @Override
+      protected void visitTerm(BytesRef term) {}
+
+      @Override
+      protected void visitDoc(int docID) {}
+    }
   }
 
   @Override
@@ -707,46 +713,7 @@ public class FieldCacheImpl implements FieldCache {
 
       final HoldsOneThing<GrowableWriterAndMinValue> valuesRef = new HoldsOneThing<>();
 
-      Uninvert u = new Uninvert(parser instanceof PointParser) {
-          private long minValue;
-          private long currentValue;
-          private GrowableWriter values;
-
-          @Override
-          public void visitTerm(BytesRef term) {
-            currentValue = parser.parseValue(term);
-            if (values == null) {
-              // Lazy alloc so for the numeric field case
-              // (which will hit a NumberFormatException
-              // when we first try the DEFAULT_INT_PARSER),
-              // we don't double-alloc:
-              int startBitsPerValue;
-              // Make sure than missing values (0) can be stored without resizing
-              if (currentValue < 0) {
-                minValue = currentValue;
-                startBitsPerValue = minValue == Long.MIN_VALUE ? 64 : PackedInts.bitsRequired(-minValue);
-              } else {
-                minValue = 0;
-                startBitsPerValue = PackedInts.bitsRequired(currentValue);
-              }
-              values = new GrowableWriter(startBitsPerValue, reader.maxDoc(), PackedInts.FAST);
-              if (minValue != 0) {
-                values.fill(0, values.size(), -minValue); // default value must be 0
-              }
-              valuesRef.set(new GrowableWriterAndMinValue(values, minValue));
-            }
-          }
-
-          @Override
-          public void visitDoc(int docID) {
-            values.set(docID, currentValue - minValue);
-          }
-          
-          @Override
-          protected TermsEnum termsEnum(Terms terms) throws IOException {
-            return parser.termsEnum(terms);
-          }
-        };
+      Uninvert u = new MyUninvert2(parser, reader, valuesRef);
 
       u.uninvert(reader, key.field);
       wrapper.setDocsWithField(reader, key.field, u.docsWithField, parser);
@@ -757,6 +724,57 @@ public class FieldCacheImpl implements FieldCache {
       }
       return new LongsFromArray(key.field, values.writer.getMutable(), values.minValue, docsWithField);
     }
+
+    private static class MyUninvert2 extends Uninvert {
+      private final Parser parser;
+      private final LeafReader reader;
+      private final HoldsOneThing<GrowableWriterAndMinValue> valuesRef;
+      private long minValue;
+      private long currentValue;
+      private GrowableWriter values;
+
+      public MyUninvert2(Parser parser, LeafReader reader, HoldsOneThing<GrowableWriterAndMinValue> valuesRef) {
+        super(parser instanceof PointParser);
+        this.parser = parser;
+        this.reader = reader;
+        this.valuesRef = valuesRef;
+      }
+
+      @Override
+      public void visitTerm(BytesRef term) {
+        currentValue = parser.parseValue(term);
+        if (values == null) {
+          // Lazy alloc so for the numeric field case
+          // (which will hit a NumberFormatException
+          // when we first try the DEFAULT_INT_PARSER),
+          // we don't double-alloc:
+          int startBitsPerValue;
+          // Make sure than missing values (0) can be stored without resizing
+          if (currentValue < 0) {
+            minValue = currentValue;
+            startBitsPerValue = minValue == Long.MIN_VALUE ? 64 : PackedInts.bitsRequired(-minValue);
+          } else {
+            minValue = 0;
+            startBitsPerValue = PackedInts.bitsRequired(currentValue);
+          }
+          values = new GrowableWriter(startBitsPerValue, reader.maxDoc(), PackedInts.FAST);
+          if (minValue != 0) {
+            values.fill(0, values.size(), -minValue); // default value must be 0
+          }
+          valuesRef.set(new GrowableWriterAndMinValue(values, minValue));
+        }
+      }
+
+      @Override
+      public void visitDoc(int docID) {
+        values.set(docID, currentValue - minValue);
+      }
+
+      @Override
+      protected TermsEnum termsEnum(Terms terms) throws IOException {
+        return parser.termsEnum(terms);
+      }
+    }
   }
 
   public static class SortedDocValuesImpl implements Accountable {
@@ -1175,22 +1193,32 @@ public class FieldCacheImpl implements FieldCache {
       }
 
       final PackedInts.Reader offsetReader = docToOffset.getMutable();
-      Bits docsWithField = new Bits() {
-        @Override
-        public boolean get(int index) {
-          return offsetReader.get(index) != 0;
-        }
-
-        @Override
-        public int length() {
-          return maxDoc;
-        }
-      };
+      Bits docsWithField = new MyBits(offsetReader, maxDoc);
 
       wrapper.setDocsWithField(reader, key.field, docsWithField, null);
       // maybe an int-only impl?
       return new BinaryDocValuesImpl(bytes.freeze(true), offsetReader, docsWithField);
     }
+
+    private static class MyBits implements Bits {
+      private final PackedInts.Reader offsetReader;
+      private final int maxDoc;
+
+      public MyBits(PackedInts.Reader offsetReader, int maxDoc) {
+        this.offsetReader = offsetReader;
+        this.maxDoc = maxDoc;
+      }
+
+      @Override
+      public boolean get(int index) {
+        return offsetReader.get(index) != 0;
+      }
+
+      @Override
+      public int length() {
+        return maxDoc;
+      }
+    }
   }
 
   // TODO: this if DocTermsIndex was already created, we
diff --git a/solr/core/src/java/org/apache/solr/uninverting/UninvertingReader.java b/solr/core/src/java/org/apache/solr/uninverting/UninvertingReader.java
index d83e70e..5d5ebac 100644
--- a/solr/core/src/java/org/apache/solr/uninverting/UninvertingReader.java
+++ b/solr/core/src/java/org/apache/solr/uninverting/UninvertingReader.java
@@ -196,12 +196,7 @@ public class UninvertingReader extends FilterLeafReader {
     final Function<String, Type> mapper;
     
     public UninvertingDirectoryReader(DirectoryReader in, final Function<String, Type> mapper) throws IOException {
-      super(in, new FilterDirectoryReader.SubReaderWrapper() {
-        @Override
-        public LeafReader wrap(LeafReader reader) {
-          return UninvertingReader.wrap(reader, mapper);
-        }
-      });
+      super(in, new MySubReaderWrapper(mapper));
       this.mapper = mapper;
     }
 
@@ -218,6 +213,19 @@ public class UninvertingReader extends FilterLeafReader {
     public CacheHelper getReaderCacheHelper() {
       return in.getReaderCacheHelper();
     }
+
+    private static class MySubReaderWrapper extends SubReaderWrapper {
+      private final Function<String,Type> mapper;
+
+      public MySubReaderWrapper(Function<String,Type> mapper) {
+        this.mapper = mapper;
+      }
+
+      @Override
+      public LeafReader wrap(LeafReader reader) {
+        return UninvertingReader.wrap(reader, mapper);
+      }
+    }
   }
 
   /**
diff --git a/solr/core/src/java/org/apache/solr/update/TransactionLog.java b/solr/core/src/java/org/apache/solr/update/TransactionLog.java
index f052b53..4bbc041 100644
--- a/solr/core/src/java/org/apache/solr/update/TransactionLog.java
+++ b/solr/core/src/java/org/apache/solr/update/TransactionLog.java
@@ -200,9 +200,6 @@ public class TransactionLog implements Closeable {
           return;
         }
 
-        if (start > 0) {
-          raf.setLength(0);
-        }
         addGlobalStrings(globalStrings);
       }
 
@@ -934,7 +931,7 @@ public class TransactionLog implements Closeable {
 
   }
 
-  class ChannelFastInputStream extends FastInputStream {
+  static class ChannelFastInputStream extends FastInputStream {
     private FileChannel ch;
 
     public ChannelFastInputStream(FileChannel ch, long chPosition) {
diff --git a/solr/core/src/java/org/apache/solr/update/processor/DistributedZkUpdateProcessor.java b/solr/core/src/java/org/apache/solr/update/processor/DistributedZkUpdateProcessor.java
index cae28c1..fab2429 100644
--- a/solr/core/src/java/org/apache/solr/update/processor/DistributedZkUpdateProcessor.java
+++ b/solr/core/src/java/org/apache/solr/update/processor/DistributedZkUpdateProcessor.java
@@ -34,7 +34,6 @@ import java.util.concurrent.locks.ReentrantLock;
 
 import org.apache.solr.client.solrj.request.UpdateRequest;
 import org.apache.solr.cloud.CloudDescriptor;
-import org.apache.solr.cloud.LeaderElector;
 import org.apache.solr.cloud.Overseer;
 import org.apache.solr.cloud.ZkController;
 import org.apache.solr.cloud.ZkShardTerms;
diff --git a/solr/core/src/java/org/apache/solr/update/processor/UUIDUpdateProcessorFactory.java b/solr/core/src/java/org/apache/solr/update/processor/UUIDUpdateProcessorFactory.java
index 9e02384..27a339b 100644
--- a/solr/core/src/java/org/apache/solr/update/processor/UUIDUpdateProcessorFactory.java
+++ b/solr/core/src/java/org/apache/solr/update/processor/UUIDUpdateProcessorFactory.java
@@ -100,12 +100,18 @@ public class UUIDUpdateProcessorFactory extends UpdateRequestProcessorFactory {
       fieldName = schemaField.getName();
     }
 
-    return new AbstractDefaultValueUpdateProcessorFactory.DefaultValueUpdateProcessor(fieldName, next) {
-      @Override
-      public Object getDefaultValue() {
-        return UUID.randomUUID().toString().toLowerCase(Locale.ROOT);
-      }
-    };
+    return new MyDefaultValueUpdateProcessor(fieldName, next);
+  }
+
+  private static class MyDefaultValueUpdateProcessor extends AbstractDefaultValueUpdateProcessorFactory.DefaultValueUpdateProcessor {
+    public MyDefaultValueUpdateProcessor(String fieldName, UpdateRequestProcessor next) {
+      super(fieldName, next);
+    }
+
+    @Override
+    public Object getDefaultValue() {
+      return UUID.randomUUID().toString().toLowerCase(Locale.ROOT);
+    }
   }
 }
 
diff --git a/solr/core/src/test/org/apache/solr/AnalysisAfterCoreReloadTest.java b/solr/core/src/test/org/apache/solr/AnalysisAfterCoreReloadTest.java
index 4941bd1..d098205 100644
--- a/solr/core/src/test/org/apache/solr/AnalysisAfterCoreReloadTest.java
+++ b/solr/core/src/test/org/apache/solr/AnalysisAfterCoreReloadTest.java
@@ -41,8 +41,8 @@ public class AnalysisAfterCoreReloadTest extends SolrTestCaseJ4 {
   
   @BeforeClass
   public static void beforeClass() throws Exception {
-    tmpSolrHome = createTempDir().toFile().getAbsolutePath();
-    FileUtils.copyDirectory(new File(TEST_HOME()), new File(tmpSolrHome).getAbsoluteFile());
+    tmpSolrHome = SolrTestUtil.createTempDir().toFile().getAbsolutePath();
+    FileUtils.copyDirectory(new File(SolrTestUtil.TEST_HOME()), new File(tmpSolrHome).getAbsoluteFile());
     initCore("solrconfig.xml", "schema.xml", new File(tmpSolrHome).getAbsolutePath());
   }
 
diff --git a/solr/core/src/test/org/apache/solr/BasicFunctionalityTest.java b/solr/core/src/test/org/apache/solr/BasicFunctionalityTest.java
index d9cf23a..f81f7b3 100644
--- a/solr/core/src/test/org/apache/solr/BasicFunctionalityTest.java
+++ b/solr/core/src/test/org/apache/solr/BasicFunctionalityTest.java
@@ -359,9 +359,7 @@ public class BasicFunctionalityTest extends SolrTestCaseJ4 {
 
     // test that malformed numerics cause client error not server error
     for (String field : FIELDS) {
-      SolrException e1 = expectThrows(SolrException.class,
-          "Didn't encounter an error trying to add a bad date: " + field,
-          () -> h.update(add( doc("id","100", field, BAD_VALUE))));
+      SolrException e1 = SolrTestCaseUtil.expectThrows(SolrException.class, "Didn't encounter an error trying to add a bad date: " + field, () -> h.update(add(doc("id", "100", field, BAD_VALUE))));
       String msg1 = e1.getMessage();
       // nocommit
 //      assertTrue("not an (update) client error on field: " + field +" : "+ msg1,
@@ -376,20 +374,15 @@ public class BasicFunctionalityTest extends SolrTestCaseJ4 {
       if (!sf.hasDocValues() && !sf.indexed()) {
         continue;
       }
-      SolrException e2 = expectThrows(SolrException.class,
-          "Didn't encounter an error trying to add a bad date: " + field,
-          () -> query(req("q",field + ":" + BAD_VALUE))
-      );
+      SolrException e2 = SolrTestCaseUtil.expectThrows(SolrException.class, "Didn't encounter an error trying to add a bad date: " + field, () -> query(req("q", field + ":" + BAD_VALUE)));
       String msg2 = e2.toString();
       assertTrue("not a (search) client error on field: " + field +" : "+ msg2,
           400 <= e2.code() && e2.code() < 500);
       assertTrue("(search) client error does not mention bad value: " + msg2,
           msg2.contains(BAD_VALUE));
 
-      SolrException e3 = expectThrows(SolrException.class,
-          "Didn't encounter an error trying to add a bad date: " + field,
-          () -> query(req("q",field + ":[NOW TO " + BAD_VALUE + "]"))
-      );
+      SolrException e3 = SolrTestCaseUtil
+          .expectThrows(SolrException.class, "Didn't encounter an error trying to add a bad date: " + field, () -> query(req("q", field + ":[NOW TO " + BAD_VALUE + "]")));
       String msg3 = e3.toString();
       assertTrue("not a (search) client error on field: " + field +" : "+ msg3,
           400 <= e3.code() && e3.code() < 500);
@@ -417,9 +410,7 @@ public class BasicFunctionalityTest extends SolrTestCaseJ4 {
 
     // test that malformed numerics cause client error not server error
     for (String field : FIELDS) {
-      SolrException e1 = expectThrows(SolrException.class,
-          "Didn't encounter an error trying to add a non-number: " + field,
-          () -> h.update(add( doc("id","100", field, BAD_VALUE))));
+      SolrException e1 = SolrTestCaseUtil.expectThrows(SolrException.class, "Didn't encounter an error trying to add a non-number: " + field, () -> h.update(add(doc("id", "100", field, BAD_VALUE))));
       String msg1 = e1.toString();
       // nocommit
 //      assertTrue("not an (update) client error on field: " + field +" : "+ msg1,
@@ -435,20 +426,15 @@ public class BasicFunctionalityTest extends SolrTestCaseJ4 {
         continue;
       }
 
-      SolrException e2 = expectThrows(SolrException.class,
-          "Didn't encounter an error trying to add a non-number: " + field,
-          () -> query(req("q",field + ":" + BAD_VALUE))
-      );
+      SolrException e2 = SolrTestCaseUtil.expectThrows(SolrException.class, "Didn't encounter an error trying to add a non-number: " + field, () -> query(req("q", field + ":" + BAD_VALUE)));
       String msg2 = e2.toString();
       assertTrue("not a (search) client error on field: " + field +" : "+ msg2,
           400 <= e2.code() && e2.code() < 500);
       assertTrue("(search) client error does not mention bad value: " + msg2,
           msg2.contains(BAD_VALUE));
 
-      SolrException e3 = expectThrows(SolrException.class,
-          "Didn't encounter an error trying to add a non-number: " + field,
-          () -> query(req("q",field + ":[10 TO " + BAD_VALUE + "]"))
-      );
+      SolrException e3 = SolrTestCaseUtil
+          .expectThrows(SolrException.class, "Didn't encounter an error trying to add a non-number: " + field, () -> query(req("q", field + ":[10 TO " + BAD_VALUE + "]")));
       String msg3 = e3.toString();
       assertTrue("not a (search) client error on field: " + field +" : "+ msg3,
           400 <= e3.code() && e3.code() < 500);
@@ -891,9 +877,9 @@ public class BasicFunctionalityTest extends SolrTestCaseJ4 {
     
     // a ridiculoulsy long date math expression that's still equivalent to july4
     final StringBuilder july4Long = new StringBuilder(july4);
-    final int iters = atLeast(10);
+    final int iters = SolrTestUtil.atLeast(10);
     for (int i = 0; i < iters; i++) {
-      final String val = String.valueOf(atLeast(1));
+      final String val = String.valueOf(SolrTestUtil.atLeast(1));
       july4Long.append("+" + val + "SECONDS-" + val + "SECONDS");
     }
 
@@ -1009,13 +995,10 @@ public class BasicFunctionalityTest extends SolrTestCaseJ4 {
     assertU(commit());
 
     for (String f : Arrays.asList("sortabuse_not_uninvertible", "sortabuse_t")) {
-      RuntimeException outerEx = expectThrows(RuntimeException.class, () -> {
-          ignoreException("sortabuse");
-          assertQ("sort on something that shouldn't work",
-                  req("q", "*:*",
-                      "sort", f+ " asc"),
-                  "*[count(//doc)=2]");
-        });
+      RuntimeException outerEx = SolrTestCaseUtil.expectThrows(RuntimeException.class, () -> {
+        ignoreException("sortabuse");
+        assertQ("sort on something that shouldn't work", req("q", "*:*", "sort", f + " asc"), "*[count(//doc)=2]");
+      });
       Throwable root = getRootCause(outerEx);
       assertEquals("sort exception root cause",
                    SolrException.class, root.getClass());
diff --git a/solr/core/src/test/org/apache/solr/CursorPagingTest.java b/solr/core/src/test/org/apache/solr/CursorPagingTest.java
index 6e67c7e..c755f89 100644
--- a/solr/core/src/test/org/apache/solr/CursorPagingTest.java
+++ b/solr/core/src/test/org/apache/solr/CursorPagingTest.java
@@ -16,6 +16,7 @@
  */
 package org.apache.solr;
 
+import org.apache.lucene.util.LuceneTestCase;
 import org.apache.lucene.util.SentinelIntSet;
 import org.apache.lucene.util.TestUtil;
 import org.apache.lucene.util.mutable.MutableValueInt;
@@ -504,7 +505,7 @@ public class CursorPagingTest extends SolrTestCaseJ4 {
   /**
    * test that our assumptions about how caches are affected hold true
    */
-  @Nightly // can randomly hit:
+  @LuceneTestCase.Nightly // can randomly hit:
 //  java.lang.UnsupportedOperationException
 //  at __randomizedtesting.SeedInfo.seed([4ECEFFACB197503C:3CC812D4842EB732]:0)
 //  at org.apache.lucene.queries.function.FunctionValues.longVal(FunctionValues.java:49)
@@ -563,12 +564,12 @@ public class CursorPagingTest extends SolrTestCaseJ4 {
 
   /** randomized testing of a non-trivial number of docs using assertFullWalkNoDups 
    */
-  @Nightly
+  @LuceneTestCase.Nightly
   public void testRandomSortsOnLargeIndex() throws Exception {
     final Collection<String> allFieldNames = getAllSortFieldNames();
 
     final int initialDocs = TestUtil.nextInt(random(), 100, TEST_NIGHTLY ? 200 : 102);
-    final int totalDocs = TEST_NIGHTLY ? atLeast(500) : 105;
+    final int totalDocs = TEST_NIGHTLY ? LuceneTestCase.atLeast(500) : 105;
 
     // start with a smallish number of documents, and test that we can do a full walk using a 
     // sort on *every* field in the schema...
@@ -599,7 +600,7 @@ public class CursorPagingTest extends SolrTestCaseJ4 {
     }
     assertU(commit());
 
-    final int numRandomSorts = atLeast(TEST_NIGHTLY ? 3 : 1);
+    final int numRandomSorts = LuceneTestCase.atLeast(TEST_NIGHTLY ? 3 : 1);
     for (int i = 0; i < numRandomSorts; i++) {
       final String sort = buildRandomSort(allFieldNames);
       final String rows = "" + TestUtil.nextInt(random(), 63, TEST_NIGHTLY ? 113 : 73);
@@ -707,7 +708,7 @@ public class CursorPagingTest extends SolrTestCaseJ4 {
   /**
    * test faceting with deep paging
    */
-  @Nightly // slow
+  @LuceneTestCase.Nightly // slow
   public void testFacetingWithRandomSorts() throws Exception {
     final int numDocs = TestUtil.nextInt(random(), 1000, 3000);
     String[] fieldsToFacetOn = { "int", "long", "str" };
@@ -852,7 +853,7 @@ public class CursorPagingTest extends SolrTestCaseJ4 {
     throws Exception {
 
     try {
-      SolrException e = expectThrows(SolrException.class, () -> {
+      SolrException e = SolrTestCaseUtil.expectThrows(SolrException.class, () -> {
         ignoreException(expSubstr);
         assertJQ(req(p));
       });
diff --git a/solr/core/src/test/org/apache/solr/DistributedIntervalFacetingTest.java b/solr/core/src/test/org/apache/solr/DistributedIntervalFacetingTest.java
index d3cd0f4..fe49e90 100644
--- a/solr/core/src/test/org/apache/solr/DistributedIntervalFacetingTest.java
+++ b/solr/core/src/test/org/apache/solr/DistributedIntervalFacetingTest.java
@@ -108,7 +108,7 @@ public class DistributedIntervalFacetingTest extends
     // Fields to use for interval faceting
     String[] fields = new String[]{"test_s_dv", "test_i_dv", "test_l_dv", "test_f_dv", "test_d_dv",
         "test_ss_dv", "test_is_dv", "test_fs_dv", "test_ls_dv", "test_ds_dv"};
-    for (int i = 0; i < atLeast(TEST_NIGHTLY ? 500 : 50); i++) {
+    for (int i = 0; i < SolrTestUtil.atLeast(TEST_NIGHTLY ? 500 : 50); i++) {
       if (random().nextInt(50) == 0) {
         //have some empty docs
         indexr("id", String.valueOf(i));
@@ -157,7 +157,7 @@ public class DistributedIntervalFacetingTest extends
     handle.put("maxScore", SKIPVAL);
 
 
-    for (int i = 0; i < atLeast(TEST_NIGHTLY ? 100 : 15); i++) {
+    for (int i = 0; i < SolrTestUtil.atLeast(TEST_NIGHTLY ? 100 : 15); i++) {
       doTestQuery(cardinality, fields);
     }
 
diff --git a/solr/core/src/test/org/apache/solr/HelloWorldSolrCloudTestCase.java b/solr/core/src/test/org/apache/solr/HelloWorldSolrCloudTestCase.java
index 4592010..bc7afa5 100644
--- a/solr/core/src/test/org/apache/solr/HelloWorldSolrCloudTestCase.java
+++ b/solr/core/src/test/org/apache/solr/HelloWorldSolrCloudTestCase.java
@@ -50,7 +50,7 @@ public class HelloWorldSolrCloudTestCase extends SolrCloudTestCase {
 
     // create and configure cluster
     configureCluster(3)
-        .addConfig("conf", configset("cloud-dynamic"))
+        .addConfig("conf", SolrTestUtil.configset("cloud-dynamic"))
         .configure();
 
     // create an empty collection
diff --git a/solr/core/src/test/org/apache/solr/SolrTestCaseJ4Test.java b/solr/core/src/test/org/apache/solr/SolrTestCaseJ4Test.java
index 38b9934..b955854 100644
--- a/solr/core/src/test/org/apache/solr/SolrTestCaseJ4Test.java
+++ b/solr/core/src/test/org/apache/solr/SolrTestCaseJ4Test.java
@@ -22,9 +22,7 @@ import org.apache.commons.io.FileUtils;
 import org.apache.solr.common.params.ModifiableSolrParams;
 import org.apache.solr.core.SolrCore;
 import org.junit.After;
-import org.junit.AfterClass;
 import org.junit.Before;
-import org.junit.BeforeClass;
 import org.junit.Test;
 
 
@@ -36,11 +34,11 @@ public class SolrTestCaseJ4Test extends SolrTestCaseJ4 {
   public void beforeTest() throws Exception {
     // Create a temporary directory that holds a core NOT named "collection1". Use the smallest configuration sets
     // we can so we don't copy that much junk around.
-    tmpSolrHome = createTempDir().toFile().getAbsolutePath();
+    tmpSolrHome = SolrTestUtil.createTempDir().toFile().getAbsolutePath();
 
     File subHome = new File(new File(tmpSolrHome, "core0"), "conf");
     assertTrue("Failed to make subdirectory ", subHome.mkdirs());
-    String top = SolrTestCaseJ4.TEST_HOME() + "/collection1/conf";
+    String top = SolrTestUtil.TEST_HOME() + "/collection1/conf";
     FileUtils.copyFile(new File(top, "schema-tiny.xml"), new File(subHome, "schema-tiny.xml"));
     FileUtils.copyFile(new File(top, "solrconfig-minimal.xml"), new File(subHome, "solrconfig-minimal.xml"));
     FileUtils.copyFile(new File(top, "solrconfig.snippet.randomindexconfig.xml"), new File(subHome, "solrconfig.snippet.randomindexconfig.xml"));
@@ -51,7 +49,7 @@ public class SolrTestCaseJ4Test extends SolrTestCaseJ4 {
     FileUtils.touch(new File(tmpSolrHome, "core0/core.properties"));
     FileUtils.touch(new File(tmpSolrHome, "core1/core.properties"));
 
-    FileUtils.copyFile(getFile("solr/solr.xml"), new File(tmpSolrHome, "solr.xml"));
+    FileUtils.copyFile(SolrTestUtil.getFile("solr/solr.xml"), new File(tmpSolrHome, "solr.xml"));
 
     initCore("solrconfig-minimal.xml", "schema-tiny.xml", tmpSolrHome, "core1");
   }
@@ -79,11 +77,11 @@ public class SolrTestCaseJ4Test extends SolrTestCaseJ4 {
     params.add("rows", "42");
     assertEquals(params.toString(), params("q", "*:*", "rows", "42").toString());
 
-    expectThrows(RuntimeException.class, () -> {
+    SolrTestCaseUtil.expectThrows(RuntimeException.class, () -> {
       params("parameterWithoutValue");
     });
 
-    expectThrows(RuntimeException.class, () -> {
+    SolrTestCaseUtil.expectThrows(RuntimeException.class, () -> {
       params("q", "*:*", "rows", "42", "parameterWithoutValue");
     });
   }
diff --git a/solr/core/src/test/org/apache/solr/TestCrossCoreJoin.java b/solr/core/src/test/org/apache/solr/TestCrossCoreJoin.java
index 57ad11a..59ac498 100644
--- a/solr/core/src/test/org/apache/solr/TestCrossCoreJoin.java
+++ b/solr/core/src/test/org/apache/solr/TestCrossCoreJoin.java
@@ -48,7 +48,7 @@ public class TestCrossCoreJoin extends SolrTestCaseJ4 {
 
     // File testHome = createTempDir().toFile();
     // FileUtils.copyDirectory(getFile("solrj/solr"), testHome);
-    initCore("solrconfig.xml", "schema12.xml", TEST_HOME(), "collection1");
+    initCore("solrconfig.xml", "schema12.xml", SolrTestUtil.TEST_HOME(), "collection1");
     final CoreContainer coreContainer = h.getCoreContainer();
 
     fromCore = coreContainer.create("fromCore", ImmutableMap.of("configSet", "minimal"));
diff --git a/solr/core/src/test/org/apache/solr/TestCursorMarkWithoutUniqueKey.java b/solr/core/src/test/org/apache/solr/TestCursorMarkWithoutUniqueKey.java
index 7424ec8..029e396 100644
--- a/solr/core/src/test/org/apache/solr/TestCursorMarkWithoutUniqueKey.java
+++ b/solr/core/src/test/org/apache/solr/TestCursorMarkWithoutUniqueKey.java
@@ -56,10 +56,8 @@ public class TestCursorMarkWithoutUniqueKey extends SolrTestCaseJ4 {
 
     try {
       ignoreException("Cursor functionality is not available unless the IndexSchema defines a uniqueKey field");
-      expectThrows(RuntimeException.class,
-          "No exception when querying with a cursorMark with no uniqueKey defined.",
-          () -> assertQ(req("q", "*:*", "sort", "fld desc", "cursorMark", CURSOR_MARK_START))
-      );
+      SolrTestCaseUtil.expectThrows(RuntimeException.class, "No exception when querying with a cursorMark with no uniqueKey defined.",
+          () -> assertQ(req("q", "*:*", "sort", "fld desc", "cursorMark", CURSOR_MARK_START)));
     } finally {
       unIgnoreException("Cursor functionality is not available unless the IndexSchema defines a uniqueKey field");
     }
diff --git a/solr/core/src/test/org/apache/solr/TestDistributedGrouping.java b/solr/core/src/test/org/apache/solr/TestDistributedGrouping.java
index 220f62c..fb79226 100644
--- a/solr/core/src/test/org/apache/solr/TestDistributedGrouping.java
+++ b/solr/core/src/test/org/apache/solr/TestDistributedGrouping.java
@@ -283,10 +283,7 @@ public class TestDistributedGrouping extends BaseDistributedSearchTestCase {
         "sort", i1 + " asc, id asc");
 
     ignoreException("'group.offset' parameter cannot be negative");
-    SolrException exception = expectThrows(SolrException.class, () -> query("q", "*:*",
-        "group", "true",
-        "group.query", t1 + ":kings OR " + t1 + ":eggs", "group.offset", "-1")
-    );
+    SolrException exception = SolrTestCaseUtil.expectThrows(SolrException.class, () -> query("q", "*:*", "group", "true", "group.query", t1 + ":kings OR " + t1 + ":eggs", "group.offset", "-1"));
     assertEquals(SolrException.ErrorCode.BAD_REQUEST.code, exception.code());
     assertThat(exception.getMessage(), containsString("'group.offset' parameter cannot be negative"));
     resetExceptionIgnores();
diff --git a/solr/core/src/test/org/apache/solr/TestDistributedSearch.java b/solr/core/src/test/org/apache/solr/TestDistributedSearch.java
index d94e7f4..4ee2e5b 100644
--- a/solr/core/src/test/org/apache/solr/TestDistributedSearch.java
+++ b/solr/core/src/test/org/apache/solr/TestDistributedSearch.java
@@ -81,8 +81,8 @@ public class TestDistributedSearch extends BaseDistributedSearchTestCase {
   private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
 
   String t1="a_t";
-  String i1 = pickRandom("a_i1", "a_i_p", "a_i_ni_p");
-  String nint = pickRandom("n_i", "n_is_p", "n_is_ni_p");
+  String i1 = SolrTestCaseUtil.pickRandom("a_i1", "a_i_p", "a_i_ni_p");
+  String nint = SolrTestCaseUtil.pickRandom("n_i", "n_is_p", "n_is_ni_p");
   String tint = "n_ti";
   String tlong = "other_tl1";
   String tdate_a = "a_n_tdt";
@@ -406,7 +406,7 @@ public class TestDistributedSearch extends BaseDistributedSearchTestCase {
     query("q", "toyata", "fl", "id,lowerfilt", "spellcheck", true, "spellcheck.q", "toyata", "qt", "/spellCheckCompRH_Direct", "shards.qt", "/spellCheckCompRH_Direct");
 
     stress=0;  // turn off stress... we want to tex max combos in min time
-    for (int i=0; i<(TEST_NIGHTLY ? 25 : 5)*RANDOM_MULTIPLIER; i++) {
+    for (int i=0; i<(TEST_NIGHTLY ? 25 : 5)*LuceneTestCase.RANDOM_MULTIPLIER; i++) {
       String f = fieldNames[random().nextInt(fieldNames.length)];
       if (random().nextBoolean()) f = t1;  // the text field is a really interesting one to facet on (and it's multi-valued too)
 
@@ -1285,28 +1285,28 @@ public class TestDistributedSearch extends BaseDistributedSearchTestCase {
   private void validateCommonQueryParameters() throws Exception {
     ignoreException("parameter cannot be negative");
 
-    SolrException e1 = expectThrows(SolrException.class, () -> {
+    SolrException e1 = SolrTestCaseUtil.expectThrows(SolrException.class, () -> {
       SolrQuery query = new SolrQuery();
       query.setParam("start", "non_numeric_value").setQuery("*");
       QueryResponse resp = query(query);
     });
     assertEquals(ErrorCode.BAD_REQUEST.code, e1.code());
 
-    SolrException e2 = expectThrows(SolrException.class, () -> {
+    SolrException e2 = SolrTestCaseUtil.expectThrows(SolrException.class, () -> {
       SolrQuery query = new SolrQuery();
       query.setStart(-1).setQuery("*");
       QueryResponse resp = query(query);
     });
     assertEquals(ErrorCode.BAD_REQUEST.code, e2.code());
 
-    SolrException e3 = expectThrows(SolrException.class, () -> {
+    SolrException e3 = SolrTestCaseUtil.expectThrows(SolrException.class, () -> {
       SolrQuery query = new SolrQuery();
       query.setRows(-1).setStart(0).setQuery("*");
       QueryResponse resp = query(query);
     });
     assertEquals(ErrorCode.BAD_REQUEST.code, e3.code());
 
-    SolrException e4 = expectThrows(SolrException.class, () -> {
+    SolrException e4 = SolrTestCaseUtil.expectThrows(SolrException.class, () -> {
       SolrQuery query = new SolrQuery();
       query.setParam("rows", "non_numeric_value").setQuery("*");
       QueryResponse resp = query(query);
diff --git a/solr/core/src/test/org/apache/solr/TestGroupingSearch.java b/solr/core/src/test/org/apache/solr/TestGroupingSearch.java
index 0224aba..74c16eb 100644
--- a/solr/core/src/test/org/apache/solr/TestGroupingSearch.java
+++ b/solr/core/src/test/org/apache/solr/TestGroupingSearch.java
@@ -127,7 +127,7 @@ public class TestGroupingSearch extends SolrTestCaseJ4 {
         , "//arr[@name='groups']/lst[2]/result/doc/*[@name='id'][.='5']"
     );
 
-    SolrException exception = expectThrows(SolrException.class, () -> {
+    SolrException exception = SolrTestCaseUtil.expectThrows(SolrException.class, () -> {
       h.query(req("q", "title:title", "group", "true", "group.field", "group_i", "group.offset", "-1"));
     });
     assertEquals(SolrException.ErrorCode.BAD_REQUEST.code, exception.code());
@@ -752,12 +752,12 @@ public class TestGroupingSearch extends SolrTestCaseJ4 {
      assertJQ(req("q","id:"+doc.id), "/response/numFound==1");
     **/
 
-    int indexIter=atLeast(10);  // make >0 to enable test
-    int queryIter=atLeast(50);
+    int indexIter= SolrTestUtil.atLeast(10);  // make >0 to enable test
+    int queryIter= SolrTestUtil.atLeast(50);
 
     while (--indexIter >= 0) {
 
-      int indexSize = random().nextInt(25 * RANDOM_MULTIPLIER);
+      int indexSize = random().nextInt(25 * LuceneTestCase.RANDOM_MULTIPLIER);
 //indexSize=2;
       List<FldType> types = new ArrayList<>();
       types.add(new FldType("id",ONE_ONE, new SVal('A','Z',4,4)));
diff --git a/solr/core/src/test/org/apache/solr/TestJoin.java b/solr/core/src/test/org/apache/solr/TestJoin.java
index 29e0dd8..ee39980 100644
--- a/solr/core/src/test/org/apache/solr/TestJoin.java
+++ b/solr/core/src/test/org/apache/solr/TestJoin.java
@@ -16,6 +16,7 @@
  */
 package org.apache.solr;
 
+import org.apache.lucene.util.LuceneTestCase;
 import org.apache.solr.common.SolrException;
 import org.apache.solr.common.params.ModifiableSolrParams;
 import org.apache.solr.common.util.Utils;
@@ -154,13 +155,13 @@ public class TestJoin extends SolrTestCaseJ4 {
     ModifiableSolrParams p = params("sort","id asc");
 
     // "from" field missing docValues
-    expectThrows(SolrException.class, () -> {
-      query(req(p, "q", "{!join from=nodocvalues_s to=dept_ss_dv method=topLevelDV}*:*", "fl","id"));
+    SolrTestCaseUtil.expectThrows(SolrException.class, () -> {
+      query(req(p, "q", "{!join from=nodocvalues_s to=dept_ss_dv method=topLevelDV}*:*", "fl", "id"));
     });
 
     // "to" field missing docValues
-    expectThrows(SolrException.class, () -> {
-      query(req(p, "q", "{!join from=dept_ss_dv to=nodocvalues_s method=topLevelDV}*:*", "fl","id"));
+    SolrTestCaseUtil.expectThrows(SolrException.class, () -> {
+      query(req(p, "q", "{!join from=dept_ss_dv to=nodocvalues_s method=topLevelDV}*:*", "fl", "id"));
     });
   }
 
@@ -185,8 +186,8 @@ public class TestJoin extends SolrTestCaseJ4 {
 
   @Test
   public void testRandomJoin() throws Exception {
-    int indexIter= TEST_NIGHTLY ? 50 : 5 * RANDOM_MULTIPLIER;
-    int queryIter= TEST_NIGHTLY ? 50 : 5 * RANDOM_MULTIPLIER;
+    int indexIter= TEST_NIGHTLY ? 50 : 5 * LuceneTestCase.RANDOM_MULTIPLIER;
+    int queryIter= TEST_NIGHTLY ? 50 : 5 * LuceneTestCase.RANDOM_MULTIPLIER;
 
     // groups of fields that have any chance of matching... used to
     // increase test effectiveness by avoiding 0 resultsets much of the time.
@@ -197,7 +198,7 @@ public class TestJoin extends SolrTestCaseJ4 {
 
 
     while (--indexIter >= 0) {
-      int indexSize = random().nextInt(20 * RANDOM_MULTIPLIER);
+      int indexSize = random().nextInt(20 * LuceneTestCase.RANDOM_MULTIPLIER);
 
       List<FldType> types = new ArrayList<>();
       types.add(new FldType("id",ONE_ONE, new SVal('A','Z',4,4)));
diff --git a/solr/core/src/test/org/apache/solr/TestRandomDVFaceting.java b/solr/core/src/test/org/apache/solr/TestRandomDVFaceting.java
index ebbfef7..68f2284 100644
--- a/solr/core/src/test/org/apache/solr/TestRandomDVFaceting.java
+++ b/solr/core/src/test/org/apache/solr/TestRandomDVFaceting.java
@@ -23,6 +23,7 @@ import java.util.List;
 import java.util.Map;
 import java.util.Random;
 
+import org.apache.lucene.util.LuceneTestCase;
 import org.apache.lucene.util.TestUtil;
 import org.apache.lucene.util.LuceneTestCase.Slow;
 import org.apache.solr.common.params.ModifiableSolrParams;
@@ -156,7 +157,7 @@ public class TestRandomDVFaceting extends SolrTestCaseJ4 {
   @Test
   public void testRandomFaceting() throws Exception {
     Random rand = random();
-    int iter = atLeast(TEST_NIGHTLY ? 100 : 10);
+    int iter = SolrTestUtil.atLeast(TEST_NIGHTLY ? 100 : 10);
     init();
     addMoreDocs(0);
     
@@ -211,7 +212,7 @@ public class TestRandomDVFaceting extends SolrTestCaseJ4 {
       }
 
       if (rand.nextInt(100) < 20) {
-        if(rarely()) {
+        if(LuceneTestCase.rarely()) {
           params.add("facet.limit", "-1");
         } else {
           int limit = TEST_NIGHTLY ? 100 : 10;
diff --git a/solr/core/src/test/org/apache/solr/TestRandomFaceting.java b/solr/core/src/test/org/apache/solr/TestRandomFaceting.java
index 2d6df31..7910d8f 100644
--- a/solr/core/src/test/org/apache/solr/TestRandomFaceting.java
+++ b/solr/core/src/test/org/apache/solr/TestRandomFaceting.java
@@ -153,7 +153,7 @@ public class TestRandomFaceting extends SolrTestCaseJ4 {
   @Test
   public void testRandomFaceting() throws Exception {
     Random rand = random();
-    int iter = atLeast(100);
+    int iter = SolrTestUtil.atLeast(100);
     init();
     addMoreDocs(0);
     
diff --git a/solr/core/src/test/org/apache/solr/TestSolrCoreProperties.java b/solr/core/src/test/org/apache/solr/TestSolrCoreProperties.java
index 09efba1..bf4faea 100644
--- a/solr/core/src/test/org/apache/solr/TestSolrCoreProperties.java
+++ b/solr/core/src/test/org/apache/solr/TestSolrCoreProperties.java
@@ -49,7 +49,7 @@ public class TestSolrCoreProperties extends SolrJettyTestBase {
 
   @BeforeClass
   public static void beforeTestSolrCoreProperties() throws Exception {
-    File homeDir = createTempDir().toFile();
+    File homeDir = SolrTestUtil.createTempDir().toFile();
 
     File collDir = new File(homeDir, "collection1");
     File dataDir = new File(collDir, "data");
@@ -60,8 +60,8 @@ public class TestSolrCoreProperties extends SolrJettyTestBase {
     dataDir.mkdirs();
     confDir.mkdirs();
 
-    FileUtils.copyFile(new File(SolrTestCaseJ4.TEST_HOME(), "solr.xml"), new File(homeDir, "solr.xml"));
-    String src_dir = TEST_HOME() + "/collection1/conf";
+    FileUtils.copyFile(new File(SolrTestUtil.TEST_HOME(), "solr.xml"), new File(homeDir, "solr.xml"));
+    String src_dir = SolrTestUtil.TEST_HOME() + "/collection1/conf";
     FileUtils.copyFile(new File(src_dir, "schema-tiny.xml"), 
                        new File(confDir, "schema.xml"));
     FileUtils.copyFile(new File(src_dir, "solrconfig-solcoreproperties.xml"), 
@@ -82,7 +82,7 @@ public class TestSolrCoreProperties extends SolrJettyTestBase {
     Properties nodeProperties = new Properties();
     // this sets the property for jetty starting SolrDispatchFilter
     if (System.getProperty("solr.data.dir") == null && System.getProperty("solr.hdfs.home") == null) {
-      nodeProperties.setProperty("solr.data.dir", createTempDir().toFile().getCanonicalPath());
+      nodeProperties.setProperty("solr.data.dir", SolrTestUtil.createTempDir().toFile().getCanonicalPath());
     }
     jetty = new JettySolrRunner(homeDir.getAbsolutePath(), nodeProperties, buildJettyConfig("/solr"));
 
diff --git a/solr/core/src/test/org/apache/solr/TestTolerantSearch.java b/solr/core/src/test/org/apache/solr/TestTolerantSearch.java
index e6a5cd5..a175d83 100644
--- a/solr/core/src/test/org/apache/solr/TestTolerantSearch.java
+++ b/solr/core/src/test/org/apache/solr/TestTolerantSearch.java
@@ -47,20 +47,20 @@ public class TestTolerantSearch extends SolrJettyTestBase {
   private static File solrHome;
   
   private File createSolrHome() throws Exception {
-    File workDir = createTempDir().toFile();
+    File workDir = SolrTestUtil.createTempDir().toFile();
     setupJettyTestHome(workDir, "collection1");
-    FileUtils.copyFile(new File(SolrTestCaseJ4.TEST_HOME() + "/collection1/conf/solrconfig-tolerant-search.xml"), new File(workDir, "collection1/conf/solrconfig.xml"));
-    FileUtils.copyFile(new File(SolrTestCaseJ4.TEST_HOME() + "/collection1/conf/solrconfig.snippet.randomindexconfig.xml"), new File(workDir, "configsets/collection1/conf/solrconfig.snippet.randomindexconfig.xml"));
-    FileUtils.copyFile(new File(SolrTestCaseJ4.TEST_HOME() + "/collection1/conf/schema.xml"), new File(workDir, "collection1/conf/schema.xml"));
-    FileUtils.copyFile(new File(SolrTestCaseJ4.TEST_HOME() + "/collection1/conf/enumsConfig.xml"), new File(workDir, "collection1/conf/enumsConfig.xml"));
-    FileUtils.copyFile(new File(SolrTestCaseJ4.TEST_HOME() + "/collection1/conf/currency.xml"), new File(workDir, "collection1/conf/currency.xml"));
-    FileUtils.copyFile(new File(SolrTestCaseJ4.TEST_HOME() + "/collection1/conf/open-exchange-rates.json"), new File(workDir, "collection1/conf/open-exchange-rates.json"));
-    FileUtils.copyFile(new File(SolrTestCaseJ4.TEST_HOME() + "/collection1/conf/old_synonyms.txt"), new File(workDir, "collection1/conf/old_synonyms.txt"));
-    FileUtils.copyFile(new File(SolrTestCaseJ4.TEST_HOME() + "/collection1/conf/mapping-ISOLatin1Accent.txt"), new File(workDir, "configsets/collection1/conf/mapping-ISOLatin1Accent.txt"));
-    FileUtils.copyFile(new File(SolrTestCaseJ4.TEST_HOME() + "/collection1/conf/protwords.txt"), new File(workDir, "collection1/conf/protwords.txt"));
-    FileUtils.copyFile(new File(SolrTestCaseJ4.TEST_HOME() + "/collection1/conf/synonyms.txt"), new File(workDir, "collection1/conf/synonyms.txt"));
-    FileUtils.copyFile(new File(SolrTestCaseJ4.TEST_HOME() + "/collection1/conf/stopwords.txt"), new File(workDir, "collection1/conf/stopwords.txt"));
-    FileUtils.copyFile(new File(SolrTestCaseJ4.TEST_HOME() + "/collection1/conf/old_synonyms.txt"), new File(workDir, "collection1/conf/old_synonyms.txt"));
+    FileUtils.copyFile(new File(SolrTestUtil.TEST_HOME() + "/collection1/conf/solrconfig-tolerant-search.xml"), new File(workDir, "collection1/conf/solrconfig.xml"));
+    FileUtils.copyFile(new File(SolrTestUtil.TEST_HOME() + "/collection1/conf/solrconfig.snippet.randomindexconfig.xml"), new File(workDir, "configsets/collection1/conf/solrconfig.snippet.randomindexconfig.xml"));
+    FileUtils.copyFile(new File(SolrTestUtil.TEST_HOME() + "/collection1/conf/schema.xml"), new File(workDir, "collection1/conf/schema.xml"));
+    FileUtils.copyFile(new File(SolrTestUtil.TEST_HOME() + "/collection1/conf/enumsConfig.xml"), new File(workDir, "collection1/conf/enumsConfig.xml"));
+    FileUtils.copyFile(new File(SolrTestUtil.TEST_HOME() + "/collection1/conf/currency.xml"), new File(workDir, "collection1/conf/currency.xml"));
+    FileUtils.copyFile(new File(SolrTestUtil.TEST_HOME() + "/collection1/conf/open-exchange-rates.json"), new File(workDir, "collection1/conf/open-exchange-rates.json"));
+    FileUtils.copyFile(new File(SolrTestUtil.TEST_HOME() + "/collection1/conf/old_synonyms.txt"), new File(workDir, "collection1/conf/old_synonyms.txt"));
+    FileUtils.copyFile(new File(SolrTestUtil.TEST_HOME() + "/collection1/conf/mapping-ISOLatin1Accent.txt"), new File(workDir, "configsets/collection1/conf/mapping-ISOLatin1Accent.txt"));
+    FileUtils.copyFile(new File(SolrTestUtil.TEST_HOME() + "/collection1/conf/protwords.txt"), new File(workDir, "collection1/conf/protwords.txt"));
+    FileUtils.copyFile(new File(SolrTestUtil.TEST_HOME() + "/collection1/conf/synonyms.txt"), new File(workDir, "collection1/conf/synonyms.txt"));
+    FileUtils.copyFile(new File(SolrTestUtil.TEST_HOME() + "/collection1/conf/stopwords.txt"), new File(workDir, "collection1/conf/stopwords.txt"));
+    FileUtils.copyFile(new File(SolrTestUtil.TEST_HOME() + "/collection1/conf/old_synonyms.txt"), new File(workDir, "collection1/conf/old_synonyms.txt"));
 
     FileUtils.copyDirectory(new File(workDir, "collection1"), new File(workDir, "collection2"));
     return workDir;
@@ -150,7 +150,7 @@ public class TestTolerantSearch extends SolrJettyTestBase {
     
     //ignoreException("Dummy exception in BadResponseWriter");
 
-    expectThrows(SolrException.class, () -> collection1.query(query));
+    SolrTestCaseUtil.expectThrows(SolrException.class, () -> collection1.query(query));
 
     query.set(ShardParams.SHARDS_TOLERANT, "true");
     QueryResponse response = collection1.query(query);
@@ -195,7 +195,7 @@ public class TestTolerantSearch extends SolrJettyTestBase {
     
     ignoreException("Dummy exception in BadResponseWriter");
 
-    expectThrows(Exception.class, () -> collection1.query(query));
+    SolrTestCaseUtil.expectThrows(Exception.class, () -> collection1.query(query));
 
     query.set(ShardParams.SHARDS_TOLERANT, "true");
     QueryResponse response = collection1.query(query);
diff --git a/solr/core/src/test/org/apache/solr/TestTrie.java b/solr/core/src/test/org/apache/solr/TestTrie.java
index 55d405e..61f5857 100644
--- a/solr/core/src/test/org/apache/solr/TestTrie.java
+++ b/solr/core/src/test/org/apache/solr/TestTrie.java
@@ -20,6 +20,7 @@ import java.text.SimpleDateFormat;
 import java.util.Locale;
 import java.util.TimeZone;
 
+import org.apache.lucene.util.LuceneTestCase;
 import org.apache.solr.core.SolrCore;
 import org.apache.solr.request.SolrQueryRequest;
 import org.apache.solr.schema.FieldType;
@@ -216,7 +217,7 @@ public class TestTrie extends SolrTestCaseJ4 {
   @Test
   public void testTrieFacet_PrecisionStep() throws Exception {
     if (Boolean.getBoolean(NUMERIC_POINTS_SYSPROP)) {
-      assumeTrue("Skipping test: Points+facets require docValues, but randomizer: points=true && DV=false",
+      LuceneTestCase.assumeTrue("Skipping test: Points+facets require docValues, but randomizer: points=true && DV=false",
                  Boolean.getBoolean(NUMERIC_DOCVALUES_SYSPROP));
     }
     
diff --git a/solr/core/src/test/org/apache/solr/analysis/ProtectedTermFilterFactoryTest.java b/solr/core/src/test/org/apache/solr/analysis/ProtectedTermFilterFactoryTest.java
index c663b3c..3d7c23b 100644
--- a/solr/core/src/test/org/apache/solr/analysis/ProtectedTermFilterFactoryTest.java
+++ b/solr/core/src/test/org/apache/solr/analysis/ProtectedTermFilterFactoryTest.java
@@ -24,6 +24,7 @@ import org.apache.lucene.analysis.BaseTokenStreamTestCase;
 import org.apache.lucene.analysis.TokenStream;
 import org.apache.lucene.analysis.miscellaneous.ProtectedTermFilterFactory;
 import org.apache.solr.SolrTestCaseJ4;
+import org.apache.solr.SolrTestUtil;
 import org.apache.solr.core.SolrResourceLoader;
 import org.junit.BeforeClass;
 
@@ -41,7 +42,7 @@ public class ProtectedTermFilterFactoryTest extends SolrTestCaseJ4 {
     args.put("protected", "protected-1.txt,protected-2.txt");  // Protected: foobar, jaxfopbuz, golden, compote
     args.put("wrappedFilters", "lowercase");
 
-    try (SolrResourceLoader loader = new SolrResourceLoader(TEST_PATH().resolve("collection1"))) {
+    try (SolrResourceLoader loader = new SolrResourceLoader(SolrTestUtil.TEST_PATH().resolve("collection1"))) {
       ProtectedTermFilterFactory factory = new ProtectedTermFilterFactory(args);
       factory.inform(loader);
 
diff --git a/solr/core/src/test/org/apache/solr/analysis/TestWordDelimiterFilterFactory.java b/solr/core/src/test/org/apache/solr/analysis/TestWordDelimiterFilterFactory.java
index a642647..067cf29 100644
--- a/solr/core/src/test/org/apache/solr/analysis/TestWordDelimiterFilterFactory.java
+++ b/solr/core/src/test/org/apache/solr/analysis/TestWordDelimiterFilterFactory.java
@@ -22,9 +22,9 @@ import java.util.Map;
 import org.apache.lucene.analysis.BaseTokenStreamTestCase;
 import org.apache.lucene.analysis.TokenStream;
 import org.apache.lucene.analysis.miscellaneous.WordDelimiterFilterFactory;
-import org.apache.lucene.analysis.util.ResourceLoader;
 import org.apache.lucene.util.Version;
 import org.apache.solr.SolrTestCaseJ4;
+import org.apache.solr.SolrTestUtil;
 import org.apache.solr.core.SolrResourceLoader;
 import org.junit.BeforeClass;
 import org.junit.Test;
@@ -196,7 +196,7 @@ public class TestWordDelimiterFilterFactory extends SolrTestCaseJ4 {
   @Test
   public void testCustomTypes() throws Exception {
     String testText = "I borrowed $5,400.00 at 25% interest-rate";
-    try (SolrResourceLoader loader = new SolrResourceLoader(TEST_PATH().resolve("collection1"))) {
+    try (SolrResourceLoader loader = new SolrResourceLoader(SolrTestUtil.TEST_PATH().resolve("collection1"))) {
       Map<String,String> args = new HashMap<>();
       args.put("luceneMatchVersion", Version.LATEST.toString());
       args.put("generateWordParts", "1");
diff --git a/solr/core/src/test/org/apache/solr/backcompat/TestLuceneIndexBackCompat.java b/solr/core/src/test/org/apache/solr/backcompat/TestLuceneIndexBackCompat.java
index 6a953a9..d17f49e 100644
--- a/solr/core/src/test/org/apache/solr/backcompat/TestLuceneIndexBackCompat.java
+++ b/solr/core/src/test/org/apache/solr/backcompat/TestLuceneIndexBackCompat.java
@@ -33,6 +33,7 @@ import org.apache.lucene.index.TestBackwardsCompatibility;
 import org.apache.lucene.util.LuceneTestCase;
 import org.apache.lucene.util.TestUtil;
 import org.apache.solr.SolrTestCaseJ4;
+import org.apache.solr.SolrTestUtil;
 import org.apache.solr.common.params.CommonParams;
 import org.apache.solr.util.TestHarness;
 import org.junit.BeforeClass;
@@ -70,7 +71,7 @@ public class TestLuceneIndexBackCompat extends SolrTestCaseJ4 {
     if (h != null) {
       h.close();
     }
-    Path solrHome = createTempDir(coreName).toAbsolutePath();
+    Path solrHome = SolrTestUtil.createTempDir(coreName).toAbsolutePath();
     Files.createDirectories(solrHome);
     Path coreDir = solrHome.resolve(coreName);
     Path confDir = coreDir.resolve("conf");
@@ -79,8 +80,8 @@ public class TestLuceneIndexBackCompat extends SolrTestCaseJ4 {
     Path indexDir = dataDir.resolve("index");
     Files.createDirectories(indexDir);
 
-    Files.copy(getFile("solr/solr.xml").toPath(), solrHome.resolve("solr.xml"));
-    FileUtils.copyDirectory(configset("backcompat").toFile(), confDir.toFile());
+    Files.copy(SolrTestUtil.getFile("solr/solr.xml").toPath(), solrHome.resolve("solr.xml"));
+    FileUtils.copyDirectory(SolrTestUtil.configset("backcompat").toFile(), confDir.toFile());
 
     try (Writer writer = new OutputStreamWriter(Files.newOutputStream(coreDir.resolve("core.properties")), StandardCharsets.UTF_8)) {
       Properties coreProps = new Properties();
diff --git a/solr/core/src/test/org/apache/solr/client/solrj/embedded/TestEmbeddedSolrServerAdminHandler.java b/solr/core/src/test/org/apache/solr/client/solrj/embedded/TestEmbeddedSolrServerAdminHandler.java
index 8549f74..f150855 100644
--- a/solr/core/src/test/org/apache/solr/client/solrj/embedded/TestEmbeddedSolrServerAdminHandler.java
+++ b/solr/core/src/test/org/apache/solr/client/solrj/embedded/TestEmbeddedSolrServerAdminHandler.java
@@ -20,6 +20,7 @@ import java.io.IOException;
 
 import org.apache.lucene.util.LuceneTestCase;
 import org.apache.solr.SolrTestCaseJ4;
+import org.apache.solr.SolrTestUtil;
 import org.apache.solr.client.solrj.SolrClient;
 import org.apache.solr.client.solrj.SolrRequest;
 import org.apache.solr.client.solrj.SolrServerException;
@@ -36,8 +37,8 @@ public class TestEmbeddedSolrServerAdminHandler extends SolrTestCaseJ4 {
     @Test
     public void testPathIsAddedToContext() throws IOException, SolrServerException {
 
-        final NodeConfig config = new NodeConfig.NodeConfigBuilder("testnode", TEST_PATH())
-                .setConfigSetBaseDirectory(TEST_PATH().resolve("configsets").toString())
+        final NodeConfig config = new NodeConfig.NodeConfigBuilder("testnode", SolrTestUtil.TEST_PATH())
+                .setConfigSetBaseDirectory(SolrTestUtil.TEST_PATH().resolve("configsets").toString())
                 .build();
 
         try (final EmbeddedSolrServer server = new EmbeddedSolrServer(config, "collection1")) {
diff --git a/solr/core/src/test/org/apache/solr/client/solrj/embedded/TestEmbeddedSolrServerConstructors.java b/solr/core/src/test/org/apache/solr/client/solrj/embedded/TestEmbeddedSolrServerConstructors.java
index 64cf753..f4a1acd 100644
--- a/solr/core/src/test/org/apache/solr/client/solrj/embedded/TestEmbeddedSolrServerConstructors.java
+++ b/solr/core/src/test/org/apache/solr/client/solrj/embedded/TestEmbeddedSolrServerConstructors.java
@@ -20,7 +20,9 @@ import java.io.IOException;
 import java.nio.file.Path;
 import java.nio.file.Paths;
 
+import org.apache.lucene.util.LuceneTestCase;
 import org.apache.solr.SolrTestCaseJ4;
+import org.apache.solr.SolrTestUtil;
 import org.apache.solr.client.solrj.SolrQuery;
 import org.apache.solr.client.solrj.request.CoreAdminRequest;
 import org.apache.solr.common.SolrInputDocument;
@@ -30,21 +32,21 @@ import org.junit.Test;
 public class TestEmbeddedSolrServerConstructors extends SolrTestCaseJ4 {
 
   @Test
-  @Nightly
+  @LuceneTestCase.Nightly
   public void testPathConstructor() throws IOException {
-    Path path = Paths.get(TEST_HOME());
+    Path path = Paths.get(SolrTestUtil.TEST_HOME());
     try (EmbeddedSolrServer server = new EmbeddedSolrServer(path, "collection1")) {
 
     }
   }
 
   @Test
-  @Nightly
+  @LuceneTestCase.Nightly
   public void testNodeConfigConstructor() throws Exception {
-    Path path = createTempDir();
+    Path path = SolrTestUtil.createTempDir();
 
     NodeConfig config = new NodeConfig.NodeConfigBuilder("testnode", path)
-        .setConfigSetBaseDirectory(Paths.get(TEST_HOME()).resolve("configsets").toString())
+        .setConfigSetBaseDirectory(Paths.get(SolrTestUtil.TEST_HOME()).resolve("configsets").toString())
         .build();
 
     try (EmbeddedSolrServer server = new EmbeddedSolrServer(config, "newcore")) {
diff --git a/solr/core/src/test/org/apache/solr/client/solrj/embedded/TestEmbeddedSolrServerSchemaAPI.java b/solr/core/src/test/org/apache/solr/client/solrj/embedded/TestEmbeddedSolrServerSchemaAPI.java
index 88b7177..bd2cbbf 100644
--- a/solr/core/src/test/org/apache/solr/client/solrj/embedded/TestEmbeddedSolrServerSchemaAPI.java
+++ b/solr/core/src/test/org/apache/solr/client/solrj/embedded/TestEmbeddedSolrServerSchemaAPI.java
@@ -22,7 +22,9 @@ import java.util.Collections;
 import java.util.LinkedHashMap;
 import java.util.Map;
 
+import org.apache.lucene.util.LuceneTestCase;
 import org.apache.solr.SolrTestCaseJ4;
+import org.apache.solr.SolrTestUtil;
 import org.apache.solr.api.ApiBag;
 import org.apache.solr.client.solrj.request.schema.SchemaRequest;
 import org.apache.solr.client.solrj.response.schema.SchemaResponse;
@@ -53,7 +55,7 @@ public class TestEmbeddedSolrServerSchemaAPI extends SolrTestCaseJ4 {
     System.setProperty("managed.schema.mutable", ""+
       random().nextBoolean()
     );
-    Path tmpHome = createTempDir("tmp-home");
+    Path tmpHome = SolrTestUtil.createTempDir("tmp-home");
     Path coreDir = tmpHome.resolve(DEFAULT_TEST_CORENAME);
     copyMinConf(coreDir.toFile(), null, "solrconfig-managed-schema.xml");
     initCore("solrconfig.xml" /*it's renamed to to*/, "schema.xml", tmpHome.toAbsolutePath().toString());
@@ -71,13 +73,13 @@ public class TestEmbeddedSolrServerSchemaAPI extends SolrTestCaseJ4 {
 
   @Before
   public void thereIsNoFieldYet() {
-    SolrException ex = expectThrows(SolrException.class, () -> new SchemaRequest.Field(fieldName).process(server));
+    SolrException ex = LuceneTestCase.expectThrows(SolrException.class, () -> new SchemaRequest.Field(fieldName).process(server));
     assertTrue(ex.getMessage().contains("No") && ex.getMessage().contains("VerificationTest"));
   }
   
   @Test
   public void testSchemaAddFieldAndVerifyExistence() throws Exception {
-    assumeTrue("it needs to ammend schema", Boolean.getBoolean("managed.schema.mutable"));
+    LuceneTestCase.assumeTrue("it needs to ammend schema", Boolean.getBoolean("managed.schema.mutable"));
     SchemaResponse.UpdateResponse addFieldResponse = new SchemaRequest.AddField(fieldAttributes).process(server);
 
     assertEquals(addFieldResponse.toString(), 0, addFieldResponse.getStatus());
@@ -93,15 +95,15 @@ public class TestEmbeddedSolrServerSchemaAPI extends SolrTestCaseJ4 {
 
   @Test 
   public void  testSchemaAddFieldAndFailOnImmutable() {
-    assumeFalse("it needs a readonly schema", Boolean.getBoolean("managed.schema.mutable"));
+    LuceneTestCase.assumeFalse("it needs a readonly schema", Boolean.getBoolean("managed.schema.mutable"));
 
     SchemaRequest.AddField addFieldUpdateSchemaRequest = new SchemaRequest.AddField(fieldAttributes);
     assertFailedSchemaResponse(() -> addFieldUpdateSchemaRequest.process(server),
         "schema is not editable");
   }
 
-  private static void assertFailedSchemaResponse(ThrowingRunnable runnable, String expectedErrorMessage) {
-    ApiBag.ExceptionWithErrObject e = expectThrows(ApiBag.ExceptionWithErrObject.class, runnable);
+  private static void assertFailedSchemaResponse(LuceneTestCase.ThrowingRunnable runnable, String expectedErrorMessage) {
+    ApiBag.ExceptionWithErrObject e = LuceneTestCase.expectThrows(ApiBag.ExceptionWithErrObject.class, runnable);
     String msg = e.getErrs().get(0).get("errorMessages").toString();
     assertTrue(msg.contains(expectedErrorMessage));
   }
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 280a9c6..92ea4e7 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
@@ -18,6 +18,7 @@ package org.apache.solr.client.solrj.embedded;
 
 import org.apache.lucene.util.LuceneTestCase;
 import org.apache.solr.SolrTestCaseJ4;
+import org.apache.solr.SolrTestUtil;
 import org.apache.solr.client.solrj.SolrClient;
 import org.apache.solr.client.solrj.request.CoreAdminRequest;
 import org.apache.solr.cloud.MiniSolrCloudCluster;
@@ -41,10 +42,10 @@ public class TestJettySolrRunner extends SolrTestCaseJ4 {
     // We set a non-standard coreRootDirectory, create a core, and check that it has been
     // built in the correct place
 
-    Path solrHome = createTempDir();
-    Path coresDir = createTempDir("crazy_path_to_cores");
+    Path solrHome = SolrTestUtil.createTempDir();
+    Path coresDir = SolrTestUtil.createTempDir("crazy_path_to_cores");
 
-    Path configsets = Paths.get(TEST_HOME()).resolve("configsets");
+    Path configsets = Paths.get(SolrTestUtil.TEST_HOME()).resolve("configsets");
 
     String solrxml
         = "<solr><str name=\"configSetBaseDir\">CONFIGSETS</str><str name=\"coreRootDirectory\">COREROOT</str></solr>"
@@ -77,7 +78,7 @@ public class TestJettySolrRunner extends SolrTestCaseJ4 {
   @SuppressWarnings("ThrowableNotThrown")
   @Test
   public void testLookForBindException() throws IOException {
-    Path solrHome = createTempDir();
+    Path solrHome = SolrTestUtil.createTempDir();
     Files.write(solrHome.resolve("solr.xml"), MiniSolrCloudCluster.DEFAULT_CLOUD_SOLR_XML.getBytes(Charset.defaultCharset()));
 
     JettyConfig config = JettyConfig.builder().build();
diff --git a/solr/core/src/test/org/apache/solr/cloud/AddReplicaTest.java b/solr/core/src/test/org/apache/solr/cloud/AddReplicaTest.java
index b5c2161..4c259dc 100644
--- a/solr/core/src/test/org/apache/solr/cloud/AddReplicaTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/AddReplicaTest.java
@@ -24,6 +24,7 @@ import java.util.EnumSet;
 import java.util.LinkedHashSet;
 import java.util.concurrent.atomic.AtomicInteger;
 
+import org.apache.solr.SolrTestUtil;
 import org.apache.solr.client.solrj.impl.CloudHttp2SolrClient;
 import org.apache.solr.client.solrj.request.CollectionAdminRequest;
 import org.apache.solr.client.solrj.response.CollectionAdminResponse;
@@ -34,7 +35,6 @@ import org.apache.solr.common.cloud.Replica;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.BeforeClass;
-import org.junit.Ignore;
 import org.junit.Test;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -51,7 +51,7 @@ public class AddReplicaTest extends SolrCloudTestCase {
   @BeforeClass
   public static void setupCluster() throws Exception {
     configureCluster(3)
-        .addConfig("conf1", TEST_PATH().resolve("configsets").resolve("cloud-minimal").resolve("conf"))
+        .addConfig("conf1", SolrTestUtil.TEST_PATH().resolve("configsets").resolve("cloud-minimal").resolve("conf"))
         .configure();
   }
 
diff --git a/solr/core/src/test/org/apache/solr/cloud/AliasIntegrationTest.java b/solr/core/src/test/org/apache/solr/cloud/AliasIntegrationTest.java
index cdf3e10..80d3d3d 100644
--- a/solr/core/src/test/org/apache/solr/cloud/AliasIntegrationTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/AliasIntegrationTest.java
@@ -32,6 +32,8 @@ import org.apache.http.entity.StringEntity;
 import org.apache.http.util.EntityUtils;
 import org.apache.lucene.util.LuceneTestCase;
 import org.apache.solr.SolrTestCaseJ4;
+import org.apache.solr.SolrTestCaseUtil;
+import org.apache.solr.SolrTestUtil;
 import org.apache.solr.client.solrj.SolrQuery;
 import org.apache.solr.client.solrj.SolrRequest;
 import org.apache.solr.client.solrj.SolrServerException;
@@ -72,7 +74,7 @@ public class AliasIntegrationTest extends SolrCloudTestCase {
   @BeforeClass
   public static void setupCluster() throws Exception {
     configureCluster(2)
-        .addConfig("conf", configset("cloud-minimal"))
+        .addConfig("conf", SolrTestUtil.configset("cloud-minimal"))
         .configure();
   }
 
@@ -207,7 +209,7 @@ public class AliasIntegrationTest extends SolrCloudTestCase {
 
   @Test
   public void testModifyPropertiesV2() throws Exception {
-    final String aliasName = getSaferTestName();
+    final String aliasName = SolrTestUtil.getTestName();
     ZkStateReader zkStateReader = createColectionsAndAlias(aliasName);
     final String baseUrl = cluster.getRandomJetty(random()).getBaseUrl().toString();
     //TODO fix Solr test infra so that this /____v2/ becomes /api/
@@ -229,7 +231,7 @@ public class AliasIntegrationTest extends SolrCloudTestCase {
   @Test
   public void testModifyPropertiesV1() throws Exception {
     // note we don't use TZ in this test, thus it's UTC
-    final String aliasName = getSaferTestName();
+    final String aliasName = SolrTestUtil.getTestName();
     ZkStateReader zkStateReader = createColectionsAndAlias(aliasName);
     final String baseUrl = cluster.getRandomJetty(random()).getBaseUrl().toString();
     HttpGet get = new HttpGet(baseUrl + "/admin/collections?action=ALIASPROP" +
@@ -244,7 +246,7 @@ public class AliasIntegrationTest extends SolrCloudTestCase {
   @Test
   public void testModifyPropertiesCAR() throws Exception {
     // note we don't use TZ in this test, thus it's UTC
-    final String aliasName = getSaferTestName();
+    final String aliasName = SolrTestUtil.getTestName();
     ZkStateReader zkStateReader = createColectionsAndAlias(aliasName);
     CollectionAdminRequest.SetAliasProperty setAliasProperty = CollectionAdminRequest.setAliasProperty(aliasName);
     setAliasProperty.addProperty("foo","baz");
@@ -270,7 +272,7 @@ public class AliasIntegrationTest extends SolrCloudTestCase {
 
   @Test
   public void testClusterStateProviderAPI() throws Exception {
-    final String aliasName = getSaferTestName();
+    final String aliasName = SolrTestUtil.getTestName();
     
     // pick an arbitrary node, and use it's cloudManager to assert that (an instance of)
     // the ClusterStateProvider API reflects alias changes made by remote clients
@@ -327,10 +329,10 @@ public class AliasIntegrationTest extends SolrCloudTestCase {
     stateProvider = cloudManager.getClusterStateProvider();
     assertTrue("should be a routed alias", stateProvider.isRoutedAlias(aliasName));
 
-    expectThrows(SolrException.class, () -> {
+    SolrTestCaseUtil.expectThrows(SolrException.class, () -> {
       String resolved = cloudManager.getClusterStateProvider().resolveSimpleAlias(aliasName);
       fail("this is not a simple alias but it resolved to " + resolved);
-      });
+    });
   }
 
   /** 
@@ -702,7 +704,7 @@ public class AliasIntegrationTest extends SolrCloudTestCase {
       lastVersion = waitForAliasesUpdate(lastVersion, zkStateReader);
     }
 
-    SolrException e = expectThrows(SolrException.class, () -> {
+    SolrException e = SolrTestCaseUtil.expectThrows(SolrException.class, () -> {
       SolrQuery q = new SolrQuery("*:*");
       q.set("collection", "testalias1");
       cluster.getSolrClient().query(q);
@@ -764,19 +766,16 @@ public class AliasIntegrationTest extends SolrCloudTestCase {
     SolrTestCaseJ4.ignoreException(".");
 
     // Invalid Alias name
-    SolrException e = expectThrows(SolrException.class, () ->
-        CollectionAdminRequest.createAlias("test:alias", "testErrorChecks-collection").process(cluster.getSolrClient()));
+    SolrException e = SolrTestCaseUtil.expectThrows(SolrException.class, () -> CollectionAdminRequest.createAlias("test:alias", "testErrorChecks-collection").process(cluster.getSolrClient()));
     assertEquals(SolrException.ErrorCode.BAD_REQUEST, SolrException.ErrorCode.getErrorCode(e.code()));
 
     // Target collection doesn't exists
-    e = expectThrows(SolrException.class, () ->
-        CollectionAdminRequest.createAlias("testalias", "doesnotexist").process(cluster.getSolrClient()));
+    e = SolrTestCaseUtil.expectThrows(SolrException.class, () -> CollectionAdminRequest.createAlias("testalias", "doesnotexist").process(cluster.getSolrClient()));
     assertEquals(SolrException.ErrorCode.BAD_REQUEST, SolrException.ErrorCode.getErrorCode(e.code()));
     assertTrue(e.getMessage().contains("Can't create collection alias for collections='doesnotexist', 'doesnotexist' is not an existing collection or alias"));
 
     // One of the target collections doesn't exist
-    e = expectThrows(SolrException.class, () ->
-        CollectionAdminRequest.createAlias("testalias", "testErrorChecks-collection,doesnotexist").process(cluster.getSolrClient()));
+    e = SolrTestCaseUtil.expectThrows(SolrException.class, () -> CollectionAdminRequest.createAlias("testalias", "testErrorChecks-collection,doesnotexist").process(cluster.getSolrClient()));
     assertEquals(SolrException.ErrorCode.BAD_REQUEST, SolrException.ErrorCode.getErrorCode(e.code()));
     assertTrue(e.getMessage().contains("Can't create collection alias for collections='testErrorChecks-collection,doesnotexist', 'doesnotexist' is not an existing collection or alias"));
 
@@ -786,8 +785,7 @@ public class AliasIntegrationTest extends SolrCloudTestCase {
     CollectionAdminRequest.createAlias("testalias2", "testalias").process(cluster.getSolrClient());
 
     // Alias + invalid
-    e = expectThrows(SolrException.class, () ->
-        CollectionAdminRequest.createAlias("testalias3", "testalias2,doesnotexist").process(cluster.getSolrClient()));
+    e = SolrTestCaseUtil.expectThrows(SolrException.class, () -> CollectionAdminRequest.createAlias("testalias3", "testalias2,doesnotexist").process(cluster.getSolrClient()));
     assertEquals(SolrException.ErrorCode.BAD_REQUEST, SolrException.ErrorCode.getErrorCode(e.code()));
     SolrTestCaseJ4.unIgnoreException(".");
 
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 31ba78d..e18453d 100644
--- a/solr/core/src/test/org/apache/solr/cloud/AssignBackwardCompatibilityTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/AssignBackwardCompatibilityTest.java
@@ -23,6 +23,7 @@ import java.util.HashSet;
 import java.util.Set;
 
 import org.apache.lucene.util.LuceneTestCase;
+import org.apache.solr.SolrTestUtil;
 import org.apache.solr.client.solrj.SolrServerException;
 import org.apache.solr.client.solrj.request.CollectionAdminRequest;
 import org.apache.solr.client.solrj.response.CollectionAdminResponse;
@@ -50,7 +51,7 @@ public class AssignBackwardCompatibilityTest extends SolrCloudTestCase {
   @BeforeClass
   public static void setupCluster() throws Exception {
     configureCluster(4)
-        .addConfig("conf1", TEST_PATH().resolve("configsets").resolve("cloud-dynamic").resolve("conf"))
+        .addConfig("conf1", SolrTestUtil.TEST_PATH().resolve("configsets").resolve("cloud-dynamic").resolve("conf"))
         .configure();
     CollectionAdminRequest.createCollection(COLLECTION, 1, 4)
         .setMaxShardsPerNode(1000)
diff --git a/solr/core/src/test/org/apache/solr/cloud/BasicDistributedZk2Test.java b/solr/core/src/test/org/apache/solr/cloud/BasicDistributedZk2Test.java
index b39ca3a..b2fecb5 100644
--- a/solr/core/src/test/org/apache/solr/cloud/BasicDistributedZk2Test.java
+++ b/solr/core/src/test/org/apache/solr/cloud/BasicDistributedZk2Test.java
@@ -19,6 +19,8 @@ package org.apache.solr.cloud;
 import org.apache.lucene.mockfile.FilterPath;
 import org.apache.lucene.util.LuceneTestCase;
 import org.apache.solr.SolrTestCase;
+import org.apache.solr.SolrTestCaseUtil;
+import org.apache.solr.SolrTestUtil;
 import org.apache.solr.client.solrj.SolrClient;
 import org.apache.solr.client.solrj.SolrQuery;
 import org.apache.solr.client.solrj.SolrServerException;
@@ -107,7 +109,7 @@ public class BasicDistributedZk2Test extends AbstractFullDistribZkTestBase {
       long docId = testUpdateAndDelete();
       
       // index a bad doc...
-      expectThrows(SolrException.class, () -> indexr(t1, "a doc with no id"));
+      SolrTestCaseUtil.expectThrows(SolrException.class, () -> indexr(t1, "a doc with no id"));
       
       // TODO: bring this to its own method?
       // try indexing to a leader that has no replicas up
@@ -255,10 +257,8 @@ public class BasicDistributedZk2Test extends AbstractFullDistribZkTestBase {
     CloudJettyRunner deadShard = chaosMonkey.stopShard(SHARD1, 0);
 
     // ensure shard is dead
-    expectThrows(SolrServerException.class,
-        "This server should be down and this update should have failed",
-        () -> index_specific(deadShard.client.solrClient, id, 999, i1, 107, t1, "specific doc!")
-    );
+    SolrTestCaseUtil.expectThrows(SolrServerException.class, "This server should be down and this update should have failed",
+        () -> index_specific(deadShard.client.solrClient, id, 999, i1, 107, t1, "specific doc!"));
     
     commit();
     
@@ -382,7 +382,7 @@ public class BasicDistributedZk2Test extends AbstractFullDistribZkTestBase {
       params.set("qt", ReplicationHandler.PATH);
       params.set("command", "backup");
       params.set("name", backupName);
-      Path location = createTempDir();
+      Path location = SolrTestUtil.createTempDir();
       location = FilterPath.unwrap(location).toRealPath();
       params.set("location", location.toString());
 
diff --git a/solr/core/src/test/org/apache/solr/cloud/BasicDistributedZkTest.java b/solr/core/src/test/org/apache/solr/cloud/BasicDistributedZkTest.java
index 17cb183..968e29e 100644
--- a/solr/core/src/test/org/apache/solr/cloud/BasicDistributedZkTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/BasicDistributedZkTest.java
@@ -21,6 +21,8 @@ import org.apache.lucene.util.LuceneTestCase;
 import org.apache.lucene.util.LuceneTestCase.Slow;
 import org.apache.solr.JSONTestUtil;
 import org.apache.solr.SolrTestCase;
+import org.apache.solr.SolrTestCaseUtil;
+import org.apache.solr.SolrTestUtil;
 import org.apache.solr.client.solrj.SolrClient;
 import org.apache.solr.client.solrj.SolrQuery;
 import org.apache.solr.client.solrj.SolrRequest;
@@ -533,8 +535,8 @@ public class BasicDistributedZkTest extends AbstractFullDistribZkTestBase {
   }
 
   private void testTokenizedGrouping() throws Exception {
-    SolrException ex = expectThrows(SolrException.class, () -> {
-      query(false, new String[]{"q", "*:*", "group", "true", "group.field", t1});
+    SolrException ex = SolrTestCaseUtil.expectThrows(SolrException.class, () -> {
+      query(false, new String[] {"q", "*:*", "group", "true", "group.field", t1});
     });
     assertTrue("Expected error from server that SortableTextFields are required", ex.getMessage().contains("Sorting on a tokenized field that is not a SortableTextField is not supported in cloud mode"));
   }
@@ -830,7 +832,7 @@ public class BasicDistributedZkTest extends AbstractFullDistribZkTestBase {
     final ModifiableSolrParams updateParams = new ModifiableSolrParams();
     updateParams.add(UpdateParams.UPDATE_CHAIN, chain);
     
-    final int numLoops = atLeast(50);
+    final int numLoops = SolrTestUtil.atLeast(50);
     
     for (int i = 1; i < numLoops; i++) {
       // add doc to random client
@@ -872,7 +874,7 @@ public class BasicDistributedZkTest extends AbstractFullDistribZkTestBase {
 
     ignoreException("version conflict");
     for (SolrClient client : clients) {
-      SolrException e = expectThrows(SolrException.class, () -> client.add(sd));
+      SolrException e = SolrTestCaseUtil.expectThrows(SolrException.class, () -> client.add(sd));
       assertEquals(409, e.code());
     }
     unIgnoreException("version conflict");
@@ -906,8 +908,7 @@ public class BasicDistributedZkTest extends AbstractFullDistribZkTestBase {
 
 
     NamedList<Object> result = clients.get(0).request(
-        new StreamingUpdateRequest("/update",
-            getFile("books_numeric_ids.csv"), "application/csv")
+        new StreamingUpdateRequest("/update", SolrTestUtil.getFile("books_numeric_ids.csv"), "application/csv")
             .setCommitWithin(900000)
             .setAction(AbstractUpdateRequest.ACTION.COMMIT, true, true));
     
@@ -1159,7 +1160,7 @@ public class BasicDistributedZkTest extends AbstractFullDistribZkTestBase {
         if (shardId == null) {
           createCmd.setNumShards(2);
         }
-        createCmd.setDataDir(getDataDir(createTempDir(collection).toFile().getAbsolutePath()));
+        createCmd.setDataDir(getDataDir(SolrTestUtil.createTempDir(collection).toFile().getAbsolutePath()));
         if (shardId != null) {
           createCmd.setShardId(shardId);
         }
diff --git a/solr/core/src/test/org/apache/solr/cloud/ChaosMonkeyNothingIsSafeWithPullReplicasTest.java b/solr/core/src/test/org/apache/solr/cloud/ChaosMonkeyNothingIsSafeWithPullReplicasTest.java
index fa45c05..e05c5ae 100644
--- a/solr/core/src/test/org/apache/solr/cloud/ChaosMonkeyNothingIsSafeWithPullReplicasTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/ChaosMonkeyNothingIsSafeWithPullReplicasTest.java
@@ -65,7 +65,7 @@ public class ChaosMonkeyNothingIsSafeWithPullReplicasTest extends AbstractFullDi
   @BeforeClass
   public static void beforeSuperClass() {
     schemaString = "schema15.xml";      // we need a string id
-    if (usually()) {
+    if (LuceneTestCase.usually()) {
       System.setProperty("solr.autoCommit.maxTime", "15000");
     }
     System.clearProperty("solr.httpclient.retries");
@@ -189,7 +189,7 @@ public class ChaosMonkeyNothingIsSafeWithPullReplicasTest extends AbstractFullDi
         searchThread.start();
       }
       
-      if (usually()) {
+      if (LuceneTestCase.usually()) {
         StoppableCommitThread commitThread = new StoppableCommitThread(cloudClient, 1000, false);
         threads.add(commitThread);
         commitThread.start();
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 4936fdc..fcfbe77 100644
--- a/solr/core/src/test/org/apache/solr/cloud/ChaosMonkeyShardSplitTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/ChaosMonkeyShardSplitTest.java
@@ -18,6 +18,7 @@ package org.apache.solr.cloud;
 
 import org.apache.lucene.util.LuceneTestCase;
 import org.apache.lucene.util.LuceneTestCase.Slow;
+import org.apache.solr.SolrTestUtil;
 import org.apache.solr.client.solrj.SolrClient;
 import org.apache.solr.cloud.AbstractFullDistribZkTestBase.CloudJettyRunner;
 import org.apache.solr.cloud.api.collections.ShardSplitTest;
@@ -88,11 +89,11 @@ public class ChaosMonkeyShardSplitTest extends ShardSplitTest {
       indexThread = new Thread() {
         @Override
         public void run() {
-          int max = atLeast(401);
+          int max = SolrTestUtil.atLeast(401);
           for (int id = 101; id < max; id++) {
             try {
               indexAndUpdateCount(router, ranges, docCounts, String.valueOf(id), id, documentIds);
-              Thread.sleep(atLeast(25));
+              Thread.sleep(SolrTestUtil.atLeast(25));
             } catch (Exception e) {
               log.error("Exception while adding doc", e);
             }
diff --git a/solr/core/src/test/org/apache/solr/cloud/CleanupOldIndexTest.java b/solr/core/src/test/org/apache/solr/cloud/CleanupOldIndexTest.java
index e6050ac..612c992 100644
--- a/solr/core/src/test/org/apache/solr/cloud/CleanupOldIndexTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/CleanupOldIndexTest.java
@@ -24,6 +24,7 @@ import java.util.concurrent.TimeUnit;
 
 import org.apache.commons.io.FileUtils;
 import org.apache.lucene.util.LuceneTestCase;
+import org.apache.solr.SolrTestUtil;
 import org.apache.solr.client.solrj.embedded.JettySolrRunner;
 import org.apache.solr.client.solrj.request.CollectionAdminRequest;
 import org.apache.solr.common.util.TimeOut;
@@ -33,7 +34,6 @@ import org.apache.solr.core.SolrCore;
 import org.apache.solr.handler.SnapShooter;
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
-import org.junit.Ignore;
 import org.junit.Test;
 
 @LuceneTestCase.Slow
@@ -56,7 +56,7 @@ public class CleanupOldIndexTest extends SolrCloudTestCase {
 
     useFactory(null);
     configureCluster(2)
-        .addConfig("conf1", TEST_PATH().resolve("configsets").resolve("cloud-dynamic").resolve("conf"))
+        .addConfig("conf1", SolrTestUtil.TEST_PATH().resolve("configsets").resolve("cloud-dynamic").resolve("conf"))
         .configure();
   }
 
diff --git a/solr/core/src/test/org/apache/solr/cloud/CloudExitableDirectoryReaderTest.java b/solr/core/src/test/org/apache/solr/cloud/CloudExitableDirectoryReaderTest.java
index 01e8394..7253046 100644
--- a/solr/core/src/test/org/apache/solr/cloud/CloudExitableDirectoryReaderTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/CloudExitableDirectoryReaderTest.java
@@ -22,6 +22,7 @@ import com.codahale.metrics.MetricRegistry;
 import org.apache.lucene.util.LuceneTestCase;
 import org.apache.lucene.util.TestUtil;
 import org.apache.solr.SolrTestCaseJ4;
+import org.apache.solr.SolrTestUtil;
 import org.apache.solr.client.solrj.SolrClient;
 import org.apache.solr.client.solrj.embedded.JettySolrRunner;
 import org.apache.solr.client.solrj.request.CollectionAdminRequest;
@@ -83,7 +84,7 @@ public class CloudExitableDirectoryReaderTest extends SolrCloudTestCase {
 
     // create one more node then shard, so that we also test the case of proxied requests.
     Builder clusterBuilder = configureCluster(3)
-        .addConfig("conf", TEST_PATH().resolve("configsets").resolve("exitable-directory").resolve("conf"));
+        .addConfig("conf", SolrTestUtil.TEST_PATH().resolve("configsets").resolve("exitable-directory").resolve("conf"));
     clusterBuilder.withMetrics(true);
     clusterBuilder
         .configure();
@@ -267,7 +268,7 @@ public class CloudExitableDirectoryReaderTest extends SolrCloudTestCase {
         throw ae;
       }
     }
-    int numBites = atLeast(100);
+    int numBites = SolrTestUtil.atLeast(100);
     for(int bite=0; bite<numBites; bite++) {
       int boundary = random().nextInt(creep);
       boolean omitHeader = random().nextBoolean();
diff --git a/solr/core/src/test/org/apache/solr/cloud/ClusterStateUpdateTest.java b/solr/core/src/test/org/apache/solr/cloud/ClusterStateUpdateTest.java
index e671acb..1184200 100644
--- a/solr/core/src/test/org/apache/solr/cloud/ClusterStateUpdateTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/ClusterStateUpdateTest.java
@@ -22,6 +22,7 @@ import java.util.Map;
 import java.util.Set;
 
 import org.apache.lucene.util.LuceneTestCase.Slow;
+import org.apache.solr.SolrTestUtil;
 import org.apache.solr.client.solrj.embedded.JettySolrRunner;
 import org.apache.solr.client.solrj.request.CollectionAdminRequest;
 import org.apache.solr.common.cloud.ClusterState;
@@ -43,7 +44,7 @@ public class ClusterStateUpdateTest extends SolrCloudTestCase  {
   public void setUp() throws Exception {
     super.setUp();
     configureCluster(3).formatZk(true)
-        .addConfig("conf", configset("cloud-minimal"))
+        .addConfig("conf", SolrTestUtil.configset("cloud-minimal"))
         .configure();
   }
 
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 0913722..b903458 100644
--- a/solr/core/src/test/org/apache/solr/cloud/CollectionPropsTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/CollectionPropsTest.java
@@ -30,6 +30,7 @@ import java.util.concurrent.Semaphore;
 import java.util.concurrent.TimeUnit;
 import org.apache.lucene.util.LuceneTestCase;
 import org.apache.solr.SolrTestCaseJ4;
+import org.apache.solr.SolrTestUtil;
 import org.apache.solr.client.solrj.request.CollectionAdminRequest;
 import org.apache.solr.client.solrj.response.CollectionAdminResponse;
 import org.apache.solr.common.cloud.CollectionProperties;
@@ -38,7 +39,6 @@ import org.apache.solr.common.cloud.ZkStateReader;
 import org.apache.zookeeper.KeeperException;
 import org.junit.Before;
 import org.junit.BeforeClass;
-import org.junit.Ignore;
 import org.junit.Test;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -47,13 +47,14 @@ import org.slf4j.LoggerFactory;
 @SolrTestCaseJ4.SuppressSSL
 //@LuceneTestCase.Nightly // too flakey atm, and ugly sleeps as well
 public class CollectionPropsTest extends SolrCloudTestCase {
+
   private String collectionName;
   private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
 
   @BeforeClass
   public static void setupClass() throws Exception {
     configureCluster(4)
-        .addConfig("conf", configset("cloud-minimal")).formatZk(true)
+        .addConfig("conf", SolrTestUtil.configset("cloud-minimal")).formatZk(true)
         .configure();
   }
 
@@ -162,7 +163,7 @@ public class CollectionPropsTest extends SolrCloudTestCase {
   }
 
   @Test
-  @Nightly // ugly retry - properties should be implemented better than this ...
+  @LuceneTestCase.Nightly // ugly retry - properties should be implemented better than this ...
   public void testWatcher() throws KeeperException, InterruptedException, IOException {
     final ZkStateReader zkStateReader = cluster.getSolrClient().getZkStateReader();
     CollectionProperties collectionProps = new CollectionProperties(cluster.getSolrClient().getZkStateReader());
@@ -201,7 +202,7 @@ public class CollectionPropsTest extends SolrCloudTestCase {
   }
 
   @Test
-  @Nightly
+  @LuceneTestCase.Nightly
   public void testMultipleWatchers() throws InterruptedException, IOException {
     final ZkStateReader zkStateReader = cluster.getSolrClient().getZkStateReader();
     CollectionProperties collectionProps = new CollectionProperties(cluster.getSolrClient().getZkStateReader());
diff --git a/solr/core/src/test/org/apache/solr/cloud/CollectionStateZnodeTest.java b/solr/core/src/test/org/apache/solr/cloud/CollectionStateZnodeTest.java
index 14b3bc8..57955b7 100644
--- a/solr/core/src/test/org/apache/solr/cloud/CollectionStateZnodeTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/CollectionStateZnodeTest.java
@@ -16,6 +16,7 @@
  */
 package org.apache.solr.cloud;
 
+import org.apache.solr.SolrTestUtil;
 import org.apache.solr.client.solrj.request.CollectionAdminRequest;
 import org.apache.solr.common.cloud.DocCollection;
 import org.apache.solr.common.cloud.ZkStateReader;
@@ -30,7 +31,7 @@ public class CollectionStateZnodeTest extends SolrCloudTestCase {
   @BeforeClass
   public static void setupCluster() throws Exception {
     configureCluster(4).formatZk(true)
-        .addConfig("conf", configset("cloud-minimal"))
+        .addConfig("conf", SolrTestUtil.configset("cloud-minimal"))
         .configure();
   }
   
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 4c3e278..ed4213c 100644
--- a/solr/core/src/test/org/apache/solr/cloud/CollectionsAPISolrJTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/CollectionsAPISolrJTest.java
@@ -30,8 +30,10 @@ import java.util.Optional;
 import java.util.concurrent.TimeUnit;
 
 import com.google.common.collect.ImmutableList;
+import org.apache.lucene.util.LuceneTestCase;
 import org.apache.lucene.util.TestUtil;
 import org.apache.solr.SolrTestCaseJ4;
+import org.apache.solr.SolrTestUtil;
 import org.apache.solr.client.solrj.SolrClient;
 import org.apache.solr.client.solrj.SolrRequest;
 import org.apache.solr.client.solrj.SolrServerException;
@@ -84,8 +86,8 @@ public class CollectionsAPISolrJTest extends SolrCloudTestCase {
   public static void beforeCollectionsAPISolrJTest() throws Exception {
     System.setProperty("solr.suppressDefaultConfigBootstrap", "false");
     configureCluster( TEST_NIGHTLY ? 4 : 2).formatZk(true)
-            .addConfig("conf", configset("cloud-minimal"))
-            .addConfig("conf2", configset("cloud-dynamic"))
+            .addConfig("conf", SolrTestUtil.configset("cloud-minimal"))
+            .addConfig("conf2", SolrTestUtil.configset("cloud-dynamic"))
             .configure();
   }
 
@@ -125,7 +127,7 @@ public class CollectionsAPISolrJTest extends SolrCloudTestCase {
   }
 
   @Test
-  @Nightly
+  @LuceneTestCase.Nightly
   public void testCreateCollWithDefaultClusterPropertiesNewFormat() throws Exception {
     String COLL_NAME = "CollWithDefaultClusterProperties";
       V2Response rsp = new V2Request.Builder("/cluster")
@@ -379,7 +381,7 @@ public class CollectionsAPISolrJTest extends SolrCloudTestCase {
 
     String collectionName = "solrj_test_core_props";
 
-    Path tmpDir = createTempDir("testPropertyParamsForCreate");
+    Path tmpDir = SolrTestUtil.createTempDir("testPropertyParamsForCreate");
     Path dataDir = tmpDir.resolve("dataDir-" + TestUtil.randomSimpleString(random(), 1, 5));
     Path ulogDir = tmpDir.resolve("ulogDir-" + TestUtil.randomSimpleString(random(), 1, 5));
 
@@ -508,7 +510,7 @@ public class CollectionsAPISolrJTest extends SolrCloudTestCase {
   }
 
   @Test
-  @Nightly
+  @LuceneTestCase.Nightly
   public void testColStatus() throws Exception {
     final String collectionName = "collectionStatusTest";
     CollectionAdminRequest.createCollection(collectionName, "conf2", 2, 2)
@@ -573,7 +575,7 @@ public class CollectionsAPISolrJTest extends SolrCloudTestCase {
   }
 
   @Test
-  @AwaitsFix(bugUrl = "Alias issue")
+  @LuceneTestCase.AwaitsFix(bugUrl = "Alias issue")
   public void testRenameCollection() throws Exception {
     doTestRenameCollection(true);
     CollectionAdminRequest.deleteAlias("col1").process(cluster.getSolrClient());
@@ -827,21 +829,21 @@ public class CollectionsAPISolrJTest extends SolrCloudTestCase {
     waitForState("Expecting attribute 'router' to be deleted", collection,
         (n, c) -> null == c.get("router"));
 
-    expectThrows(IllegalArgumentException.class,
+    LuceneTestCase.expectThrows(IllegalArgumentException.class,
         "An attempt to set unknown collection attribute should have failed",
         () -> CollectionAdminRequest.modifyCollection(collection, null)
             .setAttribute("non_existent_attr", 25)
             .process(cluster.getSolrClient())
     );
 
-    expectThrows(IllegalArgumentException.class,
+    LuceneTestCase.expectThrows(IllegalArgumentException.class,
         "An attempt to set null value should have failed",
         () -> CollectionAdminRequest.modifyCollection(collection, null)
             .setAttribute("non_existent_attr", null)
             .process(cluster.getSolrClient())
     );
 
-    expectThrows(IllegalArgumentException.class,
+    LuceneTestCase.expectThrows(IllegalArgumentException.class,
         "An attempt to unset unknown collection attribute should have failed",
         () -> CollectionAdminRequest.modifyCollection(collection, null)
             .unsetAttribute("non_existent_attr")
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 3f86e60..66e4a53 100644
--- a/solr/core/src/test/org/apache/solr/cloud/ConcurrentCreateRoutedAliasTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/ConcurrentCreateRoutedAliasTest.java
@@ -22,6 +22,7 @@ import java.util.concurrent.atomic.AtomicReference;
 
 import org.apache.lucene.util.LuceneTestCase;
 import org.apache.solr.SolrTestCaseJ4;
+import org.apache.solr.SolrTestUtil;
 import org.apache.solr.client.solrj.SolrClient;
 import org.apache.solr.client.solrj.request.CollectionAdminRequest;
 import org.apache.solr.client.solrj.response.CollectionAdminResponse;
@@ -48,7 +49,7 @@ public class ConcurrentCreateRoutedAliasTest extends SolrTestCaseJ4 {
   @Before
   public void setUp() throws Exception {
     super.setUp();
-    solrCluster = new MiniSolrCloudCluster(4, createTempDir(), buildJettyConfig("/solr"));
+    solrCluster = new MiniSolrCloudCluster(4, SolrTestUtil.createTempDir(), buildJettyConfig("/solr"));
   }
 
   @Override
diff --git a/solr/core/src/test/org/apache/solr/cloud/ConfigSetsAPITest.java b/solr/core/src/test/org/apache/solr/cloud/ConfigSetsAPITest.java
index 005824e..0b312e5 100644
--- a/solr/core/src/test/org/apache/solr/cloud/ConfigSetsAPITest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/ConfigSetsAPITest.java
@@ -16,7 +16,9 @@
  */
 package org.apache.solr.cloud;
 
+import org.apache.lucene.util.LuceneTestCase;
 import org.apache.solr.SolrTestCaseJ4;
+import org.apache.solr.SolrTestUtil;
 import org.apache.solr.client.solrj.request.CollectionAdminRequest;
 import org.apache.solr.client.solrj.request.ConfigSetAdminRequest;
 import org.apache.solr.common.SolrException;
@@ -34,8 +36,8 @@ public class ConfigSetsAPITest extends SolrCloudTestCase {
     System.setProperty("shareSchema", "true");  // see testSharedSchema
 
     configureCluster(1) // some tests here assume 1 node
-        .addConfig("conf1", TEST_PATH().resolve("configsets").resolve("cloud-minimal").resolve("conf"))
-        .addConfig("cShare", TEST_PATH().resolve("configsets").resolve("cloud-minimal").resolve("conf"))
+        .addConfig("conf1", SolrTestUtil.TEST_PATH().resolve("configsets").resolve("cloud-minimal").resolve("conf"))
+        .addConfig("cShare", SolrTestUtil.TEST_PATH().resolve("configsets").resolve("cloud-minimal").resolve("conf"))
         .formatZk(true).configure();
   }
   @After
@@ -56,13 +58,13 @@ public class ConfigSetsAPITest extends SolrCloudTestCase {
     // TODO - check exception response!
     ConfigSetAdminRequest.Delete deleteConfigRequest = new ConfigSetAdminRequest.Delete();
     deleteConfigRequest.setConfigSetName("conf1");
-    expectThrows(SolrException.class, () -> {
+    LuceneTestCase.expectThrows(SolrException.class, () -> {
       deleteConfigRequest.process(cluster.getSolrClient());
     });
   }
 
   @Test
-  @Nightly // TODO speedup
+  @LuceneTestCase.Nightly // TODO speedup
   public void testSharedSchema() throws Exception {
     CollectionAdminRequest.createCollection("col1", "cShare", 1, 1)
         .processAndWait(cluster.getSolrClient(), DEFAULT_TIMEOUT);
diff --git a/solr/core/src/test/org/apache/solr/cloud/CreateCollectionCleanupTest.java b/solr/core/src/test/org/apache/solr/cloud/CreateCollectionCleanupTest.java
index 0e190d7..3f78321 100644
--- a/solr/core/src/test/org/apache/solr/cloud/CreateCollectionCleanupTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/CreateCollectionCleanupTest.java
@@ -27,6 +27,8 @@ import java.util.List;
 import java.util.Properties;
 import java.util.concurrent.TimeUnit;
 
+import org.apache.lucene.util.LuceneTestCase;
+import org.apache.solr.SolrTestUtil;
 import org.apache.solr.client.solrj.impl.BaseHttpSolrClient;
 import org.apache.solr.client.solrj.impl.CloudHttp2SolrClient;
 import org.apache.solr.client.solrj.request.CollectionAdminRequest;
@@ -68,7 +70,7 @@ public class CreateCollectionCleanupTest extends SolrCloudTestCase {
   public static void createCluster() throws Exception {
     useFactory(null);
     configureCluster(1)
-        .addConfig("conf1", TEST_PATH().resolve("configsets").resolve("cloud-minimal").resolve("conf"))
+        .addConfig("conf1", SolrTestUtil.TEST_PATH().resolve("configsets").resolve("cloud-minimal").resolve("conf"))
         .formatZk(true).withSolrXml(CLOUD_SOLR_XML_WITH_10S_CREATE_COLL_WAIT)
         .configure();
   }
@@ -82,12 +84,12 @@ public class CreateCollectionCleanupTest extends SolrCloudTestCase {
     CollectionAdminRequest.Create create = CollectionAdminRequest.createCollection(collectionName,"conf1",1,1);
 
     Properties properties = new Properties();
-    Path tmpDir = createTempDir();
+    Path tmpDir = SolrTestUtil.createTempDir();
     tmpDir = tmpDir.resolve("foo");
     Files.createFile(tmpDir);
     properties.put(CoreAdminParams.DATA_DIR, tmpDir.toString());
     create.setProperties(properties);
-    expectThrows(BaseHttpSolrClient.RemoteSolrException.class, () -> {
+    LuceneTestCase.expectThrows(BaseHttpSolrClient.RemoteSolrException.class, () -> {
       create.process(cloudClient);
     });
 
@@ -105,7 +107,7 @@ public class CreateCollectionCleanupTest extends SolrCloudTestCase {
   
   @Test
   // TODO: this won't fail as async as that won't wait for the point this data dir issue is hit
-  @Nightly // TODO why does this take 10+ seconds?
+  @LuceneTestCase.Nightly // TODO why does this take 10+ seconds?
   public void testAsyncCreateCollectionCleanup() throws Exception {
     final CloudHttp2SolrClient cloudClient = cluster.getSolrClient();
     String collectionName = "foo2";
@@ -115,7 +117,7 @@ public class CreateCollectionCleanupTest extends SolrCloudTestCase {
     CollectionAdminRequest.Create create = CollectionAdminRequest.createCollection(collectionName,"conf1",1,1);
 
     Properties properties = new Properties();
-    Path tmpDir = createTempDir();
+    Path tmpDir = SolrTestUtil.createTempDir();
     tmpDir = tmpDir.resolve("foo2");
     Files.createFile(tmpDir);
     properties.put(CoreAdminParams.DATA_DIR, tmpDir.toString());
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 9f61915..4f267e3 100644
--- a/solr/core/src/test/org/apache/solr/cloud/CreateRoutedAliasTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/CreateRoutedAliasTest.java
@@ -26,6 +26,7 @@ import org.apache.http.entity.StringEntity;
 import org.apache.http.impl.client.CloseableHttpClient;
 import org.apache.http.util.EntityUtils;
 import org.apache.solr.SolrTestCaseJ4;
+import org.apache.solr.SolrTestUtil;
 import org.apache.solr.client.solrj.SolrClient;
 import org.apache.solr.client.solrj.SolrServerException;
 import org.apache.solr.client.solrj.impl.HttpClientUtil;
@@ -82,7 +83,7 @@ public class CreateRoutedAliasTest extends SolrCloudTestCase {
   @Test
   public void testV2() throws Exception {
     // note we don't use TZ in this test, thus it's UTC
-    final String aliasName = getSaferTestName();
+    final String aliasName = SolrTestUtil.getTestName();
 
     String createNode = cluster.getRandomJetty(random()).getNodeName();
 
@@ -162,7 +163,7 @@ public class CreateRoutedAliasTest extends SolrCloudTestCase {
 
   @Test
   public void testV1() throws Exception {
-    final String aliasName = getSaferTestName();
+    final String aliasName = SolrTestUtil.getTestName();
     final String baseUrl = cluster.getRandomJetty(random()).getBaseUrl().toString();
     Instant start = Instant.now().truncatedTo(ChronoUnit.HOURS); // mostly make sure no millis
     HttpGet get = new HttpGet(baseUrl + "/admin/collections?action=CREATEALIAS" +
@@ -204,7 +205,7 @@ public class CreateRoutedAliasTest extends SolrCloudTestCase {
   // TZ should not affect the first collection name if absolute date given for start
   @Test
   public void testTimezoneAbsoluteDate() throws Exception {
-    final String aliasName = getSaferTestName();
+    final String aliasName = SolrTestUtil.getTestName();
     try (SolrClient client = SolrTestCaseJ4.getCloudSolrClient(cluster)) {
       CollectionAdminRequest.createTimeRoutedAlias(
           aliasName,
@@ -231,7 +232,7 @@ public class CreateRoutedAliasTest extends SolrCloudTestCase {
     final String baseUrl = cluster.getRandomJetty(random()).getBaseUrl().toString();
     HttpGet get = new HttpGet(baseUrl + "/admin/collections?action=CREATEALIAS" +
         "&wt=json" +
-        "&name=" + getTestName() +
+        "&name=" + SolrTestUtil.getTestName() +
         "&collections=collection1meta,collection2meta" +
         "&router.field=evt_dt" +
         "&router.name=time" +
@@ -259,7 +260,7 @@ public class CreateRoutedAliasTest extends SolrCloudTestCase {
 
   @Test
   public void testRandomRouterNameFails() throws Exception {
-    final String aliasName = getSaferTestName();
+    final String aliasName = SolrTestUtil.getTestName();
     final String baseUrl = cluster.getRandomJetty(random()).getBaseUrl().toString();
     HttpGet get = new HttpGet(baseUrl + "/admin/collections?action=CREATEALIAS" +
         "&wt=json" +
@@ -275,7 +276,7 @@ public class CreateRoutedAliasTest extends SolrCloudTestCase {
 
   @Test
   public void testTimeStampWithMsFails() throws Exception {
-    final String aliasName = getSaferTestName();
+    final String aliasName = SolrTestUtil.getTestName();
     final String baseUrl = cluster.getRandomJetty(random()).getBaseUrl().toString();
     HttpGet get = new HttpGet(baseUrl + "/admin/collections?action=CREATEALIAS" +
         "&wt=json" +
@@ -291,7 +292,7 @@ public class CreateRoutedAliasTest extends SolrCloudTestCase {
 
   @Test
   public void testBadDateMathIntervalFails() throws Exception {
-    final String aliasName = getSaferTestName();
+    final String aliasName = SolrTestUtil.getTestName();
     final String baseUrl = cluster.getRandomJetty(random()).getBaseUrl().toString();
     HttpGet get = new HttpGet(baseUrl + "/admin/collections?action=CREATEALIAS" +
         "&wt=json" +
@@ -308,7 +309,7 @@ public class CreateRoutedAliasTest extends SolrCloudTestCase {
 
   @Test
   public void testNegativeFutureFails() throws Exception {
-    final String aliasName = getSaferTestName();
+    final String aliasName = SolrTestUtil.getTestName();
     final String baseUrl = cluster.getRandomJetty(random()).getBaseUrl().toString();
     HttpGet get = new HttpGet(baseUrl + "/admin/collections?action=CREATEALIAS" +
         "&wt=json" +
diff --git a/solr/core/src/test/org/apache/solr/cloud/DeleteInactiveReplicaTest.java b/solr/core/src/test/org/apache/solr/cloud/DeleteInactiveReplicaTest.java
index 4fa2f79..5b5d462 100644
--- a/solr/core/src/test/org/apache/solr/cloud/DeleteInactiveReplicaTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/DeleteInactiveReplicaTest.java
@@ -16,13 +16,13 @@
  */
 package org.apache.solr.cloud;
 
+import org.apache.solr.SolrTestUtil;
 import org.apache.solr.client.solrj.SolrClient;
 import org.apache.solr.client.solrj.embedded.JettySolrRunner;
 import org.apache.solr.client.solrj.request.CollectionAdminRequest;
 import org.apache.solr.common.cloud.DocCollection;
 import org.apache.solr.common.cloud.Replica;
 import org.apache.solr.common.cloud.Slice;
-import org.eclipse.jetty.util.Jetty;
 import org.junit.BeforeClass;
 import org.junit.Test;
 import org.slf4j.Logger;
@@ -40,7 +40,7 @@ public class DeleteInactiveReplicaTest extends SolrCloudTestCase {
   public static void setupCluster() throws Exception {
     useFactory(null);
     configureCluster(4)
-        .addConfig("conf", configset("cloud-minimal"))
+        .addConfig("conf", SolrTestUtil.configset("cloud-minimal"))
         .configure();
   }
 
diff --git a/solr/core/src/test/org/apache/solr/cloud/DeleteLastCustomShardedReplicaTest.java b/solr/core/src/test/org/apache/solr/cloud/DeleteLastCustomShardedReplicaTest.java
index 1256593..1429cde 100644
--- a/solr/core/src/test/org/apache/solr/cloud/DeleteLastCustomShardedReplicaTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/DeleteLastCustomShardedReplicaTest.java
@@ -16,11 +16,11 @@
  */
 package org.apache.solr.cloud;
 
+import org.apache.solr.SolrTestUtil;
 import org.apache.solr.client.solrj.request.CollectionAdminRequest;
 import org.apache.solr.common.cloud.DocCollection;
 import org.apache.solr.common.cloud.Replica;
 import org.junit.Before;
-import org.junit.BeforeClass;
 import org.junit.Test;
 
 public class DeleteLastCustomShardedReplicaTest extends SolrCloudTestCase {
@@ -28,7 +28,7 @@ public class DeleteLastCustomShardedReplicaTest extends SolrCloudTestCase {
   @Before
   public void setupCluster() throws Exception {
     configureCluster(2)
-        .addConfig("conf", configset("cloud-minimal"))
+        .addConfig("conf", SolrTestUtil.configset("cloud-minimal"))
         .configure();
   }
 
diff --git a/solr/core/src/test/org/apache/solr/cloud/DeleteNodeTest.java b/solr/core/src/test/org/apache/solr/cloud/DeleteNodeTest.java
index 7032686..9734bba 100644
--- a/solr/core/src/test/org/apache/solr/cloud/DeleteNodeTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/DeleteNodeTest.java
@@ -17,7 +17,8 @@
 
 package org.apache.solr.cloud;
 
-import org.apache.solr.SolrTestCaseJ4;
+import org.apache.solr.SolrTestCaseUtil;
+import org.apache.solr.SolrTestUtil;
 import org.apache.solr.client.solrj.impl.CloudHttp2SolrClient;
 import org.apache.solr.client.solrj.request.CollectionAdminRequest;
 import org.apache.solr.common.cloud.ClusterState;
@@ -41,7 +42,7 @@ public class DeleteNodeTest extends SolrCloudTestCase {
   public static void setupCluster() throws Exception {
     useFactory(null);
     configureCluster(TEST_NIGHTLY ? 6 : 3)
-        .addConfig("conf1", TEST_PATH().resolve("configsets").resolve("cloud-dynamic").resolve("conf"))
+        .addConfig("conf1", SolrTestUtil.TEST_PATH().resolve("configsets").resolve("cloud-dynamic").resolve("conf"))
         .formatZk(true).configure();
   }
 
@@ -59,7 +60,7 @@ public class DeleteNodeTest extends SolrCloudTestCase {
     ArrayList<String> l = new ArrayList<>(liveNodes);
     Collections.shuffle(l, random());
     // NOTE: must be more than a single nrt replica or it will not let you delete a node
-    CollectionAdminRequest.Create create = SolrTestCaseJ4.pickRandom(
+    CollectionAdminRequest.Create create = SolrTestCaseUtil.pickRandom(
         CollectionAdminRequest.createCollection(coll, "conf1", 5, 2, 0, 0),
         CollectionAdminRequest.createCollection(coll, "conf1", 5, 2, 1, 0),
         CollectionAdminRequest.createCollection(coll, "conf1", 5, 2, 1, 1),
diff --git a/solr/core/src/test/org/apache/solr/cloud/DeleteReplicaTest.java b/solr/core/src/test/org/apache/solr/cloud/DeleteReplicaTest.java
index 1d9fa03..3552bf4 100644
--- a/solr/core/src/test/org/apache/solr/cloud/DeleteReplicaTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/DeleteReplicaTest.java
@@ -30,7 +30,9 @@ import java.util.concurrent.TimeoutException;
 import java.util.concurrent.atomic.AtomicBoolean;
 import java.util.concurrent.atomic.AtomicInteger;
 
+import org.apache.lucene.util.LuceneTestCase;
 import org.apache.solr.SolrTestCase;
+import org.apache.solr.SolrTestUtil;
 import org.apache.solr.client.solrj.embedded.JettySolrRunner;
 import org.apache.solr.client.solrj.request.CollectionAdminRequest;
 import org.apache.solr.client.solrj.request.CollectionAdminRequest.Create;
@@ -83,7 +85,7 @@ public class DeleteReplicaTest extends SolrCloudTestCase {
     
     // these tests need to be isolated, so we dont share the minicluster
     configureCluster(4)
-        .addConfig("conf", configset("cloud-minimal"))
+        .addConfig("conf", SolrTestUtil.configset("cloud-minimal"))
         .configure();
   }
   
@@ -181,7 +183,7 @@ public class DeleteReplicaTest extends SolrCloudTestCase {
 
     CollectionAdminRequest.deleteReplicasFromShard(collectionName, "s1", 2).process(cluster.getSolrClient());
 
-    SolrException e = expectThrows(SolrException.class,
+    SolrException e = LuceneTestCase.expectThrows(SolrException.class,
         "Can't delete the last replica by count",
         () -> CollectionAdminRequest.deleteReplicasFromShard(collectionName, "s1", 1).process(cluster.getSolrClient())
     );
@@ -194,7 +196,7 @@ public class DeleteReplicaTest extends SolrCloudTestCase {
 
   @Test
   // commented out on: 17-Feb-2019   @BadApple(bugUrl="https://issues.apache.org/jira/browse/SOLR-12028") // annotated on: 24-Dec-2018
-  @Nightly
+  @LuceneTestCase.Nightly
   public void deleteReplicaByCountForAllShards() throws Exception {
     final String collectionName = "deleteByCountNew";
     Create req = CollectionAdminRequest.createCollection(collectionName, "conf", 2, 2);
@@ -203,7 +205,7 @@ public class DeleteReplicaTest extends SolrCloudTestCase {
   }
 
   @Test
-  @AwaitsFix(bugUrl = "Currently disabled due to negative behavior of UnloadCoreOnDeletedWatcher and it's semi disable")
+  @LuceneTestCase.AwaitsFix(bugUrl = "Currently disabled due to negative behavior of UnloadCoreOnDeletedWatcher and it's semi disable")
   public void deleteReplicaFromClusterState() throws Exception {
     final String collectionName = "deleteFromClusterStateCollection";
     CollectionAdminRequest.createCollection(collectionName, "conf", 1, 3)
@@ -256,9 +258,9 @@ public class DeleteReplicaTest extends SolrCloudTestCase {
   }
 
   @Test
-  @Slow
+  @LuceneTestCase.Slow
   // commented out on: 17-Feb-2019   @BadApple(bugUrl="https://issues.apache.org/jira/browse/SOLR-12028") // annotated on: 24-Dec-2018
-  @Nightly // TODO look at performance of this - need lower connection timeouts for test?
+  @LuceneTestCase.Nightly // TODO look at performance of this - need lower connection timeouts for test?
   public void raceConditionOnDeleteAndRegisterReplica() throws Exception {
     final String collectionName = "raceDeleteReplicaCollection";
     CollectionAdminRequest.createCollection(collectionName, "conf", 1, 2)
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 bb45f69..dc5f5e7 100644
--- a/solr/core/src/test/org/apache/solr/cloud/DeleteShardTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/DeleteShardTest.java
@@ -20,9 +20,10 @@ import java.io.IOException;
 import java.util.HashMap;
 import java.util.Map;
 
+import org.apache.lucene.util.LuceneTestCase;
+import org.apache.solr.SolrTestUtil;
 import org.apache.solr.client.solrj.SolrServerException;
 import org.apache.solr.client.solrj.cloud.DistributedQueue;
-import org.apache.solr.client.solrj.impl.CloudHttp2SolrClient;
 import org.apache.solr.client.solrj.request.CollectionAdminRequest;
 import org.apache.solr.client.solrj.request.CoreStatus;
 import org.apache.solr.cloud.overseer.OverseerAction;
@@ -36,7 +37,6 @@ import org.apache.solr.common.util.Utils;
 import org.apache.solr.util.FileUtils;
 import org.junit.After;
 import org.junit.Before;
-import org.junit.Ignore;
 import org.junit.Test;
 
 public class DeleteShardTest extends SolrCloudTestCase {
@@ -46,7 +46,7 @@ public class DeleteShardTest extends SolrCloudTestCase {
   @Before
   public void setupCluster() throws Exception {
     configureCluster(2)
-        .addConfig("conf", configset("cloud-minimal"))
+        .addConfig("conf", SolrTestUtil.configset("cloud-minimal"))
         .configure();
   }
   
@@ -72,7 +72,7 @@ public class DeleteShardTest extends SolrCloudTestCase {
     assertEquals(State.ACTIVE, state.getSlice("s2").getState());
 
     // Can't delete an ACTIVE shard
-    expectThrows(Exception.class, () -> {
+    LuceneTestCase.expectThrows(Exception.class, () -> {
       CollectionAdminRequest.deleteShard(collection, "s1").process(cluster.getSolrClient());
     });
 
diff --git a/solr/core/src/test/org/apache/solr/cloud/DeleteStatusTest.java b/solr/core/src/test/org/apache/solr/cloud/DeleteStatusTest.java
index ab8209f..bb841de 100644
--- a/solr/core/src/test/org/apache/solr/cloud/DeleteStatusTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/DeleteStatusTest.java
@@ -19,6 +19,7 @@ package org.apache.solr.cloud;
 import java.io.IOException;
 import java.util.concurrent.TimeUnit;
 
+import org.apache.solr.SolrTestUtil;
 import org.apache.solr.client.solrj.SolrClient;
 import org.apache.solr.client.solrj.SolrServerException;
 import org.apache.solr.client.solrj.impl.CloudHttp2SolrClient;
@@ -36,7 +37,7 @@ public class DeleteStatusTest extends SolrCloudTestCase {
   @BeforeClass
   public static void createCluster() throws Exception {
     configureCluster(2)
-        .addConfig("conf1", TEST_PATH().resolve("configsets").resolve("cloud-minimal").resolve("conf"))
+        .addConfig("conf1", SolrTestUtil.TEST_PATH().resolve("configsets").resolve("cloud-minimal").resolve("conf"))
         .formatZk(true).configure();
   }
 
diff --git a/solr/core/src/test/org/apache/solr/cloud/DistribCursorPagingTest.java b/solr/core/src/test/org/apache/solr/cloud/DistribCursorPagingTest.java
index 7f6bf9c..8eb1dbd 100644
--- a/solr/core/src/test/org/apache/solr/cloud/DistribCursorPagingTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/DistribCursorPagingTest.java
@@ -23,6 +23,7 @@ import org.apache.lucene.util.TestUtil;
 import org.apache.solr.SolrTestCase;
 import org.apache.solr.SolrTestCaseJ4;
 import org.apache.solr.CursorPagingTest;
+import org.apache.solr.SolrTestUtil;
 import org.apache.solr.client.solrj.SolrServerException;
 import org.apache.solr.client.solrj.request.LukeRequest;
 import org.apache.solr.client.solrj.response.QueryResponse;
@@ -538,7 +539,7 @@ public class DistribCursorPagingTest extends SolrCloudBridgeTestCase {
     final Collection<String> allFieldNames = getAllSortFieldNames();
 
     final int numInitialDocs = TestUtil.nextInt(random(), 100, 200);
-    final int totalDocs = atLeast(500);
+    final int totalDocs = SolrTestUtil.atLeast(500);
 
     // start with a smallish number of documents, and test that we can do a full walk using a 
     // sort on *every* field in the schema...
@@ -595,7 +596,7 @@ public class DistribCursorPagingTest extends SolrCloudBridgeTestCase {
     }
     commit();
 
-    final int numRandomSorts = atLeast(3);
+    final int numRandomSorts = SolrTestUtil.atLeast(3);
     for (int i = 0; i < numRandomSorts; i++) {
       final String sort = CursorPagingTest.buildRandomSort(allFieldNames);
       final String rows = "" + TestUtil.nextInt(random(), 63, 113);
diff --git a/solr/core/src/test/org/apache/solr/cloud/DistribDocExpirationUpdateProcessorTest.java b/solr/core/src/test/org/apache/solr/cloud/DistribDocExpirationUpdateProcessorTest.java
index e28a204..d7a0e18 100644
--- a/solr/core/src/test/org/apache/solr/cloud/DistribDocExpirationUpdateProcessorTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/DistribDocExpirationUpdateProcessorTest.java
@@ -31,6 +31,8 @@ import static java.util.Collections.singletonList;
 import org.apache.lucene.util.LuceneTestCase;
 import org.apache.lucene.util.LuceneTestCase.Slow;
 import org.apache.solr.SolrTestCaseJ4;
+import org.apache.solr.SolrTestCaseUtil;
+import org.apache.solr.SolrTestUtil;
 import org.apache.solr.client.solrj.SolrRequest;
 import org.apache.solr.client.solrj.SolrServerException;
 import org.apache.solr.client.solrj.impl.Http2SolrClient;
@@ -92,7 +94,7 @@ public class DistribDocExpirationUpdateProcessorTest extends SolrCloudTestCase {
   public void setupCluster(boolean security) throws Exception {
     // we want at most one core per node to force lots of network traffic to try and tickle distributed bugs
     final Builder b = configureCluster(4)
-      .addConfig("conf", TEST_PATH().resolve("configsets").resolve("doc-expiry").resolve("conf"));
+      .addConfig("conf", SolrTestUtil.TEST_PATH().resolve("configsets").resolve("doc-expiry").resolve("conf"));
 
     COLLECTION = "expiring";
     if (security) {
@@ -132,20 +134,15 @@ public class DistribDocExpirationUpdateProcessorTest extends SolrCloudTestCase {
 
     // sanity check that our cluster really does require authentication
     assertEquals("sanity check of non authenticated request",
-                 401,
-                 expectThrows(SolrException.class, () -> {
-                     final long ignored = cluster.getSolrClient().query
-                       (COLLECTION,
-                        params("q", "*:*",
-                               "rows", "0",
-                               "_trace", "no_auth_sanity_check")).getResults().getNumFound();
-                   }).code());
+                 401, SolrTestCaseUtil.expectThrows(SolrException.class, () -> {
+          final long ignored = cluster.getSolrClient().query(COLLECTION, params("q", "*:*", "rows", "0", "_trace", "no_auth_sanity_check")).getResults().getNumFound();
+        }).code());
     
     runTest();
   }
   
   private void runTest() throws Exception {
-    final int totalNumDocs = atLeast(50);
+    final int totalNumDocs = SolrTestUtil.atLeast(50);
     
     // Add a bunch of docs; some with extremely short expiration, some with no expiration
     // these should be randomly distributed to each shard
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 d74233f..3b9b2ea 100644
--- a/solr/core/src/test/org/apache/solr/cloud/DistribJoinFromCollectionTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/DistribJoinFromCollectionTest.java
@@ -26,6 +26,7 @@ import java.util.Map;
 import java.util.Set;
 
 import org.apache.lucene.util.LuceneTestCase;
+import org.apache.solr.SolrTestUtil;
 import org.apache.solr.client.solrj.SolrServerException;
 import org.apache.solr.client.solrj.impl.BaseHttpSolrClient;
 import org.apache.solr.client.solrj.impl.CloudHttp2SolrClient;
@@ -67,7 +68,7 @@ public class DistribJoinFromCollectionTest extends SolrCloudTestCase{
   
   @BeforeClass
   public static void setupCluster() throws Exception {
-    final Path configDir = Paths.get(TEST_HOME(), "collection1", "conf");
+    final Path configDir = Paths.get(SolrTestUtil.TEST_HOME(), "collection1", "conf");
 
     String configName = "solrCloudCollectionConfig";
     int nodeCount = 5;
diff --git a/solr/core/src/test/org/apache/solr/cloud/DistributedVersionInfoTest.java b/solr/core/src/test/org/apache/solr/cloud/DistributedVersionInfoTest.java
index 42fc5a3..c04d3f7 100644
--- a/solr/core/src/test/org/apache/solr/cloud/DistributedVersionInfoTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/DistributedVersionInfoTest.java
@@ -33,6 +33,7 @@ import org.apache.lucene.util.LuceneTestCase.Slow;
 import org.apache.solr.JSONTestUtil;
 import org.apache.solr.SolrTestCase;
 import org.apache.solr.SolrTestCaseJ4;
+import org.apache.solr.SolrTestUtil;
 import org.apache.solr.client.solrj.SolrClient;
 import org.apache.solr.client.solrj.SolrQuery;
 import org.apache.solr.client.solrj.SolrServerException;
@@ -70,7 +71,7 @@ public class DistributedVersionInfoTest extends SolrCloudTestCase {
   @BeforeClass
   public static void setupCluster() throws Exception {
     configureCluster(3)
-        .addConfig("conf", configset("cloud-minimal"))
+        .addConfig("conf", SolrTestUtil.configset("cloud-minimal"))
         .configure();
   }
 
diff --git a/solr/core/src/test/org/apache/solr/cloud/DocValuesNotIndexedTest.java b/solr/core/src/test/org/apache/solr/cloud/DocValuesNotIndexedTest.java
index 02807a8..b85f0e4 100644
--- a/solr/core/src/test/org/apache/solr/cloud/DocValuesNotIndexedTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/DocValuesNotIndexedTest.java
@@ -18,6 +18,7 @@
 package org.apache.solr.cloud;
 
 import org.apache.solr.SolrTestCaseJ4;
+import org.apache.solr.SolrTestUtil;
 import org.apache.solr.client.solrj.SolrQuery;
 import org.apache.solr.client.solrj.SolrServerException;
 import org.apache.solr.client.solrj.impl.CloudHttp2SolrClient;
@@ -76,7 +77,7 @@ public class DocValuesNotIndexedTest extends SolrCloudTestCase {
     SolrTestCaseJ4.randomizeNumericTypesProperties();
     System.setProperty("managed.schema.mutable", "true");
     configureCluster(2)
-        .addConfig("conf1", configset("cloud-managed"))
+        .addConfig("conf1", SolrTestUtil.configset("cloud-managed"))
         .configure();
 
     // Need enough shards that we have some shards that don't have any docs on them.
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 5c8dd16..e354d00 100644
--- a/solr/core/src/test/org/apache/solr/cloud/ForceLeaderTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/ForceLeaderTest.java
@@ -24,6 +24,7 @@ import java.util.List;
 import java.util.concurrent.TimeUnit;
 
 import com.carrotsearch.randomizedtesting.annotations.Nightly;
+import org.apache.lucene.util.LuceneTestCase;
 import org.apache.solr.client.solrj.SolrClient;
 import org.apache.solr.client.solrj.SolrServerException;
 import org.apache.solr.client.solrj.cloud.SocketProxy;
@@ -72,7 +73,7 @@ public class ForceLeaderTest extends HttpPartitionTest {
    * Tests that FORCELEADER can get an active leader even only replicas with term lower than leader's term are live
    */
   @Test
-  @Slow
+  @LuceneTestCase.Slow
   public void testReplicasInLowerTerms() throws Exception {
     handle.put("maxScore", SKIPVAL);
     handle.put("timestamp", SKIPVAL);
@@ -248,7 +249,7 @@ public class ForceLeaderTest extends HttpPartitionTest {
 
   private void assertSendDocFails(int docId) throws Exception {
     // sending a doc in this state fails
-    expectThrows(SolrException.class,
+    LuceneTestCase.expectThrows(SolrException.class,
         "Should've failed indexing during a down state.",
         () -> sendDoc(docId));
   }
diff --git a/solr/core/src/test/org/apache/solr/cloud/FullSolrCloudDistribCmdsTest.java b/solr/core/src/test/org/apache/solr/cloud/FullSolrCloudDistribCmdsTest.java
index db44bf0..99acd6a 100644
--- a/solr/core/src/test/org/apache/solr/cloud/FullSolrCloudDistribCmdsTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/FullSolrCloudDistribCmdsTest.java
@@ -163,7 +163,7 @@ public class FullSolrCloudDistribCmdsTest extends SolrCloudTestCase {
     CollectionAdminRequest.deleteCollection(collectionName).process(cluster.getSolrClient());
   }
 
-  @Nightly
+  @LuceneTestCase.Nightly
   public void testThatCantForwardToLeaderFails() throws Exception {
     final CloudHttp2SolrClient cloudClient = cluster.getSolrClient();
     final String collectionName = "test_collection_" + NAME_COUNTER.getAndIncrement();
@@ -227,7 +227,7 @@ public class FullSolrCloudDistribCmdsTest extends SolrCloudTestCase {
           log.info("Closing leaderToPartition's proxy: {}", proxy);
           proxy.close(); // NOTE: can't use halfClose, won't ensure a garunteed failure
           
-          final SolrException e = expectThrows(SolrException.class, () -> {
+          final SolrException e = LuceneTestCase.expectThrows(SolrException.class, () -> {
               // start at 50 so that we have some "updates" to previous docs and some "adds"...
               for (int i = 50; i < 250; i++) {
                 // Pure random odds of all of these docs belonging to the live shard are 1 in 2**200...
@@ -309,7 +309,7 @@ public class FullSolrCloudDistribCmdsTest extends SolrCloudTestCase {
     
     // index
     long docId = 42;
-    int topDocsNum = atLeast(TEST_NIGHTLY ? 5 : 2);
+    int topDocsNum = LuceneTestCase.atLeast(TEST_NIGHTLY ? 5 : 2);
     int childsNum = (TEST_NIGHTLY ? 5 : 2)+random().nextInt(TEST_NIGHTLY ? 5 : 2);
     for (int i = 0; i < topDocsNum; ++i) {
       UpdateRequest uReq = new UpdateRequest();
@@ -386,7 +386,7 @@ public class FullSolrCloudDistribCmdsTest extends SolrCloudTestCase {
     final CloudHttp2SolrClient cloudClient = cluster.getSolrClient();
     final String collectionName = createAndSetNewDefaultCollection();
     
-    final int numDocs = atLeast(TEST_NIGHTLY ? 50 : 15);
+    final int numDocs = LuceneTestCase.atLeast(TEST_NIGHTLY ? 50 : 15);
     for (int i = 0; i < numDocs; i++) {
       UpdateRequest uReq;
       uReq = new UpdateRequest();
@@ -404,8 +404,8 @@ public class FullSolrCloudDistribCmdsTest extends SolrCloudTestCase {
     final CloudHttp2SolrClient cloudClient = cluster.getSolrClient();
     final String collectionName = createAndSetNewDefaultCollection();
 
-    final int numDocsPerBatch = atLeast(5);
-    final int numBatchesPerThread = atLeast(5);
+    final int numDocsPerBatch = LuceneTestCase.atLeast(5);
+    final int numBatchesPerThread = LuceneTestCase.atLeast(5);
     AtomicInteger expectedDocCount = new AtomicInteger();
       
     final CountDownLatch abort = new CountDownLatch(1);
diff --git a/solr/core/src/test/org/apache/solr/cloud/LeaderElectionContextKeyTest.java b/solr/core/src/test/org/apache/solr/cloud/LeaderElectionContextKeyTest.java
index 0302145..131193c 100644
--- a/solr/core/src/test/org/apache/solr/cloud/LeaderElectionContextKeyTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/LeaderElectionContextKeyTest.java
@@ -23,6 +23,7 @@ import java.util.Locale;
 import java.util.concurrent.TimeUnit;
 
 import org.apache.lucene.util.LuceneTestCase;
+import org.apache.solr.SolrTestUtil;
 import org.apache.solr.client.solrj.SolrClient;
 import org.apache.solr.client.solrj.SolrServerException;
 import org.apache.solr.client.solrj.impl.HttpSolrClient;
@@ -46,7 +47,7 @@ public class LeaderElectionContextKeyTest extends SolrCloudTestCase {
   @BeforeClass
   public static void setupCluster() throws Exception {
     configureCluster(1)
-        .addConfig("config", TEST_PATH().resolve("configsets").resolve("cloud-minimal").resolve("conf"))
+        .addConfig("config", SolrTestUtil.TEST_PATH().resolve("configsets").resolve("cloud-minimal").resolve("conf"))
         .configure();
 
     for (int i = 1; i <= 2; i++) {
diff --git a/solr/core/src/test/org/apache/solr/cloud/LeaderElectionIntegrationTest.java b/solr/core/src/test/org/apache/solr/cloud/LeaderElectionIntegrationTest.java
index b4a15b8..2e215f0 100644
--- a/solr/core/src/test/org/apache/solr/cloud/LeaderElectionIntegrationTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/LeaderElectionIntegrationTest.java
@@ -24,6 +24,7 @@ import java.util.concurrent.TimeoutException;
 
 import org.apache.lucene.util.LuceneTestCase;
 import org.apache.lucene.util.LuceneTestCase.Slow;
+import org.apache.solr.SolrTestUtil;
 import org.apache.solr.client.solrj.SolrServerException;
 import org.apache.solr.client.solrj.embedded.JettySolrRunner;
 import org.apache.solr.client.solrj.request.CollectionAdminRequest;
@@ -48,7 +49,7 @@ public class LeaderElectionIntegrationTest extends SolrCloudTestCase {
     useFactory(null);
     super.setUp();
     configureCluster(6)
-        .addConfig("conf", configset("cloud-minimal"))
+        .addConfig("conf", SolrTestUtil.configset("cloud-minimal"))
         .configure();
   }
 
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 8075912..8474225 100644
--- a/solr/core/src/test/org/apache/solr/cloud/LeaderElectionTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/LeaderElectionTest.java
@@ -32,6 +32,7 @@ import java.util.concurrent.TimeUnit;
 import org.apache.lucene.util.LuceneTestCase;
 import org.apache.lucene.util.LuceneTestCase.Slow;
 import org.apache.solr.SolrTestCaseJ4;
+import org.apache.solr.SolrTestUtil;
 import org.apache.solr.common.cloud.OnReconnect;
 import org.apache.solr.common.cloud.Replica;
 import org.apache.solr.common.cloud.SolrZkClient;
@@ -76,7 +77,7 @@ public class LeaderElectionTest extends SolrTestCaseJ4 {
   @Override
   public void setUp() throws Exception {
     super.setUp();
-    Path zkDir = createTempDir("zkData");
+    Path zkDir = SolrTestUtil.createTempDir("zkData");
 
     server = new ZkTestServer(zkDir);
     server.setTheTickTime(1000);
@@ -460,7 +461,7 @@ public class LeaderElectionTest extends SolrTestCaseJ4 {
     Thread scheduleThread = new Thread() {
       @Override
       public void run() {
-        int count = atLeast(5);
+        int count = SolrTestUtil.atLeast(5);
         for (int i = 1; i < count; i++) {
           int launchIn = random().nextInt(500);
           ClientThread thread = null;
diff --git a/solr/core/src/test/org/apache/solr/cloud/LeaderTragicEventTest.java b/solr/core/src/test/org/apache/solr/cloud/LeaderTragicEventTest.java
index bf51e5e..e26b28f 100644
--- a/solr/core/src/test/org/apache/solr/cloud/LeaderTragicEventTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/LeaderTragicEventTest.java
@@ -28,6 +28,7 @@ import java.util.List;
 import org.apache.lucene.store.AlreadyClosedException;
 import org.apache.lucene.store.MockDirectoryWrapper;
 import org.apache.lucene.util.LuceneTestCase.AwaitsFix;
+import org.apache.solr.SolrTestUtil;
 import org.apache.solr.client.solrj.embedded.JettySolrRunner;
 import org.apache.solr.client.solrj.impl.BaseHttpSolrClient.RemoteSolrException;
 import org.apache.solr.client.solrj.impl.HttpSolrClient;
@@ -61,7 +62,7 @@ public class LeaderTragicEventTest extends SolrCloudTestCase {
     System.setProperty(MockDirectoryFactory.SOLR_TESTS_USING_MOCK_DIRECTORY_WRAPPER, "true");
 
     configureCluster(2)
-        .addConfig("config", TEST_PATH().resolve("configsets").resolve("cloud-minimal").resolve("conf"))
+        .addConfig("config", SolrTestUtil.TEST_PATH().resolve("configsets").resolve("cloud-minimal").resolve("conf"))
         .configure();
   }
 
diff --git a/solr/core/src/test/org/apache/solr/cloud/LeaderVoteWaitTimeoutTest.java b/solr/core/src/test/org/apache/solr/cloud/LeaderVoteWaitTimeoutTest.java
index 01137c2..aab8e05 100644
--- a/solr/core/src/test/org/apache/solr/cloud/LeaderVoteWaitTimeoutTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/LeaderVoteWaitTimeoutTest.java
@@ -27,8 +27,10 @@ import java.util.List;
 import java.util.Map;
 import java.util.concurrent.TimeUnit;
 
+import org.apache.lucene.util.LuceneTestCase;
 import org.apache.solr.JSONTestUtil;
 import org.apache.solr.SolrTestCaseJ4;
+import org.apache.solr.SolrTestUtil;
 import org.apache.solr.client.solrj.SolrServerException;
 import org.apache.solr.client.solrj.cloud.SocketProxy;
 import org.apache.solr.client.solrj.embedded.JettySolrRunner;
@@ -44,7 +46,6 @@ import org.junit.After;
 import org.junit.AfterClass;
 import org.junit.Before;
 import org.junit.BeforeClass;
-import org.junit.Ignore;
 import org.junit.Test;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -83,7 +84,7 @@ public class LeaderVoteWaitTimeoutTest extends SolrCloudTestCase {
   @Before
   public void setupTest() throws Exception {
     configureCluster(NODE_COUNT)
-        .addConfig("conf", configset("cloud-minimal"))
+        .addConfig("conf", SolrTestUtil.configset("cloud-minimal"))
         .configure();
 
     // Add proxies
@@ -115,7 +116,7 @@ public class LeaderVoteWaitTimeoutTest extends SolrCloudTestCase {
   }
 
   @Test
-  @Nightly
+  @LuceneTestCase.Nightly
   public void basicTest() throws Exception {
     final String collectionName = "basicTest";
     CollectionAdminRequest.createCollection(collectionName, 1, 1)
@@ -168,7 +169,7 @@ public class LeaderVoteWaitTimeoutTest extends SolrCloudTestCase {
   }
 
   @Test
-  @Nightly
+  @LuceneTestCase.Nightly
   public void testMostInSyncReplicasCanWinElection() throws Exception {
     final String collectionName = "collection1";
     CollectionAdminRequest.createCollection(collectionName, 1, 3)
diff --git a/solr/core/src/test/org/apache/solr/cloud/MetricsHistoryIntegrationTest.java b/solr/core/src/test/org/apache/solr/cloud/MetricsHistoryIntegrationTest.java
index 8c86c56..2e74732 100644
--- a/solr/core/src/test/org/apache/solr/cloud/MetricsHistoryIntegrationTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/MetricsHistoryIntegrationTest.java
@@ -21,9 +21,9 @@ import java.io.ByteArrayInputStream;
 import java.io.IOException;
 import java.lang.invoke.MethodHandles;
 import java.util.List;
-import java.util.concurrent.TimeUnit;
 
 import org.apache.lucene.util.LuceneTestCase;
+import org.apache.solr.SolrTestUtil;
 import org.apache.solr.client.solrj.SolrClient;
 import org.apache.solr.client.solrj.SolrRequest;
 import org.apache.solr.client.solrj.cloud.SolrCloudManager;
@@ -65,7 +65,7 @@ public class MetricsHistoryIntegrationTest extends SolrCloudTestCase {
     System.setProperty("solr.suppressDefaultConfigBootstrap", "false");
 
     configureCluster(1)
-        .addConfig("conf", configset("cloud-minimal"))
+        .addConfig("conf", SolrTestUtil.configset("cloud-minimal"))
         .configure();
     cloudManager = cluster.getJettySolrRunner(0).getCoreContainer().getZkController().getSolrCloudManager();
     solrClient = cluster.getSolrClient();
diff --git a/solr/core/src/test/org/apache/solr/cloud/MetricsHistoryWithAuthIntegrationTest.java b/solr/core/src/test/org/apache/solr/cloud/MetricsHistoryWithAuthIntegrationTest.java
index 7bf1b88..79e1076 100644
--- a/solr/core/src/test/org/apache/solr/cloud/MetricsHistoryWithAuthIntegrationTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/MetricsHistoryWithAuthIntegrationTest.java
@@ -22,6 +22,7 @@ import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicReference;
 
 import org.apache.lucene.util.LuceneTestCase;
+import org.apache.solr.SolrTestUtil;
 import org.apache.solr.client.solrj.SolrClient;
 import org.apache.solr.client.solrj.SolrServerException;
 import org.apache.solr.client.solrj.cloud.SolrCloudManager;
@@ -69,7 +70,7 @@ public class MetricsHistoryWithAuthIntegrationTest extends SolrCloudTestCase {
         "<metrics>\n" + SOLR_XML_HISTORY_CONFIG);
     // Spin up a cluster with a protected /admin/metrics handler, and a 2 seconds metrics collectPeriod
     configureCluster(1)
-        .addConfig("conf", configset("cloud-minimal"))
+        .addConfig("conf", SolrTestUtil.configset("cloud-minimal"))
         .withSecurityJson(SECURITY_JSON)
         .withSolrXml(solrXml)
         .configure();
diff --git a/solr/core/src/test/org/apache/solr/cloud/MigrateRouteKeyTest.java b/solr/core/src/test/org/apache/solr/cloud/MigrateRouteKeyTest.java
index 7065d24..104df73 100644
--- a/solr/core/src/test/org/apache/solr/cloud/MigrateRouteKeyTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/MigrateRouteKeyTest.java
@@ -23,6 +23,7 @@ import java.util.concurrent.TimeUnit;
 
 import org.apache.lucene.util.LuceneTestCase;
 import org.apache.solr.SolrTestCaseJ4;
+import org.apache.solr.SolrTestUtil;
 import org.apache.solr.client.solrj.SolrQuery;
 import org.apache.solr.client.solrj.SolrServerException;
 import org.apache.solr.client.solrj.impl.BaseHttpSolrClient;
@@ -49,7 +50,7 @@ public class MigrateRouteKeyTest extends SolrCloudTestCase {
   @BeforeClass
   public static void setupCluster() throws Exception {
     configureCluster(2)
-        .addConfig("conf", configset("cloud-minimal"))
+        .addConfig("conf", SolrTestUtil.configset("cloud-minimal"))
         .configure();
   }
 
@@ -89,7 +90,7 @@ public class MigrateRouteKeyTest extends SolrCloudTestCase {
     CollectionAdminRequest.createCollection(targetCollection, "conf", 1, 1)
         .process(cluster.getSolrClient());
 
-    BaseHttpSolrClient.RemoteSolrException remoteSolrException = expectThrows(BaseHttpSolrClient.RemoteSolrException.class,
+    BaseHttpSolrClient.RemoteSolrException remoteSolrException = LuceneTestCase.expectThrows(BaseHttpSolrClient.RemoteSolrException.class,
         "Expected an exception in case split.key is not specified", () -> {
           CollectionAdminRequest.migrateData(sourceCollection, targetCollection, "")
               .setForwardTimeout(45)
@@ -99,7 +100,7 @@ public class MigrateRouteKeyTest extends SolrCloudTestCase {
   }
 
   @Test
-  @Nightly
+  @LuceneTestCase.Nightly
   public void multipleShardMigrateTest() throws Exception  {
 
     CollectionAdminRequest.createCollection("sourceCollection", "conf", 2, 1).process(cluster.getSolrClient());
diff --git a/solr/core/src/test/org/apache/solr/cloud/MissingSegmentRecoveryTest.java b/solr/core/src/test/org/apache/solr/cloud/MissingSegmentRecoveryTest.java
index addc405..718c39d 100644
--- a/solr/core/src/test/org/apache/solr/cloud/MissingSegmentRecoveryTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/MissingSegmentRecoveryTest.java
@@ -25,6 +25,7 @@ import java.util.ArrayList;
 import java.util.List;
 
 import org.apache.lucene.util.LuceneTestCase.Slow;
+import org.apache.solr.SolrTestUtil;
 import org.apache.solr.client.solrj.SolrQuery;
 import org.apache.solr.client.solrj.SolrServerException;
 import org.apache.solr.client.solrj.embedded.JettySolrRunner;
@@ -59,7 +60,7 @@ public class MissingSegmentRecoveryTest extends SolrCloudTestCase {
     System.setProperty("solr.skipCommitOnClose", "false");
     useFactory(null);
     configureCluster(2)
-        .addConfig("conf", configset("cloud-minimal"))
+        .addConfig("conf", SolrTestUtil.configset("cloud-minimal"))
         .configure();
   }
 
diff --git a/solr/core/src/test/org/apache/solr/cloud/MoveReplicaHDFSFailoverTest.java b/solr/core/src/test/org/apache/solr/cloud/MoveReplicaHDFSFailoverTest.java
index 8f2f58b..9024f5c 100644
--- a/solr/core/src/test/org/apache/solr/cloud/MoveReplicaHDFSFailoverTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/MoveReplicaHDFSFailoverTest.java
@@ -19,6 +19,7 @@ package org.apache.solr.cloud;
 
 import org.apache.hadoop.hdfs.MiniDFSCluster;
 import org.apache.lucene.util.LuceneTestCase;
+import org.apache.solr.SolrTestUtil;
 import org.apache.solr.client.solrj.SolrClient;
 import org.apache.solr.client.solrj.SolrQuery;
 import org.apache.solr.client.solrj.SolrServerException;
@@ -44,13 +45,13 @@ public class MoveReplicaHDFSFailoverTest extends SolrCloudTestCase {
   @BeforeClass
   public static void setupClass() throws Exception {
     configureCluster(2)
-        .addConfig("conf1", TEST_PATH().resolve("configsets").resolve("cloud-dynamic").resolve("conf"))
+        .addConfig("conf1", SolrTestUtil.TEST_PATH().resolve("configsets").resolve("cloud-dynamic").resolve("conf"))
         .configure();
 
-    dfsCluster = HdfsTestUtil.setupClass(createTempDir().toFile().getAbsolutePath());
+    dfsCluster = HdfsTestUtil.setupClass(SolrTestUtil.createTempDir().toFile().getAbsolutePath());
 
     ZkConfigManager configManager = new ZkConfigManager(zkClient());
-    configManager.uploadConfigDir(configset("cloud-hdfs"), "conf1");
+    configManager.uploadConfigDir(SolrTestUtil.configset("cloud-hdfs"), "conf1");
   }
 
   @AfterClass
diff --git a/solr/core/src/test/org/apache/solr/cloud/MoveReplicaHDFSTest.java b/solr/core/src/test/org/apache/solr/cloud/MoveReplicaHDFSTest.java
index 511a4c6..cc4a821 100644
--- a/solr/core/src/test/org/apache/solr/cloud/MoveReplicaHDFSTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/MoveReplicaHDFSTest.java
@@ -22,6 +22,7 @@ import org.apache.lucene.util.LuceneTestCase;
 import org.apache.lucene.util.LuceneTestCase.AwaitsFix;
 import org.apache.lucene.util.LuceneTestCase.Slow;
 import org.apache.lucene.util.TimeUnits;
+import org.apache.solr.SolrTestUtil;
 import org.apache.solr.cloud.hdfs.HdfsTestUtil;
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
@@ -36,7 +37,7 @@ public class MoveReplicaHDFSTest extends MoveReplicaTest {
 
   @BeforeClass
   public static void setupClass() throws Exception {
-    dfsCluster = HdfsTestUtil.setupClass(createTempDir().toFile().getAbsolutePath());
+    dfsCluster = HdfsTestUtil.setupClass(SolrTestUtil.createTempDir().toFile().getAbsolutePath());
   }
 
   @AfterClass
@@ -66,7 +67,7 @@ public class MoveReplicaHDFSTest extends MoveReplicaTest {
   // commented 4-Sep-2018 @BadApple(bugUrl="https://issues.apache.org/jira/browse/SOLR-12028") // added 23-Aug-2018
   //commented 20-Sep-2018 @BadApple(bugUrl="https://issues.apache.org/jira/browse/SOLR-12028") // 6-Sep-2018
   //Commented 14-Oct-2018 @BadApple(bugUrl="https://issues.apache.org/jira/browse/SOLR-12028") // added 20-Sep-2018
-  @BadApple(bugUrl="https://issues.apache.org/jira/browse/SOLR-12028") // 14-Oct-2018
+  @LuceneTestCase.BadApple(bugUrl="https://issues.apache.org/jira/browse/SOLR-12028") // 14-Oct-2018
   public void testNormalFailedMove() throws Exception {
     inPlaceMove = false;
     testFailedMove();
diff --git a/solr/core/src/test/org/apache/solr/cloud/MoveReplicaTest.java b/solr/core/src/test/org/apache/solr/cloud/MoveReplicaTest.java
index 4362e75..24ae3d3 100644
--- a/solr/core/src/test/org/apache/solr/cloud/MoveReplicaTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/MoveReplicaTest.java
@@ -19,6 +19,7 @@ package org.apache.solr.cloud;
 
 import org.apache.lucene.util.LuceneTestCase;
 import org.apache.solr.SolrTestCaseJ4;
+import org.apache.solr.SolrTestUtil;
 import org.apache.solr.client.solrj.SolrClient;
 import org.apache.solr.client.solrj.SolrQuery;
 import org.apache.solr.client.solrj.SolrServerException;
@@ -54,7 +55,7 @@ public class MoveReplicaTest extends SolrCloudTestCase {
   private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
 
   // used by MoveReplicaHDFSTest
-  protected boolean inPlaceMove = true;
+  protected boolean inPlaceMove = false;
 
   protected String getConfigSet() {
     return "cloud-dynamic";
@@ -67,12 +68,12 @@ public class MoveReplicaTest extends SolrCloudTestCase {
 
   @Before
   public void beforeTest() throws Exception {
-    inPlaceMove = true;
+    inPlaceMove = false;
 
     configureCluster(4)
-        .addConfig("conf1", configset(getConfigSet()))
-        .addConfig("conf2", configset(getConfigSet()))
-        .withSolrXml(TEST_PATH().resolve("solr.xml"))
+        .addConfig("conf1", SolrTestUtil.configset(getConfigSet()))
+        .addConfig("conf2", SolrTestUtil.configset(getConfigSet()))
+        .withSolrXml(SolrTestUtil.TEST_PATH().resolve("solr.xml"))
         .configure();
 
     NamedList<Object> overSeerStatus = cluster.getSolrClient().request(CollectionAdminRequest.getOverseerStatus());
@@ -101,7 +102,7 @@ public class MoveReplicaTest extends SolrCloudTestCase {
   @Test
   // commented out on: 17-Feb-2019   @BadApple(bugUrl="https://issues.apache.org/jira/browse/SOLR-12028") // annotated on: 24-Dec-2018
   public void test() throws Exception {
-    String coll = getTestClass().getSimpleName() + "_coll_" + inPlaceMove;
+    String coll = SolrTestUtil.getTestName() + "_coll_" + inPlaceMove;
     if (log.isInfoEnabled()) {
       log.info("total_jettys: {}", cluster.getJettySolrRunners().size());
     }
@@ -181,9 +182,9 @@ public class MoveReplicaTest extends SolrCloudTestCase {
   // 12-Jun-2018 @BadApple(bugUrl="https://issues.apache.org/jira/browse/SOLR-12028") // 17-Mar-2018 This JIRA is fixed, but this test still fails
   //17-Aug-2018 commented  @LuceneTestCase.BadApple(bugUrl="https://issues.apache.org/jira/browse/SOLR-12028") // 2-Aug-2018
   // commented out on: 17-Feb-2019   @BadApple(bugUrl="https://issues.apache.org/jira/browse/SOLR-12028") // annotated on: 24-Dec-2018
-  @Nightly // may be flakey as well ...
+  @LuceneTestCase.Nightly // may be flakey as well ...
   public void testFailedMove() throws Exception {
-    String coll = getTestClass().getSimpleName() + "_failed_coll_" + inPlaceMove;
+    String coll = LuceneTestCase.getTestClass().getSimpleName() + "_failed_coll_" + inPlaceMove;
     int REPLICATION = 2;
 
     CloudHttp2SolrClient cloudClient = cluster.getSolrClient();
diff --git a/solr/core/src/test/org/apache/solr/cloud/NestedShardedAtomicUpdateTest.java b/solr/core/src/test/org/apache/solr/cloud/NestedShardedAtomicUpdateTest.java
index 1ca2ad4..0994a7b 100644
--- a/solr/core/src/test/org/apache/solr/cloud/NestedShardedAtomicUpdateTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/NestedShardedAtomicUpdateTest.java
@@ -22,6 +22,7 @@ import java.lang.invoke.MethodHandles;
 import java.util.List;
 
 import org.apache.solr.SolrTestCaseJ4;
+import org.apache.solr.SolrTestCaseUtil;
 import org.apache.solr.client.solrj.SolrClient;
 import org.apache.solr.client.solrj.SolrServerException;
 import org.apache.solr.client.solrj.response.QueryResponse;
@@ -202,10 +203,7 @@ public class NestedShardedAtomicUpdateTest extends SolrCloudBridgeTestCase {
         )
     );
 
-    SolrException e = expectThrows(SolrException.class,
-        "wrong \"_route_\" param should throw an exception",
-        () -> indexDocAndRandomlyCommit(aClient, wrongRootParams, grandChildDoc)
-    );
+    SolrException e = SolrTestCaseUtil.expectThrows(SolrException.class, "wrong \"_route_\" param should throw an exception", () -> indexDocAndRandomlyCommit(aClient, wrongRootParams, grandChildDoc));
 
     assertTrue("message should suggest the wrong \"_route_\" param was supplied",
         e.getMessage().contains("perhaps the wrong \"_route_\" param was supplied"));
diff --git a/solr/core/src/test/org/apache/solr/cloud/OutOfBoxZkACLAndCredentialsProvidersTest.java b/solr/core/src/test/org/apache/solr/cloud/OutOfBoxZkACLAndCredentialsProvidersTest.java
index 4011f17..e15fa58 100644
--- a/solr/core/src/test/org/apache/solr/cloud/OutOfBoxZkACLAndCredentialsProvidersTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/OutOfBoxZkACLAndCredentialsProvidersTest.java
@@ -23,6 +23,7 @@ import java.util.ArrayList;
 import java.util.List;
 
 import org.apache.solr.SolrTestCaseJ4;
+import org.apache.solr.SolrTestUtil;
 import org.apache.solr.common.cloud.SecurityAwareZkACLProvider;
 import org.apache.solr.common.cloud.SolrZkClient;
 import org.apache.zookeeper.CreateMode;
@@ -31,7 +32,6 @@ import org.apache.zookeeper.data.ACL;
 import org.apache.zookeeper.data.Stat;
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
-import org.junit.Ignore;
 import org.junit.Test;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -64,11 +64,11 @@ public class OutOfBoxZkACLAndCredentialsProvidersTest extends SolrTestCaseJ4 {
   public void setUp() throws Exception {
     super.setUp();
     if (log.isInfoEnabled()) {
-      log.info("####SETUP_START {}", getTestName());
+      log.info("####SETUP_START {}", SolrTestUtil.getTestName());
     }
-    createTempDir();
+    SolrTestUtil.createTempDir();
 
-    zkDir = createTempDir().resolve("zookeeper/server1/data");
+    zkDir = SolrTestUtil.createTempDir().resolve("zookeeper/server1/data");
     log.info("ZooKeeper dataDir:{}", zkDir);
     zkServer = new ZkTestServer(zkDir);
     zkServer.run();
@@ -90,7 +90,7 @@ public class OutOfBoxZkACLAndCredentialsProvidersTest extends SolrTestCaseJ4 {
     zkClient.close();
 
     if (log.isInfoEnabled()) {
-      log.info("####SETUP_END {}", getTestName());
+      log.info("####SETUP_END {}", SolrTestUtil.getTestName());
     }
   }
 
diff --git a/solr/core/src/test/org/apache/solr/cloud/OverriddenZkACLAndCredentialsProvidersTest.java b/solr/core/src/test/org/apache/solr/cloud/OverriddenZkACLAndCredentialsProvidersTest.java
index ee8a39f..db24893 100644
--- a/solr/core/src/test/org/apache/solr/cloud/OverriddenZkACLAndCredentialsProvidersTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/OverriddenZkACLAndCredentialsProvidersTest.java
@@ -17,6 +17,7 @@
 package org.apache.solr.cloud;
 
 import org.apache.solr.SolrTestCaseJ4;
+import org.apache.solr.SolrTestUtil;
 import org.apache.solr.common.StringUtils;
 import org.apache.solr.common.cloud.DefaultZkCredentialsProvider;
 import org.apache.solr.common.cloud.SecurityAwareZkACLProvider;
@@ -67,11 +68,11 @@ public class OverriddenZkACLAndCredentialsProvidersTest extends SolrTestCaseJ4 {
   public void setUp() throws Exception {
     super.setUp();
     if (log.isInfoEnabled()) {
-      log.info("####SETUP_START {}", getTestName());
+      log.info("####SETUP_START {}", SolrTestUtil.getTestName());
     }
-    createTempDir();
+    SolrTestUtil.createTempDir();
     
-    zkDir =createTempDir().resolve("zookeeper/server1/data");
+    zkDir = SolrTestUtil.createTempDir().resolve("zookeeper/server1/data");
     log.info("ZooKeeper dataDir:{}", zkDir);
     zkServer = new ZkTestServer(zkDir);
     zkServer.run(false);
@@ -98,7 +99,7 @@ public class OverriddenZkACLAndCredentialsProvidersTest extends SolrTestCaseJ4 {
     zkClient.close();
 
     if (log.isInfoEnabled()) {
-      log.info("####SETUP_END {}", getTestName());
+      log.info("####SETUP_END {}", SolrTestUtil.getTestName());
     }
   }
   
diff --git a/solr/core/src/test/org/apache/solr/cloud/OverseerModifyCollectionTest.java b/solr/core/src/test/org/apache/solr/cloud/OverseerModifyCollectionTest.java
index 8de68c1..4c7fd13 100644
--- a/solr/core/src/test/org/apache/solr/cloud/OverseerModifyCollectionTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/OverseerModifyCollectionTest.java
@@ -19,6 +19,8 @@ package org.apache.solr.cloud;
 
 import java.util.Map;
 
+import org.apache.solr.SolrTestCaseUtil;
+import org.apache.solr.SolrTestUtil;
 import org.apache.solr.client.solrj.request.CollectionAdminRequest;
 import org.apache.solr.client.solrj.request.GenericSolrRequest;
 import org.apache.solr.common.cloud.ZkStateReader;
@@ -26,7 +28,6 @@ import org.apache.solr.common.params.ModifiableSolrParams;
 import org.apache.solr.common.util.Utils;
 import org.apache.zookeeper.KeeperException;
 import org.junit.BeforeClass;
-import org.junit.Ignore;
 import org.junit.Test;
 
 import static org.apache.solr.client.solrj.SolrRequest.METHOD.POST;
@@ -37,8 +38,8 @@ public class OverseerModifyCollectionTest extends SolrCloudTestCase {
   @BeforeClass
   public static void setupCluster() throws Exception {
     configureCluster(2)
-        .addConfig("conf1", configset("cloud-minimal"))
-        .addConfig("conf2", configset("cloud-minimal"))
+        .addConfig("conf1", SolrTestUtil.configset("cloud-minimal"))
+        .addConfig("conf2", SolrTestUtil.configset("cloud-minimal"))
         .formatZk(true).configure();
   }
 
@@ -65,7 +66,7 @@ public class OverseerModifyCollectionTest extends SolrCloudTestCase {
     p2.add("collection", collName);
     p2.add("action", "MODIFYCOLLECTION");
     p2.add("collection.configName", "notARealConfigName");
-    Exception e = expectThrows(Exception.class, () -> {
+    Exception e = SolrTestCaseUtil.expectThrows(Exception.class, () -> {
       cluster.getSolrClient().request(new GenericSolrRequest(POST, COLLECTIONS_HANDLER_PATH, p2));
     });
 
diff --git a/solr/core/src/test/org/apache/solr/cloud/OverseerRolesTest.java b/solr/core/src/test/org/apache/solr/cloud/OverseerRolesTest.java
index 05a1732..d2bf476 100644
--- a/solr/core/src/test/org/apache/solr/cloud/OverseerRolesTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/OverseerRolesTest.java
@@ -25,6 +25,7 @@ import java.util.concurrent.TimeUnit;
 import java.util.function.Predicate;
 
 import org.apache.lucene.util.LuceneTestCase;
+import org.apache.solr.SolrTestUtil;
 import org.apache.solr.client.solrj.embedded.JettySolrRunner;
 import org.apache.solr.client.solrj.request.CollectionAdminRequest;
 import org.apache.solr.cloud.overseer.OverseerAction;
@@ -50,7 +51,7 @@ public class OverseerRolesTest extends SolrCloudTestCase {
   @Before
   public void setupCluster() throws Exception {
     configureCluster(4)
-        .addConfig("conf", configset("cloud-minimal"))
+        .addConfig("conf", SolrTestUtil.configset("cloud-minimal"))
         .configure();
   }
 
diff --git a/solr/core/src/test/org/apache/solr/cloud/OverseerStatusTest.java b/solr/core/src/test/org/apache/solr/cloud/OverseerStatusTest.java
index 7e56784..b086736 100644
--- a/solr/core/src/test/org/apache/solr/cloud/OverseerStatusTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/OverseerStatusTest.java
@@ -16,6 +16,8 @@
  */
 package org.apache.solr.cloud;
 
+import org.apache.lucene.util.LuceneTestCase;
+import org.apache.solr.SolrTestUtil;
 import org.apache.solr.client.solrj.impl.BaseHttpSolrClient;
 import org.apache.solr.client.solrj.request.CollectionAdminRequest;
 import org.apache.solr.common.params.CollectionParams;
@@ -31,7 +33,7 @@ public class OverseerStatusTest extends SolrCloudTestCase {
   @BeforeClass
   public static void setupCluster() throws Exception {
     configureCluster(2)
-        .addConfig("conf", configset("cloud-minimal"))
+        .addConfig("conf", SolrTestUtil.configset("cloud-minimal"))
         .configure();;
   }
 
@@ -61,7 +63,7 @@ public class OverseerStatusTest extends SolrCloudTestCase {
     SimpleOrderedMap<Object> reload = (SimpleOrderedMap<Object>) collection_operations.get(CollectionParams.CollectionAction.RELOAD.toLower());
     assertEquals("No stats for reload in OverseerCollectionProcessor", 1, reload.get("requests"));
 
-    BaseHttpSolrClient.RemoteSolrException e = expectThrows(BaseHttpSolrClient.RemoteSolrException.class,
+    BaseHttpSolrClient.RemoteSolrException e = LuceneTestCase.expectThrows(BaseHttpSolrClient.RemoteSolrException.class,
         "Split shard for non existent collection should have failed",
         () -> CollectionAdminRequest
             .splitShard("non_existent_collection")
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 5305559..f885669 100644
--- a/solr/core/src/test/org/apache/solr/cloud/OverseerTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/OverseerTest.java
@@ -20,6 +20,7 @@ import com.codahale.metrics.Snapshot;
 import com.codahale.metrics.Timer;
 import org.apache.lucene.util.LuceneTestCase.Slow;
 import org.apache.solr.SolrTestCaseJ4;
+import org.apache.solr.SolrTestUtil;
 import org.apache.solr.client.solrj.SolrClient;
 import org.apache.solr.client.solrj.cloud.SolrCloudManager;
 import org.apache.solr.client.solrj.impl.CloudSolrClient;
@@ -269,7 +270,7 @@ public class OverseerTest extends SolrTestCaseJ4 {
 
     System.setProperty("solr.zkclienttimeout", "30000");
 
-    Path zkDir = createTempDir("zkData");
+    Path zkDir = SolrTestUtil.createTempDir("zkData");
 
     server = new ZkTestServer(zkDir);
     server.run();
@@ -813,7 +814,7 @@ public class OverseerTest extends SolrTestCaseJ4 {
       // Create collection znode before repeatedly trying to enqueue the Cluster state change message
       zkClient.makePath(ZkStateReader.COLLECTIONS_ZKNODE + "/" + COLLECTION, false, true);
 
-      for (int i = 0; i < atLeast(4); i++) {
+      for (int i = 0; i < SolrTestUtil.atLeast(4); i++) {
         killCounter.incrementAndGet(); // for each round allow 1 kill
 
         mockController = new MockZKController(server.getZkAddress(), "node1", overseers);
diff --git a/solr/core/src/test/org/apache/solr/cloud/PackageManagerCLITest.java b/solr/core/src/test/org/apache/solr/cloud/PackageManagerCLITest.java
index 1f724a9..eff41ee 100644
--- a/solr/core/src/test/org/apache/solr/cloud/PackageManagerCLITest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/PackageManagerCLITest.java
@@ -21,6 +21,7 @@ import java.lang.invoke.MethodHandles;
 import java.util.Arrays;
 
 import org.apache.lucene.util.LuceneTestCase;
+import org.apache.solr.SolrTestUtil;
 import org.apache.solr.client.solrj.request.CollectionAdminRequest;
 import org.apache.solr.core.TestSolrConfigHandler;
 import org.apache.solr.util.LogLevel;
@@ -56,11 +57,11 @@ public class PackageManagerCLITest extends SolrCloudTestCase {
     System.setProperty("enable.packages", "true");
 
     configureCluster(1)
-    .addConfig("conf1", TEST_PATH().resolve("configsets").resolve("cloud-minimal").resolve("conf"))
-    .addConfig("conf2", TEST_PATH().resolve("configsets").resolve("cloud-minimal").resolve("conf"))
+    .addConfig("conf1", SolrTestUtil.TEST_PATH().resolve("configsets").resolve("cloud-minimal").resolve("conf"))
+    .addConfig("conf2", SolrTestUtil.TEST_PATH().resolve("configsets").resolve("cloud-minimal").resolve("conf"))
     .configure();
 
-    repositoryServer = new LocalWebServer(TEST_PATH().resolve("question-answer-repository").toString());
+    repositoryServer = new LocalWebServer(SolrTestUtil.TEST_PATH().resolve("question-answer-repository").toString());
     repositoryServer.start();
   }
 
diff --git a/solr/core/src/test/org/apache/solr/cloud/RecoveryZkTest.java b/solr/core/src/test/org/apache/solr/cloud/RecoveryZkTest.java
index 9eba5d2..8af125e 100644
--- a/solr/core/src/test/org/apache/solr/cloud/RecoveryZkTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/RecoveryZkTest.java
@@ -18,6 +18,7 @@ package org.apache.solr.cloud;
 
 import org.apache.lucene.util.LuceneTestCase;
 import org.apache.lucene.util.LuceneTestCase.Slow;
+import org.apache.solr.SolrTestUtil;
 import org.apache.solr.client.solrj.SolrQuery;
 import org.apache.solr.client.solrj.embedded.JettySolrRunner;
 import org.apache.solr.client.solrj.impl.Http2SolrClient;
@@ -60,7 +61,7 @@ public class RecoveryZkTest extends SolrCloudTestCase {
     System.setProperty("solr.httpclient.defaultSoTimeout", "10000");
 
     configureCluster(2).formatZk(true)
-        .addConfig("conf", configset("cloud-minimal"))
+        .addConfig("conf", SolrTestUtil.configset("cloud-minimal"))
         .configure();
   }
 
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 422eb3e..b86f07b 100644
--- a/solr/core/src/test/org/apache/solr/cloud/ReindexCollectionTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/ReindexCollectionTest.java
@@ -28,6 +28,7 @@ import java.util.function.Function;
 
 import org.apache.lucene.util.LuceneTestCase;
 import org.apache.solr.SolrTestCaseJ4;
+import org.apache.solr.SolrTestUtil;
 import org.apache.solr.client.solrj.cloud.DistribStateManager;
 import org.apache.solr.client.solrj.cloud.SolrCloudManager;
 import org.apache.solr.client.solrj.impl.CloudSolrClient;
@@ -66,11 +67,11 @@ public class ReindexCollectionTest extends SolrCloudTestCase {
 
     configureCluster(2)
         // only *_s
-        .addConfig("conf1", configset("cloud-minimal"))
+        .addConfig("conf1", SolrTestUtil.configset("cloud-minimal"))
         // every combination of field flags
-        .addConfig("conf2", configset("cloud-dynamic"))
+        .addConfig("conf2", SolrTestUtil.configset("cloud-dynamic"))
         // catch-all * field, indexed+stored
-        .addConfig("conf3", configset("cloud-minimal-inplace-updates"))
+        .addConfig("conf3", SolrTestUtil.configset("cloud-minimal-inplace-updates"))
         .configure();
   }
 
diff --git a/solr/core/src/test/org/apache/solr/cloud/RemoteQueryErrorTest.java b/solr/core/src/test/org/apache/solr/cloud/RemoteQueryErrorTest.java
index 2581b9b..30dbb8c 100644
--- a/solr/core/src/test/org/apache/solr/cloud/RemoteQueryErrorTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/RemoteQueryErrorTest.java
@@ -16,6 +16,8 @@
  */
 package org.apache.solr.cloud;
 
+import org.apache.solr.SolrTestCaseUtil;
+import org.apache.solr.SolrTestUtil;
 import org.apache.solr.client.solrj.SolrClient;
 import org.apache.solr.client.solrj.embedded.JettySolrRunner;
 import org.apache.solr.client.solrj.request.CollectionAdminRequest;
@@ -34,7 +36,7 @@ public class RemoteQueryErrorTest extends SolrCloudTestCase {
   @BeforeClass
   public static void setupCluster() throws Exception {
     configureCluster(3)
-        .addConfig("conf", configset("cloud-minimal"))
+        .addConfig("conf", SolrTestUtil.configset("cloud-minimal"))
         .formatZk(true).configure();
   }
 
@@ -48,7 +50,7 @@ public class RemoteQueryErrorTest extends SolrCloudTestCase {
 
     for (JettySolrRunner jetty : cluster.getJettySolrRunners()) {
       try (SolrClient client = jetty.newClient()) {
-        SolrException e = expectThrows(SolrException.class, () -> {
+        SolrException e = SolrTestCaseUtil.expectThrows(SolrException.class, () -> {
           client.add("collection", new SolrInputDocument());
         });
         assertThat(e.getMessage(), containsString("Document is missing mandatory uniqueKey field: id"));
diff --git a/solr/core/src/test/org/apache/solr/cloud/ReplaceNodeTest.java b/solr/core/src/test/org/apache/solr/cloud/ReplaceNodeTest.java
index 62e6e8e..d14c0ca 100644
--- a/solr/core/src/test/org/apache/solr/cloud/ReplaceNodeTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/ReplaceNodeTest.java
@@ -18,6 +18,8 @@
 package org.apache.solr.cloud;
 
 import org.apache.lucene.util.LuceneTestCase;
+import org.apache.solr.SolrTestCaseUtil;
+import org.apache.solr.SolrTestUtil;
 import org.apache.solr.client.solrj.impl.CloudHttp2SolrClient;
 import org.apache.solr.client.solrj.impl.Http2SolrClient;
 import org.apache.solr.client.solrj.request.CollectionAdminRequest;
@@ -51,7 +53,7 @@ public class ReplaceNodeTest extends SolrCloudTestCase {
   public static void setupCluster() throws Exception {
     useFactory(null);
     configureCluster(6)
-        .addConfig("conf1", TEST_PATH().resolve("configsets").resolve("cloud-dynamic").resolve("conf"))
+        .addConfig("conf1", SolrTestUtil.TEST_PATH().resolve("configsets").resolve("cloud-dynamic").resolve("conf"))
         .configure();
   }
 
@@ -77,15 +79,14 @@ public class ReplaceNodeTest extends SolrCloudTestCase {
     // have to worry about null checking when comparing the Create command with the final Slices
     
     // TODO: tlog replicas do not work correctly in tests due to fault TestInjection#waitForInSyncWithLeader
-    create = pickRandom(
-                        CollectionAdminRequest.createCollection(coll, "conf1", 5, 2,0,0),
-                        //CollectionAdminRequest.createCollection(coll, "conf1", 5, 1,1,0),
-                        //CollectionAdminRequest.createCollection(coll, "conf1", 5, 0,1,1),
-                        //CollectionAdminRequest.createCollection(coll, "conf1", 5, 1,0,1),
-                        //CollectionAdminRequest.createCollection(coll, "conf1", 5, 0,2,0),
-                        // check also replicationFactor 1
-                        CollectionAdminRequest.createCollection(coll, "conf1", 5, 1,0,0)
-                        //CollectionAdminRequest.createCollection(coll, "conf1", 5, 0,1,0)
+    create = SolrTestCaseUtil.pickRandom(CollectionAdminRequest.createCollection(coll, "conf1", 5, 2, 0, 0),
+        //CollectionAdminRequest.createCollection(coll, "conf1", 5, 1,1,0),
+        //CollectionAdminRequest.createCollection(coll, "conf1", 5, 0,1,1),
+        //CollectionAdminRequest.createCollection(coll, "conf1", 5, 1,0,1),
+        //CollectionAdminRequest.createCollection(coll, "conf1", 5, 0,2,0),
+        // check also replicationFactor 1
+        CollectionAdminRequest.createCollection(coll, "conf1", 5, 1, 0, 0)
+        //CollectionAdminRequest.createCollection(coll, "conf1", 5, 0,1,0)
     );
     create.setCreateNodeSet(StrUtils.join(l, ',')).setMaxShardsPerNode(100);
     create.processAndWait(cloudClient, 2000);
diff --git a/solr/core/src/test/org/apache/solr/cloud/ReplicationFactorTest.java b/solr/core/src/test/org/apache/solr/cloud/ReplicationFactorTest.java
index 5aecdc6..266bc1a 100644
--- a/solr/core/src/test/org/apache/solr/cloud/ReplicationFactorTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/ReplicationFactorTest.java
@@ -502,7 +502,7 @@ public class ReplicationFactorTest extends AbstractFullDistribZkTestBase {
 
   private boolean maybeAddMinRfExplicitly(int minRf, UpdateRequest up) {
     boolean minRfExplicit = false;
-    if (rarely()) {
+    if (LuceneTestCase.rarely()) {
       // test back compat behavior. Remove in Solr 9
       up.setParam(UpdateRequest.MIN_REPFACT, String.valueOf(minRf));
       minRfExplicit = true;
diff --git a/solr/core/src/test/org/apache/solr/cloud/SaslZkACLProviderTest.java b/solr/core/src/test/org/apache/solr/cloud/SaslZkACLProviderTest.java
index da6799f..0f964a9 100644
--- a/solr/core/src/test/org/apache/solr/cloud/SaslZkACLProviderTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/SaslZkACLProviderTest.java
@@ -23,7 +23,9 @@ import java.nio.charset.Charset;
 import java.nio.file.Path;
 
 import org.apache.lucene.util.Constants;
+import org.apache.lucene.util.LuceneTestCase;
 import org.apache.solr.SolrTestCaseJ4;
+import org.apache.solr.SolrTestUtil;
 import org.apache.solr.common.cloud.DefaultZkACLProvider;
 import org.apache.solr.common.cloud.SaslZkACLProvider;
 import org.apache.solr.common.cloud.SecurityAwareZkACLProvider;
@@ -46,9 +48,9 @@ public class SaslZkACLProviderTest extends SolrTestCaseJ4 {
 
   @BeforeClass
   public static void beforeClass() {
-    assumeFalse("FIXME: This test fails on Java 9 (https://issues.apache.org/jira/browse/SOLR-8052)", Constants.JRE_IS_MINIMUM_JAVA9);
-    
-    assumeFalse("FIXME: SOLR-7040: This test fails under IBM J9",
+    LuceneTestCase.assumeFalse("FIXME: This test fails on Java 9 (https://issues.apache.org/jira/browse/SOLR-8052)", Constants.JRE_IS_MINIMUM_JAVA9);
+
+    LuceneTestCase.assumeFalse("FIXME: SOLR-7040: This test fails under IBM J9",
                 Constants.JAVA_VENDOR.startsWith("IBM"));
     System.setProperty("solrcloud.skip.autorecovery", "true");
     System.setProperty("hostName", "localhost");
@@ -64,13 +66,13 @@ public class SaslZkACLProviderTest extends SolrTestCaseJ4 {
   public void setUp() throws Exception {
     super.setUp();
     if (log.isInfoEnabled()) {
-      log.info("####SETUP_START {}", getTestName());
+      log.info("####SETUP_START {}", SolrTestUtil.getTestName());
     }
-    createTempDir();
+    SolrTestUtil.createTempDir();
 
-    Path zkDir = createTempDir().resolve("zookeeper/server1/data");
+    Path zkDir = SolrTestUtil.createTempDir().resolve("zookeeper/server1/data");
     log.info("ZooKeeper dataDir:{}", zkDir);
-    zkServer = new SaslZkTestServer(zkDir, createTempDir().resolve("miniKdc"));
+    zkServer = new SaslZkTestServer(zkDir, SolrTestUtil.createTempDir().resolve("miniKdc"));
     zkServer.run();
 
     System.setProperty("zkHost", zkServer.getZkAddress());
@@ -81,7 +83,7 @@ public class SaslZkACLProviderTest extends SolrTestCaseJ4 {
     setupZNodes();
 
     if (log.isInfoEnabled()) {
-      log.info("####SETUP_END {}", getTestName());
+      log.info("####SETUP_END {}", SolrTestUtil.getTestName());
     }
   }
 
@@ -112,7 +114,7 @@ public class SaslZkACLProviderTest extends SolrTestCaseJ4 {
   }
 
   @Test
-  @AwaitsFix(bugUrl = "https://issues.apache.org/jira/browse/SOLR-13075")
+  @LuceneTestCase.AwaitsFix(bugUrl = "https://issues.apache.org/jira/browse/SOLR-13075")
   public void testSaslZkACLProvider() throws Exception {
     // Test with Sasl enabled
     SolrZkClient zkClient = new SolrZkClientWithACLs(zkServer.getZkAddress(), AbstractZkTestCase.TIMEOUT);
diff --git a/solr/core/src/test/org/apache/solr/cloud/SharedFSAutoReplicaFailoverTest.java b/solr/core/src/test/org/apache/solr/cloud/SharedFSAutoReplicaFailoverTest.java
index 20aca5b..bcaa16c 100644
--- a/solr/core/src/test/org/apache/solr/cloud/SharedFSAutoReplicaFailoverTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/SharedFSAutoReplicaFailoverTest.java
@@ -20,6 +20,7 @@ import org.apache.hadoop.hdfs.MiniDFSCluster;
 import org.apache.lucene.util.LuceneTestCase;
 import org.apache.lucene.util.LuceneTestCase.Slow;
 import org.apache.solr.SolrTestCase;
+import org.apache.solr.SolrTestUtil;
 import org.apache.solr.client.solrj.SolrQuery;
 import org.apache.solr.client.solrj.SolrServerException;
 import org.apache.solr.client.solrj.embedded.JettySolrRunner;
@@ -81,7 +82,7 @@ public class SharedFSAutoReplicaFailoverTest extends AbstractFullDistribZkTestBa
   @BeforeClass
   public static void hdfsFailoverBeforeClass() throws Exception {
     System.setProperty("solr.hdfs.blockcache.blocksperbank", "512");
-    dfsCluster = HdfsTestUtil.setupClass(createTempDir().toFile().getAbsolutePath());
+    dfsCluster = HdfsTestUtil.setupClass(SolrTestUtil.createTempDir().toFile().getAbsolutePath());
     System.setProperty("solr.hdfs.blockcache.global", "true"); // always use global cache, this test can create a lot of directories
     schemaString = "schema15.xml"; 
   }
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 d44eed8..e0fa6fd 100644
--- a/solr/core/src/test/org/apache/solr/cloud/SolrCLIZkUtilsTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/SolrCLIZkUtilsTest.java
@@ -33,6 +33,7 @@ import java.util.ArrayList;
 import java.util.List;
 
 import org.apache.lucene.util.LuceneTestCase;
+import org.apache.solr.SolrTestUtil;
 import org.apache.solr.common.cloud.SolrZkClient;
 import org.apache.solr.common.cloud.ZkMaintenanceUtils;
 import org.apache.solr.util.SolrCLI;
@@ -50,7 +51,7 @@ public class SolrCLIZkUtilsTest extends SolrCloudTestCase {
   public static void setupCluster() throws Exception {
     useFactory(null);
     configureCluster(1)
-        .addConfig("conf1", TEST_PATH().resolve("configsets").resolve("cloud-minimal").resolve("conf"))
+        .addConfig("conf1", SolrTestUtil.TEST_PATH().resolve("configsets").resolve("cloud-minimal").resolve("conf"))
         .formatZk(true).configure();
     zkAddr = cluster.getZkServer().getZkAddress();
     zkClient = cluster.getZkClient();
@@ -68,14 +69,14 @@ public class SolrCLIZkUtilsTest extends SolrCloudTestCase {
   public void testUpconfig() throws Exception {
     // Use a full, explicit path for configset.
 
-    Path configSet = TEST_PATH().resolve("configsets");
+    Path configSet = SolrTestUtil.TEST_PATH().resolve("configsets");
     Path srcPathCheck = configSet.resolve("cloud-subdirs").resolve("conf");
     AbstractDistribZkTestBase.copyConfigUp(configSet, "cloud-subdirs", "upconfig1", zkAddr);
     // Now do we have that config up on ZK?
     verifyZkLocalPathsMatch(srcPathCheck, "/configs/upconfig1");
 
     // Now just use a name in the configsets directory, do we find it?
-    configSet = TEST_PATH().resolve("configsets");
+    configSet = SolrTestUtil.TEST_PATH().resolve("configsets");
 
     String[] args = new String[]{
         "-confname", "upconfig2",
@@ -109,11 +110,11 @@ public class SolrCLIZkUtilsTest extends SolrCloudTestCase {
 
   @Test
   public void testDownconfig() throws Exception {
-    Path tmp = Paths.get(createTempDir("downConfigNewPlace").toAbsolutePath().toString(), "myconfset");
+    Path tmp = Paths.get(SolrTestUtil.createTempDir("downConfigNewPlace").toAbsolutePath().toString(), "myconfset");
 
     // First we need a configset on ZK to bring down. 
     
-    Path configSet = TEST_PATH().resolve("configsets");
+    Path configSet = SolrTestUtil.TEST_PATH().resolve("configsets");
     Path srcPathCheck = configSet.resolve("cloud-subdirs").resolve("conf");
     AbstractDistribZkTestBase.copyConfigUp(configSet, "cloud-subdirs", "downconfig1", zkAddr);
     // Now do we have that config up on ZK?
@@ -137,7 +138,7 @@ public class SolrCLIZkUtilsTest extends SolrCloudTestCase {
 
     // Now copy it up and back and insure it's still a file in the new place
     AbstractDistribZkTestBase.copyConfigUp(tmp.getParent(), "myconfset", "downconfig2", zkAddr);
-    Path tmp2 = createTempDir("downConfigNewPlace2");
+    Path tmp2 = SolrTestUtil.createTempDir("downConfigNewPlace2");
     downTool = new SolrCLI.ConfigSetDownloadTool();
     args = new String[]{
         "-confname", "downconfig2",
@@ -159,7 +160,7 @@ public class SolrCLIZkUtilsTest extends SolrCloudTestCase {
   public void testCp() throws Exception {
     // First get something up on ZK
 
-    Path configSet = TEST_PATH().resolve("configsets");
+    Path configSet = SolrTestUtil.TEST_PATH().resolve("configsets");
     Path srcPathCheck = configSet.resolve("cloud-subdirs").resolve("conf");
 
     AbstractDistribZkTestBase.copyConfigUp(configSet, "cloud-subdirs", "cp1", zkAddr);
@@ -180,7 +181,7 @@ public class SolrCLIZkUtilsTest extends SolrCloudTestCase {
 
 
     // try with zk->local
-    Path tmp = createTempDir("tmpNewPlace2");
+    Path tmp = SolrTestUtil.createTempDir("tmpNewPlace2");
     args = new String[]{
         "-src", "zk:/configs/cp1",
         "-dst", "file:" + tmp.toAbsolutePath().toString(),
@@ -194,7 +195,7 @@ public class SolrCLIZkUtilsTest extends SolrCloudTestCase {
 
 
     // try with zk->local  no file: prefix
-    tmp = createTempDir("tmpNewPlace3");
+    tmp = SolrTestUtil.createTempDir("tmpNewPlace3");
     args = new String[]{
         "-src", "zk:/configs/cp1",
         "-dst", tmp.toAbsolutePath().toString(),
@@ -348,7 +349,7 @@ public class SolrCLIZkUtilsTest extends SolrCloudTestCase {
     verifyZkLocalPathsMatch(srcPathCheck, "/cp7/" + srcPathCheck.getFileName().toString());
 
     // Check for an intermediate ZNODE having content. You know cp7/stopwords is a parent node.
-    tmp = createTempDir("dirdata");
+    tmp = SolrTestUtil.createTempDir("dirdata");
     Path file = Paths.get(tmp.toAbsolutePath().toString(), "zknode.data");
     List<String> lines = new ArrayList<>();
     lines.add("{Some Arbitrary Data}");
@@ -371,7 +372,7 @@ public class SolrCLIZkUtilsTest extends SolrCloudTestCase {
     res = cpTool.runTool(SolrCLI.processCommandLineArgs(SolrCLI.joinCommonAndToolOptions(cpTool.getOptions()), args));
     assertEquals("Copy should have succeeded.", 0, res);
 
-    tmp = createTempDir("cp8");
+    tmp = SolrTestUtil.createTempDir("cp8");
     args = new String[]{
         "-src", "zk:/cp7",
         "-dst", "file:" + tmp.toAbsolutePath().toString(),
@@ -413,7 +414,7 @@ public class SolrCLIZkUtilsTest extends SolrCloudTestCase {
     res = cpTool.runTool(SolrCLI.processCommandLineArgs(SolrCLI.joinCommonAndToolOptions(cpTool.getOptions()), args));
     assertEquals("Copy should have succeeded.", 0, res);
 
-    Path tmp2 = createTempDir("cp9");
+    Path tmp2 = SolrTestUtil.createTempDir("cp9");
     Path emptyDest = Paths.get(tmp2.toAbsolutePath().toString(), "emptyfile");
     args = new String[]{
         "-src", "zk:/cp7/conf/stopwords/emptyfile",
@@ -439,7 +440,7 @@ public class SolrCLIZkUtilsTest extends SolrCloudTestCase {
     assertEquals("Copy should have succeeded.", 0, res);
 
     // Now copy it all back and make sure empty file is still a file when recursively copying.
-    tmp2 = createTempDir("cp10");
+    tmp2 = SolrTestUtil.createTempDir("cp10");
     args = new String[]{
         "-src", "zk:/cp10",
         "-dst", "file:" + tmp2.toAbsolutePath().toString(),
@@ -458,7 +459,7 @@ public class SolrCLIZkUtilsTest extends SolrCloudTestCase {
 
     // First get something up on ZK
 
-    Path configSet = TEST_PATH().resolve("configsets");
+    Path configSet = SolrTestUtil.TEST_PATH().resolve("configsets");
     Path srcPathCheck = configSet.resolve("cloud-subdirs").resolve("conf");
 
     AbstractDistribZkTestBase.copyConfigUp(configSet, "cloud-subdirs", "mv1", zkAddr);
@@ -536,7 +537,7 @@ public class SolrCLIZkUtilsTest extends SolrCloudTestCase {
   @Test
   public void testLs() throws Exception {
 
-    Path configSet = TEST_PATH().resolve("configsets");
+    Path configSet = SolrTestUtil.TEST_PATH().resolve("configsets");
 
     AbstractDistribZkTestBase.copyConfigUp(configSet, "cloud-subdirs", "lister", zkAddr);
 
@@ -634,7 +635,7 @@ public class SolrCLIZkUtilsTest extends SolrCloudTestCase {
   @Test
   public void testRm() throws Exception {
     
-    Path configSet = TEST_PATH().resolve("configsets");
+    Path configSet = SolrTestUtil.TEST_PATH().resolve("configsets");
     Path srcPathCheck = configSet.resolve("cloud-subdirs").resolve("conf");
 
     AbstractDistribZkTestBase.copyConfigUp(configSet, "cloud-subdirs", "rm1", zkAddr);
diff --git a/solr/core/src/test/org/apache/solr/cloud/SolrCloudBridgeTestCase.java b/solr/core/src/test/org/apache/solr/cloud/SolrCloudBridgeTestCase.java
index 566e6c9..5e3c9aa 100644
--- a/solr/core/src/test/org/apache/solr/cloud/SolrCloudBridgeTestCase.java
+++ b/solr/core/src/test/org/apache/solr/cloud/SolrCloudBridgeTestCase.java
@@ -42,6 +42,7 @@ import java.util.regex.Pattern;
 
 import org.apache.commons.io.FileUtils;
 import org.apache.solr.SolrTestCaseJ4;
+import org.apache.solr.SolrTestUtil;
 import org.apache.solr.client.solrj.SolrClient;
 import org.apache.solr.client.solrj.SolrServerException;
 import org.apache.solr.client.solrj.embedded.JettySolrRunner;
@@ -140,7 +141,7 @@ public abstract class SolrCloudBridgeTestCase extends SolrCloudTestCase {
 
   final Pattern filenameExclusions = Pattern.compile(".*solrconfig(?:-|_).*?\\.xml|.*schema(?:-|_).*?\\.xml");
   
-  public static Path TEST_PATH() { return SolrTestCaseJ4.getFile("solr/collection1").getParentFile().toPath(); }
+  public static Path TEST_PATH() { return SolrTestUtil.getFile("solr/collection1").getParentFile().toPath(); }
   
   @Before
   public void beforeSolrCloudBridgeTestCase() throws Exception {
@@ -156,7 +157,7 @@ public abstract class SolrCloudBridgeTestCase extends SolrCloudTestCase {
     SolrZkClient zkClient = cluster.getSolrClient().getZkStateReader().getZkClient();
 
     if (!zkClient.exists("/configs/_default")) {
-      zkClient.uploadToZK(Paths.get(TEST_HOME()).resolve("collection1").resolve("conf"), "/configs" + "/" + "_default", filenameExclusions);
+      zkClient.uploadToZK(Paths.get(SolrTestUtil.TEST_HOME()).resolve("collection1").resolve("conf"), "/configs" + "/" + "_default", filenameExclusions);
     }
     
     if (schemaString != null) {
diff --git a/solr/core/src/test/org/apache/solr/cloud/SolrXmlInZkTest.java b/solr/core/src/test/org/apache/solr/cloud/SolrXmlInZkTest.java
index e9fb938..2e530a5 100644
--- a/solr/core/src/test/org/apache/solr/cloud/SolrXmlInZkTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/SolrXmlInZkTest.java
@@ -25,6 +25,8 @@ import java.util.Properties;
 import org.apache.commons.io.FileUtils;
 import org.apache.lucene.util.LuceneTestCase;
 import org.apache.solr.SolrTestCaseJ4;
+import org.apache.solr.SolrTestCaseUtil;
+import org.apache.solr.SolrTestUtil;
 import org.apache.solr.common.SolrException;
 import org.apache.solr.common.cloud.SolrZkClient;
 import org.apache.solr.common.cloud.ZkStateReader;
@@ -50,11 +52,11 @@ public class SolrXmlInZkTest extends SolrTestCaseJ4 {
   private NodeConfig cfg;
 
   private void setUpZkAndDiskXml(boolean toZk, boolean leaveOnLocal) throws Exception {
-    Path tmpDir = createTempDir();
+    Path tmpDir = SolrTestUtil.createTempDir();
     Path solrHome = tmpDir.resolve("home");
     copyMinConf(new File(solrHome.toFile(), "myCollect"));
     if (leaveOnLocal) {
-      FileUtils.copyFile(new File(SolrTestCaseJ4.TEST_HOME(), "solr-stress-new.xml"), new File(solrHome.toFile(), "solr.xml"));
+      FileUtils.copyFile(new File(SolrTestUtil.TEST_HOME(), "solr-stress-new.xml"), new File(solrHome.toFile(), "solr.xml"));
     }
 
     ignoreException("No UpdateLog found - cannot sync");
@@ -75,7 +77,7 @@ public class SolrXmlInZkTest extends SolrTestCaseJ4 {
     }
 
     if (log.isInfoEnabled()) {
-      log.info("####SETUP_START {}", getTestName());
+      log.info("####SETUP_START {}", SolrTestUtil.getTestName());
     }
 
     // set some system properties for use by tests
@@ -85,7 +87,7 @@ public class SolrXmlInZkTest extends SolrTestCaseJ4 {
 
     cfg = SolrDispatchFilter.loadNodeConfig(zkClient, solrHome, props);
     if (log.isInfoEnabled()) {
-      log.info("####SETUP_END {}", getTestName());
+      log.info("####SETUP_END {}", SolrTestUtil.getTestName());
     }
   }
 
@@ -136,7 +138,7 @@ public class SolrXmlInZkTest extends SolrTestCaseJ4 {
   @Test
   public void testNotInZkOrOnDisk() throws Exception {
     try {
-      SolrException e = expectThrows(SolrException.class, () -> {
+      SolrException e = SolrTestCaseUtil.expectThrows(SolrException.class, () -> {
         System.setProperty("hostPort", "8787");
         setUpZkAndDiskXml(false, false); // solr.xml not on disk either
       });
diff --git a/solr/core/src/test/org/apache/solr/cloud/SplitShardTest.java b/solr/core/src/test/org/apache/solr/cloud/SplitShardTest.java
index 3600b07..a5fb602 100644
--- a/solr/core/src/test/org/apache/solr/cloud/SplitShardTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/SplitShardTest.java
@@ -31,6 +31,7 @@ import java.util.concurrent.atomic.AtomicBoolean;
 import java.util.concurrent.atomic.AtomicInteger;
 
 import org.apache.solr.SolrTestCaseJ4;
+import org.apache.solr.SolrTestUtil;
 import org.apache.solr.client.solrj.SolrClient;
 import org.apache.solr.client.solrj.SolrQuery;
 import org.apache.solr.client.solrj.SolrServerException;
@@ -63,7 +64,7 @@ public class SplitShardTest extends SolrCloudTestCase {
   public static void setupCluster() throws Exception {
     System.setProperty("solr.enableMetrics", "true");
     configureCluster(1)
-        .addConfig("conf", configset("cloud-minimal"))
+        .addConfig("conf", SolrTestUtil.configset("cloud-minimal"))
         .configure();
   }
 
diff --git a/solr/core/src/test/org/apache/solr/cloud/SystemCollectionCompatTest.java b/solr/core/src/test/org/apache/solr/cloud/SystemCollectionCompatTest.java
index bb1f8cf..ed89ba2 100644
--- a/solr/core/src/test/org/apache/solr/cloud/SystemCollectionCompatTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/SystemCollectionCompatTest.java
@@ -29,6 +29,7 @@ import java.util.Set;
 import java.util.concurrent.TimeUnit;
 
 import org.apache.solr.SolrTestCaseJ4;
+import org.apache.solr.SolrTestUtil;
 import org.apache.solr.client.solrj.cloud.SolrCloudManager;
 import org.apache.solr.client.solrj.embedded.JettySolrRunner;
 import org.apache.solr.client.solrj.impl.CloudHttp2SolrClient;
@@ -73,7 +74,7 @@ public class SystemCollectionCompatTest extends SolrCloudTestCase {
 
     System.setProperty("managed.schema.mutable", "true");
     configureCluster(2)
-        .addConfig("conf1", configset("cloud-managed"))
+        .addConfig("conf1", SolrTestUtil.configset("cloud-managed"))
         .configure();
     if (! log.isWarnEnabled()) {
       fail("Test requires that log-level is at-least WARN, but WARN is disabled");
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 79b95ff..fe2af01 100644
--- a/solr/core/src/test/org/apache/solr/cloud/TestAuthenticationFramework.java
+++ b/solr/core/src/test/org/apache/solr/cloud/TestAuthenticationFramework.java
@@ -24,6 +24,8 @@ import java.util.Map;
 
 import org.apache.http.HttpRequestInterceptor;
 import org.apache.lucene.util.LuceneTestCase;
+import org.apache.solr.SolrTestCaseUtil;
+import org.apache.solr.SolrTestUtil;
 import org.apache.solr.client.solrj.SolrQuery;
 import org.apache.solr.client.solrj.impl.BaseHttpSolrClient;
 import org.apache.solr.client.solrj.impl.CloudHttp2SolrClient;
@@ -61,7 +63,7 @@ public class TestAuthenticationFramework extends SolrCloudTestCase {
   public void setUp() throws Exception {
     System.setProperty("solr.enablePublicKeyHandler", "true");
     setupAuthenticationPlugin();
-    configureCluster(nodeCount).addConfig(configName, configset("cloud-minimal")).configure();
+    configureCluster(nodeCount).addConfig(configName, SolrTestUtil.configset("cloud-minimal")).configure();
     super.setUp();
   }
   
@@ -80,8 +82,7 @@ public class TestAuthenticationFramework extends SolrCloudTestCase {
 
     // Should fail with 401
     try {
-      BaseHttpSolrClient.RemoteSolrException e = expectThrows(BaseHttpSolrClient.RemoteSolrException.class,
-          this::collectionCreateSearchDeleteTwice);
+      BaseHttpSolrClient.RemoteSolrException e = SolrTestCaseUtil.expectThrows(BaseHttpSolrClient.RemoteSolrException.class, this::collectionCreateSearchDeleteTwice);
       assertEquals("Should've returned a 401 error: " +  e.getMessage(), 401, e.code());
     } finally {
       MockAuthenticationPlugin.expectedUsername = null;
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 30533a1..7ff28d7 100644
--- a/solr/core/src/test/org/apache/solr/cloud/TestBaseStatsCacheCloud.java
+++ b/solr/core/src/test/org/apache/solr/cloud/TestBaseStatsCacheCloud.java
@@ -23,6 +23,7 @@ import java.util.Map;
 import java.util.function.Function;
 
 import org.apache.solr.SolrTestCaseJ4;
+import org.apache.solr.SolrTestUtil;
 import org.apache.solr.client.solrj.SolrClient;
 import org.apache.solr.client.solrj.SolrRequest;
 import org.apache.solr.client.solrj.embedded.EmbeddedSolrServer;
@@ -89,7 +90,7 @@ public abstract class TestBaseStatsCacheCloud extends SolrCloudTestCase {
     control = new EmbeddedSolrServer(SolrTestCaseJ4.h.getCore());
     // create cluster
     configureCluster(numNodes) // 2 + random().nextInt(3)
-        .addConfig("conf", configset(configset))
+        .addConfig("conf", SolrTestUtil.configset(configset))
         .configure();
     solrClient = cluster.getSolrClient();
     createTestCollection();
diff --git a/solr/core/src/test/org/apache/solr/cloud/TestCloudConsistency.java b/solr/core/src/test/org/apache/solr/cloud/TestCloudConsistency.java
index a42ff4e..c147e9a 100644
--- a/solr/core/src/test/org/apache/solr/cloud/TestCloudConsistency.java
+++ b/solr/core/src/test/org/apache/solr/cloud/TestCloudConsistency.java
@@ -20,6 +20,8 @@ package org.apache.solr.cloud;
 import org.apache.lucene.util.LuceneTestCase;
 import org.apache.solr.JSONTestUtil;
 import org.apache.solr.SolrTestCaseJ4;
+import org.apache.solr.SolrTestCaseUtil;
+import org.apache.solr.SolrTestUtil;
 import org.apache.solr.client.solrj.SolrServerException;
 import org.apache.solr.client.solrj.cloud.SocketProxy;
 import org.apache.solr.client.solrj.embedded.JettySolrRunner;
@@ -62,7 +64,7 @@ public class TestCloudConsistency extends SolrCloudTestCase {
     System.setProperty("solr.skipCommitOnClose", "false");
 
     configureCluster(4)
-        .addConfig("conf", configset("cloud-minimal"))
+        .addConfig("conf", SolrTestUtil.configset("cloud-minimal"))
         .configure();
     // Add proxies
     proxies = new HashMap<>(cluster.getJettySolrRunners().size());
@@ -183,19 +185,17 @@ public class TestCloudConsistency extends SolrCloudTestCase {
 
     // the meat of the test -- wait to see if a different replica become a leader
     // the correct behavior is that this should time out, if it succeeds we have a problem...
-    expectThrows(TimeoutException.class,
-                 "Did not time out waiting for new leader, out of sync replica became leader",
-                 () -> {
-                   cluster.getSolrClient().waitForState(collection, 3, TimeUnit.SECONDS, (l, state) -> {
-            Replica newLeader = state.getSlice("shard1").getLeader();
-            if (newLeader != null && !newLeader.getName().equals(leader.getName()) && newLeader.getState() == Replica.State.ACTIVE) {
-              // this is is the bad case, our "bad" state was found before timeout
-              log.error("WTF: New Leader={} original Leader={}", newLeader, leader);
-              return true;
-            }
-            return false; // still no bad state, wait for timeout
-          });
+    SolrTestCaseUtil.expectThrows(TimeoutException.class, "Did not time out waiting for new leader, out of sync replica became leader", () -> {
+      cluster.getSolrClient().waitForState(collection, 3, TimeUnit.SECONDS, (l, state) -> {
+        Replica newLeader = state.getSlice("shard1").getLeader();
+        if (newLeader != null && !newLeader.getName().equals(leader.getName()) && newLeader.getState() == Replica.State.ACTIVE) {
+          // this is is the bad case, our "bad" state was found before timeout
+          log.error("WTF: New Leader={} original Leader={}", newLeader, leader);
+          return true;
+        }
+        return false; // still no bad state, wait for timeout
       });
+    });
 
     waitForState("Timeout waiting for leader", collection, (liveNodes, collectionState) -> {
       Replica newLeader = collectionState.getLeader("shard1");
@@ -234,19 +234,17 @@ public class TestCloudConsistency extends SolrCloudTestCase {
 
     // the meat of the test -- wait to see if a different replica become a leader
     // the correct behavior is that this should time out, if it succeeds we have a problem...
-    expectThrows(TimeoutException.class,
-                 "Did not time out waiting for new leader, out of sync replica became leader",
-                 () -> {
-                   cluster.getSolrClient().waitForState(collection, 3, TimeUnit.SECONDS, (l, state) -> {
-            Replica newLeader = state.getSlice("shard1").getLeader();
-            if (newLeader != null && !newLeader.getName().equals(leader.getName()) && newLeader.getState() == Replica.State.ACTIVE) {
-              // this is is the bad case, our "bad" state was found before timeout
-              log.error("WTF: New Leader={} Old Leader={}", newLeader, leader);
-              return true;
-            }
-            return false; // still no bad state, wait for timeout
-          });
+    SolrTestCaseUtil.expectThrows(TimeoutException.class, "Did not time out waiting for new leader, out of sync replica became leader", () -> {
+      cluster.getSolrClient().waitForState(collection, 3, TimeUnit.SECONDS, (l, state) -> {
+        Replica newLeader = state.getSlice("shard1").getLeader();
+        if (newLeader != null && !newLeader.getName().equals(leader.getName()) && newLeader.getState() == Replica.State.ACTIVE) {
+          // this is is the bad case, our "bad" state was found before timeout
+          log.error("WTF: New Leader={} Old Leader={}", newLeader, leader);
+          return true;
+        }
+        return false; // still no bad state, wait for timeout
       });
+    });
 
     j1.start();
 
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 b20857d..c1f5fd0 100644
--- a/solr/core/src/test/org/apache/solr/cloud/TestCloudDeleteByQuery.java
+++ b/solr/core/src/test/org/apache/solr/cloud/TestCloudDeleteByQuery.java
@@ -17,6 +17,7 @@
 package org.apache.solr.cloud;
 
 import org.apache.solr.SolrTestCaseJ4;
+import org.apache.solr.SolrTestUtil;
 import org.apache.solr.client.solrj.SolrClient;
 import org.apache.solr.client.solrj.embedded.JettySolrRunner;
 import org.apache.solr.client.solrj.impl.CloudHttp2SolrClient;
@@ -114,7 +115,7 @@ public class TestCloudDeleteByQuery extends SolrCloudTestCase {
   private static void createMiniSolrCloudCluster() throws Exception {
     
     final String configName = "solrCloudCollectionConfig";
-    final Path configDir = Paths.get(TEST_HOME(), "collection1", "conf");
+    final Path configDir = Paths.get(SolrTestUtil.TEST_HOME(), "collection1", "conf");
     
     configureCluster(NUM_SERVERS)
       .addConfig(configName, configDir)
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 6031e03..83ff9ce 100644
--- a/solr/core/src/test/org/apache/solr/cloud/TestCloudInspectUtil.java
+++ b/solr/core/src/test/org/apache/solr/cloud/TestCloudInspectUtil.java
@@ -20,6 +20,7 @@ import java.util.HashSet;
 import java.util.Set;
 
 import org.apache.solr.SolrTestCaseJ4;
+import org.apache.solr.SolrTestCaseUtil;
 import org.apache.solr.common.SolrDocument;
 import org.apache.solr.common.SolrDocumentList;
 import org.junit.After;
@@ -106,9 +107,8 @@ public class TestCloudInspectUtil extends SolrTestCaseJ4 {
     final SolrDocumentList aExpectEx = getDocList("2", "3", "4");
     final SolrDocumentList bExpectEx = getDocList("2", "3", "4");
 
-    expectThrows(IllegalArgumentException.class, "Expected exception because lists have no diff",
-        () -> CloudInspectUtil.checkIfDiffIsLegal(aExpectEx, bExpectEx,
-            "control", "cloud", addFailsExpectEx, deleteFailsExpectEx));
+    SolrTestCaseUtil.expectThrows(IllegalArgumentException.class, "Expected exception because lists have no diff",
+        () -> CloudInspectUtil.checkIfDiffIsLegal(aExpectEx, bExpectEx, "control", "cloud", addFailsExpectEx, deleteFailsExpectEx));
   }
 
   private SolrDocumentList getDocList(String ... ids) {
diff --git a/solr/core/src/test/org/apache/solr/cloud/TestCloudPhrasesIdentificationComponent.java b/solr/core/src/test/org/apache/solr/cloud/TestCloudPhrasesIdentificationComponent.java
index d9f7161..a433142 100644
--- a/solr/core/src/test/org/apache/solr/cloud/TestCloudPhrasesIdentificationComponent.java
+++ b/solr/core/src/test/org/apache/solr/cloud/TestCloudPhrasesIdentificationComponent.java
@@ -26,9 +26,11 @@ import java.util.List;
 import java.util.Map;
 import java.util.Random;
 
+import org.apache.lucene.util.LuceneTestCase;
 import org.apache.lucene.util.LuceneTestCase.Slow;
 import org.apache.lucene.util.TestUtil;
 import org.apache.solr.SolrTestCaseJ4;
+import org.apache.solr.SolrTestUtil;
 import org.apache.solr.client.solrj.SolrClient;
 import org.apache.solr.client.solrj.embedded.JettySolrRunner;
 import org.apache.solr.client.solrj.impl.CloudHttp2SolrClient;
@@ -41,8 +43,6 @@ import org.apache.solr.common.util.NamedList;
 
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
-import org.junit.Ignore;
-
 /** 
  * A very simple sanity check that Phrase Identification works across a cloud cluster
  * using distributed term stat collection.
@@ -64,13 +64,13 @@ public class TestCloudPhrasesIdentificationComponent extends SolrCloudTestCase {
   public static void createMiniSolrCloudCluster() throws Exception {
     
     // multi replicas should not matter...
-    final int repFactor = usually() ? 1 : 2;
-    // ... but we definitely want to test multiple shards
-    final int numShards = TestUtil.nextInt(random(), 1, (usually() ? 2 :3));
+    final int repFactor = LuceneTestCase.usually() ? 1 : 2;
+    // ... but we definitely want to test multiple shardsLuceneTestCase.
+    final int numShards = TestUtil.nextInt(random(), 1, (LuceneTestCase.usually() ? 2 :3));
     final int numNodes = (numShards * repFactor);
    
     final String configName = DEBUG_LABEL + "_config-set";
-    final Path configDir = Paths.get(TEST_HOME(), "collection1", "conf");
+    final Path configDir = Paths.get(SolrTestUtil.TEST_HOME(), "collection1", "conf");
     
     configureCluster(numNodes).addConfig(configName, configDir).configure();
     
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 902d3b9..e6c0653 100644
--- a/solr/core/src/test/org/apache/solr/cloud/TestCloudPivotFacet.java
+++ b/solr/core/src/test/org/apache/solr/cloud/TestCloudPivotFacet.java
@@ -29,6 +29,7 @@ import java.util.Set;
 import org.apache.lucene.util.TestUtil;
 import org.apache.solr.SolrTestCase;
 import org.apache.solr.SolrTestCaseJ4;
+import org.apache.solr.SolrTestUtil;
 import org.apache.solr.client.solrj.SolrServerException;
 import org.apache.solr.client.solrj.response.FieldStatsInfo;
 import org.apache.solr.client.solrj.response.PivotField;
@@ -134,7 +135,7 @@ public class TestCloudPivotFacet extends SolrCloudBridgeTestCase {
     final Set<String> fieldNameSet = new HashSet<>();
     
     // build up a randomized index
-    final int numDocs = atLeast(TEST_NIGHTLY ? 500 : 50);
+    final int numDocs = SolrTestUtil.atLeast(TEST_NIGHTLY ? 500 : 50);
     log.info("numDocs: {}", numDocs);
 
     for (int i = 1; i <= numDocs; i++) {
@@ -563,7 +564,7 @@ public class TestCloudPivotFacet extends SolrCloudBridgeTestCase {
                                         
       }
       if (useField()) {
-        int numMulti = atLeast(1);
+        int numMulti = SolrTestUtil.atLeast(1);
         while (0 < numMulti--) {
           doc.addField(prefix, SolrTestCaseJ4.skewed(TestUtil.nextInt(random(), 20, 50),
                                       random().nextInt()));
@@ -576,7 +577,7 @@ public class TestCloudPivotFacet extends SolrCloudBridgeTestCase {
                                         random().nextLong()));
       }
       if (useField()) {
-        int numMulti = atLeast(1);
+        int numMulti = SolrTestUtil.atLeast(1);
         while (0 < numMulti--) {
           doc.addField(prefix, SolrTestCaseJ4.skewed(TestUtil.nextInt(random(), 5000, 5100),
                                       random().nextLong()));
@@ -589,7 +590,7 @@ public class TestCloudPivotFacet extends SolrCloudBridgeTestCase {
                                         random().nextFloat() * random().nextInt()));
       }
       if (useField()) {
-        int numMulti = atLeast(1);
+        int numMulti = SolrTestUtil.atLeast(1);
         while (0 < numMulti--) {
           doc.addField(prefix, SolrTestCaseJ4.skewed(1.0F / random().nextInt(13),
                                       random().nextFloat() * random().nextInt()));
@@ -602,7 +603,7 @@ public class TestCloudPivotFacet extends SolrCloudBridgeTestCase {
                                         random().nextDouble() * random().nextInt()));
       }
       if (useField()) {
-        int numMulti = atLeast(1);
+        int numMulti = SolrTestUtil.atLeast(1);
         while (0 < numMulti--) {
           doc.addField(prefix, SolrTestCaseJ4.skewed(1.0D / random().nextInt(19),
                                       random().nextDouble() * random().nextInt()));
@@ -615,7 +616,7 @@ public class TestCloudPivotFacet extends SolrCloudBridgeTestCase {
                                         
       }
       if (useField()) {
-        int numMulti = atLeast(1);
+        int numMulti = SolrTestUtil.atLeast(1);
         while (0 < numMulti--) {
           doc.addField(prefix, SolrTestCaseJ4.skewed(SolrTestCaseJ4.randomSkewedDate(), SolrTestCaseJ4.randomDate()));
                                       
@@ -628,7 +629,7 @@ public class TestCloudPivotFacet extends SolrCloudBridgeTestCase {
         doc.addField(prefix+"1", random().nextBoolean() ? "t" : "f");
       }
       if (useField()) {
-        int numMulti = atLeast(1);
+        int numMulti = SolrTestUtil.atLeast(1);
         while (0 < numMulti--) {
           doc.addField(prefix, random().nextBoolean() ? "t" : "f");
         }
@@ -640,7 +641,7 @@ public class TestCloudPivotFacet extends SolrCloudBridgeTestCase {
             SolrTestCaseJ4.randomXmlUsableUnicodeString()));
       }
       if (useField()) {
-        int numMulti = atLeast(1);
+        int numMulti = SolrTestUtil.atLeast(1);
         while (0 < numMulti--) {
           doc.addField(prefix, SolrTestCaseJ4.skewed(TestUtil.randomSimpleString(random(), 1, 1),
               SolrTestCaseJ4.randomXmlUsableUnicodeString()));
@@ -657,7 +658,7 @@ public class TestCloudPivotFacet extends SolrCloudBridgeTestCase {
         doc.addField(prefix+"1", TestUtil.randomSimpleString(random(), 1, 1));
       }
       if (useField()) {
-        int numMulti = atLeast(1);
+        int numMulti = SolrTestUtil.atLeast(1);
         while (0 < numMulti--) {
           doc.addField(prefix, TestUtil.randomSimpleString(random(), 1, 1));
         }
@@ -668,7 +669,7 @@ public class TestCloudPivotFacet extends SolrCloudBridgeTestCase {
         doc.addField(prefix+"1", TestUtil.nextInt(random(), 20, 50));
       }
       if (useField()) {
-        int numMulti = atLeast(1);
+        int numMulti = SolrTestUtil.atLeast(1);
         while (0 < numMulti--) {
           doc.addField(prefix, TestUtil.nextInt(random(), 20, 50));
         }
diff --git a/solr/core/src/test/org/apache/solr/cloud/TestCloudPseudoReturnFields.java b/solr/core/src/test/org/apache/solr/cloud/TestCloudPseudoReturnFields.java
index 0c460b9..22ff437 100644
--- a/solr/core/src/test/org/apache/solr/cloud/TestCloudPseudoReturnFields.java
+++ b/solr/core/src/test/org/apache/solr/cloud/TestCloudPseudoReturnFields.java
@@ -30,6 +30,7 @@ import java.util.Random;
 import org.apache.lucene.util.LuceneTestCase;
 import org.apache.lucene.util.TestUtil;
 import org.apache.solr.SolrTestCaseJ4;
+import org.apache.solr.SolrTestUtil;
 import org.apache.solr.client.solrj.SolrClient;
 import org.apache.solr.client.solrj.SolrServerException;
 import org.apache.solr.client.solrj.embedded.JettySolrRunner;
@@ -66,14 +67,14 @@ public class TestCloudPseudoReturnFields extends SolrCloudTestCase {
   @BeforeClass
   private static void createMiniSolrCloudCluster() throws Exception {
     // multi replicas should matter...
-    final int repFactor = usually() ? 1 : 2;;
+    final int repFactor = LuceneTestCase.usually() ? 1 : 2;;
     // ... but we definitely want to ensure forwarded requests to other shards work ...
     final int numShards = 2;
     // ... including some forwarded requests from nodes not hosting a shard
     final int numNodes = 1 + (numShards * repFactor);
    
     final String configName = DEBUG_LABEL + "_config-set";
-    final Path configDir = Paths.get(TEST_HOME(), "collection1", "conf");
+    final Path configDir = Paths.get(SolrTestUtil.TEST_HOME(), "collection1", "conf");
     
     configureCluster(numNodes).addConfig(configName, configDir).configure();
     
@@ -727,7 +728,7 @@ public class TestCloudPseudoReturnFields extends SolrCloudTestCase {
     final List<String> fl = Arrays.asList
       ("id","[docid]","[explain]","score","val_*","subj*");
     
-    final int iters = atLeast(random, 10);
+    final int iters = LuceneTestCase.atLeast(random, 10);
     for (int i = 0; i< iters; i++) {
       
       Collections.shuffle(fl, random);
@@ -762,7 +763,7 @@ public class TestCloudPseudoReturnFields extends SolrCloudTestCase {
     final List<String> fl = Arrays.asList
       ("id","[docid]","[explain]","score","val_*","subj*");
     
-    final int iters = atLeast(random, 10);
+    final int iters = LuceneTestCase.atLeast(random, 10);
     for (int i = 0; i< iters; i++) {
       
       Collections.shuffle(fl, random);
diff --git a/solr/core/src/test/org/apache/solr/cloud/TestCloudRecovery.java b/solr/core/src/test/org/apache/solr/cloud/TestCloudRecovery.java
index 91ba1d3..3048ae2 100644
--- a/solr/core/src/test/org/apache/solr/cloud/TestCloudRecovery.java
+++ b/solr/core/src/test/org/apache/solr/cloud/TestCloudRecovery.java
@@ -30,6 +30,7 @@ import java.util.stream.Collectors;
 import org.apache.commons.io.IOUtils;
 import org.apache.lucene.util.LuceneTestCase;
 import org.apache.solr.SolrTestCaseJ4;
+import org.apache.solr.SolrTestUtil;
 import org.apache.solr.client.solrj.embedded.JettySolrRunner;
 import org.apache.solr.client.solrj.impl.CloudHttp2SolrClient;
 import org.apache.solr.client.solrj.request.CollectionAdminRequest;
@@ -71,7 +72,7 @@ public class TestCloudRecovery extends SolrCloudTestCase {
   @Before
   public void beforeTest() throws Exception {
     configureCluster(2)
-        .addConfig("config", TEST_PATH().resolve("configsets").resolve("cloud-minimal").resolve("conf"))
+        .addConfig("config", SolrTestUtil.TEST_PATH().resolve("configsets").resolve("cloud-minimal").resolve("conf"))
         .configure();
 
     onlyLeaderIndexes = random().nextBoolean();
diff --git a/solr/core/src/test/org/apache/solr/cloud/TestCloudRecovery2.java b/solr/core/src/test/org/apache/solr/cloud/TestCloudRecovery2.java
index 047a39f..f8e1668 100644
--- a/solr/core/src/test/org/apache/solr/cloud/TestCloudRecovery2.java
+++ b/solr/core/src/test/org/apache/solr/cloud/TestCloudRecovery2.java
@@ -22,6 +22,7 @@ import java.util.concurrent.TimeUnit;
 
 import org.apache.lucene.util.LuceneTestCase;
 import org.apache.solr.SolrTestCaseJ4;
+import org.apache.solr.SolrTestUtil;
 import org.apache.solr.client.solrj.SolrQuery;
 import org.apache.solr.client.solrj.embedded.JettySolrRunner;
 import org.apache.solr.client.solrj.impl.Http2SolrClient;
@@ -29,7 +30,6 @@ import org.apache.solr.client.solrj.request.CollectionAdminRequest;
 import org.apache.solr.client.solrj.request.UpdateRequest;
 import org.apache.solr.common.cloud.Replica;
 import org.junit.BeforeClass;
-import org.junit.Ignore;
 import org.junit.Test;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -46,7 +46,7 @@ public class TestCloudRecovery2 extends SolrCloudTestCase {
     System.setProperty("solr.ulog.numRecordsToKeep", "1000");
 
     configureCluster(2)
-        .addConfig("config", TEST_PATH().resolve("configsets").resolve("cloud-minimal").resolve("conf"))
+        .addConfig("config", SolrTestUtil.TEST_PATH().resolve("configsets").resolve("cloud-minimal").resolve("conf"))
         .configure();
 
     CollectionAdminRequest
diff --git a/solr/core/src/test/org/apache/solr/cloud/TestCloudSearcherWarming.java b/solr/core/src/test/org/apache/solr/cloud/TestCloudSearcherWarming.java
index e37a6d2..1b48b65 100644
--- a/solr/core/src/test/org/apache/solr/cloud/TestCloudSearcherWarming.java
+++ b/solr/core/src/test/org/apache/solr/cloud/TestCloudSearcherWarming.java
@@ -23,6 +23,7 @@ import java.util.concurrent.atomic.AtomicInteger;
 import java.util.concurrent.atomic.AtomicReference;
 
 import org.apache.lucene.util.LuceneTestCase;
+import org.apache.solr.SolrTestUtil;
 import org.apache.solr.client.solrj.SolrQuery;
 import org.apache.solr.client.solrj.embedded.JettySolrRunner;
 import org.apache.solr.client.solrj.impl.CloudHttp2SolrClient;
@@ -66,7 +67,7 @@ public class TestCloudSearcherWarming extends SolrCloudTestCase {
   @Before
   public void setUp() throws Exception {
     super.setUp();
-    configureCluster(1).addConfig("conf", configset("cloud-minimal")).configure();
+    configureCluster(1).addConfig("conf", SolrTestUtil.configset("cloud-minimal")).configure();
   }
   
   @After
diff --git a/solr/core/src/test/org/apache/solr/cloud/TestConfigSetsAPI.java b/solr/core/src/test/org/apache/solr/cloud/TestConfigSetsAPI.java
index 4007c41..7017fe8 100644
--- a/solr/core/src/test/org/apache/solr/cloud/TestConfigSetsAPI.java
+++ b/solr/core/src/test/org/apache/solr/cloud/TestConfigSetsAPI.java
@@ -49,6 +49,8 @@ import org.apache.commons.io.FileUtils;
 import org.apache.http.client.HttpClient;
 import org.apache.lucene.util.TestUtil;
 import org.apache.solr.SolrTestCaseJ4;
+import org.apache.solr.SolrTestCaseUtil;
+import org.apache.solr.SolrTestUtil;
 import org.apache.solr.client.solrj.SolrClient;
 import org.apache.solr.client.solrj.SolrRequest;
 import org.apache.solr.client.solrj.SolrServerException;
@@ -113,7 +115,7 @@ public class TestConfigSetsAPI extends SolrTestCaseJ4 {
   @Before
   public void setUp() throws Exception {
     super.setUp();
-    solrCluster = new MiniSolrCloudCluster(1, createTempDir(), buildJettyConfig("/solr"));
+    solrCluster = new MiniSolrCloudCluster(1, SolrTestUtil.createTempDir(), buildJettyConfig("/solr"));
   }
 
   @Override
@@ -130,7 +132,7 @@ public class TestConfigSetsAPI extends SolrTestCaseJ4 {
   public void testCreateErrors() throws Exception {
     final String baseUrl = solrCluster.getJettySolrRunners().get(0).getBaseUrl().toString();
     final SolrClient solrClient = getHttpSolrClient(baseUrl);
-    solrCluster.uploadConfigSet(configset("configset-2"), "configSet");
+    solrCluster.uploadConfigSet(SolrTestUtil.configset("configset-2"), "configSet");
 
     // no action
     CreateNoErrorChecking createNoAction = new CreateNoErrorChecking();
@@ -177,8 +179,8 @@ public class TestConfigSetsAPI extends SolrTestCaseJ4 {
   }
 
   private void setupBaseConfigSet(String baseConfigSetName, Map<String, String> oldProps) throws Exception {
-    final File configDir = getFile("solr").toPath().resolve("configsets/configset-2/conf").toFile();
-    final File tmpConfigDir = createTempDir().toFile();
+    final File configDir = SolrTestUtil.getFile("solr").toPath().resolve("configsets/configset-2/conf").toFile();
+    final File tmpConfigDir = SolrTestUtil.createTempDir().toFile();
     tmpConfigDir.deleteOnExit();
     FileUtils.copyDirectory(configDir, tmpConfigDir);
     if (oldProps != null && oldProps.size() > 0) {
@@ -355,9 +357,8 @@ public class TestConfigSetsAPI extends SolrTestCaseJ4 {
       final String untrustedSuffix = "-untrusted";
       uploadConfigSetWithAssertions("with-script-processor", untrustedSuffix, null, null);
       // try to create a collection with the uploaded configset
-      Throwable thrown = expectThrows(BaseHttpSolrClient.RemoteSolrException.class, () -> {
-        createCollection("newcollection2", "with-script-processor" + untrustedSuffix,
-      1, 1, solrCluster.getSolrClient());
+      Throwable thrown = SolrTestCaseUtil.expectThrows(BaseHttpSolrClient.RemoteSolrException.class, () -> {
+        createCollection("newcollection2", "with-script-processor" + untrustedSuffix, 1, 1, solrCluster.getSolrClient());
       });
 
     assertThat(thrown.getMessage(), containsString("Underlying core creation failed"));
@@ -381,7 +382,7 @@ public class TestConfigSetsAPI extends SolrTestCaseJ4 {
     final String untrustedSuffix = "-untrusted";
     uploadConfigSetWithAssertions("with-lib-directive", untrustedSuffix, null, null);
     // try to create a collection with the uploaded configset
-    Throwable thrown = expectThrows(BaseHttpSolrClient.RemoteSolrException.class, () -> {
+    Throwable thrown = SolrTestCaseUtil.expectThrows(BaseHttpSolrClient.RemoteSolrException.class, () -> {
       createCollection("newcollection3", "with-lib-directive" + untrustedSuffix, 1, 1, solrCluster.getSolrClient());
     });
 
@@ -499,7 +500,7 @@ public class TestConfigSetsAPI extends SolrTestCaseJ4 {
     File zipFile = new File(solrCluster.getBaseDir().toFile().getAbsolutePath() +
         File.separator + TestUtil.randomSimpleString(random(), 6, 8) + ".zip");
 
-    File directory = SolrTestCaseJ4.getFile(directoryPath);
+    File directory = SolrTestUtil.getFile(directoryPath);
     if (log.isInfoEnabled()) {
       log.info("Directory: {}", directory.getAbsolutePath());
     }
@@ -635,7 +636,7 @@ public class TestConfigSetsAPI extends SolrTestCaseJ4 {
 
   private byte[] readFile(String fname) throws IOException {
     byte[] buf = null;
-    try (FileInputStream fis = new FileInputStream(getFile(fname))) {
+    try (FileInputStream fis = new FileInputStream(SolrTestUtil.getFile(fname))) {
       buf = new byte[fis.available()];
       fis.read(buf);
     }
@@ -646,8 +647,8 @@ public class TestConfigSetsAPI extends SolrTestCaseJ4 {
   public void testDeleteErrors() throws Exception {
     final String baseUrl = solrCluster.getJettySolrRunners().get(0).getBaseUrl().toString();
     final SolrClient solrClient = getHttpSolrClient(baseUrl);
-    final File configDir = getFile("solr").toPath().resolve("configsets/configset-2/conf").toFile();
-    final File tmpConfigDir = createTempDir().toFile();
+    final File configDir = SolrTestUtil.getFile("solr").toPath().resolve("configsets/configset-2/conf").toFile();
+    final File tmpConfigDir = SolrTestUtil.createTempDir().toFile();
     tmpConfigDir.deleteOnExit();
     // Ensure ConfigSet is immutable
     FileUtils.copyDirectory(configDir, tmpConfigDir);
@@ -672,7 +673,7 @@ public class TestConfigSetsAPI extends SolrTestCaseJ4 {
 
   private void verifyException(SolrClient solrClient, ConfigSetAdminRequest request,
       String errorContains) throws Exception {
-    Exception e = expectThrows(Exception.class, () -> solrClient.request(request));
+    Exception e = SolrTestCaseUtil.expectThrows(Exception.class, () -> solrClient.request(request));
     assertTrue("Expected exception message to contain: " + errorContains
         + " got: " + e.getMessage(), e.getMessage().contains(errorContains));
   }
@@ -682,7 +683,7 @@ public class TestConfigSetsAPI extends SolrTestCaseJ4 {
     final String baseUrl = solrCluster.getJettySolrRunners().get(0).getBaseUrl().toString();
     final SolrClient solrClient = getHttpSolrClient(baseUrl);
     final String configSet = "configSet";
-    solrCluster.uploadConfigSet(configset("configset-2"), configSet);
+    solrCluster.uploadConfigSet(SolrTestUtil.configset("configset-2"), configSet);
 
     SolrZkClient zkClient = zkClient();
     ZkConfigManager configManager = new ZkConfigManager(zkClient);
@@ -713,7 +714,7 @@ public class TestConfigSetsAPI extends SolrTestCaseJ4 {
     Set<String> configSets = new HashSet<String>();
     for (int i = 0; i < 5; ++i) {
       String configSet = "configSet" + i;
-      solrCluster.uploadConfigSet(configset("configset-2"), configSet);
+      solrCluster.uploadConfigSet(SolrTestUtil.configset("configset-2"), configSet);
       configSets.add(configSet);
     }
     response = list.process(solrClient);
diff --git a/solr/core/src/test/org/apache/solr/cloud/TestConfigSetsAPIExclusivity.java b/solr/core/src/test/org/apache/solr/cloud/TestConfigSetsAPIExclusivity.java
index 65b50a5..9b7c86e 100644
--- a/solr/core/src/test/org/apache/solr/cloud/TestConfigSetsAPIExclusivity.java
+++ b/solr/core/src/test/org/apache/solr/cloud/TestConfigSetsAPIExclusivity.java
@@ -21,7 +21,9 @@ import java.util.Arrays;
 import java.util.LinkedList;
 import java.util.List;
 
+import org.apache.lucene.util.LuceneTestCase;
 import org.apache.solr.SolrTestCaseJ4;
+import org.apache.solr.SolrTestUtil;
 import org.apache.solr.client.solrj.SolrClient;
 import org.apache.solr.client.solrj.request.ConfigSetAdminRequest;
 import org.apache.solr.client.solrj.request.ConfigSetAdminRequest.Create;
@@ -50,7 +52,7 @@ public class TestConfigSetsAPIExclusivity extends SolrTestCaseJ4 {
   @Before
   public void setUp() throws Exception {
     super.setUp();
-    solrCluster = new MiniSolrCloudCluster(1, createTempDir(), buildJettyConfig("/solr"));
+    solrCluster = new MiniSolrCloudCluster(1, SolrTestUtil.createTempDir(), buildJettyConfig("/solr"));
   }
 
   @Override
@@ -64,7 +66,7 @@ public class TestConfigSetsAPIExclusivity extends SolrTestCaseJ4 {
   }
 
   @Test
-  @AwaitsFix(bugUrl = "overseer does not currently limit")
+  @LuceneTestCase.AwaitsFix(bugUrl = "overseer does not currently limit")
   public void testAPIExclusivity() throws Exception {
     int trials = 20;
     setupBaseConfigSet(GRANDBASE_CONFIGSET_NAME);
@@ -92,7 +94,7 @@ public class TestConfigSetsAPIExclusivity extends SolrTestCaseJ4 {
   }
 
   private void setupBaseConfigSet(String baseConfigSetName) throws Exception {
-    solrCluster.uploadConfigSet(configset("configset-2"), baseConfigSetName);
+    solrCluster.uploadConfigSet(SolrTestUtil.configset("configset-2"), baseConfigSetName);
   }
 
   private Exception getFirstExceptionOrNull(List<Exception> list) {
diff --git a/solr/core/src/test/org/apache/solr/cloud/TestConfigSetsAPIZkFailure.java b/solr/core/src/test/org/apache/solr/cloud/TestConfigSetsAPIZkFailure.java
index 1621051..9dd336e 100644
--- a/solr/core/src/test/org/apache/solr/cloud/TestConfigSetsAPIZkFailure.java
+++ b/solr/core/src/test/org/apache/solr/cloud/TestConfigSetsAPIZkFailure.java
@@ -33,7 +33,10 @@ import org.apache.commons.io.FileUtils;
 import org.apache.jute.InputArchive;
 import org.apache.jute.OutputArchive;
 import org.apache.jute.Record;
+import org.apache.lucene.util.LuceneTestCase;
 import org.apache.solr.SolrTestCaseJ4;
+import org.apache.solr.SolrTestCaseUtil;
+import org.apache.solr.SolrTestUtil;
 import org.apache.solr.client.solrj.SolrClient;
 import org.apache.solr.client.solrj.impl.BaseHttpSolrClient.RemoteSolrException;
 import org.apache.solr.client.solrj.request.ConfigSetAdminRequest.Create;
@@ -76,7 +79,7 @@ public class TestConfigSetsAPIZkFailure extends SolrTestCaseJ4 {
   @Before
   public void setUp() throws Exception {
     super.setUp();
-    final Path testDir = createTempDir();
+    final Path testDir = SolrTestUtil.createTempDir();
     final Path zkDir = testDir.resolve("zookeeper/server1/data");
     zkTestServer = new ZkTestServer(zkDir);
     zkTestServer.run();
@@ -100,7 +103,7 @@ public class TestConfigSetsAPIZkFailure extends SolrTestCaseJ4 {
   }
 
   @Test
-  @AwaitsFix(bugUrl = "fragile")
+  @LuceneTestCase.AwaitsFix(bugUrl = "fragile")
   public void testCreateZkFailure() throws Exception {
     final String baseUrl = solrCluster.getJettySolrRunners().get(0).getBaseUrl().toString();
     final SolrClient solrClient = getHttpSolrClient(baseUrl);
@@ -115,7 +118,7 @@ public class TestConfigSetsAPIZkFailure extends SolrTestCaseJ4 {
 
     Create create = new Create();
     create.setBaseConfigSetName(BASE_CONFIGSET_NAME).setConfigSetName(CONFIGSET_NAME);
-    RemoteSolrException se = expectThrows(RemoteSolrException.class, () -> create.process(solrClient));
+    RemoteSolrException se = SolrTestCaseUtil.expectThrows(RemoteSolrException.class, () -> create.process(solrClient));
     // partial creation should have been cleaned up
     assertFalse(configManager.configExists(CONFIGSET_NAME));
     assertEquals(400, se.code());
@@ -125,8 +128,8 @@ public class TestConfigSetsAPIZkFailure extends SolrTestCaseJ4 {
   }
 
   private void setupBaseConfigSet(String baseConfigSetName, Map<String, String> oldProps) throws Exception {
-    final File configDir = getFile("solr").toPath().resolve("configsets/configset-2/conf").toFile();
-    final File tmpConfigDir = createTempDir().toFile();
+    final File configDir = SolrTestUtil.getFile("solr").toPath().resolve("configsets/configset-2/conf").toFile();
+    final File tmpConfigDir = SolrTestUtil.createTempDir().toFile();
     tmpConfigDir.deleteOnExit();
     FileUtils.copyDirectory(configDir, tmpConfigDir);
     if (oldProps != null) {
diff --git a/solr/core/src/test/org/apache/solr/cloud/TestDeleteCollectionOnDownNodes.java b/solr/core/src/test/org/apache/solr/cloud/TestDeleteCollectionOnDownNodes.java
index 87da3a8..01302a9 100644
--- a/solr/core/src/test/org/apache/solr/cloud/TestDeleteCollectionOnDownNodes.java
+++ b/solr/core/src/test/org/apache/solr/cloud/TestDeleteCollectionOnDownNodes.java
@@ -17,6 +17,7 @@
 
 package org.apache.solr.cloud;
 
+import org.apache.solr.SolrTestUtil;
 import org.apache.solr.client.solrj.embedded.JettySolrRunner;
 import org.apache.solr.client.solrj.request.CollectionAdminRequest;
 import org.junit.After;
@@ -28,7 +29,7 @@ public class TestDeleteCollectionOnDownNodes extends SolrCloudTestCase {
   @Before
   public void beforeTestDeleteCollectionOnDownNodes() throws Exception {
     configureCluster(4)
-        .addConfig("conf", configset("cloud-minimal"))
+        .addConfig("conf", SolrTestUtil.configset("cloud-minimal"))
         .configure();
 
     CollectionAdminRequest.createCollection("DeleteCollectionOnDownNodes", "conf", 4, 3)
diff --git a/solr/core/src/test/org/apache/solr/cloud/TestDistributedMap.java b/solr/core/src/test/org/apache/solr/cloud/TestDistributedMap.java
index eef9c1f..0d19779 100644
--- a/solr/core/src/test/org/apache/solr/cloud/TestDistributedMap.java
+++ b/solr/core/src/test/org/apache/solr/cloud/TestDistributedMap.java
@@ -22,6 +22,7 @@ import java.nio.file.Path;
 import java.util.Locale;
 import org.apache.commons.io.FileUtils;
 import org.apache.solr.SolrTestCaseJ4;
+import org.apache.solr.SolrTestUtil;
 import org.apache.solr.common.cloud.SolrZkClient;
 import org.apache.zookeeper.CreateMode;
 import org.apache.zookeeper.KeeperException;
@@ -36,7 +37,7 @@ public class TestDistributedMap extends SolrTestCaseJ4 {
 
   @BeforeClass
   public static void setUpClass() throws Exception {
-    zkDir = createTempDir("TestDistributedMap");
+    zkDir = SolrTestUtil.createTempDir("TestDistributedMap");
     zkServer = new ZkTestServer(zkDir);
     zkServer.run();
   }
@@ -177,7 +178,7 @@ public class TestDistributedMap extends SolrTestCaseJ4 {
   }
 
   protected String getAndMakeInitialPath(SolrZkClient zkClient) throws KeeperException, InterruptedException {
-    String path = String.format(Locale.ROOT, "/%s/%s", getClass().getName(), getSaferTestName());
+    String path = String.format(Locale.ROOT, "/%s/%s", getClass().getName(), SolrTestUtil.getTestName());
     zkClient.makePath(path, false, true);
     return path;
   }
diff --git a/solr/core/src/test/org/apache/solr/cloud/TestDownShardTolerantSearch.java b/solr/core/src/test/org/apache/solr/cloud/TestDownShardTolerantSearch.java
index ab2479f..309d68b 100644
--- a/solr/core/src/test/org/apache/solr/cloud/TestDownShardTolerantSearch.java
+++ b/solr/core/src/test/org/apache/solr/cloud/TestDownShardTolerantSearch.java
@@ -16,6 +16,8 @@
  */
 package org.apache.solr.cloud;
 
+import org.apache.solr.SolrTestCaseUtil;
+import org.apache.solr.SolrTestUtil;
 import org.apache.solr.client.solrj.SolrClient;
 import org.apache.solr.client.solrj.SolrQuery;
 import org.apache.solr.client.solrj.embedded.JettySolrRunner;
@@ -42,7 +44,7 @@ public class TestDownShardTolerantSearch extends SolrCloudTestCase {
 
   @BeforeClass
   public static void setupCluster() throws Exception {
-    configureCluster(2).addConfig("conf", configset("cloud-minimal")).configure();
+    configureCluster(2).addConfig("conf", SolrTestUtil.configset("cloud-minimal")).configure();
   }
 
   @Test
@@ -69,7 +71,7 @@ public class TestDownShardTolerantSearch extends SolrCloudTestCase {
       assertThat(response.getStatus(), is(0));
       assertTrue(response.getResults().getNumFound() > 0);
 
-      Exception e = expectThrows(Exception.class, "Request should have failed because we killed shard1 jetty",
+      Exception e = SolrTestCaseUtil.expectThrows(Exception.class, "Request should have failed because we killed shard1 jetty",
           () -> cluster.getSolrClient().query("tolerant", new SolrQuery("*:*").setRows(1).setParam(ShardParams.SHARDS_TOLERANT, false)));
 
       assertNotNull(e);
diff --git a/solr/core/src/test/org/apache/solr/cloud/TestExclusionRuleCollectionAccess.java b/solr/core/src/test/org/apache/solr/cloud/TestExclusionRuleCollectionAccess.java
index 5bf77c1..5f738a4 100644
--- a/solr/core/src/test/org/apache/solr/cloud/TestExclusionRuleCollectionAccess.java
+++ b/solr/core/src/test/org/apache/solr/cloud/TestExclusionRuleCollectionAccess.java
@@ -16,6 +16,7 @@
  */
 package org.apache.solr.cloud;
 
+import org.apache.solr.SolrTestUtil;
 import org.apache.solr.client.solrj.request.CollectionAdminRequest;
 import org.apache.solr.client.solrj.request.UpdateRequest;
 import org.junit.BeforeClass;
@@ -26,7 +27,7 @@ public class TestExclusionRuleCollectionAccess extends SolrCloudTestCase {
   @BeforeClass
   public static void setupCluster() throws Exception {
     configureCluster(1)
-        .addConfig("conf", configset("cloud-minimal"))
+        .addConfig("conf", SolrTestUtil.configset("cloud-minimal"))
         .configure();
   }
 
diff --git a/solr/core/src/test/org/apache/solr/cloud/TestLeaderElectionWithEmptyReplica.java b/solr/core/src/test/org/apache/solr/cloud/TestLeaderElectionWithEmptyReplica.java
index 512708d..1613693 100644
--- a/solr/core/src/test/org/apache/solr/cloud/TestLeaderElectionWithEmptyReplica.java
+++ b/solr/core/src/test/org/apache/solr/cloud/TestLeaderElectionWithEmptyReplica.java
@@ -17,6 +17,7 @@
 
 package org.apache.solr.cloud;
 
+import org.apache.solr.SolrTestUtil;
 import org.apache.solr.client.solrj.SolrQuery;
 import org.apache.solr.client.solrj.SolrServerException;
 import org.apache.solr.client.solrj.embedded.JettySolrRunner;
@@ -50,7 +51,7 @@ public class TestLeaderElectionWithEmptyReplica extends SolrCloudTestCase {
 
     useFactory(null);
     configureCluster(2)
-        .addConfig("config", TEST_PATH().resolve("configsets").resolve("cloud-minimal").resolve("conf"))
+        .addConfig("config", SolrTestUtil.TEST_PATH().resolve("configsets").resolve("cloud-minimal").resolve("conf"))
         .configure();
 
     CollectionAdminRequest.createCollection(COLLECTION_NAME, "config", 1, 1)
diff --git a/solr/core/src/test/org/apache/solr/cloud/TestLeaderElectionZkExpiry.java b/solr/core/src/test/org/apache/solr/cloud/TestLeaderElectionZkExpiry.java
index c871665..5559c16 100644
--- a/solr/core/src/test/org/apache/solr/cloud/TestLeaderElectionZkExpiry.java
+++ b/solr/core/src/test/org/apache/solr/cloud/TestLeaderElectionZkExpiry.java
@@ -21,6 +21,7 @@ import java.nio.file.Path;
 import java.util.concurrent.TimeUnit;
 
 import org.apache.solr.SolrTestCaseJ4;
+import org.apache.solr.SolrTestUtil;
 import org.apache.solr.common.cloud.SolrZkClient;
 import org.apache.solr.core.CloudConfig;
 import org.apache.solr.core.CoreContainer;
@@ -39,8 +40,8 @@ public class TestLeaderElectionZkExpiry extends SolrTestCaseJ4 {
 
   @Test
   public void testLeaderElectionWithZkExpiry() throws Exception {
-    Path zkDir = createTempDir("zkData");
-    Path ccDir = createTempDir("testLeaderElectionWithZkExpiry-solr");
+    Path zkDir = SolrTestUtil.createTempDir("zkData");
+    Path ccDir = SolrTestUtil.createTempDir("testLeaderElectionWithZkExpiry-solr");
     CoreContainer cc = createCoreContainer(ccDir, SOLRXML);
     final ZkTestServer server = new ZkTestServer(zkDir);
     server.setTheTickTime(1000);
diff --git a/solr/core/src/test/org/apache/solr/cloud/TestMiniSolrCloudClusterSSL.java b/solr/core/src/test/org/apache/solr/cloud/TestMiniSolrCloudClusterSSL.java
index 2fdbb3a..6319c12 100644
--- a/solr/core/src/test/org/apache/solr/cloud/TestMiniSolrCloudClusterSSL.java
+++ b/solr/core/src/test/org/apache/solr/cloud/TestMiniSolrCloudClusterSSL.java
@@ -26,8 +26,11 @@ import org.apache.http.impl.client.CloseableHttpClient;
 import org.apache.http.impl.client.HttpClientBuilder;
 import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
 import org.apache.lucene.util.Constants;
+import org.apache.lucene.util.LuceneTestCase;
 import org.apache.lucene.util.TestRuleRestoreSystemProperties;
 import org.apache.solr.SolrTestCaseJ4;
+import org.apache.solr.SolrTestCaseUtil;
+import org.apache.solr.SolrTestUtil;
 import org.apache.solr.client.solrj.SolrServerException;
 import org.apache.solr.client.solrj.embedded.JettyConfig;
 import org.apache.solr.client.solrj.embedded.JettySolrRunner;
@@ -125,7 +128,7 @@ public class TestMiniSolrCloudClusterSSL extends SolrTestCaseJ4 {
   }
 
   public void testSslAndClientAuth() throws Exception {
-    assumeFalse("SOLR-9039: SSL w/clientAuth does not work on MAC_OS_X", Constants.MAC_OS_X);
+    LuceneTestCase.assumeFalse("SOLR-9039: SSL w/clientAuth does not work on MAC_OS_X", Constants.MAC_OS_X);
     
     final SSLTestConfig sslConfig = new SSLTestConfig(true, true);
 
@@ -157,7 +160,7 @@ public class TestMiniSolrCloudClusterSSL extends SolrTestCaseJ4 {
   private void checkClusterWithNodeReplacement(SSLTestConfig sslConfig) throws Exception {
     
     final JettyConfig config = JettyConfig.builder().withSSLConfig(sslConfig.buildServerSSLConfig()).build();
-    final MiniSolrCloudCluster cluster = new MiniSolrCloudCluster(NUM_SERVERS, createTempDir(), config);
+    final MiniSolrCloudCluster cluster = new MiniSolrCloudCluster(NUM_SERVERS, SolrTestUtil.createTempDir(), config);
     try {
       checkClusterWithCollectionCreations(cluster, sslConfig);
 
@@ -187,7 +190,7 @@ public class TestMiniSolrCloudClusterSSL extends SolrTestCaseJ4 {
     Http2SolrClient.setDefaultSSLConfig(sslConfig.buildClientSSLConfig());
     System.setProperty(ZkStateReader.URL_SCHEME, "https");
     final JettyConfig config = JettyConfig.builder().withSSLConfig(sslConfig.buildServerSSLConfig()).build();
-    final MiniSolrCloudCluster cluster = new MiniSolrCloudCluster(NUM_SERVERS, createTempDir(), config);
+    final MiniSolrCloudCluster cluster = new MiniSolrCloudCluster(NUM_SERVERS, SolrTestUtil.createTempDir(), config);
     try {
       checkClusterWithCollectionCreations(cluster, sslConfig);
       
@@ -202,13 +205,13 @@ public class TestMiniSolrCloudClusterSSL extends SolrTestCaseJ4 {
       for (JettySolrRunner jetty : jettys) {
         final String baseURL = jetty.getBaseUrl().toString();
         // verify new solr clients validate peer name and can't talk to this server
-        Exception ex = expectThrows(SolrServerException.class, () -> {
-            try (Http2SolrClient client = getRandomizedHttpSolrClient(baseURL)) {
-              CoreAdminRequest req = new CoreAdminRequest();
-              req.setAction( CoreAdminAction.STATUS );
-              client.request(req);
-            }
-          });
+        Exception ex = SolrTestCaseUtil.expectThrows(SolrServerException.class, () -> {
+          try (Http2SolrClient client = getRandomizedHttpSolrClient(baseURL)) {
+            CoreAdminRequest req = new CoreAdminRequest();
+            req.setAction(CoreAdminAction.STATUS);
+            client.request(req);
+          }
+        });
         assertTrue("Expected an root cause SSL Exception, got: " + ex.toString(),
                    ex.getCause() instanceof SSLException);
       }
@@ -236,7 +239,7 @@ public class TestMiniSolrCloudClusterSSL extends SolrTestCaseJ4 {
   public static void checkClusterWithCollectionCreations(final MiniSolrCloudCluster cluster,
                                                          final SSLTestConfig sslConfig) throws Exception {
 
-    cluster.uploadConfigSet(SolrTestCaseJ4.TEST_PATH().resolve("collection1").resolve("conf"), CONF_NAME);
+    cluster.uploadConfigSet(SolrTestUtil.TEST_PATH().resolve("collection1").resolve("conf"), CONF_NAME);
     
     checkCreateCollection(cluster, "first_collection");
     
@@ -311,22 +314,22 @@ public class TestMiniSolrCloudClusterSSL extends SolrTestCaseJ4 {
                                                        (ssl ? "http://" : "https://"));
           
       // verify solr client using wrong protocol can't talk to server
-      expectThrows(SolrServerException.class, () -> {
-          try (Http2SolrClient client = getRandomizedHttpSolrClient(wrongBaseURL)) {
-            CoreAdminRequest req = new CoreAdminRequest();
-            req.setAction( CoreAdminAction.STATUS );
-            client.request(req);
-          }
-        });
+      SolrTestCaseUtil.expectThrows(SolrServerException.class, () -> {
+        try (Http2SolrClient client = getRandomizedHttpSolrClient(wrongBaseURL)) {
+          CoreAdminRequest req = new CoreAdminRequest();
+          req.setAction(CoreAdminAction.STATUS);
+          client.request(req);
+        }
+      });
       
       if (! sslConfig.isClientAuthMode()) {
         // verify simple HTTP(S) client can't do HEAD request for URL with wrong protocol
         try (CloseableHttpClient client = getSslAwareClientWithNoClientCerts()) {
           final String wrongUrl = wrongBaseURL + "/admin/cores";
           // vastly diff exception details between plain http vs https, not worried about details here
-          expectThrows(IOException.class, () -> {
-              doHeadRequest(client, wrongUrl);
-            });
... 23471 lines suppressed ...


[lucene-solr] 02/03: @1341 Finishing moving to http2 client in final spots, clean up proxy forwarding more and some other things.

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

markrmiller pushed a commit to branch reference_impl_dev
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git

commit da3a67b484b3ca780982132f18a2c2bb2f602615
Author: markrmiller@gmail.com <ma...@gmail.com>
AuthorDate: Wed Feb 10 13:08:36 2021 -0600

    @1341 Finishing moving to http2 client in final spots, clean up proxy forwarding more and some other things.
---
 .../client/solrj/embedded/JettySolrRunner.java     | 15 ++--
 .../src/java/org/apache/solr/cloud/Overseer.java   |  4 +-
 .../java/org/apache/solr/cloud/ZkController.java   |  2 +-
 .../apache/solr/filestore/DistribPackageStore.java |  6 +-
 .../packagemanager/DefaultPackageRepository.java   |  7 +-
 .../apache/solr/packagemanager/PackageManager.java | 16 ++--
 .../apache/solr/packagemanager/PackageUtils.java   | 26 +++---
 .../solr/packagemanager/RepositoryManager.java     | 11 +--
 .../apache/solr/schema/JsonPreAnalyzedParser.java  |  2 +-
 .../solr/security/PKIAuthenticationPlugin.java     | 12 +--
 .../apache/solr/servlet/SolrDispatchFilter.java    |  4 +-
 .../org/apache/solr/update/UpdateShardHandler.java | 15 ----
 .../src/java/org/apache/solr/util/PackageTool.java | 10 +--
 .../src/java/org/apache/solr/util/SolrCLI.java     | 77 ++++++++---------
 .../org/apache/solr/cloud/MoveReplicaTest.java     |  2 +
 .../CollectionsAPIDistClusterPerZkTest.java        |  2 +-
 .../CollectionsAPIDistributedZkTest.java           | 14 ++-
 .../CreateCollectionsIndexAndRestartTest.java      |  3 +-
 .../SimpleCollectionCreateDeleteTest.java          |  2 +-
 .../solr/filestore/TestDistribPackageStore.java    | 20 +++--
 .../solr/handler/admin/ZookeeperReadAPITest.java   | 12 +--
 .../src/test/org/apache/solr/pkg/TestPackages.java | 10 +--
 solr/server/resources/log4j2.xml                   |  2 +-
 .../org/apache/solr/cli/ClusterStateCommand.java   | 16 ++--
 .../client/solrj/cloud/DelegatingCloudManager.java |  5 --
 .../solr/client/solrj/cloud/SolrCloudManager.java  |  3 -
 .../client/solrj/impl/SolrClientCloudManager.java  | 84 ++----------------
 .../solrj/impl/SolrClientNodeStateProvider.java    | 14 +--
 .../solr/common/cloud/ConnectionManager.java       |  6 +-
 .../org/apache/solr/common/cloud/DocRouter.java    |  4 +-
 .../org/apache/solr/common/cloud/SolrZkClient.java | 44 ++++++++--
 .../apache/solr/common/cloud/ZkCmdExecutor.java    |  3 +-
 .../java/org/apache/solr/common/util/Utils.java    | 99 +++++++++++-----------
 33 files changed, 243 insertions(+), 309 deletions(-)

diff --git a/solr/core/src/java/org/apache/solr/client/solrj/embedded/JettySolrRunner.java b/solr/core/src/java/org/apache/solr/client/solrj/embedded/JettySolrRunner.java
index ad6b18c..dfda359 100644
--- a/solr/core/src/java/org/apache/solr/client/solrj/embedded/JettySolrRunner.java
+++ b/solr/core/src/java/org/apache/solr/client/solrj/embedded/JettySolrRunner.java
@@ -20,7 +20,6 @@ import org.apache.lucene.util.Constants;
 import org.apache.solr.client.solrj.SolrClient;
 import org.apache.solr.client.solrj.cloud.SocketProxy;
 import org.apache.solr.client.solrj.impl.Http2SolrClient;
-import org.apache.solr.client.solrj.impl.HttpSolrClient;
 import org.apache.solr.common.ParWork;
 import org.apache.solr.common.SolrException;
 import org.apache.solr.common.cloud.SolrZkClient;
@@ -86,7 +85,7 @@ import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicInteger;
-import java.util.concurrent.atomic.AtomicLong;
+import java.util.concurrent.atomic.LongAdder;
 
 /**
  * Run solr using jetty
@@ -145,12 +144,12 @@ public class JettySolrRunner implements Closeable {
   public static class DebugFilter implements Filter {
     private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
 
-    private final AtomicLong nRequests = new AtomicLong();
+    private final LongAdder nRequests = new LongAdder();
 
     private Set<Delay> delays = ConcurrentHashMap.newKeySet(12);
 
     public long getTotalRequests() {
-      return nRequests.get();
+      return nRequests.longValue();
 
     }
     
@@ -178,7 +177,7 @@ public class JettySolrRunner implements Closeable {
 
     @Override
     public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
-      nRequests.incrementAndGet();
+      nRequests.increment();
       executeDelay();
       filterChain.doFilter(servletRequest, servletResponse);
     }
@@ -842,9 +841,9 @@ public class JettySolrRunner implements Closeable {
   }
 
 
-  public SolrClient newHttp1Client() {
-    return new HttpSolrClient.Builder(getBaseUrl()).
-        withHttpClient(getCoreContainer().getUpdateShardHandler().getDefaultHttpClient()).build();
+  public SolrClient newHttp2Client() {
+    return new Http2SolrClient.Builder(getBaseUrl()).
+        withHttpClient(getCoreContainer().getUpdateShardHandler().getTheSharedHttpClient()).build();
   }
 
   public SolrClient newClient(int connectionTimeoutMillis, int socketTimeoutMillis) {
diff --git a/solr/core/src/java/org/apache/solr/cloud/Overseer.java b/solr/core/src/java/org/apache/solr/cloud/Overseer.java
index b1a4b61..f38d2da 100644
--- a/solr/core/src/java/org/apache/solr/cloud/Overseer.java
+++ b/solr/core/src/java/org/apache/solr/cloud/Overseer.java
@@ -295,13 +295,13 @@ public class Overseer implements SolrCloseable {
 //     stateManagmentExecutor = ParWork.getParExecutorService("stateManagmentExecutor",
 //        1, 1, 3000, new SynchronousQueue());
      taskExecutor = (ParWorkExecutor) ParWork.getParExecutorService("overseerTaskExecutor",
-         4, SysStats.PROC_COUNT, 1000, new BlockingArrayQueue<>(32, 64));
+         4, SysStats.PROC_COUNT * 2, 1000, new BlockingArrayQueue<>(32, 64));
     for (int i = 0; i < 4; i++) {
       taskExecutor.prestartCoreThread();
     }
 
     zkWriterExecutor = (ParWorkExecutor) ParWork.getParExecutorService("overseerZkWriterExecutor",
-        4, SysStats.PROC_COUNT, 1000, new BlockingArrayQueue<>(64, 128));
+        4, SysStats.PROC_COUNT * 2, 1000, new BlockingArrayQueue<>(64, 128));
     for (int i = 0; i < 4; i++) {
       zkWriterExecutor.prestartCoreThread();
     }
diff --git a/solr/core/src/java/org/apache/solr/cloud/ZkController.java b/solr/core/src/java/org/apache/solr/cloud/ZkController.java
index 922e19e..010a1ce 100644
--- a/solr/core/src/java/org/apache/solr/cloud/ZkController.java
+++ b/solr/core/src/java/org/apache/solr/cloud/ZkController.java
@@ -749,7 +749,7 @@ public class ZkController implements Closeable, Runnable {
       cloudManager = new SolrClientCloudManager(
           new ZkDistributedQueueFactory(zkClient),
           cloudSolrClient,
-          cc.getObjectCache(), cc.getUpdateShardHandler().getDefaultHttpClient());
+          cc.getObjectCache(), cc.getUpdateShardHandler().getTheSharedHttpClient());
       cloudManager.getClusterStateProvider().connect();
     }
     return cloudManager;
diff --git a/solr/core/src/java/org/apache/solr/filestore/DistribPackageStore.java b/solr/core/src/java/org/apache/solr/filestore/DistribPackageStore.java
index 3193433..29cc96c 100644
--- a/solr/core/src/java/org/apache/solr/filestore/DistribPackageStore.java
+++ b/solr/core/src/java/org/apache/solr/filestore/DistribPackageStore.java
@@ -198,7 +198,7 @@ public class DistribPackageStore implements PackageStore {
       ByteBuffer metadata = null;
       Map m = null;
       try {
-        metadata = Utils.executeGET(coreContainer.getUpdateShardHandler().getDefaultHttpClient(),
+        metadata = Utils.executeGET(coreContainer.getUpdateShardHandler().getTheSharedHttpClient(),
             baseUrl + "/node/files" + getMetaPath(),
             Utils.newBytesConsumer((int) MAX_PKG_SIZE));
         m = (Map) Utils.fromJSON(metadata.array(), metadata.arrayOffset(), metadata.limit());
@@ -207,7 +207,7 @@ public class DistribPackageStore implements PackageStore {
       }
 
       try {
-        ByteBuffer filedata = Utils.executeGET(coreContainer.getUpdateShardHandler().getDefaultHttpClient(),
+        ByteBuffer filedata = Utils.executeGET(coreContainer.getUpdateShardHandler().getTheSharedHttpClient(),
             baseUrl + "/node/files" + path,
             Utils.newBytesConsumer((int) MAX_PKG_SIZE));
         String sha512 = DigestUtils.sha512Hex(new ByteBufferInputStream(filedata));
@@ -235,7 +235,7 @@ public class DistribPackageStore implements PackageStore {
           String reqUrl = url + "/node/files" + path +
               "?meta=true&wt=javabin&omitHeader=true";
           boolean nodeHasBlob = false;
-          Object nl = Utils.executeGET(coreContainer.getUpdateShardHandler().getDefaultHttpClient(), reqUrl, Utils.JAVABINCONSUMER);
+          Object nl = Utils.executeGET(coreContainer.getUpdateShardHandler().getTheSharedHttpClient(), reqUrl, Utils.JAVABINCONSUMER);
           if (Utils.getObjectByPath(nl, false, Arrays.asList("files", path)) != null) {
             nodeHasBlob = true;
           }
diff --git a/solr/core/src/java/org/apache/solr/packagemanager/DefaultPackageRepository.java b/solr/core/src/java/org/apache/solr/packagemanager/DefaultPackageRepository.java
index cbff8cf..0829736 100644
--- a/solr/core/src/java/org/apache/solr/packagemanager/DefaultPackageRepository.java
+++ b/solr/core/src/java/org/apache/solr/packagemanager/DefaultPackageRepository.java
@@ -27,8 +27,7 @@ import java.util.Map;
 
 import org.apache.commons.io.FileUtils;
 import org.apache.commons.io.FilenameUtils;
-import org.apache.http.impl.client.CloseableHttpClient;
-import org.apache.http.impl.client.HttpClientBuilder;
+import org.apache.solr.client.solrj.impl.Http2SolrClient;
 import org.apache.solr.common.SolrException;
 import org.apache.solr.common.SolrException.ErrorCode;
 import org.slf4j.Logger;
@@ -101,7 +100,7 @@ public class DefaultPackageRepository extends PackageRepository {
   }
 
   private void initPackages() {
-    try (CloseableHttpClient client = HttpClientBuilder.create().build()) {
+    try (Http2SolrClient client = new Http2SolrClient.Builder().build()) {
       SolrPackage[] items = PackageUtils.getJson(client, repositoryURL + "/repository.json", SolrPackage[].class);
 
       packages = new HashMap<>(items.length);
@@ -109,7 +108,7 @@ public class DefaultPackageRepository extends PackageRepository {
         pkg.setRepository(name);
         packages.put(pkg.name, pkg);
       }
-    } catch (IOException ex) {
+    } catch (Exception ex) {
       throw new SolrException(ErrorCode.INVALID_STATE, ex);
     }
     if (log.isDebugEnabled()) {
diff --git a/solr/core/src/java/org/apache/solr/packagemanager/PackageManager.java b/solr/core/src/java/org/apache/solr/packagemanager/PackageManager.java
index caf300c..dcad3a1 100644
--- a/solr/core/src/java/org/apache/solr/packagemanager/PackageManager.java
+++ b/solr/core/src/java/org/apache/solr/packagemanager/PackageManager.java
@@ -33,7 +33,7 @@ import java.util.Scanner;
 import java.util.Set;
 import java.util.stream.Collectors;
 
-import org.apache.solr.client.solrj.impl.HttpSolrClient;
+import org.apache.solr.client.solrj.impl.Http2SolrClient;
 import org.apache.solr.common.NavigableObject;
 import org.apache.solr.common.SolrException;
 import org.apache.solr.common.SolrException.ErrorCode;
@@ -59,7 +59,7 @@ import com.jayway.jsonpath.PathNotFoundException;
 public class PackageManager implements Closeable {
 
   final String solrBaseUrl;
-  final HttpSolrClient solrClient;
+  final Http2SolrClient solrClient;
   final SolrZkClient zkClient;
 
   private Map<String, List<SolrPackageInstance>> packages = null;
@@ -67,7 +67,7 @@ public class PackageManager implements Closeable {
   private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
 
 
-  public PackageManager(HttpSolrClient solrClient, String solrBaseUrl, String zkHost) {
+  public PackageManager(Http2SolrClient solrClient, String solrBaseUrl, String zkHost) {
     this.solrBaseUrl = solrBaseUrl;
     this.solrClient = solrClient;
     this.zkClient = new SolrZkClient(zkHost, 30000);
@@ -117,7 +117,7 @@ public class PackageManager implements Closeable {
   public Map<String, SolrPackageInstance> getPackagesDeployed(String collection) {
     Map<String, String> packages = null;
     try {
-      NavigableObject result = (NavigableObject) Utils.executeGET(solrClient.getHttpClient(),
+      NavigableObject result = (NavigableObject) Utils.executeGET(solrClient,
           solrBaseUrl + PackageUtils.getCollectionParamsPath(collection) + "/PKG_VERSIONS?omitHeader=true&wt=javabin", Utils.JAVABINCONSUMER);
       packages = (Map<String, String>) result._get("/response/params/PKG_VERSIONS", Collections.emptyMap());
     } catch (PathNotFoundException ex) {
@@ -171,7 +171,7 @@ public class PackageManager implements Closeable {
 
       // Get package params
       try {
-        boolean packageParamsExist = ((Map)PackageUtils.getJson(solrClient.getHttpClient(), solrBaseUrl + PackageUtils.getCollectionParamsPath(collection) + "/packages", Map.class)
+        boolean packageParamsExist = ((Map)PackageUtils.getJson(solrClient, solrBaseUrl + PackageUtils.getCollectionParamsPath(collection) + "/packages", Map.class)
             .getOrDefault("response", Collections.emptyMap())).containsKey("params");
         SolrCLI.postJsonToSolr(solrClient, PackageUtils.getCollectionParamsPath(collection),
             getMapper().writeValueAsString(Collections.singletonMap(packageParamsExist? "update": "set",
@@ -274,7 +274,7 @@ public class PackageManager implements Closeable {
   Map<String, String> getPackageParams(String packageName, String collection) {
     try {
       return (Map<String, String>)((Map)((Map)((Map)
-          PackageUtils.getJson(solrClient.getHttpClient(), solrBaseUrl + PackageUtils.getCollectionParamsPath(collection) + "/packages", Map.class)
+          PackageUtils.getJson(solrClient, solrBaseUrl + PackageUtils.getCollectionParamsPath(collection) + "/packages", Map.class)
           .get("response"))
           .get("params"))
           .get("packages")).get(packageName);
@@ -301,7 +301,7 @@ public class PackageManager implements Closeable {
           PackageUtils.printGreen("Executing " + url + " for collection:" + collection);
 
           if ("GET".equalsIgnoreCase(cmd.method)) {
-            String response = PackageUtils.getJsonStringFromUrl(solrClient.getHttpClient(), url);
+            String response = PackageUtils.getJsonStringFromUrl(solrClient, url);
             PackageUtils.printGreen(response);
             String actualValue = JsonPath.parse(response, PackageUtils.jsonPathConfiguration())
                 .read(PackageUtils.resolve(cmd.condition, pkg.parameterDefaults, collectionParameterOverrides, systemParams));
@@ -439,7 +439,7 @@ public class PackageManager implements Closeable {
     Map<String, String> deployed = new HashMap<String, String>();
     for (String collection: allCollections) {
       // Check package version installed
-      String paramsJson = PackageUtils.getJsonStringFromUrl(solrClient.getHttpClient(), solrBaseUrl + PackageUtils.getCollectionParamsPath(collection) + "/PKG_VERSIONS?omitHeader=true");
+      String paramsJson = PackageUtils.getJsonStringFromUrl(solrClient,solrBaseUrl + PackageUtils.getCollectionParamsPath(collection) + "/PKG_VERSIONS?omitHeader=true");
       String version = null;
       try {
         version = JsonPath.parse(paramsJson, PackageUtils.jsonPathConfiguration())
diff --git a/solr/core/src/java/org/apache/solr/packagemanager/PackageUtils.java b/solr/core/src/java/org/apache/solr/packagemanager/PackageUtils.java
index 602a9e5..e355cdd 100644
--- a/solr/core/src/java/org/apache/solr/packagemanager/PackageUtils.java
+++ b/solr/core/src/java/org/apache/solr/packagemanager/PackageUtils.java
@@ -26,14 +26,11 @@ import java.util.zip.ZipEntry;
 import java.util.zip.ZipFile;
 
 import org.apache.commons.io.IOUtils;
-import org.apache.http.HttpResponse;
-import org.apache.http.client.HttpClient;
-import org.apache.http.client.methods.HttpGet;
 import org.apache.lucene.util.SuppressForbidden;
 import org.apache.solr.client.solrj.SolrClient;
 import org.apache.solr.client.solrj.SolrRequest;
 import org.apache.solr.client.solrj.SolrServerException;
-import org.apache.solr.client.solrj.impl.HttpSolrClient;
+import org.apache.solr.client.solrj.impl.Http2SolrClient;
 import org.apache.solr.client.solrj.request.V2Request;
 import org.apache.solr.client.solrj.response.V2Response;
 import org.apache.solr.common.SolrException;
@@ -109,7 +106,7 @@ public class PackageUtils {
   /**
    * Download JSON from the url and deserialize into klass.
    */
-  public static <T> T getJson(HttpClient client, String url, Class<T> klass) {
+  public static <T> T getJson(Http2SolrClient client, String url, Class<T> klass) {
     try {
       return getMapper().readValue(getJsonStringFromUrl(client, url), klass);
     } catch (IOException e) {
@@ -139,15 +136,14 @@ public class PackageUtils {
   /**
    * Returns JSON string from a given URL
    */
-  public static String getJsonStringFromUrl(HttpClient client, String url) {
+  public static String getJsonStringFromUrl(Http2SolrClient client, String url) {
     try {
-      HttpResponse resp = client.execute(new HttpGet(url));
-      if (resp.getStatusLine().getStatusCode() != 200) {
-        throw new SolrException(ErrorCode.NOT_FOUND,
-            "Error (code="+resp.getStatusLine().getStatusCode()+") fetching from URL: "+url);
+      Http2SolrClient.SimpleResponse resp = Http2SolrClient.GET(url, client);
+      if (resp.status != 200) {
+        throw new SolrException(ErrorCode.NOT_FOUND, "Error (code=" + resp.status + ") fetching from URL: " + url);
       }
-      return IOUtils.toString(resp.getEntity().getContent(), "UTF-8");
-    } catch (UnsupportedOperationException | IOException e) {
+      return resp.asString;
+    } catch (Exception e) {
       throw new RuntimeException(e);
     }
   }
@@ -162,8 +158,8 @@ public class PackageUtils {
   /**
    * Fetches a manifest file from the File Store / Package Store. A SHA512 check is enforced after fetching.
    */
-  public static Manifest fetchManifest(HttpSolrClient solrClient, String solrBaseUrl, String manifestFilePath, String expectedSHA512) throws MalformedURLException, IOException {
-    String manifestJson = PackageUtils.getJsonStringFromUrl(solrClient.getHttpClient(), solrBaseUrl + "/api/node/files" + manifestFilePath);
+  public static Manifest fetchManifest(Http2SolrClient solrClient, String solrBaseUrl, String manifestFilePath, String expectedSHA512) throws MalformedURLException, IOException {
+    String manifestJson = PackageUtils.getJsonStringFromUrl(solrClient, solrBaseUrl + "/api/node/files" + manifestFilePath);
     String calculatedSHA512 = BlobRepository.sha512Digest(ByteBuffer.wrap(manifestJson.getBytes("UTF-8")));
     if (expectedSHA512.equals(calculatedSHA512) == false) {
       throw new SolrException(ErrorCode.UNAUTHORIZED, "The manifest SHA512 doesn't match expected SHA512. Possible unauthorized manipulation. "
@@ -254,7 +250,7 @@ public class PackageUtils {
     return "/api/collections/" + collection + "/config/params";
   }
 
-  public static void uploadKey(byte bytes[], String path, Path home, HttpSolrClient client) throws IOException {
+  public static void uploadKey(byte bytes[], String path, Path home) throws IOException {
     ByteBuffer buf = ByteBuffer.wrap(bytes);
     PackageStoreAPI.MetaData meta = PackageStoreAPI._createJsonMetaData(buf, null);
     DistribPackageStore._persistToFile(home, path, buf, ByteBuffer.wrap(Utils.toJSON(meta)));
diff --git a/solr/core/src/java/org/apache/solr/packagemanager/RepositoryManager.java b/solr/core/src/java/org/apache/solr/packagemanager/RepositoryManager.java
index 4090094..c6b9f4d 100644
--- a/solr/core/src/java/org/apache/solr/packagemanager/RepositoryManager.java
+++ b/solr/core/src/java/org/apache/solr/packagemanager/RepositoryManager.java
@@ -40,6 +40,7 @@ import org.apache.commons.io.IOUtils;
 import org.apache.lucene.util.Version;
 import org.apache.solr.client.solrj.SolrRequest;
 import org.apache.solr.client.solrj.SolrServerException;
+import org.apache.solr.client.solrj.impl.Http2SolrClient;
 import org.apache.solr.client.solrj.impl.HttpSolrClient;
 import org.apache.solr.client.solrj.request.V2Request;
 import org.apache.solr.client.solrj.request.beans.Package;
@@ -70,9 +71,9 @@ public class RepositoryManager {
 
   public static final String systemVersion = Version.LATEST.toString();
 
-  final HttpSolrClient solrClient;
+  final Http2SolrClient solrClient;
 
-  public RepositoryManager(HttpSolrClient solrClient, PackageManager packageManager) {
+  public RepositoryManager(Http2SolrClient solrClient, PackageManager packageManager) {
     this.packageManager = packageManager;
     this.solrClient = solrClient;
   }
@@ -136,13 +137,13 @@ public class RepositoryManager {
   public void addKey(byte[] key, String destinationKeyFilename) throws Exception {
     // get solr_home directory from info servlet
     String systemInfoUrl = solrClient.getBaseURL() + "/solr/admin/info/system";
-    Map<String,Object> systemInfo = SolrCLI.getJson(solrClient.getHttpClient(), systemInfoUrl, 2, true);
+    Map<String,Object> systemInfo = SolrCLI.getJson(solrClient, systemInfoUrl, 2, true);
     String solrHome = (String) systemInfo.get("solr_home");
     
     // put the public key into package store's trusted key store and request a sync.
     String path = PackageStoreAPI.KEYS_DIR + "/" + destinationKeyFilename;
-    PackageUtils.uploadKey(key, path, Paths.get(solrHome), solrClient);
-    PackageUtils.getJsonStringFromUrl(solrClient.getHttpClient(), solrClient.getBaseURL() + "/api/node/files" + path + "?sync=true");
+    PackageUtils.uploadKey(key, path, Paths.get(solrHome));
+    PackageUtils.getJsonStringFromUrl(solrClient, solrClient.getBaseURL() + "/api/node/files" + path + "?sync=true");
   }
 
   private String getRepositoriesJson(SolrZkClient zkClient) throws UnsupportedEncodingException, KeeperException, InterruptedException {
diff --git a/solr/core/src/java/org/apache/solr/schema/JsonPreAnalyzedParser.java b/solr/core/src/java/org/apache/solr/schema/JsonPreAnalyzedParser.java
index 7cad0f4..c5fad49 100644
--- a/solr/core/src/java/org/apache/solr/schema/JsonPreAnalyzedParser.java
+++ b/solr/core/src/java/org/apache/solr/schema/JsonPreAnalyzedParser.java
@@ -70,7 +70,7 @@ public class JsonPreAnalyzedParser implements PreAnalyzedParser {
   public ParseResult parse(Reader reader, AttributeSource parent)
       throws IOException {
     ParseResult res = new ParseResult();
-    StringBuilder sb = new StringBuilder();
+    StringBuilder sb = new StringBuilder(128);
     char[] buf = new char[128];
     int cnt;
     while ((cnt = reader.read(buf)) > 0) {
diff --git a/solr/core/src/java/org/apache/solr/security/PKIAuthenticationPlugin.java b/solr/core/src/java/org/apache/solr/security/PKIAuthenticationPlugin.java
index 7cdbeb2..fbd334f 100644
--- a/solr/core/src/java/org/apache/solr/security/PKIAuthenticationPlugin.java
+++ b/solr/core/src/java/org/apache/solr/security/PKIAuthenticationPlugin.java
@@ -34,9 +34,7 @@ import org.apache.http.HttpEntity;
 import org.apache.http.HttpException;
 import org.apache.http.HttpRequest;
 import org.apache.http.HttpRequestInterceptor;
-import org.apache.http.HttpResponse;
 import org.apache.http.auth.BasicUserPrincipal;
-import org.apache.http.client.methods.HttpGet;
 import org.apache.http.protocol.HttpContext;
 import org.apache.solr.client.solrj.impl.Http2SolrClient;
 import org.apache.solr.client.solrj.impl.HttpClientUtil;
@@ -191,13 +189,11 @@ public class PKIAuthenticationPlugin extends AuthenticationPlugin implements Htt
     InputStream is = null;
     try {
       String uri = url + PublicKeyHandler.PATH + "?wt=json&omitHeader=true";
-      log.debug("Fetching fresh public key from : {}",uri);
-      HttpResponse rsp = cores.getUpdateShardHandler().getDefaultHttpClient()
-          .execute(new HttpGet(uri), HttpClientUtil.createNewHttpClientRequestContext());
-      is  = rsp.getEntity().getContent();
+      if (log.isDebugEnabled()) log.debug("Fetching fresh public key from : {}",uri);
 
-      byte[] bytes = is.readAllBytes();
-      Map m = (Map) Utils.fromJSON(bytes);
+      Http2SolrClient.SimpleResponse resp = Http2SolrClient.GET(uri, cores.getUpdateShardHandler().getTheSharedHttpClient());
+
+      Map m = (Map) Utils.fromJSON(resp.bytes);
       String key = (String) m.get("key");
       if (key == null) {
         log.error("No key available from {} {}", url, PublicKeyHandler.PATH);
diff --git a/solr/core/src/java/org/apache/solr/servlet/SolrDispatchFilter.java b/solr/core/src/java/org/apache/solr/servlet/SolrDispatchFilter.java
index f866a15..828368a 100644
--- a/solr/core/src/java/org/apache/solr/servlet/SolrDispatchFilter.java
+++ b/solr/core/src/java/org/apache/solr/servlet/SolrDispatchFilter.java
@@ -236,8 +236,8 @@ public class SolrDispatchFilter extends BaseSolrFilter {
         }
       }
     } finally {
-      if (cores != null) {
-        this.httpClient = cores.getUpdateShardHandler().getTheSharedHttpClient().getHttpClient();
+      if (coresInit != null) {
+        this.httpClient = coresInit.getUpdateShardHandler().getTheSharedHttpClient().getHttpClient();
       }
       init.countDown();
       log.info("SolrDispatchFilter.init() end");
diff --git a/solr/core/src/java/org/apache/solr/update/UpdateShardHandler.java b/solr/core/src/java/org/apache/solr/update/UpdateShardHandler.java
index a9179c4..92aa409 100644
--- a/solr/core/src/java/org/apache/solr/update/UpdateShardHandler.java
+++ b/solr/core/src/java/org/apache/solr/update/UpdateShardHandler.java
@@ -23,8 +23,6 @@ import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ExecutorService;
 
 import com.google.common.annotations.VisibleForTesting;
-import org.apache.http.client.HttpClient;
-import org.apache.http.impl.client.CloseableHttpClient;
 import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
 import org.apache.solr.client.solrj.impl.BaseCloudSolrClient;
 import org.apache.solr.client.solrj.impl.Http2SolrClient;
@@ -61,8 +59,6 @@ public class UpdateShardHandler implements SolrInfoBean {
 
   private final Http2SolrClient recoveryOnlyClient;
 
-  private final CloseableHttpClient defaultClient;
-
   private ExecutorService recoveryExecutor;
 
   private final InstrumentedPoolingHttpClientConnectionManager defaultConnectionManager;
@@ -100,8 +96,6 @@ public class UpdateShardHandler implements SolrInfoBean {
     httpRequestExecutor = new InstrumentedHttpRequestExecutor(getMetricNameStrategy(cfg));
     //updateHttpListenerFactory = new InstrumentedHttpListenerFactory(getNameStrategy(cfg));
 
-    defaultClient = HttpClientUtil.createClient(clientParams, defaultConnectionManager, true, httpRequestExecutor);
-
     Http2SolrClient.Builder updateOnlyClientBuilder = new Http2SolrClient.Builder();
     if (cfg != null) {
       updateOnlyClientBuilder
@@ -200,11 +194,6 @@ public class UpdateShardHandler implements SolrInfoBean {
   public SolrMetricsContext getSolrMetricsContext() {
     return solrMetricsContext;
   }
-
-  // if you are looking for a client to use, it's probably this one.
-  public HttpClient getDefaultHttpClient() {
-    return defaultClient;
-  }
   
   // don't introduce a bug, this client is for sending updates only!
   public Http2SolrClient getTheSharedHttpClient() {
@@ -240,10 +229,6 @@ public class UpdateShardHandler implements SolrInfoBean {
 
 
     try (ParWork closer = new ParWork(this, true, false)) {
-      closer.collect("", () -> {
-        HttpClientUtil.close(defaultClient);
-        return defaultClient;
-      });
       closer.collect(recoveryOnlyClient);
       closer.collect(searchOnlyClient);
       closer.collect(updateOnlyClient);
diff --git a/solr/core/src/java/org/apache/solr/util/PackageTool.java b/solr/core/src/java/org/apache/solr/util/PackageTool.java
index 5adeccd..74bd7f6 100644
--- a/solr/core/src/java/org/apache/solr/util/PackageTool.java
+++ b/solr/core/src/java/org/apache/solr/util/PackageTool.java
@@ -25,12 +25,10 @@ import org.apache.commons.cli.CommandLine;
 import org.apache.commons.cli.Option;
 import org.apache.commons.cli.OptionBuilder;
 import org.apache.commons.io.FileUtils;
-import org.apache.http.impl.client.CloseableHttpClient;
 import org.apache.logging.log4j.Level;
 import org.apache.logging.log4j.core.config.Configurator;
 import org.apache.lucene.util.SuppressForbidden;
-import org.apache.solr.client.solrj.impl.HttpClientUtil;
-import org.apache.solr.client.solrj.impl.HttpSolrClient;
+import org.apache.solr.client.solrj.impl.Http2SolrClient;
 import org.apache.solr.common.ParWork;
 import org.apache.solr.common.SolrException;
 import org.apache.solr.common.SolrException.ErrorCode;
@@ -82,7 +80,7 @@ public class PackageTool extends SolrCLI.ToolBase {
       log.info("ZK: {}", zkHost);
       String cmd = cli.getArgList().size() == 0? "help": cli.getArgs()[0];
 
-      try (HttpSolrClient solrClient = new HttpSolrClient.Builder(solrBaseUrl).markInternalRequest().build()) {
+      try (Http2SolrClient solrClient = new Http2SolrClient.Builder(solrBaseUrl).markInternalRequest().build()) {
         if (cmd != null) {
           packageManager = new PackageManager(solrClient, solrBaseUrl, zkHost); 
           try {
@@ -279,7 +277,7 @@ public class PackageTool extends SolrCLI.ToolBase {
       return zkHost;
 
     String systemInfoUrl = solrUrl+"/admin/info/system";
-    CloseableHttpClient httpClient = SolrCLI.getHttpClient();
+    Http2SolrClient httpClient = SolrCLI.getHttpClient();
     try {
       // hit Solr to get system info
       Map<String,Object> systemInfo = SolrCLI.getJson(httpClient, systemInfoUrl, 2, true);
@@ -296,7 +294,7 @@ public class PackageTool extends SolrCLI.ToolBase {
         zkHost = zookeeper;
       }
     } finally {
-      HttpClientUtil.close(httpClient);
+      httpClient.close();
     }
 
     return zkHost;
diff --git a/solr/core/src/java/org/apache/solr/util/SolrCLI.java b/solr/core/src/java/org/apache/solr/util/SolrCLI.java
index 255ac85..325fe0b 100755
--- a/solr/core/src/java/org/apache/solr/util/SolrCLI.java
+++ b/solr/core/src/java/org/apache/solr/util/SolrCLI.java
@@ -37,12 +37,8 @@ import org.apache.http.HttpResponse;
 import org.apache.http.NoHttpResponseException;
 import org.apache.http.StatusLine;
 import org.apache.http.client.ClientProtocolException;
-import org.apache.http.client.HttpClient;
 import org.apache.http.client.HttpResponseException;
 import org.apache.http.client.ResponseHandler;
-import org.apache.http.client.methods.HttpGet;
-import org.apache.http.client.methods.HttpHead;
-import org.apache.http.client.utils.URIBuilder;
 import org.apache.http.conn.ConnectTimeoutException;
 import org.apache.http.impl.client.CloseableHttpClient;
 import org.apache.http.util.EntityUtils;
@@ -51,7 +47,9 @@ import org.apache.solr.client.solrj.SolrClient;
 import org.apache.solr.client.solrj.SolrQuery;
 import org.apache.solr.client.solrj.SolrRequest;
 import org.apache.solr.client.solrj.SolrServerException;
+import org.apache.solr.client.solrj.impl.CloudHttp2SolrClient;
 import org.apache.solr.client.solrj.impl.CloudSolrClient;
+import org.apache.solr.client.solrj.impl.Http2SolrClient;
 import org.apache.solr.client.solrj.impl.HttpClientUtil;
 import org.apache.solr.client.solrj.impl.HttpSolrClient;
 import org.apache.solr.client.solrj.impl.ZkClientClusterStateProvider;
@@ -70,10 +68,10 @@ import org.apache.solr.common.cloud.ZkConfigManager;
 import org.apache.solr.common.cloud.ZkStateReader;
 import org.apache.solr.common.params.CollectionAdminParams;
 import org.apache.solr.common.params.CommonParams;
-import org.apache.solr.common.params.ModifiableSolrParams;
 import org.apache.solr.common.util.ContentStreamBase;
 import org.apache.solr.common.util.NamedList;
 import org.apache.solr.common.util.StrUtils;
+import org.apache.solr.common.util.Utils;
 import org.apache.solr.security.Sha256AuthenticationProvider;
 import org.apache.solr.util.configuration.SSLConfigurationsFactory;
 import org.noggit.CharArr;
@@ -122,6 +120,7 @@ import java.util.Optional;
 import java.util.Scanner;
 import java.util.Set;
 import java.util.TreeSet;
+import java.util.concurrent.ExecutionException;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.TimeoutException;
 import java.util.stream.Collectors;
@@ -208,7 +207,7 @@ public class SolrCLI implements CLIO {
       String zkHost = cli.getOptionValue("zkHost", ZK_HOST);
 
       log.debug("Connecting to Solr cluster: {}", zkHost);
-      try (CloudSolrClient cloudSolrClient = new CloudSolrClient.Builder(Collections.singletonList(zkHost), Optional.empty()).build()) {
+      try (CloudHttp2SolrClient cloudSolrClient = new CloudHttp2SolrClient.Builder(Collections.singletonList(zkHost), Optional.empty()).build()) {
 
         String collection = cli.getOptionValue("collection");
         if (collection != null)
@@ -222,7 +221,7 @@ public class SolrCLI implements CLIO {
     /**
      * Runs a SolrCloud tool with CloudSolrClient initialized
      */
-    protected abstract void runCloudTool(CloudSolrClient cloudSolrClient, CommandLine cli)
+    protected abstract void runCloudTool(CloudHttp2SolrClient cloudSolrClient, CommandLine cli)
         throws Exception;
   }
 
@@ -582,9 +581,11 @@ public class SolrCLI implements CLIO {
    * @throws SolrException if auth/autz problems
    * @throws IOException if connection failure
    */
-  private static int attemptHttpHead(String url, HttpClient httpClient) throws SolrException, IOException {
-    HttpResponse response = httpClient.execute(new HttpHead(url), HttpClientUtil.createNewHttpClientRequestContext());
-    int code = response.getStatusLine().getStatusCode();
+  private static int attemptHttpHead(String url, Http2SolrClient httpClient) throws SolrException, IOException, InterruptedException, ExecutionException, TimeoutException {
+
+
+    int code = Http2SolrClient.HEAD(url, httpClient);
+
     if (code == UNAUTHORIZED.code || code == FORBIDDEN.code) {
       throw new SolrException(SolrException.ErrorCode.getErrorCode(code),
           "Solr requires authentication for " + url + ". Please supply valid credentials. HTTP code=" + code);
@@ -597,12 +598,8 @@ public class SolrCLI implements CLIO {
         && Arrays.asList(UNAUTHORIZED.code, FORBIDDEN.code).contains(((SolrException) exc).code()));
   }
 
-  public static CloseableHttpClient getHttpClient() {
-    ModifiableSolrParams params = new ModifiableSolrParams();
-    params.set(HttpClientUtil.PROP_MAX_CONNECTIONS, 128);
-    params.set(HttpClientUtil.PROP_MAX_CONNECTIONS_PER_HOST, 32);
-    params.set(HttpClientUtil.PROP_FOLLOW_REDIRECTS, false);
-    return HttpClientUtil.createClient(params);
+  public static Http2SolrClient getHttpClient() {
+    return new Http2SolrClient.Builder().build();
   }
 
   @SuppressWarnings("deprecation")
@@ -632,11 +629,11 @@ public class SolrCLI implements CLIO {
    */
   public static Map<String,Object> getJson(String getUrl) throws Exception {
     Map<String,Object> json = null;
-    CloseableHttpClient httpClient = getHttpClient();
+    Http2SolrClient httpClient = getHttpClient();
     try {
       json = getJson(httpClient, getUrl, 2, true);
     } finally {
-      closeHttpClient(httpClient);
+      httpClient.close();
     }
     return json;
   }
@@ -644,7 +641,7 @@ public class SolrCLI implements CLIO {
   /**
    * Utility function for sending HTTP GET request to Solr with built-in retry support.
    */
-  public static Map<String,Object> getJson(HttpClient httpClient, String getUrl, int attempts, boolean isFirstAttempt) throws Exception {
+  public static Map<String,Object> getJson(Http2SolrClient httpClient, String getUrl, int attempts, boolean isFirstAttempt) throws Exception {
     Map<String,Object> json = null;
     if (attempts >= 1) {
       try {
@@ -705,13 +702,13 @@ public class SolrCLI implements CLIO {
    * validation of the response.
    */
   @SuppressWarnings({"unchecked"})
-  public static Map<String,Object> getJson(HttpClient httpClient, String getUrl) throws Exception {
+  public static Map<String,Object> getJson(Http2SolrClient httpClient, String getUrl) throws Exception {
     try {
       // ensure we're requesting JSON back from Solr
-      HttpGet httpGet = new HttpGet(new URIBuilder(getUrl).setParameter(CommonParams.WT, CommonParams.JSON).build());
+      Http2SolrClient.SimpleResponse resp = Http2SolrClient.GET(getUrl + "?" + CommonParams.WT + "=" + CommonParams.JSON, httpClient);
 
       // make the request and get back a parsed JSON object
-      Map<String, Object> json = httpClient.execute(httpGet, new SolrResponseHandler(), HttpClientUtil.createNewHttpClientRequestContext());
+      Map<String, Object> json = (Map<String,Object>) Utils.fromJSON(resp.bytes);
       // check the response JSON from Solr to see if it is an error
       Long statusCode = asLong("/responseHeader/status", json);
       if (statusCode == -1) {
@@ -735,7 +732,7 @@ public class SolrCLI implements CLIO {
         }
       }
       return json;
-    } catch (ClientProtocolException cpe) {
+    } catch (Exception cpe) {
       // Currently detecting authentication by string-matching the HTTP response
       // Perhaps SolrClient should have thrown an exception itself??
       if (cpe.getMessage().contains("HTTP ERROR 401") || cpe.getMessage().contentEquals("HTTP ERROR 403")) {
@@ -932,20 +929,20 @@ public class SolrCLI implements CLIO {
         solrUrl += "/";
 
       String systemInfoUrl = solrUrl+"admin/info/system";
-      CloseableHttpClient httpClient = getHttpClient();
+      Http2SolrClient httpClient = getHttpClient();
       try {
         // hit Solr to get system info
         Map<String,Object> systemInfo = getJson(httpClient, systemInfoUrl, 2, true);
         // convert raw JSON into user-friendly output
         status = reportStatus(solrUrl, systemInfo, httpClient);
       } finally {
-        closeHttpClient(httpClient);
+        httpClient.close();
       }
 
       return status;
     }
 
-    public Map<String,Object> reportStatus(String solrUrl, Map<String,Object> info, HttpClient httpClient)
+    public Map<String,Object> reportStatus(String solrUrl, Map<String,Object> info, Http2SolrClient httpClient)
         throws Exception
     {
       Map<String,Object> status = new LinkedHashMap<String,Object>();
@@ -973,7 +970,7 @@ public class SolrCLI implements CLIO {
      * Calls the CLUSTERSTATUS endpoint in Solr to get basic status information about
      * the SolrCloud cluster.
      */
-    protected Map<String,String> getCloudStatus(HttpClient httpClient, String solrUrl, String zkHost)
+    protected Map<String,String> getCloudStatus(Http2SolrClient httpClient, String solrUrl, String zkHost)
         throws Exception
     {
       Map<String,String> cloudStatus = new LinkedHashMap<String,String>();
@@ -1190,7 +1187,7 @@ public class SolrCLI implements CLIO {
     }
 
     @Override
-    protected void runCloudTool(CloudSolrClient cloudSolrClient, CommandLine cli) throws Exception {
+    protected void runCloudTool(CloudHttp2SolrClient cloudSolrClient, CommandLine cli) throws Exception {
       raiseLogLevelUnlessVerbose(cli);
       String collection = cli.getOptionValue("collection");
       if (collection == null)
@@ -1258,7 +1255,7 @@ public class SolrCLI implements CLIO {
             q = new SolrQuery("*:*");
             q.setRows(0);
             q.set(DISTRIB, "false");
-            try (HttpSolrClient solr = new HttpSolrClient.Builder(coreUrl).markInternalRequest().build()) {
+            try (Http2SolrClient solr = new Http2SolrClient.Builder(coreUrl).markInternalRequest().build()) {
 
               String solrUrl = solr.getBaseURL();
 
@@ -1267,7 +1264,7 @@ public class SolrCLI implements CLIO {
 
               int lastSlash = solrUrl.lastIndexOf('/');
               String systemInfoUrl = solrUrl.substring(0,lastSlash)+"/admin/info/system";
-              Map<String,Object> info = getJson(solr.getHttpClient(), systemInfoUrl, 2, true);
+              Map<String,Object> info = getJson(solr, systemInfoUrl, 2, true);
               uptime = uptime(asLong("/jvm/jmx/upTimeMS", info));
               String usedMemory = asString("/jvm/memory/used", info);
               String totalMemory = asString("/jvm/memory/total", info);
@@ -1419,7 +1416,7 @@ public class SolrCLI implements CLIO {
       solrUrl += "/";
 
     String systemInfoUrl = solrUrl+"admin/info/system";
-    CloseableHttpClient httpClient = getHttpClient();
+    Http2SolrClient httpClient = getHttpClient();
     try {
       // hit Solr to get system info
       Map<String,Object> systemInfo = getJson(httpClient, systemInfoUrl, 2, true);
@@ -1437,7 +1434,7 @@ public class SolrCLI implements CLIO {
         zkHost = zookeeper;
       }
     } finally {
-      HttpClientUtil.close(httpClient);
+      httpClient.close();
     }
 
     return zkHost;
@@ -1690,7 +1687,7 @@ public class SolrCLI implements CLIO {
       String coreName = cli.getOptionValue(NAME);
 
       String systemInfoUrl = solrUrl+"admin/info/system";
-      CloseableHttpClient httpClient = getHttpClient();
+      Http2SolrClient httpClient = getHttpClient();
       String solrHome = null;
       try {
         Map<String,Object> systemInfo = getJson(httpClient, systemInfoUrl, 2, true);
@@ -1705,7 +1702,7 @@ public class SolrCLI implements CLIO {
           solrHome = configsetsDir.getParentFile().getAbsolutePath();
 
       } finally {
-        closeHttpClient(httpClient);
+        httpClient.close();
       }
 
       String coreStatusUrl = solrUrl+"admin/cores?action=STATUS&core="+coreName;
@@ -1783,7 +1780,7 @@ public class SolrCLI implements CLIO {
         solrUrl += "/";
 
       String systemInfoUrl = solrUrl+"admin/info/system";
-      CloseableHttpClient httpClient = getHttpClient();
+      Http2SolrClient httpClient = getHttpClient();
 
       ToolBase tool = null;
       try {
@@ -1795,7 +1792,7 @@ public class SolrCLI implements CLIO {
         }
         tool.runImpl(cli);
       } finally {
-        closeHttpClient(httpClient);
+        httpClient.close();
       }
     }
 
@@ -2388,16 +2385,16 @@ public class SolrCLI implements CLIO {
         solrUrl += "/";
 
       String systemInfoUrl = solrUrl+"admin/info/system";
-      CloseableHttpClient httpClient = getHttpClient();
+      Http2SolrClient httpClient = getHttpClient();
       try {
         Map<String,Object> systemInfo = getJson(httpClient, systemInfoUrl, 2, true);
         if ("solrcloud".equals(systemInfo.get("mode"))) {
           deleteCollection(cli);
         } else {
-          deleteCore(cli, httpClient, solrUrl);
+          deleteCore(cli, solrUrl);
         }
       } finally {
-        closeHttpClient(httpClient);
+        httpClient.close();
       }
     }
 
@@ -2490,7 +2487,7 @@ public class SolrCLI implements CLIO {
       echo("Deleted collection '" + collectionName + "' using command:\n" + deleteCollectionUrl);
     }
 
-    protected void deleteCore(CommandLine cli, CloseableHttpClient httpClient, String solrUrl) throws Exception {
+    protected void deleteCore(CommandLine cli, String solrUrl) throws Exception {
       String coreName = cli.getOptionValue(NAME);
       String deleteCoreUrl =
           String.format(Locale.ROOT,
diff --git a/solr/core/src/test/org/apache/solr/cloud/MoveReplicaTest.java b/solr/core/src/test/org/apache/solr/cloud/MoveReplicaTest.java
index 582a57b..4362e75 100644
--- a/solr/core/src/test/org/apache/solr/cloud/MoveReplicaTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/MoveReplicaTest.java
@@ -157,6 +157,8 @@ public class MoveReplicaTest extends SolrCloudTestCase {
     }
     assertTrue(success);
 
+    Thread.sleep(50);
+
     assertEquals(100,  cluster.getSolrClient().query(coll, new SolrQuery("*:*")).getResults().getNumFound());
 
 //    assertEquals("should be one less core on the source node!", sourceNumCores - 1, getNumOfCores(cloudClient, replica.getNodeName(), coll, replica.getType().name()));
diff --git a/solr/core/src/test/org/apache/solr/cloud/api/collections/CollectionsAPIDistClusterPerZkTest.java b/solr/core/src/test/org/apache/solr/cloud/api/collections/CollectionsAPIDistClusterPerZkTest.java
index 5d2c829..8c40162 100644
--- a/solr/core/src/test/org/apache/solr/cloud/api/collections/CollectionsAPIDistClusterPerZkTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/api/collections/CollectionsAPIDistClusterPerZkTest.java
@@ -105,7 +105,7 @@ public class CollectionsAPIDistClusterPerZkTest extends SolrCloudTestCase {
   
   @After
   public void tearDownCluster() throws Exception {
-    cluster.deleteAllCollections();
+
   }
 
   @Test
diff --git a/solr/core/src/test/org/apache/solr/cloud/api/collections/CollectionsAPIDistributedZkTest.java b/solr/core/src/test/org/apache/solr/cloud/api/collections/CollectionsAPIDistributedZkTest.java
index b044358..f54aa39 100644
--- a/solr/core/src/test/org/apache/solr/cloud/api/collections/CollectionsAPIDistributedZkTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/api/collections/CollectionsAPIDistributedZkTest.java
@@ -17,8 +17,6 @@
 package org.apache.solr.cloud.api.collections;
 
 import org.apache.solr.client.solrj.SolrRequest;
-import org.apache.solr.client.solrj.SolrServerException;
-import org.apache.solr.client.solrj.impl.BaseHttpSolrClient;
 import org.apache.solr.client.solrj.impl.CloudHttp2SolrClient;
 import org.apache.solr.client.solrj.request.CollectionAdminRequest;
 import org.apache.solr.client.solrj.request.QueryRequest;
@@ -33,8 +31,8 @@ import org.apache.solr.common.params.CommonParams;
 import org.apache.solr.common.params.ModifiableSolrParams;
 import org.apache.solr.common.util.RetryUtil;
 import org.apache.solr.util.TestInjection;
-import org.junit.After;
-import org.junit.Before;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
 import org.junit.Ignore;
 import org.junit.Test;
 import org.slf4j.Logger;
@@ -58,8 +56,8 @@ public class CollectionsAPIDistributedZkTest extends SolrCloudTestCase {
     return configSet;
   }
 
-  @Before
-  public void setupCluster() throws Exception {
+  @BeforeClass
+  public static void setupCluster() throws Exception {
     // we don't want this test to have zk timeouts
     System.setProperty("zkClientTimeout", "60000");
     if (TEST_NIGHTLY) {
@@ -74,8 +72,8 @@ public class CollectionsAPIDistributedZkTest extends SolrCloudTestCase {
         .configure();
   }
   
-  @After
-  public void tearDownCluster() throws Exception {
+  @AfterClass
+  public static void tearDownCluster() throws Exception {
     if (cluster != null) cluster.shutdown();
     cluster = null;
   }
diff --git a/solr/core/src/test/org/apache/solr/cloud/api/collections/CreateCollectionsIndexAndRestartTest.java b/solr/core/src/test/org/apache/solr/cloud/api/collections/CreateCollectionsIndexAndRestartTest.java
index ca54954..455f553 100644
--- a/solr/core/src/test/org/apache/solr/cloud/api/collections/CreateCollectionsIndexAndRestartTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/api/collections/CreateCollectionsIndexAndRestartTest.java
@@ -16,6 +16,7 @@
  */
 package org.apache.solr.cloud.api.collections;
 
+import org.apache.lucene.util.LuceneTestCase;
 import org.apache.lucene.util.LuceneTestCase.Slow;
 import org.apache.solr.client.solrj.embedded.JettySolrRunner;
 import org.apache.solr.client.solrj.request.CollectionAdminRequest;
@@ -35,7 +36,7 @@ import java.util.concurrent.Future;
 import java.util.concurrent.TimeUnit;
 
 @Slow
-//@LuceneTestCase.AwaitsFix(bugUrl = "This an experimental test class")
+@LuceneTestCase.Nightly
 public class CreateCollectionsIndexAndRestartTest extends SolrCloudTestCase {
   private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
 
diff --git a/solr/core/src/test/org/apache/solr/cloud/api/collections/SimpleCollectionCreateDeleteTest.java b/solr/core/src/test/org/apache/solr/cloud/api/collections/SimpleCollectionCreateDeleteTest.java
index e5e35a0..423d2e9 100644
--- a/solr/core/src/test/org/apache/solr/cloud/api/collections/SimpleCollectionCreateDeleteTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/api/collections/SimpleCollectionCreateDeleteTest.java
@@ -65,7 +65,7 @@ public class SimpleCollectionCreateDeleteTest extends SolrCloudBridgeTestCase {
       assertFalse(cloudClient.getZkStateReader().getZkClient().exists(ZkStateReader.COLLECTIONS_ZKNODE + "/" + collectionName));
       
       // currently, removing a collection does not wait for cores to be unloaded
-      TimeOut timeout = new TimeOut(30, TimeUnit.SECONDS, TimeSource.NANO_TIME);
+      TimeOut timeout = new TimeOut(30, TimeUnit.SECONDS, 50, TimeSource.NANO_TIME);
       while (true) {
         
         if( timeout.hasTimedOut() ) {
diff --git a/solr/core/src/test/org/apache/solr/filestore/TestDistribPackageStore.java b/solr/core/src/test/org/apache/solr/filestore/TestDistribPackageStore.java
index 4f83b8f..9fbbdd4 100644
--- a/solr/core/src/test/org/apache/solr/filestore/TestDistribPackageStore.java
+++ b/solr/core/src/test/org/apache/solr/filestore/TestDistribPackageStore.java
@@ -23,7 +23,7 @@ import org.apache.solr.client.solrj.SolrClient;
 import org.apache.solr.client.solrj.SolrRequest;
 import org.apache.solr.client.solrj.SolrServerException;
 import org.apache.solr.client.solrj.embedded.JettySolrRunner;
-import org.apache.solr.client.solrj.impl.HttpSolrClient;
+import org.apache.solr.client.solrj.impl.Http2SolrClient;
 import org.apache.solr.client.solrj.request.V2Request;
 import org.apache.solr.client.solrj.response.V2Response;
 import org.apache.solr.cloud.MiniSolrCloudCluster;
@@ -176,8 +176,8 @@ public class TestDistribPackageStore extends SolrCloudTestCase {
       assertResponseValues(10, new Fetcher(url, jettySolrRunner), expected);
 
       if (verifyContent) {
-        try (HttpSolrClient solrClient = (HttpSolrClient) jettySolrRunner.newHttp1Client()) {
-          ByteBuffer buf = Utils.executeGET(solrClient.getHttpClient(), baseUrl + "/node/files" + path,
+        try (Http2SolrClient solrClient = (Http2SolrClient) jettySolrRunner.newHttp2Client()) {
+          ByteBuffer buf = Utils.executeGET(solrClient, baseUrl + "/node/files" + path,
               Utils.newBytesConsumer(Integer.MAX_VALUE));
           assertEquals(
               "d01b51de67ae1680a84a813983b1de3b592fc32f1a22b662fc9057da5953abd1b72476388ba342cad21671cd0b805503c78ab9075ff2f3951fdf75fa16981420",
@@ -199,8 +199,8 @@ public class TestDistribPackageStore extends SolrCloudTestCase {
     }
     @Override
     public NavigableObject call() throws Exception {
-      try (HttpSolrClient solrClient = (HttpSolrClient) jetty.newHttp1Client()) {
-        return (NavigableObject) Utils.executeGET(solrClient.getHttpClient(), this.url, JAVABINCONSUMER);
+      try (Http2SolrClient solrClient = (Http2SolrClient) jetty.newHttp2Client()) {
+        return (NavigableObject) Utils.executeGET(solrClient, this.url, JAVABINCONSUMER);
       }
     }
 
@@ -254,10 +254,12 @@ public class TestDistribPackageStore extends SolrCloudTestCase {
 
   public static void uploadKey(byte[] bytes, String path, MiniSolrCloudCluster cluster) throws Exception {
     JettySolrRunner jetty = cluster.getRandomJetty(random());
-    try(HttpSolrClient client = (HttpSolrClient) jetty.newHttp1Client()) {
-      PackageUtils.uploadKey(bytes, path, Paths.get(jetty.getCoreContainer().getSolrHome()), client);
-      Object resp = Utils.executeGET(client.getHttpClient(), jetty.getBaseURLV2().toString() + "/node/files" + path + "?sync=true", null);
-      log.info("sync resp: "+jetty.getBaseURLV2().toString() + "/node/files" + path + "?sync=true"+" ,is: "+resp);
+    try(Http2SolrClient client = (Http2SolrClient) jetty.newHttp2Client()) {
+      PackageUtils.uploadKey(bytes, path, Paths.get(jetty.getCoreContainer().getSolrHome()));
+
+      Http2SolrClient.SimpleResponse resp = Http2SolrClient.GET(jetty.getBaseURLV2().toString() + "/node/files" + path + "?sync=true", client);
+      
+      log.info("sync resp: "+jetty.getBaseURLV2().toString() + "/node/files" + path + "?sync=true"+" ,is: "+resp.asString);
     }
     waitForAllNodesHaveFile(cluster,path, Utils.makeMap(":files:" + path + ":name", (Predicate<Object>) Objects::nonNull),
         false);
diff --git a/solr/core/src/test/org/apache/solr/handler/admin/ZookeeperReadAPITest.java b/solr/core/src/test/org/apache/solr/handler/admin/ZookeeperReadAPITest.java
index d5ad026..34c0539 100644
--- a/solr/core/src/test/org/apache/solr/handler/admin/ZookeeperReadAPITest.java
+++ b/solr/core/src/test/org/apache/solr/handler/admin/ZookeeperReadAPITest.java
@@ -20,7 +20,7 @@ package org.apache.solr.handler.admin;
 import java.lang.invoke.MethodHandles;
 import java.util.Map;
 
-import org.apache.solr.client.solrj.impl.HttpSolrClient;
+import org.apache.solr.client.solrj.impl.Http2SolrClient;
 import org.apache.solr.cloud.SolrCloudTestCase;
 import org.apache.solr.common.util.Utils;
 import org.apache.zookeeper.CreateMode;
@@ -63,17 +63,17 @@ public class ZookeeperReadAPITest extends SolrCloudTestCase {
     String basezk = baseUrl.toString().replace("/solr", "/api") + "/cluster/zk/data";
     String basezkls = baseUrl.toString().replace("/solr", "/api") + "/cluster/zk/ls";
 
-    try (HttpSolrClient client = new HttpSolrClient.Builder(baseUrl.toString()).build()) {
-      Object o = Utils.executeGET(client.getHttpClient(),
+    try (Http2SolrClient client = new Http2SolrClient.Builder(baseUrl.toString()).build()) {
+      Object o = Utils.executeGET(client,
           basezk + "/security.json",
           Utils.JSONCONSUMER);
       assertNotNull(o);
-      o = Utils.executeGET(client.getHttpClient(),
+      o = Utils.executeGET(client,
           basezkls + "/configs",
           Utils.JSONCONSUMER);
       assertEquals("0", String.valueOf(getObjectByPath(o, true, split(":/configs:_default:dataLength", ':'))));
 
-      o = Utils.executeGET(client.getHttpClient(),
+      o = Utils.executeGET(client,
           basezk + "/configs",
           Utils.JSONCONSUMER);
       assertTrue(((Map)o).containsKey("/configs"));
@@ -84,7 +84,7 @@ public class ZookeeperReadAPITest extends SolrCloudTestCase {
         bytes[i] = (byte) random().nextInt(128);
       }
       cluster.getZkClient().create("/configs/_default/testdata", bytes, CreateMode.PERSISTENT, true);
-      Utils.executeGET(client.getHttpClient(),
+      Utils.executeGET(client,
           basezk + "/configs/_default/testdata",
           is -> {
             byte[] newBytes = new byte[bytes.length];
diff --git a/solr/core/src/test/org/apache/solr/pkg/TestPackages.java b/solr/core/src/test/org/apache/solr/pkg/TestPackages.java
index 6fe4740..ebf98d8 100644
--- a/solr/core/src/test/org/apache/solr/pkg/TestPackages.java
+++ b/solr/core/src/test/org/apache/solr/pkg/TestPackages.java
@@ -32,7 +32,7 @@ import org.apache.solr.client.solrj.SolrRequest;
 import org.apache.solr.client.solrj.SolrServerException;
 import org.apache.solr.client.solrj.embedded.JettySolrRunner;
 import org.apache.solr.client.solrj.impl.BaseHttpSolrClient;
-import org.apache.solr.client.solrj.impl.HttpSolrClient;
+import org.apache.solr.client.solrj.impl.Http2SolrClient;
 import org.apache.solr.client.solrj.request.CollectionAdminRequest;
 import org.apache.solr.client.solrj.request.GenericSolrRequest;
 import org.apache.solr.client.solrj.request.RequestWriter;
@@ -446,10 +446,10 @@ public class TestPackages extends SolrCloudTestCase {
   }
 
   private void executeReq(String uri, JettySolrRunner jetty, Utils.InputStreamConsumer parser, Map expected) throws Exception {
-    try(HttpSolrClient client = (HttpSolrClient) jetty.newHttp1Client()){
+    try(Http2SolrClient client = (Http2SolrClient) jetty.newHttp2Client()){
       TestDistribPackageStore.assertResponseValues(10,
           () -> {
-            Object o = Utils.executeGET(client.getHttpClient(),
+            Object o = Utils.executeGET(client,
                 jetty.getBaseUrl() + uri, parser);
             if(o instanceof NavigableObject) return (NavigableObject) o;
             if(o instanceof Map) return new MapWriterMap((Map) o);
@@ -591,8 +591,8 @@ public class TestPackages extends SolrCloudTestCase {
         TestDistribPackageStore.assertResponseValues(10, new Callable<NavigableObject>() {
           @Override
           public NavigableObject call() throws Exception {
-            try (HttpSolrClient solrClient = (HttpSolrClient) jetty.newHttp1Client()) {
-              return (NavigableObject) Utils.executeGET(solrClient.getHttpClient(), path, Utils.JAVABINCONSUMER);
+            try (Http2SolrClient solrClient = (Http2SolrClient) jetty.newHttp2Client()) {
+              return (NavigableObject) Utils.executeGET(solrClient, path, Utils.JAVABINCONSUMER);
             }
           }
         }, Utils.makeMap(
diff --git a/solr/server/resources/log4j2.xml b/solr/server/resources/log4j2.xml
index def3f9b..191b1cb 100644
--- a/solr/server/resources/log4j2.xml
+++ b/solr/server/resources/log4j2.xml
@@ -86,7 +86,7 @@
         <AsyncLogger name="org.apache.zookeeper.ClientCnxn" level="ERROR"/>
         <AsyncLogger name="org.apache.zookeeper.server.ZooKeeperCriticalThread" level="OFF"/>
 
-        <AsyncLogger name="org.apache.solr.update.processor.LogUpdateProcessorFactory" level="INFO"/>
+        <AsyncLogger name="org.apache.solr.update.processor.LogUpdateProcessorFactory" level="WARN"/>
         <AsyncLogger name="org.apache.solr.update.LoggingInfoStream" level="OFF"/>
         <AsyncLogger name="org.apache.solr.core.SolrCore.SlowRequest" level="INFO" additivity="false">
             <AppenderRef ref="SlowLogFile"/>
diff --git a/solr/solrj/src/java/org/apache/solr/cli/ClusterStateCommand.java b/solr/solrj/src/java/org/apache/solr/cli/ClusterStateCommand.java
index 63c9bdd..ef194ad 100644
--- a/solr/solrj/src/java/org/apache/solr/cli/ClusterStateCommand.java
+++ b/solr/solrj/src/java/org/apache/solr/cli/ClusterStateCommand.java
@@ -34,7 +34,7 @@ public class ClusterStateCommand extends CliCommand {
   private CommandLine cl;
 
   static {
-    //options.addOption("s", "state", false, "Outputs the Solr state in Zookeeper");
+    options.addOption("u", "unlimited", false, "Don't suppress node output by byte size");
 
   }
 
@@ -71,16 +71,22 @@ public class ClusterStateCommand extends CliCommand {
 
    if (args.length == 2) {
      try {
-
-       zkStateReader.getZkClient().printLayoutToStream(out, args[1]);
+       if (cl.hasOption("u")) {
+         zkStateReader.getZkClient().printLayoutToStream(out, args[1], Integer.MAX_VALUE);
+       } else {
+         zkStateReader.getZkClient().printLayoutToStream(out, args[1]);
+       }
 
      } catch (IllegalArgumentException ex) {
        throw new MalformedPathException(ex.getMessage());
      }
    } else {
      try {
-
-       zkStateReader.getZkClient().printLayoutToStream(out);
+       if (cl.hasOption("u")) {
+         zkStateReader.getZkClient().printLayoutToStream(out, Integer.MAX_VALUE);
+       } else {
+         zkStateReader.getZkClient().printLayoutToStream(out);
+       }
 
      } catch (IllegalArgumentException ex) {
        throw new MalformedPathException(ex.getMessage());
diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/cloud/DelegatingCloudManager.java b/solr/solrj/src/java/org/apache/solr/client/solrj/cloud/DelegatingCloudManager.java
index 98dee96..4718477 100644
--- a/solr/solrj/src/java/org/apache/solr/client/solrj/cloud/DelegatingCloudManager.java
+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/cloud/DelegatingCloudManager.java
@@ -78,11 +78,6 @@ public class DelegatingCloudManager implements SolrCloudManager {
     }
 
     @Override
-    public byte[] httpRequest(String url, SolrRequest.METHOD method, Map<String, String> headers, String payload, int timeout, boolean followRedirects) throws IOException {
-        return delegate.httpRequest(url, method, headers, payload, timeout, followRedirects);
-    }
-
-    @Override
     public void close() throws IOException {
         delegate.close();
     }
diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/cloud/SolrCloudManager.java b/solr/solrj/src/java/org/apache/solr/client/solrj/cloud/SolrCloudManager.java
index 4ce87d9..43f8b96 100644
--- a/solr/solrj/src/java/org/apache/solr/client/solrj/cloud/SolrCloudManager.java
+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/cloud/SolrCloudManager.java
@@ -18,7 +18,6 @@
 package org.apache.solr.client.solrj.cloud;
 
 import java.io.IOException;
-import java.util.Map;
 
 import org.apache.solr.client.solrj.SolrRequest;
 import org.apache.solr.client.solrj.SolrResponse;
@@ -49,6 +48,4 @@ public interface SolrCloudManager extends SolrCloseable {
   // Solr-like methods
 
   SolrResponse request(SolrRequest req) throws IOException;
-
-  byte[] httpRequest(String url, SolrRequest.METHOD method, Map<String, String> headers, String payload, int timeout, boolean followRedirects) throws IOException;
 }
diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/SolrClientCloudManager.java b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/SolrClientCloudManager.java
index cfbef61..b2e4fc8 100644
--- a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/SolrClientCloudManager.java
+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/SolrClientCloudManager.java
@@ -17,28 +17,11 @@
 
 package org.apache.solr.client.solrj.impl;
 
-
-import java.io.IOException;
-import java.lang.invoke.MethodHandles;
-import java.util.Map;
-
-import org.apache.http.HttpEntity;
-import org.apache.http.HttpResponse;
-import org.apache.http.client.HttpClient;
-import org.apache.http.client.config.RequestConfig;
-import org.apache.http.client.methods.HttpDelete;
-import org.apache.http.client.methods.HttpGet;
-import org.apache.http.client.methods.HttpPost;
-import org.apache.http.client.methods.HttpPut;
-import org.apache.http.client.methods.HttpRequestBase;
-import org.apache.http.client.protocol.HttpClientContext;
-import org.apache.http.entity.StringEntity;
-import org.apache.http.util.EntityUtils;
 import org.apache.solr.client.solrj.SolrRequest;
 import org.apache.solr.client.solrj.SolrResponse;
 import org.apache.solr.client.solrj.SolrServerException;
-import org.apache.solr.client.solrj.cloud.DistributedQueueFactory;
 import org.apache.solr.client.solrj.cloud.DistribStateManager;
+import org.apache.solr.client.solrj.cloud.DistributedQueueFactory;
 import org.apache.solr.client.solrj.cloud.NodeStateProvider;
 import org.apache.solr.client.solrj.cloud.SolrCloudManager;
 import org.apache.solr.common.cloud.SolrZkClient;
@@ -49,6 +32,9 @@ import org.apache.solr.common.util.TimeSource;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import java.io.IOException;
+import java.lang.invoke.MethodHandles;
+
 /**
  * Class that implements {@link SolrCloudManager} using a SolrClient
  */
@@ -62,14 +48,14 @@ public class SolrClientCloudManager implements SolrCloudManager {
   private final SolrZkClient zkClient;
   private final ObjectCache objectCache;
   private final boolean closeObjectCache;
-  private final HttpClient httpClient;
+  private final Http2SolrClient httpClient;
   private volatile boolean isClosed;
 
   public SolrClientCloudManager(DistributedQueueFactory queueFactory, BaseCloudSolrClient solrClient) {
     this(queueFactory, solrClient, null, null);
   }
 
-  public SolrClientCloudManager(DistributedQueueFactory queueFactory, BaseCloudSolrClient solrClient, HttpClient httpClient) {
+  public SolrClientCloudManager(DistributedQueueFactory queueFactory, BaseCloudSolrClient solrClient, Http2SolrClient httpClient) {
     this(queueFactory, solrClient, null, httpClient);
   }
 
@@ -79,12 +65,12 @@ public class SolrClientCloudManager implements SolrCloudManager {
   }
 
   public SolrClientCloudManager(DistributedQueueFactory queueFactory, BaseCloudSolrClient solrClient,
-                                ObjectCache objectCache, HttpClient httpClient) {
+                                ObjectCache objectCache, Http2SolrClient httpClient) {
     this.queueFactory = queueFactory;
     this.solrClient = solrClient;
 
     if (httpClient == null && solrClient instanceof  CloudSolrClient) {
-      this.httpClient = ((CloudSolrClient) solrClient).getHttpClient();
+      this.httpClient = ((CloudHttp2SolrClient) solrClient).getHttpClient();
     } else if (httpClient == null) {
       throw new IllegalArgumentException("Must specify apache httpclient with non CloudSolrServer impls");
     } else {
@@ -154,60 +140,6 @@ public class SolrClientCloudManager implements SolrCloudManager {
   private static final byte[] EMPTY = new byte[0];
 
   @Override
-  public byte[] httpRequest(String url, SolrRequest.METHOD method, Map<String, String> headers, String payload, int timeout, boolean followRedirects) throws IOException {
-    HttpClient client = httpClient;
-    final HttpRequestBase req;
-    HttpEntity entity = null;
-    if (payload != null) {
-      entity = new StringEntity(payload, "UTF-8");
-    }
-    switch (method) {
-      case GET:
-        req = new HttpGet(url);
-        break;
-      case POST:
-        req = new HttpPost(url);
-        if (entity != null) {
-          ((HttpPost)req).setEntity(entity);
-        }
-        break;
-      case PUT:
-        req = new HttpPut(url);
-        if (entity != null) {
-          ((HttpPut)req).setEntity(entity);
-        }
-        break;
-      case DELETE:
-        req = new HttpDelete(url);
-        break;
-      default:
-        throw new IOException("Unsupported method " + method);
-    }
-    if (headers != null) {
-      headers.forEach((k, v) -> req.addHeader(k, v));
-    }
-    RequestConfig.Builder requestConfigBuilder = HttpClientUtil.createDefaultRequestConfigBuilder();
-    if (timeout > 0) {
-      requestConfigBuilder.setSocketTimeout(timeout);
-      requestConfigBuilder.setConnectTimeout(timeout);
-    }
-    requestConfigBuilder.setRedirectsEnabled(followRedirects);
-    req.setConfig(requestConfigBuilder.build());
-    HttpClientContext httpClientRequestContext = HttpClientUtil.createNewHttpClientRequestContext();
-    HttpResponse rsp = client.execute(req, httpClientRequestContext);
-    int statusCode = rsp.getStatusLine().getStatusCode();
-    if (statusCode != 200) {
-      throw new IOException("Error sending request to " + url + ", HTTP response: " + rsp.toString());
-    }
-    HttpEntity responseEntity = rsp.getEntity();
-    if (responseEntity != null && responseEntity.getContent() != null) {
-      return EntityUtils.toByteArray(responseEntity);
-    } else {
-      return EMPTY;
-    }
-  }
-
-  @Override
   public DistributedQueueFactory getDistributedQueueFactory() {
     return queueFactory;
   }
diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/SolrClientNodeStateProvider.java b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/SolrClientNodeStateProvider.java
index 0b4d393..94713fd 100644
--- a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/SolrClientNodeStateProvider.java
+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/SolrClientNodeStateProvider.java
@@ -31,7 +31,6 @@ import java.util.function.Consumer;
 import java.util.function.Function;
 import java.util.stream.Collectors;
 
-import org.apache.http.client.HttpClient;
 import org.apache.solr.client.solrj.SolrRequest;
 import org.apache.solr.client.solrj.SolrServerException;
 import org.apache.solr.client.solrj.cloud.NodeStateProvider;
@@ -66,6 +65,7 @@ import static java.util.Collections.emptyMap;
 public class SolrClientNodeStateProvider implements NodeStateProvider, MapWriter {
   public static final String METRICS_PREFIX = "metrics:";
   private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
+  public static final String[] EMPTY_STRINGS = new String[0];
   //only for debugging
   public static SolrClientNodeStateProvider INST;
 
@@ -73,12 +73,12 @@ public class SolrClientNodeStateProvider implements NodeStateProvider, MapWriter
 
   private final BaseCloudSolrClient solrClient;
   protected final Map<String, Map<String, Map<String, List<ReplicaInfo>>>> nodeVsCollectionVsShardVsReplicaInfo = new HashMap<>();
-  private final HttpClient httpClient;
+  private final Http2SolrClient httpClient;
   private Map<String, Object> snitchSession = new HashMap<>();
   private Map<String, Map> nodeVsTags = new HashMap<>();
   private Map<String, String> withCollectionsMap = new HashMap<>();
 
-  public SolrClientNodeStateProvider(BaseCloudSolrClient solrClient, HttpClient httpClient) {
+  public SolrClientNodeStateProvider(BaseCloudSolrClient solrClient, Http2SolrClient httpClient) {
     this.solrClient = solrClient;
     this.httpClient = httpClient;
     try {
@@ -188,7 +188,7 @@ public class SolrClientNodeStateProvider implements NodeStateProvider, MapWriter
   static void fetchReplicaMetrics(String solrNode, ClientSnitchCtx ctx, Map<String, Object> metricsKeyVsTag) {
     if (!ctx.isNodeAlive(solrNode)) return;
     ModifiableSolrParams params = new ModifiableSolrParams();
-    params.add("key", metricsKeyVsTag.keySet().toArray(new String[0]));
+    params.add("key", metricsKeyVsTag.keySet().toArray(EMPTY_STRINGS));
     try {
       SimpleSolrResponse rsp = ctx.invokeWithRetry(solrNode, CommonParams.METRICS_PATH, params);
       metricsKeyVsTag.forEach((key, tag) -> {
@@ -317,7 +317,7 @@ public class SolrClientNodeStateProvider implements NodeStateProvider, MapWriter
     ZkClientClusterStateProvider zkClientClusterStateProvider;
     BaseCloudSolrClient solrClient;
 
-    HttpClient httpClient;
+    Http2SolrClient httpClient;
 
     public boolean isNodeAlive(String node) {
       if (zkClientClusterStateProvider != null) {
@@ -327,7 +327,7 @@ public class SolrClientNodeStateProvider implements NodeStateProvider, MapWriter
     }
     public ClientSnitchCtx(SnitchInfo perSnitch,
                            String node, Map<String, Object> session,
-                           BaseCloudSolrClient solrClient, HttpClient httpClient) {
+                           BaseCloudSolrClient solrClient, Http2SolrClient httpClient) {
       super(perSnitch, node, session);
       this.solrClient = solrClient;
       this.httpClient = httpClient;
@@ -381,7 +381,7 @@ public class SolrClientNodeStateProvider implements NodeStateProvider, MapWriter
 
       try {
         GenericSolrRequest request = new GenericSolrRequest(SolrRequest.METHOD.POST, path, params);
-        try (HttpSolrClient client = new HttpSolrClient.Builder().withHttpClient(httpClient).withBaseSolrUrl(url).withResponseParser(new BinaryResponseParser()).markInternalRequest().build()) {
+        try (Http2SolrClient client = new Http2SolrClient.Builder().withHttpClient(httpClient).withBaseUrl(url).markInternalRequest().build()) {
           NamedList<Object> rsp = client.request(request);
           request.response.nl = rsp;
           return request.response;
diff --git a/solr/solrj/src/java/org/apache/solr/common/cloud/ConnectionManager.java b/solr/solrj/src/java/org/apache/solr/common/cloud/ConnectionManager.java
index aea1ffa..ac98db6 100644
--- a/solr/solrj/src/java/org/apache/solr/common/cloud/ConnectionManager.java
+++ b/solr/solrj/src/java/org/apache/solr/common/cloud/ConnectionManager.java
@@ -334,10 +334,8 @@ public class ConnectionManager implements Watcher, Closeable {
 
     client.zkCallbackExecutor.shutdown();
 
-    ExecutorUtil.awaitTermination(client.zkCallbackExecutor);
     SolrZooKeeper fkeeper = keeper;
     if (fkeeper != null) {
-      fkeeper.register(new NullWatcher());
       fkeeper.close();
     }
     client.zkConnManagerCallbackExecutor.shutdown();
@@ -396,6 +394,10 @@ public class ConnectionManager implements Watcher, Closeable {
 
   protected SolrZooKeeper createSolrZooKeeper(final String serverAddress, final int zkSessionTimeout,
                                               final Watcher watcher) throws IOException {
+    if (isClosed) {
+      throw new AlreadyClosedException();
+    }
+
     SolrZooKeeper result = new SolrZooKeeper(serverAddress, zkSessionTimeout, watcher);
 
     if (zkCredentialsToAddAutomatically != null) {
diff --git a/solr/solrj/src/java/org/apache/solr/common/cloud/DocRouter.java b/solr/solrj/src/java/org/apache/solr/common/cloud/DocRouter.java
index 65688f4..6df188c 100644
--- a/solr/solrj/src/java/org/apache/solr/common/cloud/DocRouter.java
+++ b/solr/solrj/src/java/org/apache/solr/common/cloud/DocRouter.java
@@ -86,8 +86,8 @@ public abstract class DocRouter {
   // TODO: ranges may not be all contiguous in the future (either that or we will
   // need an extra class to model a collection of ranges)
   public static class Range implements JSONWriter.Writable, Comparable<Range> {
-    public int min;  // inclusive
-    public int max;  // inclusive
+    public final int min;  // inclusive
+    public final int max;  // inclusive
 
     public Range(int min, int max) {
       assert min <= max;
diff --git a/solr/solrj/src/java/org/apache/solr/common/cloud/SolrZkClient.java b/solr/solrj/src/java/org/apache/solr/common/cloud/SolrZkClient.java
index d644752..99e1282 100644
--- a/solr/solrj/src/java/org/apache/solr/common/cloud/SolrZkClient.java
+++ b/solr/solrj/src/java/org/apache/solr/common/cloud/SolrZkClient.java
@@ -921,9 +921,17 @@ public class SolrZkClient implements Closeable {
     }
   }
 
+  public void printLayout(String path, int indent, int maxBytesBeforeSuppress, StringBuilder output) {
+    try {
+      printLayout(path, "", indent, maxBytesBeforeSuppress, output);
+    } catch (Exception e) {
+      log.error("Exception printing layout", e);
+    }
+  }
+
   public void printLayout(String path, int indent, StringBuilder output) {
     try {
-      printLayout(path, "", indent, output);
+      printLayout(path, "", indent, MAX_BYTES_FOR_ZK_LAYOUT_DATA_SHOW, output);
     } catch (Exception e) {
       log.error("Exception printing layout", e);
     }
@@ -932,7 +940,7 @@ public class SolrZkClient implements Closeable {
   /**
    * Fills string with printout of current ZooKeeper layout.
    */
-  public void printLayout(String path, String node, int indent, StringBuilder output) {
+  public void printLayout(String path, String node, int indent, int maxBytesBeforeSuppress, StringBuilder output) {
     try {
       //log.info("path={} node={} indext={}", path, node, indent);
 
@@ -977,8 +985,14 @@ public class SolrZkClient implements Closeable {
 //          } else {
             dataString = new String(data, StandardCharsets.UTF_8);
         //  }
-          int lines = dataString.split("\\r\\n|\\r|\\n").length;
-          if ((stat != null && stat.getDataLength() < MAX_BYTES_FOR_ZK_LAYOUT_DATA_SHOW && lines < 4) || path.endsWith("state.json") || path
+          int lines;
+          if (maxBytesBeforeSuppress != MAX_BYTES_FOR_ZK_LAYOUT_DATA_SHOW) {
+            lines = 0;
+          } else {
+            lines = dataString.split("\\r\\n|\\r|\\n").length;
+          }
+
+          if ((stat != null && stat.getDataLength() < maxBytesBeforeSuppress && lines < 4) || path.endsWith("state.json") || path
               .endsWith("security.json") || (path.endsWith("solrconfig.xml") && Boolean.getBoolean("solr.tests.printsolrconfig")) || path.endsWith("_statupdates") || path.contains("/terms/")) {
             //        if (path.endsWith(".xml")) {
             //          // this is the cluster state in xml format - lets pretty print
@@ -1014,7 +1028,7 @@ public class SolrZkClient implements Closeable {
       if (children != null) {
         for (String child : children) {
           if (!child.equals("quota") && !child.equals("/zookeeper")) {
-            printLayout(path.equals("/") ? "/" + child : path + "/" + child, child, indent, output);
+            printLayout(path.equals("/") ? "/" + child : path + "/" + child, child, indent, maxBytesBeforeSuppress, output);
           }
         }
       }
@@ -1024,25 +1038,37 @@ public class SolrZkClient implements Closeable {
   }
 
   public void printLayout() {
-    StringBuilder sb = new StringBuilder(512);
+    StringBuilder sb = new StringBuilder(1024);
     printLayout("/",0, sb);
     log.warn("\n\n_____________________________________________________________________\n\n\nZOOKEEPER LAYOUT:\n\n" + sb.toString() + "\n\n_____________________________________________________________________\n\n");
   }
 
   public void printLayoutToStream(PrintStream out) {
-    StringBuilder sb = new StringBuilder(512);
+    StringBuilder sb = new StringBuilder(1024);
     printLayout("/", 0, sb);
     out.println(sb.toString());
   }
 
   public void printLayoutToStream(PrintStream out, String path) {
-    StringBuilder sb = new StringBuilder(512);
+    StringBuilder sb = new StringBuilder(1024);
     printLayout(path, 0, sb);
     out.println(sb.toString());
   }
 
+  public void printLayoutToStream(PrintStream out, int maxBytesBeforeSuppress) {
+    StringBuilder sb = new StringBuilder(1024);
+    printLayout("/", 0, maxBytesBeforeSuppress, sb);
+    out.println(sb.toString());
+  }
+
+  public void printLayoutToStream(PrintStream out, String path, int maxBytesBeforeSuppress) {
+    StringBuilder sb = new StringBuilder(1024);
+    printLayout(path, 0, maxBytesBeforeSuppress, sb);
+    out.println(sb.toString());
+  }
+
   public void printLayoutToFile(Path file) {
-    StringBuilder sb = new StringBuilder(512);
+    StringBuilder sb = new StringBuilder(1024);
     printLayout("/",0, sb);
     try {
       Files.writeString(file, sb.toString(), StandardOpenOption.CREATE);
diff --git a/solr/solrj/src/java/org/apache/solr/common/cloud/ZkCmdExecutor.java b/solr/solrj/src/java/org/apache/solr/common/cloud/ZkCmdExecutor.java
index 03b200c..74a0bbc 100644
--- a/solr/solrj/src/java/org/apache/solr/common/cloud/ZkCmdExecutor.java
+++ b/solr/solrj/src/java/org/apache/solr/common/cloud/ZkCmdExecutor.java
@@ -20,6 +20,7 @@ import org.apache.solr.common.AlreadyClosedException;
 import org.apache.solr.common.SolrException;
 import org.apache.solr.common.cloud.ConnectionManager.IsClosed;
 import org.apache.zookeeper.KeeperException;
+import org.apache.zookeeper.ZooKeeper;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -70,7 +71,7 @@ public class ZkCmdExecutor {
         if (exception == null) {
           exception = e;
         }
-        if (!zkCmdExecutor.solrZkClient.getSolrZooKeeper().getState().isAlive()) {
+        if (zkCmdExecutor.solrZkClient.getSolrZooKeeper().getState() == ZooKeeper.States.CLOSED) {
           throw e;
         }
         zkCmdExecutor.retryDelay(tryCnt);
diff --git a/solr/solrj/src/java/org/apache/solr/common/util/Utils.java b/solr/solrj/src/java/org/apache/solr/common/util/Utils.java
index dfc43ef..0d107d3 100644
--- a/solr/solrj/src/java/org/apache/solr/common/util/Utils.java
+++ b/solr/solrj/src/java/org/apache/solr/common/util/Utils.java
@@ -16,6 +16,36 @@
  */
 package org.apache.solr.common.util;
 
+import org.apache.solr.client.solrj.cloud.DistribStateManager;
+import org.apache.solr.client.solrj.cloud.VersionedData;
+import org.apache.solr.client.solrj.impl.BinaryRequestWriter;
+import org.apache.solr.client.solrj.impl.Http2SolrClient;
+import org.apache.solr.common.IteratorWriter;
+import org.apache.solr.common.LinkedHashMapWriter;
+import org.apache.solr.common.MapWriter;
+import org.apache.solr.common.MapWriterMap;
+import org.apache.solr.common.ParWork;
+import org.apache.solr.common.SolrException;
+import org.apache.solr.common.SpecProvider;
+import org.apache.solr.common.cloud.SolrZkClient;
+import org.apache.solr.common.cloud.ZkStateReader;
+import org.apache.solr.common.params.CommonParams;
+import org.apache.zookeeper.KeeperException;
+import org.apache.zookeeper.server.ByteBufferInputStream;
+import org.noggit.CharArr;
+import org.noggit.JSONParser;
+import org.noggit.JSONWriter;
+import org.noggit.ObjectBuilder;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.slf4j.MDC;
+
+import static java.nio.charset.StandardCharsets.UTF_8;
+import static java.util.Collections.singletonList;
+import static java.util.Collections.unmodifiableList;
+import static java.util.Collections.unmodifiableSet;
+import static java.util.concurrent.TimeUnit.NANOSECONDS;
+import java.io.ByteArrayInputStream;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.InputStreamReader;
@@ -47,47 +77,15 @@ import java.util.Set;
 import java.util.TreeMap;
 import java.util.TreeSet;
 import java.util.concurrent.Callable;
+import java.util.concurrent.ExecutionException;
 import java.util.concurrent.TimeUnit;
+import java.util.concurrent.TimeoutException;
 import java.util.concurrent.atomic.AtomicLong;
 import java.util.function.BiConsumer;
 import java.util.function.Function;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
-import org.apache.http.HttpEntity;
-import org.apache.http.HttpResponse;
-import org.apache.http.client.HttpClient;
-import org.apache.http.client.methods.HttpGet;
-import org.apache.http.util.EntityUtils;
-import org.apache.solr.client.solrj.cloud.DistribStateManager;
-import org.apache.solr.client.solrj.cloud.VersionedData;
-import org.apache.solr.client.solrj.impl.BinaryRequestWriter;
-import org.apache.solr.common.IteratorWriter;
-import org.apache.solr.common.LinkedHashMapWriter;
-import org.apache.solr.common.MapWriter;
-import org.apache.solr.common.MapWriterMap;
-import org.apache.solr.common.ParWork;
-import org.apache.solr.common.SolrException;
-import org.apache.solr.common.SpecProvider;
-import org.apache.solr.common.cloud.SolrZkClient;
-import org.apache.solr.common.cloud.ZkStateReader;
-import org.apache.solr.common.params.CommonParams;
-import org.apache.zookeeper.KeeperException;
-import org.apache.zookeeper.server.ByteBufferInputStream;
-import org.noggit.CharArr;
-import org.noggit.JSONParser;
-import org.noggit.JSONWriter;
-import org.noggit.ObjectBuilder;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.slf4j.MDC;
-
-import static java.nio.charset.StandardCharsets.UTF_8;
-import static java.util.Collections.singletonList;
-import static java.util.Collections.unmodifiableList;
-import static java.util.Collections.unmodifiableSet;
-import static java.util.concurrent.TimeUnit.NANOSECONDS;
-
 public class Utils {
   @SuppressWarnings({"rawtypes"})
   public static final Function NEW_HASHMAP_FUN = o -> new HashMap<>();
@@ -803,30 +801,33 @@ public class Utils {
       }
 
 
-      public static <T > T executeGET(HttpClient client, String url, InputStreamConsumer < T > consumer) throws SolrException {
+      public static <T > T executeGET(Http2SolrClient client, String url, InputStreamConsumer < T > consumer) throws SolrException {
         T result = null;
-        HttpGet httpGet = new HttpGet(url);
-        HttpResponse rsp = null;
+
+        Http2SolrClient.SimpleResponse resp = null;
         try {
-          rsp = client.execute(httpGet);
-        } catch (IOException e) {
-          log.error("Error in request to url : {}", url, e);
-          throw new SolrException(SolrException.ErrorCode.UNKNOWN, "error sending request");
+          resp = Http2SolrClient.GET(url, client);
+        } catch (InterruptedException e) {
+          ParWork.propagateInterrupt(e, true);
+          throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, e);
+        } catch (ExecutionException e) {
+          throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, e);
+        } catch (TimeoutException e) {
+          throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, e);
         }
-        int statusCode = rsp.getStatusLine().getStatusCode();
+
+        int statusCode = resp.status;
         if (statusCode != 200) {
-          try {
-            log.error("Failed a request to: {}, status: {}, body: {}", url, rsp.getStatusLine(), EntityUtils.toString(rsp.getEntity(), StandardCharsets.UTF_8)); // logOk
-          } catch (IOException e) {
-            log.error("could not print error", e);
-          }
+
+          log.error("Failed a request to: {}, status: {}, body: {}", url, resp.status, resp.asString); // logOk
+
           throw new SolrException(SolrException.ErrorCode.getErrorCode(statusCode), "Unknown error");
         }
-        HttpEntity entity = rsp.getEntity();
+
         InputStream is = null;
 
         try {
-          is = entity.getContent();
+          is = new ByteArrayInputStream(resp.bytes);
           if (consumer != null) {
 
             result = consumer.accept(is);


[lucene-solr] 01/03: @1340 We only proxy to other nodes by collection, not core.

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

markrmiller pushed a commit to branch reference_impl_dev
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git

commit 59fe24c387a0e02bfafa22abacc918ea3f48f646
Author: markrmiller@gmail.com <ma...@gmail.com>
AuthorDate: Wed Feb 10 11:05:36 2021 -0600

    @1340 We only proxy to other nodes by collection, not core.
---
 .../src/java/org/apache/solr/api/V2HttpCall.java   | 38 ++++++++++++----------
 .../java/org/apache/solr/servlet/HttpSolrCall.java | 29 +++++------------
 2 files changed, 28 insertions(+), 39 deletions(-)

diff --git a/solr/core/src/java/org/apache/solr/api/V2HttpCall.java b/solr/core/src/java/org/apache/solr/api/V2HttpCall.java
index c6dd47d..9bf0369 100644
--- a/solr/core/src/java/org/apache/solr/api/V2HttpCall.java
+++ b/solr/core/src/java/org/apache/solr/api/V2HttpCall.java
@@ -67,7 +67,6 @@ public class V2HttpCall extends HttpSolrCall {
   private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
   private Api api;
   List<String> pieces;
-  private String prefix;
   HashMap<String, String> parts = new HashMap<>();
   static final Set<String> knownPrefixes = ImmutableSet.of("cluster", "node", "collections", "cores", "c");
 
@@ -81,14 +80,9 @@ public class V2HttpCall extends HttpSolrCall {
     final String fullPath = path = path.substring(7);//strip off '/____v2'
     try {
       pieces = getPathSegments(path);
+      String prefix;
       if (pieces.size() == 0 || (pieces.size() == 1 && path.endsWith(CommonParams.INTROSPECT))) {
-        api = new Api(null) {
-          @Override
-          public void call(SolrQueryRequest req, SolrQueryResponse rsp) {
-            rsp.add("documentation", "https://lucene.apache.org/solr/guide/v2-api.html");
-            rsp.add("description", "V2 API root path");
-          }
-        };
+        api = new MyApi();
         initAdminRequest(path);
         return;
       } else {
@@ -122,12 +116,9 @@ public class V2HttpCall extends HttpSolrCall {
           if (core == null) {
             //this collection exists , but this node does not have a replica for that collection
             if (log.isDebugEnabled()) log.debug("check remote path extraction {} {}", collection.getName(), origCorename);
-//            if (origCorename != null) {
-//              extractRemotePath(null, origCorename);
-//            }
-            if (origCorename == null || collection.getName().equals(origCorename)) {
-              extractRemotePath(collection.getName(), null);
-            }
+
+            extractRemotePath(collection.getName());
+
             if (action == REMOTEQUERY) {
               coreUrl = coreUrl.replace("/solr/", "/solr/____v2/c/");
               this.path = path = path.substring(prefix.length() + collection.getName().length() + 2);
@@ -286,7 +277,7 @@ public class V2HttpCall extends HttpSolrCall {
     return compositeApi.add(new Api(() -> ValidatingJsonMap.EMPTY) {
       @Override
       public void call(SolrQueryRequest req1, SolrQueryResponse rsp) {
-        String prefix = null;
+        String prefix;
         prefix = fullPath.endsWith(CommonParams.INTROSPECT) ?
             fullPath.substring(0, fullPath.length() - CommonParams.INTROSPECT.length()) :
             fullPath;
@@ -313,8 +304,7 @@ public class V2HttpCall extends HttpSolrCall {
         HashSet<String> subPaths = new HashSet<>();
         registry.lookup(path, new HashMap<>(), subPaths);
         for (String subPath : subPaths) {
-          Set<String> supportedMethods = pathsVsMethod.get(subPath);
-          if (supportedMethods == null) pathsVsMethod.put(subPath, supportedMethods = new HashSet<>());
+          Set<String> supportedMethods = pathsVsMethod.computeIfAbsent(subPath, k -> new HashSet<>());
           supportedMethods.add(m.toString());
         }
       }
@@ -322,7 +312,7 @@ public class V2HttpCall extends HttpSolrCall {
   }
 
   public static class CompositeApi extends Api {
-    private LinkedList<Api> apis = new LinkedList<>();
+    private final LinkedList<Api> apis = new LinkedList<>();
 
     public CompositeApi(Api api) {
       super(ApiBag.EMPTY_SPEC);
@@ -384,4 +374,16 @@ public class V2HttpCall extends HttpSolrCall {
   protected Map<String, JsonSchemaValidator> getValidators() {
     return api == null ? null : api.getCommandSchema();
   }
+
+  private static class MyApi extends Api {
+    public MyApi() {
+      super(null);
+    }
+
+    @Override
+    public void call(SolrQueryRequest req, SolrQueryResponse rsp) {
+      rsp.add("documentation", "https://lucene.apache.org/solr/guide/v2-api.html");
+      rsp.add("description", "V2 API root path");
+    }
+  }
 }
diff --git a/solr/core/src/java/org/apache/solr/servlet/HttpSolrCall.java b/solr/core/src/java/org/apache/solr/servlet/HttpSolrCall.java
index 0182c87..c40710a 100644
--- a/solr/core/src/java/org/apache/solr/servlet/HttpSolrCall.java
+++ b/solr/core/src/java/org/apache/solr/servlet/HttpSolrCall.java
@@ -86,7 +86,6 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import static org.apache.solr.common.cloud.ZkStateReader.COLLECTION_PROP;
-import static org.apache.solr.common.cloud.ZkStateReader.CORE_NAME_PROP;
 import static org.apache.solr.common.cloud.ZkStateReader.REPLICATION_FACTOR;
 import static org.apache.solr.common.params.CollectionAdminParams.SYSTEM_COLL;
 import static org.apache.solr.common.params.CollectionParams.CollectionAction.CREATE;
@@ -305,12 +304,9 @@ public class HttpSolrCall {
           // if we couldn't find it locally, look on other nodes
           if (idx > 0) {
             if (log.isDebugEnabled()) log.debug("check remote path extraction {} {}", collectionName, origCorename);
-//            if (origCorename != null) {
-//              extractRemotePath(null, origCorename);
-//            }
-            if (origCorename == null || collectionName.equals(origCorename)) {
-              extractRemotePath(collectionName, null);
-            }
+
+            extractRemotePath(collectionName);
+
             if (action == REMOTEQUERY) {
               path = path.substring(idx);
               if (log.isDebugEnabled()) log.debug("Path is parsed as {}", path);
@@ -476,11 +472,11 @@ public class HttpSolrCall {
     }
   }
 
-  protected void extractRemotePath(String collectionName, String origCorename) throws UnsupportedEncodingException, KeeperException, InterruptedException, SolrException, TimeoutException {
+  protected void extractRemotePath(String collectionName) throws UnsupportedEncodingException, KeeperException, InterruptedException, SolrException, TimeoutException {
 
     ensureStatesAreAtLeastAtClient();
 
-    coreUrl = getRemoteCoreUrl(collectionName, origCorename);
+    coreUrl = getRemoteCoreUrl(collectionName);
     // don't proxy for internal update requests
     Map<String,Integer> invalidStates = checkStateVersionsAreValid(queryParams.get(CloudSolrClient.STATE_VERSION));
     if (coreUrl != null
@@ -1102,7 +1098,7 @@ public class HttpSolrCall {
     return core;
   }
 
-  protected String getRemoteCoreUrl(String collectionName, String origCorename) throws SolrException {
+  protected String getRemoteCoreUrl(String collectionName) throws SolrException {
     ClusterState clusterState = cores.getZkController().getClusterState();
     final DocCollection docCollection = clusterState.getCollectionOrNull(collectionName, false);
     if (docCollection == null) {
@@ -1114,13 +1110,13 @@ public class HttpSolrCall {
       return null;
     }
 
-    String coreUrl = getCoreUrl(origCorename, slices);
+    String coreUrl = getCoreUrl(slices);
 
     if (log.isDebugEnabled()) log.debug("get remote core url returning {} for {} {}", coreUrl, collectionName, origCorename);
     return coreUrl;
   }
 
-  private String getCoreUrl(String origCorename, Collection<Slice> slices) {
+  private String getCoreUrl(Collection<Slice> slices) {
     String coreUrl;
 
     for (Slice slice : slices) {
@@ -1131,15 +1127,6 @@ public class HttpSolrCall {
         if (cores.getZkController().zkStateReader.getLiveNodes().contains(replica.getNodeName())
             && replica.getState() == Replica.State.ACTIVE) {
 
-          if (origCorename != null && !origCorename.equals(replica.getStr(CORE_NAME_PROP))) {
-            // if it's by core name, make sure they match
-            continue;
-          }
-          if (replica.getBaseUrl().equals(cores.getZkController().getBaseUrl())) {
-            // don't count a local core
-            continue;
-          }
-
           coreUrl = replica.getCoreUrl();
 
           return coreUrl;