Jeremy,
Sadly it does not cover our case. We have unit tests and we want to test really
basic things like mappings of data contained in cassandra to our model. For
that we don't need cluster at all because in unit tests we don't want to test
data distribution. We also would like to run everything in JVM, thus CCM
written in Python is not really what we need.
What we are looking for is minimal cassandra set up which could be embedded and
used concurrently multiple times. For example we now use CassandraUnit:
@Rule
public CassandraUnit unit = new CassandraUnit(new EmptyDataSet(),
"embedded-cassandra.yaml");
@Test
public void fistTest() {
// do something with data
}
@Test
public void secondTest() {
// do something else
}
In this set up JUnit will launch new CassandraDaemon for every test. If we set
FORK_MODE per test then we may have two cassandra instances running at the same
time. First test which launch CassandraDaemon will pass, second may fail due
port usage conflict. That's why we thought about testing without network layer.
This can save some time. It would be great because for some older hardware used
by our developers it takes up to 9 minutes to run build with all unit tests.
Some of this time is consumed by startup and shutdown of cassandra.
Cheers,
Łukasz Dywicki
--
[email protected]
Twitter: ldywicki
Blog: http://dywicki.pl
Code-House - http://code-house.org
Wiadomość napisana przez Jeremy Hanna <[email protected]> w dniu 9 lip
2013, o godz. 15:22:
> Have you seen https://github.com/pcmanus/ccm as described in
> http://www.datastax.com/dev/blog/ccm-a-development-tool-for-creating-local-cassandra-clusters
> or does that not fit your use case?
>
> On 9 Jul 2013, at 14:02, Łukasz Dywicki <[email protected]> wrote:
>
>> Hello,
>> First of all I would like to say hello to cassandra user and developer
>> community. :)
>>
>> I write because we are using Cassandra in our unit tests and we have some
>> troubles with network connectivity. We ca not run multiple cassandra
>> instances during tests because we would need to randomize configuration of
>> port and so on. For now if we try to fork our tests we get "address already
>> in use" on one from two ports - native or thrift. In other apache projects
>> we can "VM" connectors (ActiveMQ, Camel, Mina) based on in-memory queue. I
>> took some time to see how CassandraDaemon starts servers and it's kinda of
>> hardcoded. I thought about changing configuration to be more like:
>>
>> servers:
>> - class org.apache.cassandra.thrift.ThriftServer
>> - class org.apache.cassandra.transport.Server
>>
>> Then we will be able to disable these servers for unit tests:
>> servers:
>> - class org.apache.cassandra.vm.VmServer
>>
>> This requires some small changes in daemon code and client libraries. I'm
>> not really deeply involved in cassandra stuff so I don't know the internal
>> architecture and implications thus I look forward for you to discuss this
>> topic.
>>
>> Cheers,
>> Łukasz Dywicki
>> --
>> [email protected]
>> Twitter: ldywicki
>> Blog: http://dywicki.pl
>> Code-House - http://code-house.org
>>
>