|
|
-
Where to place HTable.exists() tests?
Jean-Marc Spaggiari 2013-01-05, 16:30
Hi,
I'm building public boolean[] exists(Get[] gets) to have the ability to do multiple exists at the same time, and I'm wondering where I should put the tests for that.
Seems that there is no specific test class for the exist(Get get) method, neither there is a testHTable class.
Where is the best place to place a test for public boolean[] exists(Get[] gets)?
Thanks,
JM
-
Re: Where to place HTable.exists() tests?
Nicolas Liochon 2013-01-05, 17:01
Hi,
Look at the tests in the client package. Typically TestFromClientSide. You may want to write some 'pure' unit test as well (i.e. small category). Then you may want to create a specific class. And I wouldn't be against a test class for HTable, especially is it can be one that doesn't start a cluster.
In all cases, public boolean[] exists(Get[] gets) is not good imho. You need this to be consistent with the API: public Boolean[] exists(List<Get> gets)
Boolean and not boolean to manage the failures (null means failure for this get). List vs. array purely for consistency.
Cheers,
Nicolas On Sat, Jan 5, 2013 at 5:30 PM, Jean-Marc Spaggiari <[EMAIL PROTECTED] > wrote:
> public boolean[] exists(Get[] gets
-
Re: Where to place HTable.exists() tests?
Jean-Marc Spaggiari 2013-01-05, 17:35
Hi Nicolas,
Thanks for pointing me to the right direction.
I changed the method signature with the one you have recommanded.
Regarding the test for exists, it's not really tested today. So I agree that a HTable test class might be good. However, I think I'm not good enought yet in HBase to build it. I will still try and see what I can do. Can you point me to another test class which is doing tests without starting the MiniCluster?
Thanks,
JM
2013/1/5, Nicolas Liochon <[EMAIL PROTECTED]>: > Hi, > > Look at the tests in the client package. Typically TestFromClientSide. > You may want to write some 'pure' unit test as well (i.e. small category). > Then you may want to create a specific class. > And I wouldn't be against a test class for HTable, especially is it can be > one that doesn't start a cluster. > > In all cases, public boolean[] exists(Get[] gets) is not good imho. > You need this to be consistent with the API: > public Boolean[] exists(List<Get> gets) > > Boolean and not boolean to manage the failures (null means failure for this > get). > List vs. array purely for consistency. > > Cheers, > > Nicolas > > > On Sat, Jan 5, 2013 at 5:30 PM, Jean-Marc Spaggiari > <[EMAIL PROTECTED] >> wrote: > >> public boolean[] exists(Get[] gets >
-
Re: Where to place HTable.exists() tests?
Nicolas Liochon 2013-01-05, 17:49
Any class with @Category(SmallTests.class) TestAssignmentManager is an example of class that uses a mockup instead of launching a cluster.
Nicolas
On Sat, Jan 5, 2013 at 6:35 PM, Jean-Marc Spaggiari <[EMAIL PROTECTED] > wrote:
> tests > without starting the MiniCluster? >
|
|