cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thijssen, Ron" <>
Subject Re: caution for restarting CassandraDaemon in junit
Date Thu, 09 Jun 2011 20:21:43 GMT
This is kind of related to the issue I filed

Forkmode works for an ordinary maven build. But when including the sonar plugin, the forkmode
is ignored in it's analysis.
A REAL work around is to manually start and stop a dedicated cassandra in your setup and teardown.

Cheers, Ron

Van: Yang <<>>
Beantwoorden - Aan: "<>" <<>>
Datum: Thu, 9 Jun 2011 21:36:30 +0200
Aan: "<>" <<>>
Onderwerp: caution for restarting CassandraDaemon in junit

I'm doing a bunch of tests for my code that uses Cassandra.

I have 2 test classes, each of them sets up a thrift.CassandraDaemon  in @BeforeClass  and
activate it in @AfterClass

when I ran them separately , they both work fine; if I run them together by "mvn test", the
latter one fails.

it turns out that after "deactivate()" , the static caches for implementing singleton in Table
 is not cleared,
so they are re-used. there could be more cases like this.

so to get that working, you need to set the "forkMode" of surefire-plugin to let each test
class be run in a separate JVM


The information contained in this message may be confidential and legally protected under
applicable law. The message is intended solely for the addressee(s). If you are not the intended
recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction
of this message is strictly prohibited and may be unlawful. If you are not the intended recipient,
please contact the sender by return e-mail and destroy all copies of the original message.

View raw message