You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@zookeeper.apache.org by litingli <li...@baidu.com> on 2011/06/30 06:09:36 UTC

About mock ZooKeeper

Dear  Mr ( or Mrs ) ZooKeeper:

I'm a test engineer of Baidu (China's Google). I'm writing this mail to ask if there is a mock ZooKeeper program  that supports stand-alone test. Our development engineers have developed a program with ZooKeeper, but  we do not want to use a real ZooKeeper cluster when we test it, a fake ZooKeeper cluster that can run on just a single machine will be more convenient.

By the way, we have downloaded release-3.3.3, but we are not clear about the fuction of release-3.3.3/src/c/tests  and  release-3.3.3/src/java/test , what can these codes test ?

I'm sorry to my poor English, hope you can understand what I mean :)

Best wishes!
----------------------------------------------
LI Tingli
Baidu China Co., Ltd.

Re: About mock ZooKeeper

Posted by "박영근 (Alex)" <al...@nexr.com>.
hi,

https://github.com/sgroschupf/zkclient

refer to unit tests in zkclient.

Gateway, InMemoryConnection, ZkServer.. are used to test on single host.

Hope this help,

- Alex

2011/6/30 lukai <lu...@gmail.com>

> It can be run on one box. You should read the documentation carefully.
>
> 2011/6/30 litingli <li...@baidu.com>
>
> > Dear  Mr ( or Mrs ) ZooKeeper:
> >
> > I'm a test engineer of Baidu (China's Google). I'm writing this mail to
> ask
> > if there is a mock ZooKeeper program  that supports stand-alone test. Our
> > development engineers have developed a program with ZooKeeper, but  we do
> > not want to use a real ZooKeeper cluster when we test it, a fake
> ZooKeeper
> > cluster that can run on just a single machine will be more convenient.
> >
> > By the way, we have downloaded release-3.3.3, but we are not clear about
> > the fuction of release-3.3.3/src/c/tests  and
>  release-3.3.3/src/java/test ,
> > what can these codes test ?
> >
> > I'm sorry to my poor English, hope you can understand what I mean :)
> >
> > Best wishes!
> > ----------------------------------------------
> > LI Tingli
> > Baidu China Co., Ltd.
> >
>

Re: About mock ZooKeeper

Posted by lukai <lu...@gmail.com>.
It can be run on one box. You should read the documentation carefully.

2011/6/30 litingli <li...@baidu.com>

> Dear  Mr ( or Mrs ) ZooKeeper:
>
> I'm a test engineer of Baidu (China's Google). I'm writing this mail to ask
> if there is a mock ZooKeeper program  that supports stand-alone test. Our
> development engineers have developed a program with ZooKeeper, but  we do
> not want to use a real ZooKeeper cluster when we test it, a fake ZooKeeper
> cluster that can run on just a single machine will be more convenient.
>
> By the way, we have downloaded release-3.3.3, but we are not clear about
> the fuction of release-3.3.3/src/c/tests  and  release-3.3.3/src/java/test ,
> what can these codes test ?
>
> I'm sorry to my poor English, hope you can understand what I mean :)
>
> Best wishes!
> ----------------------------------------------
> LI Tingli
> Baidu China Co., Ltd.
>

Re: About mock ZooKeeper

Posted by Thijs Terlouw <th...@gmail.com>.
The tests directory you refer to are *internal*
unit/integration/functionality tests. They test if a client correctly
connects to a ZK server for example, if it can create a node in ZK
etc. These tests are only important if you are changing the ZK client
and/or server.

For testing, I suggest you do not use a single ZK instance, because
that would probably not be the same as your production environment.
You can just setup a ZK cluster on a single machine though.

I also suggest you read the manual, because everything is explained
there. To test programs that use ZK, you should understand the
failures of ZK as well as the problems you are trying to solve with ZK
very good. For example network problems, race conditions etc.

Thijs Terlouw,
Shenzhen, China
http://www.startinchina.com


2011/6/30 litingli <li...@baidu.com>:
> Dear  Mr ( or Mrs ) ZooKeeper:
>
> I'm a test engineer of Baidu (China's Google). I'm writing this mail to ask if there is a mock ZooKeeper program  that supports stand-alone test. Our development engineers have developed a program with ZooKeeper, but  we do not want to use a real ZooKeeper cluster when we test it, a fake ZooKeeper cluster that can run on just a single machine will be more convenient.
>
> By the way, we have downloaded release-3.3.3, but we are not clear about the fuction of release-3.3.3/src/c/tests  and  release-3.3.3/src/java/test , what can these codes test ?