You might be interested in new class in TRUNK called HBaseTestingUtility. It was added to help our move to junit4 from junit3. For example usage where we spin up a minicluster once, perform a suite of tests and then shut down the minicluster, see TestFromClientSide or TestAdmin. The spinup and shutdown of the cluster is done via junit4 @BeforeClass and @AfterClass. Do h...@getconfiguration to get an HBaseConfiguration with all ports already set. You'll probably want to add src/test/hbase-site.xml to your CLASSPATH running tests in general but also running with HTU as it has configuration to make test suite run snappier. You'll probably also want settings it has such as hbase.regionserver.info.port = -1 which suppresses the UI else you'll run into bind issues when you have > 1 regionserver up and running in the one JVM. St.Ack
On Tue, Oct 20, 2009 at 8:54 AM, Renaud Delbru <[email protected]>wrote: > Ok, I found the solution: > HBaseClusterTestCase instantiates a zookeeper cluster, but without using > the default zookeeper port (2181). So, when I was trying to instantiate a > zookeeper connection, it failed since I was using the default port. > To get the right zookeeper port, you have to get it from the > HBaseConfiguration object using the property key > "hbase.zookeeper.property.clientPort". > > -- > Renaud Delbru > > > On 20/10/09 16:10, Renaud Delbru wrote: > >> Small correction: >> In fact, the error occurs during the second step, not the third one. >> > >
