You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Eran Chinthaka Withana <er...@gmail.com> on 2012/06/04 07:10:30 UTC

Integration Testing for Cassandra

Hi,

I want to write integration tests related to my cassandra code where
instead of accessing production clusters I should be able to start an
embedded cassandra instance, within my unit test code, populate some data
and run test cases.

I found this[1]  as the closest to what I'm looking for (I prefer to use
thrift API so didn't even think about using storage proxy API). I'm using
Hector 1.0.x as my client to connect my cassandra 1.0.x clusters. Before I
go ahead and use it, is this the recommended way to test Cassandra related
client code? Are there any test utils already in Cassandra code base? I
really appreciate if someone can shed some light here.

[1]
http://prettyprint.me/2010/02/14/running-cassandra-as-an-embedded-service/

Thanks,
Eran Chinthaka Withana

Re: Integration Testing for Cassandra

Posted by David McNelis <dm...@gmail.com>.
That article is a good starting point.  To make your life a bit easier,
consider checking out CassandraUnit that provides facilities to load
example data in a variety of ways.

https://github.com/jsevellec/cassandra-unit

Then you just need to be able to pass in which cassandra instance to
connect to before you execute your code (embedded versus external
environment).

On Mon, Jun 4, 2012 at 12:10 AM, Eran Chinthaka Withana <
eran.chinthaka@gmail.com> wrote:

> Hi,
>
> I want to write integration tests related to my cassandra code where
> instead of accessing production clusters I should be able to start an
> embedded cassandra instance, within my unit test code, populate some data
> and run test cases.
>
> I found this[1]  as the closest to what I'm looking for (I prefer to use
> thrift API so didn't even think about using storage proxy API). I'm using
> Hector 1.0.x as my client to connect my cassandra 1.0.x clusters. Before I
> go ahead and use it, is this the recommended way to test Cassandra related
> client code? Are there any test utils already in Cassandra code base? I
> really appreciate if someone can shed some light here.
>
> [1]
> http://prettyprint.me/2010/02/14/running-cassandra-as-an-embedded-service/
>
> Thanks,
> Eran Chinthaka Withana
>