HBASE-2539 Cannot start ZK before the rest in tests anymore

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@945956 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jean-Daniel Cryans 2010-05-18 23:23:02 +00:00
parent a1d6943297
commit 96321df582
3 changed files with 7 additions and 3 deletions

View File

@ -334,6 +334,7 @@ Release 0.21.0 - Unreleased
HBASE-2562 bin/hbase doesn't work in-situ in maven HBASE-2562 bin/hbase doesn't work in-situ in maven
(Todd Lipcon via Stack) (Todd Lipcon via Stack)
HBASE-2449 Local HBase does not stop properly HBASE-2449 Local HBase does not stop properly
HBASE-2539 Cannot start ZK before the rest in tests anymore
IMPROVEMENTS IMPROVEMENTS
HBASE-1760 Cleanup TODOs in HTable HBASE-1760 Cleanup TODOs in HTable

View File

@ -151,13 +151,14 @@ public class HBaseTestingUtility {
* @see #shutdownMiniZKCluster() * @see #shutdownMiniZKCluster()
*/ */
public void startMiniZKCluster() throws Exception { public void startMiniZKCluster() throws Exception {
isRunningCluster(); startMiniZKCluster(setupClusterTestBuildDir());
this.clusterTestBuildDir = setupClusterTestBuildDir();
startMiniZKCluster(this.clusterTestBuildDir);
} }
private void startMiniZKCluster(final File dir) throws Exception { private void startMiniZKCluster(final File dir) throws Exception {
if (this.zkCluster != null) {
throw new IOException("Cluster already running at " + dir);
}
this.zkCluster = new MiniZooKeeperCluster(); this.zkCluster = new MiniZooKeeperCluster();
int clientPort = this.zkCluster.startup(dir); int clientPort = this.zkCluster.startup(dir);
this.conf.set("hbase.zookeeper.property.clientPort", this.conf.set("hbase.zookeeper.property.clientPort",

View File

@ -45,6 +45,8 @@ public class TestZooKeeper {
*/ */
@BeforeClass @BeforeClass
public static void setUpBeforeClass() throws Exception { public static void setUpBeforeClass() throws Exception {
// Test we can first start the ZK cluster by itself
TEST_UTIL.startMiniZKCluster();
TEST_UTIL.getConfiguration().setBoolean("dfs.support.append", true); TEST_UTIL.getConfiguration().setBoolean("dfs.support.append", true);
TEST_UTIL.startMiniCluster(1); TEST_UTIL.startMiniCluster(1);
} }