hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject svn commit: r1189429 [2/2] - in /hbase/trunk: ./ src/test/java/org/apache/hadoop/hbase/ src/test/java/org/apache/hadoop/hbase/catalog/ src/test/java/org/apache/hadoop/hbase/client/ src/test/java/org/apache/hadoop/hbase/client/replication/ src/test/java...
Date Wed, 26 Oct 2011 20:29:44 GMT
Modified: hbase/trunk/src/test/java/org/apache/hadoop/hbase/master/TestOpenedRegionHandler.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/test/java/org/apache/hadoop/hbase/master/TestOpenedRegionHandler.java?rev=1189429&r1=1189428&r2=1189429&view=diff
==============================================================================
--- hbase/trunk/src/test/java/org/apache/hadoop/hbase/master/TestOpenedRegionHandler.java (original)
+++ hbase/trunk/src/test/java/org/apache/hadoop/hbase/master/TestOpenedRegionHandler.java Wed Oct 26 20:29:41 2011
@@ -124,8 +124,8 @@ public class TestOpenedRegionHandler {
           "testShouldNotCompeleteOpenedRegionSuccessfullyIfVersionMismatches");
       HRegionInfo hri = new HRegionInfo(htd.getName(),
           Bytes.toBytes(testIndex), Bytes.toBytes(testIndex + 1));
-      HRegion region = HRegion.createHRegion(hri, HBaseTestingUtility
-          .getTestDir(), TEST_UTIL.getConfiguration(), htd);
+      HRegion region = HRegion.createHRegion(hri, TEST_UTIL
+          .getDataTestDir(), TEST_UTIL.getConfiguration(), htd);
       assertNotNull(region);
       AssignmentManager am = Mockito.mock(AssignmentManager.class);
       when(am.isRegionInTransition(hri)).thenReturn(

Modified: hbase/trunk/src/test/java/org/apache/hadoop/hbase/master/TestRestartCluster.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/test/java/org/apache/hadoop/hbase/master/TestRestartCluster.java?rev=1189429&r1=1189428&r2=1189429&view=diff
==============================================================================
--- hbase/trunk/src/test/java/org/apache/hadoop/hbase/master/TestRestartCluster.java (original)
+++ hbase/trunk/src/test/java/org/apache/hadoop/hbase/master/TestRestartCluster.java Wed Oct 26 20:29:41 2011
@@ -44,30 +44,26 @@ import org.junit.Test;
 
 public class TestRestartCluster {
   private static final Log LOG = LogFactory.getLog(TestRestartCluster.class);
-  private static HBaseTestingUtility UTIL = new HBaseTestingUtility();
-  private static ZooKeeperWatcher zooKeeper;
-  private static final byte[] TABLENAME = Bytes.toBytes("master_transitions");
-  private static final byte [][] FAMILIES = new byte [][] {Bytes.toBytes("a")};
-
+  private HBaseTestingUtility UTIL = new HBaseTestingUtility();
 
-  private static final byte [][] TABLES = new byte[][] {
+  private static final byte[] TABLENAME = Bytes.toBytes("master_transitions");
+  private static final byte [][] FAMILIES = {Bytes.toBytes("a")};
+  private static final byte [][] TABLES = {
       Bytes.toBytes("restartTableOne"),
       Bytes.toBytes("restartTableTwo"),
       Bytes.toBytes("restartTableThree")
   };
   private static final byte [] FAMILY = Bytes.toBytes("family");
 
-  @Before public void setup() throws Exception {
-  }
-
-  @After public void teardown() throws IOException {
+  @After public void tearDown() throws Exception {
     UTIL.shutdownMiniCluster();
   }
 
   @Test (timeout=300000) public void testRestartClusterAfterKill()
   throws Exception {
     UTIL.startMiniZKCluster();
-    zooKeeper = new ZooKeeperWatcher(UTIL.getConfiguration(), "cluster1", null, true);
+    ZooKeeperWatcher zooKeeper =
+      new ZooKeeperWatcher(UTIL.getConfiguration(), "cluster1", null, true);
 
     // create the unassigned region, throw up a region opened state for META
     String unassignedZNode = zooKeeper.assignmentZNode;
@@ -106,8 +102,7 @@ public class TestRestartCluster {
     assertEquals(3, allRegions.size());
 
     LOG.info("\n\nShutting down cluster");
-    UTIL.getHBaseCluster().shutdown();
-    UTIL.getHBaseCluster().join();
+    UTIL.shutdownMiniHBaseCluster();
 
     LOG.info("\n\nSleeping a bit");
     Thread.sleep(2000);

Modified: hbase/trunk/src/test/java/org/apache/hadoop/hbase/master/TestZKBasedOpenCloseRegion.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/test/java/org/apache/hadoop/hbase/master/TestZKBasedOpenCloseRegion.java?rev=1189429&r1=1189428&r2=1189429&view=diff
==============================================================================
--- hbase/trunk/src/test/java/org/apache/hadoop/hbase/master/TestZKBasedOpenCloseRegion.java (original)
+++ hbase/trunk/src/test/java/org/apache/hadoop/hbase/master/TestZKBasedOpenCloseRegion.java Wed Oct 26 20:29:41 2011
@@ -76,7 +76,7 @@ public class TestZKBasedOpenCloseRegion 
     addToEachStartKey(countOfRegions);
   }
 
-  @AfterClass public static void afterAllTests() throws IOException {
+  @AfterClass public static void afterAllTests() throws Exception {
     TEST_UTIL.shutdownMiniCluster();
   }
 

Modified: hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/TestAtomicOperation.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/TestAtomicOperation.java?rev=1189429&r1=1189428&r2=1189429&view=diff
==============================================================================
--- hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/TestAtomicOperation.java (original)
+++ hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/TestAtomicOperation.java Wed Oct 26 20:29:41 2011
@@ -47,8 +47,9 @@ public class TestAtomicOperation extends
   static final Log LOG = LogFactory.getLog(TestAtomicOperation.class);
 
   HRegion region = null;
-  private final String DIR = HBaseTestingUtility.getTestDir() +
-    "/TestIncrement/";
+  private HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility();
+  private final String DIR = TEST_UTIL.getDataTestDir("TestIncrement").toString();
+
 
   private final int MAX_VERSIONS = 2;
 

Modified: hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/TestBlocksRead.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/TestBlocksRead.java?rev=1189429&r1=1189428&r2=1189429&view=diff
==============================================================================
--- hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/TestBlocksRead.java (original)
+++ hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/TestBlocksRead.java Wed Oct 26 20:29:41 2011
@@ -62,8 +62,8 @@ public class TestBlocksRead extends HBas
   }
 
   HRegion region = null;
-  private final String DIR = HBaseTestingUtility.getTestDir() +
-    "/TestBlocksRead/";
+  private HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility();
+  private final String DIR = TEST_UTIL.getDataTestDir("TestBlocksRead").toString();
 
   /**
    * @see org.apache.hadoop.hbase.HBaseTestCase#setUp()

Modified: hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/TestColumnSeeking.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/TestColumnSeeking.java?rev=1189429&r1=1189428&r2=1189429&view=diff
==============================================================================
--- hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/TestColumnSeeking.java (original)
+++ hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/TestColumnSeeking.java Wed Oct 26 20:29:41 2011
@@ -40,8 +40,6 @@ import org.apache.hadoop.hbase.KeyValue;
 import org.apache.hadoop.hbase.KeyValueTestUtil;
 import org.apache.hadoop.hbase.client.Put;
 import org.apache.hadoop.hbase.client.Scan;
-import org.apache.hadoop.hbase.regionserver.HRegion;
-import org.apache.hadoop.hbase.regionserver.InternalScanner;
 import org.apache.hadoop.hbase.util.Bytes;
 import org.junit.Test;
 
@@ -70,7 +68,7 @@ public class TestColumnSeeking {
     htd.addFamily(hcd);
     HRegionInfo info = new HRegionInfo(Bytes.toBytes(table), null, null, false);
     HRegion region =
-        HRegion.createHRegion(info, HBaseTestingUtility.getTestDir(), TEST_UTIL
+        HRegion.createHRegion(info, TEST_UTIL.getDataTestDir(), TEST_UTIL
             .getConfiguration(), htd);
 
     List<String> rows = generateRandomWords(10, "row");
@@ -175,7 +173,7 @@ public class TestColumnSeeking {
 
     HRegionInfo info = new HRegionInfo(Bytes.toBytes(table), null, null, false);
     HRegion region =
-        HRegion.createHRegion(info, HBaseTestingUtility.getTestDir(), TEST_UTIL
+        HRegion.createHRegion(info, TEST_UTIL.getDataTestDir(), TEST_UTIL
             .getConfiguration(), htd);
 
     List<String> rows = generateRandomWords(10, "row");

Modified: hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactSelection.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactSelection.java?rev=1189429&r1=1189428&r2=1189429&view=diff
==============================================================================
--- hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactSelection.java (original)
+++ hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactSelection.java Wed Oct 26 20:29:41 2011
@@ -48,8 +48,8 @@ public class TestCompactSelection extend
 
   private Configuration conf;
   private Store store;
-  private static final String DIR
-    = HBaseTestingUtility.getTestDir() + "/TestCompactSelection/";
+  private static final String DIR=
+    TEST_UTIL.getDataTestDir("TestCompactSelection").toString();
   private static Path TEST_FILE;
 
   private static final int minFiles = 3;

Modified: hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompaction.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompaction.java?rev=1189429&r1=1189428&r2=1189429&view=diff
==============================================================================
--- hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompaction.java (original)
+++ hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompaction.java Wed Oct 26 20:29:41 2011
@@ -33,10 +33,7 @@ import org.apache.hadoop.fs.FSDataOutput
 import org.apache.hadoop.fs.FileStatus;
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
-import org.apache.hadoop.hbase.HBaseTestCase;
-import org.apache.hadoop.hbase.HConstants;
-import org.apache.hadoop.hbase.HTableDescriptor;
-import org.apache.hadoop.hbase.KeyValue;
+import org.apache.hadoop.hbase.*;
 import org.apache.hadoop.hbase.client.Delete;
 import org.apache.hadoop.hbase.client.Get;
 import org.apache.hadoop.hbase.client.Put;
@@ -48,6 +45,8 @@ import org.apache.hadoop.hbase.regionser
 import org.apache.hadoop.hbase.regionserver.wal.HLog;
 import org.apache.hadoop.hbase.util.Bytes;
 import org.apache.hadoop.hdfs.MiniDFSCluster;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
 import org.mockito.invocation.InvocationOnMock;
 import org.mockito.stubbing.Answer;
 
@@ -57,6 +56,8 @@ import org.mockito.stubbing.Answer;
  */
 public class TestCompaction extends HBaseTestCase {
   static final Log LOG = LogFactory.getLog(TestCompaction.class.getName());
+  private static final HBaseTestingUtility UTIL = new HBaseTestingUtility();
+
   private HRegion r = null;
   private Path compactionDir = null;
   private Path regionCompactionDir = null;
@@ -67,7 +68,6 @@ public class TestCompaction extends HBas
   private byte[] firstRowBytes, secondRowBytes, thirdRowBytes;
   final private byte[] col1, col2;
 
-  private MiniDFSCluster cluster;
 
   /** constructor */
   public TestCompaction() throws Exception {
@@ -76,7 +76,6 @@ public class TestCompaction extends HBas
     // Set cache flush size to 1MB
     conf.setInt("hbase.hregion.memstore.flush.size", 1024*1024);
     conf.setInt("hbase.hregion.memstore.block.multiplier", 100);
-    this.cluster = null;
     compactionThreshold = conf.getInt("hbase.hstore.compactionThreshold", 3);
 
     firstRowBytes = START_KEY.getBytes(HConstants.UTF8_ENCODING);
@@ -92,10 +91,6 @@ public class TestCompaction extends HBas
 
   @Override
   public void setUp() throws Exception {
-    this.cluster = new MiniDFSCluster(conf, 2, true, (String[])null);
-    // Make the hbase rootdir match the minidfs we just span up
-    this.conf.set(HConstants.HBASE_DIR,
-      this.cluster.getFileSystem().getHomeDirectory().toString());
     super.setUp();
     HTableDescriptor htd = createTableDescriptor(getName());
     this.r = createNewHRegion(htd, null, null);
@@ -106,9 +101,6 @@ public class TestCompaction extends HBas
     HLog hlog = r.getLog();
     this.r.close();
     hlog.closeAndDelete();
-    if (this.cluster != null) {
-      shutdownDfs(cluster);
-    }
     super.tearDown();
   }
 
@@ -426,7 +418,7 @@ public class TestCompaction extends HBas
       assertEquals(compactionThreshold, s.getStorefilesCount());
       assertTrue(s.getStorefilesSize() > 15*1000);
       // and no new store files persisted past compactStores()
-      FileStatus[] ls = cluster.getFileSystem().listStatus(r.getTmpDir());
+      FileStatus[] ls = FileSystem.get(conf).listStatus(r.getTmpDir());
       assertEquals(0, ls.length);
 
     } finally {
@@ -501,7 +493,7 @@ public class TestCompaction extends HBas
     StoreFile.Writer compactedFile = store.compactStore(storeFiles, false, maxId);
 
     // Now lets corrupt the compacted file.
-    FileSystem fs = cluster.getFileSystem();
+    FileSystem fs = FileSystem.get(conf);
     Path origPath = compactedFile.getPath();
     Path homedir = store.getHomedir();
     Path dstPath = new Path(homedir, origPath.getName());

Modified: hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompoundBloomFilter.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompoundBloomFilter.java?rev=1189429&r1=1189428&r2=1189429&view=diff
==============================================================================
--- hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompoundBloomFilter.java (original)
+++ hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompoundBloomFilter.java Wed Oct 26 20:29:41 2011
@@ -293,7 +293,7 @@ public class TestCompoundBloomFilter {
     cacheConf = new CacheConfig(conf);
 
     StoreFile.Writer w = StoreFile.createWriter(fs,
-        HBaseTestingUtility.getTestDir(), BLOCK_SIZES[t], null, null, conf,
+        TEST_UTIL.getDataTestDir(), BLOCK_SIZES[t], null, null, conf,
         cacheConf, bt, 0);
 
     assertTrue(w.hasGeneralBloom());

Modified: hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/TestEndToEndSplitTransaction.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/TestEndToEndSplitTransaction.java?rev=1189429&r1=1189428&r2=1189429&view=diff
==============================================================================
--- hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/TestEndToEndSplitTransaction.java (original)
+++ hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/TestEndToEndSplitTransaction.java Wed Oct 26 20:29:41 2011
@@ -41,11 +41,11 @@ public class TestEndToEndSplitTransactio
   @BeforeClass
   public static void beforeAllTests() throws Exception {
     TEST_UTIL.getConfiguration().setInt(HConstants.HBASE_CLIENT_RETRIES_NUMBER, 5);
-    TEST_UTIL.startMiniCluster(1);
+    TEST_UTIL.startMiniCluster();
   }
 
   @AfterClass
-  public static void afterAllTests() throws IOException {
+  public static void afterAllTests() throws Exception {
     TEST_UTIL.shutdownMiniCluster();
   }
   

Modified: hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/TestFSErrorsExposed.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/TestFSErrorsExposed.java?rev=1189429&r1=1189428&r2=1189429&view=diff
==============================================================================
--- hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/TestFSErrorsExposed.java (original)
+++ hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/TestFSErrorsExposed.java Wed Oct 26 20:29:41 2011
@@ -68,7 +68,7 @@ public class TestFSErrorsExposed {
   @Test
   public void testHFileScannerThrowsErrors() throws IOException {
     Path hfilePath = new Path(new Path(
-        HBaseTestingUtility.getTestDir("internalScannerExposesErrors"),
+        util.getDataTestDir("internalScannerExposesErrors"),
         "regionname"), "familyname");
     FaultyFileSystem fs = new FaultyFileSystem(util.getTestFileSystem());
     CacheConfig cacheConf = new CacheConfig(util.getConfiguration());
@@ -111,7 +111,7 @@ public class TestFSErrorsExposed {
   @Test
   public void testStoreFileScannerThrowsErrors() throws IOException {
     Path hfilePath = new Path(new Path(
-        HBaseTestingUtility.getTestDir("internalScannerExposesErrors"),
+        util.getDataTestDir("internalScannerExposesErrors"),
         "regionname"), "familyname");
     FaultyFileSystem fs = new FaultyFileSystem(util.getTestFileSystem());
     CacheConfig cacheConf = new CacheConfig(util.getConfiguration());

Modified: hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/TestGetClosestAtOrBefore.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/TestGetClosestAtOrBefore.java?rev=1189429&r1=1189428&r2=1189429&view=diff
==============================================================================
--- hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/TestGetClosestAtOrBefore.java (original)
+++ hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/TestGetClosestAtOrBefore.java Wed Oct 26 20:29:41 2011
@@ -46,7 +46,6 @@ import org.apache.hadoop.hdfs.MiniDFSClu
  */
 public class TestGetClosestAtOrBefore extends HBaseTestCase {
   private static final Log LOG = LogFactory.getLog(TestGetClosestAtOrBefore.class);
-  private MiniDFSCluster miniHdfs;
 
   private static final byte[] T00 = Bytes.toBytes("000");
   private static final byte[] T10 = Bytes.toBytes("010");
@@ -58,24 +57,17 @@ public class TestGetClosestAtOrBefore ex
   private static final byte[] T35 = Bytes.toBytes("035");
   private static final byte[] T40 = Bytes.toBytes("040");
 
-  @Override
-  protected void setUp() throws Exception {
-    super.setUp();
-    this.miniHdfs = new MiniDFSCluster(this.conf, 1, true, null);
-    // Set the hbase.rootdir to be the home directory in mini dfs.
-    this.conf.set(HConstants.HBASE_DIR,
-      this.miniHdfs.getFileSystem().getHomeDirectory().toString());
-  }
+
 
   public void testUsingMetaAndBinary() throws IOException {
     FileSystem filesystem = FileSystem.get(conf);
-    Path rootdir = filesystem.makeQualified(new Path(conf.get(HConstants.HBASE_DIR)));
-    filesystem.mkdirs(rootdir);
+    Path rootdir = testDir;
     // Up flush size else we bind up when we use default catalog flush of 16k.
     HTableDescriptor.META_TABLEDESC.setMemStoreFlushSize(64 * 1024 * 1024);
 
     HRegion mr = HRegion.createHRegion(HRegionInfo.FIRST_META_REGIONINFO,
       rootdir, this.conf, HTableDescriptor.META_TABLEDESC);
+    try {
     // Write rows for three tables 'A', 'B', and 'C'.
     for (char c = 'A'; c < 'D'; c++) {
       HTableDescriptor htd = new HTableDescriptor("" + c);
@@ -134,6 +126,16 @@ public class TestGetClosestAtOrBefore ex
     findRow(mr, 'C', 45, -1);
     findRow(mr, 'C', 46, -1);
     findRow(mr, 'C', 43, -1);
+    } finally {
+      if (mr != null) {
+        try {
+          mr.close();
+        } catch (Exception e) {
+          e.printStackTrace();
+        }
+        mr.getLog().closeAndDelete();
+      }
+    }
   }
 
   /*
@@ -339,12 +341,4 @@ public class TestGetClosestAtOrBefore ex
       }
     }
   }
-
-  @Override
-  protected void tearDown() throws Exception {
-    if (this.miniHdfs != null) {
-      this.miniHdfs.shutdown();
-    }
-    super.tearDown();
-  }
 }

Modified: hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java?rev=1189429&r1=1189428&r2=1189429&view=diff
==============================================================================
--- hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java (original)
+++ hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java Wed Oct 26 20:29:41 2011
@@ -34,8 +34,6 @@ import java.util.concurrent.atomic.Atomi
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.conf.Configuration;
-import org.apache.hadoop.hdfs.MiniDFSCluster;
-import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.hbase.DoNotRetryIOException;
 import org.apache.hadoop.hbase.HBaseConfiguration;
@@ -44,7 +42,6 @@ import org.apache.hadoop.hbase.HBaseTest
 import org.apache.hadoop.hbase.HColumnDescriptor;
 import org.apache.hadoop.hbase.HConstants;
 import org.apache.hadoop.hbase.HDFSBlocksDistribution;
-import org.apache.hadoop.hbase.ServerName;
 import org.apache.hadoop.hbase.HConstants.OperationStatusCode;
 import org.apache.hadoop.hbase.HRegionInfo;
 import org.apache.hadoop.hbase.HTableDescriptor;
@@ -91,8 +88,8 @@ public class TestHRegion extends HBaseTe
   static final Log LOG = LogFactory.getLog(TestHRegion.class);
 
   HRegion region = null;
-  private final String DIR = HBaseTestingUtility.getTestDir() +
-    "/TestHRegion/";
+  private HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility();
+  private final String DIR = TEST_UTIL.getDataTestDir("TestHRegion").toString();
 
   private final int MAX_VERSIONS = 2;
 
@@ -3023,7 +3020,7 @@ public class TestHRegion extends HBaseTe
       put.add(fam2, col, 1, Bytes.toBytes("test2"));
       ht.put(put);
       
-      HRegion firstRegion = htu.getHbaseCluster().
+      HRegion firstRegion = htu.getHBaseCluster().
         getRegions(Bytes.toBytes(this.getName())).get(0);
       firstRegion.flushcache();
       HDFSBlocksDistribution blocksDistribution1 =

Modified: hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionInfo.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionInfo.java?rev=1189429&r1=1189428&r2=1189429&view=diff
==============================================================================
--- hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionInfo.java (original)
+++ hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionInfo.java Wed Oct 26 20:29:41 2011
@@ -64,7 +64,7 @@ public class TestHRegionInfo {
   @Test
   public void testGetSetOfHTD() throws IOException {
     HBaseTestingUtility HTU = new HBaseTestingUtility();
-    final String tablename = "testGetSetOfHTD";
+        final String tablename = "testGetSetOfHTD";
 
     // Delete the temporary table directory that might still be there from the
     // previous test run.

Modified: hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/TestMultiColumnScanner.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/TestMultiColumnScanner.java?rev=1189429&r1=1189428&r2=1189429&view=diff
==============================================================================
--- hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/TestMultiColumnScanner.java (original)
+++ hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/TestMultiColumnScanner.java Wed Oct 26 20:29:41 2011
@@ -279,7 +279,7 @@ public class TestMultiColumnScanner {
     HRegionInfo info =
         new HRegionInfo(Bytes.toBytes(tableName), null, null, false);
     HRegion region = HRegion.createHRegion(
-        info, HBaseTestingUtility.getTestDir(), TEST_UTIL.getConfiguration(),
+        info, TEST_UTIL.getDataTestDir(), TEST_UTIL.getConfiguration(),
         htd);
     return region;
   }

Modified: hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/TestResettingCounters.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/TestResettingCounters.java?rev=1189429&r1=1189428&r2=1189429&view=diff
==============================================================================
--- hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/TestResettingCounters.java (original)
+++ hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/TestResettingCounters.java Wed Oct 26 20:29:41 2011
@@ -62,7 +62,7 @@ public class TestResettingCounters {
     for (byte [] family : families) htd.addFamily(new HColumnDescriptor(family));
 
     HRegionInfo hri = new HRegionInfo(htd.getName(), null, null, false);
-    String testDir = HBaseTestingUtility.getTestDir() + "/TestResettingCounters/";
+    String testDir = htu.getDataTestDir() + "/TestResettingCounters/";
     Path path = new Path(testDir);
     if (fs.exists(path)) {
       if (!fs.delete(path, true)) {

Modified: hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/TestScanner.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/TestScanner.java?rev=1189429&r1=1189428&r2=1189429&view=diff
==============================================================================
--- hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/TestScanner.java (original)
+++ hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/TestScanner.java Wed Oct 26 20:29:41 2011
@@ -79,20 +79,9 @@ public class TestScanner extends HBaseTe
 
   private static final long START_CODE = Long.MAX_VALUE;
 
-  private MiniDFSCluster cluster = null;
   private HRegion r;
   private HRegionIncommon region;
 
-  @Override
-  public void setUp() throws Exception {
-    cluster = new MiniDFSCluster(conf, 2, true, (String[])null);
-    // Set the hbase.rootdir to be the home directory in mini dfs.
-    this.conf.set(HConstants.HBASE_DIR,
-      this.cluster.getFileSystem().getHomeDirectory().toString());
-    super.setUp();
-
-  }
-
   /**
    * Test basic stop row filter works.
    * @throws Exception
@@ -138,7 +127,6 @@ public class TestScanner extends HBaseTe
     } finally {
       this.r.close();
       this.r.getLog().closeAndDelete();
-      shutdownDfs(this.cluster);
     }
   }
 
@@ -192,7 +180,6 @@ public class TestScanner extends HBaseTe
     } finally {
       this.r.close();
       this.r.getLog().closeAndDelete();
-      shutdownDfs(this.cluster);
     }
   }
 
@@ -220,7 +207,6 @@ public class TestScanner extends HBaseTe
     } finally {
       this.r.close();
       this.r.getLog().closeAndDelete();
-      shutdownDfs(this.cluster);
     }
   }
 
@@ -333,13 +319,10 @@ public class TestScanner extends HBaseTe
       scan(true, address.toString());
       getRegionInfo();
 
+    } finally {
       // clean up
-
       r.close();
       r.getLog().closeAndDelete();
-
-    } finally {
-      shutdownDfs(cluster);
     }
   }
 
@@ -461,7 +444,6 @@ public class TestScanner extends HBaseTe
     } finally {
       this.r.close();
       this.r.getLog().closeAndDelete();
-      shutdownDfs(cluster);
     }
   }
 
@@ -485,7 +467,6 @@ public class TestScanner extends HBaseTe
     } finally {
       this.r.close();
       this.r.getLog().closeAndDelete();
-      shutdownDfs(cluster);
     }
   }
 

Modified: hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitTransaction.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitTransaction.java?rev=1189429&r1=1189428&r2=1189429&view=diff
==============================================================================
--- hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitTransaction.java (original)
+++ hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitTransaction.java Wed Oct 26 20:29:41 2011
@@ -55,7 +55,7 @@ import org.mockito.Mockito;
 public class TestSplitTransaction {
   private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility();
   private final Path testdir =
-    HBaseTestingUtility.getTestDir(this.getClass().getName());
+    TEST_UTIL.getDataTestDir(this.getClass().getName());
   private HRegion parent;
   private HLog wal;
   private FileSystem fs;

Modified: hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/TestStore.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/TestStore.java?rev=1189429&r1=1189428&r2=1189429&view=diff
==============================================================================
--- hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/TestStore.java (original)
+++ hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/TestStore.java Wed Oct 26 20:29:41 2011
@@ -92,7 +92,9 @@ public class TestStore extends TestCase 
   long id = System.currentTimeMillis();
   Get get = new Get(row);
 
-  private static final String DIR = HBaseTestingUtility.getTestDir() + "/TestStore/";
+  private HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility();
+  private final String DIR = TEST_UTIL.getDataTestDir("TestStore").toString();
+
 
   /**
    * Setup

Modified: hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/TestStoreFile.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/TestStoreFile.java?rev=1189429&r1=1189428&r2=1189429&view=diff
==============================================================================
--- hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/TestStoreFile.java (original)
+++ hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/TestStoreFile.java Wed Oct 26 20:29:41 2011
@@ -58,29 +58,13 @@ import com.google.common.collect.Lists;
  */
 public class TestStoreFile extends HBaseTestCase {
   static final Log LOG = LogFactory.getLog(TestStoreFile.class);
-  private MiniDFSCluster cluster;
-  private CacheConfig cacheConf;
+  private CacheConfig cacheConf =  new CacheConfig(conf);
+  private String ROOT_DIR;
 
   @Override
   public void setUp() throws Exception {
-    try {
-      this.cluster = new MiniDFSCluster(this.conf, 2, true, (String[])null);
-      // Set the hbase.rootdir to be the home directory in mini dfs.
-      this.conf.set(HConstants.HBASE_DIR,
-        this.cluster.getFileSystem().getHomeDirectory().toString());
-      this.cacheConf = new CacheConfig(conf);
-    } catch (IOException e) {
-      shutdownDfs(cluster);
-    }
     super.setUp();
-  }
-
-  @Override
-  public void tearDown() throws Exception {
-    super.tearDown();
-    shutdownDfs(cluster);
-    // ReflectionUtils.printThreadInfo(new PrintWriter(System.out),
-    //  "Temporary end-of-test thread dump debugging HADOOP-2040: " + getName());
+    ROOT_DIR = new Path(this.testDir, "TestStoreFile").toString();
   }
 
   /**
@@ -330,9 +314,7 @@ public class TestStoreFile extends HBase
     }
   }
 
-  private static String ROOT_DIR =
-    HBaseTestingUtility.getTestDir("TestStoreFile").toString();
-  private static String localFormatter = "%010d";
+  private static final String localFormatter = "%010d";
 
   private void bloomWriteRead(StoreFile.Writer writer, FileSystem fs)
   throws Exception {
@@ -700,8 +682,7 @@ public class TestStoreFile extends HBase
     Configuration conf = this.conf;
 
     // Find a home for our files
-    Path baseDir = new Path(new Path(this.testDir, "regionname"),
-    "twoCOWEOC");
+    Path baseDir = new Path(new Path(this.testDir, "regionname"),"twoCOWEOC");
 
     // Grab the block cache and get the initial hit/miss counts
     BlockCache bc = new CacheConfig(conf).getBlockCache();

Modified: hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/TestWideScanner.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/TestWideScanner.java?rev=1189429&r1=1189428&r2=1189429&view=diff
==============================================================================
--- hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/TestWideScanner.java (original)
+++ hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/TestWideScanner.java Wed Oct 26 20:29:41 2011
@@ -69,18 +69,8 @@ public class TestWideScanner extends HBa
   }
 
   /** HRegionInfo for root region */
-  MiniDFSCluster cluster = null;
   HRegion r;
 
-  @Override
-  public void setUp() throws Exception {
-    cluster = new MiniDFSCluster(conf, 2, true, (String[])null);
-    // Set the hbase.rootdir to be the home directory in mini dfs.
-    this.conf.set(HConstants.HBASE_DIR,
-      this.cluster.getFileSystem().getHomeDirectory().toString());
-    super.setUp();
-  }
-
   private int addWideContent(HRegion region) throws IOException {
     int count = 0;
     for (char c = 'a'; c <= 'c'; c++) {
@@ -153,7 +143,6 @@ public class TestWideScanner extends HBa
     } finally {
       this.r.close();
       this.r.getLog().closeAndDelete();
-      shutdownDfs(this.cluster);
     }
   }
 }

Modified: hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/handler/TestCloseRegionHandler.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/handler/TestCloseRegionHandler.java?rev=1189429&r1=1189428&r2=1189429&view=diff
==============================================================================
--- hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/handler/TestCloseRegionHandler.java (original)
+++ hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/handler/TestCloseRegionHandler.java Wed Oct 26 20:29:41 2011
@@ -62,7 +62,7 @@ public class TestCloseRegionHandler {
       new HRegionInfo(htd.getName(), HConstants.EMPTY_END_ROW,
         HConstants.EMPTY_END_ROW);
     HRegion region =
-      HRegion.createHRegion(hri, HBaseTestingUtility.getTestDir(),
+      HRegion.createHRegion(hri, HTU.getDataTestDir(),
         HTU.getConfiguration(), htd);
     assertNotNull(region);
     // Spy on the region so can throw exception when close is called.

Modified: hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/handler/TestOpenRegionHandler.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/handler/TestOpenRegionHandler.java?rev=1189429&r1=1189428&r2=1189429&view=diff
==============================================================================
--- hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/handler/TestOpenRegionHandler.java (original)
+++ hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/handler/TestOpenRegionHandler.java Wed Oct 26 20:29:41 2011
@@ -25,14 +25,10 @@ import java.io.IOException;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.hadoop.conf.Configuration;
-import org.apache.hadoop.hbase.HBaseConfiguration;
 import org.apache.hadoop.hbase.HBaseTestingUtility;
-import org.apache.hadoop.hbase.HConstants;
 import org.apache.hadoop.hbase.HRegionInfo;
 import org.apache.hadoop.hbase.HTableDescriptor;
 import org.apache.hadoop.hbase.Server;
-import org.apache.hadoop.hbase.ZooKeeperConnectionException;
 import org.apache.hadoop.hbase.executor.RegionTransitionData;
 import org.apache.hadoop.hbase.executor.EventHandler.EventType;
 import org.apache.hadoop.hbase.regionserver.HRegion;
@@ -49,9 +45,6 @@ import org.junit.AfterClass;
 import org.junit.Before;
 import org.junit.BeforeClass;
 import org.junit.Test;
-import org.mockito.Mockito;
-import org.mockito.invocation.InvocationOnMock;
-import org.mockito.stubbing.Answer;
 
 /**
  * Test of the {@link OpenRegionHandler}.
@@ -59,17 +52,18 @@ import org.mockito.stubbing.Answer;
 public class TestOpenRegionHandler {
   static final Log LOG = LogFactory.getLog(TestOpenRegionHandler.class);
   private final static HBaseTestingUtility HTU = new HBaseTestingUtility();
-  private static final HTableDescriptor TEST_HTD =
-    new HTableDescriptor("TestOpenRegionHandler.java");
+  private static HTableDescriptor TEST_HTD;
   private HRegionInfo TEST_HRI;
 
   private int testIndex = 0;
 
   @BeforeClass public static void before() throws Exception {
     HTU.startMiniZKCluster();
+    TEST_HTD = new HTableDescriptor("TestOpenRegionHandler.java");
   }
 
   @AfterClass public static void after() throws IOException {
+    TEST_HTD = null;
     HTU.shutdownMiniZKCluster();
   }
 
@@ -102,7 +96,7 @@ public class TestOpenRegionHandler {
     HTableDescriptor htd = TEST_HTD;
     final HRegionInfo hri = TEST_HRI;
     HRegion region =
-         HRegion.createHRegion(hri, HBaseTestingUtility.getTestDir(), HTU
+         HRegion.createHRegion(hri, HTU.getDataTestDir(), HTU
             .getConfiguration(), htd);
     assertNotNull(region);
     OpenRegionHandler handler = new OpenRegionHandler(server, rss, hri, htd) {

Modified: hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestHLog.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestHLog.java?rev=1189429&r1=1189428&r2=1189429&view=diff
==============================================================================
--- hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestHLog.java (original)
+++ hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestHLog.java Wed Oct 26 20:29:41 2011
@@ -93,6 +93,7 @@ public class TestHLog  {
   @After
   public void tearDown() throws Exception {
   }
+
   @BeforeClass
   public static void setUpBeforeClass() throws Exception {
     // Make block sizes small.

Modified: hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestHLogBench.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestHLogBench.java?rev=1189429&r1=1189428&r2=1189429&view=diff
==============================================================================
--- hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestHLogBench.java (original)
+++ hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestHLogBench.java Wed Oct 26 20:29:41 2011
@@ -21,7 +21,7 @@ package org.apache.hadoop.hbase.regionse
 
 import java.io.IOException;
 import java.util.Random;
-import java.text.NumberFormat;
+
 import org.apache.commons.logging.impl.Log4JLogger;
 import org.apache.log4j.Level;
 import org.apache.commons.logging.Log;
@@ -39,17 +39,10 @@ import org.apache.hadoop.hbase.HBaseTest
 import org.apache.hadoop.hbase.HColumnDescriptor;
 import org.apache.hadoop.hbase.HRegionInfo;
 import org.apache.hadoop.hbase.HTableDescriptor;
-import org.apache.hadoop.hbase.client.Increment;
 import org.apache.hadoop.hbase.regionserver.HRegion;
-import org.apache.hadoop.hbase.regionserver.Store;
-import org.apache.hadoop.hbase.regionserver.wal.HLog;
-import org.apache.hadoop.hbase.regionserver.wal.WALEdit;
 import org.apache.hadoop.hbase.util.Bytes;
 import org.apache.hadoop.hbase.ipc.HBaseRPC;
 
-import org.junit.After;
-import org.junit.Before;
-import org.junit.BeforeClass;
 import org.junit.Test;
 
 public class TestHLogBench extends Configured implements Tool {
@@ -69,8 +62,10 @@ public class TestHLogBench extends Confi
   // the number of threads and the number of iterations per thread
   private int numThreads = 300;
   private int numIterationsPerThread = 10000;
-  private Path regionRootDir = new Path(HBaseTestingUtility.getTestDir() + 
-                                        "/TestHLogBench/");
+
+  private final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility();
+  private Path regionRootDir =TEST_UTIL.getDataTestDir("TestHLogBench") ;
+
   private boolean appendNoSync = false;
 
   public TestHLogBench() {
@@ -327,7 +322,7 @@ public class TestHLogBench extends Confi
     argv[2] = "-numIterationsPerThread";
     argv[3] = Integer.toString(1000);
     argv[4] = "-path";
-    argv[5] = HBaseTestingUtility.getTestDir() + "/HlogPerformance";
+    argv[5] = TEST_UTIL.getDataTestDir() + "/HlogPerformance";
     argv[6] = "-nosync";
     try {
       res = ToolRunner.run(bench, argv);

Modified: hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestHLogMethods.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestHLogMethods.java?rev=1189429&r1=1189428&r2=1189429&view=diff
==============================================================================
--- hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestHLogMethods.java (original)
+++ hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestHLogMethods.java Wed Oct 26 20:29:41 2011
@@ -31,9 +31,6 @@ import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.hbase.HBaseTestingUtility;
 import org.apache.hadoop.hbase.HConstants;
 import org.apache.hadoop.hbase.KeyValueTestUtil;
-import org.apache.hadoop.hbase.MultithreadedTestUtil;
-import org.apache.hadoop.hbase.MultithreadedTestUtil.TestContext;
-import org.apache.hadoop.hbase.MultithreadedTestUtil.TestThread;
 import org.apache.hadoop.hbase.regionserver.wal.HLogSplitter.EntryBuffers;
 import org.apache.hadoop.hbase.regionserver.wal.HLogSplitter.RegionEntryBuffer;
 import org.apache.hadoop.hbase.util.Bytes;
@@ -56,7 +53,7 @@ public class TestHLogMethods {
    */
   @Test public void testGetSplitEditFilesSorted() throws IOException {
     FileSystem fs = FileSystem.get(util.getConfiguration());
-    Path regiondir = HBaseTestingUtility.getTestDir("regiondir");
+    Path regiondir = util.getDataTestDir("regiondir");
     fs.delete(regiondir, true);
     fs.mkdirs(regiondir);
     Path recoverededits = HLog.getRegionDirRecoveredEditsDir(regiondir);

Modified: hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestLogRollAbort.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestLogRollAbort.java?rev=1189429&r1=1189428&r2=1189429&view=diff
==============================================================================
--- hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestLogRollAbort.java (original)
+++ hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestLogRollAbort.java Wed Oct 26 20:29:41 2011
@@ -112,7 +112,7 @@ public class TestLogRollAbort {
   }
 
   @After
-  public void tearDown() throws IOException {
+  public void tearDown() throws Exception {
     TEST_UTIL.shutdownMiniCluster();
   }
 

Modified: hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestLogRolling.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestLogRolling.java?rev=1189429&r1=1189428&r2=1189429&view=diff
==============================================================================
--- hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestLogRolling.java (original)
+++ hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestLogRolling.java Wed Oct 26 20:29:41 2011
@@ -77,11 +77,11 @@ public class TestLogRolling  {
   private HLog log;
   private String tableName;
   private byte[] value;
-  private static FileSystem fs;
-  private static MiniDFSCluster dfsCluster;
-  private static HBaseAdmin admin;
-  private static MiniHBaseCluster cluster;
-  private final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility();
+  private FileSystem fs;
+  private MiniDFSCluster dfsCluster;
+  private HBaseAdmin admin;
+  private MiniHBaseCluster cluster;
+  private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility();
 
  // verbose logging on classes that are touched in these tests
  {
@@ -100,19 +100,16 @@ public class TestLogRolling  {
    * @throws Exception
    */
   public TestLogRolling()  {
-    // start one regionserver and a minidfs.
-    super();
-      this.server = null;
-      this.log = null;
-      this.tableName = null;
-      this.value = null;
-
-      String className = this.getClass().getName();
-      StringBuilder v = new StringBuilder(className);
-      while (v.length() < 1000) {
-        v.append(className);
-      }
-      value = Bytes.toBytes(v.toString());
+    this.server = null;
+    this.log = null;
+    this.tableName = null;
+
+    String className = this.getClass().getName();
+    StringBuilder v = new StringBuilder(className);
+    while (v.length() < 1000) {
+      v.append(className);
+    }
+    this.value = Bytes.toBytes(v.toString());
   }
 
   // Need to override this setup so we can edit the config before it gets sent
@@ -175,8 +172,7 @@ public class TestLogRolling  {
   }
 
   @After
-  public void tearDown() throws IOException  {
-    TEST_UTIL.cleanupTestDir();
+  public void tearDown() throws Exception  {
     TEST_UTIL.shutdownMiniCluster();
   }
 

Modified: hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestWALActionsListener.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestWALActionsListener.java?rev=1189429&r1=1189428&r2=1189429&view=diff
==============================================================================
--- hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestWALActionsListener.java (original)
+++ hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestWALActionsListener.java Wed Oct 26 20:29:41 2011
@@ -55,9 +55,9 @@ public class TestWALActionsListener {
     conf = TEST_UTIL.getConfiguration();
     conf.setInt("hbase.regionserver.maxlogs", 5);
     fs = FileSystem.get(conf);
-    oldLogDir = new Path(HBaseTestingUtility.getTestDir(),
+    oldLogDir = new Path(TEST_UTIL.getDataTestDir(),
         HConstants.HREGION_OLDLOGDIR_NAME);
-    logDir = new Path(HBaseTestingUtility.getTestDir(),
+    logDir = new Path(TEST_UTIL.getDataTestDir(),
         HConstants.HREGION_LOGDIR_NAME);
   }
 

Modified: hbase/trunk/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationPeer.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationPeer.java?rev=1189429&r1=1189428&r2=1189429&view=diff
==============================================================================
--- hbase/trunk/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationPeer.java (original)
+++ hbase/trunk/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationPeer.java Wed Oct 26 20:29:41 2011
@@ -26,8 +26,7 @@ import org.apache.hadoop.hbase.HBaseConf
 import org.apache.hadoop.hbase.HBaseTestingUtility;
 import org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher;
 import org.apache.zookeeper.KeeperException.SessionExpiredException;
-import org.junit.BeforeClass;
-import org.junit.Test;
+import org.junit.*;
 
 public class TestReplicationPeer {
 

Modified: hbase/trunk/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestReplicationSourceManager.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestReplicationSourceManager.java?rev=1189429&r1=1189428&r2=1189429&view=diff
==============================================================================
--- hbase/trunk/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestReplicationSourceManager.java (original)
+++ hbase/trunk/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestReplicationSourceManager.java Wed Oct 26 20:29:41 2011
@@ -112,9 +112,9 @@ public class TestReplicationSourceManage
     replication = new Replication(new DummyServer(), fs, logDir, oldLogDir);
     manager = replication.getReplicationManager();
     fs = FileSystem.get(conf);
-    oldLogDir = new Path(utility.getTestDir(),
+    oldLogDir = new Path(utility.getDataTestDir(),
         HConstants.HREGION_OLDLOGDIR_NAME);
-    logDir = new Path(utility.getTestDir(),
+    logDir = new Path(utility.getDataTestDir(),
         HConstants.HREGION_LOGDIR_NAME);
 
     manager.addSource(slaveId);

Modified: hbase/trunk/src/test/java/org/apache/hadoop/hbase/thrift/TestThriftServer.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/test/java/org/apache/hadoop/hbase/thrift/TestThriftServer.java?rev=1189429&r1=1189428&r2=1189429&view=diff
==============================================================================
--- hbase/trunk/src/test/java/org/apache/hadoop/hbase/thrift/TestThriftServer.java (original)
+++ hbase/trunk/src/test/java/org/apache/hadoop/hbase/thrift/TestThriftServer.java Wed Oct 26 20:29:41 2011
@@ -65,7 +65,7 @@ public class TestThriftServer {
   }
 
   @AfterClass
-  public static void afterClass() throws IOException {
+  public static void afterClass() throws Exception {
     UTIL.shutdownMiniCluster();
   }
 

Modified: hbase/trunk/src/test/java/org/apache/hadoop/hbase/util/TestFSTableDescriptors.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/test/java/org/apache/hadoop/hbase/util/TestFSTableDescriptors.java?rev=1189429&r1=1189428&r2=1189429&view=diff
==============================================================================
--- hbase/trunk/src/test/java/org/apache/hadoop/hbase/util/TestFSTableDescriptors.java (original)
+++ hbase/trunk/src/test/java/org/apache/hadoop/hbase/util/TestFSTableDescriptors.java Wed Oct 26 20:29:41 2011
@@ -32,8 +32,6 @@ import org.apache.hadoop.hbase.HConstant
 import org.apache.hadoop.hbase.HTableDescriptor;
 import org.apache.hadoop.hbase.TableDescriptors;
 import org.apache.hadoop.hbase.TableExistsException;
-import org.apache.hadoop.hbase.util.Bytes;
-import org.apache.hadoop.hbase.util.FSUtils;
 import org.junit.Test;
 
 
@@ -49,7 +47,7 @@ public class TestFSTableDescriptors {
     final String name = "testRemoves";
     FileSystem fs = FileSystem.get(UTIL.getConfiguration());
     // Cleanup old tests if any detrius laying around.
-    Path rootdir = new Path(HBaseTestingUtility.getTestDir(), name);
+    Path rootdir = new Path(UTIL.getDataTestDir(), name);
     TableDescriptors htds = new FSTableDescriptors(fs, rootdir);
     HTableDescriptor htd = new HTableDescriptor(name);
     htds.add(htd);
@@ -61,7 +59,7 @@ public class TestFSTableDescriptors {
     final String name = "testReadingHTDFromFS";
     FileSystem fs = FileSystem.get(UTIL.getConfiguration());
     HTableDescriptor htd = new HTableDescriptor(name);
-    Path rootdir = HBaseTestingUtility.getTestDir(name);
+    Path rootdir = UTIL.getDataTestDir(name);
     createHTDInFS(fs, rootdir, htd);
     HTableDescriptor htd2 =
       FSUtils.getTableDescriptor(fs, rootdir, htd.getNameAsString());
@@ -79,7 +77,7 @@ public class TestFSTableDescriptors {
     final String name = "testHTableDescriptors";
     FileSystem fs = FileSystem.get(UTIL.getConfiguration());
     // Cleanup old tests if any debris laying around.
-    Path rootdir = new Path(HBaseTestingUtility.getTestDir(), name);
+    Path rootdir = new Path(UTIL.getDataTestDir(), name);
     final int count = 10;
     // Write out table infos.
     for (int i = 0; i < count; i++) {
@@ -128,7 +126,7 @@ public class TestFSTableDescriptors {
     final String name = "testNoSuchTable";
     FileSystem fs = FileSystem.get(UTIL.getConfiguration());
     // Cleanup old tests if any detrius laying around.
-    Path rootdir = new Path(HBaseTestingUtility.getTestDir(), name);
+    Path rootdir = new Path(UTIL.getDataTestDir(), name);
     TableDescriptors htds = new FSTableDescriptors(fs, rootdir);
     htds.get("NoSuchTable");
   }
@@ -138,7 +136,7 @@ public class TestFSTableDescriptors {
     final String name = "testUpdates";
     FileSystem fs = FileSystem.get(UTIL.getConfiguration());
     // Cleanup old tests if any detrius laying around.
-    Path rootdir = new Path(HBaseTestingUtility.getTestDir(), name);
+    Path rootdir = new Path(UTIL.getDataTestDir(), name);
     TableDescriptors htds = new FSTableDescriptors(fs, rootdir);
     HTableDescriptor htd = new HTableDescriptor(name);
     htds.add(htd);

Modified: hbase/trunk/src/test/java/org/apache/hadoop/hbase/util/TestRegionSplitter.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/test/java/org/apache/hadoop/hbase/util/TestRegionSplitter.java?rev=1189429&r1=1189428&r2=1189429&view=diff
==============================================================================
--- hbase/trunk/src/test/java/org/apache/hadoop/hbase/util/TestRegionSplitter.java (original)
+++ hbase/trunk/src/test/java/org/apache/hadoop/hbase/util/TestRegionSplitter.java Wed Oct 26 20:29:41 2011
@@ -61,7 +61,7 @@ public class TestRegionSplitter {
     }
 
     @AfterClass
-    public static void teardown() throws IOException {
+    public static void teardown() throws Exception {
         UTIL.shutdownMiniCluster();
     }
 

Modified: hbase/trunk/src/test/java/org/apache/hadoop/hbase/zookeeper/TestHQuorumPeer.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/test/java/org/apache/hadoop/hbase/zookeeper/TestHQuorumPeer.java?rev=1189429&r1=1189428&r2=1189429&view=diff
==============================================================================
--- hbase/trunk/src/test/java/org/apache/hadoop/hbase/zookeeper/TestHQuorumPeer.java (original)
+++ hbase/trunk/src/test/java/org/apache/hadoop/hbase/zookeeper/TestHQuorumPeer.java Wed Oct 26 20:29:41 2011
@@ -52,7 +52,7 @@ public class TestHQuorumPeer {
     // Set it to a non-standard port.
     TEST_UTIL.getConfiguration().setInt("hbase.zookeeper.property.clientPort",
       PORT_NO);
-    this.dataDir = HBaseTestingUtility.getTestDir(this.getClass().getName());
+    this.dataDir = TEST_UTIL.getDataTestDir(this.getClass().getName());
     FileSystem fs = FileSystem.get(TEST_UTIL.getConfiguration());
     if (fs.exists(this.dataDir)) {
       if (!fs.delete(this.dataDir, true)) {



Mime
View raw message