accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ctubb...@apache.org
Subject [2/4] ACCUMULO-1599 Move MiniAccumuloCluster output to target directory
Date Fri, 11 Oct 2013 06:37:07 GMT
http://git-wip-us.apache.org/repos/asf/accumulo/blob/aa711023/test/src/test/java/org/apache/accumulo/test/MetaSplitTest.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/MetaSplitTest.java b/test/src/test/java/org/apache/accumulo/test/MetaSplitTest.java
index d3ebd0f..02b0e2f 100644
--- a/test/src/test/java/org/apache/accumulo/test/MetaSplitTest.java
+++ b/test/src/test/java/org/apache/accumulo/test/MetaSplitTest.java
@@ -18,6 +18,7 @@ package org.apache.accumulo.test;
 
 import static org.junit.Assert.assertEquals;
 
+import java.io.File;
 import java.util.SortedSet;
 import java.util.TreeSet;
 
@@ -35,11 +36,11 @@ import org.junit.Test;
 import org.junit.rules.TemporaryFolder;
 
 public class MetaSplitTest {
-  
+
   private static String secret = "superSecret";
-  public static TemporaryFolder folder = new TemporaryFolder();
+  public static TemporaryFolder folder = new TemporaryFolder(new File(System.getProperty("user.dir") + "/target"));
   public static MiniAccumuloCluster cluster;
-  
+
   @BeforeClass
   public static void setUpBeforeClass() throws Exception {
     folder.create();
@@ -47,13 +48,13 @@ public class MetaSplitTest {
     cluster = new MiniAccumuloCluster(cfg);
     cluster.start();
   }
-  
+
   @AfterClass
   public static void tearDownAfterClass() throws Exception {
     cluster.stop();
     folder.delete();
   }
-  
+
   @Test(expected = AccumuloException.class)
   public void testRootTableSplit() throws Exception {
     Connector connector = cluster.getConnector("root", secret);
@@ -62,14 +63,14 @@ public class MetaSplitTest {
     splits.add(new Text("5"));
     opts.addSplits(RootTable.NAME, splits);
   }
-  
+
   @Test
   public void testRootTableMerge() throws Exception {
     Connector connector = cluster.getConnector("root", secret);
     TableOperations opts = connector.tableOperations();
     opts.merge(RootTable.NAME, null, null);
   }
-  
+
   private void addSplits(TableOperations opts, String... points) throws Exception {
     SortedSet<Text> splits = new TreeSet<Text>();
     for (String point : points) {
@@ -77,7 +78,7 @@ public class MetaSplitTest {
     }
     opts.addSplits(MetadataTable.NAME, splits);
   }
-  
+
   @Test(timeout = 60000)
   public void testMetadataTableSplit() throws Exception {
     Connector connector = cluster.getConnector("root", secret);
@@ -98,5 +99,5 @@ public class MetaSplitTest {
     opts.merge(MetadataTable.NAME, null, null);
     assertEquals(0, opts.listSplits(MetadataTable.NAME).size());
   }
-  
+
 }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/aa711023/test/src/test/java/org/apache/accumulo/test/ShellServerIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/ShellServerIT.java b/test/src/test/java/org/apache/accumulo/test/ShellServerIT.java
index 9694ce9..179bca7 100644
--- a/test/src/test/java/org/apache/accumulo/test/ShellServerIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/ShellServerIT.java
@@ -49,6 +49,7 @@ import org.apache.accumulo.core.util.shell.Shell;
 import org.apache.accumulo.minicluster.MiniAccumuloCluster;
 import org.apache.accumulo.minicluster.MiniAccumuloConfig;
 import org.apache.accumulo.server.trace.TraceServer;
+import org.apache.accumulo.test.functional.SimpleMacIT;
 import org.apache.commons.io.FileUtils;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.FileSystem;
@@ -58,10 +59,11 @@ import org.apache.hadoop.tools.DistCp;
 import org.junit.After;
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
+import org.junit.Rule;
 import org.junit.Test;
 import org.junit.rules.TemporaryFolder;
 
-public class ShellServerIT {
+public class ShellServerIT extends SimpleMacIT {
   public static class TestOutputStream extends OutputStream {
     StringBuilder sb = new StringBuilder();
 
@@ -98,7 +100,6 @@ public class ShellServerIT {
   }
 
   private static String secret = "superSecret";
-  public static TemporaryFolder folder = new TemporaryFolder();
   public static MiniAccumuloCluster cluster;
   public static TestOutputStream output;
   public static StringInputStream input;
@@ -759,15 +760,16 @@ public class ShellServerIT {
     exec("deletetable -f t", true);
   }
 
+  @Rule
+  public TemporaryFolder folder2 = new TemporaryFolder(new File(System.getProperty("user.dir") + "/target"));
+
   @Test(timeout = 30 * 1000)
   public void testPertableClasspath() throws Exception {
-    File fooFilterJar = File.createTempFile("FooFilter", ".jar");
+    File fooFilterJar = folder2.newFile("FooFilter.jar");
     FileUtils.copyURLToFile(this.getClass().getResource("/FooFilter.jar"), fooFilterJar);
-    fooFilterJar.deleteOnExit();
 
-    File fooConstraintJar = File.createTempFile("FooConstraint", ".jar");
+    File fooConstraintJar = folder2.newFile("FooConstraint.jar");
     FileUtils.copyURLToFile(this.getClass().getResource("/FooConstraint.jar"), fooConstraintJar);
-    fooConstraintJar.deleteOnExit();
 
     exec(
         "config -s " + Property.VFS_CONTEXT_CLASSPATH_PROPERTY.getKey() + "cx1=" + fooFilterJar.toURI().toString() + "," + fooConstraintJar.toURI().toString(),
@@ -872,4 +874,10 @@ public class ShellServerIT {
     return output.get().split("\n").length - 1;
   }
 
+  public static TemporaryFolder folder = new TemporaryFolder(new File(System.getProperty("user.dir") + "/target/"));
+
+  public MiniAccumuloCluster getCluster() {
+    return cluster;
+  }
+
 }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/aa711023/test/src/test/java/org/apache/accumulo/test/TableOperationsIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/TableOperationsIT.java b/test/src/test/java/org/apache/accumulo/test/TableOperationsIT.java
index 03b69b8..edc2987 100644
--- a/test/src/test/java/org/apache/accumulo/test/TableOperationsIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/TableOperationsIT.java
@@ -20,6 +20,7 @@ import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
+import java.io.File;
 import java.io.IOException;
 import java.util.Collections;
 import java.util.HashMap;
@@ -53,31 +54,31 @@ import org.junit.Test;
 import org.junit.rules.TemporaryFolder;
 
 public class TableOperationsIT {
-  
-  static TemporaryFolder tempFolder = new TemporaryFolder();
+
+  static TemporaryFolder tempFolder = new TemporaryFolder(new File(System.getProperty("user.dir") + "/target"));
   static final String ROOT = "root";
   static final String ROOT_PASS = "password";
-  
+
   static MiniAccumuloCluster accumuloCluster;
-  
+
   static Connector connector;
   static TabletClientService.Client client;
   final AtomicInteger tableCounter = new AtomicInteger(0);
-  
+
   @BeforeClass
   public static void startUp() throws IOException, AccumuloException, AccumuloSecurityException, TTransportException, InterruptedException {
     tempFolder.create();
     accumuloCluster = new MiniAccumuloCluster(tempFolder.getRoot(), ROOT_PASS);
-    
+
     accumuloCluster.start();
-    
+
     connector = accumuloCluster.getConnector(ROOT, ROOT_PASS);
   }
-  
+
   String makeTableName() {
     return "table" + tableCounter.getAndIncrement();
   }
-  
+
   @Test(timeout = 30 * 1000)
   public void getDiskUsageErrors() throws TableExistsException, AccumuloException, AccumuloSecurityException, TableNotFoundException, TException {
     String tableName = makeTableName();
@@ -86,33 +87,33 @@ public class TableOperationsIT {
     assertEquals(1, diskUsage.size());
     assertEquals(0, (long) diskUsage.get(0).getUsage());
     assertEquals(tableName, diskUsage.get(0).getTables().iterator().next());
-    
+
     connector.securityOperations().revokeTablePermission(ROOT, tableName, TablePermission.READ);
     try {
       connector.tableOperations().getDiskUsage(Collections.singleton(tableName));
       fail("Should throw securityexception");
     } catch (AccumuloSecurityException e) {}
-    
+
     connector.tableOperations().delete(tableName);
     try {
       connector.tableOperations().getDiskUsage(Collections.singleton(tableName));
       fail("Should throw tablenotfound");
     } catch (TableNotFoundException e) {}
   }
-  
+
   @Test(timeout = 30 * 1000)
   public void getDiskUsage() throws TableExistsException, AccumuloException, AccumuloSecurityException, TableNotFoundException, TException {
-    
+
     String tableName = makeTableName();
     connector.tableOperations().create(tableName);
-    
+
     // verify 0 disk usage
     List<DiskUsage> diskUsages = connector.tableOperations().getDiskUsage(Collections.singleton(tableName));
     assertEquals(1, diskUsages.size());
     assertEquals(1, diskUsages.get(0).getTables().size());
     assertEquals(new Long(0), diskUsages.get(0).getUsage());
     assertEquals(tableName, diskUsages.get(0).getTables().first());
-    
+
     // add some data
     BatchWriter bw = connector.createBatchWriter(tableName, new BatchWriterConfig());
     Mutation m = new Mutation("a");
@@ -120,19 +121,19 @@ public class TableOperationsIT {
     bw.addMutation(m);
     bw.flush();
     bw.close();
-    
+
     connector.tableOperations().compact(tableName, new Text("A"), new Text("z"), true, true);
-    
+
     // verify we have usage
     diskUsages = connector.tableOperations().getDiskUsage(Collections.singleton(tableName));
     assertEquals(1, diskUsages.size());
     assertEquals(1, diskUsages.get(0).getTables().size());
     assertTrue(diskUsages.get(0).getUsage() > 0);
     assertEquals(tableName, diskUsages.get(0).getTables().first());
-    
+
     // clone table
     connector.tableOperations().clone(tableName, "table2", false, null, null);
-    
+
     // verify tables are exactly the same
     Set<String> tables = new HashSet<String>();
     tables.add(tableName);
@@ -141,10 +142,10 @@ public class TableOperationsIT {
     assertEquals(1, diskUsages.size());
     assertEquals(2, diskUsages.get(0).getTables().size());
     assertTrue(diskUsages.get(0).getUsage() > 0);
-    
+
     connector.tableOperations().compact(tableName, new Text("A"), new Text("z"), true, true);
     connector.tableOperations().compact("table2", new Text("A"), new Text("z"), true, true);
-    
+
     // verify tables have differences
     diskUsages = connector.tableOperations().getDiskUsage(tables);
     assertEquals(2, diskUsages.size());
@@ -152,10 +153,10 @@ public class TableOperationsIT {
     assertEquals(1, diskUsages.get(1).getTables().size());
     assertTrue(diskUsages.get(0).getUsage() > 0);
     assertTrue(diskUsages.get(1).getUsage() > 0);
-    
+
     connector.tableOperations().delete(tableName);
   }
-  
+
   @Test(timeout = 30 * 1000)
   public void createTable() throws TableExistsException, AccumuloException, AccumuloSecurityException, TableNotFoundException {
     String tableName = makeTableName();
@@ -165,7 +166,7 @@ public class TableOperationsIT {
     assertEquals(DefaultKeySizeConstraint.class.getName(), props.get(Property.TABLE_CONSTRAINT_PREFIX.toString() + "1"));
     connector.tableOperations().delete(tableName);
   }
-  
+
   private Map<String,String> propsToMap(Iterable<Map.Entry<String,String>> props) {
     Map<String,String> map = new HashMap<String,String>();
     for (Map.Entry<String,String> prop : props) {
@@ -173,7 +174,7 @@ public class TableOperationsIT {
     }
     return map;
   }
-  
+
   @AfterClass
   public static void shutDown() throws IOException, InterruptedException {
     accumuloCluster.stop();

http://git-wip-us.apache.org/repos/asf/accumulo/blob/aa711023/test/src/test/java/org/apache/accumulo/test/TestAccumuloSplitRecovery.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/TestAccumuloSplitRecovery.java b/test/src/test/java/org/apache/accumulo/test/TestAccumuloSplitRecovery.java
index c481f91..a7a58ec 100644
--- a/test/src/test/java/org/apache/accumulo/test/TestAccumuloSplitRecovery.java
+++ b/test/src/test/java/org/apache/accumulo/test/TestAccumuloSplitRecovery.java
@@ -18,6 +18,7 @@ package org.apache.accumulo.test;
 
 import static org.junit.Assert.assertEquals;
 
+import java.io.File;
 import java.util.Map.Entry;
 
 import org.apache.accumulo.core.client.BatchWriter;
@@ -44,31 +45,31 @@ import org.junit.Test;
 import org.junit.rules.TemporaryFolder;
 
 public class TestAccumuloSplitRecovery {
-  
+
   private static final String TABLE = "simple";
-  public static TemporaryFolder folder = new TemporaryFolder();
+  public static TemporaryFolder folder = new TemporaryFolder(new File(System.getProperty("user.dir") + "/target"));
   private MiniAccumuloCluster accumulo;
   private String secret = "secret";
-  
+
   @Before
   public void setUp() throws Exception {
     folder.create();
     accumulo = new MiniAccumuloCluster(folder.getRoot(), secret);
     accumulo.start();
   }
-  
+
   @After
   public void tearDown() throws Exception {
     accumulo.stop();
     folder.delete();
   }
-  
+
   private Mutation m(String row) {
     Mutation result = new Mutation(row);
     result.put("cf", "cq", new Value("value".getBytes()));
     return result;
   }
-  
+
   boolean isOffline(String tablename, Connector connector) throws TableNotFoundException {
     String tableId = connector.tableOperations().tableIdMap().get(tablename);
     Scanner scanner = connector.createScanner(MetadataTable.NAME, Authorizations.EMPTY);
@@ -80,12 +81,12 @@ public class TestAccumuloSplitRecovery {
     }
     return true;
   }
-  
+
   @Test(timeout = 60000)
   public void test() throws Exception {
-    
+
     for (int tn = 0; tn < 2; tn++) {
-      
+
       Connector connector = accumulo.getConnector("root", secret);
       // create a table and put some data in it
       connector.tableOperations().create(TABLE);
@@ -98,43 +99,43 @@ public class TestAccumuloSplitRecovery {
       connector.tableOperations().offline(TABLE);
       while (!isOffline(TABLE, connector))
         UtilWaitThread.sleep(200);
-      
+
       // poke a partial split into the !METADATA table
       connector.securityOperations().grantTablePermission("root", MetadataTable.NAME, TablePermission.WRITE);
       String tableId = connector.tableOperations().tableIdMap().get(TABLE);
-      
+
       KeyExtent extent = new KeyExtent(new Text(tableId), null, new Text("b"));
       Mutation m = extent.getPrevRowUpdateMutation();
-      
+
       TabletsSection.TabletColumnFamily.SPLIT_RATIO_COLUMN.put(m, new Value(Double.toString(0.5).getBytes()));
       TabletsSection.TabletColumnFamily.OLD_PREV_ROW_COLUMN.put(m, KeyExtent.encodePrevEndRow(null));
       bw = connector.createBatchWriter(MetadataTable.NAME, new BatchWriterConfig());
       bw.addMutation(m);
-      
+
       if (tn == 1) {
-        
+
         bw.flush();
-        
+
         Scanner scanner = connector.createScanner(MetadataTable.NAME, Authorizations.EMPTY);
         scanner.setRange(extent.toMetadataRange());
         scanner.fetchColumnFamily(DataFileColumnFamily.NAME);
-        
+
         KeyExtent extent2 = new KeyExtent(new Text(tableId), new Text("b"), null);
         m = extent2.getPrevRowUpdateMutation();
         TabletsSection.ServerColumnFamily.DIRECTORY_COLUMN.put(m, new Value("/t2".getBytes()));
         TabletsSection.ServerColumnFamily.TIME_COLUMN.put(m, new Value("M0".getBytes()));
-        
+
         for (Entry<Key,Value> entry : scanner) {
           m.put(DataFileColumnFamily.NAME, entry.getKey().getColumnQualifier(), entry.getValue());
         }
-        
+
         bw.addMutation(m);
       }
-      
+
       bw.close();
       // bring the table online
       connector.tableOperations().online(TABLE);
-      
+
       // verify the tablets went online
       Scanner scanner = connector.createScanner(TABLE, Authorizations.EMPTY);
       int i = 0;
@@ -144,10 +145,10 @@ public class TestAccumuloSplitRecovery {
         i++;
       }
       assertEquals(3, i);
-      
+
       connector.tableOperations().delete(TABLE);
-      
+
     }
   }
-  
+
 }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/aa711023/test/src/test/java/org/apache/accumulo/test/VolumeTest.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/VolumeTest.java b/test/src/test/java/org/apache/accumulo/test/VolumeTest.java
index 18b0c9a..8813c63 100644
--- a/test/src/test/java/org/apache/accumulo/test/VolumeTest.java
+++ b/test/src/test/java/org/apache/accumulo/test/VolumeTest.java
@@ -19,6 +19,7 @@ package org.apache.accumulo.test;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
 
+import java.io.File;
 import java.util.Map;
 import java.util.Map.Entry;
 import java.util.SortedSet;
@@ -45,15 +46,15 @@ import org.junit.Test;
 import org.junit.rules.TemporaryFolder;
 
 public class VolumeTest {
-  
+
   private static final Text EMPTY = new Text();
-  private static final Value EMPTY_VALUE = new Value(new byte[]{});
+  private static final Value EMPTY_VALUE = new Value(new byte[] {});
   private static String secret = "superSecret";
-  public static TemporaryFolder folder = new TemporaryFolder();
+  public static TemporaryFolder folder = new TemporaryFolder(new File(System.getProperty("user.dir") + "/target"));
   public static MiniAccumuloCluster cluster;
   public static Path v1;
   public static Path v2;
-  
+
   @BeforeClass
   public static void setUpBeforeClass() throws Exception {
     folder.create();
@@ -67,13 +68,13 @@ public class VolumeTest {
     cluster = new MiniAccumuloCluster(cfg);
     cluster.start();
   }
-  
+
   @AfterClass
   public static void tearDownAfterClass() throws Exception {
     cluster.stop();
     folder.delete();
   }
-  
+
   @Test
   public void test() throws Exception {
     // create a table
@@ -108,11 +109,11 @@ public class VolumeTest {
     int fileCount = 0;
     for (Entry<Key,Value> entry : scanner) {
       boolean inV1 = entry.getKey().getColumnQualifier().toString().contains(v1.toString());
-      boolean inV2 = entry.getKey().getColumnQualifier().toString().contains(v2.toString()); 
+      boolean inV2 = entry.getKey().getColumnQualifier().toString().contains(v2.toString());
       assertTrue(inV1 || inV2);
       fileCount++;
     }
     assertEquals(4, fileCount);
   }
-  
+
 }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/aa711023/test/src/test/java/org/apache/accumulo/test/functional/AbstractMacIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/functional/AbstractMacIT.java b/test/src/test/java/org/apache/accumulo/test/functional/AbstractMacIT.java
index f1a651d..d24b85b 100644
--- a/test/src/test/java/org/apache/accumulo/test/functional/AbstractMacIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/functional/AbstractMacIT.java
@@ -16,62 +16,73 @@
  */
 package org.apache.accumulo.test.functional;
 
-import java.io.IOException;
+import java.io.File;
+import java.util.Random;
 import java.util.concurrent.atomic.AtomicInteger;
 
-import org.apache.accumulo.core.Constants;
 import org.apache.accumulo.core.cli.BatchWriterOpts;
 import org.apache.accumulo.core.cli.ScannerOpts;
 import org.apache.accumulo.core.client.AccumuloException;
 import org.apache.accumulo.core.client.AccumuloSecurityException;
 import org.apache.accumulo.core.client.Connector;
-import org.apache.accumulo.core.client.Instance;
-import org.apache.accumulo.core.client.ZooKeeperInstance;
-import org.apache.accumulo.core.zookeeper.ZooUtil;
-import org.apache.accumulo.fate.zookeeper.ZooReader;
 import org.apache.accumulo.minicluster.MiniAccumuloCluster;
+import org.apache.commons.io.FileUtils;
 import org.apache.log4j.Logger;
-import org.apache.zookeeper.KeeperException;
-import org.junit.rules.TemporaryFolder;
+import org.junit.Rule;
+import org.junit.rules.TestName;
 
 public abstract class AbstractMacIT {
   public static final Logger log = Logger.getLogger(AbstractMacIT.class);
-  
-  public static final String ROOT_PASSWORD = "secret";
+
+  public static final String ROOT_PASSWORD = "testRootPassword1";
   public static final ScannerOpts SOPTS = new ScannerOpts();
   public static final BatchWriterOpts BWOPTS = new BatchWriterOpts();
-  
-  public abstract MiniAccumuloCluster getCluster();
-  
-  protected static void cleanUp(MiniAccumuloCluster cluster, TemporaryFolder folder) {
+
+  @Rule
+  public TestName testName = new TestName();
+
+  protected static void cleanUp(MiniAccumuloCluster cluster) {
     if (cluster != null)
       try {
         cluster.stop();
       } catch (Exception e) {}
-    folder.delete();
   }
-  
+
   static AtomicInteger tableCount = new AtomicInteger();
-  
-  static public String makeTableName() {
-    return "table" + tableCount.getAndIncrement();
-  }
-  
-  public Connector getConnector() throws AccumuloException, AccumuloSecurityException {
-    return getCluster().getConnector("root", ROOT_PASSWORD);
-  }
-  
-  public String getMonitor() throws KeeperException, InterruptedException {
-    Instance instance = new ZooKeeperInstance(getCluster().getInstanceName(), getCluster().getZooKeepers());
-    ZooReader zr = new ZooReader(getCluster().getZooKeepers(), 5000);
-    return new String(zr.getData(ZooUtil.getRoot(instance) + Constants.ZMONITOR, null));
+
+  protected static File createSharedTestDir(String name) {
+    File baseDir = new File(System.getProperty("user.dir") + "/target/mini-tests");
+    baseDir.mkdirs();
+    if (name != null)
+      baseDir = new File(baseDir, name);
+    File testDir = new File(baseDir, System.currentTimeMillis() + "_" + new Random().nextInt(Short.MAX_VALUE));
+    FileUtils.deleteQuietly(testDir);
+    testDir.mkdir();
+    return testDir;
   }
-  
-  public String rootPath() {
-    return getCluster().getConfig().getDir().getAbsolutePath();
+
+  protected File createTestDir(String name) {
+    File baseDir = new File(System.getProperty("user.dir") + "/target/mini-tests");
+    baseDir.mkdirs();
+    if (name == null)
+      return baseDir;
+    File testDir = new File(baseDir, name);
+    FileUtils.deleteQuietly(testDir);
+    testDir.mkdir();
+    return testDir;
   }
-  
-  public Process exec(Class<? extends Object> clazz, String... args) throws IOException {
-    return getCluster().exec(clazz, args);
+
+  public String[] getTableNames(int num) {
+    if (num == 1)
+      return new String[] {testName.getMethodName()};
+    String[] names = new String[num];
+    for (int i = 0; i < num; i++)
+      names[i] = this.getClass().getSimpleName() + "_" + testName.getMethodName() + i;
+    return names;
   }
+
+  public abstract Connector getConnector() throws AccumuloException, AccumuloSecurityException;
+
+  public abstract String rootPath();
+
 }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/aa711023/test/src/test/java/org/apache/accumulo/test/functional/AddSplitIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/functional/AddSplitIT.java b/test/src/test/java/org/apache/accumulo/test/functional/AddSplitIT.java
index eba3081..e4760ba 100644
--- a/test/src/test/java/org/apache/accumulo/test/functional/AddSplitIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/functional/AddSplitIT.java
@@ -37,98 +37,98 @@ import org.apache.hadoop.io.Text;
 import org.junit.Test;
 
 public class AddSplitIT extends SimpleMacIT {
-  
+
   @Test(timeout = 60 * 1000)
   public void addSplitTest() throws Exception {
 
-    String tableName = makeTableName();
+    String tableName = getTableNames(1)[0];
     Connector c = getConnector();
     c.tableOperations().create(tableName);
-    
+
     insertData(tableName, 1l);
-    
+
     TreeSet<Text> splits = new TreeSet<Text>();
     splits.add(new Text(String.format("%09d", 333)));
     splits.add(new Text(String.format("%09d", 666)));
-    
+
     c.tableOperations().addSplits(tableName, splits);
-    
+
     UtilWaitThread.sleep(100);
-    
+
     Collection<Text> actualSplits = c.tableOperations().listSplits(tableName);
-    
+
     if (!splits.equals(new TreeSet<Text>(actualSplits))) {
       throw new Exception(splits + " != " + actualSplits);
     }
-    
+
     verifyData(tableName, 1l);
     insertData(tableName, 2l);
-    
+
     // did not clear splits on purpose, it should ignore existing split points
     // and still create the three additional split points
-    
+
     splits.add(new Text(String.format("%09d", 200)));
     splits.add(new Text(String.format("%09d", 500)));
     splits.add(new Text(String.format("%09d", 800)));
-    
+
     c.tableOperations().addSplits(tableName, splits);
-    
+
     UtilWaitThread.sleep(100);
-    
+
     actualSplits = c.tableOperations().listSplits(tableName);
-    
+
     if (!splits.equals(new TreeSet<Text>(actualSplits))) {
       throw new Exception(splits + " != " + actualSplits);
     }
-    
+
     verifyData(tableName, 2l);
   }
-  
+
   private void verifyData(String tableName, long ts) throws Exception {
     Scanner scanner = getConnector().createScanner(tableName, Authorizations.EMPTY);
-    
+
     Iterator<Entry<Key,Value>> iter = scanner.iterator();
-    
+
     for (int i = 0; i < 10000; i++) {
       if (!iter.hasNext()) {
         throw new Exception("row " + i + " not found");
       }
-      
+
       Entry<Key,Value> entry = iter.next();
-      
+
       String row = String.format("%09d", i);
-      
+
       if (!entry.getKey().getRow().equals(new Text(row))) {
         throw new Exception("unexpected row " + entry.getKey() + " " + i);
       }
-      
+
       if (entry.getKey().getTimestamp() != ts) {
         throw new Exception("unexpected ts " + entry.getKey() + " " + ts);
       }
-      
+
       if (Integer.parseInt(entry.getValue().toString()) != i) {
         throw new Exception("unexpected value " + entry + " " + i);
       }
     }
-    
+
     if (iter.hasNext()) {
       throw new Exception("found more than expected " + iter.next());
     }
-    
+
   }
-  
+
   private void insertData(String tableName, long ts) throws AccumuloException, AccumuloSecurityException, TableNotFoundException, MutationsRejectedException {
     BatchWriter bw = getConnector().createBatchWriter(tableName, null);
-    
+
     for (int i = 0; i < 10000; i++) {
       String row = String.format("%09d", i);
-      
+
       Mutation m = new Mutation(new Text(row));
       m.put(new Text("cf1"), new Text("cq1"), ts, new Value(("" + i).getBytes()));
       bw.addMutation(m);
     }
-    
+
     bw.close();
   }
-  
+
 }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/aa711023/test/src/test/java/org/apache/accumulo/test/functional/BadIteratorMincIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/functional/BadIteratorMincIT.java b/test/src/test/java/org/apache/accumulo/test/functional/BadIteratorMincIT.java
index 0d7e509..8de84f2 100644
--- a/test/src/test/java/org/apache/accumulo/test/functional/BadIteratorMincIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/functional/BadIteratorMincIT.java
@@ -34,57 +34,57 @@ import org.apache.hadoop.io.Text;
 import org.junit.Test;
 
 public class BadIteratorMincIT extends SimpleMacIT {
-  
+
   @Test(timeout = 60 * 1000)
   public void test() throws Exception {
     Connector c = getConnector();
-    
-    String tableName = makeTableName();
+
+    String tableName = getTableNames(1)[0];
     c.tableOperations().create(tableName);
     IteratorSetting is = new IteratorSetting(30, BadIterator.class);
     c.tableOperations().attachIterator(tableName, is, EnumSet.of(IteratorScope.minc));
     BatchWriter bw = c.createBatchWriter(tableName, new BatchWriterConfig());
-    
+
     Mutation m = new Mutation(new Text("r1"));
     m.put(new Text("acf"), new Text(tableName), new Value("1".getBytes()));
     bw.addMutation(m);
     bw.close();
-    
+
     c.tableOperations().flush(tableName, null, null, false);
     UtilWaitThread.sleep(1000);
-    
+
     // minc should fail, so there should be no files
     FunctionalTestUtils.checkRFiles(c, tableName, 1, 1, 0, 0);
-    
+
     // try to scan table
     Scanner scanner = c.createScanner(tableName, Authorizations.EMPTY);
-    
+
     int count = 0;
     for (@SuppressWarnings("unused")
     Entry<Key,Value> entry : scanner) {
       count++;
     }
-    
+
     if (count != 1)
       throw new Exception("Did not see expected # entries " + count);
-    
+
     // remove the bad iterator
     c.tableOperations().removeIterator(tableName, BadIterator.class.getSimpleName(), EnumSet.of(IteratorScope.minc));
-    
+
     UtilWaitThread.sleep(5000);
-    
+
     // minc should complete
     FunctionalTestUtils.checkRFiles(c, tableName, 1, 1, 1, 1);
-    
+
     count = 0;
     for (@SuppressWarnings("unused")
     Entry<Key,Value> entry : scanner) {
       count++;
     }
-    
+
     if (count != 1)
       throw new Exception("Did not see expected # entries " + count);
-    
+
     // now try putting bad iterator back and deleting the table
     c.tableOperations().attachIterator(tableName, is, EnumSet.of(IteratorScope.minc));
     bw = c.createBatchWriter(tableName, new BatchWriterConfig());
@@ -92,20 +92,17 @@ public class BadIteratorMincIT extends SimpleMacIT {
     m.put(new Text("acf"), new Text(tableName), new Value("1".getBytes()));
     bw.addMutation(m);
     bw.close();
-    
+
     // make sure property is given time to propagate
     UtilWaitThread.sleep(500);
-    
+
     c.tableOperations().flush(tableName, null, null, false);
-    
+
     // make sure the flush has time to start
     UtilWaitThread.sleep(1000);
-    
+
     // this should not hang
     c.tableOperations().delete(tableName);
   }
-  
-
 
-  
 }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/aa711023/test/src/test/java/org/apache/accumulo/test/functional/BatchScanSplitIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/functional/BatchScanSplitIT.java b/test/src/test/java/org/apache/accumulo/test/functional/BatchScanSplitIT.java
index ba7f07c..0297ffc 100644
--- a/test/src/test/java/org/apache/accumulo/test/functional/BatchScanSplitIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/functional/BatchScanSplitIT.java
@@ -39,42 +39,42 @@ import org.apache.hadoop.io.Text;
 import org.junit.Test;
 
 public class BatchScanSplitIT extends ConfigurableMacIT {
-  
+
   @Override
   public void configure(MiniAccumuloConfig cfg) {
     cfg.setSiteConfig(Collections.singletonMap(Property.TSERV_MAJC_DELAY.getKey(), "0"));
   }
-  
+
   @Test(timeout = 2 * 60 * 1000)
   public void test() throws Exception {
     Connector c = getConnector();
-    String tableName = makeTableName();
+    String tableName = getTableNames(1)[0];
     c.tableOperations().create(tableName);
-    
+
     int numRows = 1 << 18;
-    
+
     BatchWriter bw = getConnector().createBatchWriter(tableName, new BatchWriterConfig());
-    
+
     for (int i = 0; i < numRows; i++) {
       Mutation m = new Mutation(new Text(String.format("%09x", i)));
       m.put(new Text("cf1"), new Text("cq1"), new Value(String.format("%016x", numRows - i).getBytes()));
       bw.addMutation(m);
     }
-    
+
     bw.close();
-    
+
     getConnector().tableOperations().flush(tableName, null, null, true);
-    
+
     getConnector().tableOperations().setProperty(tableName, Property.TABLE_SPLIT_THRESHOLD.getKey(), "4K");
-    
+
     Collection<Text> splits = getConnector().tableOperations().listSplits(tableName);
     while (splits.size() < 2) {
       UtilWaitThread.sleep(1);
       splits = getConnector().tableOperations().listSplits(tableName);
     }
-    
+
     System.out.println("splits : " + splits);
-    
+
     Random random = new Random(19011230);
     HashMap<Text,Value> expected = new HashMap<Text,Value>();
     ArrayList<Range> ranges = new ArrayList<Range>();
@@ -84,35 +84,35 @@ public class BatchScanSplitIT extends ConfigurableMacIT {
       expected.put(row, new Value(String.format("%016x", numRows - r).getBytes()));
       ranges.add(new Range(row));
     }
-    
+
     // logger.setLevel(Level.TRACE);
-    
+
     HashMap<Text,Value> found = new HashMap<Text,Value>();
-    
+
     for (int i = 0; i < 20; i++) {
       BatchScanner bs = getConnector().createBatchScanner(tableName, Authorizations.EMPTY, 4);
-      
+
       found.clear();
-      
+
       long t1 = System.currentTimeMillis();
-      
+
       bs.setRanges(ranges);
-      
+
       for (Entry<Key,Value> entry : bs) {
         found.put(entry.getKey().getRow(), entry.getValue());
       }
       bs.close();
-      
+
       long t2 = System.currentTimeMillis();
-      
+
       log.info(String.format("rate : %06.2f%n", ranges.size() / ((t2 - t1) / 1000.0)));
-      
+
       if (!found.equals(expected))
         throw new Exception("Found and expected differ " + found + " " + expected);
     }
-    
+
     splits = getConnector().tableOperations().listSplits(tableName);
     log.info("splits : " + splits);
   }
-  
+
 }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/aa711023/test/src/test/java/org/apache/accumulo/test/functional/BatchWriterFlushIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/functional/BatchWriterFlushIT.java b/test/src/test/java/org/apache/accumulo/test/functional/BatchWriterFlushIT.java
index f313786..59fa753 100644
--- a/test/src/test/java/org/apache/accumulo/test/functional/BatchWriterFlushIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/functional/BatchWriterFlushIT.java
@@ -39,114 +39,116 @@ import org.apache.hadoop.io.Text;
 import org.junit.Test;
 
 public class BatchWriterFlushIT extends SimpleMacIT {
-  
+
   private static final int NUM_TO_FLUSH = 100000;
-  
+
   @Test(timeout = 30 * 1000)
   public void run() throws Exception {
     Connector c = getConnector();
-    String bwft = makeTableName();
+    String[] tableNames = getTableNames(2);
+    String bwft = tableNames[0];
     c.tableOperations().create(bwft);
-    String bwlt = makeTableName();
+    String bwlt = tableNames[1];
     c.tableOperations().create(bwlt);
     runFlushTest(bwft);
     runLatencyTest(bwlt);
-    
+
   }
-  
+
   private void runLatencyTest(String tableName) throws Exception {
     // should automatically flush after 2 seconds
     BatchWriter bw = getConnector().createBatchWriter(tableName, new BatchWriterConfig().setMaxLatency(1000, TimeUnit.MILLISECONDS));
     Scanner scanner = getConnector().createScanner(tableName, Authorizations.EMPTY);
-    
+
     Mutation m = new Mutation(new Text(String.format("r_%10d", 1)));
     m.put(new Text("cf"), new Text("cq"), new Value(("" + 1).getBytes()));
     bw.addMutation(m);
-    
+
     UtilWaitThread.sleep(500);
-    
+
     int count = 0;
     for (@SuppressWarnings("unused")
     Entry<Key,Value> entry : scanner) {
       count++;
     }
-    
+
     if (count != 0) {
       throw new Exception("Flushed too soon");
     }
-    
+
     UtilWaitThread.sleep(1500);
-    
+
     for (@SuppressWarnings("unused")
     Entry<Key,Value> entry : scanner) {
       count++;
     }
-    
+
     if (count != 1) {
       throw new Exception("Did not flush");
     }
-    
+
     bw.close();
   }
-  
-  private void runFlushTest(String tableName) throws AccumuloException, AccumuloSecurityException, TableNotFoundException, MutationsRejectedException, Exception {
+
+  private void runFlushTest(String tableName) throws AccumuloException, AccumuloSecurityException, TableNotFoundException, MutationsRejectedException,
+      Exception {
     BatchWriter bw = getConnector().createBatchWriter(tableName, new BatchWriterConfig());
     Scanner scanner = getConnector().createScanner(tableName, Authorizations.EMPTY);
     Random r = new Random();
-    
+
     for (int i = 0; i < 4; i++) {
       for (int j = 0; j < NUM_TO_FLUSH; j++) {
         int row = i * NUM_TO_FLUSH + j;
-        
+
         Mutation m = new Mutation(new Text(String.format("r_%10d", row)));
         m.put(new Text("cf"), new Text("cq"), new Value(("" + row).getBytes()));
         bw.addMutation(m);
       }
-      
+
       bw.flush();
-      
+
       // do a few random lookups into the data just flushed
-      
+
       for (int k = 0; k < 10; k++) {
         int rowToLookup = r.nextInt(NUM_TO_FLUSH) + i * NUM_TO_FLUSH;
-        
+
         scanner.setRange(new Range(new Text(String.format("r_%10d", rowToLookup))));
-        
+
         Iterator<Entry<Key,Value>> iter = scanner.iterator();
-        
+
         if (!iter.hasNext())
           throw new Exception(" row " + rowToLookup + " not found after flush");
-        
+
         Entry<Key,Value> entry = iter.next();
-        
+
         if (iter.hasNext())
           throw new Exception("Scanner returned too much");
-        
+
         verifyEntry(rowToLookup, entry);
       }
-      
+
       // scan all data just flushed
       scanner.setRange(new Range(new Text(String.format("r_%10d", i * NUM_TO_FLUSH)), true, new Text(String.format("r_%10d", (i + 1) * NUM_TO_FLUSH)), false));
       Iterator<Entry<Key,Value>> iter = scanner.iterator();
-      
+
       for (int j = 0; j < NUM_TO_FLUSH; j++) {
         int row = i * NUM_TO_FLUSH + j;
-        
+
         if (!iter.hasNext())
           throw new Exception("Scan stopped permaturely at " + row);
-        
+
         Entry<Key,Value> entry = iter.next();
-        
+
         verifyEntry(row, entry);
       }
-      
+
       if (iter.hasNext())
         throw new Exception("Scanner returned too much");
-      
+
     }
-    
+
     bw.close();
-    
+
     // test adding a mutation to a closed batch writer
     boolean caught = false;
     try {
@@ -154,20 +156,20 @@ public class BatchWriterFlushIT extends SimpleMacIT {
     } catch (IllegalStateException ise) {
       caught = true;
     }
-    
+
     if (!caught) {
       throw new Exception("Adding to closed batch writer did not fail");
     }
   }
-  
+
   private void verifyEntry(int row, Entry<Key,Value> entry) throws Exception {
     if (!entry.getKey().getRow().toString().equals(String.format("r_%10d", row))) {
       throw new Exception("Unexpected key returned, expected " + row + " got " + entry.getKey());
     }
-    
+
     if (!entry.getValue().toString().equals("" + row)) {
       throw new Exception("Unexpected value, expected " + row + " got " + entry.getValue());
     }
   }
-  
+
 }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/aa711023/test/src/test/java/org/apache/accumulo/test/functional/BinaryIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/functional/BinaryIT.java b/test/src/test/java/org/apache/accumulo/test/functional/BinaryIT.java
index 58ca57c..aad112e 100644
--- a/test/src/test/java/org/apache/accumulo/test/functional/BinaryIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/functional/BinaryIT.java
@@ -27,14 +27,15 @@ import org.apache.hadoop.io.Text;
 import org.junit.Test;
 
 public class BinaryIT extends ConfigurableMacIT {
-  
+
   @Test(timeout = 60 * 1000)
   public void test() throws Exception {
     Connector c = getConnector();
     c.tableOperations().create("bt");
     runTest(c);
   }
-  
+
+  @Test(timeout = 60 * 1000)
   public void testPreSplit() throws Exception {
     Connector c = getConnector();
     c.tableOperations().create("bt");
@@ -44,7 +45,7 @@ public class BinaryIT extends ConfigurableMacIT {
     c.tableOperations().addSplits("bt", splits);
     runTest(c);
   }
-  
+
   public static void runTest(Connector c) throws Exception {
     BatchWriterOpts bwOpts = new BatchWriterOpts();
     ScannerOpts scanOpts = new ScannerOpts();
@@ -73,5 +74,5 @@ public class BinaryIT extends ConfigurableMacIT {
     opts.mode = "verifyDeleted";
     TestBinaryRows.runTest(c, opts, bwOpts, scanOpts);
   }
-  
+
 }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/aa711023/test/src/test/java/org/apache/accumulo/test/functional/BulkFileIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/functional/BulkFileIT.java b/test/src/test/java/org/apache/accumulo/test/functional/BulkFileIT.java
index 6597c68..3a0eeda 100644
--- a/test/src/test/java/org/apache/accumulo/test/functional/BulkFileIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/functional/BulkFileIT.java
@@ -40,11 +40,11 @@ import org.apache.hadoop.io.Text;
 import org.junit.Test;
 
 public class BulkFileIT extends SimpleMacIT {
-  
+
   @Test(timeout = 2 * 60 * 1000)
   public void testBulkFile() throws Exception {
     Connector c = getConnector();
-    String tableName = makeTableName();
+    String tableName = getTableNames(1)[0];
     c.tableOperations().create(tableName);
     SortedSet<Text> splits = new TreeSet<Text>();
     for (String split : "0333 0666 0999 1333 1666".split(" "))
@@ -53,62 +53,62 @@ public class BulkFileIT extends SimpleMacIT {
     Configuration conf = new Configuration();
     AccumuloConfiguration aconf = ServerConfiguration.getDefaultConfiguration();
     FileSystem fs = TraceFileSystem.wrap(FileUtil.getFileSystem(conf, aconf));
-    
-    String dir = "/tmp/bulk_test_diff_files_89723987592";
-    
+
+    String dir = rootPath() + "/bulk_test_diff_files_89723987592_" + getTableNames(1)[0];
+
     fs.delete(new Path(dir), true);
-    
+
     FileSKVWriter writer1 = FileOperations.getInstance().openWriter(dir + "/f1." + RFile.EXTENSION, fs, conf, aconf);
     writer1.startDefaultLocalityGroup();
     writeData(writer1, 0, 333);
     writer1.close();
-    
+
     FileSKVWriter writer2 = FileOperations.getInstance().openWriter(dir + "/f2." + RFile.EXTENSION, fs, conf, aconf);
     writer2.startDefaultLocalityGroup();
     writeData(writer2, 334, 999);
     writer2.close();
-    
+
     FileSKVWriter writer3 = FileOperations.getInstance().openWriter(dir + "/f3." + RFile.EXTENSION, fs, conf, aconf);
     writer3.startDefaultLocalityGroup();
     writeData(writer3, 1000, 1999);
     writer3.close();
-    
-    FunctionalTestUtils.bulkImport(c,  fs, tableName, dir);
-    
+
+    FunctionalTestUtils.bulkImport(c, fs, tableName, dir);
+
     FunctionalTestUtils.checkRFiles(c, tableName, 6, 6, 1, 1);
-    
+
     verifyData(tableName, 0, 1999);
-    
+
   }
-  
+
   private void verifyData(String table, int s, int e) throws Exception {
     Scanner scanner = getConnector().createScanner(table, Authorizations.EMPTY);
-    
+
     Iterator<Entry<Key,Value>> iter = scanner.iterator();
-    
+
     for (int i = s; i <= e; i++) {
       if (!iter.hasNext())
         throw new Exception("row " + i + " not found");
-      
+
       Entry<Key,Value> entry = iter.next();
-      
+
       String row = String.format("%04d", i);
-      
+
       if (!entry.getKey().getRow().equals(new Text(row)))
         throw new Exception("unexpected row " + entry.getKey() + " " + i);
-      
+
       if (Integer.parseInt(entry.getValue().toString()) != i)
         throw new Exception("unexpected value " + entry + " " + i);
     }
-    
+
     if (iter.hasNext())
       throw new Exception("found more than expected " + iter.next());
   }
-  
+
   private void writeData(FileSKVWriter w, int s, int e) throws Exception {
     for (int i = s; i <= e; i++) {
       w.append(new Key(new Text(String.format("%04d", i))), new Value(("" + i).getBytes()));
     }
   }
-  
+
 }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/aa711023/test/src/test/java/org/apache/accumulo/test/functional/BulkIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/functional/BulkIT.java b/test/src/test/java/org/apache/accumulo/test/functional/BulkIT.java
index 607f2a5..2fb5827 100644
--- a/test/src/test/java/org/apache/accumulo/test/functional/BulkIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/functional/BulkIT.java
@@ -26,20 +26,20 @@ import org.apache.hadoop.fs.Path;
 import org.junit.Test;
 
 public class BulkIT extends SimpleMacIT {
-  
+
   static final int N = 100000;
   static final int COUNT = 5;
-  
+
   @Test(timeout = 4 * 60 * 1000)
   public void test() throws Exception {
     Connector c = getConnector();
-    String tableName = makeTableName();
+    String tableName = getTableNames(1)[0];
     c.tableOperations().create(tableName);
     FileSystem fs = FileSystem.get(CachedConfiguration.getInstance());
     String base = "target/accumulo-maven-plugin";
     fs.delete(new Path(base + "/testrf"), true);
     fs.mkdirs(new Path(base + "/testBulkFail"));
-    
+
     Opts opts = new Opts();
     opts.timestamp = 1;
     opts.random = 56;
@@ -70,5 +70,5 @@ public class BulkIT extends SimpleMacIT {
     vopts.rows = 1;
     VerifyIngest.verifyIngest(c, vopts, SOPTS);
   }
-  
+
 }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/aa711023/test/src/test/java/org/apache/accumulo/test/functional/BulkSplitOptimizationIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/functional/BulkSplitOptimizationIT.java b/test/src/test/java/org/apache/accumulo/test/functional/BulkSplitOptimizationIT.java
index f836181..337d0f7 100644
--- a/test/src/test/java/org/apache/accumulo/test/functional/BulkSplitOptimizationIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/functional/BulkSplitOptimizationIT.java
@@ -16,6 +16,7 @@
  */
 package org.apache.accumulo.test.functional;
 
+import java.io.File;
 import java.util.Collections;
 
 import org.apache.accumulo.core.cli.ClientOpts.Password;
@@ -26,7 +27,9 @@ import org.apache.accumulo.core.util.UtilWaitThread;
 import org.apache.accumulo.minicluster.MiniAccumuloConfig;
 import org.apache.accumulo.test.VerifyIngest;
 import org.apache.hadoop.fs.FileSystem;
+import org.junit.Rule;
 import org.junit.Test;
+import org.junit.rules.TemporaryFolder;
 
 /**
  * This test verifies that when a lot of files are bulk imported into a table with one tablet and then splits that not all map files go to the children tablets.
@@ -36,9 +39,12 @@ import org.junit.Test;
  */
 
 public class BulkSplitOptimizationIT extends ConfigurableMacIT {
-  
+
   private static final String TABLE_NAME = "test_ingest";
-  
+
+  @Rule
+  public TemporaryFolder folder = new TemporaryFolder(new File(System.getProperty("user.dir") + "/target"));
+
   @Override
   public void configure(MiniAccumuloConfig cfg) {
     cfg.setSiteConfig(Collections.singletonMap(Property.TSERV_MAJC_DELAY.getKey(), "1s"));
@@ -54,23 +60,23 @@ public class BulkSplitOptimizationIT extends ConfigurableMacIT {
     c.tableOperations().setProperty(TABLE_NAME, Property.TABLE_MAJC_RATIO.getKey(), "1000");
     c.tableOperations().setProperty(TABLE_NAME, Property.TABLE_FILE_MAX.getKey(), "1000");
     c.tableOperations().setProperty(TABLE_NAME, Property.TABLE_SPLIT_THRESHOLD.getKey(), "1G");
-    
+
     FileSystem fs = FileSystem.get(CachedConfiguration.getInstance());
-    FunctionalTestUtils.createRFiles(c, fs, "tmp/testmf", ROWS, SPLITS, 8);
-    FunctionalTestUtils.bulkImport(c, fs, TABLE_NAME, "tmp/testmf");
+    FunctionalTestUtils.createRFiles(c, fs, folder.getRoot() + "/testmf", ROWS, SPLITS, 8);
+    FunctionalTestUtils.bulkImport(c, fs, TABLE_NAME, folder.getRoot() + "/testmf");
     FunctionalTestUtils.checkSplits(c, TABLE_NAME, 0, 0);
     FunctionalTestUtils.checkRFiles(c, TABLE_NAME, 1, 1, 100, 100);
-    
+
     // initiate splits
     getConnector().tableOperations().setProperty(TABLE_NAME, Property.TABLE_SPLIT_THRESHOLD.getKey(), "100K");
-    
+
     UtilWaitThread.sleep(2000);
-    
+
     // wait until over split threshold
     while (getConnector().tableOperations().listSplits(TABLE_NAME).size() < 50) {
       UtilWaitThread.sleep(500);
     }
-    
+
     FunctionalTestUtils.checkSplits(c, TABLE_NAME, 50, 100);
     VerifyIngest.Opts opts = new VerifyIngest.Opts();
     opts.timestamp = 1;
@@ -81,7 +87,7 @@ public class BulkSplitOptimizationIT extends ConfigurableMacIT {
     opts.cols = 1;
     opts.password = new Password(ROOT_PASSWORD);
     VerifyIngest.verifyIngest(c, opts, SOPTS);
-    
+
     // ensure each tablet does not have all map files
     FunctionalTestUtils.checkRFiles(c, TABLE_NAME, 50, 100, 1, 4);
   }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/aa711023/test/src/test/java/org/apache/accumulo/test/functional/ClassLoaderIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/functional/ClassLoaderIT.java b/test/src/test/java/org/apache/accumulo/test/functional/ClassLoaderIT.java
index c85c78c..0834b89 100644
--- a/test/src/test/java/org/apache/accumulo/test/functional/ClassLoaderIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/functional/ClassLoaderIT.java
@@ -43,7 +43,7 @@ import org.apache.hadoop.fs.Path;
 import org.junit.Test;
 
 public class ClassLoaderIT extends SimpleMacIT {
-  
+
   @Test(timeout = 2 * 60 * 1000)
   public void test() throws Exception {
     Connector c = getConnector();
@@ -56,7 +56,7 @@ public class ClassLoaderIT extends SimpleMacIT {
     scanCheck(c, "Test");
     FileSystem fs = FileSystem.get(CachedConfiguration.getInstance());
     Path jarPath = new Path(rootPath() + "/lib/Test.jar");
-    fs.copyFromLocalFile(new Path(System.getProperty("user.dir")+"/system/auto/TestCombinerX.jar"), jarPath);
+    fs.copyFromLocalFile(new Path(System.getProperty("user.dir") + "/system/auto/TestCombinerX.jar"), jarPath);
     UtilWaitThread.sleep(1000);
     IteratorSetting is = new IteratorSetting(10, "TestCombiner", "org.apache.accumulo.test.functional.TestCombiner");
     Combiner.setColumns(is, Collections.singletonList(new IteratorSetting.Column("cf")));
@@ -64,7 +64,7 @@ public class ClassLoaderIT extends SimpleMacIT {
     UtilWaitThread.sleep(5000);
     scanCheck(c, "TestX");
     fs.delete(jarPath, true);
-    fs.copyFromLocalFile(new Path(System.getProperty("user.dir")+"/system/auto/TestCombinerY.jar"), jarPath);
+    fs.copyFromLocalFile(new Path(System.getProperty("user.dir") + "/system/auto/TestCombinerY.jar"), jarPath);
     UtilWaitThread.sleep(5000);
     scanCheck(c, "TestY");
   }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/aa711023/test/src/test/java/org/apache/accumulo/test/functional/CleanTmpIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/functional/CleanTmpIT.java b/test/src/test/java/org/apache/accumulo/test/functional/CleanTmpIT.java
index 0216a7a..06ce6ee 100644
--- a/test/src/test/java/org/apache/accumulo/test/functional/CleanTmpIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/functional/CleanTmpIT.java
@@ -53,7 +53,7 @@ public class CleanTmpIT extends ConfigurableMacIT {
   public void test() throws Exception {
     Connector c = getConnector();
     // make a table
-    String tableName = makeTableName();
+    String tableName = getTableNames(1)[0];
     c.tableOperations().create(tableName);
     // write to it
     BatchWriter bw = c.createBatchWriter(tableName, new BatchWriterConfig());

http://git-wip-us.apache.org/repos/asf/accumulo/blob/aa711023/test/src/test/java/org/apache/accumulo/test/functional/CloneTestIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/functional/CloneTestIT.java b/test/src/test/java/org/apache/accumulo/test/functional/CloneTestIT.java
index c238e96..f5c392f 100644
--- a/test/src/test/java/org/apache/accumulo/test/functional/CloneTestIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/functional/CloneTestIT.java
@@ -50,143 +50,145 @@ import org.junit.Test;
  * 
  */
 public class CloneTestIT extends SimpleMacIT {
-  
+
   @Test(timeout = 120 * 1000)
   public void testProps() throws Exception {
-    String table1 = makeTableName();
-    String table2 = makeTableName();
-    
+    String[] tableNames = getTableNames(2);
+    String table1 = tableNames[0];
+    String table2 = tableNames[1];
+
     Connector c = getConnector();
-    
+
     c.tableOperations().create(table1);
-    
+
     c.tableOperations().setProperty(table1, Property.TABLE_FILE_COMPRESSED_BLOCK_SIZE.getKey(), "1M");
     c.tableOperations().setProperty(table1, Property.TABLE_FILE_COMPRESSED_BLOCK_SIZE_INDEX.getKey(), "2M");
     c.tableOperations().setProperty(table1, Property.TABLE_FILE_MAX.getKey(), "23");
-    
+
     BatchWriter bw = writeData(table1, c);
-    
+
     Map<String,String> props = new HashMap<String,String>();
     props.put(Property.TABLE_FILE_COMPRESSED_BLOCK_SIZE.getKey(), "500K");
-    
+
     Set<String> exclude = new HashSet<String>();
     exclude.add(Property.TABLE_FILE_MAX.getKey());
-    
+
     c.tableOperations().clone(table1, table2, true, props, exclude);
-    
+
     Mutation m3 = new Mutation("009");
     m3.put("data", "x", "1");
     m3.put("data", "y", "2");
     bw.addMutation(m3);
     bw.close();
-    
+
     checkData(table2, c);
-    
+
     HashMap<String,String> tableProps = new HashMap<String,String>();
     for (Entry<String,String> prop : c.tableOperations().getProperties(table2)) {
       tableProps.put(prop.getKey(), prop.getValue());
     }
-    
+
     Assert.assertEquals("500K", tableProps.get(Property.TABLE_FILE_COMPRESSED_BLOCK_SIZE.getKey()));
     Assert.assertEquals(Property.TABLE_FILE_MAX.getDefaultValue(), tableProps.get(Property.TABLE_FILE_MAX.getKey()));
     Assert.assertEquals("2M", tableProps.get(Property.TABLE_FILE_COMPRESSED_BLOCK_SIZE_INDEX.getKey()));
-    
+
     c.tableOperations().delete(table1);
     c.tableOperations().delete(table2);
-    
+
   }
-  
+
   private void checkData(String table2, Connector c) throws TableNotFoundException {
     Scanner scanner = c.createScanner(table2, Authorizations.EMPTY);
-    
+
     HashMap<String,String> expected = new HashMap<String,String>();
     expected.put("001:x", "9");
     expected.put("001:y", "7");
     expected.put("008:x", "3");
     expected.put("008:y", "4");
-    
+
     HashMap<String,String> actual = new HashMap<String,String>();
-    
+
     for (Entry<Key,Value> entry : scanner)
       actual.put(entry.getKey().getRowData().toString() + ":" + entry.getKey().getColumnQualifierData().toString(), entry.getValue().toString());
-    
+
     Assert.assertEquals(expected, actual);
   }
-  
+
   private BatchWriter writeData(String table1, Connector c) throws TableNotFoundException, MutationsRejectedException {
     BatchWriter bw = c.createBatchWriter(table1, new BatchWriterConfig());
-    
+
     Mutation m1 = new Mutation("001");
     m1.put("data", "x", "9");
     m1.put("data", "y", "7");
-    
+
     Mutation m2 = new Mutation("008");
     m2.put("data", "x", "3");
     m2.put("data", "y", "4");
-    
+
     bw.addMutation(m1);
     bw.addMutation(m2);
-    
+
     bw.flush();
     return bw;
   }
-  
+
   @Test(timeout = 120 * 1000)
   public void testDeleteClone() throws Exception {
-    String table1 = makeTableName();
-    String table2 = makeTableName();
-    String table3 = makeTableName();
-    
+    String[] tableNames = getTableNames(3);
+    String table1 = tableNames[0];
+    String table2 = tableNames[1];
+    String table3 = tableNames[2];
+
     Connector c = getConnector();
 
     // verify that deleting a new table removes the files
     c.tableOperations().create(table3);
     writeData(table3, c).close();
     c.tableOperations().flush(table3, null, null, true);
-    //    check for files
+    // check for files
     FileSystem fs = FileSystem.get(new Configuration());
     String id = c.tableOperations().tableIdMap().get(table3);
     FileStatus[] status = fs.listStatus(new Path(rootPath() + "/accumulo/tables/" + id));
     assertTrue(status.length > 0);
-    //     verify disk usage
+    // verify disk usage
     List<DiskUsage> diskUsage = c.tableOperations().getDiskUsage(Collections.singleton(table3));
     assertEquals(1, diskUsage.size());
     assertTrue(diskUsage.get(0).getUsage() > 100);
-    //     delete the table
+    // delete the table
     c.tableOperations().delete(table3);
-    //     verify its gone from the file system
+    // verify its gone from the file system
     status = fs.listStatus(new Path(rootPath() + "/accumulo/tables/" + id));
     assertTrue(status == null || status.length == 0);
 
     c.tableOperations().create(table1);
-    
+
     BatchWriter bw = writeData(table1, c);
 
     Map<String,String> props = new HashMap<String,String>();
     props.put(Property.TABLE_FILE_COMPRESSED_BLOCK_SIZE.getKey(), "500K");
-    
+
     Set<String> exclude = new HashSet<String>();
     exclude.add(Property.TABLE_FILE_MAX.getKey());
-    
+
     c.tableOperations().clone(table1, table2, true, props, exclude);
-    
+
     Mutation m3 = new Mutation("009");
     m3.put("data", "x", "1");
     m3.put("data", "y", "2");
     bw.addMutation(m3);
     bw.close();
-    
+
     // delete source table, should not affect clone
     c.tableOperations().delete(table1);
-    
+
     checkData(table2, c);
-    
+
     c.tableOperations().compact(table2, null, null, true, true);
-    
+
     checkData(table2, c);
-    
+
     c.tableOperations().delete(table2);
-    
+
   }
 
 }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/aa711023/test/src/test/java/org/apache/accumulo/test/functional/CombinerIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/functional/CombinerIT.java b/test/src/test/java/org/apache/accumulo/test/functional/CombinerIT.java
index dc4368f..c3a7f38 100644
--- a/test/src/test/java/org/apache/accumulo/test/functional/CombinerIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/functional/CombinerIT.java
@@ -38,7 +38,7 @@ import org.apache.accumulo.core.security.Authorizations;
 import org.junit.Test;
 
 public class CombinerIT extends SimpleMacIT {
-  
+
   private void checkSum(String tableName, Connector c) throws Exception {
     Scanner s = c.createScanner(tableName, Authorizations.EMPTY);
     Iterator<Entry<Key,Value>> i = s.iterator();
@@ -47,11 +47,11 @@ public class CombinerIT extends SimpleMacIT {
     assertEquals("45", entry.getValue().toString());
     assertFalse(i.hasNext());
   }
-  
+
   @Test(timeout = 60 * 1000)
   public void aggregationTest() throws Exception {
     Connector c = getConnector();
-    String tableName = makeTableName();
+    String tableName = getTableNames(1)[0];
     c.tableOperations().create(tableName);
     IteratorSetting setting = new IteratorSetting(10, SummingCombiner.class);
     SummingCombiner.setEncodingType(setting, Type.STRING);
@@ -66,5 +66,5 @@ public class CombinerIT extends SimpleMacIT {
     bw.close();
     checkSum(tableName, c);
   }
-  
+
 }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/aa711023/test/src/test/java/org/apache/accumulo/test/functional/CompactionIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/functional/CompactionIT.java b/test/src/test/java/org/apache/accumulo/test/functional/CompactionIT.java
index a49670e..cba24fd 100644
--- a/test/src/test/java/org/apache/accumulo/test/functional/CompactionIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/functional/CompactionIT.java
@@ -20,6 +20,7 @@ import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
 
+import java.io.File;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
@@ -41,10 +42,15 @@ import org.apache.accumulo.minicluster.MiniAccumuloConfig;
 import org.apache.accumulo.server.util.Admin;
 import org.apache.accumulo.test.VerifyIngest;
 import org.apache.hadoop.fs.FileSystem;
+import org.junit.Rule;
 import org.junit.Test;
+import org.junit.rules.TemporaryFolder;
 
 public class CompactionIT extends ConfigurableMacIT {
-  
+
+  @Rule
+  public TemporaryFolder folder = new TemporaryFolder(new File(System.getProperty("user.dir") + "/target"));
+
   @Override
   public void configure(MiniAccumuloConfig cfg) {
     Map<String,String> map = new HashMap<String,String>();
@@ -53,17 +59,17 @@ public class CompactionIT extends ConfigurableMacIT {
     map.put(Property.TSERV_MAJC_MAXCONCURRENT.getKey(), "1");
     cfg.setSiteConfig(map);
   }
-  
+
   @Test(timeout = 4 * 60 * 1000)
   public void test() throws Exception {
     final Connector c = getConnector();
     c.tableOperations().create("test_ingest");
     c.tableOperations().setProperty("test_ingest", Property.TABLE_MAJC_RATIO.getKey(), "1.0");
     FileSystem fs = FileSystem.get(CachedConfiguration.getInstance());
-    FunctionalTestUtils.createRFiles(c, fs, "tmp/testrf", 500000, 59, 4);
-    FunctionalTestUtils.bulkImport(c, fs, "test_ingest", "tmp/testrf");
+    FunctionalTestUtils.createRFiles(c, fs, folder.getRoot() + "/testrf", 500000, 59, 4);
+    FunctionalTestUtils.bulkImport(c, fs, "test_ingest", folder.getRoot() + "/testrf");
     int beforeCount = countFiles(c);
-    
+
     final AtomicBoolean fail = new AtomicBoolean(false);
     for (int count = 0; count < 5; count++) {
       List<Thread> threads = new ArrayList<Thread>();
@@ -93,12 +99,12 @@ public class CompactionIT extends ConfigurableMacIT {
         t.join();
       assertFalse(fail.get());
     }
-    
+
     int finalCount = countFiles(c);
     assertTrue(finalCount < beforeCount);
     assertEquals(0, cluster.exec(Admin.class, "stopAll").waitFor());
   }
-  
+
   private int countFiles(Connector c) throws Exception {
     Scanner s = c.createScanner(MetadataTable.NAME, Authorizations.EMPTY);
     s.fetchColumnFamily(MetadataSchema.TabletsSection.TabletColumnFamily.NAME);
@@ -109,5 +115,5 @@ public class CompactionIT extends ConfigurableMacIT {
       i++;
     return i;
   }
-  
+
 }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/aa711023/test/src/test/java/org/apache/accumulo/test/functional/ConfigurableMacIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/functional/ConfigurableMacIT.java b/test/src/test/java/org/apache/accumulo/test/functional/ConfigurableMacIT.java
index c34fff5..597f385 100644
--- a/test/src/test/java/org/apache/accumulo/test/functional/ConfigurableMacIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/functional/ConfigurableMacIT.java
@@ -16,40 +16,65 @@
  */
 package org.apache.accumulo.test.functional;
 
+import java.io.IOException;
+
+import org.apache.accumulo.core.Constants;
+import org.apache.accumulo.core.client.AccumuloException;
+import org.apache.accumulo.core.client.AccumuloSecurityException;
+import org.apache.accumulo.core.client.Connector;
+import org.apache.accumulo.core.client.Instance;
+import org.apache.accumulo.core.client.ZooKeeperInstance;
+import org.apache.accumulo.core.zookeeper.ZooUtil;
+import org.apache.accumulo.fate.zookeeper.ZooReader;
 import org.apache.accumulo.minicluster.MiniAccumuloCluster;
 import org.apache.accumulo.minicluster.MiniAccumuloConfig;
 import org.apache.log4j.Logger;
+import org.apache.zookeeper.KeeperException;
 import org.junit.After;
 import org.junit.Before;
-import org.junit.rules.TemporaryFolder;
-import java.io.File;
 
 public class ConfigurableMacIT extends AbstractMacIT {
   public static final Logger log = Logger.getLogger(ConfigurableMacIT.class);
-  
-  public TemporaryFolder folder = new TemporaryFolder(new File(System.getProperty("user.dir") + "/target"));
+
   public MiniAccumuloCluster cluster;
-  
+
+  public void configure(MiniAccumuloConfig cfg) {}
+
   @Before
   public void setUp() throws Exception {
-    folder.create();
-    MiniAccumuloConfig cfg = new MiniAccumuloConfig(folder.newFolder(this.getClass().getSimpleName()), ROOT_PASSWORD);
+    MiniAccumuloConfig cfg = new MiniAccumuloConfig(createTestDir(this.getClass().getName()), ROOT_PASSWORD);
     configure(cfg);
     cluster = new MiniAccumuloCluster(cfg);
     cluster.start();
   }
-  
-  public void configure(MiniAccumuloConfig cfg) {
-  }
-  
+
   @After
   public void tearDown() throws Exception {
-    cleanUp(cluster, folder);
+    cleanUp(cluster);
   }
 
-  @Override
   public MiniAccumuloCluster getCluster() {
     return cluster;
   }
-  
+
+  @Override
+  public Connector getConnector() throws AccumuloException, AccumuloSecurityException {
+    return getCluster().getConnector("root", ROOT_PASSWORD);
+  }
+
+  public Process exec(Class<? extends Object> clazz, String... args) throws IOException {
+    return getCluster().exec(clazz, args);
+  }
+
+  @Override
+  public String rootPath() {
+    return getCluster().getConfig().getDir().getAbsolutePath();
+  }
+
+  public String getMonitor() throws KeeperException, InterruptedException {
+    Instance instance = new ZooKeeperInstance(getCluster().getInstanceName(), getCluster().getZooKeepers());
+    ZooReader zr = new ZooReader(getCluster().getZooKeepers(), 5000);
+    return new String(zr.getData(ZooUtil.getRoot(instance) + Constants.ZMONITOR, null));
+  }
+
 }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/aa711023/test/src/test/java/org/apache/accumulo/test/functional/ConstraintIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/functional/ConstraintIT.java b/test/src/test/java/org/apache/accumulo/test/functional/ConstraintIT.java
index 56f0c22..1e824f8 100644
--- a/test/src/test/java/org/apache/accumulo/test/functional/ConstraintIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/functional/ConstraintIT.java
@@ -40,132 +40,132 @@ import org.apache.hadoop.io.Text;
 import org.junit.Test;
 
 public class ConstraintIT extends SimpleMacIT {
-  
+
   @Test(timeout = 30 * 1000)
   public void run() throws Exception {
-    String[] tableNames = { makeTableName(), makeTableName(), makeTableName() }; 
+    String[] tableNames = getTableNames(3);
     Connector c = getConnector();
     for (String table : tableNames) {
       c.tableOperations().create(table);
       c.tableOperations().addConstraint(table, NumericValueConstraint.class.getName());
       c.tableOperations().addConstraint(table, AlphaNumKeyConstraint.class.getName());
     }
-      
-//    Logger logger = Logger.getLogger(Constants.CORE_PACKAGE_NAME);
-    //logger.setLevel(Level.TRACE);
-    
+
+    // Logger logger = Logger.getLogger(Constants.CORE_PACKAGE_NAME);
+    // logger.setLevel(Level.TRACE);
+
     test1(tableNames[0]);
-    
-    //logger.setLevel(Level.TRACE);
-    
+
+    // logger.setLevel(Level.TRACE);
+
     test2(tableNames[1], false);
     test2(tableNames[2], true);
   }
-  
+
   private void test1(String tableName) throws Exception {
     BatchWriter bw = getConnector().createBatchWriter(tableName, new BatchWriterConfig());
-    
+
     Mutation mut1 = new Mutation(new Text("r1"));
     mut1.put(new Text("cf1"), new Text("cq1"), new Value("123".getBytes()));
-    
+
     bw.addMutation(mut1);
-    
+
     // should not throw any exceptions
     bw.close();
-    
+
     bw = getConnector().createBatchWriter(tableName, new BatchWriterConfig());
-    
+
     // create a mutation with a non numeric value
     Mutation mut2 = new Mutation(new Text("r1"));
     mut2.put(new Text("cf1"), new Text("cq1"), new Value("123a".getBytes()));
-    
+
     bw.addMutation(mut2);
-    
+
     boolean sawMRE = false;
-    
+
     try {
       bw.close();
       // should not get here
       throw new Exception("Test failed, constraint did not catch bad mutation");
     } catch (MutationsRejectedException mre) {
       sawMRE = true;
-      
+
       // verify constraint violation summary
       List<ConstraintViolationSummary> cvsl = mre.getConstraintViolationSummaries();
-      
+
       if (cvsl.size() != 1) {
         throw new Exception("Unexpected constraints");
       }
-      
+
       for (ConstraintViolationSummary cvs : cvsl) {
         if (!cvs.constrainClass.equals(NumericValueConstraint.class.getName())) {
           throw new Exception("Unexpected constraint class " + cvs.constrainClass);
         }
-        
+
         if (cvs.numberOfViolatingMutations != 1) {
           throw new Exception("Unexpected # violating mutations " + cvs.numberOfViolatingMutations);
         }
       }
     }
-    
+
     if (!sawMRE) {
       throw new Exception("Did not see MutationsRejectedException");
     }
-    
+
     // verify mutation did not go through
     Scanner scanner = getConnector().createScanner(tableName, Authorizations.EMPTY);
     scanner.setRange(new Range(new Text("r1")));
-    
+
     Iterator<Entry<Key,Value>> iter = scanner.iterator();
     Entry<Key,Value> entry = iter.next();
-    
+
     if (!entry.getKey().getRow().equals(new Text("r1")) || !entry.getKey().getColumnFamily().equals(new Text("cf1"))
         || !entry.getKey().getColumnQualifier().equals(new Text("cq1")) || !entry.getValue().equals(new Value("123".getBytes()))) {
       throw new Exception("Unexpected key or value " + entry.getKey() + " " + entry.getValue());
     }
-    
+
     if (iter.hasNext()) {
       entry = iter.next();
       throw new Exception("Unexpected extra key or value " + entry.getKey() + " " + entry.getValue());
     }
-    
+
     // remove the numeric value constraint
     getConnector().tableOperations().removeConstraint(tableName, 2);
     UtilWaitThread.sleep(1000);
-    
+
     // now should be able to add a non numeric value
     bw = getConnector().createBatchWriter(tableName, new BatchWriterConfig());
     bw.addMutation(mut2);
     bw.close();
-    
+
     // verify mutation went through
     iter = scanner.iterator();
     entry = iter.next();
-    
+
     if (!entry.getKey().getRow().equals(new Text("r1")) || !entry.getKey().getColumnFamily().equals(new Text("cf1"))
         || !entry.getKey().getColumnQualifier().equals(new Text("cq1")) || !entry.getValue().equals(new Value("123a".getBytes()))) {
       throw new Exception("Unexpected key or value " + entry.getKey() + " " + entry.getValue());
     }
-    
+
     if (iter.hasNext()) {
       entry = iter.next();
       throw new Exception("Unexpected extra key or value " + entry.getKey() + " " + entry.getValue());
     }
-    
+
     // add a constraint that references a non-existant class
     getConnector().tableOperations().setProperty(tableName, Property.TABLE_CONSTRAINT_PREFIX + "1", "com.foobar.nonExistantClass");
     UtilWaitThread.sleep(1000);
-    
+
     // add a mutation
     bw = getConnector().createBatchWriter(tableName, new BatchWriterConfig());
-    
+
     Mutation mut3 = new Mutation(new Text("r1"));
     mut3.put(new Text("cf1"), new Text("cq1"), new Value("foo".getBytes()));
-    
+
     bw.addMutation(mut3);
-    
+
     sawMRE = false;
-    
+
     try {
       bw.close();
       // should not get here
@@ -173,60 +173,60 @@ public class ConstraintIT extends SimpleMacIT {
     } catch (MutationsRejectedException mre) {
       sawMRE = true;
     }
-    
+
     if (!sawMRE) {
       throw new Exception("Did not see MutationsRejectedException");
     }
-    
+
     // verify the mutation did not go through
     iter = scanner.iterator();
     entry = iter.next();
-    
+
     if (!entry.getKey().getRow().equals(new Text("r1")) || !entry.getKey().getColumnFamily().equals(new Text("cf1"))
         || !entry.getKey().getColumnQualifier().equals(new Text("cq1")) || !entry.getValue().equals(new Value("123a".getBytes()))) {
       throw new Exception("Unexpected key or value " + entry.getKey() + " " + entry.getValue());
     }
-    
+
     if (iter.hasNext()) {
       entry = iter.next();
       throw new Exception("Unexpected extra key or value " + entry.getKey() + " " + entry.getValue());
     }
-    
+
     // remove the bad constraint
     getConnector().tableOperations().removeConstraint(tableName, 1);
     UtilWaitThread.sleep(1000);
-    
+
     // try the mutation again
     bw = getConnector().createBatchWriter(tableName, new BatchWriterConfig());
     bw.addMutation(mut3);
     bw.close();
-    
+
     // verify it went through
     iter = scanner.iterator();
     entry = iter.next();
-    
+
     if (!entry.getKey().getRow().equals(new Text("r1")) || !entry.getKey().getColumnFamily().equals(new Text("cf1"))
         || !entry.getKey().getColumnQualifier().equals(new Text("cq1")) || !entry.getValue().equals(new Value("foo".getBytes()))) {
       throw new Exception("Unexpected key or value " + entry.getKey() + " " + entry.getValue());
     }
-    
+
     if (iter.hasNext()) {
       entry = iter.next();
       throw new Exception("Unexpected extra key or value " + entry.getKey() + " " + entry.getValue());
     }
   }
-  
+
   private Mutation newMut(String row, String cf, String cq, String val) {
     Mutation mut1 = new Mutation(new Text(row));
     mut1.put(new Text(cf), new Text(cq), new Value(val.getBytes()));
     return mut1;
   }
-  
+
   private void test2(String table, boolean doFlush) throws Exception {
     // test sending multiple mutations with multiple constrain violations... all of the non violating mutations
     // should go through
     int numericErrors = 2;
-    
+
     BatchWriter bw = getConnector().createBatchWriter(table, new BatchWriterConfig());
     bw.addMutation(newMut("r1", "cf1", "cq1", "123"));
     bw.addMutation(newMut("r1", "cf1", "cq2", "I'm a bad value"));
@@ -248,64 +248,64 @@ public class ConstraintIT extends SimpleMacIT {
     bw.addMutation(newMut("r1", "cf1", "cq3", "I'm a naughty value"));
     bw.addMutation(newMut("@bad row@", "cf1", "cq2", "456"));
     bw.addMutation(newMut("r1", "cf1", "cq4", "789"));
-    
+
     boolean sawMRE = false;
-    
+
     try {
       bw.close();
       // should not get here
       throw new Exception("Test failed, constraint did not catch bad mutation");
     } catch (MutationsRejectedException mre) {
       System.out.println(mre);
-      
+
       sawMRE = true;
-      
+
       // verify constraint violation summary
       List<ConstraintViolationSummary> cvsl = mre.getConstraintViolationSummaries();
-      
+
       if (cvsl.size() != 2) {
         throw new Exception("Unexpected constraints");
       }
-      
+
       HashMap<String,Integer> expected = new HashMap<String,Integer>();
-      
+
       expected.put("org.apache.accumulo.examples.simple.constraints.NumericValueConstraint", numericErrors);
       expected.put("org.apache.accumulo.examples.simple.constraints.AlphaNumKeyConstraint", 1);
-      
+
       for (ConstraintViolationSummary cvs : cvsl) {
         if (expected.get(cvs.constrainClass) != cvs.numberOfViolatingMutations) {
           throw new Exception("Unexpected " + cvs.constrainClass + " " + cvs.numberOfViolatingMutations);
         }
       }
     }
-    
+
     if (!sawMRE) {
       throw new Exception("Did not see MutationsRejectedException");
     }
-    
+
     Scanner scanner = getConnector().createScanner(table, Authorizations.EMPTY);
-    
+
     Iterator<Entry<Key,Value>> iter = scanner.iterator();
-    
+
     Entry<Key,Value> entry = iter.next();
-    
+
     if (!entry.getKey().getRow().equals(new Text("r1")) || !entry.getKey().getColumnFamily().equals(new Text("cf1"))
         || !entry.getKey().getColumnQualifier().equals(new Text("cq1")) || !entry.getValue().equals(new Value("123".getBytes()))) {
       throw new Exception("Unexpected key or value " + entry.getKey() + " " + entry.getValue());
     }
-    
+
     entry = iter.next();
-    
+
     if (!entry.getKey().getRow().equals(new Text("r1")) || !entry.getKey().getColumnFamily().equals(new Text("cf1"))
         || !entry.getKey().getColumnQualifier().equals(new Text("cq4")) || !entry.getValue().equals(new Value("789".getBytes()))) {
       throw new Exception("Unexpected key or value " + entry.getKey() + " " + entry.getValue());
     }
-    
+
     if (iter.hasNext()) {
       entry = iter.next();
       throw new Exception("Unexpected extra key or value " + entry.getKey() + " " + entry.getValue());
     }
-    
+
   }
-  
+
 }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/aa711023/test/src/test/java/org/apache/accumulo/test/functional/CreateAndUseIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/functional/CreateAndUseIT.java b/test/src/test/java/org/apache/accumulo/test/functional/CreateAndUseIT.java
index ba17f88..68a6a2e 100644
--- a/test/src/test/java/org/apache/accumulo/test/functional/CreateAndUseIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/functional/CreateAndUseIT.java
@@ -34,57 +34,58 @@ import org.apache.hadoop.io.Text;
 import org.junit.Test;
 
 public class CreateAndUseIT extends SimpleMacIT {
-  
+
   @Test(timeout = 2 * 60 * 1000)
   public void run() throws Exception {
     SortedSet<Text> splits = new TreeSet<Text>();
-    
+
     for (int i = 1; i < 256; i++) {
       splits.add(new Text(String.format("%08x", i << 8)));
     }
-    
+
     // TEST 1 create a table and immediately batch write to it
-    
+
     Text cf = new Text("cf1");
     Text cq = new Text("cq1");
-    
-    String tableName = makeTableName();
+
+    String[] tableNames = getTableNames(3);
+    String tableName = tableNames[0];
     getConnector().tableOperations().create(tableName);
     getConnector().tableOperations().addSplits(tableName, splits);
     BatchWriter bw = getConnector().createBatchWriter(tableName, new BatchWriterConfig());
-    
+
     for (int i = 1; i < 257; i++) {
       Mutation m = new Mutation(new Text(String.format("%08x", (i << 8) - 16)));
       m.put(cf, cq, new Value(("" + i).getBytes()));
-      
+
       bw.addMutation(m);
     }
-    
+
     bw.close();
-    
+
     // verify data is there
     Scanner scanner1 = getConnector().createScanner(tableName, Authorizations.EMPTY);
-    
+
     int ei = 1;
-    
+
     for (Entry<Key,Value> entry : scanner1) {
       if (!entry.getKey().getRow().toString().equals(String.format("%08x", (ei << 8) - 16))) {
         throw new Exception("Expected row " + String.format("%08x", (ei << 8) - 16) + " saw " + entry.getKey().getRow());
       }
-      
+
       if (!entry.getValue().toString().equals("" + ei)) {
         throw new Exception("Expected value " + ei + " saw " + entry.getValue());
       }
-      
+
       ei++;
     }
-    
+
     if (ei != 257) {
       throw new Exception("Did not see expected number of rows, ei = " + ei);
     }
-    
+
     // TEST 2 create a table and immediately scan it
-    String table2 = makeTableName();
+    String table2 = tableNames[1];
     getConnector().tableOperations().create(table2);
     getConnector().tableOperations().addSplits(table2, splits);
     Scanner scanner2 = getConnector().createScanner(table2, Authorizations.EMPTY);
@@ -93,19 +94,19 @@ public class CreateAndUseIT extends SimpleMacIT {
       if (entry != null)
         count++;
     }
-    
+
     if (count != 0) {
       throw new Exception("Did not see expected number of entries, count = " + count);
     }
-    
+
     // TEST 3 create a table and immediately batch scan it
-    
+
     ArrayList<Range> ranges = new ArrayList<Range>();
     for (int i = 1; i < 257; i++) {
       ranges.add(new Range(new Text(String.format("%08x", (i << 8) - 16))));
     }
 
-    String table3 = makeTableName();
+    String table3 = tableNames[2];
     getConnector().tableOperations().create(table3);
     getConnector().tableOperations().addSplits(table3, splits);
     BatchScanner bs = getConnector().createBatchScanner(table3, Authorizations.EMPTY, 3);
@@ -115,13 +116,13 @@ public class CreateAndUseIT extends SimpleMacIT {
       if (entry != null)
         count++;
     }
-    
+
     if (count != 0) {
       throw new Exception("Did not see expected number of entries, count = " + count);
     }
-    
+
     bs.close();
-    
+
   }
-  
+
 }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/aa711023/test/src/test/java/org/apache/accumulo/test/functional/CreateManyScannersIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/functional/CreateManyScannersIT.java b/test/src/test/java/org/apache/accumulo/test/functional/CreateManyScannersIT.java
index 4549d55..0c51f2a 100644
--- a/test/src/test/java/org/apache/accumulo/test/functional/CreateManyScannersIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/functional/CreateManyScannersIT.java
@@ -21,15 +21,15 @@ import org.apache.accumulo.core.security.Authorizations;
 import org.junit.Test;
 
 public class CreateManyScannersIT extends SimpleMacIT {
-  
+
   @Test(timeout = 60 * 1000)
   public void run() throws Exception {
     Connector c = getConnector();
-    String tableName = makeTableName();
+    String tableName = getTableNames(1)[0];
     c.tableOperations().create(tableName);
     for (int i = 0; i < 100000; i++) {
       c.createScanner(tableName, Authorizations.EMPTY);
     }
   }
-  
+
 }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/aa711023/test/src/test/java/org/apache/accumulo/test/functional/DeleteRowsIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/functional/DeleteRowsIT.java b/test/src/test/java/org/apache/accumulo/test/functional/DeleteRowsIT.java
index e6c0446..3ab2768 100644
--- a/test/src/test/java/org/apache/accumulo/test/functional/DeleteRowsIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/functional/DeleteRowsIT.java
@@ -40,7 +40,7 @@ import org.junit.Test;
 
 public class DeleteRowsIT extends SimpleMacIT {
   private static final Logger log = Logger.getLogger(DeleteRowsIT.class);
-  
+
   private static final int ROWS_PER_TABLET = 10;
   private static final String[] LETTERS = new String[] {"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t",
       "u", "v", "w", "x", "y", "z"};
@@ -56,13 +56,13 @@ public class DeleteRowsIT extends SimpleMacIT {
     ROWS.add("A");
     ROWS.add("{");
   }
-  
+
   @Test(timeout = 10 * 60 * 1000)
   public void test() throws Exception {
     // Delete ranges of rows, and verify the tablets are removed.
     int i = 0;
     // Eliminate whole tablets
-    String tableName = makeTableName();
+    String tableName = getTableNames(1)[0];
     testSplit(tableName + i++, "f", "h", "abcdefijklmnopqrstuvwxyz", 260);
     // Eliminate whole tablets, partial first tablet
     testSplit(tableName + i++, "f1", "h", "abcdeff1ijklmnopqrstuvwxyz", 262);
@@ -89,7 +89,7 @@ public class DeleteRowsIT extends SimpleMacIT {
     // Delete everything
     testSplit(tableName + i++, null, null, "", 0);
   }
-  
+
   private void testSplit(String table, String start, String end, String result, int entries) throws Exception {
     // Put a bunch of rows on each tablet
     Connector c = getConnector();
@@ -106,7 +106,7 @@ public class DeleteRowsIT extends SimpleMacIT {
     bw.close();
     // Split the table
     c.tableOperations().addSplits(table, SPLITS);
-    
+
     Text startText = start == null ? null : new Text(start);
     Text endText = end == null ? null : new Text(end);
     c.tableOperations().deleteRows(table, startText, endText);
@@ -128,5 +128,5 @@ public class DeleteRowsIT extends SimpleMacIT {
     log.info("Finished table " + table);
     assertEquals(entries, count);
   }
-  
+
 }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/aa711023/test/src/test/java/org/apache/accumulo/test/functional/DeleteRowsSplitIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/functional/DeleteRowsSplitIT.java b/test/src/test/java/org/apache/accumulo/test/functional/DeleteRowsSplitIT.java
index fae52d0..a08aa2c 100644
--- a/test/src/test/java/org/apache/accumulo/test/functional/DeleteRowsSplitIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/functional/DeleteRowsSplitIT.java
@@ -39,9 +39,9 @@ import org.junit.Test;
 
 // attempt to reproduce ACCUMULO-315
 public class DeleteRowsSplitIT extends SimpleMacIT {
-  
+
   private static final Logger log = Logger.getLogger(DeleteRowsSplitIT.class);
-  
+
   private static final String LETTERS = "abcdefghijklmnopqrstuvwxyz";
   static final SortedSet<Text> SPLITS = new TreeSet<Text>();
   static final List<String> ROWS = new ArrayList<String>();
@@ -51,27 +51,27 @@ public class DeleteRowsSplitIT extends SimpleMacIT {
       ROWS.add(new String(new byte[] {b}));
     }
   }
-  
+
   @Test(timeout = 4 * 60 * 1000)
   public void run() throws Exception {
     // Delete ranges of rows, and verify the are removed
     // Do this while adding many splits
-    final String tableName = makeTableName();
-    
+    final String tableName = getTableNames(1)[0];
+
     // Eliminate whole tablets
     for (int test = 0; test < 10; test++) {
       // create a table
       log.info("Test " + test);
       getConnector().tableOperations().create(tableName);
-      
+
       // put some data in it
       fillTable(tableName);
-      
+
       // generate a random delete range
       final Text start = new Text();
       final Text end = new Text();
       generateRandomRange(start, end);
-      
+
       // initiate the delete range
       final boolean fail[] = {false};
       Thread t = new Thread() {
@@ -90,28 +90,28 @@ public class DeleteRowsSplitIT extends SimpleMacIT {
         }
       };
       t.start();
-      
+
       UtilWaitThread.sleep(test * 2);
-      
+
       getConnector().tableOperations().deleteRows(tableName, start, end);
-      
+
       t.join();
       synchronized (fail) {
         assertTrue(!fail[0]);
       }
-      
+
       // scan the table
       Scanner scanner = getConnector().createScanner(tableName, Authorizations.EMPTY);
       for (Entry<Key,Value> entry : scanner) {
         Text row = entry.getKey().getRow();
         assertTrue(row.compareTo(start) <= 0 || row.compareTo(end) > 0);
       }
-      
+
       // delete the table
       getConnector().tableOperations().delete(tableName);
     }
   }
-  
+
   private void generateRandomRange(Text start, Text end) {
     List<String> bunch = new ArrayList<String>(ROWS);
     Collections.shuffle(bunch);
@@ -122,9 +122,9 @@ public class DeleteRowsSplitIT extends SimpleMacIT {
       start.set(bunch.get(1));
       end.set(bunch.get(0));
     }
-    
+
   }
-  
+
   private void fillTable(String table) throws Exception {
     BatchWriter bw = getConnector().createBatchWriter(table, new BatchWriterConfig());
     for (String row : ROWS) {

http://git-wip-us.apache.org/repos/asf/accumulo/blob/aa711023/test/src/test/java/org/apache/accumulo/test/functional/FateStarvationIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/functional/FateStarvationIT.java b/test/src/test/java/org/apache/accumulo/test/functional/FateStarvationIT.java
index e58931d..cf16105 100644
--- a/test/src/test/java/org/apache/accumulo/test/functional/FateStarvationIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/functional/FateStarvationIT.java
@@ -30,15 +30,15 @@ import org.junit.Test;
  * See ACCUMULO-779
  */
 public class FateStarvationIT extends SimpleMacIT {
-  
+
   @Test(timeout = 2 * 60 * 1000)
   public void run() throws Exception {
-    String tableName = makeTableName();
+    String tableName = getTableNames(1)[0];
     Connector c = getConnector();
     c.tableOperations().create(tableName);
-    
+
     c.tableOperations().addSplits(tableName, TestIngest.getSplitPoints(0, 100000, 50));
-    
+
     TestIngest.Opts opts = new TestIngest.Opts();
     opts.random = 89;
     opts.timestamp = 7;
@@ -47,20 +47,20 @@ public class FateStarvationIT extends SimpleMacIT {
     opts.cols = 1;
     opts.tableName = tableName;
     TestIngest.ingest(c, opts, new BatchWriterOpts());
-    
+
     c.tableOperations().flush(tableName, null, null, true);
-    
+
     List<Text> splits = new ArrayList<Text>(TestIngest.getSplitPoints(0, 100000, 67));
     Random rand = new Random();
-    
+
     for (int i = 0; i < 100; i++) {
       int idx1 = rand.nextInt(splits.size() - 1);
       int idx2 = rand.nextInt(splits.size() - (idx1 + 1)) + idx1 + 1;
-      
+
       c.tableOperations().compact(tableName, splits.get(idx1), splits.get(idx2), false, false);
     }
-    
+
     c.tableOperations().offline(tableName);
   }
-  
+
 }


Mime
View raw message