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

git-svn-id: https://svn.apache.org/repos/asf/lucene/hadoop/trunk/src/contrib/hbase@573776 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jim Kellerman 2007-09-08 03:04:54 +00:00
parent c3ee52355d
commit 135670ccf4
13 changed files with 37 additions and 78 deletions

View File

@ -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

View File

@ -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;

View File

@ -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);

View File

@ -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

View File

@ -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

View File

@ -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:");

View File

@ -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();
}
}

View File

@ -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));
}

View File

@ -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

View File

@ -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);
}

View File

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

View File

@ -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

View File

@ -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