accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From els...@apache.org
Subject [2/6] git commit: ACCUMULO-1890 Clean up the test to avoid spinning up a MAC
Date Fri, 15 Nov 2013 19:48:48 GMT
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 <elserj@apache.org>
Authored: Fri Nov 15 11:26:30 2013 -0800
Committer: Josh Elser <elserj@apache.org>
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);


Mime
View raw message