Return-Path: X-Original-To: apmail-accumulo-commits-archive@www.apache.org Delivered-To: apmail-accumulo-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 44AFF105CD for ; Fri, 15 Nov 2013 19:48:48 +0000 (UTC) Received: (qmail 14435 invoked by uid 500); 15 Nov 2013 19:48:48 -0000 Delivered-To: apmail-accumulo-commits-archive@accumulo.apache.org Received: (qmail 14364 invoked by uid 500); 15 Nov 2013 19:48:48 -0000 Mailing-List: contact commits-help@accumulo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@accumulo.apache.org Delivered-To: mailing list commits@accumulo.apache.org Received: (qmail 14309 invoked by uid 99); 15 Nov 2013 19:48:48 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 15 Nov 2013 19:48:48 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id CD79C82F48F; Fri, 15 Nov 2013 19:48:47 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: elserj@apache.org To: commits@accumulo.apache.org Date: Fri, 15 Nov 2013 19:48:48 -0000 Message-Id: <19ebf8251153481c89c9f087d7053a95@git.apache.org> In-Reply-To: <47176f32efee4518af87befc35171bd3@git.apache.org> References: <47176f32efee4518af87befc35171bd3@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [2/6] git commit: ACCUMULO-1890 Clean up the test to avoid spinning up a MAC ACCUMULO-1890 Clean up the test to avoid spinning up a MAC Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/7e23cf28 Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/7e23cf28 Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/7e23cf28 Branch: refs/heads/master Commit: 7e23cf2854387a3b27d460a174e12eb0f40bfe0d Parents: 4119611 Author: Josh Elser Authored: Fri Nov 15 11:26:30 2013 -0800 Committer: Josh Elser Committed: Fri Nov 15 11:30:31 2013 -0800 ---------------------------------------------------------------------- .../minicluster/MiniAccumuloClusterGCTest.java | 23 +++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/accumulo/blob/7e23cf28/src/minicluster/src/test/java/org/apache/accumulo/minicluster/MiniAccumuloClusterGCTest.java ---------------------------------------------------------------------- diff --git a/src/minicluster/src/test/java/org/apache/accumulo/minicluster/MiniAccumuloClusterGCTest.java b/src/minicluster/src/test/java/org/apache/accumulo/minicluster/MiniAccumuloClusterGCTest.java index b73523f..d58eb47 100644 --- a/src/minicluster/src/test/java/org/apache/accumulo/minicluster/MiniAccumuloClusterGCTest.java +++ b/src/minicluster/src/test/java/org/apache/accumulo/minicluster/MiniAccumuloClusterGCTest.java @@ -30,9 +30,8 @@ import org.apache.commons.io.filefilter.SuffixFileFilter; import org.apache.commons.io.filefilter.TrueFileFilter; import org.apache.log4j.Level; import org.apache.log4j.Logger; -import org.junit.AfterClass; import org.junit.Assert; -import org.junit.BeforeClass; +import org.junit.Ignore; import org.junit.Test; import org.junit.rules.TemporaryFolder; @@ -43,12 +42,26 @@ import com.google.common.collect.ImmutableMap; */ public class MiniAccumuloClusterGCTest { + @Test + public void testGcConfig() throws Exception { + + MiniAccumuloConfig macConfig = new MiniAccumuloConfig(tmpDir.getRoot(), passwd); + macConfig.setNumTservers(1); + + Assert.assertEquals(false, macConfig.shouldRunGC()); + + // Turn on the garbage collector + macConfig.runGC(true); + + Assert.assertEquals(true, macConfig.shouldRunGC()); + } + + private static TemporaryFolder tmpDir = new TemporaryFolder(); private static MiniAccumuloConfig macConfig; private static MiniAccumuloCluster accumulo; private static final String passwd = "password"; - @BeforeClass public static void setupMiniCluster() throws Exception { tmpDir.create(); Logger.getLogger("org.apache.zookeeper").setLevel(Level.ERROR); @@ -69,13 +82,13 @@ public class MiniAccumuloClusterGCTest { accumulo.start(); } - @AfterClass public static void tearDownMiniCluster() throws Exception { accumulo.stop(); tmpDir.delete(); } - @Test(timeout = 20000) + // This test seems to be a little too unstable for a unit test + @Ignore public void test() throws Exception { ZooKeeperInstance inst = new ZooKeeperInstance(accumulo.getInstanceName(), accumulo.getZooKeepers()); Connector c = inst.getConnector("root", passwd);