mirror of https://github.com/apache/lucene.git
SOLR-8221: Ensure that SSL config is passed to MiniSolrCloudCluster
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1711112 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
cb234d3c6b
commit
2018b052db
|
@ -43,7 +43,7 @@ public class ConcurrentDeleteAndCreateCollectionTest extends SolrTestCaseJ4 {
|
||||||
@Before
|
@Before
|
||||||
public void setUp() throws Exception {
|
public void setUp() throws Exception {
|
||||||
super.setUp();
|
super.setUp();
|
||||||
solrCluster = new MiniSolrCloudCluster(1, createTempDir());
|
solrCluster = new MiniSolrCloudCluster(1, createTempDir(), buildJettyConfig("/solr"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -33,6 +33,7 @@ import org.apache.lucene.util.Constants;
|
||||||
import org.apache.lucene.util.LuceneTestCase;
|
import org.apache.lucene.util.LuceneTestCase;
|
||||||
import org.apache.solr.SolrTestCaseJ4;
|
import org.apache.solr.SolrTestCaseJ4;
|
||||||
import org.apache.solr.client.solrj.SolrQuery;
|
import org.apache.solr.client.solrj.SolrQuery;
|
||||||
|
import org.apache.solr.client.solrj.embedded.JettyConfig;
|
||||||
import org.apache.solr.client.solrj.embedded.JettySolrRunner;
|
import org.apache.solr.client.solrj.embedded.JettySolrRunner;
|
||||||
import org.apache.solr.client.solrj.impl.CloudSolrClient;
|
import org.apache.solr.client.solrj.impl.CloudSolrClient;
|
||||||
import org.apache.solr.client.solrj.impl.HttpClientUtil;
|
import org.apache.solr.client.solrj.impl.HttpClientUtil;
|
||||||
|
@ -158,7 +159,8 @@ public class TestSolrCloudWithKerberosAlt extends LuceneTestCase {
|
||||||
HttpClientUtil.setConfigurer(new Krb5HttpClientConfigurer());
|
HttpClientUtil.setConfigurer(new Krb5HttpClientConfigurer());
|
||||||
String collectionName = "testkerberoscollection";
|
String collectionName = "testkerberoscollection";
|
||||||
|
|
||||||
MiniSolrCloudCluster miniCluster = new MiniSolrCloudCluster(NUM_SERVERS, createTempDir());
|
MiniSolrCloudCluster miniCluster
|
||||||
|
= new MiniSolrCloudCluster(NUM_SERVERS, createTempDir(), JettyConfig.builder().setContext("/solr").build());
|
||||||
CloudSolrClient cloudSolrClient = miniCluster.getSolrClient();
|
CloudSolrClient cloudSolrClient = miniCluster.getSolrClient();
|
||||||
cloudSolrClient.setDefaultCollection(collectionName);
|
cloudSolrClient.setDefaultCollection(collectionName);
|
||||||
|
|
||||||
|
|
|
@ -175,7 +175,7 @@ public class PingRequestHandlerTest extends SolrTestCaseJ4 {
|
||||||
|
|
||||||
public void testPingInClusterWithNoHealthCheck() throws Exception {
|
public void testPingInClusterWithNoHealthCheck() throws Exception {
|
||||||
|
|
||||||
MiniSolrCloudCluster miniCluster = new MiniSolrCloudCluster(NUM_SERVERS, createTempDir());
|
MiniSolrCloudCluster miniCluster = new MiniSolrCloudCluster(NUM_SERVERS, createTempDir(), buildJettyConfig("/solr"));
|
||||||
|
|
||||||
final CloudSolrClient cloudSolrClient = miniCluster.getSolrClient();
|
final CloudSolrClient cloudSolrClient = miniCluster.getSolrClient();
|
||||||
|
|
||||||
|
|
|
@ -52,7 +52,7 @@ public class TestDistribIDF extends SolrTestCaseJ4 {
|
||||||
}
|
}
|
||||||
|
|
||||||
super.setUp();
|
super.setUp();
|
||||||
solrCluster = new MiniSolrCloudCluster(3, createTempDir());
|
solrCluster = new MiniSolrCloudCluster(3, createTempDir(), buildJettyConfig("/solr"));
|
||||||
// set some system properties for use by tests
|
// set some system properties for use by tests
|
||||||
System.setProperty("solr.test.sys.prop1", "propone");
|
System.setProperty("solr.test.sys.prop1", "propone");
|
||||||
System.setProperty("solr.test.sys.prop2", "proptwo");
|
System.setProperty("solr.test.sys.prop2", "proptwo");
|
||||||
|
|
|
@ -33,7 +33,7 @@ public class TestCloudSolrClientConnections extends SolrTestCaseJ4 {
|
||||||
public void testCloudClientCanConnectAfterClusterComesUp() throws Exception {
|
public void testCloudClientCanConnectAfterClusterComesUp() throws Exception {
|
||||||
|
|
||||||
// Start by creating a cluster with no jetties
|
// Start by creating a cluster with no jetties
|
||||||
MiniSolrCloudCluster cluster = new MiniSolrCloudCluster(0, createTempDir());
|
MiniSolrCloudCluster cluster = new MiniSolrCloudCluster(0, createTempDir(), buildJettyConfig("/solr"));
|
||||||
try {
|
try {
|
||||||
|
|
||||||
CloudSolrClient client = cluster.getSolrClient();
|
CloudSolrClient client = cluster.getSolrClient();
|
||||||
|
@ -65,7 +65,7 @@ public class TestCloudSolrClientConnections extends SolrTestCaseJ4 {
|
||||||
|
|
||||||
Path configPath = getFile("solrj").toPath().resolve("solr/configsets/configset-2/conf");
|
Path configPath = getFile("solrj").toPath().resolve("solr/configsets/configset-2/conf");
|
||||||
|
|
||||||
MiniSolrCloudCluster cluster = new MiniSolrCloudCluster(0, createTempDir());
|
MiniSolrCloudCluster cluster = new MiniSolrCloudCluster(0, createTempDir(), buildJettyConfig("/solr"));
|
||||||
try {
|
try {
|
||||||
CloudSolrClient client = cluster.getSolrClient();
|
CloudSolrClient client = cluster.getSolrClient();
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -87,8 +87,6 @@ public class MiniSolrCloudCluster {
|
||||||
" \n" +
|
" \n" +
|
||||||
"</solr>\n";
|
"</solr>\n";
|
||||||
|
|
||||||
public static final JettyConfig DEFAULT_JETTY_CONFIG = JettyConfig.builder().setContext("/solr").build();
|
|
||||||
|
|
||||||
private final ZkTestServer zkServer;
|
private final ZkTestServer zkServer;
|
||||||
private final boolean externalZkServer;
|
private final boolean externalZkServer;
|
||||||
private final List<JettySolrRunner> jettys = new LinkedList<>();
|
private final List<JettySolrRunner> jettys = new LinkedList<>();
|
||||||
|
@ -100,18 +98,6 @@ public class MiniSolrCloudCluster {
|
||||||
|
|
||||||
private final AtomicInteger nodeIds = new AtomicInteger();
|
private final AtomicInteger nodeIds = new AtomicInteger();
|
||||||
|
|
||||||
/**
|
|
||||||
* Create a MiniSolrCloudCluster with default configuration
|
|
||||||
*
|
|
||||||
* @param numServers number of Solr servers to start
|
|
||||||
* @param baseDir base directory that the mini cluster should be run from
|
|
||||||
*
|
|
||||||
* @throws Exception if there was an error starting the cluster
|
|
||||||
*/
|
|
||||||
public MiniSolrCloudCluster(int numServers, Path baseDir) throws Exception {
|
|
||||||
this(numServers, baseDir, DEFAULT_CLOUD_SOLR_XML, DEFAULT_JETTY_CONFIG, null);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a MiniSolrCloudCluster with default solr.xml
|
* Create a MiniSolrCloudCluster with default solr.xml
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in New Issue