I recommend using CassandraUnit (https://github.com/jsevellec/cassandra-unit). It makes using Cassandra in unit tests quite easy.

It allows you to start an embedded Cassandra synchronously with a single simple method call, optionally load your schema and initial data, and you're ready to start testing. 

I'm using it in many unit tests (although formally it's not a unit test anymore when relying on a cassandra node). The fantastic performance of Cassandra even allows me to clear all column families and insert the test fixture rows for each individual test case. 

Good luck,
Tom



On Fri, Nov 1, 2013 at 10:00 AM, Salih Kardan <kardan38@gmail.com> wrote:
Hi all,

I am a newbie to Cassandra and I am tring to write test cases to cassandra with JUnit. 
I use CassandraDaemon class to start cassandra in IntelliJ IDEA. I want to wait 
until Cassandra up and running before runnig test methods. How can I wait until cassandra starts or 
is there any way to check if cassandra is running (with Java)?

Thanks.
Salih Kardan



--

Drillster BV
Middenburcht 136
3452MT Vleuten
Netherlands

+31 30 755 5330

Open your free account at www.drillster.com