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
public class SolrJettyTestRule extends SolrClientTestRule
ASolrClientTestRule
that provides a Solr instance running in Jetty, an HTTP server. It's based off ofJettySolrRunner
.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.solr.util.SolrClientTestRule
SolrClientTestRule.NewCollectionBuilder
-
-
Constructor Summary
Constructors Constructor Description SolrJettyTestRule()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected void
after()
void
enableProxy()
Enables proxy feature to allow for failure injection testing at the inter-node communication level.String
getBaseUrl()
URL to Solr.org.apache.solr.core.CoreContainer
getCoreContainer()
JettySolrRunner
getJetty()
org.apache.solr.client.solrj.SolrClient
getSolrClient(String collection)
Provides a SolrClient instance for caller defined collection name.protected org.apache.solr.client.solrj.SolrClient
newSolrClient(String collection)
void
reset()
Deprecated.void
startSolr(Path solrHome)
Starts the Solr server with the given solrHome.void
startSolr(Path solrHome, Properties nodeProperties, JettyConfig jettyConfig)
-
Methods inherited from class org.apache.solr.util.SolrClientTestRule
clearIndex, create, getAdminClient, getSolrClient, newCollection, newCollection, startSolr
-
-
-
-
Method Detail
-
after
protected void after()
- Overrides:
after
in classorg.junit.rules.ExternalResource
-
reset
@Deprecated public void reset()
Deprecated.Resets the state. DEPRECATED; please don't call!
-
startSolr
public void startSolr(Path solrHome)
Description copied from class:SolrClientTestRule
Starts 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:
startSolr
in 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:
JettySolrRunner.getProxy()
-
startSolr
public void startSolr(Path solrHome, Properties nodeProperties, JettyConfig jettyConfig)
-
getJetty
public JettySolrRunner getJetty()
-
getSolrClient
public org.apache.solr.client.solrj.SolrClient getSolrClient(String collection)
Description copied from class:SolrClientTestRule
Provides a SolrClient instance for caller defined collection name. The caller doesn't need to close it- Specified by:
getSolrClient
in classSolrClientTestRule
-
newSolrClient
protected org.apache.solr.client.solrj.SolrClient newSolrClient(String collection)
-
getBaseUrl
public String getBaseUrl()
URL to Solr.
-
getCoreContainer
public org.apache.solr.core.CoreContainer getCoreContainer()
-
-