You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by ct...@apache.org on 2014/12/18 23:57:40 UTC

[4/9] accumulo git commit: ACCUMULO-3291 Use target instead of /tmp

ACCUMULO-3291 Use target instead of /tmp


Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/0398fa70
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/0398fa70
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/0398fa70

Branch: refs/heads/1.5
Commit: 0398fa70be7758279c61735435be4c67f96bb104
Parents: 6d8c8c7
Author: Christopher Tubbs <ct...@apache.org>
Authored: Thu Dec 18 17:24:18 2014 -0500
Committer: Christopher Tubbs <ct...@apache.org>
Committed: Thu Dec 18 17:24:18 2014 -0500

----------------------------------------------------------------------
 .../MiniAccumuloClusterStartStopTest.java       | 38 +++++++++++---------
 1 file changed, 21 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/0398fa70/minicluster/src/test/java/org/apache/accumulo/minicluster/MiniAccumuloClusterStartStopTest.java
----------------------------------------------------------------------
diff --git a/minicluster/src/test/java/org/apache/accumulo/minicluster/MiniAccumuloClusterStartStopTest.java b/minicluster/src/test/java/org/apache/accumulo/minicluster/MiniAccumuloClusterStartStopTest.java
index f7440e8..a92342e 100644
--- a/minicluster/src/test/java/org/apache/accumulo/minicluster/MiniAccumuloClusterStartStopTest.java
+++ b/minicluster/src/test/java/org/apache/accumulo/minicluster/MiniAccumuloClusterStartStopTest.java
@@ -16,36 +16,40 @@
  */
 package org.apache.accumulo.minicluster;
 
+import java.io.File;
 import java.io.IOException;
 
 import org.apache.accumulo.core.client.Connector;
 import org.apache.accumulo.core.client.ZooKeeperInstance;
 import org.apache.accumulo.core.client.security.tokens.PasswordToken;
-import org.junit.After;
+import org.apache.commons.io.FileUtils;
 import org.junit.Assert;
 import org.junit.Before;
+import org.junit.Rule;
 import org.junit.Test;
-import org.junit.rules.TemporaryFolder;
+import org.junit.rules.TestName;
 
 public class MiniAccumuloClusterStartStopTest {
-  
-  public TemporaryFolder folder = new TemporaryFolder();
-  
+
+  private File baseDir = new File(System.getProperty("user.dir") + "/target/mini-tests/" + this.getClass().getName());
+  private File testDir;
+
+  @Rule
+  public TestName testName = new TestName();
+
   @Before
   public void createMacDir() throws IOException {
-    folder.create();
-  }
-  
-  @After
-  public void deleteMacDir() {
-    folder.delete();
+    baseDir.mkdirs();
+    testDir = new File(baseDir, testName.getMethodName());
+    FileUtils.deleteQuietly(testDir);
+    testDir.mkdir();
   }
-  
+
   @Test
   public void multipleStartsThrowsAnException() throws Exception {
-    MiniAccumuloCluster accumulo = new MiniAccumuloCluster(folder.getRoot(), "superSecret");
+    MiniAccumuloCluster accumulo = new MiniAccumuloCluster(testDir, "superSecret");
     accumulo.start();
-    
+
     try {
       accumulo.start();
       Assert.fail("Invoking start() while already started is an error");
@@ -55,12 +59,12 @@ public class MiniAccumuloClusterStartStopTest {
       accumulo.stop();
     }
   }
-  
+
   @Test
   public void multipleStopsIsAllowed() throws Exception {
-    MiniAccumuloCluster accumulo = new MiniAccumuloCluster(folder.getRoot(), "superSecret");
+    MiniAccumuloCluster accumulo = new MiniAccumuloCluster(testDir, "superSecret");
     accumulo.start();
-    
+
     Connector conn = new ZooKeeperInstance(accumulo.getInstanceName(), accumulo.getZooKeepers()).getConnector("root", new PasswordToken("superSecret"));
     conn.tableOperations().create("foo");