mirror of https://github.com/apache/lucene.git
SOLR-9481: Fix test errors by using coreContainer.getSolrHome instead of SolrResourceLoader.locateSolrHome() in SecurityConfHandlerLocal
This commit is contained in:
parent
feb1a5d3e7
commit
24446f5085
|
@ -23,6 +23,7 @@ import java.io.OutputStream;
|
|||
import java.lang.invoke.MethodHandles;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.Collections;
|
||||
|
||||
import org.apache.solr.common.SolrException;
|
||||
|
@ -43,7 +44,7 @@ public class SecurityConfHandlerLocal extends SecurityConfHandler {
|
|||
|
||||
public SecurityConfHandlerLocal(CoreContainer coreContainer) {
|
||||
super(coreContainer);
|
||||
securityJsonPath = SolrResourceLoader.locateSolrHome().resolve("security.json");
|
||||
securityJsonPath = Paths.get(coreContainer.getSolrHome()).resolve("security.json");
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -20,20 +20,16 @@ package org.apache.solr.handler.admin;
|
|||
import java.io.IOException;
|
||||
|
||||
import org.apache.solr.core.CoreContainer;
|
||||
import org.apache.solr.core.SolrResourceLoader;
|
||||
|
||||
/**
|
||||
* Wrapper for use in tests
|
||||
*/
|
||||
public class SecurityConfHandlerLocalForTesting extends SecurityConfHandlerLocal {
|
||||
|
||||
public SecurityConfHandlerLocalForTesting(CoreContainer coreContainer) {
|
||||
super(coreContainer);
|
||||
}
|
||||
|
||||
public boolean persistConf(SecurityConfig securityConfig) throws IOException {
|
||||
// Set JSON_PATH again since the test may have
|
||||
securityJsonPath = SolrResourceLoader.locateSolrHome().resolve("security.json");
|
||||
return super.persistConf(securityConfig);
|
||||
}
|
||||
|
||||
|
|
|
@ -70,7 +70,6 @@ public class BasicAuthStandaloneTest extends AbstractSolrTestCase {
|
|||
super.setUp();
|
||||
instance = new SolrInstance("inst", null);
|
||||
instance.setUp();
|
||||
System.setProperty("solr.solr.home", instance.getHomeDir().toString());
|
||||
jetty = createJetty(instance);
|
||||
initCore("solrconfig.xml", "schema.xml", instance.getHomeDir().toString());
|
||||
securityConfHandler = new SecurityConfHandlerLocalForTesting(jetty.getCoreContainer());
|
||||
|
|
Loading…
Reference in New Issue