Package org.apache.solr.cloud
Class SolrCloudTestCase.Builder
- java.lang.Object
-
- org.apache.solr.cloud.SolrCloudTestCase.Builder
-
- Enclosing class:
- SolrCloudTestCase
public static class SolrCloudTestCase.Builder extends Object
Builder class for a MiniSolrCloudCluster
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SolrCloudTestCase.Builder
addConfig(String configName, Path configPath)
Upload a collection config before tests startMiniSolrCloudCluster
build()
Configure, run and return theMiniSolrCloudCluster
MiniSolrCloudCluster
configure()
Configure and run theMiniSolrCloudCluster
SolrCloudTestCase.Builder
withDefaultClusterProperty(String key, String value)
SolrCloudTestCase.Builder
withJettyConfig(Consumer<org.apache.solr.client.solrj.embedded.JettyConfig.Builder> fun)
Use a JettyConfig.Builder to configure the cluster's jetty serversSolrCloudTestCase.Builder
withMetrics(boolean trackJettyMetrics)
SolrCloudTestCase.Builder
withProperty(String propertyName, String propertyValue)
Set a cluster propertySolrCloudTestCase.Builder
withSecurityJson(String securityJson)
Configure the specified security.json for the MiniSolrCloudClusterSolrCloudTestCase.Builder
withSecurityJson(Path securityJson)
Configure the specified security.json for the MiniSolrCloudClusterSolrCloudTestCase.Builder
withSolrXml(String solrXml)
Use the provided string as solr.xml contentSolrCloudTestCase.Builder
withSolrXml(Path solrXml)
Read solr.xml from the provided path
-
-
-
Constructor Detail
-
Builder
public Builder(int nodeCount, Path baseDir)
Create a builder- Parameters:
nodeCount
- the number of nodes in the clusterbaseDir
- a base directory for the cluster
-
-
Method Detail
-
withJettyConfig
public SolrCloudTestCase.Builder withJettyConfig(Consumer<org.apache.solr.client.solrj.embedded.JettyConfig.Builder> fun)
Use a JettyConfig.Builder to configure the cluster's jetty servers
-
withSolrXml
public SolrCloudTestCase.Builder withSolrXml(String solrXml)
Use the provided string as solr.xml content
-
withSolrXml
public SolrCloudTestCase.Builder withSolrXml(Path solrXml)
Read solr.xml from the provided path
-
withSecurityJson
public SolrCloudTestCase.Builder withSecurityJson(Path securityJson)
Configure the specified security.json for the MiniSolrCloudCluster- Parameters:
securityJson
- The path specifying the security.json file- Returns:
- the instance of SolrCloudTestCase.Builder
-
withSecurityJson
public SolrCloudTestCase.Builder withSecurityJson(String securityJson)
Configure the specified security.json for the MiniSolrCloudCluster- Parameters:
securityJson
- The string specifying the security.json configuration- Returns:
- the instance of SolrCloudTestCase.Builder
-
addConfig
public SolrCloudTestCase.Builder addConfig(String configName, Path configPath)
Upload a collection config before tests start- Parameters:
configName
- the config nameconfigPath
- the path to the config files
-
withProperty
public SolrCloudTestCase.Builder withProperty(String propertyName, String propertyValue)
Set a cluster property- Parameters:
propertyName
- the property namepropertyValue
- the property value
-
withMetrics
public SolrCloudTestCase.Builder withMetrics(boolean trackJettyMetrics)
-
configure
public MiniSolrCloudCluster configure() throws Exception
Configure and run theMiniSolrCloudCluster
- Throws:
Exception
- if an error occurs on startup
-
build
public MiniSolrCloudCluster build() throws Exception
Configure, run and return theMiniSolrCloudCluster
- Throws:
Exception
- if an error occurs on startup
-
withDefaultClusterProperty
public SolrCloudTestCase.Builder withDefaultClusterProperty(String key, String value)
-
-