You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by rm...@apache.org on 2011/11/15 00:53:58 UTC
svn commit: r1201967 -
/lucene/dev/branches/lucene2621/modules/benchmark/src/test/org/apache/lucene/benchmark/BenchmarkTestCase.java
Author: rmuir
Date: Mon Nov 14 23:53:57 2011
New Revision: 1201967
URL: http://svn.apache.org/viewvc?rev=1201967&view=rev
Log:
LUCENE-2621: make a real unique temp dir
Modified:
lucene/dev/branches/lucene2621/modules/benchmark/src/test/org/apache/lucene/benchmark/BenchmarkTestCase.java
Modified: lucene/dev/branches/lucene2621/modules/benchmark/src/test/org/apache/lucene/benchmark/BenchmarkTestCase.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene2621/modules/benchmark/src/test/org/apache/lucene/benchmark/BenchmarkTestCase.java?rev=1201967&r1=1201966&r2=1201967&view=diff
==============================================================================
--- lucene/dev/branches/lucene2621/modules/benchmark/src/test/org/apache/lucene/benchmark/BenchmarkTestCase.java (original)
+++ lucene/dev/branches/lucene2621/modules/benchmark/src/test/org/apache/lucene/benchmark/BenchmarkTestCase.java Mon Nov 14 23:53:57 2011
@@ -26,12 +26,28 @@ import java.io.StringReader;
import org.apache.lucene.benchmark.byTask.Benchmark;
import org.apache.lucene.util.LuceneTestCase;
+import org.apache.lucene.util._TestUtil;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
/** Base class for all Benchmark unit tests. */
public abstract class BenchmarkTestCase extends LuceneTestCase {
+ private static File WORKDIR;
+
+ @BeforeClass
+ public static void beforeClassBenchmarkTestCase() throws Exception {
+ WORKDIR = _TestUtil.getTempDir("benchmark");
+ WORKDIR.delete();
+ WORKDIR.mkdirs();
+ }
+
+ @AfterClass
+ public static void afterClassBenchmarkTestCase() throws Exception {
+ WORKDIR = null;
+ }
public File getWorkDir() {
- return TEMP_DIR;
+ return WORKDIR;
}
/** Copy a resource into the workdir */