use a temp dir for solrhome for this test - it makes a stopwords.bak file that can interfere with later tests

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1421543 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Mark Robert Miller 2012-12-13 21:22:05 +00:00
parent 92176fce6e
commit a3f456e378
1 changed files with 11 additions and 1 deletions

View File

@ -30,9 +30,11 @@ import org.apache.solr.client.solrj.request.UpdateRequest;
import org.apache.solr.common.SolrInputDocument;
import org.apache.solr.core.SolrCore;
import org.junit.BeforeClass;
import org.junit.AfterClass;
public class AnalysisAfterCoreReloadTest extends SolrTestCaseJ4 {
private static String tmpSolrHome;
int port = 0;
static final String context = "/solr";
@ -40,9 +42,17 @@ public class AnalysisAfterCoreReloadTest extends SolrTestCaseJ4 {
@BeforeClass
public static void beforeClass() throws Exception {
initCore("solrconfig.xml", "schema.xml");
createTempDir();
tmpSolrHome = TEMP_DIR + File.separator + AnalysisAfterCoreReloadTest.class.getSimpleName() + System.currentTimeMillis();
FileUtils.copyDirectory(new File(TEST_HOME()), new File(tmpSolrHome).getAbsoluteFile());
initCore("solrconfig.xml", "schema.xml", new File(tmpSolrHome).getAbsolutePath());
}
@AfterClass
public static void AfterClass() throws Exception {
FileUtils.deleteDirectory(new File(tmpSolrHome).getAbsoluteFile());
}
public void testStopwordsAfterCoreReload() throws Exception {
SolrInputDocument doc = new SolrInputDocument();
doc.setField( "id", "42" );