mirror of https://github.com/apache/lucene.git
Remove 3 File.createTempDir in favour of LTC's own cleanup magic.
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1359920 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
524fa2d4f6
commit
80c852e721
|
@ -39,6 +39,7 @@ import javax.xml.xpath.XPathFactory;
|
|||
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.apache.lucene.util.LuceneTestCase;
|
||||
import org.apache.lucene.util._TestUtil;
|
||||
import org.apache.solr.core.SolrXMLSerializer.SolrCoreXMLDef;
|
||||
import org.apache.solr.core.SolrXMLSerializer.SolrXMLDef;
|
||||
import org.junit.Test;
|
||||
|
@ -81,11 +82,12 @@ public class TestSolrXMLSerializer extends LuceneTestCase {
|
|||
assertResults(((StringWriter) w).getBuffer().toString().getBytes("UTF-8"));
|
||||
|
||||
// again with default file
|
||||
File tmpFile = File.createTempFile("solr", ".xml", TEMP_DIR);
|
||||
File tmpFile = _TestUtil.getTempDir("solr.xml");
|
||||
|
||||
serializer.persistFile(tmpFile, solrXMLDef);
|
||||
|
||||
assertResults(FileUtils.readFileToString(tmpFile, "UTF-8").getBytes("UTF-8"));
|
||||
tmpFile.delete();
|
||||
}
|
||||
|
||||
private void assertResults(byte[] bytes)
|
||||
|
|
|
@ -23,6 +23,8 @@ import java.text.Collator;
|
|||
import java.text.RuleBasedCollator;
|
||||
import java.util.Locale;
|
||||
|
||||
import org.apache.lucene.util._TestUtil;
|
||||
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.apache.solr.SolrTestCaseJ4;
|
||||
|
@ -61,7 +63,7 @@ public class TestCollationField extends SolrTestCaseJ4 {
|
|||
*/
|
||||
public static String setupSolrHome() throws Exception {
|
||||
// make a solr home underneath the test's TEMP_DIR
|
||||
File tmpFile = File.createTempFile("test", "tmp", TEMP_DIR);
|
||||
File tmpFile = _TestUtil.getTempDir("collation1");
|
||||
tmpFile.delete();
|
||||
tmpFile.mkdir();
|
||||
|
||||
|
|
|
@ -31,6 +31,8 @@ import org.apache.solr.common.params.CommonParams;
|
|||
import org.junit.BeforeClass;
|
||||
import org.junit.Test;
|
||||
|
||||
import org.apache.lucene.util._TestUtil;
|
||||
|
||||
/**
|
||||
* A test case for the several HTTP cache headers emitted by Solr
|
||||
*/
|
||||
|
@ -54,6 +56,7 @@ public class CacheHeaderTest extends CacheHeaderTestBase {
|
|||
HttpResponse response = getClient().execute(m);
|
||||
assertEquals(200, response.getStatusLine().getStatusCode());
|
||||
checkVetoHeaders(response, true);
|
||||
f.delete();
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -243,8 +246,7 @@ public class CacheHeaderTest extends CacheHeaderTestBase {
|
|||
|
||||
protected File makeFile(String contents, String charset) {
|
||||
try {
|
||||
File f = File.createTempFile(getClass().getName(),"csv");
|
||||
f.deleteOnExit();
|
||||
File f = _TestUtil.getTempDir("cachetest_csv");
|
||||
Writer out = new OutputStreamWriter(new FileOutputStream(f),
|
||||
charset);
|
||||
out.write(contents);
|
||||
|
|
Loading…
Reference in New Issue