diff --git a/solr/src/test/org/apache/solr/client/solrj/SolrExampleTestBase.java b/solr/src/test/org/apache/solr/client/solrj/SolrExampleTestBase.java index 4260927ba09..b4dc835c622 100644 --- a/solr/src/test/org/apache/solr/client/solrj/SolrExampleTestBase.java +++ b/solr/src/test/org/apache/solr/client/solrj/SolrExampleTestBase.java @@ -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() ); } /** diff --git a/solr/src/test/org/apache/solr/client/solrj/embedded/JettyWebappTest.java b/solr/src/test/org/apache/solr/client/solrj/embedded/JettyWebappTest.java index 6d91e211a06..7090c470663 100644 --- a/solr/src/test/org/apache/solr/client/solrj/embedded/JettyWebappTest.java +++ b/solr/src/test/org/apache/solr/client/solrj/embedded/JettyWebappTest.java @@ -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);