ACCUMULO-3167 Some recommended simplification on AccumuloClusterIT.
Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/a09d20a5 Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/a09d20a5 Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/a09d20a5 Branch: refs/heads/metrics2 Commit: a09d20a52ce45f96a59db16a82e916c3b4f9df39 Parents: 2f108c9 Author: Josh Elser <els...@apache.org> Authored: Wed Nov 19 19:41:31 2014 -0500 Committer: Josh Elser <els...@apache.org> Committed: Mon Nov 24 18:08:17 2014 -0500 ---------------------------------------------------------------------- .../org/apache/accumulo/harness/AccumuloClusterIT.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/accumulo/blob/a09d20a5/test/src/test/java/org/apache/accumulo/harness/AccumuloClusterIT.java ---------------------------------------------------------------------- diff --git a/test/src/test/java/org/apache/accumulo/harness/AccumuloClusterIT.java b/test/src/test/java/org/apache/accumulo/harness/AccumuloClusterIT.java index 1638647..d7751e3 100644 --- a/test/src/test/java/org/apache/accumulo/harness/AccumuloClusterIT.java +++ b/test/src/test/java/org/apache/accumulo/harness/AccumuloClusterIT.java @@ -50,7 +50,11 @@ public abstract class AccumuloClusterIT extends AccumuloIT implements MiniCluste private static final Logger log = LoggerFactory.getLogger(AccumuloClusterIT.class); public static enum ClusterType { - MINI, STANDALONE + MINI, STANDALONE; + + public boolean isDynamic() { + return this == MINI; + } } private static boolean initialized = false; @@ -70,10 +74,7 @@ public abstract class AccumuloClusterIT extends AccumuloIT implements MiniCluste @Before public void setupCluster() throws Exception { // Before we try to instantiate the cluster, check to see if the test even wants to run against this type of cluster - if (!canRunTest(type)) { - // Test cannot run with the given ClusterType - Assume.assumeTrue(false); - } + Assume.assumeTrue(canRunTest(type)); switch (type) { case MINI: @@ -89,7 +90,7 @@ public abstract class AccumuloClusterIT extends AccumuloIT implements MiniCluste throw new RuntimeException("Unhandled type"); } - if (isDynamicCluster()) { + if (type.isDynamic()) { cluster.start(); } else { log.info("Removing tables which appear to be from a previous test run");