Re: Running Cassandra in Integration Tests

2017-04-28 Thread kurt greaves
Use ccmlib. https://github.com/pcmanus/ccm

On 28 April 2017 at 12:59, Matteo Moci  wrote:

> Sorry for bumping this old thread, but what would be your suggestion for
> programmatically start/stop nodes in a cluster?
>
> I'd like to make some experiments and perform QUORUM writes against a
> cluster (REPLICATION=3) with alternatively 2 or 3 nodes up,
> starting/stopping/restarting nodes in the middle, etc...  to understand
> the behaviour.
>
>
>
> On Fri, Oct 7, 2016 at 3:43 PM, Eric Stevens  wrote:
>
>> If you happen to be using Scala, we recently released some tooling we
>> wrote around using CCM for integration testing:
>> https://github.com/protectwise/cassandra-util
>>
>> You define clusters and nodes in configuration, then ask the service to
>> go:
>> https://github.com/protectwise/cassandra-util/blob/master/
>> ccm-testing-helper/src/main/scala/com/protectwise/testing/
>> ccm/CassandraSetup.scala#L147
>>
>> It'll create your clusters and tear them down automatically when
>> execution completes.
>>
>> On Thu, Oct 6, 2016 at 11:50 PM Edward Capriolo 
>> wrote:
>>
>>> Checkout https://github.com/edwardcapriolo/farsandra. It falls under
>>> the realm of almost 100% pure java (besides the fact it uses some shell to
>>> launch Cassandra).
>>>
>>> On Thu, Oct 6, 2016 at 7:08 PM, Ali Akhtar  wrote:
>>>
>>> Is it possible to create an isolated cassandra instance which is run
>>> during integration tests and it disappears after tests have finished
>>> running? Then its recreated the next time tests run (perhaps being
>>> populated with test data).
>>>
>>>  I'm using Java.
>>>
>>>
>>>
>>>
>
>
> --
> Matteo Moci
> http://mox.fm
>
>


Re: Running Cassandra in Integration Tests

2017-04-28 Thread Matteo Moci
Sorry for bumping this old thread, but what would be your suggestion for
programmatically start/stop nodes in a cluster?

I'd like to make some experiments and perform QUORUM writes against a
cluster (REPLICATION=3) with alternatively 2 or 3 nodes up,
starting/stopping/restarting nodes in the middle, etc...  to understand the
behaviour.



On Fri, Oct 7, 2016 at 3:43 PM, Eric Stevens  wrote:

> If you happen to be using Scala, we recently released some tooling we
> wrote around using CCM for integration testing:
> https://github.com/protectwise/cassandra-util
>
> You define clusters and nodes in configuration, then ask the service to go:
> https://github.com/protectwise/cassandra-util/blob/master/ccm-testing-
> helper/src/main/scala/com/protectwise/testing/ccm/
> CassandraSetup.scala#L147
>
> It'll create your clusters and tear them down automatically when execution
> completes.
>
> On Thu, Oct 6, 2016 at 11:50 PM Edward Capriolo 
> wrote:
>
>> Checkout https://github.com/edwardcapriolo/farsandra. It falls under the
>> realm of almost 100% pure java (besides the fact it uses some shell to
>> launch Cassandra).
>>
>> On Thu, Oct 6, 2016 at 7:08 PM, Ali Akhtar  wrote:
>>
>> Is it possible to create an isolated cassandra instance which is run
>> during integration tests and it disappears after tests have finished
>> running? Then its recreated the next time tests run (perhaps being
>> populated with test data).
>>
>>  I'm using Java.
>>
>>
>>
>>


-- 
Matteo Moci
http://mox.fm


Re: Running Cassandra in Integration Tests

2016-10-07 Thread Eric Stevens
If you happen to be using Scala, we recently released some tooling we wrote
around using CCM for integration testing:
https://github.com/protectwise/cassandra-util

You define clusters and nodes in configuration, then ask the service to go:
https://github.com/protectwise/cassandra-util/blob/master/ccm-testing-helper/src/main/scala/com/protectwise/testing/ccm/CassandraSetup.scala#L147

It'll create your clusters and tear them down automatically when execution
completes.

On Thu, Oct 6, 2016 at 11:50 PM Edward Capriolo 
wrote:

> Checkout https://github.com/edwardcapriolo/farsandra. It falls under the
> realm of almost 100% pure java (besides the fact it uses some shell to
> launch Cassandra).
>
> On Thu, Oct 6, 2016 at 7:08 PM, Ali Akhtar  wrote:
>
> Is it possible to create an isolated cassandra instance which is run
> during integration tests and it disappears after tests have finished
> running? Then its recreated the next time tests run (perhaps being
> populated with test data).
>
>  I'm using Java.
>
>
>
>


Re: Running Cassandra in Integration Tests

2016-10-06 Thread Edward Capriolo
Checkout https://github.com/edwardcapriolo/farsandra. It falls under the
realm of almost 100% pure java (besides the fact it uses some shell to
launch Cassandra).

On Thu, Oct 6, 2016 at 7:08 PM, Ali Akhtar  wrote:

> Is it possible to create an isolated cassandra instance which is run
> during integration tests and it disappears after tests have finished
> running? Then its recreated the next time tests run (perhaps being
> populated with test data).
>
>  I'm using Java.
>
>
>


Re: Running Cassandra in Integration Tests

2016-10-06 Thread Jonathan Haddad
3.9 falls under the Tick Tock release cycle, which is almost completely
untested in production by experienced operators.  In the cases where it has
been tested, there have been numerous bugs found which I (and I think most
people on this list) consider to be show stoppers.  Additionally, the Tick
Tock release cycle puts the operator in the uncomfortable position of
having to decide between upgrading to a new version with new features
(probably new bugs) or back porting bug fixes from future versions
themselves.There will never be a 3.9.1 release which fixes bugs in 3.9
without adding new features.

https://github.com/apache/cassandra/blob/trunk/NEWS.txt

For new projects I recommend starting with the recently released 3.0.9.

Assuming the project changes it's policy on releases (all signs point to
yes), then by the time 4.0 rolls out a lot of the features which have been
released in the 3.x series will have matured a bit, so it's very possible
4.0 will stabilize faster than the usual 6 months it takes for a major
release.

All that said, there's nothing wrong with doing compatibility & smoke tests
against the latest 3.x release as well as 3.0 and reporting bugs back to
the Apache Cassandra JIRA, I'm sure it would be greatly appreciated.

https://issues.apache.org/jira/secure/Dashboard.jspa

Jon

On Thu, Oct 6, 2016 at 5:35 PM Ali Akhtar  wrote:

> That looks great Andrew, but it doesn't seem to have been committed to for
> 5 months. Is anyone still using cassandra-unit , does it work with latest
> cassandra versions (e.g 3.9)?
>
> On Fri, Oct 7, 2016 at 5:33 AM, Andrew Tolbert <
> andrew.tolb...@datastax.com> wrote:
>
> Hi Ali,
>
> cassandra-unit  might be
> what you are looking for.  It allows you to run an embedded cassandra
> instance along side your tests and has some nice integration with JUnit.
>
> Thanks,
> Andy
>
> On Thu, Oct 6, 2016 at 7:13 PM Ali Akhtar  wrote:
>
> Ok, but that's not what this question is about.
>
> I'm looking for a way to run an embedded cassandra instance which is
> created & destroyed during tests and which doesn't persist any state
> outside the tests.
>
>
> On Fri, Oct 7, 2016 at 5:10 AM, Kant Kodali  wrote:
>
> you dont need to look for cassandra java api to start/stop instance. you
> just need to write a shell script or python or java or any language to
> execute shell commands!
>
>
>
> On Thu, Oct 6, 2016 4:57 PM, Ali Akhtar ali.rac...@gmail.com wrote:
>
> Okay.. but how would I start this instance? Is there a java api to
> programmatically start / destroy an instance during tests?
>
> On Fri, Oct 7, 2016 at 4:56 AM, Kant Kodali  wrote:
>
> sure as long as that isolated instance is treated as separate cluster you
> shouldn't run into any problems.
>
>
>
> On Thu, Oct 6, 2016 4:08 PM, Ali Akhtar ali.rac...@gmail.com wrote:
>
> Is it possible to create an isolated cassandra instance which is run
> during integration tests and it disappears after tests have finished
> running? Then its recreated the next time tests run (perhaps being
> populated with test data).
>
>  I'm using Java.
>
>
>
>
>
>


Re: Running Cassandra in Integration Tests

2016-10-06 Thread Peddi, Praveen
Our application takes care of creating keyspace and tables as necessary. Our 
tests didn't need to worry about that.

On Oct 6, 2016, at 9:22 PM, Ali Akhtar 
<ali.rac...@gmail.com<mailto:ali.rac...@gmail.com>> wrote:

Oh, and how do you generate your tables / keyspaces for the tests (if you do)?

On Fri, Oct 7, 2016 at 6:21 AM, Ali Akhtar 
<ali.rac...@gmail.com<mailto:ali.rac...@gmail.com>> wrote:
Peddi,

Thanks, does this start @ localhost, default port? And, mind sharing which 
version of cassandra you use this with? will this work on 3.9, or on 3.7?

Also, why is the config in a temp location - wouldn't it be better to put it in 
src/test/resources and try to specify that?

Thanks.

On Fri, Oct 7, 2016 at 6:17 AM, Peddi, Praveen 
<pe...@amazon.com<mailto:pe...@amazon.com>> wrote:
Honestly there isn't much code to share. Here is the code (excluded exception 
handling). For yaml location, we have the classpathpath and write to temp 
location everytime.

System.setProperty("cassandra.config", "file://" + YAML_LOCATION);
cassandraDaemon = new CassandraDaemon();
 cassandraDaemon.init(null);
cassandraDaemon.start();

//stop cassandra after tests are done
cassandraDaemon.stop();

From: Ali Akhtar <ali.rac...@gmail.com<mailto:ali.rac...@gmail.com>>
Reply-To: "user@cassandra.apache.org<mailto:user@cassandra.apache.org>" 
<user@cassandra.apache.org<mailto:user@cassandra.apache.org>>
Date: Thursday, October 6, 2016 at 8:44 PM

To: "user@cassandra.apache.org<mailto:user@cassandra.apache.org>" 
<user@cassandra.apache.org<mailto:user@cassandra.apache.org>>
Subject: Re: Running Cassandra in Integration Tests

Peddi @ Amazon, would you be able to share your code such as in a gist, if 
possible, please?

Also, which version of cassandra are you doing that with?



On Fri, Oct 7, 2016 at 5:41 AM, Peddi, Praveen 
<pe...@amazon.com<mailto:pe...@amazon.com>> wrote:
We could not use cassandra unit for licensing reasons so we ended up 
instantiate CassandraDeamon after setting system property of 
cassandra.config={yaml location}. It works fine for our needs.

Praveen

From: Ali Akhtar <ali.rac...@gmail.com<mailto:ali.rac...@gmail.com>>
Reply-To: "user@cassandra.apache.org<mailto:user@cassandra.apache.org>" 
<user@cassandra.apache.org<mailto:user@cassandra.apache.org>>
Date: Thursday, October 6, 2016 at 8:35 PM
To: "user@cassandra.apache.org<mailto:user@cassandra.apache.org>" 
<user@cassandra.apache.org<mailto:user@cassandra.apache.org>>
Subject: Re: Running Cassandra in Integration Tests

That looks great Andrew, but it doesn't seem to have been committed to for 5 
months. Is anyone still using cassandra-unit , does it work with latest 
cassandra versions (e.g 3.9)?

On Fri, Oct 7, 2016 at 5:33 AM, Andrew Tolbert 
<andrew.tolb...@datastax.com<mailto:andrew.tolb...@datastax.com>> wrote:
Hi Ali,

cassandra-unit<https://github.com/jsevellec/cassandra-unit> might be what you 
are looking for.  It allows you to run an embedded cassandra instance along 
side your tests and has some nice integration with JUnit.

Thanks,
Andy

On Thu, Oct 6, 2016 at 7:13 PM Ali Akhtar 
<ali.rac...@gmail.com<mailto:ali.rac...@gmail.com>> wrote:
Ok, but that's not what this question is about.

I'm looking for a way to run an embedded cassandra instance which is created & 
destroyed during tests and which doesn't persist any state outside the tests.


On Fri, Oct 7, 2016 at 5:10 AM, Kant Kodali 
<k...@peernova.com<mailto:k...@peernova.com>> wrote:
you dont need to look for cassandra java api to start/stop instance. you just 
need to write a shell script or python or java or any language to execute shell 
commands!




On Thu, Oct 6, 2016 4:57 PM, Ali Akhtar 
ali.rac...@gmail.com<mailto:ali.rac...@gmail.com> wrote:
Okay.. but how would I start this instance? Is there a java api to 
programmatically start / destroy an instance during tests?

On Fri, Oct 7, 2016 at 4:56 AM, Kant Kodali 
<k...@peernova.com<mailto:k...@peernova.com>> wrote:
sure as long as that isolated instance is treated as separate cluster you 
shouldn't run into any problems.




On Thu, Oct 6, 2016 4:08 PM, Ali Akhtar 
ali.rac...@gmail.com<mailto:ali.rac...@gmail.com> wrote:
Is it possible to create an isolated cassandra instance which is run during 
integration tests and it disappears after tests have finished running? Then its 
recreated the next time tests run (perhaps being populated with test data).

 I'm using Java.










Re: Running Cassandra in Integration Tests

2016-10-06 Thread Peddi, Praveen
Akthar,
We use 2.2.4.

I am not sure if cassandra.config can take a classpath. Feel free to try. It 
was easy enough to copy the resource to temp file location for us.

Praveen

On Oct 6, 2016, at 9:21 PM, Ali Akhtar 
<ali.rac...@gmail.com<mailto:ali.rac...@gmail.com>> wrote:

Peddi,

Thanks, does this start @ localhost, default port? And, mind sharing which 
version of cassandra you use this with? will this work on 3.9, or on 3.7?

Also, why is the config in a temp location - wouldn't it be better to put it in 
src/test/resources and try to specify that?

Thanks.

On Fri, Oct 7, 2016 at 6:17 AM, Peddi, Praveen 
<pe...@amazon.com<mailto:pe...@amazon.com>> wrote:
Honestly there isn't much code to share. Here is the code (excluded exception 
handling). For yaml location, we have the classpathpath and write to temp 
location everytime.

System.setProperty("cassandra.config", "file://" + YAML_LOCATION);
cassandraDaemon = new CassandraDaemon();
 cassandraDaemon.init(null);
cassandraDaemon.start();

//stop cassandra after tests are done
cassandraDaemon.stop();

From: Ali Akhtar <ali.rac...@gmail.com<mailto:ali.rac...@gmail.com>>
Reply-To: "user@cassandra.apache.org<mailto:user@cassandra.apache.org>" 
<user@cassandra.apache.org<mailto:user@cassandra.apache.org>>
Date: Thursday, October 6, 2016 at 8:44 PM

To: "user@cassandra.apache.org<mailto:user@cassandra.apache.org>" 
<user@cassandra.apache.org<mailto:user@cassandra.apache.org>>
Subject: Re: Running Cassandra in Integration Tests

Peddi @ Amazon, would you be able to share your code such as in a gist, if 
possible, please?

Also, which version of cassandra are you doing that with?



On Fri, Oct 7, 2016 at 5:41 AM, Peddi, Praveen 
<pe...@amazon.com<mailto:pe...@amazon.com>> wrote:
We could not use cassandra unit for licensing reasons so we ended up 
instantiate CassandraDeamon after setting system property of 
cassandra.config={yaml location}. It works fine for our needs.

Praveen

From: Ali Akhtar <ali.rac...@gmail.com<mailto:ali.rac...@gmail.com>>
Reply-To: "user@cassandra.apache.org<mailto:user@cassandra.apache.org>" 
<user@cassandra.apache.org<mailto:user@cassandra.apache.org>>
Date: Thursday, October 6, 2016 at 8:35 PM
To: "user@cassandra.apache.org<mailto:user@cassandra.apache.org>" 
<user@cassandra.apache.org<mailto:user@cassandra.apache.org>>
Subject: Re: Running Cassandra in Integration Tests

That looks great Andrew, but it doesn't seem to have been committed to for 5 
months. Is anyone still using cassandra-unit , does it work with latest 
cassandra versions (e.g 3.9)?

On Fri, Oct 7, 2016 at 5:33 AM, Andrew Tolbert 
<andrew.tolb...@datastax.com<mailto:andrew.tolb...@datastax.com>> wrote:
Hi Ali,

cassandra-unit<https://github.com/jsevellec/cassandra-unit> might be what you 
are looking for.  It allows you to run an embedded cassandra instance along 
side your tests and has some nice integration with JUnit.

Thanks,
Andy

On Thu, Oct 6, 2016 at 7:13 PM Ali Akhtar 
<ali.rac...@gmail.com<mailto:ali.rac...@gmail.com>> wrote:
Ok, but that's not what this question is about.

I'm looking for a way to run an embedded cassandra instance which is created & 
destroyed during tests and which doesn't persist any state outside the tests.


On Fri, Oct 7, 2016 at 5:10 AM, Kant Kodali 
<k...@peernova.com<mailto:k...@peernova.com>> wrote:
you dont need to look for cassandra java api to start/stop instance. you just 
need to write a shell script or python or java or any language to execute shell 
commands!




On Thu, Oct 6, 2016 4:57 PM, Ali Akhtar 
ali.rac...@gmail.com<mailto:ali.rac...@gmail.com> wrote:
Okay.. but how would I start this instance? Is there a java api to 
programmatically start / destroy an instance during tests?

On Fri, Oct 7, 2016 at 4:56 AM, Kant Kodali 
<k...@peernova.com<mailto:k...@peernova.com>> wrote:
sure as long as that isolated instance is treated as separate cluster you 
shouldn't run into any problems.




On Thu, Oct 6, 2016 4:08 PM, Ali Akhtar 
ali.rac...@gmail.com<mailto:ali.rac...@gmail.com> wrote:
Is it possible to create an isolated cassandra instance which is run during 
integration tests and it disappears after tests have finished running? Then its 
recreated the next time tests run (perhaps being populated with test data).

 I'm using Java.









Re: Running Cassandra in Integration Tests

2016-10-06 Thread Ali Akhtar
Oh, and how do you generate your tables / keyspaces for the tests (if you
do)?

On Fri, Oct 7, 2016 at 6:21 AM, Ali Akhtar <ali.rac...@gmail.com> wrote:

> Peddi,
>
> Thanks, does this start @ localhost, default port? And, mind sharing which
> version of cassandra you use this with? will this work on 3.9, or on 3.7?
>
> Also, why is the config in a temp location - wouldn't it be better to put
> it in src/test/resources and try to specify that?
>
> Thanks.
>
> On Fri, Oct 7, 2016 at 6:17 AM, Peddi, Praveen <pe...@amazon.com> wrote:
>
>> Honestly there isn’t much code to share. Here is the code (excluded
>> exception handling). For yaml location, we have the classpathpath and write
>> to temp location everytime.
>>
>> System.setProperty("cassandra.config", "file://" + YAML_LOCATION);
>> cassandraDaemon = new CassandraDaemon();
>>  cassandraDaemon.init(null);
>> cassandraDaemon.start();
>>
>> //stop cassandra after tests are done
>> cassandraDaemon.stop();
>>
>> From: Ali Akhtar <ali.rac...@gmail.com>
>> Reply-To: "user@cassandra.apache.org" <user@cassandra.apache.org>
>> Date: Thursday, October 6, 2016 at 8:44 PM
>>
>> To: "user@cassandra.apache.org" <user@cassandra.apache.org>
>> Subject: Re: Running Cassandra in Integration Tests
>>
>> Peddi @ Amazon, would you be able to share your code such as in a gist,
>> if possible, please?
>>
>> Also, which version of cassandra are you doing that with?
>>
>>
>>
>> On Fri, Oct 7, 2016 at 5:41 AM, Peddi, Praveen <pe...@amazon.com> wrote:
>>
>>> We could not use cassandra unit for licensing reasons so we ended up
>>> instantiate CassandraDeamon after setting system property of
>>> cassandra.config={yaml location}. It works fine for our needs.
>>>
>>> Praveen
>>>
>>> From: Ali Akhtar <ali.rac...@gmail.com>
>>> Reply-To: "user@cassandra.apache.org" <user@cassandra.apache.org>
>>> Date: Thursday, October 6, 2016 at 8:35 PM
>>> To: "user@cassandra.apache.org" <user@cassandra.apache.org>
>>> Subject: Re: Running Cassandra in Integration Tests
>>>
>>> That looks great Andrew, but it doesn't seem to have been committed to
>>> for 5 months. Is anyone still using cassandra-unit , does it work with
>>> latest cassandra versions (e.g 3.9)?
>>>
>>> On Fri, Oct 7, 2016 at 5:33 AM, Andrew Tolbert <
>>> andrew.tolb...@datastax.com> wrote:
>>>
>>>> Hi Ali,
>>>>
>>>> cassandra-unit <https://github.com/jsevellec/cassandra-unit> might be
>>>> what you are looking for.  It allows you to run an embedded cassandra
>>>> instance along side your tests and has some nice integration with JUnit.
>>>>
>>>> Thanks,
>>>> Andy
>>>>
>>>> On Thu, Oct 6, 2016 at 7:13 PM Ali Akhtar <ali.rac...@gmail.com> wrote:
>>>>
>>>>> Ok, but that's not what this question is about.
>>>>>
>>>>> I'm looking for a way to run an embedded cassandra instance which is
>>>>> created & destroyed during tests and which doesn't persist any state
>>>>> outside the tests.
>>>>>
>>>>>
>>>>> On Fri, Oct 7, 2016 at 5:10 AM, Kant Kodali <k...@peernova.com> wrote:
>>>>>
>>>>> you dont need to look for cassandra java api to start/stop instance.
>>>>> you just need to write a shell script or python or java or any language to
>>>>> execute shell commands!
>>>>>
>>>>>
>>>>>
>>>>> On Thu, Oct 6, 2016 4:57 PM, Ali Akhtar ali.rac...@gmail.com wrote:
>>>>>
>>>>> Okay.. but how would I start this instance? Is there a java api to
>>>>> programmatically start / destroy an instance during tests?
>>>>>
>>>>> On Fri, Oct 7, 2016 at 4:56 AM, Kant Kodali <k...@peernova.com> wrote:
>>>>>
>>>>> sure as long as that isolated instance is treated as separate cluster
>>>>> you shouldn't run into any problems.
>>>>>
>>>>>
>>>>>
>>>>> On Thu, Oct 6, 2016 4:08 PM, Ali Akhtar ali.rac...@gmail.com wrote:
>>>>>
>>>>> Is it possible to create an isolated cassandra instance which is run
>>>>> during integration tests and it disappears after tests have finished
>>>>> running? Then its recreated the next time tests run (perhaps being
>>>>> populated with test data).
>>>>>
>>>>>  I'm using Java.
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>
>>
>


Re: Running Cassandra in Integration Tests

2016-10-06 Thread Ali Akhtar
Peddi,

Thanks, does this start @ localhost, default port? And, mind sharing which
version of cassandra you use this with? will this work on 3.9, or on 3.7?

Also, why is the config in a temp location - wouldn't it be better to put
it in src/test/resources and try to specify that?

Thanks.

On Fri, Oct 7, 2016 at 6:17 AM, Peddi, Praveen <pe...@amazon.com> wrote:

> Honestly there isn’t much code to share. Here is the code (excluded
> exception handling). For yaml location, we have the classpathpath and write
> to temp location everytime.
>
> System.setProperty("cassandra.config", "file://" + YAML_LOCATION);
> cassandraDaemon = new CassandraDaemon();
>  cassandraDaemon.init(null);
> cassandraDaemon.start();
>
> //stop cassandra after tests are done
> cassandraDaemon.stop();
>
> From: Ali Akhtar <ali.rac...@gmail.com>
> Reply-To: "user@cassandra.apache.org" <user@cassandra.apache.org>
> Date: Thursday, October 6, 2016 at 8:44 PM
>
> To: "user@cassandra.apache.org" <user@cassandra.apache.org>
> Subject: Re: Running Cassandra in Integration Tests
>
> Peddi @ Amazon, would you be able to share your code such as in a gist, if
> possible, please?
>
> Also, which version of cassandra are you doing that with?
>
>
>
> On Fri, Oct 7, 2016 at 5:41 AM, Peddi, Praveen <pe...@amazon.com> wrote:
>
>> We could not use cassandra unit for licensing reasons so we ended up
>> instantiate CassandraDeamon after setting system property of
>> cassandra.config={yaml location}. It works fine for our needs.
>>
>> Praveen
>>
>> From: Ali Akhtar <ali.rac...@gmail.com>
>> Reply-To: "user@cassandra.apache.org" <user@cassandra.apache.org>
>> Date: Thursday, October 6, 2016 at 8:35 PM
>> To: "user@cassandra.apache.org" <user@cassandra.apache.org>
>> Subject: Re: Running Cassandra in Integration Tests
>>
>> That looks great Andrew, but it doesn't seem to have been committed to
>> for 5 months. Is anyone still using cassandra-unit , does it work with
>> latest cassandra versions (e.g 3.9)?
>>
>> On Fri, Oct 7, 2016 at 5:33 AM, Andrew Tolbert <
>> andrew.tolb...@datastax.com> wrote:
>>
>>> Hi Ali,
>>>
>>> cassandra-unit <https://github.com/jsevellec/cassandra-unit> might be
>>> what you are looking for.  It allows you to run an embedded cassandra
>>> instance along side your tests and has some nice integration with JUnit.
>>>
>>> Thanks,
>>> Andy
>>>
>>> On Thu, Oct 6, 2016 at 7:13 PM Ali Akhtar <ali.rac...@gmail.com> wrote:
>>>
>>>> Ok, but that's not what this question is about.
>>>>
>>>> I'm looking for a way to run an embedded cassandra instance which is
>>>> created & destroyed during tests and which doesn't persist any state
>>>> outside the tests.
>>>>
>>>>
>>>> On Fri, Oct 7, 2016 at 5:10 AM, Kant Kodali <k...@peernova.com> wrote:
>>>>
>>>> you dont need to look for cassandra java api to start/stop instance.
>>>> you just need to write a shell script or python or java or any language to
>>>> execute shell commands!
>>>>
>>>>
>>>>
>>>> On Thu, Oct 6, 2016 4:57 PM, Ali Akhtar ali.rac...@gmail.com wrote:
>>>>
>>>> Okay.. but how would I start this instance? Is there a java api to
>>>> programmatically start / destroy an instance during tests?
>>>>
>>>> On Fri, Oct 7, 2016 at 4:56 AM, Kant Kodali <k...@peernova.com> wrote:
>>>>
>>>> sure as long as that isolated instance is treated as separate cluster
>>>> you shouldn't run into any problems.
>>>>
>>>>
>>>>
>>>> On Thu, Oct 6, 2016 4:08 PM, Ali Akhtar ali.rac...@gmail.com wrote:
>>>>
>>>> Is it possible to create an isolated cassandra instance which is run
>>>> during integration tests and it disappears after tests have finished
>>>> running? Then its recreated the next time tests run (perhaps being
>>>> populated with test data).
>>>>
>>>>  I'm using Java.
>>>>
>>>>
>>>>
>>>>
>>>>
>>
>


Re: Running Cassandra in Integration Tests

2016-10-06 Thread Peddi, Praveen
Honestly there isn't much code to share. Here is the code (excluded exception 
handling). For yaml location, we have the classpathpath and write to temp 
location everytime.

System.setProperty("cassandra.config", "file://" + YAML_LOCATION);
cassandraDaemon = new CassandraDaemon();
 cassandraDaemon.init(null);
cassandraDaemon.start();

//stop cassandra after tests are done
cassandraDaemon.stop();

From: Ali Akhtar <ali.rac...@gmail.com<mailto:ali.rac...@gmail.com>>
Reply-To: "user@cassandra.apache.org<mailto:user@cassandra.apache.org>" 
<user@cassandra.apache.org<mailto:user@cassandra.apache.org>>
Date: Thursday, October 6, 2016 at 8:44 PM
To: "user@cassandra.apache.org<mailto:user@cassandra.apache.org>" 
<user@cassandra.apache.org<mailto:user@cassandra.apache.org>>
Subject: Re: Running Cassandra in Integration Tests

Peddi @ Amazon, would you be able to share your code such as in a gist, if 
possible, please?

Also, which version of cassandra are you doing that with?



On Fri, Oct 7, 2016 at 5:41 AM, Peddi, Praveen 
<pe...@amazon.com<mailto:pe...@amazon.com>> wrote:
We could not use cassandra unit for licensing reasons so we ended up 
instantiate CassandraDeamon after setting system property of 
cassandra.config={yaml location}. It works fine for our needs.

Praveen

From: Ali Akhtar <ali.rac...@gmail.com<mailto:ali.rac...@gmail.com>>
Reply-To: "user@cassandra.apache.org<mailto:user@cassandra.apache.org>" 
<user@cassandra.apache.org<mailto:user@cassandra.apache.org>>
Date: Thursday, October 6, 2016 at 8:35 PM
To: "user@cassandra.apache.org<mailto:user@cassandra.apache.org>" 
<user@cassandra.apache.org<mailto:user@cassandra.apache.org>>
Subject: Re: Running Cassandra in Integration Tests

That looks great Andrew, but it doesn't seem to have been committed to for 5 
months. Is anyone still using cassandra-unit , does it work with latest 
cassandra versions (e.g 3.9)?

On Fri, Oct 7, 2016 at 5:33 AM, Andrew Tolbert 
<andrew.tolb...@datastax.com<mailto:andrew.tolb...@datastax.com>> wrote:
Hi Ali,

cassandra-unit<https://github.com/jsevellec/cassandra-unit> might be what you 
are looking for.  It allows you to run an embedded cassandra instance along 
side your tests and has some nice integration with JUnit.

Thanks,
Andy

On Thu, Oct 6, 2016 at 7:13 PM Ali Akhtar 
<ali.rac...@gmail.com<mailto:ali.rac...@gmail.com>> wrote:
Ok, but that's not what this question is about.

I'm looking for a way to run an embedded cassandra instance which is created & 
destroyed during tests and which doesn't persist any state outside the tests.


On Fri, Oct 7, 2016 at 5:10 AM, Kant Kodali 
<k...@peernova.com<mailto:k...@peernova.com>> wrote:
you dont need to look for cassandra java api to start/stop instance. you just 
need to write a shell script or python or java or any language to execute shell 
commands!




On Thu, Oct 6, 2016 4:57 PM, Ali Akhtar 
ali.rac...@gmail.com<mailto:ali.rac...@gmail.com> wrote:
Okay.. but how would I start this instance? Is there a java api to 
programmatically start / destroy an instance during tests?

On Fri, Oct 7, 2016 at 4:56 AM, Kant Kodali 
<k...@peernova.com<mailto:k...@peernova.com>> wrote:
sure as long as that isolated instance is treated as separate cluster you 
shouldn't run into any problems.




On Thu, Oct 6, 2016 4:08 PM, Ali Akhtar 
ali.rac...@gmail.com<mailto:ali.rac...@gmail.com> wrote:
Is it possible to create an isolated cassandra instance which is run during 
integration tests and it disappears after tests have finished running? Then its 
recreated the next time tests run (perhaps being populated with test data).

 I'm using Java.








Re: Running Cassandra in Integration Tests

2016-10-06 Thread Ali Akhtar
Peddi @ Amazon, would you be able to share your code such as in a gist, if
possible, please?

Also, which version of cassandra are you doing that with?



On Fri, Oct 7, 2016 at 5:41 AM, Peddi, Praveen <pe...@amazon.com> wrote:

> We could not use cassandra unit for licensing reasons so we ended up
> instantiate CassandraDeamon after setting system property of
> cassandra.config={yaml location}. It works fine for our needs.
>
> Praveen
>
> From: Ali Akhtar <ali.rac...@gmail.com>
> Reply-To: "user@cassandra.apache.org" <user@cassandra.apache.org>
> Date: Thursday, October 6, 2016 at 8:35 PM
> To: "user@cassandra.apache.org" <user@cassandra.apache.org>
> Subject: Re: Running Cassandra in Integration Tests
>
> That looks great Andrew, but it doesn't seem to have been committed to for
> 5 months. Is anyone still using cassandra-unit , does it work with latest
> cassandra versions (e.g 3.9)?
>
> On Fri, Oct 7, 2016 at 5:33 AM, Andrew Tolbert <
> andrew.tolb...@datastax.com> wrote:
>
>> Hi Ali,
>>
>> cassandra-unit <https://github.com/jsevellec/cassandra-unit> might be
>> what you are looking for.  It allows you to run an embedded cassandra
>> instance along side your tests and has some nice integration with JUnit.
>>
>> Thanks,
>> Andy
>>
>> On Thu, Oct 6, 2016 at 7:13 PM Ali Akhtar <ali.rac...@gmail.com> wrote:
>>
>>> Ok, but that's not what this question is about.
>>>
>>> I'm looking for a way to run an embedded cassandra instance which is
>>> created & destroyed during tests and which doesn't persist any state
>>> outside the tests.
>>>
>>>
>>> On Fri, Oct 7, 2016 at 5:10 AM, Kant Kodali <k...@peernova.com> wrote:
>>>
>>> you dont need to look for cassandra java api to start/stop instance. you
>>> just need to write a shell script or python or java or any language to
>>> execute shell commands!
>>>
>>>
>>>
>>> On Thu, Oct 6, 2016 4:57 PM, Ali Akhtar ali.rac...@gmail.com wrote:
>>>
>>> Okay.. but how would I start this instance? Is there a java api to
>>> programmatically start / destroy an instance during tests?
>>>
>>> On Fri, Oct 7, 2016 at 4:56 AM, Kant Kodali <k...@peernova.com> wrote:
>>>
>>> sure as long as that isolated instance is treated as separate cluster
>>> you shouldn't run into any problems.
>>>
>>>
>>>
>>> On Thu, Oct 6, 2016 4:08 PM, Ali Akhtar ali.rac...@gmail.com wrote:
>>>
>>> Is it possible to create an isolated cassandra instance which is run
>>> during integration tests and it disappears after tests have finished
>>> running? Then its recreated the next time tests run (perhaps being
>>> populated with test data).
>>>
>>>  I'm using Java.
>>>
>>>
>>>
>>>
>>>
>


Re: Running Cassandra in Integration Tests

2016-10-06 Thread Kant Kodali
embedded cassandra instance? you mean dont persist any data to disk? If so I
dont see that being possible at this time. prior to running your test code you
just run shell script and after test truncate everything and bring down the
instance. one way or other this needs to happen underneath so I dont see how you
could bypass that whichever way you may choose.
 





On Thu, Oct 6, 2016 5:35 PM, Ali Akhtar ali.rac...@gmail.com
wrote:
That looks great Andrew, but it doesn't seem to have been committed to for 5
months. Is anyone still using cassandra-unit , does it work with latest
cassandra versions (e.g 3.9)?
On Fri, Oct 7, 2016 at 5:33 AM, Andrew Tolbert  
wrote:
Hi Ali,
cassandra-unit might be what you are looking for.  It allows you to run an
embedded cassandra instance along side your tests and has some nice integration
with JUnit.
Thanks,Andy
On Thu, Oct 6, 2016 at 7:13 PM Ali Akhtar  wrote:
Ok, but that's not what this question is about.
I'm looking for a way to run an embedded cassandra instance which is created &
destroyed during tests and which doesn't persist any state outside the tests.

On Fri, Oct 7, 2016 at 5:10 AM, Kant Kodali   wrote:
you dont need to look for cassandra java api to start/stop instance. you just
need to write a shell script or python or java or any language to execute shell
commands!

 





On Thu, Oct 6, 2016 4:57 PM, Ali Akhtar ali.rac...@gmail.com
wrote:
Okay.. but how would I start this instance? Is there a java api to
programmatically start / destroy an instance during tests?
On Fri, Oct 7, 2016 at 4:56 AM, Kant Kodali   wrote:
sure as long as that isolated instance is treated as separate cluster you
shouldn't run into any problems.

 





On Thu, Oct 6, 2016 4:08 PM, Ali Akhtar ali.rac...@gmail.com
wrote:
Is it possible to create an isolated cassandra instance which is run during
integration tests and it disappears after tests have finished running? Then its
recreated the next time tests run (perhaps being populated with test data).
I'm using Java.

Re: Running Cassandra in Integration Tests

2016-10-06 Thread Peddi, Praveen
We could not use cassandra unit for licensing reasons so we ended up 
instantiate CassandraDeamon after setting system property of 
cassandra.config={yaml location}. It works fine for our needs.

Praveen

From: Ali Akhtar <ali.rac...@gmail.com<mailto:ali.rac...@gmail.com>>
Reply-To: "user@cassandra.apache.org<mailto:user@cassandra.apache.org>" 
<user@cassandra.apache.org<mailto:user@cassandra.apache.org>>
Date: Thursday, October 6, 2016 at 8:35 PM
To: "user@cassandra.apache.org<mailto:user@cassandra.apache.org>" 
<user@cassandra.apache.org<mailto:user@cassandra.apache.org>>
Subject: Re: Running Cassandra in Integration Tests

That looks great Andrew, but it doesn't seem to have been committed to for 5 
months. Is anyone still using cassandra-unit , does it work with latest 
cassandra versions (e.g 3.9)?

On Fri, Oct 7, 2016 at 5:33 AM, Andrew Tolbert 
<andrew.tolb...@datastax.com<mailto:andrew.tolb...@datastax.com>> wrote:
Hi Ali,

cassandra-unit<https://github.com/jsevellec/cassandra-unit> might be what you 
are looking for.  It allows you to run an embedded cassandra instance along 
side your tests and has some nice integration with JUnit.

Thanks,
Andy

On Thu, Oct 6, 2016 at 7:13 PM Ali Akhtar 
<ali.rac...@gmail.com<mailto:ali.rac...@gmail.com>> wrote:
Ok, but that's not what this question is about.

I'm looking for a way to run an embedded cassandra instance which is created & 
destroyed during tests and which doesn't persist any state outside the tests.


On Fri, Oct 7, 2016 at 5:10 AM, Kant Kodali 
<k...@peernova.com<mailto:k...@peernova.com>> wrote:
you dont need to look for cassandra java api to start/stop instance. you just 
need to write a shell script or python or java or any language to execute shell 
commands!




On Thu, Oct 6, 2016 4:57 PM, Ali Akhtar 
ali.rac...@gmail.com<mailto:ali.rac...@gmail.com> wrote:
Okay.. but how would I start this instance? Is there a java api to 
programmatically start / destroy an instance during tests?

On Fri, Oct 7, 2016 at 4:56 AM, Kant Kodali 
<k...@peernova.com<mailto:k...@peernova.com>> wrote:
sure as long as that isolated instance is treated as separate cluster you 
shouldn't run into any problems.




On Thu, Oct 6, 2016 4:08 PM, Ali Akhtar 
ali.rac...@gmail.com<mailto:ali.rac...@gmail.com> wrote:
Is it possible to create an isolated cassandra instance which is run during 
integration tests and it disappears after tests have finished running? Then its 
recreated the next time tests run (perhaps being populated with test data).

 I'm using Java.







Re: Running Cassandra in Integration Tests

2016-10-06 Thread Ali Akhtar
That looks great Andrew, but it doesn't seem to have been committed to for
5 months. Is anyone still using cassandra-unit , does it work with latest
cassandra versions (e.g 3.9)?

On Fri, Oct 7, 2016 at 5:33 AM, Andrew Tolbert 
wrote:

> Hi Ali,
>
> cassandra-unit  might be
> what you are looking for.  It allows you to run an embedded cassandra
> instance along side your tests and has some nice integration with JUnit.
>
> Thanks,
> Andy
>
> On Thu, Oct 6, 2016 at 7:13 PM Ali Akhtar  wrote:
>
>> Ok, but that's not what this question is about.
>>
>> I'm looking for a way to run an embedded cassandra instance which is
>> created & destroyed during tests and which doesn't persist any state
>> outside the tests.
>>
>>
>> On Fri, Oct 7, 2016 at 5:10 AM, Kant Kodali  wrote:
>>
>> you dont need to look for cassandra java api to start/stop instance. you
>> just need to write a shell script or python or java or any language to
>> execute shell commands!
>>
>>
>>
>> On Thu, Oct 6, 2016 4:57 PM, Ali Akhtar ali.rac...@gmail.com wrote:
>>
>> Okay.. but how would I start this instance? Is there a java api to
>> programmatically start / destroy an instance during tests?
>>
>> On Fri, Oct 7, 2016 at 4:56 AM, Kant Kodali  wrote:
>>
>> sure as long as that isolated instance is treated as separate cluster you
>> shouldn't run into any problems.
>>
>>
>>
>> On Thu, Oct 6, 2016 4:08 PM, Ali Akhtar ali.rac...@gmail.com wrote:
>>
>> Is it possible to create an isolated cassandra instance which is run
>> during integration tests and it disappears after tests have finished
>> running? Then its recreated the next time tests run (perhaps being
>> populated with test data).
>>
>>  I'm using Java.
>>
>>
>>
>>
>>


Re: Running Cassandra in Integration Tests

2016-10-06 Thread Andrew Tolbert
Hi Ali,

cassandra-unit  might be what
you are looking for.  It allows you to run an embedded cassandra instance
along side your tests and has some nice integration with JUnit.

Thanks,
Andy

On Thu, Oct 6, 2016 at 7:13 PM Ali Akhtar  wrote:

> Ok, but that's not what this question is about.
>
> I'm looking for a way to run an embedded cassandra instance which is
> created & destroyed during tests and which doesn't persist any state
> outside the tests.
>
>
> On Fri, Oct 7, 2016 at 5:10 AM, Kant Kodali  wrote:
>
> you dont need to look for cassandra java api to start/stop instance. you
> just need to write a shell script or python or java or any language to
> execute shell commands!
>
>
>
> On Thu, Oct 6, 2016 4:57 PM, Ali Akhtar ali.rac...@gmail.com wrote:
>
> Okay.. but how would I start this instance? Is there a java api to
> programmatically start / destroy an instance during tests?
>
> On Fri, Oct 7, 2016 at 4:56 AM, Kant Kodali  wrote:
>
> sure as long as that isolated instance is treated as separate cluster you
> shouldn't run into any problems.
>
>
>
> On Thu, Oct 6, 2016 4:08 PM, Ali Akhtar ali.rac...@gmail.com wrote:
>
> Is it possible to create an isolated cassandra instance which is run
> during integration tests and it disappears after tests have finished
> running? Then its recreated the next time tests run (perhaps being
> populated with test data).
>
>  I'm using Java.
>
>
>
>
>


Re: Running Cassandra in Integration Tests

2016-10-06 Thread Ali Akhtar
Ok, but that's not what this question is about.

I'm looking for a way to run an embedded cassandra instance which is
created & destroyed during tests and which doesn't persist any state
outside the tests.


On Fri, Oct 7, 2016 at 5:10 AM, Kant Kodali  wrote:

> you dont need to look for cassandra java api to start/stop instance. you
> just need to write a shell script or python or java or any language to
> execute shell commands!
>
>
>
> On Thu, Oct 6, 2016 4:57 PM, Ali Akhtar ali.rac...@gmail.com wrote:
>
>> Okay.. but how would I start this instance? Is there a java api to
>> programmatically start / destroy an instance during tests?
>>
>> On Fri, Oct 7, 2016 at 4:56 AM, Kant Kodali  wrote:
>>
>> sure as long as that isolated instance is treated as separate cluster you
>> shouldn't run into any problems.
>>
>>
>>
>> On Thu, Oct 6, 2016 4:08 PM, Ali Akhtar ali.rac...@gmail.com wrote:
>>
>> Is it possible to create an isolated cassandra instance which is run
>> during integration tests and it disappears after tests have finished
>> running? Then its recreated the next time tests run (perhaps being
>> populated with test data).
>>
>>  I'm using Java.
>>
>>
>>
>>


Re: Running Cassandra in Integration Tests

2016-10-06 Thread Ali Akhtar
Okay.. but how would I start this instance? Is there a java api to
programmatically start / destroy an instance during tests?

On Fri, Oct 7, 2016 at 4:56 AM, Kant Kodali  wrote:

> sure as long as that isolated instance is treated as separate cluster you
> shouldn't run into any problems.
>
>
>
> On Thu, Oct 6, 2016 4:08 PM, Ali Akhtar ali.rac...@gmail.com wrote:
>
>> Is it possible to create an isolated cassandra instance which is run
>> during integration tests and it disappears after tests have finished
>> running? Then its recreated the next time tests run (perhaps being
>> populated with test data).
>>
>>  I'm using Java.
>>
>>
>>


Re: Running Cassandra in Integration Tests

2016-10-06 Thread Kant Kodali

sure as long as that isolated instance is treated as separate cluster you
shouldn't run into any problems.






On Thu, Oct 6, 2016 4:08 PM, Ali Akhtar ali.rac...@gmail.com
wrote:
Is it possible to create an isolated cassandra instance which is run during
integration tests and it disappears after tests have finished running? Then its
recreated the next time tests run (perhaps being populated with test data).
I'm using Java.