You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hbase.apache.org by Wei Tan <wt...@us.ibm.com> on 2013/01/31 08:27:21 UTC

maven junit test of a coprocessor

Hi,
I am writing a maven junit test for a HBase coprocessor. The problem is 
that, I want to write a junit test that deploy the cp jar into a cluster, 
and test its function. However, test is before install so I cannot get a 
cp jar to deploy at that time.
Is this like a chicken-and-egg problem? Any advice? Thanks!
Wei

Re: maven junit test of a coprocessor

Posted by Gary Helmling <gh...@gmail.com>.
If you're writing a junit test that spins up a mini cluster to test the
coprocessor, then there's no need to deploy the jar into HDFS just for
testing.  The coprocessor class should already be on your test classpath.
 In your test's setup method, you just need to either: a) add the
coprocessor class name to the configuration (as
hbase.coprocessor.region.classes) or b) to the HTableDescriptor before you
create the table.

Take a look at the following HBase test classes as an example:

org.apache.hadoop.hbase.coprocessor.TestRegionObserverInterface
org.apache.hadoop.hbase.coprocessor.TestCoprocessorEndpoint




On Wed, Jan 30, 2013 at 11:27 PM, Wei Tan <wt...@us.ibm.com> wrote:

> Hi,
> I am writing a maven junit test for a HBase coprocessor. The problem is
> that, I want to write a junit test that deploy the cp jar into a cluster,
> and test its function. However, test is before install so I cannot get a
> cp jar to deploy at that time.
> Is this like a chicken-and-egg problem? Any advice? Thanks!
> Wei