瀏覽代碼

HADOOP-1847 Many HBase tests do not fail well. (phase 2)

git-svn-id: https://svn.apache.org/repos/asf/lucene/hadoop/trunk@573776 13f79535-47bb-0310-9956-ffa450edef68
Jim Kellerman 17 年之前
父節點
當前提交
622f943f73

+ 1 - 0
src/contrib/hbase/CHANGES.txt

@@ -32,6 +32,7 @@ Trunk (unreleased changes)
     HADOOP-1832 listTables() returns duplicate tables
     HADOOP-1834 Scanners ignore timestamp passed on creation
     HADOOP-1847 Many HBase tests do not fail well.
+    HADOOP-1847 Many HBase tests do not fail well. (phase 2)
 
   IMPROVEMENTS
     HADOOP-1737 Make HColumnDescriptor data publically members settable

+ 21 - 5
src/contrib/hbase/src/test/org/apache/hadoop/hbase/HBaseClusterTestCase.java

@@ -28,26 +28,42 @@ public abstract class HBaseClusterTestCase extends HBaseTestCase {
   final boolean miniHdfs;
   int regionServers;
   
-  protected HBaseClusterTestCase() {
+  /**
+   * constructor
+   */
+  public HBaseClusterTestCase() {
     this(true);
   }
   
-  protected HBaseClusterTestCase(int regionServers) {
+  /**
+   * @param regionServers
+   */
+  public HBaseClusterTestCase(int regionServers) {
     this(true);
     this.regionServers = regionServers;
   }
 
-  protected HBaseClusterTestCase(String name) {
+  /**
+   * @param name
+   */
+  public HBaseClusterTestCase(String name) {
     this(name, true);
   }
   
-  protected HBaseClusterTestCase(final boolean miniHdfs) {
+  /**
+   * @param miniHdfs
+   */
+  public HBaseClusterTestCase(final boolean miniHdfs) {
     super();
     this.miniHdfs = miniHdfs;
     this.regionServers = 1;
   }
 
-  protected HBaseClusterTestCase(String name, final boolean miniHdfs) {
+  /**
+   * @param name
+   * @param miniHdfs
+   */
+  public HBaseClusterTestCase(String name, final boolean miniHdfs) {
     super(name);
     this.miniHdfs = miniHdfs;
     this.regionServers = 1;

+ 11 - 5
src/contrib/hbase/src/test/org/apache/hadoop/hbase/HBaseTestCase.java

@@ -47,19 +47,24 @@ public abstract class HBaseTestCase extends TestCase {
   }
   
   protected volatile Configuration conf;
-  
-  protected HBaseTestCase() {
+
+  /** constructor */
+  public HBaseTestCase() {
     super();
     conf = new HBaseConfiguration();
   }
   
-  protected HBaseTestCase(String name) {
+  /**
+   * @param name
+   */
+  public HBaseTestCase(String name) {
     super(name);
     conf = new HBaseConfiguration();
   }
   
+  /** {@inheritDoc} */
   @Override
-  protected void setUp() throws Exception {
+  public void setUp() throws Exception {
     super.setUp();
     this.testDir = getUnitTestdir(getName());
     this.localFs = FileSystem.getLocal(this.conf);
@@ -68,8 +73,9 @@ public abstract class HBaseTestCase extends TestCase {
     }
   }
   
+  /** {@inheritDoc} */
   @Override
-  protected void tearDown() throws Exception {
+  public void tearDown() throws Exception {
     if (this.localFs != null && this.testDir != null &&
         this.localFs.exists(testDir)) {
       this.localFs.delete(testDir);

+ 0 - 8
src/contrib/hbase/src/test/org/apache/hadoop/hbase/TestCleanRegionServerExit.java

@@ -42,14 +42,6 @@ public class TestCleanRegionServerExit extends HBaseClusterTestCase {
     Logger.getLogger(this.getClass().getPackage().getName()).setLevel(Level.DEBUG);
   }
   
-  /**
-   * {@inheritDoc}
-   */
-  @Override
-  public void setUp() throws Exception {
-    super.setUp();
-  }
-  
   /**
    * The test
    * @throws IOException

+ 0 - 12
src/contrib/hbase/src/test/org/apache/hadoop/hbase/TestCompaction.java

@@ -30,18 +30,6 @@ import org.apache.commons.logging.LogFactory;
 public class TestCompaction extends HBaseTestCase {
   static final Log LOG = LogFactory.getLog(TestCompaction.class.getName());
 
-  /** {@inheritDoc} */
-  @Override
-  public void setUp() throws Exception {
-    super.setUp();
-  }
-  
-  /** {@inheritDoc} */
-  @Override
-  public void tearDown() throws Exception {
-    super.tearDown();
-  }
-  
   /**
    * Run compaction and flushing memcache
    * @throws Exception

+ 0 - 6
src/contrib/hbase/src/test/org/apache/hadoop/hbase/TestHBaseCluster.java

@@ -57,12 +57,6 @@ public class TestHBaseCluster extends HBaseClusterTestCase {
     cleanup();
   }
 
-  /** {@inheritDoc} */
-  @Override
-  public void tearDown() throws Exception {
-    super.tearDown();
-  }
-
   private static final int FIRST_ROW = 1;
   private static final int NUM_VALS = 1000;
   private static final Text CONTENTS = new Text("contents:");

+ 0 - 11
src/contrib/hbase/src/test/org/apache/hadoop/hbase/TestHLog.java

@@ -31,12 +31,6 @@ import org.apache.hadoop.io.SequenceFile.Reader;
 /** JUnit test case for HLog */
 public class TestHLog extends HBaseTestCase implements HConstants {
 
-  /** {@inheritDoc} */
-  @Override
-  public void setUp() throws Exception {
-    super.setUp();
-  }
-  
   /**
    * @throws IOException
    */
@@ -101,9 +95,4 @@ public class TestHLog extends HBaseTestCase implements HConstants {
     }
   }
 
-  /** {@inheritDoc} */
-  @Override
-  public void tearDown() throws Exception {
-    super.tearDown();
-  }
 }

+ 0 - 6
src/contrib/hbase/src/test/org/apache/hadoop/hbase/TestHMemcache.java

@@ -55,12 +55,6 @@ public class TestHMemcache extends TestCase {
     this.conf = new HBaseConfiguration();
   }
 
-  /** {@inheritDoc} */
-  @Override
-  public void tearDown() throws Exception {
-    super.tearDown();
-  }
-
   private Text getRowName(final int index) {
     return new Text("row" + Integer.toString(index));
   }

+ 0 - 5
src/contrib/hbase/src/test/org/apache/hadoop/hbase/TestHRegion.java

@@ -43,11 +43,6 @@ public class TestHRegion extends HBaseTestCase implements RegionUnavailableListe
   static final Logger LOG =
     Logger.getLogger(TestHRegion.class.getName());
   
-  /** Constructor */
-  public TestHRegion() {
-    super();
-  }
-  
   /**
    * Since all the "tests" depend on the results of the previous test, they are
    * not Junit tests that can stand alone. Consequently we have a single Junit

+ 4 - 2
src/contrib/hbase/src/test/org/apache/hadoop/hbase/TestHStoreFile.java

@@ -46,16 +46,18 @@ public class TestHStoreFile extends TestCase {
   private Configuration conf;
   private Path dir = null;
   
+  /** {@inheritDoc} */
   @Override
-  protected void setUp() throws Exception {
+  public void setUp() throws Exception {
     super.setUp();
     this.conf = new HBaseConfiguration();
     this.fs = FileSystem.getLocal(this.conf);
     this.dir = new Path(DIR, getName());
   }
   
+  /** {@inheritDoc} */
   @Override
-  protected void tearDown() throws Exception {
+  public void tearDown() throws Exception {
     if (this.fs.exists(this.dir)) {
       this.fs.delete(this.dir);
     }

+ 0 - 5
src/contrib/hbase/src/test/org/apache/hadoop/hbase/TestListTables.java

@@ -35,11 +35,6 @@ public class TestListTables extends HBaseClusterTestCase {
       new HTableDescriptor("table3")
   };
   
-  /** constructor */
-  public TestListTables() {
-    super();
-  }
-
   /** {@inheritDoc} */
   @Override
   public void setUp() throws Exception {

+ 0 - 8
src/contrib/hbase/src/test/org/apache/hadoop/hbase/TestRegionServerAbort.java

@@ -42,14 +42,6 @@ public class TestRegionServerAbort extends HBaseClusterTestCase {
     Logger.getLogger(this.getClass().getPackage().getName()).setLevel(Level.DEBUG);
   }
   
-  /**
-   * {@inheritDoc}
-   */
-  @Override
-  public void setUp() throws Exception {
-    super.setUp();
-  }
-  
   /**
    * The test
    * @throws IOException

+ 0 - 5
src/contrib/hbase/src/test/org/apache/hadoop/hbase/TestTable.java

@@ -25,11 +25,6 @@ import java.util.concurrent.atomic.AtomicInteger;
 
 /** Tests table creation restrictions*/
 public class TestTable extends HBaseClusterTestCase {
-  /** constructor */
-  public TestTable() {
-    super(true);
-  }
-
   /**
    * the test
    * @throws IOException