accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ctubb...@apache.org
Subject [1/3] accumulo git commit: ACCUMULO-3643 Catch findbugs up through rank 16
Date Wed, 11 Mar 2015 21:40:51 GMT
Repository: accumulo
Updated Branches:
  refs/heads/master ded955e91 -> 8158d39c9


http://git-wip-us.apache.org/repos/asf/accumulo/blob/8158d39c/shell/src/test/java/org/apache/accumulo/shell/ShellTest.java
----------------------------------------------------------------------
diff --git a/shell/src/test/java/org/apache/accumulo/shell/ShellTest.java b/shell/src/test/java/org/apache/accumulo/shell/ShellTest.java
index 567cdad..7a4a87e 100644
--- a/shell/src/test/java/org/apache/accumulo/shell/ShellTest.java
+++ b/shell/src/test/java/org/apache/accumulo/shell/ShellTest.java
@@ -40,8 +40,12 @@ import org.apache.log4j.Level;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 public class ShellTest {
+  private static final Logger log = LoggerFactory.getLogger(ShellTest.class);
+
   public static class TestOutputStream extends OutputStream {
     StringBuilder sb = new StringBuilder();
 
@@ -136,7 +140,9 @@ public class ShellTest {
   @After
   public void teardown() {
     if (config.exists()) {
-      config.delete();
+      if (!config.delete()) {
+        log.error("Unable to delete {}", config);
+      }
     }
     shell.shutdown();
   }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/8158d39c/start/src/test/java/org/apache/accumulo/start/classloader/vfs/AccumuloReloadingVFSClassLoaderTest.java
----------------------------------------------------------------------
diff --git a/start/src/test/java/org/apache/accumulo/start/classloader/vfs/AccumuloReloadingVFSClassLoaderTest.java b/start/src/test/java/org/apache/accumulo/start/classloader/vfs/AccumuloReloadingVFSClassLoaderTest.java
index 5adab86..aabfc4f 100644
--- a/start/src/test/java/org/apache/accumulo/start/classloader/vfs/AccumuloReloadingVFSClassLoaderTest.java
+++ b/start/src/test/java/org/apache/accumulo/start/classloader/vfs/AccumuloReloadingVFSClassLoaderTest.java
@@ -16,6 +16,8 @@
  */
 package org.apache.accumulo.start.classloader.vfs;
 
+import static org.junit.Assert.assertTrue;
+
 import java.io.File;
 
 import org.apache.commons.io.FileUtils;
@@ -105,7 +107,7 @@ public class AccumuloReloadingVFSClassLoaderTest {
     Class<?> clazz1_5 = arvcl.getClassLoader().loadClass("test.HelloWorld");
     Assert.assertEquals(clazz1, clazz1_5);
 
-    new File(folder1.getRoot(), "HelloWorld.jar").delete();
+    assertTrue(new File(folder1.getRoot(), "HelloWorld.jar").delete());
 
     // VFS-487 significantly wait to avoid failure
     Thread.sleep(7000);
@@ -157,7 +159,7 @@ public class AccumuloReloadingVFSClassLoaderTest {
     Class<?> clazz1_5 = arvcl.getClassLoader().loadClass("test.HelloWorld");
     Assert.assertEquals(clazz1, clazz1_5);
 
-    new File(folder1.getRoot(), "HelloWorld.jar").delete();
+    assertTrue(new File(folder1.getRoot(), "HelloWorld.jar").delete());
 
     // Update the class
     FileUtils.copyURLToFile(this.getClass().getResource("/HelloWorld.jar"), folder1.newFile("HelloWorld.jar"));
@@ -206,7 +208,7 @@ public class AccumuloReloadingVFSClassLoaderTest {
     // file
     Thread.sleep(1000);
 
-    new File(folder1.getRoot(), "HelloWorld.jar").delete();
+    assertTrue(new File(folder1.getRoot(), "HelloWorld.jar").delete());
 
     // Update the class
     FileUtils.copyURLToFile(this.getClass().getResource("/HelloWorld2.jar"), folder1.newFile("HelloWorld.jar"));

http://git-wip-us.apache.org/repos/asf/accumulo/blob/8158d39c/test/src/main/findbugs/exclude-filter.xml
----------------------------------------------------------------------
diff --git a/test/src/main/findbugs/exclude-filter.xml b/test/src/main/findbugs/exclude-filter.xml
index 6d7584d..3c3e596 100644
--- a/test/src/main/findbugs/exclude-filter.xml
+++ b/test/src/main/findbugs/exclude-filter.xml
@@ -16,8 +16,12 @@
 -->
 <FindBugsFilter>
   <Match>
-    <!-- ignore intentional infinite loop in stress test main method -->
-    <Class name="org.apache.accumulo.test.stress.random.Write" />
+    <!-- ignore intentional infinite loop in test main methods -->
+    <Or>
+      <Class name="org.apache.accumulo.test.continuous.ContinuousQuery" />
+      <Class name="org.apache.accumulo.test.continuous.ContinuousScanner" />
+      <Class name="org.apache.accumulo.test.stress.random.Write" />
+    </Or>
     <Method name="main" params="java.lang.String[]" returns="void" />
     <Bug code="IL" pattern="IL_INFINITE_LOOP" />
   </Match>
@@ -27,4 +31,21 @@
     <Method name="start" params="" returns="void" />
     <Bug code="SWL" pattern="SWL_SLEEP_WITH_LOCK_HELD" />
   </Match>
+  <Match>
+    <!-- test classes can call System.exit -->
+    <Or>
+      <Package name="org.apache.accumulo.test.functional" />
+      <Package name="org.apache.accumulo.test.scalability" />
+      <Package name="org.apache.accumulo.test.performance" />
+    </Or>
+    <Bug code="DM" pattern="DM_EXIT" />
+  </Match>
+  <Match>
+    <!-- test classes can force garbage collection -->
+    <Or>
+      <Class name="org.apache.accumulo.test.performance.scan.CollectTabletStats" />
+      <Class name="org.apache.accumulo.test.MemoryUsageTest" />
+    </Or>
+    <Bug code="DM" pattern="DM_GC" />
+  </Match>
 </FindBugsFilter>

http://git-wip-us.apache.org/repos/asf/accumulo/blob/8158d39c/test/src/main/java/org/apache/accumulo/test/TestRandomDeletes.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/TestRandomDeletes.java b/test/src/main/java/org/apache/accumulo/test/TestRandomDeletes.java
index ba5874d..cd3299b 100644
--- a/test/src/main/java/org/apache/accumulo/test/TestRandomDeletes.java
+++ b/test/src/main/java/org/apache/accumulo/test/TestRandomDeletes.java
@@ -18,6 +18,7 @@ package org.apache.accumulo.test;
 
 import java.util.ArrayList;
 import java.util.Map.Entry;
+import java.util.Objects;
 import java.util.Set;
 import java.util.TreeSet;
 
@@ -52,6 +53,17 @@ public class TestRandomDeletes {
       this.timestamp = timestamp;
     }
 
+    @Override
+    public int hashCode() {
+      return Objects.hashCode(row) + Objects.hashCode(column);
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+      return this == obj || (obj != null && obj instanceof RowColumn && 0 == compareTo((RowColumn) obj));
+    }
+
+    @Override
     public int compareTo(RowColumn other) {
       int result = row.compareTo(other.row);
       if (result != 0)
@@ -59,6 +71,7 @@ public class TestRandomDeletes {
       return column.compareTo(other.column);
     }
 
+    @Override
     public String toString() {
       return row.toString() + ":" + column.toString();
     }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/8158d39c/test/src/main/java/org/apache/accumulo/test/continuous/Histogram.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/continuous/Histogram.java b/test/src/main/java/org/apache/accumulo/test/continuous/Histogram.java
index 6362afd..dd17f3d 100644
--- a/test/src/main/java/org/apache/accumulo/test/continuous/Histogram.java
+++ b/test/src/main/java/org/apache/accumulo/test/continuous/Histogram.java
@@ -29,6 +29,7 @@ import java.util.Comparator;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
+import java.util.Objects;
 import java.util.Set;
 import java.util.TreeSet;
 
@@ -43,7 +44,19 @@ class HistData<T> implements Comparable<HistData<T>>, Serializable {
     count = 0;
   }
 
+  @Override
+  public int hashCode() {
+    return Objects.hashCode(bin) + Objects.hashCode(count);
+  }
+
+  @SuppressWarnings("unchecked")
+  @Override
+  public boolean equals(Object obj) {
+    return obj == this || (obj != null && obj instanceof HistData && 0 == compareTo((HistData<T>) obj));
+  }
+
   @SuppressWarnings("unchecked")
+  @Override
   public int compareTo(HistData<T> o) {
     return ((Comparable<T>) bin).compareTo(o.bin);
   }
@@ -100,6 +113,7 @@ public class Histogram<T> implements Serializable {
     ArrayList<HistData<T>> sortedCounts = new ArrayList<HistData<T>>(counts.values());
 
     Collections.sort(sortedCounts, new Comparator<HistData<T>>() {
+      @Override
       public int compare(HistData<T> o1, HistData<T> o2) {
         if (o1.count < o2.count)
           return -1;

http://git-wip-us.apache.org/repos/asf/accumulo/blob/8158d39c/test/src/main/java/org/apache/accumulo/test/functional/CacheTestClean.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/functional/CacheTestClean.java b/test/src/main/java/org/apache/accumulo/test/functional/CacheTestClean.java
index 62afb32..64123f0 100644
--- a/test/src/main/java/org/apache/accumulo/test/functional/CacheTestClean.java
+++ b/test/src/main/java/org/apache/accumulo/test/functional/CacheTestClean.java
@@ -17,6 +17,7 @@
 package org.apache.accumulo.test.functional;
 
 import java.io.File;
+import java.io.IOException;
 
 import org.apache.accumulo.fate.zookeeper.IZooReaderWriter;
 import org.apache.accumulo.fate.zookeeper.ZooUtil.NodeMissingPolicy;
@@ -35,9 +36,9 @@ public class CacheTestClean {
       zoo.recursiveDelete(rootDir, NodeMissingPolicy.FAIL);
     }
 
-    if (reportDir.exists()) {
-      FileUtils.deleteDirectory(reportDir);
+    FileUtils.deleteQuietly(reportDir);
+    if (!reportDir.mkdirs()) {
+      throw new IOException("Unable to (re-)create " + reportDir);
     }
-    reportDir.mkdirs();
   }
 }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/8158d39c/test/src/main/java/org/apache/accumulo/test/functional/CacheTestReader.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/functional/CacheTestReader.java b/test/src/main/java/org/apache/accumulo/test/functional/CacheTestReader.java
index 82eef6c..fd8ba2c 100644
--- a/test/src/main/java/org/apache/accumulo/test/functional/CacheTestReader.java
+++ b/test/src/main/java/org/apache/accumulo/test/functional/CacheTestReader.java
@@ -28,6 +28,7 @@ import java.util.UUID;
 
 import org.apache.accumulo.core.util.UtilWaitThread;
 import org.apache.accumulo.fate.zookeeper.ZooCache;
+import org.slf4j.LoggerFactory;
 
 public class CacheTestReader {
   public static void main(String[] args) throws Exception {
@@ -42,8 +43,9 @@ public class CacheTestReader {
     ZooCache zc = new ZooCache(keepers, 30000);
 
     while (true) {
-      if (myfile.exists())
-        myfile.delete();
+      if (myfile.exists() && !myfile.delete()) {
+        LoggerFactory.getLogger(CacheTestReader.class).warn("Unable to delete {}", myfile);
+      }
 
       if (zc.get(rootDir + "/die") != null) {
         return;

http://git-wip-us.apache.org/repos/asf/accumulo/blob/8158d39c/test/src/main/java/org/apache/accumulo/test/randomwalk/bulk/Verify.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/bulk/Verify.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/bulk/Verify.java
index f92c31d..97fec75 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/bulk/Verify.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/bulk/Verify.java
@@ -83,7 +83,7 @@ public class Verify extends Test {
         if (rowText == null)
           rowText = entry.getKey().getRow();
 
-        long curr = Long.valueOf(entry.getKey().getColumnQualifier().toString());
+        long curr = Long.parseLong(entry.getKey().getColumnQualifier().toString());
 
         if (curr - 1 != prev)
           throw new Exception("Bad marker count " + entry.getKey() + " " + entry.getValue() + " " + prev);

http://git-wip-us.apache.org/repos/asf/accumulo/blob/8158d39c/test/src/main/java/org/apache/accumulo/test/randomwalk/security/WalkingSecurity.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/security/WalkingSecurity.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/security/WalkingSecurity.java
index 9d285e0..7763544 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/security/WalkingSecurity.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/security/WalkingSecurity.java
@@ -308,7 +308,9 @@ public class WalkingSecurity extends SecurityOperation implements Authorizor, Au
       for (TablePermission tp : TablePermission.values())
         try {
           revokeTablePermission(user, getTableName(), tp);
-        } catch (TableNotFoundException e) {}
+        } catch (TableNotFoundException e) {
+          // ignore
+        }
     for (SystemPermission sp : SystemPermission.values())
       revokeSystemPermission(user, sp);
   }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/8158d39c/test/src/test/java/org/apache/accumulo/fate/zookeeper/ZooLockTest.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/fate/zookeeper/ZooLockTest.java b/test/src/test/java/org/apache/accumulo/fate/zookeeper/ZooLockTest.java
index 2ad8161..8f66791 100644
--- a/test/src/test/java/org/apache/accumulo/fate/zookeeper/ZooLockTest.java
+++ b/test/src/test/java/org/apache/accumulo/fate/zookeeper/ZooLockTest.java
@@ -44,7 +44,7 @@ import org.junit.rules.TemporaryFolder;
  */
 public class ZooLockTest {
 
-  public static TemporaryFolder folder = new TemporaryFolder(new File(System.getProperty("user.dir") + "/target"));
+  private static final TemporaryFolder folder = new TemporaryFolder(new File(System.getProperty("user.dir") + "/target"));
 
   private static MiniAccumuloCluster accumulo;
 

http://git-wip-us.apache.org/repos/asf/accumulo/blob/8158d39c/test/src/test/java/org/apache/accumulo/harness/AccumuloIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/harness/AccumuloIT.java b/test/src/test/java/org/apache/accumulo/harness/AccumuloIT.java
index e7c8c2d..144938e 100644
--- a/test/src/test/java/org/apache/accumulo/harness/AccumuloIT.java
+++ b/test/src/test/java/org/apache/accumulo/harness/AccumuloIT.java
@@ -16,6 +16,8 @@
  */
 package org.apache.accumulo.harness;
 
+import static org.junit.Assert.assertTrue;
+
 import java.io.File;
 import java.util.Random;
 
@@ -44,23 +46,23 @@ public class AccumuloIT {
 
   public static File createSharedTestDir(String name) {
     File baseDir = new File(System.getProperty("user.dir") + "/target/mini-tests");
-    baseDir.mkdirs();
+    assertTrue(baseDir.mkdirs() || baseDir.isDirectory());
     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();
+    assertTrue(testDir.mkdir());
     return testDir;
   }
 
   public static File createTestDir(String name) {
     File baseDir = new File(System.getProperty("user.dir") + "/target/mini-tests");
-    baseDir.mkdirs();
+    assertTrue(baseDir.mkdirs() || baseDir.isDirectory());
     if (name == null)
       return baseDir;
     File testDir = new File(baseDir, name);
     FileUtils.deleteQuietly(testDir);
-    testDir.mkdir();
+    assertTrue(testDir.mkdir());
     return testDir;
   }
 

http://git-wip-us.apache.org/repos/asf/accumulo/blob/8158d39c/test/src/test/java/org/apache/accumulo/harness/MiniClusterHarness.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/harness/MiniClusterHarness.java b/test/src/test/java/org/apache/accumulo/harness/MiniClusterHarness.java
index 7312486..d8540cd 100644
--- a/test/src/test/java/org/apache/accumulo/harness/MiniClusterHarness.java
+++ b/test/src/test/java/org/apache/accumulo/harness/MiniClusterHarness.java
@@ -16,6 +16,8 @@
  */
 package org.apache.accumulo.harness;
 
+import static org.junit.Assert.assertTrue;
+
 import java.io.BufferedOutputStream;
 import java.io.File;
 import java.io.FileOutputStream;
@@ -175,7 +177,7 @@ public class MiniClusterHarness {
     }
 
     File sslDir = new File(folder, "ssl");
-    sslDir.mkdirs();
+    assertTrue(sslDir.mkdirs() || sslDir.isDirectory());
     File rootKeystoreFile = new File(sslDir, "root-" + cfg.getInstanceName() + ".jks");
     File localKeystoreFile = new File(sslDir, "local-" + cfg.getInstanceName() + ".jks");
     File publicTruststoreFile = new File(sslDir, "public-" + cfg.getInstanceName() + ".jks");

http://git-wip-us.apache.org/repos/asf/accumulo/blob/8158d39c/test/src/test/java/org/apache/accumulo/harness/SharedMiniClusterIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/harness/SharedMiniClusterIT.java b/test/src/test/java/org/apache/accumulo/harness/SharedMiniClusterIT.java
index 189b535..b47e604 100644
--- a/test/src/test/java/org/apache/accumulo/harness/SharedMiniClusterIT.java
+++ b/test/src/test/java/org/apache/accumulo/harness/SharedMiniClusterIT.java
@@ -16,6 +16,8 @@
  */
 package org.apache.accumulo.harness;
 
+import static org.junit.Assert.assertTrue;
+
 import java.io.File;
 import java.io.IOException;
 import java.util.Random;
@@ -57,7 +59,7 @@ public abstract class SharedMiniClusterIT extends AccumuloIT implements ClusterU
   @BeforeClass
   public static void startMiniCluster() throws Exception {
     File baseDir = new File(System.getProperty("user.dir") + "/target/mini-tests");
-    baseDir.mkdirs();
+    assertTrue(baseDir.mkdirs() || baseDir.isDirectory());
 
     // Make a shared MAC instance instead of spinning up one per test method
     MiniClusterHarness harness = new MiniClusterHarness();

http://git-wip-us.apache.org/repos/asf/accumulo/blob/8158d39c/test/src/test/java/org/apache/accumulo/harness/TestingKdc.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/harness/TestingKdc.java b/test/src/test/java/org/apache/accumulo/harness/TestingKdc.java
index acc2a03..9471274 100644
--- a/test/src/test/java/org/apache/accumulo/harness/TestingKdc.java
+++ b/test/src/test/java/org/apache/accumulo/harness/TestingKdc.java
@@ -18,6 +18,7 @@ package org.apache.accumulo.harness;
 
 import static com.google.common.base.Preconditions.checkArgument;
 import static com.google.common.base.Preconditions.checkNotNull;
+import static org.junit.Assert.assertTrue;
 
 import java.io.File;
 import java.net.InetAddress;
@@ -60,7 +61,7 @@ public class TestingKdc {
     // Create the directories: target/kerberos/minikdc
     File kdcDir = new File(new File(targetDir, "kerberos"), "minikdc");
 
-    kdcDir.mkdirs();
+    assertTrue(kdcDir.mkdirs() || kdcDir.isDirectory());
 
     return kdcDir;
   }
@@ -72,7 +73,7 @@ public class TestingKdc {
     // Create the directories: target/kerberos/keytabs
     File keytabDir = new File(new File(targetDir, "kerberos"), "keytabs");
 
-    keytabDir.mkdirs();
+    assertTrue(keytabDir.mkdirs() || keytabDir.isDirectory());
 
     return keytabDir;
   }
@@ -190,7 +191,7 @@ public class TestingKdc {
     return ORG_NAME;
   }
 
-    /**
+  /**
    * @return the domain for the realm
    */
   public String getOrgDomain() {

http://git-wip-us.apache.org/repos/asf/accumulo/blob/8158d39c/test/src/test/java/org/apache/accumulo/proxy/SimpleProxyBase.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/proxy/SimpleProxyBase.java b/test/src/test/java/org/apache/accumulo/proxy/SimpleProxyBase.java
index a0300ad..19116f0 100644
--- a/test/src/test/java/org/apache/accumulo/proxy/SimpleProxyBase.java
+++ b/test/src/test/java/org/apache/accumulo/proxy/SimpleProxyBase.java
@@ -124,7 +124,7 @@ import com.google.common.net.HostAndPort;
  */
 public abstract class SimpleProxyBase {
 
-  public static File macTestFolder = new File(System.getProperty("user.dir") + "/target/" + SimpleProxyBase.class.getName());
+  public static final File macTestFolder = new File(System.getProperty("user.dir") + "/target/" + SimpleProxyBase.class.getName());
 
   private static MiniAccumuloCluster accumulo;
   private static String secret = "superSecret";
@@ -162,7 +162,7 @@ public abstract class SimpleProxyBase {
 
   public static void setupMiniCluster(TProtocolFactory protocol) throws Exception {
     FileUtils.deleteQuietly(macTestFolder);
-    macTestFolder.mkdirs();
+    assertTrue(macTestFolder.mkdirs() || macTestFolder.isDirectory());
     MiniAccumuloConfig config = new MiniAccumuloConfig(macTestFolder, secret).setNumTservers(1);
     accumulo = new MiniAccumuloCluster(config);
     accumulo.start();
@@ -1155,13 +1155,14 @@ public abstract class SimpleProxyBase {
     // copy files to a new location
     FileSystem fs = FileSystem.get(new Configuration());
     FSDataInputStream is = fs.open(new Path(dir + "/distcp.txt"));
-    BufferedReader r = new BufferedReader(new InputStreamReader(is));
-    while (true) {
-      String line = r.readLine();
-      if (line == null)
-        break;
-      Path srcPath = new Path(line);
-      FileUtils.copyFile(new File(srcPath.toUri().getPath()), new File(destDir, srcPath.getName()));
+    try (BufferedReader r = new BufferedReader(new InputStreamReader(is))) {
+      while (true) {
+        String line = r.readLine();
+        if (line == null)
+          break;
+        Path srcPath = new Path(line);
+        FileUtils.copyFile(new File(srcPath.toUri().getPath()), new File(destDir, srcPath.getName()));
+      }
     }
     client.deleteTable(creds, TABLE_TEST);
     client.importTable(creds, "testify", destDir.getAbsolutePath());

http://git-wip-us.apache.org/repos/asf/accumulo/blob/8158d39c/test/src/test/java/org/apache/accumulo/test/AuditMessageIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/AuditMessageIT.java b/test/src/test/java/org/apache/accumulo/test/AuditMessageIT.java
index d055852..00a5749 100644
--- a/test/src/test/java/org/apache/accumulo/test/AuditMessageIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/AuditMessageIT.java
@@ -80,7 +80,10 @@ public class AuditMessageIT extends ConfigurableMacIT {
 
   @Override
   public void beforeClusterStart(MiniAccumuloConfigImpl cfg) throws Exception {
-    new File(cfg.getConfDir(), "auditLog.xml").delete();
+    File f = new File(cfg.getConfDir(), "auditLog.xml");
+    if (f.delete()) {
+      log.debug("Deleted " + f);
+    }
   }
 
   // Must be static to survive Junit re-initialising the class every time.
@@ -317,7 +320,7 @@ public class AuditMessageIT extends ConfigurableMacIT {
     // Now do a Directory (bulk) import of the same data.
     auditConnector.tableOperations().create(THIRD_TEST_TABLE_NAME);
     File failDir = new File(exportDir + "/tmp");
-    failDir.mkdirs();
+    assertTrue(failDir.mkdirs() || failDir.isDirectory());
     auditConnector.tableOperations().importDirectory(THIRD_TEST_TABLE_NAME, exportDir.toString(), failDir.toString(), false);
     auditConnector.tableOperations().online(OLD_TEST_TABLE_NAME);
 

http://git-wip-us.apache.org/repos/asf/accumulo/blob/8158d39c/test/src/test/java/org/apache/accumulo/test/BulkImportVolumeIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/BulkImportVolumeIT.java b/test/src/test/java/org/apache/accumulo/test/BulkImportVolumeIT.java
index 8966ce3..95cc69e 100644
--- a/test/src/test/java/org/apache/accumulo/test/BulkImportVolumeIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/BulkImportVolumeIT.java
@@ -51,8 +51,8 @@ public class BulkImportVolumeIT extends AccumuloClusterIT {
     volDirBase = new File(baseDir, "volumes");
     File v1f = new File(volDirBase, "v1");
     File v2f = new File(volDirBase, "v2");
-    v1f.mkdir();
-    v2f.mkdir();
+    assertTrue(v1f.mkdir());
+    assertTrue(v2f.mkdir());
     v1 = new Path("file://" + v1f.getAbsolutePath());
     v2 = new Path("file://" + v2f.getAbsolutePath());
 

http://git-wip-us.apache.org/repos/asf/accumulo/blob/8158d39c/test/src/test/java/org/apache/accumulo/test/ExistingMacIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/ExistingMacIT.java b/test/src/test/java/org/apache/accumulo/test/ExistingMacIT.java
index 6330a59..5460f7a 100644
--- a/test/src/test/java/org/apache/accumulo/test/ExistingMacIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/ExistingMacIT.java
@@ -16,6 +16,8 @@
  */
 package org.apache.accumulo.test;
 
+import static org.junit.Assert.assertTrue;
+
 import java.io.File;
 import java.io.FileOutputStream;
 import java.io.IOException;
@@ -103,7 +105,7 @@ public class ExistingMacIT extends ConfigurableMacIT {
 
     File hadoopConfDir = createTestDir(ExistingMacIT.class.getSimpleName() + "_hadoop_conf");
     FileUtils.deleteQuietly(hadoopConfDir);
-    hadoopConfDir.mkdirs();
+    assertTrue(hadoopConfDir.mkdirs());
     createEmptyConfig(new File(hadoopConfDir, "core-site.xml"));
     createEmptyConfig(new File(hadoopConfDir, "hdfs-site.xml"));
 
@@ -144,7 +146,7 @@ public class ExistingMacIT extends ConfigurableMacIT {
 
     File hadoopConfDir = createTestDir(ExistingMacIT.class.getSimpleName() + "_hadoop_conf_2");
     FileUtils.deleteQuietly(hadoopConfDir);
-    hadoopConfDir.mkdirs();
+    assertTrue(hadoopConfDir.mkdirs());
     createEmptyConfig(new File(hadoopConfDir, "core-site.xml"));
     createEmptyConfig(new File(hadoopConfDir, "hdfs-site.xml"));
 

http://git-wip-us.apache.org/repos/asf/accumulo/blob/8158d39c/test/src/test/java/org/apache/accumulo/test/MissingWalHeaderCompletesRecoveryIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/MissingWalHeaderCompletesRecoveryIT.java b/test/src/test/java/org/apache/accumulo/test/MissingWalHeaderCompletesRecoveryIT.java
index 7f2f6f9..b78a311 100644
--- a/test/src/test/java/org/apache/accumulo/test/MissingWalHeaderCompletesRecoveryIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/MissingWalHeaderCompletesRecoveryIT.java
@@ -16,6 +16,8 @@
  */
 package org.apache.accumulo.test;
 
+import static java.nio.charset.StandardCharsets.UTF_8;
+
 import java.io.File;
 import java.util.Collections;
 import java.util.UUID;
@@ -57,7 +59,7 @@ import com.google.common.collect.Iterables;
 public class MissingWalHeaderCompletesRecoveryIT extends ConfigurableMacIT {
   private static final Logger log = LoggerFactory.getLogger(MissingWalHeaderCompletesRecoveryIT.class);
 
-  private static boolean rootHasWritePermission;
+  private boolean rootHasWritePermission;
 
   @Override
   protected int defaultTimeoutSeconds() {
@@ -172,7 +174,7 @@ public class MissingWalHeaderCompletesRecoveryIT extends ConfigurableMacIT {
 
     // Write half of the header
     FSDataOutputStream wal = fs.create(new Path(partialHeaderWalog.toURI()));
-    wal.write(DfsLogger.LOG_FILE_HEADER_V3.getBytes(), 0, DfsLogger.LOG_FILE_HEADER_V3.length() / 2);
+    wal.write(DfsLogger.LOG_FILE_HEADER_V3.getBytes(UTF_8), 0, DfsLogger.LOG_FILE_HEADER_V3.length() / 2);
     wal.close();
 
     Assert.assertTrue("root user did not have write permission to metadata table",

http://git-wip-us.apache.org/repos/asf/accumulo/blob/8158d39c/test/src/test/java/org/apache/accumulo/test/NamespacesIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/NamespacesIT.java b/test/src/test/java/org/apache/accumulo/test/NamespacesIT.java
index 5808d70..c246a68 100644
--- a/test/src/test/java/org/apache/accumulo/test/NamespacesIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/NamespacesIT.java
@@ -886,7 +886,9 @@ public class NamespacesIT extends AccumuloClusterIT {
     try {
       c.namespaceOperations().testClassLoad(namespace, "dummy", "dummy");
       fail();
-    } catch (NamespaceNotFoundException e) {}
+    } catch (NamespaceNotFoundException e) {
+      // expected, ignore
+    }
   }
 
   @Test

http://git-wip-us.apache.org/repos/asf/accumulo/blob/8158d39c/test/src/test/java/org/apache/accumulo/test/RewriteTabletDirectoriesIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/RewriteTabletDirectoriesIT.java b/test/src/test/java/org/apache/accumulo/test/RewriteTabletDirectoriesIT.java
index f9ce176..744f113 100644
--- a/test/src/test/java/org/apache/accumulo/test/RewriteTabletDirectoriesIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/RewriteTabletDirectoriesIT.java
@@ -67,8 +67,8 @@ public class RewriteTabletDirectoriesIT extends ConfigurableMacIT {
     File volDirBase = new File(baseDir, "volumes");
     File v1f = new File(volDirBase, "v1");
     File v2f = new File(volDirBase, "v2");
-    v1f.mkdir();
-    v2f.mkdir();
+    assertTrue(v1f.mkdir());
+    assertTrue(v2f.mkdir());
     v1 = new Path("file://" + v1f.getAbsolutePath());
     v2 = new Path("file://" + v2f.getAbsolutePath());
 

http://git-wip-us.apache.org/repos/asf/accumulo/blob/8158d39c/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 f7ce461..a7538af 100644
--- a/test/src/test/java/org/apache/accumulo/test/ShellServerIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/ShellServerIT.java
@@ -1080,11 +1080,11 @@ public class ShellServerIT extends SharedMiniClusterIT {
     Configuration conf = new Configuration();
     FileSystem fs = FileSystem.get(conf);
     File importDir = new File(rootPath, "import");
-    importDir.mkdir();
+    assertTrue(importDir.mkdir());
     String even = new File(importDir, "even.rf").toString();
     String odd = new File(importDir, "odd.rf").toString();
     File errorsDir = new File(rootPath, "errors");
-    errorsDir.mkdir();
+    assertTrue(errorsDir.mkdir());
     fs.mkdirs(new Path(errorsDir.toString()));
     AccumuloConfiguration aconf = AccumuloConfiguration.getDefaultConfiguration();
     FileSKVWriter evenWriter = FileOperations.getInstance().openWriter(even, fs, conf, aconf);

http://git-wip-us.apache.org/repos/asf/accumulo/blob/8158d39c/test/src/test/java/org/apache/accumulo/test/VolumeChooserIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/VolumeChooserIT.java b/test/src/test/java/org/apache/accumulo/test/VolumeChooserIT.java
index 8ca141b..fe9fa26 100644
--- a/test/src/test/java/org/apache/accumulo/test/VolumeChooserIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/VolumeChooserIT.java
@@ -91,9 +91,9 @@ public class VolumeChooserIT extends ConfigurableMacIT {
     File v2f = new File(volDirBase, "v2");
     File v3f = new File(volDirBase, "v3");
     File v4f = new File(volDirBase, "v4");
-    v1f.mkdir();
-    v2f.mkdir();
-    v4f.mkdir();
+    assertTrue(v1f.mkdir() || v1f.isDirectory());
+    assertTrue(v2f.mkdir() || v2f.isDirectory());
+    assertTrue(v4f.mkdir() || v4f.isDirectory());
     v1 = new Path("file://" + v1f.getAbsolutePath());
     v2 = new Path("file://" + v2f.getAbsolutePath());
     v3 = new Path("file://" + v3f.getAbsolutePath());

http://git-wip-us.apache.org/repos/asf/accumulo/blob/8158d39c/test/src/test/java/org/apache/accumulo/test/VolumeIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/VolumeIT.java b/test/src/test/java/org/apache/accumulo/test/VolumeIT.java
index a34ef8c..25247a7 100644
--- a/test/src/test/java/org/apache/accumulo/test/VolumeIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/VolumeIT.java
@@ -95,8 +95,8 @@ public class VolumeIT extends ConfigurableMacIT {
     volDirBase = new File(baseDir, "volumes");
     File v1f = new File(volDirBase, "v1");
     File v2f = new File(volDirBase, "v2");
-    v1f.mkdir();
-    v2f.mkdir();
+    assertTrue(v1f.mkdir() || v1f.isDirectory());
+    assertTrue(v2f.mkdir() || v2f.isDirectory());
     v1 = new Path("file://" + v1f.getAbsolutePath());
     v2 = new Path("file://" + v2f.getAbsolutePath());
 
@@ -276,7 +276,7 @@ public class VolumeIT extends ConfigurableMacIT {
     conf.addResource(new Path(cluster.getConfig().getConfDir().toURI().toString(), "accumulo-site.xml"));
 
     File v3f = new File(volDirBase, "v3");
-    v3f.mkdir();
+    assertTrue(v3f.mkdir() || v3f.isDirectory());
     Path v3 = new Path("file://" + v3f.getAbsolutePath());
 
     conf.set(Property.INSTANCE_VOLUMES.getKey(), v1.toString() + "," + v2.toString() + "," + v3.toString());
@@ -319,7 +319,7 @@ public class VolumeIT extends ConfigurableMacIT {
     conf.addResource(new Path(cluster.getConfig().getConfDir().toURI().toString(), "accumulo-site.xml"));
 
     File v3f = new File(volDirBase, "v3");
-    v3f.mkdir();
+    assertTrue(v3f.mkdir() || v3f.isDirectory());
     Path v3 = new Path("file://" + v3f.getAbsolutePath());
 
     conf.set(Property.INSTANCE_VOLUMES.getKey(), v2.toString() + "," + v3.toString());

http://git-wip-us.apache.org/repos/asf/accumulo/blob/8158d39c/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 f2b9489..90f02b5 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,6 +16,8 @@
  */
 package org.apache.accumulo.test.functional;
 
+import static org.junit.Assert.assertTrue;
+
 import java.io.BufferedOutputStream;
 import java.io.File;
 import java.io.FileOutputStream;
@@ -78,7 +80,7 @@ public class ConfigurableMacIT extends AccumuloIT {
     }
 
     File sslDir = new File(folder, "ssl");
-    sslDir.mkdirs();
+    assertTrue(sslDir.mkdirs() || sslDir.isDirectory());
     File rootKeystoreFile = new File(sslDir, "root-" + cfg.getInstanceName() + ".jks");
     File localKeystoreFile = new File(sslDir, "local-" + cfg.getInstanceName() + ".jks");
     File publicTruststoreFile = new File(sslDir, "public-" + cfg.getInstanceName() + ".jks");

http://git-wip-us.apache.org/repos/asf/accumulo/blob/8158d39c/test/src/test/java/org/apache/accumulo/test/functional/DeleteIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/functional/DeleteIT.java b/test/src/test/java/org/apache/accumulo/test/functional/DeleteIT.java
index ec248f2..3b06dbb 100644
--- a/test/src/test/java/org/apache/accumulo/test/functional/DeleteIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/functional/DeleteIT.java
@@ -18,7 +18,7 @@ package org.apache.accumulo.test.functional;
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNull;
-import static org.junit.Assert.fail;
+import static org.junit.Assert.assertTrue;
 
 import org.apache.accumulo.cluster.AccumuloCluster;
 import org.apache.accumulo.core.cli.BatchWriterOpts;
@@ -72,6 +72,7 @@ public class DeleteIT extends AccumuloClusterIT {
     vopts.cols = opts.cols = 1;
     vopts.random = opts.random = 56;
 
+    assertTrue("Expected one of password or keytab", null != password || null != keytab);
     if (null != password) {
       assertNull("Given password, expected null keytab", keytab);
       Password passwd = new Password(password);
@@ -79,27 +80,27 @@ public class DeleteIT extends AccumuloClusterIT {
       opts.setPrincipal(user);
       vopts.setPassword(passwd);
       vopts.setPrincipal(user);
-    } else if (null != keytab) {
+    }
+    if (null != keytab) {
       assertNull("Given keytab, expect null password", password);
       ClientConfiguration clientConfig = cluster.getClientConfig();
       opts.updateKerberosCredentials(clientConfig);
       vopts.updateKerberosCredentials(clientConfig);
-    } else {
-      fail("Expected one of password or keytab");
     }
 
     BatchWriterOpts BWOPTS = new BatchWriterOpts();
     TestIngest.ingest(c, opts, BWOPTS);
 
     String[] args = null;
+
+    assertTrue("Expected one of password or keytab", null != password || null != keytab);
     if (null != password) {
       assertNull("Given password, expected null keytab", keytab);
       args = new String[] {"-u", user, "-p", password, "-i", cluster.getInstanceName(), "-z", cluster.getZooKeepers(), "--table", tableName};
-    } else if (null != keytab) {
+    }
+    if (null != keytab) {
       assertNull("Given keytab, expect null password", password);
       args = new String[] {"-u", user, "-i", cluster.getInstanceName(), "-z", cluster.getZooKeepers(), "--table", tableName, "--keytab", keytab};
-    } else {
-      fail("Expected one of password or keytab");
     }
 
     assertEquals(0, cluster.getClusterControl().exec(TestRandomDeletes.class, args));

http://git-wip-us.apache.org/repos/asf/accumulo/blob/8158d39c/test/src/test/java/org/apache/accumulo/test/functional/DeleteTableDuringSplitIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/functional/DeleteTableDuringSplitIT.java b/test/src/test/java/org/apache/accumulo/test/functional/DeleteTableDuringSplitIT.java
index bc0503f..e645c03 100644
--- a/test/src/test/java/org/apache/accumulo/test/functional/DeleteTableDuringSplitIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/functional/DeleteTableDuringSplitIT.java
@@ -65,7 +65,9 @@ public class DeleteTableDuringSplitIT extends AccumuloClusterIT {
         public void run() {
           try {
             getConnector().tableOperations().addSplits(finalName, splits);
-          } catch (TableNotFoundException ex) {} catch (Exception ex) {
+          } catch (TableNotFoundException ex) {
+            // expected, ignore
+          } catch (Exception ex) {
             throw new RuntimeException(finalName, ex);
           }
         }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/8158d39c/test/src/test/java/org/apache/accumulo/test/functional/HalfDeadTServerIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/functional/HalfDeadTServerIT.java b/test/src/test/java/org/apache/accumulo/test/functional/HalfDeadTServerIT.java
index 270a44e..0e31253 100644
--- a/test/src/test/java/org/apache/accumulo/test/functional/HalfDeadTServerIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/functional/HalfDeadTServerIT.java
@@ -153,10 +153,12 @@ public class HalfDeadTServerIT extends ConfigurableMacIT {
       // block I/O with some side-channel trickiness
       File trickFile = new File(trickFilename);
       try {
-        trickFile.createNewFile();
+        assertTrue(trickFile.createNewFile());
         UtilWaitThread.sleep(seconds * 1000);
       } finally {
-        trickFile.delete();
+        if (!trickFile.delete()) {
+          log.error("Couldn't delete " + trickFile);
+        }
       }
 
       if (seconds <= 10) {

http://git-wip-us.apache.org/repos/asf/accumulo/blob/8158d39c/test/src/test/java/org/apache/accumulo/test/functional/KerberosIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/functional/KerberosIT.java b/test/src/test/java/org/apache/accumulo/test/functional/KerberosIT.java
index 536ac7b..e351c50 100644
--- a/test/src/test/java/org/apache/accumulo/test/functional/KerberosIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/functional/KerberosIT.java
@@ -171,8 +171,8 @@ public class KerberosIT extends AccumuloIT {
   public void testNewUser() throws Exception {
     String newUser = testName.getMethodName();
     final File newUserKeytab = new File(kdc.getKeytabDir(), newUser + ".keytab");
-    if (newUserKeytab.exists()) {
-      newUserKeytab.delete();
+    if (newUserKeytab.exists() && !newUserKeytab.delete()) {
+      log.warn("Unable to delete {}", newUserKeytab);
     }
 
     // Create a new user
@@ -217,8 +217,8 @@ public class KerberosIT extends AccumuloIT {
   public void testUserPrivilegesThroughGrant() throws Exception {
     String user1 = testName.getMethodName();
     final File user1Keytab = new File(kdc.getKeytabDir(), user1 + ".keytab");
-    if (user1Keytab.exists()) {
-      user1Keytab.delete();
+    if (user1Keytab.exists() && !user1Keytab.delete()) {
+      log.warn("Unable to delete {}", user1Keytab);
     }
 
     // Create some new users
@@ -266,8 +266,8 @@ public class KerberosIT extends AccumuloIT {
   public void testUserPrivilegesForTable() throws Exception {
     String user1 = testName.getMethodName();
     final File user1Keytab = new File(kdc.getKeytabDir(), user1 + ".keytab");
-    if (user1Keytab.exists()) {
-      user1Keytab.delete();
+    if (user1Keytab.exists() && !user1Keytab.delete()) {
+      log.warn("Unable to delete {}", user1Keytab);
     }
 
     // Create some new users -- cannot contain realm
@@ -421,8 +421,8 @@ public class KerberosIT extends AccumuloIT {
   public void testGetDelegationTokenDenied() throws Exception {
     String newUser = testName.getMethodName();
     final File newUserKeytab = new File(kdc.getKeytabDir(), newUser + ".keytab");
-    if (newUserKeytab.exists()) {
-      newUserKeytab.delete();
+    if (newUserKeytab.exists() && !newUserKeytab.delete()) {
+      log.warn("Unable to delete {}", newUserKeytab);
     }
 
     // Create a new user

http://git-wip-us.apache.org/repos/asf/accumulo/blob/8158d39c/test/src/test/java/org/apache/accumulo/test/functional/MonitorLoggingIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/functional/MonitorLoggingIT.java b/test/src/test/java/org/apache/accumulo/test/functional/MonitorLoggingIT.java
index cb87946..43e2350 100644
--- a/test/src/test/java/org/apache/accumulo/test/functional/MonitorLoggingIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/functional/MonitorLoggingIT.java
@@ -89,7 +89,7 @@ public class MonitorLoggingIT extends ConfigurableMacIT {
       IteratorSetting cfg = new IteratorSetting(100, "incorrect", "java.lang.String");
       s.addScanIterator(cfg);
       s.iterator().next();
-    } catch (Exception e) {
+    } catch (RuntimeException e) {
       // expected, the iterator was bad
     }
 

http://git-wip-us.apache.org/repos/asf/accumulo/blob/8158d39c/test/src/test/java/org/apache/accumulo/test/functional/ScanIdIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/functional/ScanIdIT.java b/test/src/test/java/org/apache/accumulo/test/functional/ScanIdIT.java
index 7216c2d..508ebcf 100644
--- a/test/src/test/java/org/apache/accumulo/test/functional/ScanIdIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/functional/ScanIdIT.java
@@ -32,6 +32,7 @@ import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
+import java.util.concurrent.atomic.AtomicBoolean;
 
 import org.apache.accumulo.core.client.AccumuloException;
 import org.apache.accumulo.core.client.AccumuloSecurityException;
@@ -83,7 +84,7 @@ public class ScanIdIT extends AccumuloClusterIT {
 
   private static final ExecutorService pool = Executors.newFixedThreadPool(NUM_SCANNERS);
 
-  private static volatile boolean testInProgress = true;
+  private static final AtomicBoolean testInProgress = new AtomicBoolean(true);
 
   private static final Map<Integer,Value> resultsByWorker = new ConcurrentHashMap<Integer,Value>();
 
@@ -121,14 +122,14 @@ public class ScanIdIT extends AccumuloClusterIT {
     }
 
     // wait for scanners to report a result.
-    while (testInProgress) {
+    while (testInProgress.get()) {
 
       if (resultsByWorker.size() < NUM_SCANNERS) {
         log.trace("Results reported {}", resultsByWorker.size());
         UtilWaitThread.sleep(750);
       } else {
         // each worker has reported at least one result.
-        testInProgress = false;
+        testInProgress.set(false);
 
         log.debug("Final result count {}", resultsByWorker.size());
 
@@ -218,7 +219,7 @@ public class ScanIdIT extends AccumuloClusterIT {
       for (Map.Entry<Key,Value> entry : scanner) {
 
         // exit when success condition is met.
-        if (!testInProgress) {
+        if (!testInProgress.get()) {
           scanner.clearScanIterators();
           scanner.close();
 

http://git-wip-us.apache.org/repos/asf/accumulo/blob/8158d39c/test/src/test/java/org/apache/accumulo/test/replication/CyclicReplicationIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/replication/CyclicReplicationIT.java b/test/src/test/java/org/apache/accumulo/test/replication/CyclicReplicationIT.java
index 3c7297d..4ecb944 100644
--- a/test/src/test/java/org/apache/accumulo/test/replication/CyclicReplicationIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/replication/CyclicReplicationIT.java
@@ -16,6 +16,8 @@
  */
 package org.apache.accumulo.test.replication;
 
+import static org.junit.Assert.assertTrue;
+
 import java.io.BufferedOutputStream;
 import java.io.File;
 import java.io.FileOutputStream;
@@ -85,10 +87,10 @@ public class CyclicReplicationIT {
 
   private File createTestDir(String name) {
     File baseDir = new File(System.getProperty("user.dir") + "/target/mini-tests");
-    baseDir.mkdirs();
+    assertTrue(baseDir.mkdirs() || baseDir.isDirectory());
     File testDir = new File(baseDir, this.getClass().getName() + "_" + testName.getMethodName() + "_" + name);
     FileUtils.deleteQuietly(testDir);
-    testDir.mkdir();
+    assertTrue(testDir.mkdir());
     return testDir;
   }
 

http://git-wip-us.apache.org/repos/asf/accumulo/blob/8158d39c/test/src/test/java/org/apache/accumulo/test/replication/UnusedWalDoesntCloseReplicationStatusIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/replication/UnusedWalDoesntCloseReplicationStatusIT.java b/test/src/test/java/org/apache/accumulo/test/replication/UnusedWalDoesntCloseReplicationStatusIT.java
index 7ae60bf..f8626aa 100644
--- a/test/src/test/java/org/apache/accumulo/test/replication/UnusedWalDoesntCloseReplicationStatusIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/replication/UnusedWalDoesntCloseReplicationStatusIT.java
@@ -78,7 +78,7 @@ public class UnusedWalDoesntCloseReplicationStatusIT extends ConfigurableMacIT {
     conn.tableOperations().create(tableName);
 
     final String tableId = conn.tableOperations().tableIdMap().get(tableName);
-    final int numericTableId = Integer.valueOf(tableId);
+    final int numericTableId = Integer.parseInt(tableId);
     final int fakeTableId = numericTableId + 1;
 
     Assert.assertNotNull("Did not find table ID", tableId);

http://git-wip-us.apache.org/repos/asf/accumulo/blob/8158d39c/test/src/test/java/org/apache/accumulo/test/security/KerberosTokenTest.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/security/KerberosTokenTest.java b/test/src/test/java/org/apache/accumulo/test/security/KerberosTokenTest.java
index 5568e9c..ba7c41e 100644
--- a/test/src/test/java/org/apache/accumulo/test/security/KerberosTokenTest.java
+++ b/test/src/test/java/org/apache/accumulo/test/security/KerberosTokenTest.java
@@ -33,9 +33,13 @@ import org.junit.BeforeClass;
 import org.junit.Rule;
 import org.junit.Test;
 import org.junit.rules.TestName;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 public class KerberosTokenTest {
 
+  private static final Logger log = LoggerFactory.getLogger(KerberosTokenTest.class);
+
   @Rule
   public TestName testName = new TestName();
 
@@ -65,8 +69,8 @@ public class KerberosTokenTest {
   public void test() throws Exception {
     String user = testName.getMethodName();
     File userKeytab = new File(kdc.getKeytabDir(), user + ".keytab");
-    if (userKeytab.exists()) {
-      userKeytab.delete();
+    if (userKeytab.exists() && !userKeytab.delete()) {
+      log.warn("Unable to delete {}", userKeytab);
     }
 
     kdc.createPrincipal(userKeytab, user);
@@ -88,8 +92,8 @@ public class KerberosTokenTest {
   public void testDestroy() throws Exception {
     String user = testName.getMethodName();
     File userKeytab = new File(kdc.getKeytabDir(), user + ".keytab");
-    if (userKeytab.exists()) {
-      userKeytab.delete();
+    if (userKeytab.exists() && !userKeytab.delete()) {
+      log.warn("Unable to delete {}", userKeytab);
     }
 
     kdc.createPrincipal(userKeytab, user);

http://git-wip-us.apache.org/repos/asf/accumulo/blob/8158d39c/test/src/test/java/org/apache/accumulo/test/util/CertUtils.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/util/CertUtils.java b/test/src/test/java/org/apache/accumulo/test/util/CertUtils.java
index 395870b..1f39b47 100644
--- a/test/src/test/java/org/apache/accumulo/test/util/CertUtils.java
+++ b/test/src/test/java/org/apache/accumulo/test/util/CertUtils.java
@@ -223,13 +223,17 @@ public class CertUtils {
       throws NoSuchAlgorithmException, CertificateException, FileNotFoundException, IOException, KeyStoreException, UnrecoverableKeyException {
     KeyStore signerKeystore = KeyStore.getInstance(keystoreType);
     char[] signerPasswordArray = rootKeystorePassword.toCharArray();
-    signerKeystore.load(new FileInputStream(rootKeystorePath), signerPasswordArray);
+    try (FileInputStream fis = new FileInputStream(rootKeystorePath)) {
+      signerKeystore.load(fis, signerPasswordArray);
+    }
     Certificate rootCert = findCert(signerKeystore);
 
     KeyStore keystore = KeyStore.getInstance(keystoreType);
     keystore.load(null, null);
     keystore.setCertificateEntry(keyName + "Cert", rootCert);
-    keystore.store(new FileOutputStream(targetKeystoreFile), truststorePassword.toCharArray());
+    try (FileOutputStream fos = new FileOutputStream(targetKeystoreFile)) {
+      keystore.store(fos, truststorePassword.toCharArray());
+    }
   }
 
   public void createSignedCert(File targetKeystoreFile, String keyName, String keystorePassword, String signerKeystorePath, String signerKeystorePassword)
@@ -237,7 +241,9 @@ public class CertUtils {
       UnrecoverableKeyException, NoSuchProviderException {
     KeyStore signerKeystore = KeyStore.getInstance(keystoreType);
     char[] signerPasswordArray = signerKeystorePassword.toCharArray();
-    signerKeystore.load(new FileInputStream(signerKeystorePath), signerPasswordArray);
+    try (FileInputStream fis = new FileInputStream(signerKeystorePath)) {
+      signerKeystore.load(fis, signerPasswordArray);
+    }
     Certificate signerCert = findCert(signerKeystore);
     PrivateKey signerKey = findPrivateKey(signerKeystore, signerPasswordArray);
 
@@ -249,7 +255,9 @@ public class CertUtils {
     keystore.load(null, null);
     keystore.setCertificateEntry(keyName + "Cert", cert);
     keystore.setKeyEntry(keyName + "Key", kp.getPrivate(), password, new Certificate[] {cert, signerCert});
-    keystore.store(new FileOutputStream(targetKeystoreFile), password);
+    try (FileOutputStream fos = new FileOutputStream(targetKeystoreFile)) {
+      keystore.store(fos, password);
+    }
   }
 
   public void createSelfSignedCert(File targetKeystoreFile, String keyName, String keystorePassword) throws KeyStoreException, CertificateException,
@@ -267,7 +275,9 @@ public class CertUtils {
     keystore.load(null, null);
     keystore.setCertificateEntry(keyName + "Cert", cert);
     keystore.setKeyEntry(keyName + "Key", kp.getPrivate(), password, new Certificate[] {cert});
-    keystore.store(new FileOutputStream(targetKeystoreFile), password);
+    try (FileOutputStream fos = new FileOutputStream(targetKeystoreFile)) {
+      keystore.store(fos, password);
+    }
   }
 
   private KeyPair generateKeyPair() throws NoSuchAlgorithmException, NoSuchProviderException {

http://git-wip-us.apache.org/repos/asf/accumulo/blob/8158d39c/test/src/test/java/org/apache/accumulo/test/util/CertUtilsTest.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/util/CertUtilsTest.java b/test/src/test/java/org/apache/accumulo/test/util/CertUtilsTest.java
index 1e4e68a..7f74598 100644
--- a/test/src/test/java/org/apache/accumulo/test/util/CertUtilsTest.java
+++ b/test/src/test/java/org/apache/accumulo/test/util/CertUtilsTest.java
@@ -50,7 +50,9 @@ public class CertUtilsTest {
     certUtils.createSelfSignedCert(keyStoreFile, "test", PASSWORD);
 
     KeyStore keyStore = KeyStore.getInstance(KEYSTORE_TYPE);
-    keyStore.load(new FileInputStream(keyStoreFile), PASSWORD_CHARS);
+    try (FileInputStream fis = new FileInputStream(keyStoreFile)) {
+      keyStore.load(fis, PASSWORD_CHARS);
+    }
     Certificate cert = CertUtils.findCert(keyStore);
 
     cert.verify(cert.getPublicKey()); // throws exception if it can't be verified
@@ -65,7 +67,9 @@ public class CertUtilsTest {
     certUtils.createPublicCert(publicKeyStoreFile, "test", rootKeyStoreFile.getAbsolutePath(), PASSWORD, "");
 
     KeyStore keyStore = KeyStore.getInstance(KEYSTORE_TYPE);
-    keyStore.load(new FileInputStream(publicKeyStoreFile), new char[0]);
+    try (FileInputStream fis = new FileInputStream(publicKeyStoreFile)) {
+      keyStore.load(fis, new char[0]);
+    }
     try {
       CertUtils.findPrivateKey(keyStore, PASSWORD_CHARS);
       fail("expected not to find private key in keystore");
@@ -85,11 +89,15 @@ public class CertUtilsTest {
     certUtils.createSignedCert(signedKeyStoreFile, "test", PASSWORD, rootKeyStoreFile.getAbsolutePath(), PASSWORD);
 
     KeyStore rootKeyStore = KeyStore.getInstance(KEYSTORE_TYPE);
-    rootKeyStore.load(new FileInputStream(rootKeyStoreFile), PASSWORD_CHARS);
+    try (FileInputStream fis = new FileInputStream(rootKeyStoreFile)) {
+      rootKeyStore.load(fis, PASSWORD_CHARS);
+    }
     Certificate rootCert = CertUtils.findCert(rootKeyStore);
 
     KeyStore signedKeyStore = KeyStore.getInstance(KEYSTORE_TYPE);
-    signedKeyStore.load(new FileInputStream(signedKeyStoreFile), PASSWORD_CHARS);
+    try (FileInputStream fis = new FileInputStream(signedKeyStoreFile)) {
+      signedKeyStore.load(fis, PASSWORD_CHARS);
+    }
     Certificate signedCert = CertUtils.findCert(signedKeyStore);
 
     try {
@@ -117,9 +125,13 @@ public class CertUtilsTest {
     certUtils.createPublicCert(publicSignedKeyStoreFile, "test", signedKeyStoreFile.getAbsolutePath(), PASSWORD, "");
 
     KeyStore rootKeyStore = KeyStore.getInstance(KEYSTORE_TYPE);
-    rootKeyStore.load(new FileInputStream(publicRootKeyStoreFile), new char[0]);
+    try (FileInputStream fis = new FileInputStream(publicRootKeyStoreFile)) {
+      rootKeyStore.load(fis, new char[0]);
+    }
     KeyStore signedKeyStore = KeyStore.getInstance(KEYSTORE_TYPE);
-    signedKeyStore.load(new FileInputStream(publicSignedKeyStoreFile), new char[0]);
+    try (FileInputStream fis = new FileInputStream(publicSignedKeyStoreFile)) {
+      signedKeyStore.load(fis, new char[0]);
+    }
     Certificate rootCert = CertUtils.findCert(rootKeyStore);
     Certificate signedCert = CertUtils.findCert(signedKeyStore);
 
@@ -146,11 +158,15 @@ public class CertUtilsTest {
     certUtils.createSignedCert(signedLeafKeyStoreFile, "test", PASSWORD, signedCaKeyStoreFile.getAbsolutePath(), PASSWORD);
 
     KeyStore caKeyStore = KeyStore.getInstance(KEYSTORE_TYPE);
-    caKeyStore.load(new FileInputStream(signedCaKeyStoreFile), PASSWORD_CHARS);
+    try (FileInputStream fis = new FileInputStream(signedCaKeyStoreFile)) {
+      caKeyStore.load(fis, PASSWORD_CHARS);
+    }
     Certificate caCert = CertUtils.findCert(caKeyStore);
 
     KeyStore leafKeyStore = KeyStore.getInstance(KEYSTORE_TYPE);
-    leafKeyStore.load(new FileInputStream(signedLeafKeyStoreFile), PASSWORD_CHARS);
+    try (FileInputStream fis = new FileInputStream(signedLeafKeyStoreFile)) {
+      leafKeyStore.load(fis, PASSWORD_CHARS);
+    }
     Certificate leafCert = CertUtils.findCert(leafKeyStore);
 
     leafCert.verify(caCert.getPublicKey()); // throws exception if it can't be verified

http://git-wip-us.apache.org/repos/asf/accumulo/blob/8158d39c/trace/src/main/findbugs/exclude-filter.xml
----------------------------------------------------------------------
diff --git a/trace/src/main/findbugs/exclude-filter.xml b/trace/src/main/findbugs/exclude-filter.xml
index 56767ef..6ce4bed 100644
--- a/trace/src/main/findbugs/exclude-filter.xml
+++ b/trace/src/main/findbugs/exclude-filter.xml
@@ -21,6 +21,9 @@
       <Package name="org.apache.accumulo.trace.instrument" />
       <Package name="org.apache.accumulo.trace.thrift" />
     </Or>
-    <Bug code="NM" pattern="NM_SAME_SIMPLE_NAME_AS_SUPERCLASS" />
+    <Or>
+      <Bug code="NM" pattern="NM_SAME_SIMPLE_NAME_AS_SUPERCLASS" />
+      <Bug code="NM" pattern="NM_SAME_SIMPLE_NAME_AS_INTERFACE" />
+    </Or>
   </Match>
 </FindBugsFilter>


Mime
View raw message