accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ctubb...@apache.org
Subject [1/4] ACCUMULO-1599 Move MiniAccumuloCluster output to target directory
Date Fri, 11 Oct 2013 06:37:06 GMT
Updated Branches:
  refs/heads/master 741daecfd -> aa7110234


http://git-wip-us.apache.org/repos/asf/accumulo/blob/aa711023/test/src/test/java/org/apache/accumulo/test/functional/GarbageCollectorIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/functional/GarbageCollectorIT.java b/test/src/test/java/org/apache/accumulo/test/functional/GarbageCollectorIT.java
index 06c86e6..7b9282c 100644
--- a/test/src/test/java/org/apache/accumulo/test/functional/GarbageCollectorIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/functional/GarbageCollectorIT.java
@@ -51,7 +51,7 @@ import org.apache.hadoop.io.Text;
 import org.junit.Test;
 
 public class GarbageCollectorIT extends ConfigurableMacIT {
-  
+
   @Override
   public void configure(MiniAccumuloConfig cfg) {
     Map<String,String> settings = new HashMap<String,String>();
@@ -61,7 +61,7 @@ public class GarbageCollectorIT extends ConfigurableMacIT {
     settings.put(Property.TSERV_MAJC_DELAY.getKey(), "1");
     cfg.setSiteConfig(settings);
   }
-  
+
   @Test(timeout = 4 * 60 * 1000)
   public void gcTest() throws Exception {
     Connector c = getConnector();
@@ -88,7 +88,7 @@ public class GarbageCollectorIT extends ConfigurableMacIT {
     assertTrue(after < before);
     gc.destroy();
   }
-  
+
   @Test(timeout = 4 * 60 * 1000)
   public void gcLotsOfCandidatesIT() throws Exception {
     log.info("Filling !METADATA table with bogus delete flags");
@@ -101,12 +101,12 @@ public class GarbageCollectorIT extends ConfigurableMacIT {
     gc.destroy();
     assertTrue(output.contains("delete candidates has exceeded"));
   }
-  
+
   @Test(timeout = 4 * 60 * 1000)
   public void dontGCRootLog() throws Exception {
     // dirty !METADATA
     Connector c = getConnector();
-    String table = makeTableName();
+    String table = getTableNames(1)[0];
     c.tableOperations().create(table);
     // let gc run for a bit
     Process gc = cluster.exec(SimpleGarbageCollector.class);
@@ -120,11 +120,12 @@ public class GarbageCollectorIT extends ConfigurableMacIT {
     cluster.start();
     // did it recover?
     Scanner scanner = c.createScanner(MetadataTable.NAME, Authorizations.EMPTY);
-    for (@SuppressWarnings("unused") Entry<Key,Value> unused : scanner) {
-      
+    for (@SuppressWarnings("unused")
+    Entry<Key,Value> unused : scanner) {
+
     }
   }
-  
+
   private int countFiles() throws Exception {
     FileSystem fs = FileSystem.get(CachedConfiguration.getInstance());
     int result = 0;
@@ -135,11 +136,11 @@ public class GarbageCollectorIT extends ConfigurableMacIT {
     }
     return result;
   }
-  
+
   public static void addEntries(Connector conn, BatchWriterOpts bwOpts) throws Exception {
     conn.securityOperations().grantTablePermission(conn.whoami(), MetadataTable.NAME, TablePermission.WRITE);
     BatchWriter bw = conn.createBatchWriter(MetadataTable.NAME, bwOpts.getBatchWriterConfig());
-    
+
     for (int i = 0; i < 100000; ++i) {
       final Text emptyText = new Text("");
       Text row = new Text(String.format("%s%s%020d%s", MetadataSchema.DeletesSection.getRowPrefix(), "/", i,

http://git-wip-us.apache.org/repos/asf/accumulo/blob/aa711023/test/src/test/java/org/apache/accumulo/test/functional/MapReduceIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/functional/MapReduceIT.java b/test/src/test/java/org/apache/accumulo/test/functional/MapReduceIT.java
index 69825bc..9e42e55 100644
--- a/test/src/test/java/org/apache/accumulo/test/functional/MapReduceIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/functional/MapReduceIT.java
@@ -34,15 +34,15 @@ import org.apache.hadoop.io.Text;
 import org.codehaus.plexus.util.Base64;
 import org.junit.Test;
 
-public class MapReduceIT extends SimpleMacIT {
-  
+public class MapReduceIT extends ConfigurableMacIT {
+
   static final String tablename = "mapredf";
   static final String input_cf = "cf-HASHTYPE";
   static final String input_cq = "cq-NOTHASHED";
   static final String input_cfcq = input_cf + ":" + input_cq;
   static final String output_cq = "cq-MD4BASE64";
-  static final String output_cfcq =  input_cf + ":" + output_cq;
-  
+  static final String output_cfcq = input_cf + ":" + output_cq;
+
   @Test(timeout = 60 * 1000)
   public void test() throws Exception {
     Connector c = getConnector();
@@ -54,16 +54,11 @@ public class MapReduceIT extends SimpleMacIT {
       bw.addMutation(m);
     }
     bw.close();
-    
-    Process hash = exec(RowHash.class, 
-        "-i", c.getInstance().getInstanceName(),
-        "-z", c.getInstance().getZooKeepers(),
-        "-u", "root",
-        "-p", ROOT_PASSWORD,
-        "-t", tablename,
-        "--column", input_cfcq);
+
+    Process hash = exec(RowHash.class, "-i", c.getInstance().getInstanceName(), "-z", c.getInstance().getZooKeepers(), "-u", "root", "-p", ROOT_PASSWORD, "-t",
+        tablename, "--column", input_cfcq);
     assertEquals(0, hash.waitFor());
-    
+
     Scanner s = c.createScanner(tablename, Authorizations.EMPTY);
     s.fetchColumn(new Text(input_cf), new Text(output_cq));
     int i = 0;
@@ -73,8 +68,7 @@ public class MapReduceIT extends SimpleMacIT {
       assertEquals(entry.getValue().toString(), new String(check));
       i++;
     }
-    
+
   }
 
-  
 }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/aa711023/test/src/test/java/org/apache/accumulo/test/functional/MergeIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/functional/MergeIT.java b/test/src/test/java/org/apache/accumulo/test/functional/MergeIT.java
index 2ae90ee..27b4f27 100644
--- a/test/src/test/java/org/apache/accumulo/test/functional/MergeIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/functional/MergeIT.java
@@ -39,18 +39,18 @@ import org.apache.hadoop.io.Text;
 import org.junit.Test;
 
 public class MergeIT extends SimpleMacIT {
-  
-  SortedSet<Text> splits(String [] points) {
+
+  SortedSet<Text> splits(String[] points) {
     SortedSet<Text> result = new TreeSet<Text>();
     for (String point : points)
       result.add(new Text(point));
     return result;
   }
-  
+
   @Test(timeout = 60 * 1000)
   public void merge() throws Exception {
     Connector c = getConnector();
-    String tableName = makeTableName();
+    String tableName = getTableNames(1)[0];
     c.tableOperations().create(tableName);
     c.tableOperations().addSplits(tableName, splits("a b c d e f g h i j k".split(" ")));
     BatchWriter bw = c.createBatchWriter(tableName, null);
@@ -64,11 +64,11 @@ public class MergeIT extends SimpleMacIT {
     c.tableOperations().merge(tableName, new Text("c1"), new Text("f1"));
     assertEquals(8, c.tableOperations().listSplits(tableName).size());
   }
-  
+
   @Test(timeout = 60 * 1000)
   public void mergeSize() throws Exception {
     Connector c = getConnector();
-    String tableName = makeTableName();
+    String tableName = getTableNames(1)[0];
     c.tableOperations().create(tableName);
     c.tableOperations().addSplits(tableName, splits("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".split(" ")));
     BatchWriter bw = c.createBatchWriter(tableName, null);
@@ -94,22 +94,22 @@ public class MergeIT extends SimpleMacIT {
     }
     return result;
   }
-  
+
   private String[] ns(String... strings) {
     return strings;
   }
-  
+
   @Test(timeout = 4 * 60 * 1000)
   public void mergeTest() throws Exception {
     int tc = 0;
     Connector c = getConnector();
-    String tableName = makeTableName();
+    String tableName = getTableNames(1)[0];
     runMergeTest(c, tableName + tc++, ns(), ns(), ns("l", "m", "n"), ns(null, "l"), ns(null, "n"));
-    
+
     runMergeTest(c, tableName + tc++, ns("m"), ns(), ns("l", "m", "n"), ns(null, "l"), ns(null, "n"));
     runMergeTest(c, tableName + tc++, ns("m"), ns("m"), ns("l", "m", "n"), ns("m", "n"), ns(null, "z"));
     runMergeTest(c, tableName + tc++, ns("m"), ns("m"), ns("l", "m", "n"), ns(null, "b"), ns("l", "m"));
-    
+
     runMergeTest(c, tableName + tc++, ns("b", "m", "r"), ns(), ns("a", "b", "c", "l", "m", "n", "q", "r", "s"), ns(null, "a"), ns(null, "s"));
     runMergeTest(c, tableName + tc++, ns("b", "m", "r"), ns("m", "r"), ns("a", "b", "c", "l", "m", "n", "q", "r", "s"), ns(null, "a"), ns("c", "m"));
     runMergeTest(c, tableName + tc++, ns("b", "m", "r"), ns("r"), ns("a", "b", "c", "l", "m", "n", "q", "r", "s"), ns(null, "a"), ns("n", "r"));
@@ -120,29 +120,31 @@ public class MergeIT extends SimpleMacIT {
     runMergeTest(c, tableName + tc++, ns("b", "m", "r"), ns("b", "m", "r"), ns("a", "b", "c", "l", "m", "n", "q", "r", "s"), ns("r", "s"), ns(null, "z"));
     runMergeTest(c, tableName + tc++, ns("b", "m", "r"), ns("b", "m", "r"), ns("a", "b", "c", "l", "m", "n", "q", "r", "s"), ns("b", "c"), ns("l", "m"));
     runMergeTest(c, tableName + tc++, ns("b", "m", "r"), ns("b", "m", "r"), ns("a", "b", "c", "l", "m", "n", "q", "r", "s"), ns("m", "n"), ns("q", "r"));
-    
+
   }
-  
-  private void runMergeTest(Connector c, String table, String[] splits, String[] expectedSplits, String[] inserts, String[] start, String[] end) throws Exception {
+
+  private void runMergeTest(Connector c, String table, String[] splits, String[] expectedSplits, String[] inserts, String[] start, String[] end)
+      throws Exception {
     int count = 0;
-    
+
     for (String s : start) {
       for (String e : end) {
         runMergeTest(c, table + "_" + count++, splits, expectedSplits, inserts, s, e);
       }
     }
   }
-  
-  private void runMergeTest(Connector conn, String table, String[] splits, String[] expectedSplits, String[] inserts, String start, String end) throws Exception {
+
+  private void runMergeTest(Connector conn, String table, String[] splits, String[] expectedSplits, String[] inserts, String start, String end)
+      throws Exception {
     System.out.println("Running merge test " + table + " " + Arrays.asList(splits) + " " + start + " " + end);
-    
+
     conn.tableOperations().create(table, true, TimeType.LOGICAL);
     TreeSet<Text> splitSet = new TreeSet<Text>();
     for (String split : splits) {
       splitSet.add(new Text(split));
     }
     conn.tableOperations().addSplits(table, splitSet);
-    
+
     BatchWriter bw = conn.createBatchWriter(table, null);
     HashSet<String> expected = new HashSet<String>();
     for (String row : inserts) {
@@ -151,13 +153,13 @@ public class MergeIT extends SimpleMacIT {
       bw.addMutation(m);
       expected.add(row);
     }
-    
+
     bw.close();
-    
+
     conn.tableOperations().merge(table, start == null ? null : new Text(start), end == null ? null : new Text(end));
-    
+
     Scanner scanner = conn.createScanner(table, Authorizations.EMPTY);
-    
+
     HashSet<String> observed = new HashSet<String>();
     for (Entry<Key,Value> entry : scanner) {
       String row = entry.getKey().getRowData().toString();
@@ -165,21 +167,21 @@ public class MergeIT extends SimpleMacIT {
         throw new Exception("Saw data twice " + table + " " + row);
       }
     }
-    
+
     if (!observed.equals(expected)) {
       throw new Exception("data inconsistency " + table + " " + observed + " != " + expected);
     }
-    
+
     HashSet<Text> currentSplits = new HashSet<Text>(conn.tableOperations().listSplits(table));
     HashSet<Text> ess = new HashSet<Text>();
     for (String es : expectedSplits) {
       ess.add(new Text(es));
     }
-    
+
     if (!currentSplits.equals(ess)) {
       throw new Exception("split inconsistency " + table + " " + currentSplits + " != " + ess);
     }
 
   }
-  
+
 }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/aa711023/test/src/test/java/org/apache/accumulo/test/functional/MetadataIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/functional/MetadataIT.java b/test/src/test/java/org/apache/accumulo/test/functional/MetadataIT.java
index aa5f8b0..92e0d44 100644
--- a/test/src/test/java/org/apache/accumulo/test/functional/MetadataIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/functional/MetadataIT.java
@@ -67,7 +67,7 @@ public class MetadataIT extends SimpleMacIT {
   @Test(timeout = 2 * 60 * 1000)
   public void batchScanTest() throws Exception {
     Connector c = getConnector();
-    String tableName = makeTableName();
+    String tableName = getTableNames(1)[0];
     c.tableOperations().create(tableName);
 
     // batch scan regular metadata table

http://git-wip-us.apache.org/repos/asf/accumulo/blob/aa711023/test/src/test/java/org/apache/accumulo/test/functional/NativeMapIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/functional/NativeMapIT.java b/test/src/test/java/org/apache/accumulo/test/functional/NativeMapIT.java
index b0b6344..32be35d 100644
--- a/test/src/test/java/org/apache/accumulo/test/functional/NativeMapIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/functional/NativeMapIT.java
@@ -20,11 +20,11 @@ import static org.junit.Assert.assertEquals;
 
 import org.junit.Test;
 
-public class NativeMapIT extends SimpleMacIT {
-  
+public class NativeMapIT extends ConfigurableMacIT {
+
   @Test(timeout = 15 * 1000)
   public void test() throws Exception {
     assertEquals(0, exec(NativeMapTest.class).waitFor());
   }
-  
+
 }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/aa711023/test/src/test/java/org/apache/accumulo/test/functional/PermissionsIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/functional/PermissionsIT.java b/test/src/test/java/org/apache/accumulo/test/functional/PermissionsIT.java
index 7c565f2..b8e1a4f 100644
--- a/test/src/test/java/org/apache/accumulo/test/functional/PermissionsIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/functional/PermissionsIT.java
@@ -51,12 +51,11 @@ import org.junit.Test;
 public class PermissionsIT extends SimpleMacIT {
 
   static AtomicInteger userId = new AtomicInteger(0);
-  
+
   static String makeUserName() {
     return "user_" + userId.getAndIncrement();
   }
-  
-  
+
   @Test(timeout = 60 * 1000)
   public void systemPermissionsTest() throws Exception {
     String testUser = makeUserName();
@@ -65,16 +64,16 @@ public class PermissionsIT extends SimpleMacIT {
     // verify that the test is being run by root
     Connector c = getConnector();
     verifyHasOnlyTheseSystemPermissions(c, c.whoami(), SystemPermission.values());
-    
+
     // create the test user
     c.securityOperations().createLocalUser(testUser, testPasswd);
     Connector test_user_conn = c.getInstance().getConnector(testUser, testPasswd);
     verifyHasNoSystemPermissions(c, testUser, SystemPermission.values());
-    
+
     // test each permission
     for (SystemPermission perm : SystemPermission.values()) {
       log.debug("Verifying the " + perm + " permission");
-      
+
       // verify GRANT can't be granted
       if (perm.equals(SystemPermission.GRANT)) {
         try {
@@ -85,17 +84,18 @@ public class PermissionsIT extends SimpleMacIT {
         }
         throw new IllegalStateException("Should NOT be able to grant GRANT");
       }
-      
+
       // test permission before and after granting it
-      testMissingSystemPermission(c, test_user_conn, perm);
+      String tableNamePrefix = getTableNames(1)[0];
+      testMissingSystemPermission(tableNamePrefix, c, test_user_conn, perm);
       c.securityOperations().grantSystemPermission(testUser, perm);
       verifyHasOnlyTheseSystemPermissions(c, testUser, perm);
-      testGrantedSystemPermission(c, test_user_conn, perm);
+      testGrantedSystemPermission(tableNamePrefix, c, test_user_conn, perm);
       c.securityOperations().revokeSystemPermission(testUser, perm);
       verifyHasNoSystemPermissions(c, testUser, perm);
     }
   }
-  
+
   static Map<String,String> map(Iterable<Entry<String,String>> i) {
     Map<String,String> result = new HashMap<String,String>();
     for (Entry<String,String> e : i) {
@@ -103,16 +103,16 @@ public class PermissionsIT extends SimpleMacIT {
     }
     return result;
   }
-  
-  private static void testMissingSystemPermission(Connector root_conn, Connector test_user_conn, SystemPermission perm) throws AccumuloException,
-      TableExistsException, AccumuloSecurityException, TableNotFoundException {
+
+  private static void testMissingSystemPermission(String tableNamePrefix, Connector root_conn, Connector test_user_conn, SystemPermission perm)
+      throws AccumuloException, TableExistsException, AccumuloSecurityException, TableNotFoundException {
     String tableName, user, password = "password";
     log.debug("Confirming that the lack of the " + perm + " permission properly restricts the user");
-    
+
     // test permission prior to granting it
     switch (perm) {
       case CREATE_TABLE:
-        tableName = makeTableName() + "__CREATE_TABLE_WITHOUT_PERM_TEST__";
+        tableName = tableNamePrefix + "__CREATE_TABLE_WITHOUT_PERM_TEST__";
         try {
           test_user_conn.tableOperations().create(tableName);
           throw new IllegalStateException("Should NOT be able to create a table");
@@ -122,7 +122,7 @@ public class PermissionsIT extends SimpleMacIT {
         }
         break;
       case DROP_TABLE:
-        tableName = makeTableName() + "__DROP_TABLE_WITHOUT_PERM_TEST__";
+        tableName = tableNamePrefix + "__DROP_TABLE_WITHOUT_PERM_TEST__";
         root_conn.tableOperations().create(tableName);
         try {
           test_user_conn.tableOperations().delete(tableName);
@@ -133,7 +133,7 @@ public class PermissionsIT extends SimpleMacIT {
         }
         break;
       case ALTER_TABLE:
-        tableName = makeTableName() + "__ALTER_TABLE_WITHOUT_PERM_TEST__";
+        tableName = tableNamePrefix + "__ALTER_TABLE_WITHOUT_PERM_TEST__";
         root_conn.tableOperations().create(tableName);
         try {
           test_user_conn.tableOperations().setProperty(tableName, Property.TABLE_BLOOM_ERRORRATE.getKey(), "003.14159%");
@@ -203,29 +203,29 @@ public class PermissionsIT extends SimpleMacIT {
         throw new IllegalArgumentException("Unrecognized System Permission: " + perm);
     }
   }
-  
-  private static void testGrantedSystemPermission(Connector root_conn, Connector test_user_conn, SystemPermission perm) throws AccumuloException,
-      AccumuloSecurityException, TableNotFoundException, TableExistsException {
+
+  private static void testGrantedSystemPermission(String tableNamePrefix, Connector root_conn, Connector test_user_conn, SystemPermission perm)
+      throws AccumuloException, AccumuloSecurityException, TableNotFoundException, TableExistsException {
     String tableName, user, password = "password";
     log.debug("Confirming that the presence of the " + perm + " permission properly permits the user");
-    
+
     // test permission after granting it
     switch (perm) {
       case CREATE_TABLE:
-        tableName = makeTableName() + "__CREATE_TABLE_WITH_PERM_TEST__";
+        tableName = tableNamePrefix + "__CREATE_TABLE_WITH_PERM_TEST__";
         test_user_conn.tableOperations().create(tableName);
         if (!root_conn.tableOperations().list().contains(tableName))
           throw new IllegalStateException("Should be able to create a table");
         break;
       case DROP_TABLE:
-        tableName = makeTableName() + "__DROP_TABLE_WITH_PERM_TEST__";
+        tableName = tableNamePrefix + "__DROP_TABLE_WITH_PERM_TEST__";
         root_conn.tableOperations().create(tableName);
         test_user_conn.tableOperations().delete(tableName);
         if (root_conn.tableOperations().list().contains(tableName))
           throw new IllegalStateException("Should be able to delete a table");
         break;
       case ALTER_TABLE:
-        tableName = makeTableName() + "__ALTER_TABLE_WITH_PERM_TEST__";
+        tableName = tableNamePrefix + "__ALTER_TABLE_WITH_PERM_TEST__";
         String table2 = tableName + "2";
         root_conn.tableOperations().create(tableName);
         test_user_conn.tableOperations().setProperty(tableName, Property.TABLE_BLOOM_ERRORRATE.getKey(), "003.14159%");
@@ -267,7 +267,7 @@ public class PermissionsIT extends SimpleMacIT {
         throw new IllegalArgumentException("Unrecognized System Permission: " + perm);
     }
   }
-  
+
   private static void verifyHasOnlyTheseSystemPermissions(Connector root_conn, String user, SystemPermission... perms) throws AccumuloException,
       AccumuloSecurityException {
     List<SystemPermission> permList = Arrays.asList(perms);
@@ -283,15 +283,14 @@ public class PermissionsIT extends SimpleMacIT {
       }
     }
   }
-  
+
   private static void verifyHasNoSystemPermissions(Connector root_conn, String user, SystemPermission... perms) throws AccumuloException,
       AccumuloSecurityException {
     for (SystemPermission p : perms)
       if (root_conn.securityOperations().hasSystemPermission(user, p))
         throw new IllegalStateException(user + " SHOULD NOT have system permission " + p);
   }
-  
-  
+
   @Test(timeout = 30 * 1000)
   public void tablePermissionTest() throws Exception {
     // create the test user
@@ -301,29 +300,29 @@ public class PermissionsIT extends SimpleMacIT {
     Connector c = getConnector();
     c.securityOperations().createLocalUser(testUser, testPasswd);
     Connector test_user_conn = c.getInstance().getConnector(testUser, testPasswd);
-    
+
     // check for read-only access to metadata table
     verifyHasOnlyTheseTablePermissions(c, c.whoami(), MetadataTable.NAME, TablePermission.READ, TablePermission.ALTER_TABLE);
     verifyHasOnlyTheseTablePermissions(c, testUser, MetadataTable.NAME, TablePermission.READ);
-    String tableName = makeTableName() + "__TABLE_PERMISSION_TEST__";
-      
+    String tableName = getTableNames(1)[0] + "__TABLE_PERMISSION_TEST__";
+
     // test each permission
     for (TablePermission perm : TablePermission.values()) {
       log.debug("Verifying the " + perm + " permission");
-      
+
       // test permission before and after granting it
       createTestTable(c, testUser, tableName);
       testMissingTablePermission(c, test_user_conn, perm, tableName);
       c.securityOperations().grantTablePermission(testUser, tableName, perm);
       verifyHasOnlyTheseTablePermissions(c, testUser, tableName, perm);
       testGrantedTablePermission(c, test_user_conn, perm, tableName);
-      
+
       createTestTable(c, testUser, tableName);
       c.securityOperations().revokeTablePermission(testUser, tableName, perm);
       verifyHasNoTablePermissions(c, testUser, tableName, perm);
     }
   }
-  
+
   private void createTestTable(Connector c, String testUser, String tableName) throws Exception, MutationsRejectedException {
     if (!c.tableOperations().exists(tableName)) {
       // create the test table
@@ -334,20 +333,20 @@ public class PermissionsIT extends SimpleMacIT {
       m.put(new Text("cf"), new Text("cq"), new Value("val".getBytes()));
       writer.addMutation(m);
       writer.close();
-      
+
       // verify proper permissions for creator and test user
       verifyHasOnlyTheseTablePermissions(c, c.whoami(), tableName, TablePermission.values());
       verifyHasNoTablePermissions(c, testUser, tableName, TablePermission.values());
-      
+
     }
   }
-  
+
   private static void testMissingTablePermission(Connector root_conn, Connector test_user_conn, TablePermission perm, String tableName) throws Exception {
     Scanner scanner;
     BatchWriter writer;
     Mutation m;
     log.debug("Confirming that the lack of the " + perm + " permission properly restricts the user");
-    
+
     // test permission prior to granting it
     switch (perm) {
       case READ:
@@ -418,14 +417,14 @@ public class PermissionsIT extends SimpleMacIT {
         throw new IllegalArgumentException("Unrecognized table Permission: " + perm);
     }
   }
-  
-  private static void testGrantedTablePermission(Connector root_conn, Connector test_user_conn, TablePermission perm, String tableName) throws AccumuloException,
-      TableExistsException, AccumuloSecurityException, TableNotFoundException, MutationsRejectedException {
+
+  private static void testGrantedTablePermission(Connector root_conn, Connector test_user_conn, TablePermission perm, String tableName)
+      throws AccumuloException, TableExistsException, AccumuloSecurityException, TableNotFoundException, MutationsRejectedException {
     Scanner scanner;
     BatchWriter writer;
     Mutation m;
     log.debug("Confirming that the presence of the " + perm + " permission properly permits the user");
-    
+
     // test permission after granting it
     switch (perm) {
       case READ:
@@ -458,7 +457,7 @@ public class PermissionsIT extends SimpleMacIT {
         throw new IllegalArgumentException("Unrecognized table Permission: " + perm);
     }
   }
-  
+
   private static void verifyHasOnlyTheseTablePermissions(Connector root_conn, String user, String table, TablePermission... perms) throws AccumuloException,
       AccumuloSecurityException {
     List<TablePermission> permList = Arrays.asList(perms);
@@ -474,7 +473,7 @@ public class PermissionsIT extends SimpleMacIT {
       }
     }
   }
-  
+
   private static void verifyHasNoTablePermissions(Connector root_conn, String user, String table, TablePermission... perms) throws AccumuloException,
       AccumuloSecurityException {
     for (TablePermission p : perms)

http://git-wip-us.apache.org/repos/asf/accumulo/blob/aa711023/test/src/test/java/org/apache/accumulo/test/functional/RenameIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/functional/RenameIT.java b/test/src/test/java/org/apache/accumulo/test/functional/RenameIT.java
index ff8d894..78b0537 100644
--- a/test/src/test/java/org/apache/accumulo/test/functional/RenameIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/functional/RenameIT.java
@@ -24,11 +24,12 @@ import org.apache.accumulo.test.VerifyIngest;
 import org.junit.Test;
 
 public class RenameIT extends SimpleMacIT {
-  
+
   @Test(timeout = 2 * 60 * 1000)
   public void renameTest() throws Exception {
-    String name1 = makeTableName();
-    String name2 = makeTableName();
+    String[] tableNames = getTableNames(2);
+    String name1 = tableNames[0];
+    String name2 = tableNames[1];
     BatchWriterOpts bwOpts = new BatchWriterOpts();
     ScannerOpts scanOpts = new ScannerOpts();
     TestIngest.Opts opts = new TestIngest.Opts();
@@ -46,5 +47,5 @@ public class RenameIT extends SimpleMacIT {
     vopts.tableName = name1;
     VerifyIngest.verifyIngest(c, vopts, scanOpts);
   }
-  
+
 }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/aa711023/test/src/test/java/org/apache/accumulo/test/functional/ScanIteratorIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/functional/ScanIteratorIT.java b/test/src/test/java/org/apache/accumulo/test/functional/ScanIteratorIT.java
index aa014c7..3264bd1 100644
--- a/test/src/test/java/org/apache/accumulo/test/functional/ScanIteratorIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/functional/ScanIteratorIT.java
@@ -37,36 +37,36 @@ import org.apache.hadoop.io.Text;
 import org.junit.Test;
 
 public class ScanIteratorIT extends SimpleMacIT {
-  
+
   @Test(timeout = 30 * 1000)
   public void run() throws Exception {
-    String tableName = makeTableName();
+    String tableName = getTableNames(1)[0];
     Connector c = getConnector();
     c.tableOperations().create(tableName);
-    
+
     BatchWriter bw = c.createBatchWriter(tableName, new BatchWriterConfig());
-    
+
     for (int i = 0; i < 1000; i++) {
       Mutation m = new Mutation(new Text(String.format("%06d", i)));
       m.put(new Text("cf1"), new Text("cq1"), new Value(("" + (1000 - i)).getBytes()));
       m.put(new Text("cf1"), new Text("cq2"), new Value(("" + (i - 1000)).getBytes()));
-      
+
       bw.addMutation(m);
     }
-    
+
     bw.close();
-    
+
     Scanner scanner = c.createScanner(tableName, new Authorizations());
-    
+
     setupIter(scanner);
     verify(scanner, 1, 999);
-    
+
     BatchScanner bscanner = c.createBatchScanner(tableName, new Authorizations(), 3);
     bscanner.setRanges(Collections.singleton(new Range((Key) null, null)));
-    
+
     setupIter(bscanner);
     verify(bscanner, 1, 999);
-    
+
     ArrayList<Range> ranges = new ArrayList<Range>();
     ranges.add(new Range(new Text(String.format("%06d", 1))));
     ranges.add(new Range(new Text(String.format("%06d", 6)), new Text(String.format("%06d", 16))));
@@ -75,52 +75,52 @@ public class ScanIteratorIT extends SimpleMacIT {
     ranges.add(new Range(new Text(String.format("%06d", 56)), new Text(String.format("%06d", 61))));
     ranges.add(new Range(new Text(String.format("%06d", 501)), new Text(String.format("%06d", 504))));
     ranges.add(new Range(new Text(String.format("%06d", 998)), new Text(String.format("%06d", 1000))));
-    
+
     HashSet<Integer> got = new HashSet<Integer>();
     HashSet<Integer> expected = new HashSet<Integer>();
     for (int i : new int[] {1, 7, 9, 11, 13, 15, 23, 57, 59, 61, 501, 503, 999}) {
       expected.add(i);
     }
-    
+
     bscanner.setRanges(ranges);
-    
+
     for (Entry<Key,Value> entry : bscanner) {
       got.add(Integer.parseInt(entry.getKey().getRow().toString()));
     }
-    
+
     System.out.println("got : " + got);
-    
+
     if (!got.equals(expected)) {
       throw new Exception(got + " != " + expected);
     }
-    
+
     bscanner.close();
-    
+
   }
-  
+
   private void verify(Iterable<Entry<Key,Value>> scanner, int start, int finish) throws Exception {
-    
+
     int expected = start;
     for (Entry<Key,Value> entry : scanner) {
       if (Integer.parseInt(entry.getKey().getRow().toString()) != expected) {
         throw new Exception("Saw unexpexted " + entry.getKey().getRow() + " " + expected);
       }
-      
+
       if (entry.getKey().getColumnQualifier().toString().equals("cq2")) {
         expected += 2;
       }
     }
-    
+
     if (expected != finish + 2) {
       throw new Exception("Ended at " + expected + " not " + (finish + 2));
     }
   }
-  
+
   private void setupIter(ScannerBase scanner) throws Exception {
     IteratorSetting dropMod = new IteratorSetting(50, "dropMod", "org.apache.accumulo.test.functional.DropModIter");
     dropMod.addOption("mod", "2");
     dropMod.addOption("drop", "0");
     scanner.addScanIterator(dropMod);
   }
-  
+
 }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/aa711023/test/src/test/java/org/apache/accumulo/test/functional/ScanRangeIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/functional/ScanRangeIT.java b/test/src/test/java/org/apache/accumulo/test/functional/ScanRangeIT.java
index 8a42740..e034740 100644
--- a/test/src/test/java/org/apache/accumulo/test/functional/ScanRangeIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/functional/ScanRangeIT.java
@@ -32,95 +32,96 @@ import org.apache.hadoop.io.Text;
 import org.junit.Test;
 
 public class ScanRangeIT extends SimpleMacIT {
-  
+
   private static final int TS_LIMIT = 1;
   private static final int CQ_LIMIT = 5;
   private static final int CF_LIMIT = 5;
   private static final int ROW_LIMIT = 100;
-  
+
   @Test(timeout = 2 * 60 * 1000)
   public void run() throws Exception {
     Connector c = getConnector();
-    String table1 = makeTableName();
+    String[] tableNames = getTableNames(2);
+    String table1 = tableNames[0];
     c.tableOperations().create(table1);
-    String table2 = makeTableName();
+    String table2 = tableNames[1];
     c.tableOperations().create(table2);
     TreeSet<Text> splitRows = new TreeSet<Text>();
     int splits = 3;
     for (int i = (ROW_LIMIT / splits); i < ROW_LIMIT; i += (ROW_LIMIT / splits))
       splitRows.add(createRow(i));
     c.tableOperations().addSplits(table2, splitRows);
-    
+
     insertData(c, table1);
     scanTable(c, table1);
-    
+
     insertData(c, table2);
     scanTable(c, table2);
   }
-  
+
   private void scanTable(Connector c, String table) throws Exception {
     scanRange(c, table, new IntKey(0, 0, 0, 0), new IntKey(1, 0, 0, 0));
-    
+
     scanRange(c, table, new IntKey(0, 0, 0, 0), new IntKey(ROW_LIMIT - 1, CF_LIMIT - 1, CQ_LIMIT - 1, 0));
-    
+
     scanRange(c, table, null, null);
-    
+
     for (int i = 0; i < ROW_LIMIT; i += (ROW_LIMIT / 3)) {
       for (int j = 0; j < CF_LIMIT; j += (CF_LIMIT / 2)) {
         for (int k = 1; k < CQ_LIMIT; k += (CQ_LIMIT / 2)) {
           scanRange(c, table, null, new IntKey(i, j, k, 0));
           scanRange(c, table, new IntKey(0, 0, 0, 0), new IntKey(i, j, k, 0));
-          
+
           scanRange(c, table, new IntKey(i, j, k, 0), new IntKey(ROW_LIMIT - 1, CF_LIMIT - 1, CQ_LIMIT - 1, 0));
-          
+
           scanRange(c, table, new IntKey(i, j, k, 0), null);
-          
+
         }
       }
     }
-    
+
     for (int i = 0; i < ROW_LIMIT; i++) {
       scanRange(c, table, new IntKey(i, 0, 0, 0), new IntKey(i, CF_LIMIT - 1, CQ_LIMIT - 1, 0));
-      
+
       if (i > 0 && i < ROW_LIMIT - 1) {
         scanRange(c, table, new IntKey(i - 1, 0, 0, 0), new IntKey(i + 1, CF_LIMIT - 1, CQ_LIMIT - 1, 0));
       }
     }
-    
+
   }
-  
+
   private static class IntKey {
     private int row;
     private int cf;
     private int cq;
     private long ts;
-    
+
     IntKey(IntKey ik) {
       this.row = ik.row;
       this.cf = ik.cf;
       this.cq = ik.cq;
       this.ts = ik.ts;
     }
-    
+
     IntKey(int row, int cf, int cq, long ts) {
       this.row = row;
       this.cf = cf;
       this.cq = cq;
       this.ts = ts;
     }
-    
+
     Key createKey() {
       Text trow = createRow(row);
       Text tcf = createCF(cf);
       Text tcq = createCQ(cq);
-      
+
       return new Key(trow, tcf, tcq, ts);
     }
-    
+
     IntKey increment() {
-      
+
       IntKey ik = new IntKey(this);
-      
+
       ik.ts++;
       if (ik.ts >= TS_LIMIT) {
         ik.ts = 0;
@@ -134,91 +135,91 @@ public class ScanRangeIT extends SimpleMacIT {
           }
         }
       }
-      
+
       return ik;
     }
-    
+
   }
-  
+
   private void scanRange(Connector c, String table, IntKey ik1, IntKey ik2) throws Exception {
     scanRange(c, table, ik1, false, ik2, false);
     scanRange(c, table, ik1, false, ik2, true);
     scanRange(c, table, ik1, true, ik2, false);
     scanRange(c, table, ik1, true, ik2, true);
   }
-  
+
   private void scanRange(Connector c, String table, IntKey ik1, boolean inclusive1, IntKey ik2, boolean inclusive2) throws Exception {
     Scanner scanner = c.createScanner(table, Authorizations.EMPTY);
-    
+
     Key key1 = null;
     Key key2 = null;
-    
+
     IntKey expectedIntKey;
     IntKey expectedEndIntKey;
-    
+
     if (ik1 != null) {
       key1 = ik1.createKey();
       expectedIntKey = ik1;
-      
+
       if (!inclusive1) {
         expectedIntKey = expectedIntKey.increment();
       }
     } else {
       expectedIntKey = new IntKey(0, 0, 0, 0);
     }
-    
+
     if (ik2 != null) {
       key2 = ik2.createKey();
       expectedEndIntKey = ik2;
-      
+
       if (inclusive2) {
         expectedEndIntKey = expectedEndIntKey.increment();
       }
     } else {
       expectedEndIntKey = new IntKey(ROW_LIMIT, 0, 0, 0);
     }
-    
+
     Range range = new Range(key1, inclusive1, key2, inclusive2);
-    
+
     scanner.setRange(range);
-    
+
     for (Entry<Key,Value> entry : scanner) {
-      
+
       Key expectedKey = expectedIntKey.createKey();
       if (!expectedKey.equals(entry.getKey())) {
         throw new Exception(" " + expectedKey + " != " + entry.getKey());
       }
-      
+
       expectedIntKey = expectedIntKey.increment();
     }
-    
+
     if (!expectedIntKey.createKey().equals(expectedEndIntKey.createKey())) {
       throw new Exception(" " + expectedIntKey.createKey() + " != " + expectedEndIntKey.createKey());
     }
   }
-  
+
   private static Text createCF(int cf) {
     Text tcf = new Text(String.format("cf_%03d", cf));
     return tcf;
   }
-  
+
   private static Text createCQ(int cf) {
     Text tcf = new Text(String.format("cq_%03d", cf));
     return tcf;
   }
-  
+
   private static Text createRow(int row) {
     Text trow = new Text(String.format("r_%06d", row));
     return trow;
   }
-  
+
   private void insertData(Connector c, String table) throws Exception {
-    
+
     BatchWriter bw = c.createBatchWriter(table, new BatchWriterConfig());
-    
+
     for (int i = 0; i < ROW_LIMIT; i++) {
       Mutation m = new Mutation(createRow(i));
-      
+
       for (int j = 0; j < CF_LIMIT; j++) {
         for (int k = 0; k < CQ_LIMIT; k++) {
           for (int t = 0; t < TS_LIMIT; t++) {
@@ -226,10 +227,10 @@ public class ScanRangeIT extends SimpleMacIT {
           }
         }
       }
-      
+
       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/ServerSideErrorIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/functional/ServerSideErrorIT.java b/test/src/test/java/org/apache/accumulo/test/functional/ServerSideErrorIT.java
index a9fa847..cf7726e 100644
--- a/test/src/test/java/org/apache/accumulo/test/functional/ServerSideErrorIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/functional/ServerSideErrorIT.java
@@ -37,28 +37,28 @@ import org.apache.hadoop.io.Text;
 import org.junit.Test;
 
 public class ServerSideErrorIT extends SimpleMacIT {
-  
+
   @Test(timeout = 2 * 60 * 1000)
   public void run() throws Exception {
     Connector c = getConnector();
-    String tableName = makeTableName();
+    String tableName = getTableNames(1)[0];
     c.tableOperations().create(tableName);
     IteratorSetting is = new IteratorSetting(5, "Bad Aggregator", BadCombiner.class);
     Combiner.setColumns(is, Collections.singletonList(new IteratorSetting.Column("acf")));
     c.tableOperations().attachIterator(tableName, is);
-    
+
     BatchWriter bw = c.createBatchWriter(tableName, new BatchWriterConfig());
-    
+
     Mutation m = new Mutation(new Text("r1"));
     m.put(new Text("acf"), new Text("foo"), new Value("1".getBytes()));
-    
+
     bw.addMutation(m);
-    
+
     bw.close();
-    
+
     // try to scan table
     Scanner scanner = c.createScanner(tableName, Authorizations.EMPTY);
-    
+
     boolean caught = false;
     try {
       for (Entry<Key,Value> entry : scanner) {
@@ -67,14 +67,14 @@ public class ServerSideErrorIT extends SimpleMacIT {
     } catch (Exception e) {
       caught = true;
     }
-    
+
     if (!caught)
       throw new Exception("Scan did not fail");
-    
+
     // try to batch scan the table
     BatchScanner bs = c.createBatchScanner(tableName, Authorizations.EMPTY, 2);
     bs.setRanges(Collections.singleton(new Range()));
-    
+
     caught = false;
     try {
       for (Entry<Key,Value> entry : bs) {
@@ -85,27 +85,27 @@ public class ServerSideErrorIT extends SimpleMacIT {
     } finally {
       bs.close();
     }
-    
+
     if (!caught)
       throw new Exception("batch scan did not fail");
-    
+
     // remove the bad agg so accumulo can shutdown
     TableOperations to = c.tableOperations();
     for (Entry<String,String> e : to.getProperties(tableName)) {
       to.removeProperty(tableName, e.getKey());
     }
-    
+
     UtilWaitThread.sleep(500);
-    
+
     // should be able to scan now
     scanner = c.createScanner(tableName, Authorizations.EMPTY);
     for (Entry<Key,Value> entry : scanner) {
       entry.getKey();
     }
-    
+
     // set a non existant iterator, should cause scan to fail on server side
     scanner.addScanIterator(new IteratorSetting(100, "bogus", "com.bogus.iterator"));
-    
+
     caught = false;
     try {
       for (Entry<Key,Value> entry : scanner) {
@@ -115,7 +115,7 @@ public class ServerSideErrorIT extends SimpleMacIT {
     } catch (Exception e) {
       caught = true;
     }
-    
+
     if (!caught)
       throw new Exception("Scan did not fail");
   }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/aa711023/test/src/test/java/org/apache/accumulo/test/functional/SimpleMacIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/functional/SimpleMacIT.java b/test/src/test/java/org/apache/accumulo/test/functional/SimpleMacIT.java
index 4a37d82..9086f13 100644
--- a/test/src/test/java/org/apache/accumulo/test/functional/SimpleMacIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/functional/SimpleMacIT.java
@@ -16,44 +16,61 @@
  */
 package org.apache.accumulo.test.functional;
 
+import java.io.File;
+
+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.security.tokens.PasswordToken;
 import org.apache.accumulo.minicluster.MiniAccumuloCluster;
 import org.apache.accumulo.minicluster.MiniAccumuloConfig;
+import org.apache.accumulo.minicluster.MiniAccumuloInstance;
 import org.apache.log4j.Logger;
-import org.junit.After;
-import org.junit.AfterClass;
 import org.junit.BeforeClass;
-import org.junit.rules.TemporaryFolder;
 
 public class SimpleMacIT extends AbstractMacIT {
   public static final Logger log = Logger.getLogger(SimpleMacIT.class);
-  
-  static private TemporaryFolder folder = new TemporaryFolder();
-  static private MiniAccumuloCluster cluster;
-  
+
+  private static File folder;
+  private static MiniAccumuloCluster cluster = null;
+
   @BeforeClass
-  synchronized public static void setUp() throws Exception {
-    if (cluster == null) {
-      folder.create();
-      MiniAccumuloConfig cfg = new MiniAccumuloConfig(folder.newFolder("mac"), ROOT_PASSWORD);
+  public static synchronized void setUp() throws Exception {
+    if (getInstanceOneConnector() == null && cluster == null) {
+      folder = createSharedTestDir(SimpleMacIT.class.getName());
+      MiniAccumuloConfig cfg = new MiniAccumuloConfig(folder, ROOT_PASSWORD);
       cluster = new MiniAccumuloCluster(cfg);
       cluster.start();
       Runtime.getRuntime().addShutdownHook(new Thread() {
         @Override
         public void run() {
-          cleanUp(cluster, folder);
+          cleanUp(cluster);
         }
       });
     }
   }
-  
+
+  @Override
+  public Connector getConnector() throws AccumuloException, AccumuloSecurityException {
+    Connector conn = getInstanceOneConnector();
+    return conn == null ? cluster.getConnector("root", ROOT_PASSWORD) : conn;
+  }
+
   @Override
-  public MiniAccumuloCluster getCluster() {
-    return cluster;
+  public String rootPath() {
+    return (getInstanceOneConnector() == null ? cluster.getConfig().getDir() : getInstanceOnePath()).getAbsolutePath();
   }
-  
-  @After
-  public void cleanUp() throws Exception {}
-  
-  @AfterClass
-  public static void tearDown() throws Exception {}
+
+  private static Connector getInstanceOneConnector() {
+    try {
+      return new MiniAccumuloInstance("instance1", getInstanceOnePath()).getConnector("root", new PasswordToken(ROOT_PASSWORD));
+    } catch (Exception e) {
+      return null;
+    }
+  }
+
+  private static File getInstanceOnePath() {
+    return new File(System.getProperty("user.dir") + "/accumulo-maven-plugin/instance1");
+  }
+
 }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/aa711023/test/src/test/java/org/apache/accumulo/test/functional/SparseColumnFamilyIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/functional/SparseColumnFamilyIT.java b/test/src/test/java/org/apache/accumulo/test/functional/SparseColumnFamilyIT.java
index c45a6a3..47db29a 100644
--- a/test/src/test/java/org/apache/accumulo/test/functional/SparseColumnFamilyIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/functional/SparseColumnFamilyIT.java
@@ -35,45 +35,45 @@ import org.junit.Test;
  * This test recreates issue ACCUMULO-516. Until that issue is fixed this test should time out.
  */
 public class SparseColumnFamilyIT extends SimpleMacIT {
-  
+
   @Test(timeout = 60 * 1000)
   public void sparceColumnFamily() throws Exception {
-    String scftt = makeTableName();
+    String scftt = getTableNames(1)[0];
     Connector c = getConnector();
     c.tableOperations().create(scftt);
-    
+
     BatchWriter bw = c.createBatchWriter(scftt, new BatchWriterConfig());
-    
+
     // create file in the tablet that has mostly column family 0, with a few entries for column family 1
-    
+
     bw.addMutation(nm(0, 1, 0));
     for (int i = 1; i < 99999; i++) {
       bw.addMutation(nm(i * 2, 0, i));
     }
     bw.addMutation(nm(99999 * 2, 1, 99999));
     bw.flush();
-    
+
     c.tableOperations().flush(scftt, null, null, true);
-    
+
     // create a file that has column family 1 and 0 interleaved
     for (int i = 0; i < 100000; i++) {
       bw.addMutation(nm(i * 2 + 1, i % 2 == 0 ? 0 : 1, i));
     }
     bw.close();
-    
+
     c.tableOperations().flush(scftt, null, null, true);
-    
+
     Scanner scanner = c.createScanner(scftt, Authorizations.EMPTY);
-    
+
     for (int i = 0; i < 200; i++) {
-      
+
       // every time we search for column family 1, it will scan the entire file
       // that has mostly column family 0 until the bug is fixed
       scanner.setRange(new Range(String.format("%06d", i), null));
       scanner.clearColumns();
       scanner.setBatchSize(3);
       scanner.fetchColumnFamily(new Text(String.format("%03d", 1)));
-      
+
       Iterator<Entry<Key,Value>> iter = scanner.iterator();
       if (iter.hasNext()) {
         Entry<Key,Value> entry = iter.next();
@@ -83,7 +83,7 @@ public class SparseColumnFamilyIT extends SimpleMacIT {
       }
     }
   }
-  
+
   /**
    * @param i
    * @param j

http://git-wip-us.apache.org/repos/asf/accumulo/blob/aa711023/test/src/test/java/org/apache/accumulo/test/functional/SplitRecoveryIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/functional/SplitRecoveryIT.java b/test/src/test/java/org/apache/accumulo/test/functional/SplitRecoveryIT.java
index 69f2808..4d97886 100644
--- a/test/src/test/java/org/apache/accumulo/test/functional/SplitRecoveryIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/functional/SplitRecoveryIT.java
@@ -20,11 +20,11 @@ import static org.junit.Assert.assertEquals;
 
 import org.junit.Test;
 
-public class SplitRecoveryIT extends SimpleMacIT {
-  
+public class SplitRecoveryIT extends ConfigurableMacIT {
+
   @Test(timeout = 10 * 1000)
   public void test() throws Exception {
     assertEquals(0, exec(SplitRecoveryTest.class).waitFor());
   }
-  
+
 }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/aa711023/test/src/test/java/org/apache/accumulo/test/functional/StartIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/functional/StartIT.java b/test/src/test/java/org/apache/accumulo/test/functional/StartIT.java
index eeec941..8162f71 100644
--- a/test/src/test/java/org/apache/accumulo/test/functional/StartIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/functional/StartIT.java
@@ -16,18 +16,19 @@
  */
 package org.apache.accumulo.test.functional;
 
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
 
 import org.apache.accumulo.start.TestMain;
 import org.junit.Test;
 
-public class StartIT extends SimpleMacIT {
-  
+public class StartIT extends ConfigurableMacIT {
+
   @Test(timeout = 10 * 1000)
   public void test() throws Exception {
     assertTrue(exec(TestMain.class, "exception").waitFor() != 0);
     assertEquals(0, exec(TestMain.class, "success").waitFor());
     assertTrue(exec(TestMain.class).waitFor() != 0);
   }
-  
+
 }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/aa711023/test/src/test/java/org/apache/accumulo/test/functional/TableIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/functional/TableIT.java b/test/src/test/java/org/apache/accumulo/test/functional/TableIT.java
index c3f8073..a9e78f8 100644
--- a/test/src/test/java/org/apache/accumulo/test/functional/TableIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/functional/TableIT.java
@@ -43,12 +43,12 @@ import org.apache.hadoop.io.Text;
 import org.junit.Test;
 
 public class TableIT extends SimpleMacIT {
-  
+
   @Test(timeout = 2 * 60 * 1000)
   public void test() throws Exception {
     Connector c = getConnector();
     TableOperations to = c.tableOperations();
-    String tableName = makeTableName();
+    String tableName = getTableNames(1)[0];
     to.create(tableName);
     TestIngest.Opts opts = new TestIngest.Opts();
     opts.tableName = tableName;
@@ -87,5 +87,5 @@ public class TableIT extends SimpleMacIT {
     VerifyIngest.verifyIngest(c, vopts, new ScannerOpts());
     to.delete(tableName);
   }
-  
+
 }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/aa711023/test/src/test/java/org/apache/accumulo/test/functional/TimeoutIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/functional/TimeoutIT.java b/test/src/test/java/org/apache/accumulo/test/functional/TimeoutIT.java
index 4bae35c..505d69b 100644
--- a/test/src/test/java/org/apache/accumulo/test/functional/TimeoutIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/functional/TimeoutIT.java
@@ -41,27 +41,27 @@ import org.junit.Test;
  * 
  */
 public class TimeoutIT extends SimpleMacIT {
-  
+
   @Test(timeout = 60 * 1000)
   public void run() throws Exception {
     Connector conn = getConnector();
-    testBatchWriterTimeout(conn);
-    testBatchScannerTimeout(conn);
+    String[] tableNames = getTableNames(2);
+    testBatchWriterTimeout(conn, tableNames[0]);
+    testBatchScannerTimeout(conn, tableNames[1]);
   }
-  
-  public void testBatchWriterTimeout(Connector conn) throws Exception {
-    String tableName = makeTableName();
+
+  public void testBatchWriterTimeout(Connector conn, String tableName) throws Exception {
     conn.tableOperations().create(tableName);
     conn.tableOperations().addConstraint(tableName, SlowConstraint.class.getName());
-    
+
     // give constraint time to propagate through zookeeper
     UtilWaitThread.sleep(1000);
-    
+
     BatchWriter bw = conn.createBatchWriter(tableName, new BatchWriterConfig().setTimeout(3, TimeUnit.SECONDS));
-    
+
     Mutation mut = new Mutation("r1");
     mut.put("cf1", "cq1", "v1");
-    
+
     bw.addMutation(mut);
     try {
       bw.close();
@@ -72,35 +72,34 @@ public class TimeoutIT extends SimpleMacIT {
       throw mre;
     }
   }
-  
-  public void testBatchScannerTimeout(Connector conn) throws Exception {
-    String tableName = makeTableName();
+
+  public void testBatchScannerTimeout(Connector conn, String tableName) throws Exception {
     getConnector().tableOperations().create(tableName);
-    
+
     BatchWriter bw = getConnector().createBatchWriter(tableName, new BatchWriterConfig());
-    
+
     Mutation m = new Mutation("r1");
     m.put("cf1", "cq1", "v1");
     m.put("cf1", "cq2", "v2");
     m.put("cf1", "cq3", "v3");
     m.put("cf1", "cq4", "v4");
-    
+
     bw.addMutation(m);
     bw.close();
-    
+
     BatchScanner bs = getConnector().createBatchScanner(tableName, Authorizations.EMPTY, 2);
     bs.setRanges(Collections.singletonList(new Range()));
-    
+
     // should not timeout
     for (Entry<Key,Value> entry : bs) {
       entry.getKey();
     }
-    
+
     bs.setTimeout(5, TimeUnit.SECONDS);
     IteratorSetting iterSetting = new IteratorSetting(100, SlowIterator.class);
     iterSetting.addOption("sleepTime", 2000 + "");
     bs.addScanIterator(iterSetting);
-    
+
     try {
       for (Entry<Key,Value> entry : bs) {
         entry.getKey();
@@ -111,5 +110,5 @@ public class TimeoutIT extends SimpleMacIT {
     }
     bs.close();
   }
-  
+
 }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/aa711023/test/src/test/java/org/apache/accumulo/test/functional/VisibilityIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/functional/VisibilityIT.java b/test/src/test/java/org/apache/accumulo/test/functional/VisibilityIT.java
index bde7883..3252dec 100644
--- a/test/src/test/java/org/apache/accumulo/test/functional/VisibilityIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/functional/VisibilityIT.java
@@ -45,50 +45,51 @@ import org.apache.hadoop.io.Text;
 import org.junit.Test;
 
 public class VisibilityIT extends SimpleMacIT {
-  
+
   @Test(timeout = 2 * 60 * 1000)
   public void run() throws Exception {
     Connector c = getConnector();
-    String table = makeTableName();
+    String[] tableNames = getTableNames(2);
+    String table = tableNames[0];
     c.tableOperations().create(table);
-    String table2 = makeTableName();
+    String table2 = tableNames[1];
     c.tableOperations().create(table2);
     c.tableOperations().setProperty(table2, Property.TABLE_DEFAULT_SCANTIME_VISIBILITY.getKey(), "DEFLABEL");
-    
+
     insertData(c, table);
     queryData(c, table);
     deleteData(c, table);
-    
+
     insertDefaultData(c, table2);
     queryDefaultData(c, table2);
-    
+
   }
-  
+
   private static SortedSet<String> nss(String... labels) {
     TreeSet<String> ts = new TreeSet<String>();
-    
+
     for (String s : labels) {
       ts.add(s);
     }
-    
+
     return ts;
   }
-  
+
   private void mput(Mutation m, String cf, String cq, String cv, String val) {
     ColumnVisibility le = new ColumnVisibility(cv.getBytes());
     m.put(new Text(cf), new Text(cq), le, new Value(val.getBytes()));
   }
-  
+
   private void mputDelete(Mutation m, String cf, String cq, String cv) {
     ColumnVisibility le = new ColumnVisibility(cv.getBytes());
     m.putDelete(new Text(cf), new Text(cq), le);
   }
-  
+
   private void insertData(Connector c, String tableName) throws Exception {
-    
+
     BatchWriter bw = c.createBatchWriter(tableName, new BatchWriterConfig());
     Mutation m1 = new Mutation(new Text("row1"));
-    
+
     mput(m1, "cf1", "cq1", "", "v1");
     mput(m1, "cf1", "cq1", "A", "v2");
     mput(m1, "cf1", "cq1", "B", "v3");
@@ -102,16 +103,16 @@ public class VisibilityIT extends SimpleMacIT {
     mput(m1, "cf1", "cq1", "FOO", "v11");
     mput(m1, "cf1", "cq1", "(A|B)&FOO&(L|M)", "v12");
     mput(m1, "cf1", "cq1", "A&B&(L|M|FOO)", "v13");
-    
+
     bw.addMutation(m1);
     bw.close();
   }
-  
+
   private void deleteData(Connector c, String tableName) throws Exception {
-    
+
     BatchWriter bw = c.createBatchWriter(tableName, new BatchWriterConfig());
     Mutation m1 = new Mutation(new Text("row1"));
-    
+
     mputDelete(m1, "cf1", "cq1", "");
     mputDelete(m1, "cf1", "cq1", "A");
     mputDelete(m1, "cf1", "cq1", "A&B");
@@ -120,12 +121,12 @@ public class VisibilityIT extends SimpleMacIT {
     mputDelete(m1, "cf1", "cq1", "A&FOO&(L|M)");
     mputDelete(m1, "cf1", "cq1", "(A|B)&FOO&(L|M)");
     mputDelete(m1, "cf1", "cq1", "FOO&A"); // should not delete anything
-    
+
     bw.addMutation(m1);
     bw.close();
-    
+
     Map<Set<String>,Set<String>> expected = new HashMap<Set<String>,Set<String>>();
-    
+
     expected.put(nss("A", "L"), nss("v5"));
     expected.put(nss("A", "M"), nss("v5"));
     expected.put(nss("B"), nss("v3"));
@@ -135,37 +136,37 @@ public class VisibilityIT extends SimpleMacIT {
     expected.put(nss("A", "B", "FOO"), nss("v13"));
     expected.put(nss("FOO"), nss("v11"));
     expected.put(nss("A", "FOO"), nss("v9"));
-    
+
     queryData(c, tableName, nss("A", "B", "FOO", "L", "M", "Z"), nss("A", "B", "FOO", "L", "M", "Z"), expected);
   }
-  
+
   private void insertDefaultData(Connector c, String tableName) throws Exception {
     BatchWriter bw = c.createBatchWriter(tableName, new BatchWriterConfig());
     Mutation m1 = new Mutation(new Text("row1"));
-    
+
     mput(m1, "cf1", "cq1", "BASE", "v1");
     mput(m1, "cf1", "cq2", "DEFLABEL", "v2");
     mput(m1, "cf1", "cq3", "", "v3");
-    
+
     bw.addMutation(m1);
     bw.close();
   }
-  
+
   private static void uniqueCombos(List<Set<String>> all, Set<String> prefix, Set<String> suffix) {
-    
+
     all.add(prefix);
-    
+
     TreeSet<String> ss = new TreeSet<String>(suffix);
-    
+
     for (String s : suffix) {
       TreeSet<String> ps = new TreeSet<String>(prefix);
       ps.add(s);
       ss.remove(s);
-      
+
       uniqueCombos(all, ps, ss);
     }
   }
-  
+
   private void queryData(Connector c, String tableName) throws Exception {
     Map<Set<String>,Set<String>> expected = new HashMap<Set<String>,Set<String>>();
     expected.put(nss(), nss("v1"));
@@ -186,56 +187,56 @@ public class VisibilityIT extends SimpleMacIT {
     expected.put(nss("A", "FOO", "M"), nss("v10", "v12"));
     expected.put(nss("B", "FOO", "L"), nss("v12"));
     expected.put(nss("B", "FOO", "M"), nss("v12"));
-    
+
     queryData(c, tableName, nss("A", "B", "FOO", "L", "M", "Z"), nss("A", "B", "FOO", "L", "M", "Z"), expected);
     queryData(c, tableName, nss("A", "B", "FOO", "L", "M", "Z"), nss("A", "B", "L", "M", "Z"), expected);
     queryData(c, tableName, nss("A", "B", "FOO", "L", "M", "Z"), nss("A", "Z"), expected);
     queryData(c, tableName, nss("A", "B", "FOO", "L", "M", "Z"), nss("Z"), expected);
     queryData(c, tableName, nss("A", "B", "FOO", "L", "M", "Z"), nss(), expected);
   }
-  
+
   private void queryData(Connector c, String tableName, Set<String> allAuths, Set<String> userAuths, Map<Set<String>,Set<String>> expected) throws Exception {
-    
+
     c.securityOperations().changeUserAuthorizations("root", new Authorizations(nbas(userAuths)));
-    
+
     ArrayList<Set<String>> combos = new ArrayList<Set<String>>();
     uniqueCombos(combos, nss(), allAuths);
-    
+
     for (Set<String> set1 : combos) {
       Set<String> e = new TreeSet<String>();
       for (Set<String> set2 : combos) {
-        
+
         set2 = new HashSet<String>(set2);
         set2.retainAll(userAuths);
-        
+
         if (set1.containsAll(set2) && expected.containsKey(set2)) {
           e.addAll(expected.get(set2));
         }
       }
-      
+
       set1.retainAll(userAuths);
       verify(c, tableName, set1, e);
     }
-    
+
   }
-  
+
   private void queryDefaultData(Connector c, String tableName) throws Exception {
     Scanner scanner;
-    
+
     // should return no records
     c.securityOperations().changeUserAuthorizations("root", new Authorizations("BASE", "DEFLABEL"));
     scanner = getConnector().createScanner(tableName, new Authorizations());
     verifyDefault(scanner, 0);
-    
+
     // should return one record
     scanner = getConnector().createScanner(tableName, new Authorizations("BASE"));
     verifyDefault(scanner, 1);
-    
+
     // should return all three records
     scanner = getConnector().createScanner(tableName, new Authorizations("BASE", "DEFLABEL"));
     verifyDefault(scanner, 3);
   }
-  
+
   private void verifyDefault(Scanner scanner, int expectedCount) throws Exception {
     for (@SuppressWarnings("unused")
     Entry<Key,Value> entry : scanner)
@@ -243,17 +244,17 @@ public class VisibilityIT extends SimpleMacIT {
     if (expectedCount != 0)
       throw new Exception(" expected count !=0 " + expectedCount);
   }
-  
+
   private void verify(Connector c, String tableName, Set<String> auths, Set<String> expectedValues) throws Exception {
     ByteArraySet bas = nbas(auths);
-    
+
     try {
       verify(c, tableName, bas, expectedValues.toArray(new String[0]));
     } catch (Exception e) {
       throw new Exception("Verification failed auths=" + auths + " exp=" + expectedValues, e);
     }
   }
-  
+
   private ByteArraySet nbas(Set<String> auths) {
     ByteArraySet bas = new ByteArraySet();
     for (String auth : auths) {
@@ -261,20 +262,20 @@ public class VisibilityIT extends SimpleMacIT {
     }
     return bas;
   }
-  
+
   private void verify(Connector c, String tableName, ByteArraySet nss, String... expected) throws Exception {
     Scanner scanner = c.createScanner(tableName, new Authorizations(nss));
     verify(scanner.iterator(), expected);
-    
+
     BatchScanner bs = getConnector().createBatchScanner(tableName, new Authorizations(nss), 3);
     bs.setRanges(Collections.singleton(new Range()));
     verify(bs.iterator(), expected);
     bs.close();
   }
-  
+
   private void verify(Iterator<Entry<Key,Value>> iter, String... expected) throws Exception {
     HashSet<String> valuesSeen = new HashSet<String>();
-    
+
     while (iter.hasNext()) {
       Entry<Key,Value> entry = iter.next();
       if (valuesSeen.contains(entry.getValue().toString())) {
@@ -282,13 +283,13 @@ public class VisibilityIT extends SimpleMacIT {
       }
       valuesSeen.add(entry.getValue().toString());
     }
-    
+
     for (String ev : expected) {
       if (!valuesSeen.remove(ev)) {
         throw new Exception("Did not see expected value " + ev);
       }
     }
-    
+
     if (valuesSeen.size() != 0) {
       throw new Exception("Saw more values than expected " + valuesSeen);
     }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/aa711023/test/src/test/java/org/apache/accumulo/test/functional/WriteLotsIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/functional/WriteLotsIT.java b/test/src/test/java/org/apache/accumulo/test/functional/WriteLotsIT.java
index f713474..7021395 100644
--- a/test/src/test/java/org/apache/accumulo/test/functional/WriteLotsIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/functional/WriteLotsIT.java
@@ -28,17 +28,18 @@ import org.apache.accumulo.test.VerifyIngest;
 import org.junit.Test;
 
 public class WriteLotsIT extends SimpleMacIT {
-  
+
   @Test(timeout = 60 * 1000)
   public void writeLots() throws Exception {
     final Connector c = getConnector();
-    final String tableName = makeTableName();
+    final String tableName = getTableNames(1)[0];
     c.tableOperations().create(tableName);
     final AtomicReference<Exception> ref = new AtomicReference<Exception>();
     List<Thread> threads = new ArrayList<Thread>();
     for (int i = 0; i < 10; i++) {
       final int index = i;
       Thread t = new Thread() {
+        @Override
         public void run() {
           try {
             TestIngest.Opts opts = new TestIngest.Opts();
@@ -65,5 +66,5 @@ public class WriteLotsIT extends SimpleMacIT {
     vopts.tableName = tableName;
     VerifyIngest.verifyIngest(c, vopts, new ScannerOpts());
   }
-  
+
 }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/aa711023/test/src/test/java/org/apache/accumulo/test/functional/ZooCacheIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/functional/ZooCacheIT.java b/test/src/test/java/org/apache/accumulo/test/functional/ZooCacheIT.java
index f4f4964..ba5f44b 100644
--- a/test/src/test/java/org/apache/accumulo/test/functional/ZooCacheIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/functional/ZooCacheIT.java
@@ -16,7 +16,7 @@
  */
 package org.apache.accumulo.test.functional;
 
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
 
 import java.util.ArrayList;
 import java.util.List;
@@ -24,19 +24,20 @@ import java.util.concurrent.atomic.AtomicReference;
 
 import org.junit.Test;
 
-public class ZooCacheIT extends SimpleMacIT {
-  
-  @Test(timeout = 2 * 60 *1000)
+public class ZooCacheIT extends ConfigurableMacIT {
+
+  @Test(timeout = 2 * 60 * 1000)
   public void test() throws Exception {
     assertEquals(0, exec(CacheTestClean.class, "/zcTest-42", "/tmp/zcTest-42").waitFor());
     final AtomicReference<Exception> ref = new AtomicReference<Exception>();
     List<Thread> threads = new ArrayList<Thread>();
     for (int i = 0; i < 3; i++) {
       Thread reader = new Thread() {
+        @Override
         public void run() {
           try {
-            CacheTestReader.main(new String[]{"/zcTest-42", "/tmp/zcTest-42", getConnector().getInstance().getZooKeepers()});
-          } catch(Exception ex) {
+            CacheTestReader.main(new String[] {"/zcTest-42", "/tmp/zcTest-42", getConnector().getInstance().getZooKeepers()});
+          } catch (Exception ex) {
             ref.set(ex);
           }
         }
@@ -44,12 +45,12 @@ public class ZooCacheIT extends SimpleMacIT {
       reader.start();
       threads.add(reader);
     }
-    assertEquals(0, exec(CacheTestWriter.class, "/zcTest-42", "/tmp/zcTest-42", "3","50").waitFor());
-    for (Thread t: threads) {
+    assertEquals(0, exec(CacheTestWriter.class, "/zcTest-42", "/tmp/zcTest-42", "3", "50").waitFor());
+    for (Thread t : threads) {
       t.join();
       if (ref.get() != null)
         throw ref.get();
     }
   }
-  
+
 }


Mime
View raw message