From 90cb0259f814e5eb68c0661a9ef69c80fa445e00 Mon Sep 17 00:00:00 2001 From: Yonik Seeley Date: Mon, 28 Sep 2009 01:22:53 +0000 Subject: [PATCH] tests: make TestBinaryField use generic tmp dir so it's cleaned up at the end git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@819441 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/solr/schema/TestBinaryField.java | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/test/org/apache/solr/schema/TestBinaryField.java b/src/test/org/apache/solr/schema/TestBinaryField.java index 3580e6e0724..80fc7659dd8 100644 --- a/src/test/org/apache/solr/schema/TestBinaryField.java +++ b/src/test/org/apache/solr/schema/TestBinaryField.java @@ -25,13 +25,14 @@ import org.apache.solr.client.solrj.response.QueryResponse; import org.apache.solr.common.SolrDocument; import org.apache.solr.common.SolrDocumentList; import org.apache.solr.common.SolrInputDocument; +import org.apache.solr.util.AbstractSolrTestCase; import org.apache.commons.io.FileUtils; import java.nio.ByteBuffer; import java.io.File; import java.util.List; -public class TestBinaryField extends TestCase { +public class TestBinaryField extends AbstractSolrTestCase { CommonsHttpSolrServer server; JettySolrRunner jetty; @@ -39,14 +40,18 @@ public class TestBinaryField extends TestCase { static final String context = "/example"; + public String getSchemaFile() { + return null; + } + public String getSolrConfigFile() { + return null; + } + @Override public void setUp() throws Exception { super.setUp(); - String home = System.getProperty("java.io.tmpdir") - + File.separator - + getClass().getName() + "-" + System.currentTimeMillis(); - + File home = dataDir; File homeDir = new File(home, "example"); File dataDir = new File(homeDir, "data"); @@ -76,6 +81,7 @@ public class TestBinaryField extends TestCase { String url = "http://localhost:" + jetty.getLocalPort() + context; server = new CommonsHttpSolrServer(url); // server.setRequestWriter(new BinaryRequestWriter()); + super.postSetUp(); } public void testSimple() throws Exception { @@ -172,7 +178,8 @@ public class TestBinaryField extends TestCase { } - protected void tearDown() throws Exception { + public void tearDown() throws Exception { jetty.stop(); + super.tearDown(); } }