[SEARCH-1309] solr home proper set up for distributed tests

This commit is contained in:
Alessandro Benedetti
2019-02-05 18:08:53 +00:00
parent 88c0b64971
commit 1ee6e2a157
2 changed files with 2 additions and 6 deletions

View File

@@ -66,7 +66,6 @@ public class CoresCreateUpdateDistributedTest extends AbstractAlfrescoDistribute
private void destroyData() throws Throwable
{
dismissSolrServers();
System.clearProperty("solr.solr.home");
}
@Test
@@ -100,11 +99,6 @@ public class CoresCreateUpdateDistributedTest extends AbstractAlfrescoDistribute
assertNotNull(coreAdminHandler);
String coreName = "alfSharedCore";
//AlfrescoSolrDataModel.getResourceDirectory() looks for solrhome in a system property or jndi.
//In production there's always a solr.home but not in this test, so this is the workaround.
//Set it here and clean up with a @AfterClass method.
System.setProperty("solr.solr.home", coreContainer.getSolrHome());
//First, we have no cores so we can update the shared properties, including disallowed
updateShared(coreAdminHandler,"property.solr.host", "myhost", "property.my.property", "chocolate",
"property.alfresco.identifier.property.0", "http://www.alfresco.org/model/content/1.0}userName");

View File

@@ -196,12 +196,14 @@ public abstract class SolrTestInitializer extends SolrTestCaseJ4
System.setProperty("solr.test.sys.prop2", "proptwo");
System.setProperty("solr.directoryFactory", "org.apache.solr.core.MockDirectoryFactory");
System.setProperty("solr.log.dir", testDir.toPath().resolve(serverName).toString());
System.setProperty("solr.solr.home", testDir.toPath().resolve(serverName).toString());
}
public static void distribTearDown() throws Exception
{
System.clearProperty("solr.directoryFactory");
System.clearProperty("solr.log.dir");
System.clearProperty("solr.solr.home");
SOLRAPIQueueClient.nodeMetaDataMap.clear();
SOLRAPIQueueClient.transactionQueue.clear();