Package org.apache.solr.util
Class SolrJettyTestRule
java.lang.Object
org.junit.rules.ExternalResource
org.apache.solr.util.SolrClientTestRule
org.apache.solr.util.SolrJettyTestRule
- All Implemented Interfaces:
org.junit.rules.TestRule
A
SolrClientTestRule that provides a Solr instance running in Jetty, an HTTP server. It's
based off of JettySolrRunner.-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.solr.util.SolrClientTestRule
SolrClientTestRule.NewCollectionBuilder -
Field Summary
Fields inherited from class org.apache.solr.util.SolrClientTestRule
backend -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidafter()protected voidvoidEnables proxy feature to allow for failure injection testing at the inter-node communication level.org.apache.solr.client.solrj.impl.HttpSolrClientProvides a SolrClient instance for administration actions.URL to Solr.getJetty()org.apache.solr.client.solrj.impl.HttpSolrClientgetSolrClient(String collection) Provides a SolrClient instance for caller defined collection name.protected org.apache.solr.client.solrj.impl.HttpSolrClientnewSolrClient(String collection) org.apache.solr.client.solrj.jetty.HttpJettySolrClient.BuilderCreates a client builder with the URL, shared Jetty HttpClient, and default collection "collection1" (can be changed).voidreset()Deprecated.Please don't call! There is no replacement API.voidStarts the Solr server with the given solrHome.voidstartSolr(Path solrHome, Properties nodeProperties, JettyConfig jettyConfig) Methods inherited from class org.apache.solr.util.SolrClientTestRule
clearIndex, createCollSolrCloud, createCollStandalone, getBackend, getBaseUrl, getCoreContainer, getSolrClient, newCollection, newCollection, startSolrMethods inherited from class org.junit.rules.ExternalResource
apply, before
-
Constructor Details
-
SolrJettyTestRule
public SolrJettyTestRule()
-
-
Method Details
-
after
protected void after()- Overrides:
afterin classSolrClientTestRule
-
reset
Deprecated.Please don't call! There is no replacement API.Resets the state. -
startSolr
Description copied from class:SolrClientTestRuleStarts the Solr server with the given solrHome. If solrHome contains a solr.xml file, it is used. Otherwise, a default testing configuration is used.- Specified by:
startSolrin classSolrClientTestRule
-
enableProxy
public void enableProxy()Enables proxy feature to allow for failure injection testing at the inter-node communication level. Must be called prior to starting.- See Also:
-
startSolr
-
getJetty
-
getSolrClient
Description copied from class:SolrClientTestRuleProvides a SolrClient instance for caller defined collection name. The caller doesn't need to close it- Specified by:
getSolrClientin classSolrClientTestRule
-
getAdminClient
public org.apache.solr.client.solrj.impl.HttpSolrClient getAdminClient()Description copied from class:SolrClientTestRuleProvides a SolrClient instance for administration actions. The caller must not close it.- Overrides:
getAdminClientin classSolrClientTestRule
-
newSolrClient
-
newSolrClientBuilder
public org.apache.solr.client.solrj.jetty.HttpJettySolrClient.Builder newSolrClientBuilder()Creates a client builder with the URL, shared Jetty HttpClient, and default collection "collection1" (can be changed). -
getBaseUrl
URL to Solr. -
createColl
protected void createColl(SolrClientTestRule.NewCollectionBuilder b) throws org.apache.solr.client.solrj.SolrServerException, IOException Description copied from class:SolrClientTestRuleOverride to call eitherSolrClientTestRule.createCollSolrCloud(NewCollectionBuilder)orSolrClientTestRule.createCollStandalone(NewCollectionBuilder)- Specified by:
createCollin classSolrClientTestRule- Throws:
org.apache.solr.client.solrj.SolrServerExceptionIOException
-