This is kind of related to the issue I filed
https://issues.apache.org/jira/browse/CASSANDRA-2724

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 <teddyyyy...@gmail.com<mailto:teddyyyy...@gmail.com>>
Beantwoorden - Aan: 
"user@cassandra.apache.org<mailto:user@cassandra.apache.org>" 
<user@cassandra.apache.org<mailto:user@cassandra.apache.org>>
Datum: Thu, 9 Jun 2011 21:36:30 +0200
Aan: "user@cassandra.apache.org<mailto:user@cassandra.apache.org>" 
<user@cassandra.apache.org<mailto:user@cassandra.apache.org>>
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





yang

________________________________
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.

Reply via email to