You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by st...@apache.org on 2011/10/26 22:39:29 UTC
svn commit: r1189434 [2/2] - in /hbase/branches/0.92: ./
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/t...
Modified: hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/master/TestMasterTransitions.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/master/TestMasterTransitions.java?rev=1189434&r1=1189433&r2=1189434&view=diff
==============================================================================
--- hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/master/TestMasterTransitions.java (original)
+++ hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/master/TestMasterTransitions.java Wed Oct 26 20:39:27 2011
@@ -66,7 +66,7 @@ public class TestMasterTransitions {
addToEachStartKey(countOfRegions);
}
- @AfterClass public static void afterAllTests() throws IOException {
+ @AfterClass public static void afterAllTests() throws Exception {
TEST_UTIL.shutdownMiniCluster();
}
Modified: hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/master/TestOpenedRegionHandler.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/master/TestOpenedRegionHandler.java?rev=1189434&r1=1189433&r2=1189434&view=diff
==============================================================================
--- hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/master/TestOpenedRegionHandler.java (original)
+++ hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/master/TestOpenedRegionHandler.java Wed Oct 26 20:39:27 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/branches/0.92/src/test/java/org/apache/hadoop/hbase/master/TestRestartCluster.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/master/TestRestartCluster.java?rev=1189434&r1=1189433&r2=1189434&view=diff
==============================================================================
--- hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/master/TestRestartCluster.java (original)
+++ hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/master/TestRestartCluster.java Wed Oct 26 20:39:27 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/branches/0.92/src/test/java/org/apache/hadoop/hbase/master/TestZKBasedOpenCloseRegion.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/master/TestZKBasedOpenCloseRegion.java?rev=1189434&r1=1189433&r2=1189434&view=diff
==============================================================================
--- hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/master/TestZKBasedOpenCloseRegion.java (original)
+++ hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/master/TestZKBasedOpenCloseRegion.java Wed Oct 26 20:39:27 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/branches/0.92/src/test/java/org/apache/hadoop/hbase/regionserver/TestBlocksRead.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/regionserver/TestBlocksRead.java?rev=1189434&r1=1189433&r2=1189434&view=diff
==============================================================================
--- hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/regionserver/TestBlocksRead.java (original)
+++ hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/regionserver/TestBlocksRead.java Wed Oct 26 20:39:27 2011
@@ -41,7 +41,6 @@ import org.apache.hadoop.hbase.client.Pu
import org.apache.hadoop.hbase.client.Scan;
import org.apache.hadoop.hbase.io.hfile.BlockCache;
import org.apache.hadoop.hbase.io.hfile.CacheConfig;
-import org.apache.hadoop.hbase.io.hfile.LruBlockCache;
import org.apache.hadoop.hbase.util.Bytes;
import org.apache.hadoop.hbase.util.EnvironmentEdgeManagerTestHelper;
import org.junit.Test;
@@ -60,8 +59,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/branches/0.92/src/test/java/org/apache/hadoop/hbase/regionserver/TestColumnSeeking.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/regionserver/TestColumnSeeking.java?rev=1189434&r1=1189433&r2=1189434&view=diff
==============================================================================
--- hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/regionserver/TestColumnSeeking.java (original)
+++ hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/regionserver/TestColumnSeeking.java Wed Oct 26 20:39:27 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/branches/0.92/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactSelection.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactSelection.java?rev=1189434&r1=1189433&r2=1189434&view=diff
==============================================================================
--- hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactSelection.java (original)
+++ hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactSelection.java Wed Oct 26 20:39:27 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/branches/0.92/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompaction.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompaction.java?rev=1189434&r1=1189433&r2=1189434&view=diff
==============================================================================
--- hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompaction.java (original)
+++ hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompaction.java Wed Oct 26 20:39:27 2011
@@ -38,10 +38,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;
@@ -53,6 +50,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;
@@ -62,6 +61,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;
@@ -72,7 +73,6 @@ public class TestCompaction extends HBas
private byte[] firstRowBytes, secondRowBytes, thirdRowBytes;
final private byte[] col1, col2;
- private MiniDFSCluster cluster;
/** constructor */
public TestCompaction() throws Exception {
@@ -81,7 +81,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);
@@ -97,10 +96,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);
@@ -111,9 +106,6 @@ public class TestCompaction extends HBas
HLog hlog = r.getLog();
this.r.close();
hlog.closeAndDelete();
- if (this.cluster != null) {
- shutdownDfs(cluster);
- }
super.tearDown();
}
@@ -427,7 +419,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 {
@@ -498,7 +490,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/branches/0.92/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompoundBloomFilter.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompoundBloomFilter.java?rev=1189434&r1=1189433&r2=1189434&view=diff
==============================================================================
--- hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompoundBloomFilter.java (original)
+++ hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompoundBloomFilter.java Wed Oct 26 20:39:27 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.hasBloom());
Modified: hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/regionserver/TestEndToEndSplitTransaction.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/regionserver/TestEndToEndSplitTransaction.java?rev=1189434&r1=1189433&r2=1189434&view=diff
==============================================================================
--- hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/regionserver/TestEndToEndSplitTransaction.java (original)
+++ hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/regionserver/TestEndToEndSplitTransaction.java Wed Oct 26 20:39:27 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/branches/0.92/src/test/java/org/apache/hadoop/hbase/regionserver/TestFSErrorsExposed.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/regionserver/TestFSErrorsExposed.java?rev=1189434&r1=1189433&r2=1189434&view=diff
==============================================================================
--- hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/regionserver/TestFSErrorsExposed.java (original)
+++ hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/regionserver/TestFSErrorsExposed.java Wed Oct 26 20:39:27 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/branches/0.92/src/test/java/org/apache/hadoop/hbase/regionserver/TestGetClosestAtOrBefore.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/regionserver/TestGetClosestAtOrBefore.java?rev=1189434&r1=1189433&r2=1189434&view=diff
==============================================================================
--- hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/regionserver/TestGetClosestAtOrBefore.java (original)
+++ hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/regionserver/TestGetClosestAtOrBefore.java Wed Oct 26 20:39:27 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/branches/0.92/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java?rev=1189434&r1=1189433&r2=1189434&view=diff
==============================================================================
--- hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java (original)
+++ hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java Wed Oct 26 20:39:27 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/branches/0.92/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionInfo.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionInfo.java?rev=1189434&r1=1189433&r2=1189434&view=diff
==============================================================================
--- hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionInfo.java (original)
+++ hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionInfo.java Wed Oct 26 20:39:27 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/branches/0.92/src/test/java/org/apache/hadoop/hbase/regionserver/TestMultiColumnScanner.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/regionserver/TestMultiColumnScanner.java?rev=1189434&r1=1189433&r2=1189434&view=diff
==============================================================================
--- hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/regionserver/TestMultiColumnScanner.java (original)
+++ hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/regionserver/TestMultiColumnScanner.java Wed Oct 26 20:39:27 2011
@@ -282,7 +282,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/branches/0.92/src/test/java/org/apache/hadoop/hbase/regionserver/TestResettingCounters.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/regionserver/TestResettingCounters.java?rev=1189434&r1=1189433&r2=1189434&view=diff
==============================================================================
--- hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/regionserver/TestResettingCounters.java (original)
+++ hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/regionserver/TestResettingCounters.java Wed Oct 26 20:39:27 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/branches/0.92/src/test/java/org/apache/hadoop/hbase/regionserver/TestScanner.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/regionserver/TestScanner.java?rev=1189434&r1=1189433&r2=1189434&view=diff
==============================================================================
--- hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/regionserver/TestScanner.java (original)
+++ hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/regionserver/TestScanner.java Wed Oct 26 20:39:27 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/branches/0.92/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitTransaction.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitTransaction.java?rev=1189434&r1=1189433&r2=1189434&view=diff
==============================================================================
--- hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitTransaction.java (original)
+++ hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitTransaction.java Wed Oct 26 20:39:27 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/branches/0.92/src/test/java/org/apache/hadoop/hbase/regionserver/TestStore.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/regionserver/TestStore.java?rev=1189434&r1=1189433&r2=1189434&view=diff
==============================================================================
--- hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/regionserver/TestStore.java (original)
+++ hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/regionserver/TestStore.java Wed Oct 26 20:39:27 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/branches/0.92/src/test/java/org/apache/hadoop/hbase/regionserver/TestStoreFile.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/regionserver/TestStoreFile.java?rev=1189434&r1=1189433&r2=1189434&view=diff
==============================================================================
--- hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/regionserver/TestStoreFile.java (original)
+++ hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/regionserver/TestStoreFile.java Wed Oct 26 20:39:27 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 {
@@ -646,8 +628,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/branches/0.92/src/test/java/org/apache/hadoop/hbase/regionserver/TestWideScanner.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/regionserver/TestWideScanner.java?rev=1189434&r1=1189433&r2=1189434&view=diff
==============================================================================
--- hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/regionserver/TestWideScanner.java (original)
+++ hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/regionserver/TestWideScanner.java Wed Oct 26 20:39:27 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/branches/0.92/src/test/java/org/apache/hadoop/hbase/regionserver/handler/TestCloseRegionHandler.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/regionserver/handler/TestCloseRegionHandler.java?rev=1189434&r1=1189433&r2=1189434&view=diff
==============================================================================
--- hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/regionserver/handler/TestCloseRegionHandler.java (original)
+++ hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/regionserver/handler/TestCloseRegionHandler.java Wed Oct 26 20:39:27 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/branches/0.92/src/test/java/org/apache/hadoop/hbase/regionserver/handler/TestOpenRegionHandler.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/regionserver/handler/TestOpenRegionHandler.java?rev=1189434&r1=1189433&r2=1189434&view=diff
==============================================================================
--- hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/regionserver/handler/TestOpenRegionHandler.java (original)
+++ hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/regionserver/handler/TestOpenRegionHandler.java Wed Oct 26 20:39:27 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/branches/0.92/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestHLog.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestHLog.java?rev=1189434&r1=1189433&r2=1189434&view=diff
==============================================================================
--- hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestHLog.java (original)
+++ hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestHLog.java Wed Oct 26 20:39:27 2011
@@ -92,6 +92,7 @@ public class TestHLog {
@After
public void tearDown() throws Exception {
}
+
@BeforeClass
public static void setUpBeforeClass() throws Exception {
// Make block sizes small.
Modified: hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestHLogMethods.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestHLogMethods.java?rev=1189434&r1=1189433&r2=1189434&view=diff
==============================================================================
--- hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestHLogMethods.java (original)
+++ hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestHLogMethods.java Wed Oct 26 20:39:27 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/branches/0.92/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestLogRollAbort.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestLogRollAbort.java?rev=1189434&r1=1189433&r2=1189434&view=diff
==============================================================================
--- hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestLogRollAbort.java (original)
+++ hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestLogRollAbort.java Wed Oct 26 20:39:27 2011
@@ -113,7 +113,7 @@ public class TestLogRollAbort {
}
@After
- public void tearDown() throws IOException {
+ public void tearDown() throws Exception {
TEST_UTIL.shutdownMiniCluster();
}
Modified: hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestLogRolling.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestLogRolling.java?rev=1189434&r1=1189433&r2=1189434&view=diff
==============================================================================
--- hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestLogRolling.java (original)
+++ hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestLogRolling.java Wed Oct 26 20:39:27 2011
@@ -76,11 +76,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
{
@@ -99,19 +99,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
@@ -174,8 +171,7 @@ public class TestLogRolling {
}
@After
- public void tearDown() throws IOException {
- TEST_UTIL.cleanupTestDir();
+ public void tearDown() throws Exception {
TEST_UTIL.shutdownMiniCluster();
}
Modified: hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestWALActionsListener.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestWALActionsListener.java?rev=1189434&r1=1189433&r2=1189434&view=diff
==============================================================================
--- hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestWALActionsListener.java (original)
+++ hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestWALActionsListener.java Wed Oct 26 20:39:27 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/branches/0.92/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationPeer.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationPeer.java?rev=1189434&r1=1189433&r2=1189434&view=diff
==============================================================================
--- hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationPeer.java (original)
+++ hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationPeer.java Wed Oct 26 20:39:27 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/branches/0.92/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestReplicationSourceManager.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestReplicationSourceManager.java?rev=1189434&r1=1189433&r2=1189434&view=diff
==============================================================================
--- hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestReplicationSourceManager.java (original)
+++ hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestReplicationSourceManager.java Wed Oct 26 20:39:27 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/branches/0.92/src/test/java/org/apache/hadoop/hbase/thrift/TestThriftServer.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/thrift/TestThriftServer.java?rev=1189434&r1=1189433&r2=1189434&view=diff
==============================================================================
--- hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/thrift/TestThriftServer.java (original)
+++ hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/thrift/TestThriftServer.java Wed Oct 26 20:39:27 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/branches/0.92/src/test/java/org/apache/hadoop/hbase/util/TestFSTableDescriptors.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/util/TestFSTableDescriptors.java?rev=1189434&r1=1189433&r2=1189434&view=diff
==============================================================================
--- hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/util/TestFSTableDescriptors.java (original)
+++ hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/util/TestFSTableDescriptors.java Wed Oct 26 20:39:27 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/branches/0.92/src/test/java/org/apache/hadoop/hbase/zookeeper/TestHQuorumPeer.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/zookeeper/TestHQuorumPeer.java?rev=1189434&r1=1189433&r2=1189434&view=diff
==============================================================================
--- hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/zookeeper/TestHQuorumPeer.java (original)
+++ hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/zookeeper/TestHQuorumPeer.java Wed Oct 26 20:39:27 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)) {