Updated Branches: refs/heads/lucene-4.0.0 ad0095c52 -> c7a57227e
Moved all of the test output files into the target directory. Test output files are now properly cleaned up on "mvn clean" Maven sets up a system property when running mvn test Otherwise (eclipse) the /tmp is used. Project: http://git-wip-us.apache.org/repos/asf/incubator-blur/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-blur/commit/c7a57227 Tree: http://git-wip-us.apache.org/repos/asf/incubator-blur/tree/c7a57227 Diff: http://git-wip-us.apache.org/repos/asf/incubator-blur/diff/c7a57227 Branch: refs/heads/lucene-4.0.0 Commit: c7a57227ec1d228e4e022e75b7210f56a451ddf5 Parents: ad0095c Author: Patrick Hunt <[email protected]> Authored: Tue Oct 23 15:58:41 2012 -0700 Committer: Patrick Hunt <[email protected]> Committed: Tue Oct 23 15:58:41 2012 -0700 ---------------------------------------------------------------------- .../src/test/java/org/apache/blur/MiniCluster.java | 51 ++++++++------- .../org/apache/blur/manager/IndexManagerTest.java | 7 ++- .../clusterstatus/ZookeeperClusterStatusTest.java | 7 ++- .../blur/manager/writer/BlurNRTIndexTest.java | 5 +- .../manager/writer/TransactionRecorderTest.java | 9 ++- .../org/apache/blur/thrift/BlurClusterTest.java | 2 +- .../blur/thrift/BlurControllerServerTest.java | 4 +- .../java/org/apache/blur/utils/BlurUtilsTest.java | 9 ++- .../apache/blur/mapred/BlurInputFormatTest.java | 2 +- .../org/apache/blur/mapreduce/BlurTaskTest.java | 19 +++--- .../blur/mapreduce/lib/BlurInputFormatTest.java | 2 +- .../blur/mapreduce/lib/BlurRecordWriterTest.java | 2 +- .../org/apache/blur/store/HdfsDirectoryTest.java | 3 +- .../blur/store/blockcache/BlockDirectoryTest.java | 3 +- src/pom.xml | 10 +++ 15 files changed, 81 insertions(+), 54 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/c7a57227/src/blur-core/src/test/java/org/apache/blur/MiniCluster.java ---------------------------------------------------------------------- diff --git a/src/blur-core/src/test/java/org/apache/blur/MiniCluster.java b/src/blur-core/src/test/java/org/apache/blur/MiniCluster.java index 5b35cf1..ae7fe02 100644 --- a/src/blur-core/src/test/java/org/apache/blur/MiniCluster.java +++ b/src/blur-core/src/test/java/org/apache/blur/MiniCluster.java @@ -77,8 +77,10 @@ import org.apache.zookeeper.server.quorum.QuorumPeerConfig; import org.apache.zookeeper.server.quorum.QuorumPeerConfig.ConfigException; public abstract class MiniCluster { + private static final Log LOG = LogFactory.getLog(MiniCluster.class); + + private static final File TMPDIR = new File(System.getProperty("blur.tmp.dir", "/tmp")); - private static Log LOG = LogFactory.getLog(MiniCluster.class); private static MiniDFSCluster cluster; private static Thread serverThread; // private static String zkConnectionString = "localhost:21810"; @@ -89,8 +91,8 @@ public abstract class MiniCluster { private static int zkPort; public static void main(String[] args) throws IOException, InterruptedException, KeeperException, BlurException, TException { - startDfs("./tmp"); - startZooKeeper("./tmp"); + startDfs("main"); + startZooKeeper("main"); startControllers(1); startShards(1); @@ -122,9 +124,9 @@ public abstract class MiniCluster { } } - public static void startBlurCluster(String path, int controllerCount, int shardCount) { - startDfs(path); - startZooKeeper(path); + public static void startBlurCluster(String name, int controllerCount, int shardCount) { + startDfs(name); + startZooKeeper(name); startControllers(controllerCount); startShards(shardCount); } @@ -303,20 +305,20 @@ public abstract class MiniCluster { return "localhost:" + zkPort; } - public static void startZooKeeper(String path) { - startZooKeeper(true, path); + public static void startZooKeeper(String name) { + startZooKeeper(true, name); } - public static void startZooKeeper(boolean format, String path) { + public static void startZooKeeper(boolean format, String name) { Properties properties = new Properties(); properties.setProperty("tickTime", "2000"); properties.setProperty("initLimit", "10"); properties.setProperty("syncLimit", "5"); - startZooKeeper(properties, format, path, getRandomPort()); + startZooKeeper(properties, format, name, getRandomPort()); } - public static void startZooKeeper(Properties properties, String path) { - startZooKeeper(properties, true, path, getRandomPort()); + public static void startZooKeeper(Properties properties, String name) { + startZooKeeper(properties, true, name, getRandomPort()); } private static int getRandomPort() { @@ -347,11 +349,11 @@ public abstract class MiniCluster { } } - public static void startZooKeeper(final Properties properties, boolean format, String path, int port) { + public static void startZooKeeper(final Properties properties, boolean format, String name, int port) { zkPort = port; properties.setProperty("clientPort", Integer.toString(port)); - String realPath = path + "/zk_test"; - properties.setProperty("dataDir", realPath); + File realPath = new File(new File(TMPDIR, name), "/zk_test"); + properties.setProperty("dataDir", realPath.getAbsolutePath()); final ServerConfig serverConfig = new ServerConfig(); QuorumPeerConfig config = new QuorumPeerConfig(); try { @@ -364,7 +366,7 @@ public abstract class MiniCluster { throw new RuntimeException(e); } serverConfig.readFrom(config); - rm(new File(realPath)); + rm(realPath); serverThread = new Thread(new Runnable() { @Override @@ -409,20 +411,21 @@ public abstract class MiniCluster { return cluster.getFileSystem().getUri(); } - public static void startDfs(String path) { - startDfs(true, path); + public static void startDfs(String name) { + startDfs(true, name); } - public static void startDfs(boolean format, String path) { - startDfs(new Configuration(), format, path); + public static void startDfs(boolean format, String name) { + startDfs(new Configuration(), format, name); } - public static void startDfs(Configuration conf, String path) { - startDfs(conf, true, path); + public static void startDfs(Configuration conf, String name) { + startDfs(conf, true, name); } - public static void startDfs(Configuration conf, boolean format, String path) { - System.setProperty("test.build.data", path); + public static void startDfs(Configuration conf, boolean format, String name) { + File path = new File(TMPDIR, name); + System.setProperty("test.build.data", path.getAbsolutePath()); try { cluster = new MiniDFSCluster(conf, 1, true, (String[]) null); cluster.waitActive(); http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/c7a57227/src/blur-core/src/test/java/org/apache/blur/manager/IndexManagerTest.java ---------------------------------------------------------------------- diff --git a/src/blur-core/src/test/java/org/apache/blur/manager/IndexManagerTest.java b/src/blur-core/src/test/java/org/apache/blur/manager/IndexManagerTest.java index 6228b4e..f402be9 100644 --- a/src/blur-core/src/test/java/org/apache/blur/manager/IndexManagerTest.java +++ b/src/blur-core/src/test/java/org/apache/blur/manager/IndexManagerTest.java @@ -78,15 +78,18 @@ public class IndexManagerTest { private static final String TABLE = "table"; private static final String FAMILY = "test-family"; private static final String FAMILY2 = "test-family2"; + + private static final File TMPDIR = new File(System.getProperty("blur.tmp.dir", "/tmp")); + private LocalIndexServer server; private IndexManager indexManager; @Before public void setUp() throws BlurException, IOException, InterruptedException { - File file = new File("./tmp/indexer-manager-test"); + File file = new File(TMPDIR, "indexer-manager-test"); rm(file); new File(new File(file, TABLE), SHARD_NAME).mkdirs(); - server = new LocalIndexServer(file, new Path("./tmp/indexer-manager-test")); + server = new LocalIndexServer(file, new Path(file.getAbsolutePath())); indexManager = new IndexManager(); indexManager.setStatusCleanupTimerDelay(1000); http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/c7a57227/src/blur-core/src/test/java/org/apache/blur/manager/clusterstatus/ZookeeperClusterStatusTest.java ---------------------------------------------------------------------- diff --git a/src/blur-core/src/test/java/org/apache/blur/manager/clusterstatus/ZookeeperClusterStatusTest.java b/src/blur-core/src/test/java/org/apache/blur/manager/clusterstatus/ZookeeperClusterStatusTest.java index 27d1e6e..b6d0b86 100644 --- a/src/blur-core/src/test/java/org/apache/blur/manager/clusterstatus/ZookeeperClusterStatusTest.java +++ b/src/blur-core/src/test/java/org/apache/blur/manager/clusterstatus/ZookeeperClusterStatusTest.java @@ -23,6 +23,7 @@ import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; +import java.io.File; import java.io.IOException; import java.util.Arrays; import java.util.List; @@ -57,6 +58,8 @@ public class ZookeeperClusterStatusTest { private static final String TEST = "test"; private static final String DEFAULT = "default"; + private static final File TMPDIR = new File(System.getProperty("blur.tmp.dir", "/tmp")); + private static final Log LOG = LogFactory.getLog(ZookeeperClusterStatusTest.class); private ZooKeeper zooKeeper; private ZookeeperClusterStatus clusterStatus; @@ -70,7 +73,7 @@ public class ZookeeperClusterStatusTest { @BeforeClass public static void setupOnce() throws InterruptedException, IOException, KeeperException { - MiniCluster.startZooKeeper("./tmp/zk_test"); + MiniCluster.startZooKeeper("zk_test"); } @AfterClass @@ -200,7 +203,7 @@ public class ZookeeperClusterStatusTest { TableDescriptor tableDescriptor = new TableDescriptor(); tableDescriptor.setName(name); tableDescriptor.setAnalyzerDefinition(new AnalyzerDefinition()); - tableDescriptor.setTableUri("./tmp/zk_test_hdfs"); + tableDescriptor.setTableUri(new File(TMPDIR, "zk_test_hdfs").getAbsolutePath()); tableDescriptor.setIsEnabled(enabled); clusterStatus.createTable(tableDescriptor); if (enabled) { http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/c7a57227/src/blur-core/src/test/java/org/apache/blur/manager/writer/BlurNRTIndexTest.java ---------------------------------------------------------------------- diff --git a/src/blur-core/src/test/java/org/apache/blur/manager/writer/BlurNRTIndexTest.java b/src/blur-core/src/test/java/org/apache/blur/manager/writer/BlurNRTIndexTest.java index 3cb341b..132d0b2 100644 --- a/src/blur-core/src/test/java/org/apache/blur/manager/writer/BlurNRTIndexTest.java +++ b/src/blur-core/src/test/java/org/apache/blur/manager/writer/BlurNRTIndexTest.java @@ -42,6 +42,9 @@ public class BlurNRTIndexTest { private static final int TEST_NUMBER_WAIT_VISIBLE = 500; private static final int TEST_NUMBER = 50000; + + private static final File TMPDIR = new File(System.getProperty("blur.tmp.dir", "/tmp")); + private BlurNRTIndex writer; private BlurIndexCloser closer; private Random random = new Random(); @@ -53,7 +56,7 @@ public class BlurNRTIndexTest { @Before public void setup() throws IOException { - base = new File("./tmp/blur-index-writer-test"); + base = new File(TMPDIR, "blur-index-writer-test"); rm(base); base.mkdirs(); closer = new BlurIndexCloser(); http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/c7a57227/src/blur-core/src/test/java/org/apache/blur/manager/writer/TransactionRecorderTest.java ---------------------------------------------------------------------- diff --git a/src/blur-core/src/test/java/org/apache/blur/manager/writer/TransactionRecorderTest.java b/src/blur-core/src/test/java/org/apache/blur/manager/writer/TransactionRecorderTest.java index ef43df4..48fa3c6 100644 --- a/src/blur-core/src/test/java/org/apache/blur/manager/writer/TransactionRecorderTest.java +++ b/src/blur-core/src/test/java/org/apache/blur/manager/writer/TransactionRecorderTest.java @@ -39,11 +39,12 @@ import org.apache.lucene.store.RAMDirectory; import org.junit.Test; public class TransactionRecorderTest { + private static final File TMPDIR = new File(System.getProperty("blur.tmp.dir", "/tmp")); @Test public void testReplay() throws IOException { - String tmpPath = "./tmp/transaction-recorder/wal"; - rm(new File(tmpPath)); + File tmpWalFile = new File(TMPDIR, "transaction-recorder/wal"); + rm(tmpWalFile); KeywordAnalyzer analyzer = new KeywordAnalyzer(); Configuration configuration = new Configuration(); @@ -53,7 +54,7 @@ public class TransactionRecorderTest { transactionRecorder.setAnalyzer(blurAnalyzer); transactionRecorder.setConfiguration(configuration); - transactionRecorder.setWalPath(new Path(tmpPath)); + transactionRecorder.setWalPath(new Path(tmpWalFile.getAbsolutePath())); transactionRecorder.init(); transactionRecorder.open(); try { @@ -71,7 +72,7 @@ public class TransactionRecorderTest { TransactionRecorder replayTransactionRecorder = new TransactionRecorder(); replayTransactionRecorder.setAnalyzer(blurAnalyzer); replayTransactionRecorder.setConfiguration(configuration); - replayTransactionRecorder.setWalPath(new Path(tmpPath)); + replayTransactionRecorder.setWalPath(new Path(tmpWalFile.getAbsolutePath())); replayTransactionRecorder.init(); replayTransactionRecorder.replay(writer); http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/c7a57227/src/blur-core/src/test/java/org/apache/blur/thrift/BlurClusterTest.java ---------------------------------------------------------------------- diff --git a/src/blur-core/src/test/java/org/apache/blur/thrift/BlurClusterTest.java b/src/blur-core/src/test/java/org/apache/blur/thrift/BlurClusterTest.java index 0ae3b25..6dbc2cc 100644 --- a/src/blur-core/src/test/java/org/apache/blur/thrift/BlurClusterTest.java +++ b/src/blur-core/src/test/java/org/apache/blur/thrift/BlurClusterTest.java @@ -47,7 +47,7 @@ public class BlurClusterTest { @BeforeClass public static void startCluster() { - MiniCluster.startBlurCluster("./tmp/cluster", 2, 3); + MiniCluster.startBlurCluster("cluster", 2, 3); } @AfterClass http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/c7a57227/src/blur-core/src/test/java/org/apache/blur/thrift/BlurControllerServerTest.java ---------------------------------------------------------------------- diff --git a/src/blur-core/src/test/java/org/apache/blur/thrift/BlurControllerServerTest.java b/src/blur-core/src/test/java/org/apache/blur/thrift/BlurControllerServerTest.java index c6f69f6..dd2f777 100644 --- a/src/blur-core/src/test/java/org/apache/blur/thrift/BlurControllerServerTest.java +++ b/src/blur-core/src/test/java/org/apache/blur/thrift/BlurControllerServerTest.java @@ -35,7 +35,7 @@ public class BlurControllerServerTest { // @BeforeClass // public static void zkServerStartup() throws InterruptedException, // KeeperException, IOException, BlurException, TException { - // rm(new File("../zk-tmp")); + // rm(new File(TMPDIR, "../zk-tmp")); // daemonService = new Thread(new Runnable() { // @Override // public void run() { @@ -66,7 +66,7 @@ public class BlurControllerServerTest { // server.setZookeeper(zookeeper); // server.init(); // - // File file = new File("./tmp-data/test"); + // File file = new File(TMPDIR, "./tmp-data/test"); // rm(file); // // TableDescriptor tableDescriptor = new TableDescriptor(); http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/c7a57227/src/blur-core/src/test/java/org/apache/blur/utils/BlurUtilsTest.java ---------------------------------------------------------------------- diff --git a/src/blur-core/src/test/java/org/apache/blur/utils/BlurUtilsTest.java b/src/blur-core/src/test/java/org/apache/blur/utils/BlurUtilsTest.java index 509d4df..df937da 100644 --- a/src/blur-core/src/test/java/org/apache/blur/utils/BlurUtilsTest.java +++ b/src/blur-core/src/test/java/org/apache/blur/utils/BlurUtilsTest.java @@ -48,6 +48,7 @@ import org.apache.lucene.store.RAMDirectory; import org.junit.Test; public class BlurUtilsTest { + private static final File TMPDIR = new File(System.getProperty("blur.tmp.dir", "/tmp")); @Test public void testHumanizeTime1() { @@ -137,7 +138,7 @@ public class BlurUtilsTest { @Test public void testValidateShardCount() throws IOException { - File file = new File("./tmp/ValidateShardCount-test"); + File file = new File(TMPDIR, "ValidateShardCount-test"); rm(file); Path path = new Path(file.toURI()); Configuration conf = new Configuration(); @@ -150,7 +151,7 @@ public class BlurUtilsTest { @Test public void testValidateShardCountExtraDir() throws IOException { - File file = new File("./tmp/ValidateShardCount-test"); + File file = new File(TMPDIR, "ValidateShardCount-test"); rm(file); Path path = new Path(file.toURI()); Configuration conf = new Configuration(); @@ -164,7 +165,7 @@ public class BlurUtilsTest { @Test public void testValidateShardCountTooFew() throws IOException { - File file = new File("./tmp/ValidateShardCount-test"); + File file = new File(TMPDIR, "ValidateShardCount-test"); rm(file); Path path = new Path(file.toURI()); Configuration conf = new Configuration(); @@ -182,7 +183,7 @@ public class BlurUtilsTest { @Test public void testValidateShardCountTooMany() throws IOException { - File file = new File("./tmp/ValidateShardCount-test"); + File file = new File(TMPDIR, "ValidateShardCount-test"); rm(file); Path path = new Path(file.toURI()); Configuration conf = new Configuration(); http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/c7a57227/src/blur-mapred/src/test/java/org/apache/blur/mapred/BlurInputFormatTest.java ---------------------------------------------------------------------- diff --git a/src/blur-mapred/src/test/java/org/apache/blur/mapred/BlurInputFormatTest.java b/src/blur-mapred/src/test/java/org/apache/blur/mapred/BlurInputFormatTest.java index 5c04039..f8f2482 100644 --- a/src/blur-mapred/src/test/java/org/apache/blur/mapred/BlurInputFormatTest.java +++ b/src/blur-mapred/src/test/java/org/apache/blur/mapred/BlurInputFormatTest.java @@ -40,7 +40,7 @@ import org.junit.Test; public abstract class BlurInputFormatTest { -// private Path indexPath = new Path("./tmp/test-indexes/oldapi"); +// private Path indexPath = new Path(TMPDIR, "./tmp/test-indexes/oldapi"); // private int numberOfShards = 13; // private int rowsPerIndex = 10; // http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/c7a57227/src/blur-mapred/src/test/java/org/apache/blur/mapreduce/BlurTaskTest.java ---------------------------------------------------------------------- diff --git a/src/blur-mapred/src/test/java/org/apache/blur/mapreduce/BlurTaskTest.java b/src/blur-mapred/src/test/java/org/apache/blur/mapreduce/BlurTaskTest.java index 2930545..1e05566 100644 --- a/src/blur-mapred/src/test/java/org/apache/blur/mapreduce/BlurTaskTest.java +++ b/src/blur-mapred/src/test/java/org/apache/blur/mapreduce/BlurTaskTest.java @@ -27,13 +27,14 @@ import org.junit.Test; import static org.junit.Assert.*; public class BlurTaskTest { + private static final File TMPDIR = new File(System.getProperty("blur.tmp.dir", "/tmp")); @Test public void testGetNumReducersBadPath() { BlurTask task = new BlurTask(); TableDescriptor tableDescriptor = new TableDescriptor(); tableDescriptor.setShardCount(5); - tableDescriptor.setTableUri("file:///tmp/blur34746545"); + tableDescriptor.setTableUri(new File(TMPDIR, "blur34746545").toURI().toString()); tableDescriptor.setName("blur34746545"); task.setTableDescriptor(tableDescriptor); assertEquals(5, task.getNumReducers(new Configuration())); @@ -41,22 +42,22 @@ public class BlurTaskTest { @Test public void testGetNumReducersValidPath() { - new File("/tmp/blurTestShards/shard-1/").mkdirs(); - new File("/tmp/blurTestShards/shard-2/").mkdirs(); - new File("/tmp/blurTestShards/shard-3/").mkdirs(); + new File(TMPDIR, "blurTestShards/shard-1/").mkdirs(); + new File(TMPDIR, "blurTestShards/shard-2/").mkdirs(); + new File(TMPDIR, "blurTestShards/shard-3/").mkdirs(); try { BlurTask task = new BlurTask(); TableDescriptor tableDescriptor = new TableDescriptor(); tableDescriptor.setShardCount(5); - tableDescriptor.setTableUri("file:///tmp/blurTestShards"); + tableDescriptor.setTableUri(new File(TMPDIR, "blurTestShards").toURI().toString()); tableDescriptor.setName("blurTestShards"); task.setTableDescriptor(tableDescriptor); assertEquals(3, task.getNumReducers(new Configuration())); } finally { - new File("/tmp/blurTestShards/shard-1/").delete(); - new File("/tmp/blurTestShards/shard-2/").delete(); - new File("/tmp/blurTestShards/shard-3/").delete(); - new File("/tmp/blurTestShards/").delete(); + new File(TMPDIR, "blurTestShards/shard-1/").delete(); + new File(TMPDIR, "blurTestShards/shard-2/").delete(); + new File(TMPDIR, "blurTestShards/shard-3/").delete(); + new File(TMPDIR, "blurTestShards/").delete(); } } } http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/c7a57227/src/blur-mapred/src/test/java/org/apache/blur/mapreduce/lib/BlurInputFormatTest.java ---------------------------------------------------------------------- diff --git a/src/blur-mapred/src/test/java/org/apache/blur/mapreduce/lib/BlurInputFormatTest.java b/src/blur-mapred/src/test/java/org/apache/blur/mapreduce/lib/BlurInputFormatTest.java index fd95907..1d77c36 100644 --- a/src/blur-mapred/src/test/java/org/apache/blur/mapreduce/lib/BlurInputFormatTest.java +++ b/src/blur-mapred/src/test/java/org/apache/blur/mapreduce/lib/BlurInputFormatTest.java @@ -56,7 +56,7 @@ import org.junit.Test; public abstract class BlurInputFormatTest { -// private Path indexPath = new Path("./tmp/test-indexes/newapi"); +// private Path indexPath = new Path(TMPDIR, "./tmp/test-indexes/newapi"); // private int numberOfShards = 13; // private int rowsPerIndex = 10; // http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/c7a57227/src/blur-mapred/src/test/java/org/apache/blur/mapreduce/lib/BlurRecordWriterTest.java ---------------------------------------------------------------------- diff --git a/src/blur-mapred/src/test/java/org/apache/blur/mapreduce/lib/BlurRecordWriterTest.java b/src/blur-mapred/src/test/java/org/apache/blur/mapreduce/lib/BlurRecordWriterTest.java index 3f9cbe6..4cd3e4c 100644 --- a/src/blur-mapred/src/test/java/org/apache/blur/mapreduce/lib/BlurRecordWriterTest.java +++ b/src/blur-mapred/src/test/java/org/apache/blur/mapreduce/lib/BlurRecordWriterTest.java @@ -46,7 +46,7 @@ public abstract class BlurRecordWriterTest { // TaskID tId = new TaskID(jobId, false, 13); // TaskAttemptID taskId = new TaskAttemptID(tId, 0); // Configuration conf = new Configuration(); -// String pathStr = "./tmp/output-record-writer-test-newapi"; +// String pathStr = TMPDIR, "./tmp/output-record-writer-test-newapi"; // rm(new File(pathStr)); // conf.set("mapred.output.dir", pathStr); // TaskAttemptContext context = new TaskAttemptContext(conf, taskId); http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/c7a57227/src/blur-store/src/test/java/org/apache/blur/store/HdfsDirectoryTest.java ---------------------------------------------------------------------- diff --git a/src/blur-store/src/test/java/org/apache/blur/store/HdfsDirectoryTest.java b/src/blur-store/src/test/java/org/apache/blur/store/HdfsDirectoryTest.java index 1ed257a..cc64218 100644 --- a/src/blur-store/src/test/java/org/apache/blur/store/HdfsDirectoryTest.java +++ b/src/blur-store/src/test/java/org/apache/blur/store/HdfsDirectoryTest.java @@ -40,6 +40,7 @@ import org.junit.Before; import org.junit.Test; public class HdfsDirectoryTest { + private static final File TMPDIR = new File(System.getProperty("blur.tmp.dir", "/tmp")); private static final int MAX_NUMBER_OF_WRITES = 10000; private static final int MIN_FILE_SIZE = 100; @@ -54,7 +55,7 @@ public class HdfsDirectoryTest { @Before public void setUp() throws IOException { - file = new File("./tmp"); + file = TMPDIR; rm(file); URI uri = new File(file, "hdfs").toURI(); Path hdfsDirPath = new Path(uri.toString()); http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/c7a57227/src/blur-store/src/test/java/org/apache/blur/store/blockcache/BlockDirectoryTest.java ---------------------------------------------------------------------- diff --git a/src/blur-store/src/test/java/org/apache/blur/store/blockcache/BlockDirectoryTest.java b/src/blur-store/src/test/java/org/apache/blur/store/blockcache/BlockDirectoryTest.java index 7e229f6..03a6458 100644 --- a/src/blur-store/src/test/java/org/apache/blur/store/blockcache/BlockDirectoryTest.java +++ b/src/blur-store/src/test/java/org/apache/blur/store/blockcache/BlockDirectoryTest.java @@ -37,6 +37,7 @@ import org.junit.Test; import com.googlecode.concurrentlinkedhashmap.ConcurrentLinkedHashMap; public class BlockDirectoryTest { + private static final File TMPDIR = new File(System.getProperty("blur.tmp.dir", "/tmp")); private static final int MAX_NUMBER_OF_WRITES = 10000; private static final int MIN_FILE_SIZE = 100; @@ -51,7 +52,7 @@ public class BlockDirectoryTest { @Before public void setUp() throws IOException { - file = new File("./tmp"); + file = TMPDIR; rm(file); file.mkdirs(); FSDirectory dir = FSDirectory.open(new File(file, "base")); http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/c7a57227/src/pom.xml ---------------------------------------------------------------------- diff --git a/src/pom.xml b/src/pom.xml index f407a88..158a1f9 100644 --- a/src/pom.xml +++ b/src/pom.xml @@ -67,6 +67,16 @@ under the License. <pluginManagement> <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-surefire-plugin</artifactId> + <configuration> + <systemPropertyVariables> + <blur.tmp.dir>${project.build.directory}/tmp</blur.tmp.dir> + </systemPropertyVariables> + </configuration> + </plugin> + <!-- Ignore/Execute plugin execution --> <plugin> <groupId>org.eclipse.m2e</groupId>
