You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by jd...@apache.org on 2010/05/19 01:23:02 UTC

svn commit: r945956 - in /hbase/trunk: CHANGES.txt core/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java core/src/test/java/org/apache/hadoop/hbase/TestZooKeeper.java

Author: jdcryans
Date: Tue May 18 23:23:02 2010
New Revision: 945956

URL: http://svn.apache.org/viewvc?rev=945956&view=rev
Log:
HBASE-2539  Cannot start ZK before the rest in tests anymore

Modified:
    hbase/trunk/CHANGES.txt
    hbase/trunk/core/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java
    hbase/trunk/core/src/test/java/org/apache/hadoop/hbase/TestZooKeeper.java

Modified: hbase/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hbase/trunk/CHANGES.txt?rev=945956&r1=945955&r2=945956&view=diff
==============================================================================
--- hbase/trunk/CHANGES.txt (original)
+++ hbase/trunk/CHANGES.txt Tue May 18 23:23:02 2010
@@ -334,6 +334,7 @@ Release 0.21.0 - Unreleased
    HBASE-2562  bin/hbase doesn't work in-situ in maven
                (Todd Lipcon via Stack)
    HBASE-2449  Local HBase does not stop properly
+   HBASE-2539  Cannot start ZK before the rest in tests anymore
 
   IMPROVEMENTS
    HBASE-1760  Cleanup TODOs in HTable

Modified: hbase/trunk/core/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java
URL: http://svn.apache.org/viewvc/hbase/trunk/core/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java?rev=945956&r1=945955&r2=945956&view=diff
==============================================================================
--- hbase/trunk/core/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java (original)
+++ hbase/trunk/core/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java Tue May 18 23:23:02 2010
@@ -151,13 +151,14 @@ public class HBaseTestingUtility {
    * @see #shutdownMiniZKCluster()
    */
   public void startMiniZKCluster() throws Exception {
-    isRunningCluster();
-    this.clusterTestBuildDir = setupClusterTestBuildDir();
-    startMiniZKCluster(this.clusterTestBuildDir);
+    startMiniZKCluster(setupClusterTestBuildDir());
 
   }
 
   private void startMiniZKCluster(final File dir) throws Exception {
+    if (this.zkCluster != null) {
+      throw new IOException("Cluster already running at " + dir);
+    }
     this.zkCluster = new MiniZooKeeperCluster();
     int clientPort = this.zkCluster.startup(dir);
     this.conf.set("hbase.zookeeper.property.clientPort",

Modified: hbase/trunk/core/src/test/java/org/apache/hadoop/hbase/TestZooKeeper.java
URL: http://svn.apache.org/viewvc/hbase/trunk/core/src/test/java/org/apache/hadoop/hbase/TestZooKeeper.java?rev=945956&r1=945955&r2=945956&view=diff
==============================================================================
--- hbase/trunk/core/src/test/java/org/apache/hadoop/hbase/TestZooKeeper.java (original)
+++ hbase/trunk/core/src/test/java/org/apache/hadoop/hbase/TestZooKeeper.java Tue May 18 23:23:02 2010
@@ -45,6 +45,8 @@ public class TestZooKeeper {
    */
   @BeforeClass
   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.startMiniCluster(1);
   }