mirror of
https://github.com/Alfresco/SearchServices.git
synced 2025-09-17 14:21:20 +00:00
[ SEARCH-1687 ] TestFolder isolation: class name + timestamp
This commit is contained in:
@@ -39,13 +39,13 @@ import static org.alfresco.solr.AlfrescoSolrUtils.*;
|
|||||||
@SolrTestCaseJ4.SuppressSSL
|
@SolrTestCaseJ4.SuppressSSL
|
||||||
public class AdminHandlerDistributedIT extends AbstractAlfrescoDistributedIT
|
public class AdminHandlerDistributedIT extends AbstractAlfrescoDistributedIT
|
||||||
{
|
{
|
||||||
final static String JETTY_SERVER_ID = getSimpleClassName();
|
static String testFolder;
|
||||||
static final String CORE_NAME = "newcoretesting";
|
static final String CORE_NAME = "newcoretesting";
|
||||||
|
|
||||||
@BeforeClass
|
@BeforeClass
|
||||||
public static void initData() throws Throwable
|
public static void initData() throws Throwable
|
||||||
{
|
{
|
||||||
initSolrServers(2, JETTY_SERVER_ID, null);
|
testFolder = initSolrServers(2, AdminHandlerDistributedIT.class.getSimpleName(), null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@AfterClass
|
@AfterClass
|
||||||
@@ -58,7 +58,7 @@ public class AdminHandlerDistributedIT extends AbstractAlfrescoDistributedIT
|
|||||||
@Test
|
@Test
|
||||||
public void newCoreUsingAdminHandler() throws Exception
|
public void newCoreUsingAdminHandler() throws Exception
|
||||||
{
|
{
|
||||||
CoreContainer coreContainer = jettyContainers.get(JETTY_SERVER_ID).getCoreContainer();
|
CoreContainer coreContainer = jettyContainers.get(testFolder).getCoreContainer();
|
||||||
|
|
||||||
//Create the new core
|
//Create the new core
|
||||||
AlfrescoCoreAdminHandler coreAdminHandler = (AlfrescoCoreAdminHandler) coreContainer.getMultiCoreHandler();
|
AlfrescoCoreAdminHandler coreAdminHandler = (AlfrescoCoreAdminHandler) coreContainer.getMultiCoreHandler();
|
||||||
|
@@ -19,7 +19,6 @@
|
|||||||
package org.alfresco.solr;
|
package org.alfresco.solr;
|
||||||
|
|
||||||
import org.alfresco.service.cmr.repository.StoreRef;
|
import org.alfresco.service.cmr.repository.StoreRef;
|
||||||
import org.apache.lucene.util.LuceneTestCase;
|
|
||||||
import org.apache.solr.SolrTestCaseJ4;
|
import org.apache.solr.SolrTestCaseJ4;
|
||||||
import org.apache.solr.common.SolrException;
|
import org.apache.solr.common.SolrException;
|
||||||
import org.apache.solr.common.params.CoreAdminParams;
|
import org.apache.solr.common.params.CoreAdminParams;
|
||||||
@@ -52,13 +51,12 @@ import static org.alfresco.solr.AlfrescoSolrUtils.getCore;
|
|||||||
@SolrTestCaseJ4.SuppressSSL
|
@SolrTestCaseJ4.SuppressSSL
|
||||||
public class CoresCreateUpdateDistributedIT extends AbstractAlfrescoDistributedIT
|
public class CoresCreateUpdateDistributedIT extends AbstractAlfrescoDistributedIT
|
||||||
{
|
{
|
||||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
static String testFolder;
|
||||||
final static String JETTY_SERVER_ID = CoresCreateUpdateDistributedIT.class.getSimpleName();
|
|
||||||
|
|
||||||
@Before
|
@Before
|
||||||
public void initData() throws Throwable
|
public void initData() throws Throwable
|
||||||
{
|
{
|
||||||
initSolrServers(0, JETTY_SERVER_ID , null);
|
testFolder = initSolrServers(0, CoresCreateUpdateDistributedIT.class.getSimpleName(), null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@After
|
@After
|
||||||
@@ -70,7 +68,7 @@ public class CoresCreateUpdateDistributedIT extends AbstractAlfrescoDistributedI
|
|||||||
@Test
|
@Test
|
||||||
public void newCoreUsingAllDefaults() throws Exception
|
public void newCoreUsingAllDefaults() throws Exception
|
||||||
{
|
{
|
||||||
CoreContainer coreContainer = jettyContainers.get(JETTY_SERVER_ID).getCoreContainer();
|
CoreContainer coreContainer = jettyContainers.get(testFolder).getCoreContainer();
|
||||||
|
|
||||||
//Now create the new core with
|
//Now create the new core with
|
||||||
AlfrescoCoreAdminHandler coreAdminHandler = (AlfrescoCoreAdminHandler) coreContainer.getMultiCoreHandler();
|
AlfrescoCoreAdminHandler coreAdminHandler = (AlfrescoCoreAdminHandler) coreContainer.getMultiCoreHandler();
|
||||||
@@ -91,7 +89,7 @@ public class CoresCreateUpdateDistributedIT extends AbstractAlfrescoDistributedI
|
|||||||
@Test
|
@Test
|
||||||
public void newCoreWithUpdateSharedProperties() throws Exception
|
public void newCoreWithUpdateSharedProperties() throws Exception
|
||||||
{
|
{
|
||||||
CoreContainer coreContainer = jettyContainers.get(JETTY_SERVER_ID).getCoreContainer();
|
CoreContainer coreContainer = jettyContainers.get(testFolder).getCoreContainer();
|
||||||
|
|
||||||
//Now create the new core with
|
//Now create the new core with
|
||||||
AlfrescoCoreAdminHandler coreAdminHandler = (AlfrescoCoreAdminHandler) coreContainer.getMultiCoreHandler();
|
AlfrescoCoreAdminHandler coreAdminHandler = (AlfrescoCoreAdminHandler) coreContainer.getMultiCoreHandler();
|
||||||
@@ -131,7 +129,7 @@ public class CoresCreateUpdateDistributedIT extends AbstractAlfrescoDistributedI
|
|||||||
@Test
|
@Test
|
||||||
public void newCoreUsingArchiveStore() throws Exception
|
public void newCoreUsingArchiveStore() throws Exception
|
||||||
{
|
{
|
||||||
CoreContainer coreContainer = jettyContainers.get(JETTY_SERVER_ID).getCoreContainer();
|
CoreContainer coreContainer = jettyContainers.get(testFolder).getCoreContainer();
|
||||||
|
|
||||||
//Now create the new core with
|
//Now create the new core with
|
||||||
AlfrescoCoreAdminHandler coreAdminHandler = (AlfrescoCoreAdminHandler) coreContainer.getMultiCoreHandler();
|
AlfrescoCoreAdminHandler coreAdminHandler = (AlfrescoCoreAdminHandler) coreContainer.getMultiCoreHandler();
|
||||||
|
@@ -67,7 +67,6 @@ import java.util.concurrent.atomic.AtomicInteger;
|
|||||||
* @since solr 1.5
|
* @since solr 1.5
|
||||||
* @author Michael Suzuki
|
* @author Michael Suzuki
|
||||||
*/
|
*/
|
||||||
@ThreadLeakLingering(linger = 5000)
|
|
||||||
public abstract class SolrITInitializer extends SolrTestCaseJ4
|
public abstract class SolrITInitializer extends SolrTestCaseJ4
|
||||||
{
|
{
|
||||||
private static final Logger LOGGER = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
private static final Logger LOGGER = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||||
@@ -117,7 +116,10 @@ public abstract class SolrITInitializer extends SolrTestCaseJ4
|
|||||||
testDir = new File(System.getProperty("user.dir") + "/target/jettys");
|
testDir = new File(System.getProperty("user.dir") + "/target/jettys");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void initSolrServers(int numShards, String testClassName, Properties solrcoreProperties) throws Throwable
|
/**
|
||||||
|
* Initialises the Solr infrastructure and returns back the test folder used.
|
||||||
|
*/
|
||||||
|
public static String initSolrServers(int numShards, String testClassName, Properties solrcoreProperties) throws Throwable
|
||||||
{
|
{
|
||||||
testClassName = testClassName + "_" + System.currentTimeMillis();
|
testClassName = testClassName + "_" + System.currentTimeMillis();
|
||||||
|
|
||||||
@@ -140,6 +142,8 @@ public abstract class SolrITInitializer extends SolrTestCaseJ4
|
|||||||
createServers(testClassName, coreNames, numShards, solrcoreProperties);
|
createServers(testClassName, coreNames, numShards, solrcoreProperties);
|
||||||
|
|
||||||
System.setProperty("solr.solr.home", testDir.toPath().resolve(testClassName).toString());
|
System.setProperty("solr.solr.home", testDir.toPath().resolve(testClassName).toString());
|
||||||
|
|
||||||
|
return testClassName;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Properties addExplicitShardingProperty(Properties solrcoreProperties)
|
private static Properties addExplicitShardingProperty(Properties solrcoreProperties)
|
||||||
|
@@ -37,7 +37,7 @@ import org.junit.Test;
|
|||||||
@SolrTestCaseJ4.SuppressSSL
|
@SolrTestCaseJ4.SuppressSSL
|
||||||
public class TemplatesDistributedIT extends AbstractAlfrescoDistributedIT
|
public class TemplatesDistributedIT extends AbstractAlfrescoDistributedIT
|
||||||
{
|
{
|
||||||
final static String JETTY_SERVER_ID = getSimpleClassName();
|
final static String JETTY_SERVER_ID = TemplatesDistributedIT.class.getSimpleName();
|
||||||
|
|
||||||
@BeforeClass
|
@BeforeClass
|
||||||
public static void initData() throws Throwable
|
public static void initData() throws Throwable
|
||||||
|
Reference in New Issue
Block a user