You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Ryan Daum <ry...@thimbleware.com> on 2010/03/14 19:08:57 UTC

Embedded Cassandra for Integration testing

I know people have been successful embedding Cassandra, and I've seen code
for how to bootstrap it, but I'm wondering what people have done to manage
its 3rd party dependencies at build time? Especially for Maven projects,
Cassandra is highly uncooperative as a dependency, as many of its 3rd party
dependencies have no Maven repository source, and the Cassandra POM has been
orphaned.

R

Re: Embedded Cassandra for Integration testing

Posted by Jonas Bonér <jo...@jonasboner.com>.
Here is an util class from the Akka test suite, embedding Cassandra:

import org.apache.cassandra.service.CassandraDaemon
object EmbeddedCassandraService {

  System.setProperty("storage-config", "src/test/resources");

  val cassandra = new Runnable {

    val cassandraDaemon = new CassandraDaemon
    cassandraDaemon.init(null)

    def run = cassandraDaemon.start

  }

  // spawn cassandra in a new thread
  val t = new Thread(cassandra)
  t.setDaemon(true)
  t.start

  def start: Unit = {}

}

On 14 March 2010 19:08, Ryan Daum <ry...@thimbleware.com> wrote:
> I know people have been successful embedding Cassandra, and I've seen code
> for how to bootstrap it, but I'm wondering what people have done to manage
> its 3rd party dependencies at build time? Especially for Maven projects,
> Cassandra is highly uncooperative as a dependency, as many of its 3rd party
> dependencies have no Maven repository source, and the Cassandra POM has been
> orphaned.
> R
>



-- 
Jonas Bonér

twitter: @jboner
blog:    http://jonasboner.com
work:   http://scalablesolutions.se
code:   http://github.com/jboner
code:   http://akkasource.org
also:    http://letitcrash.com

Re: Embedded Cassandra for Integration testing

Posted by Ran Tavory <ra...@gmail.com>.
I have a writeup just for that from a while ago
http://prettyprint.me/2010/02/14/running-cassandra-as-an-embedded-service/
This addresses version 0.5.0, not 0.6 but I believe the diff isn't that big.
And as mentioned, you may also browse hector to get the list of
dependencies. Please also see
http://github.com/rantav/hector/blob/master/src/test/java/me/prettyprint/cassandra/testutils/EmbeddedServerHelper.java

On Sun, Mar 14, 2010 at 7:20 PM, Ryan Daum <ry...@thimbleware.com> wrote:

> Thanks Tom; I am working with 0.6 beta2 now, so not immediately applicable,
> but this is helpful.
>
> Maybe we ought to consider taking what you've done and putting it up in a
> generic way accessible on a public repo.
>
> R
>
>
> On Sun, Mar 14, 2010 at 2:16 PM, Tom Chen <to...@gogii.net> wrote:
>
>> Hi Ryan,
>>
>> I have been running some tests locally, and I've been using.
>>
>> http://github.com/rantav/hector
>>
>> If you look at the pom.xml you can get a pretty good idea of the
>> dependencies required to run a cassandra client for version 5. I usually
>> combine it with the maven one jar to create one jar file required for my
>> testing. Note hector has not been upgraded to v6.
>>
>> For version 6, I suspect that we can yank the dependences out the
>> ant/pom.xml file to determine the runtime jars needed.
>>
>>
>> Tom
>>
>>  <http://github.com/rantav/hector>
>>
>> On Sun, Mar 14, 2010 at 11:08 AM, Ryan Daum <ry...@thimbleware.com> wrote:
>>
>>> I know people have been successful embedding Cassandra, and I've seen
>>> code for how to bootstrap it, but I'm wondering what people have done to
>>> manage its 3rd party dependencies at build time? Especially for Maven
>>> projects, Cassandra is highly uncooperative as a dependency, as many of its
>>> 3rd party dependencies have no Maven repository source, and the Cassandra
>>> POM has been orphaned.
>>>
>>> R
>>>
>>>
>>
>>
>> --
>> Tom Chen
>> Software Architect
>> GOGII, Inc
>> tom@gogii.net
>> 650-468-6318
>>
>
>

Re: Embedded Cassandra for Integration testing

Posted by Ryan Daum <ry...@thimbleware.com>.
Thanks Tom; I am working with 0.6 beta2 now, so not immediately applicable,
but this is helpful.

Maybe we ought to consider taking what you've done and putting it up in a
generic way accessible on a public repo.

R

On Sun, Mar 14, 2010 at 2:16 PM, Tom Chen <to...@gogii.net> wrote:

> Hi Ryan,
>
> I have been running some tests locally, and I've been using.
>
> http://github.com/rantav/hector
>
> If you look at the pom.xml you can get a pretty good idea of the
> dependencies required to run a cassandra client for version 5. I usually
> combine it with the maven one jar to create one jar file required for my
> testing. Note hector has not been upgraded to v6.
>
> For version 6, I suspect that we can yank the dependences out the
> ant/pom.xml file to determine the runtime jars needed.
>
>
> Tom
>
> <http://github.com/rantav/hector>
>
> On Sun, Mar 14, 2010 at 11:08 AM, Ryan Daum <ry...@thimbleware.com> wrote:
>
>> I know people have been successful embedding Cassandra, and I've seen code
>> for how to bootstrap it, but I'm wondering what people have done to manage
>> its 3rd party dependencies at build time? Especially for Maven projects,
>> Cassandra is highly uncooperative as a dependency, as many of its 3rd party
>> dependencies have no Maven repository source, and the Cassandra POM has been
>> orphaned.
>>
>> R
>>
>>
>
>
> --
> Tom Chen
> Software Architect
> GOGII, Inc
> tom@gogii.net
> 650-468-6318
>

Re: Embedded Cassandra for Integration testing

Posted by Tom Chen <to...@gogii.net>.
Hi Ryan,

I have been running some tests locally, and I've been using.

http://github.com/rantav/hector

If you look at the pom.xml you can get a pretty good idea of the
dependencies required to run a cassandra client for version 5. I usually
combine it with the maven one jar to create one jar file required for my
testing. Note hector has not been upgraded to v6.

For version 6, I suspect that we can yank the dependences out the
ant/pom.xml file to determine the runtime jars needed.


Tom

<http://github.com/rantav/hector>

On Sun, Mar 14, 2010 at 11:08 AM, Ryan Daum <ry...@thimbleware.com> wrote:

> I know people have been successful embedding Cassandra, and I've seen code
> for how to bootstrap it, but I'm wondering what people have done to manage
> its 3rd party dependencies at build time? Especially for Maven projects,
> Cassandra is highly uncooperative as a dependency, as many of its 3rd party
> dependencies have no Maven repository source, and the Cassandra POM has been
> orphaned.
>
> R
>
>


-- 
Tom Chen
Software Architect
GOGII, Inc
tom@gogii.net
650-468-6318