hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Guillaume Dufrêne <dufr...@argia.fr>
Subject Re: How to initialize a test environment ?
Date Wed, 14 Oct 2009 07:17:42 GMT
Hi Guilherme,

Our application already inherits from abstract Test classes (and it use 
spring test runner),
and as you know it's a problem to extends two java classes ^_^
Moreover we will probably migrate to junit 4.x soon.

In the past we encountered problem to run some test with junit 3.x and 
other with junit 4.x
I think there is a Junit Wrapper to run old fashioned tests but I did 
not try yet.

Anyway, I will try  to set up a test environment that follow your code 
sample.
But I'm still confused ... why I am not able to run HBase where as I'm 
doing more or less the same as "HBaseClusterTestCase".

Thanks for your help,
If you clue why I failed in starting HBase with my code, let me know :-)

--
Guillaume.


Guilherme Germoglio wrote:
> Hello Guillaume,
> What about extending org.apache.hadoop.hbase.HBaseClusterTestCase,
> instantiating it and invoking its setUp()? I know it isn't the most
> beautiful way to start HBase from java, but it works pretty well here.
>
> Something along the lines of:
>
> public class StandAloneServer extends HBaseClusterTestCase {
>
>     public StandAloneServer(Properties props) {
>         super();
>         // iterate over props map invoking: conf.set(propKey, propValue);
>     }
>
>     public static void main(String[] args) {
>       Properties props;
>       // load props from args[0], for example
>
>       StandAloneServer sas = new StandAloneServer(props);
>        // add close hook
>       Runtime.getRuntime().addShutdownHook(new Thread() {
>          public void run() {
>              sas.tearDown();
>          }
>       });
>
>       sas.setUp();
>     }
>
> }
>
>   



Ce message et toutes les pièces jointes sont établis à l'attention exclusive de leurs destinataires
et sont confidentiels. Si vous recevez ce message par erreur, merci de le détruire et d'en
avertir immédiatement l'expéditeur. L'internet ne permettant pas d'assurer l'intégrité
de ce message, le contenu de ce message ne représente en aucun cas un engagement de la part
de Leroy Merlin.


Mime
View raw message