You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by el...@apache.org on 2014/12/02 21:36:52 UTC

[04/50] [abbrv] accumulo git commit: ACCUMULO-3167 Cleanup noticed on the review.

ACCUMULO-3167 Cleanup noticed on the review.

Whitespace/formatting issues.. Remove now duplicated methods in AbstractMacIT
that exists in AccumuloIT.


Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/163c2be0
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/163c2be0
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/163c2be0

Branch: refs/heads/metrics2
Commit: 163c2be08b73c2be361d0f883c9fb5bf9bea7913
Parents: 7e1b903
Author: Josh Elser <el...@apache.org>
Authored: Wed Nov 19 11:40:41 2014 -0500
Committer: Josh Elser <el...@apache.org>
Committed: Mon Nov 24 18:08:16 2014 -0500

----------------------------------------------------------------------
 .../impl/MiniAccumuloClusterImpl.java           |  2 -
 .../accumulo/harness/MiniClusterHarness.java    |  2 +-
 .../org/apache/accumulo/test/MetaSplitIT.java   | 13 ++--
 .../accumulo/test/functional/AbstractMacIT.java | 72 +-------------------
 4 files changed, 9 insertions(+), 80 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/163c2be0/minicluster/src/main/java/org/apache/accumulo/minicluster/impl/MiniAccumuloClusterImpl.java
----------------------------------------------------------------------
diff --git a/minicluster/src/main/java/org/apache/accumulo/minicluster/impl/MiniAccumuloClusterImpl.java b/minicluster/src/main/java/org/apache/accumulo/minicluster/impl/MiniAccumuloClusterImpl.java
index 2fc2d61..00edf94 100644
--- a/minicluster/src/main/java/org/apache/accumulo/minicluster/impl/MiniAccumuloClusterImpl.java
+++ b/minicluster/src/main/java/org/apache/accumulo/minicluster/impl/MiniAccumuloClusterImpl.java
@@ -635,8 +635,6 @@ public class MiniAccumuloClusterImpl implements AccumuloCluster {
   }
 
   /**
-   * n
-   *
    * @return zookeeper connection string
    */
   @Override

http://git-wip-us.apache.org/repos/asf/accumulo/blob/163c2be0/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 463990f..f4712b3 100644
--- a/test/src/test/java/org/apache/accumulo/harness/MiniClusterHarness.java
+++ b/test/src/test/java/org/apache/accumulo/harness/MiniClusterHarness.java
@@ -86,7 +86,7 @@ public class MiniClusterHarness {
     configCallback.configureMiniCluster(cfg, coreSite);
 
     MiniAccumuloClusterImpl miniCluster = new MiniAccumuloClusterImpl(cfg);
-    
+
     // Write out any configuration items to a file so HDFS will pick them up automatically (from the classpath)
     if (coreSite.size() > 0) {
       File csFile = new File(miniCluster.getConfig().getConfDir(), "core-site.xml");

http://git-wip-us.apache.org/repos/asf/accumulo/blob/163c2be0/test/src/test/java/org/apache/accumulo/test/MetaSplitIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/MetaSplitIT.java b/test/src/test/java/org/apache/accumulo/test/MetaSplitIT.java
index 8a788b6..754e580 100644
--- a/test/src/test/java/org/apache/accumulo/test/MetaSplitIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/MetaSplitIT.java
@@ -39,7 +39,7 @@ import org.junit.Before;
 import org.junit.Test;
 
 public class MetaSplitIT extends AccumuloIT {
-  
+
   private MiniAccumuloClusterImpl cluster;
 
   @Override
@@ -54,14 +54,14 @@ public class MetaSplitIT extends AccumuloIT {
     cluster.getConfig().setNumTservers(1);
     cluster.start();
   }
-  
+
   @After
   public void stopMiniCluster() throws Exception {
     if (null != cluster) {
       cluster.stop();
     }
   }
-  
+
   private Connector getConnector() {
     try {
       return cluster.getConnector("root", getToken());
@@ -69,7 +69,7 @@ public class MetaSplitIT extends AccumuloIT {
       throw new RuntimeException(e);
     }
   }
-  
+
   private AuthenticationToken getToken() {
     return new PasswordToken("rootPassword1");
   }
@@ -122,9 +122,8 @@ public class MetaSplitIT extends AccumuloIT {
     }
   }
 
-  private static void checkMetadataSplits(int numSplits, TableOperations opts)
-      throws AccumuloSecurityException, TableNotFoundException,
-      AccumuloException, InterruptedException {
+  private static void checkMetadataSplits(int numSplits, TableOperations opts) throws AccumuloSecurityException, TableNotFoundException, AccumuloException,
+      InterruptedException {
     for (int i = 0; i < 10; i++) {
       if (opts.listSplits(MetadataTable.NAME).size() == numSplits) {
         break;

http://git-wip-us.apache.org/repos/asf/accumulo/blob/163c2be0/test/src/test/java/org/apache/accumulo/test/functional/AbstractMacIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/functional/AbstractMacIT.java b/test/src/test/java/org/apache/accumulo/test/functional/AbstractMacIT.java
index 9b28222..3833e3c 100644
--- a/test/src/test/java/org/apache/accumulo/test/functional/AbstractMacIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/functional/AbstractMacIT.java
@@ -18,7 +18,6 @@ package org.apache.accumulo.test.functional;
 
 import java.io.File;
 import java.util.Map;
-import java.util.Random;
 
 import org.apache.accumulo.core.cli.BatchWriterOpts;
 import org.apache.accumulo.core.cli.ScannerOpts;
@@ -26,25 +25,19 @@ 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.conf.Property;
+import org.apache.accumulo.harness.AccumuloIT;
 import org.apache.accumulo.minicluster.impl.MiniAccumuloClusterImpl;
 import org.apache.accumulo.minicluster.impl.MiniAccumuloConfigImpl;
 import org.apache.accumulo.test.util.CertUtils;
-import org.apache.commons.io.FileUtils;
 import org.apache.log4j.Logger;
-import org.junit.Rule;
-import org.junit.rules.TestName;
-import org.junit.rules.Timeout;
 
-public abstract class AbstractMacIT {
+public abstract class AbstractMacIT extends AccumuloIT {
   public static final Logger log = Logger.getLogger(AbstractMacIT.class);
 
   public static final String ROOT_PASSWORD = "testRootPassword1";
   public static final ScannerOpts SOPTS = new ScannerOpts();
   public static final BatchWriterOpts BWOPTS = new BatchWriterOpts();
 
-  @Rule
-  public TestName testName = new TestName();
-
   protected static void cleanUp(MiniAccumuloClusterImpl cluster) {
     if (cluster != null)
       try {
@@ -52,28 +45,6 @@ public abstract class AbstractMacIT {
       } catch (Exception e) {}
   }
 
-  protected static File createSharedTestDir(String name) {
-    File baseDir = new File(System.getProperty("user.dir") + "/target/mini-tests");
-    baseDir.mkdirs();
-    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();
-    return testDir;
-  }
-
-  protected static File createTestDir(String name) {
-    File baseDir = new File(System.getProperty("user.dir") + "/target/mini-tests");
-    baseDir.mkdirs();
-    if (name == null)
-      return baseDir;
-    File testDir = new File(baseDir, name);
-    FileUtils.deleteQuietly(testDir);
-    testDir.mkdir();
-    return testDir;
-  }
-
   protected static void configureForEnvironment(MiniAccumuloConfigImpl cfg, Class<?> testClass, File folder) {
     if ("true".equals(System.getProperty("org.apache.accumulo.test.functional.useSslForIT"))) {
       configureForSsl(cfg, folder);
@@ -112,45 +83,6 @@ public abstract class AbstractMacIT {
     cfg.setSiteConfig(siteConfig);
   }
 
-  public String[] getUniqueNames(int num) {
-    String[] names = new String[num];
-    for (int i = 0; i < num; i++)
-      names[i] = this.getClass().getSimpleName() + "_" + testName.getMethodName() + i;
-    return names;
-  }
-
-  /**
-   * If a given IT test has a method that takes longer than a class-set default timeout, declare it failed.
-   *
-   * Note that this provides a upper bound on test times, even in the presence of Test annotations with a timeout. That is, the Test annotatation can make the
-   * timing tighter but will not be able to allow a timeout that takes longer.
-   *
-   * Defaults to no timeout and can be changed via two mechanisms
-   *
-   * 1) A given IT class can override the defaultTimeoutSeconds method if test methods in that class should have a timeout. 2) The system property
-   * "timeout.factor" is used as a multiplier for the class provided default
-   *
-   * Note that if either of these values is '0' tests will run with no timeout. The default class level timeout is set to 0.
-   *
-   */
-  @Rule
-  public Timeout testsShouldTimeout() {
-    int waitLonger = 0;
-    try {
-      waitLonger = Integer.parseInt(System.getProperty("timeout.factor"));
-    } catch (NumberFormatException exception) {
-      log.warn("Could not parse timeout.factor, defaulting to no timeout.");
-    }
-    return new Timeout(waitLonger * defaultTimeoutSeconds() * 1000);
-  }
-
-  /**
-   * time to wait per-method before declaring a timeout, in seconds.
-   */
-  protected int defaultTimeoutSeconds() {
-    return 0;
-  }
-
   public abstract Connector getConnector() throws AccumuloException, AccumuloSecurityException;
 
   public abstract String rootPath();