Package org.apache.solr.util
package org.apache.solr.util
Misc utilities useful when implementing test cases.
-
ClassDescriptionHelper class to collect interesting callers at specific points.Provides an EmbeddedSolrServer for tests.Helper code for "Muting" ERROR log messages that you expect as a result of the things you are testing, so they aren't a distraction in test logs.Some tests need to reach outside the classpath to get certain resources (e.g.Annotation specifying the log level for a particular test case or methodA JUnit
TestRulethat sets (and resets) the Log4j2 log level based on theLogLevelannotation.Helper code to listen forLogEventmessages (via aBlockingQueue) that you expect as a result of the things you are testing, So you can make assertions about when a particular action should/shouldn't cause Solr to produce a particular Log messageA mocked up instance of SecureRandom that just usesRandomunder the covers.AMergePolicywith a no-arg constructor that proxies to aForceMergePolicywrapped instance retrieved fromLuceneTestCase.newMergePolicy(java.util.Random).AMergePolicyFactoryforRandomForceMergePolicy.Marker annotation indicating when SSL Randomization should be used for a test class, and if so what the typical odds of using SSL should for that test class.A simple data structure for encapsulating the effective values to be used when randomizing SSL in a test, based on the configured values in theRandomizeSSLannotation.AMergePolicywith a no-arg constructor that proxies to an instance retrieved fromLuceneTestCase.newMergePolicy(java.util.Random).AMergePolicyFactoryforRandomMergePolicy.AMergePolicyFactoryforRandomMergePolicypreventing random segment reversing.Facilitates testing Solr's REST API via a provided embedded JettyProvides security.json constants for use in tests that enable security.Kindly borrowed the idea and base implementation from the ActiveMQ project; useful for blocking traffic on a specified port.Provides access to aSolrClientinstance and a running Solr in tests.ASolrClientTestRulethat provides a Solr instance running in Jetty, an HTTP server.This ignores those Kafka threads in Solr for which there is no way to clean up after a suite.A Utility class for extra HamcrestMatcherimplementations.An SSLConfig that providesSSLConfigandHttpClientUtil.SocketFactoryRegistryProviderfor both clients and servers that supports reading key/trust store information directly from resource files provided with the Solr test-framework classesThis class provides a simple harness that may be useful when writing testcases.