use random tmp data dir for more tests

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@926776 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Mark Robert Miller 2010-03-23 20:56:54 +00:00
parent 234c46008a
commit 32a370e127
2 changed files with 8 additions and 2 deletions

View File

@ -42,7 +42,7 @@ abstract public class SolrExampleTestBase extends AbstractSolrTestCase
// this sets the property for jetty starting SolrDispatchFilter
System.setProperty( "solr.solr.home", this.getSolrHome() );
System.setProperty( "solr.data.dir", "./solr/data" );
System.setProperty( "solr.data.dir", this.dataDir.getCanonicalPath() );
}
/**

View File

@ -17,6 +17,7 @@
package org.apache.solr.client.solrj.embedded;
import java.io.File;
import java.net.URL;
import junit.framework.TestCase;
@ -42,7 +43,12 @@ public class JettyWebappTest extends TestCase
public void setUp() throws Exception
{
System.setProperty("solr.solr.home", "../../../example/solr");
System.setProperty("solr.data.dir", "./solr/data");
File dataDir = new File(System.getProperty("java.io.tmpdir")
+ System.getProperty("file.separator")
+ getClass().getName() + "-" + System.currentTimeMillis());
dataDir.mkdirs();
System.setProperty("solr.data.dir", dataDir.getCanonicalPath());
String path = "../../webapp/web";
server = new Server(port);