Re: Writing unit tests against HBase

2013-06-24 Thread Adam Phelps
On 6/18/13 4:22 PM, Stack wrote: On Tue, Jun 18, 2013 at 4:17 PM, Varun Sharma va...@pinterest.com wrote: Hi, If I wanted to write to write a unit test against HTable/HBase, is there an already available utility to that for unit testing my application logic. I don't want to write code

Re: Writing unit tests against HBase

2013-06-24 Thread Dhaval Shah
From: Adam Phelps a...@opendns.com To: user@hbase.apache.org Sent: Monday, 24 June 2013 5:14 PM Subject: Re: Writing unit tests against HBase On 6/18/13 4:22 PM, Stack wrote: On Tue, Jun 18, 2013 at 4:17 PM, Varun Sharma va...@pinterest.com wrote: Hi, If I wanted to write to write

Re: Writing unit tests against HBase

2013-06-24 Thread Adam Phelps
data in HBase tables but I still feel this is more intuitive and reliable. Regards, Dhaval From: Adam Phelps a...@opendns.com To: user@hbase.apache.org Sent: Monday, 24 June 2013 5:14 PM Subject: Re: Writing unit tests against HBase On 6/18/13 4:22

Re: Writing unit tests against HBase

2013-06-24 Thread Christophe Taton
Hey Adam, Here is how to use fake-hbase from Java: final Configuration conf = new Configuration(); final FakeHBase fakeHBase = new FakeHBase(); final HBaseAdmin admin = fakeHBase.getAdminFactory().create(conf); final HTableDescriptor desc = new HTableDescriptor(table); desc.addFamily(new

Re: Writing unit tests against HBase

2013-06-24 Thread Dhaval Shah
will have to populate data in HBase tables but I still feel this is more intuitive and reliable. Regards, Dhaval From: Adam Phelps a...@opendns.com To: user@hbase.apache.org Sent: Monday, 24 June 2013 5:14 PM Subject: Re: Writing unit tests against HBase

Re: Writing unit tests against HBase

2013-06-24 Thread Adam Phelps
Thansk, that set me on the right path. For anyone else reading along, I also needed to add: dependency groupIdorg.scala-lang/groupId artifactIdscala-library/artifactId version2.9.0/version scopetest/scope /dependency

Re: Writing unit tests against HBase

2013-06-20 Thread Varun Sharma
Now that I think about it - this may not be as simple. The client could mix its calls with Filters etc. which the fake in memory HTable would need to support. It seems the best route would be to run the end to end test like Elliot suggested. Varun On Tue, Jun 18, 2013 at 4:46 PM, Elliott Clark

Re: Writing unit tests against HBase

2013-06-20 Thread Christophe Taton
Hey Varun, On Thu, Jun 20, 2013 at 11:56 AM, Varun Sharma va...@pinterest.com wrote: Now that I think about it - this may not be as simple. The client could mix its calls with Filters etc. which the fake in memory HTable would need to support. It seems the best route would be to run the end

Re: Writing unit tests against HBase

2013-06-20 Thread Varun Sharma
Hi Christopher, I am looking into getting maven 3.0.4 installed before i start playing with it. Elliot, does the HBaseTestingUtility thing run only against DFS. I tried to bring up a MiniHBaseCLuster with distributed=false and got the following trail when trying to run without a MiniDfsCluster

Re: Writing unit tests against HBase

2013-06-20 Thread Asaf Mesika
You shouldn't tweak any Configuration at all. It simply works - setting up both mini HDFS and mini HBase. On Fri, Jun 21, 2013 at 2:36 AM, Varun Sharma va...@pinterest.com wrote: Hi Christopher, I am looking into getting maven 3.0.4 installed before i start playing with it. Elliot, does

Writing unit tests against HBase

2013-06-18 Thread Varun Sharma
Hi, If I wanted to write to write a unit test against HTable/HBase, is there an already available utility to that for unit testing my application logic. I don't want to write code that either touches production or requires me to mock an HTable. I am looking for a test htable object which behaves

Re: Writing unit tests against HBase

2013-06-18 Thread Stack
On Tue, Jun 18, 2013 at 4:17 PM, Varun Sharma va...@pinterest.com wrote: Hi, If I wanted to write to write a unit test against HTable/HBase, is there an already available utility to that for unit testing my application logic. I don't want to write code that either touches production or

Re: Writing unit tests against HBase

2013-06-18 Thread Elliott Clark
The other option (not really a true unit test I agree) is to use HBaseTestingUtility [1]. It spins up a pretty full cluster inside of your junit tests and will behave pretty close to what a real cluster will. 1.