diff --git a/search-services/alfresco-search/src/test/java/org/alfresco/solr/CoresCreateUpdateDistributedTest.java b/search-services/alfresco-search/src/test/java/org/alfresco/solr/CoresCreateUpdateDistributedTest.java index 507443623..2081c770f 100644 --- a/search-services/alfresco-search/src/test/java/org/alfresco/solr/CoresCreateUpdateDistributedTest.java +++ b/search-services/alfresco-search/src/test/java/org/alfresco/solr/CoresCreateUpdateDistributedTest.java @@ -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"); diff --git a/search-services/alfresco-search/src/test/java/org/alfresco/solr/SolrTestInitializer.java b/search-services/alfresco-search/src/test/java/org/alfresco/solr/SolrTestInitializer.java index 0fa0b2363..2854c6312 100644 --- a/search-services/alfresco-search/src/test/java/org/alfresco/solr/SolrTestInitializer.java +++ b/search-services/alfresco-search/src/test/java/org/alfresco/solr/SolrTestInitializer.java @@ -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();