SOLR-2299: fix JettyWebappTest to work without a cwd of test-files

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1053896 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Muir 2010-12-30 13:59:51 +00:00
parent a3e1ede9bd
commit 390b5ff14b
2 changed files with 4 additions and 2 deletions

View File

@ -16,6 +16,7 @@ abstract public class SolrJettyTestBase extends SolrTestCaseJ4
// without breaking configs.
private static final String SOURCE_HOME = determineSourceHome();
public static String WEBAPP_HOME = new File(SOURCE_HOME, "src/webapp/web").getAbsolutePath();
public static String EXAMPLE_HOME = new File(SOURCE_HOME, "example/solr").getAbsolutePath();
public static String EXAMPLE_MULTICORE_HOME = new File(SOURCE_HOME, "example/multicore").getAbsolutePath();
public static String EXAMPLE_SCHEMA=EXAMPLE_HOME+"/conf/schema.xml";

View File

@ -25,6 +25,7 @@ import org.apache.lucene.util.LuceneTestCase;
import org.apache.commons.io.IOUtils;
import org.apache.solr.SolrTestCaseJ4;
import org.apache.solr.client.solrj.SolrJettyTestBase;
import org.mortbay.jetty.Connector;
import org.mortbay.jetty.Server;
import org.mortbay.jetty.bio.SocketConnector;
@ -46,13 +47,13 @@ public class JettyWebappTest extends LuceneTestCase
public void setUp() throws Exception
{
super.setUp();
System.setProperty("solr.solr.home", "../../../example/solr");
System.setProperty("solr.solr.home", SolrJettyTestBase.EXAMPLE_HOME);
File dataDir = new File(SolrTestCaseJ4.TEMP_DIR,
getClass().getName() + "-" + System.currentTimeMillis());
dataDir.mkdirs();
System.setProperty("solr.data.dir", dataDir.getCanonicalPath());
String path = "../../webapp/web";
String path = SolrJettyTestBase.WEBAPP_HOME;
server = new Server(port);
// insecure: only use for tests!!!!