title: How to execute more than one test with cassandra spring unit
body: <p>My test looks like:</p>
  
  <pre><code>@RunWith(SpringJUnit4ClassRunner.class)
  @ContextConfiguration("classpath:testContext.xml")
  @TestExecutionListeners(listeners = { CassandraUnitDependencyInjectionTestExecutionListener.class }, mergeMode = MergeMode.MERGE_WITH_DEFAULTS)
  @CassandraDataSet(value = "create_schema.cql", keyspace = "myKeyspace")
  @EmbeddedCassandra(timeout = 20000)
  public class MyItest {
  
  protected final Logger logger = LogManager.getLogger(getClass());
  
  @Test
  public void test1() throws Exception {
      System.out.println("Start1");
      ...
      System.out.println("End1");
  }
  
  @Test
  public void test2() throws Exception {
      System.out.println("Start2");
      ...
      System.out.println("End2");
  }
  </code></pre>
  
  <p>When I run this tests one by one in my STS it works OK. But when I run both test together then I got exception:</p>
  
  <pre><code>2016-08-31 13:15:37,962 [HANDSHAKE-/127.0.0.1] INFO  - OutboundTcpConnection      - Handshaking version with /127.0.0.1
  Start1
  2016-08-31 13:15:39,326 [cassandraCluster-worker-5] WARN  - Cluster                    - Re-preparing already prepared query is generally an anti-pattern and will likely affect performance. Consider preparing the statement only once. Query='...'
  2016-08-31 13:15:39,331 [cassandraCluster-worker-6] WARN  - Cluster                    - Re-preparing already prepared query is generally an anti-pattern and will likely affect performance. Consider preparing the statement only once. Query='...'
  End1
  2016-08-31 13:15:39,348 [cassandraCluster-worker-1] WARN  - Cluster                    - Re-preparing already prepared query is generally an anti-pattern and will likely affect performance. Consider preparing the statement only once. Query='...'
  2016-08-31 13:15:41,401 [cassandraCluster-worker-3] WARN  - Cluster                    - Re-preparing already prepared query is generally an anti-pattern and will likely affect performance. Consider preparing the statement only once. Query='...'
  2016-08-31 13:15:42,174 [main] INFO  - DCAwareRoundRobinPolicy    - Using data-center name 'datacenter1' for DCAwareRoundRobinPolicy (if this is incorrect, please provide the correct datacenter name with DCAwareRoundRobinPolicy constructor)
  2016-08-31 13:15:42,174 [main] INFO  - Cluster                    - New Cassandra host localhost/127.0.0.1:9142 added
  2016-08-31 13:15:42,191 [SharedPool-Worker-3] INFO  - MigrationManager           - Drop Keyspace 'rob'
  2016-08-31 13:15:54,227 [main] ERROR - TestContextManager         - Caught exception while allowing TestExecutionListener [org.cassandraunit.spring.CassandraUnitDependencyInjectionTestExecutionListener@1a9e7c8] to prepare test instance [cz.isvs.reg.rob.ws.repository.dao.MyITest@6e505c]
  com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (tried: localhost/127.0.0.1:9142 (com.datastax.driver.core.exceptions.OperationTimedOutException: [localhost/127.0.0.1:9142] Timed out waiting for server response))
      at com.datastax.driver.core.exceptions.NoHostAvailableException.copy(NoHostAvailableException.java:84) ~[cassandra-driver-core-3.0.3.jar:?]
      at com.datastax.driver.core.exceptions.NoHostAvailableException.copy(NoHostAvailableException.java:37) ~[cassandra-driver-core-3.0.3.jar:?]
      at com.datastax.driver.core.DriverThrowables.propagateCause(DriverThrowables.java:37) ~[cassandra-driver-core-3.0.3.jar:?]
      at com.datastax.driver.core.DefaultResultSetFuture.getUninterruptibly(DefaultResultSetFuture.java:245) ~[cassandra-driver-core-3.0.3.jar:?]
      at com.datastax.driver.core.AbstractSession.execute(AbstractSession.java:64) ~[cassandra-driver-core-3.0.3.jar:?]
      at com.datastax.driver.core.AbstractSession.execute(AbstractSession.java:39) ~[cassandra-driver-core-3.0.3.jar:?]
      at org.cassandraunit.CQLDataLoader.initKeyspaceContext(CQLDataLoader.java:62) ~[cassandra-unit-3.0.0.1.jar:?]
      at org.cassandraunit.CQLDataLoader.load(CQLDataLoader.java:31) ~[cassandra-unit-3.0.0.1.jar:?]
      at org.cassandraunit.spring.AbstractCassandraUnitTestExecutionListener.startServer(AbstractCassandraUnitTestExecutionListener.java:70) ~[cassandra-unit-spring-3.0.0.1.jar:?]
      at org.cassandraunit.spring.CassandraUnitDependencyInjectionTestExecutionListener.prepareTestInstance(CassandraUnitDependencyInjectionTestExecutionListener.java:21) ~[cassandra-unit-spring-3.0.0.1.jar:?]
      at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:228) [spring-test-4.2.6.RELEASE.jar:4.2.6.RELEASE]
      at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:230) [spring-test-4.2.6.RELEASE.jar:4.2.6.RELEASE]
      at org.springframework.test.context.junit4.SpringJUnit4ClassRunner$1.runReflectiveCall(SpringJUnit4ClassRunner.java:289) [spring-test-4.2.6.RELEASE.jar:4.2.6.RELEASE]
      at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) [junit-4.12.jar:4.12]
      at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.methodBlock(SpringJUnit4ClassRunner.java:291) [spring-test-4.2.6.RELEASE.jar:4.2.6.RELEASE]
      at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:249) [spring-test-4.2.6.RELEASE.jar:4.2.6.RELEASE]
      at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:89) [spring-test-4.2.6.RELEASE.jar:4.2.6.RELEASE]
      at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) [junit-4.12.jar:4.12]
      at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) [junit-4.12.jar:4.12]
      at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) [junit-4.12.jar:4.12]
      at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) [junit-4.12.jar:4.12]
      at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) [junit-4.12.jar:4.12]
      at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61) [spring-test-4.2.6.RELEASE.jar:4.2.6.RELEASE]
      at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70) [spring-test-4.2.6.RELEASE.jar:4.2.6.RELEASE]
      at org.junit.runners.ParentRunner.run(ParentRunner.java:363) [junit-4.12.jar:4.12]
      at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:193) [spring-test-4.2.6.RELEASE.jar:4.2.6.RELEASE]
      at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50) [.cp/:?]
      at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) [.cp/:?]
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459) [.cp/:?]
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675) [.cp/:?]
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382) [.cp/:?]
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192) [.cp/:?]
  Caused by: com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (tried: localhost/127.0.0.1:9142 (com.datastax.driver.core.exceptions.OperationTimedOutException: [localhost/127.0.0.1:9142] Timed out waiting for server response))
      at com.datastax.driver.core.RequestHandler.reportNoMoreHosts(RequestHandler.java:207) ~[cassandra-driver-core-3.0.3.jar:?]
      at com.datastax.driver.core.RequestHandler.access$1000(RequestHandler.java:43) ~[cassandra-driver-core-3.0.3.jar:?]
      at com.datastax.driver.core.RequestHandler$SpeculativeExecution.sendRequest(RequestHandler.java:273) ~[cassandra-driver-core-3.0.3.jar:?]
      at com.datastax.driver.core.RequestHandler$SpeculativeExecution$1.run(RequestHandler.java:396) ~[cassandra-driver-core-3.0.3.jar:?]
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) ~[?:1.8.0_66]
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) ~[?:1.8.0_66]
      at java.lang.Thread.run(Thread.java:745) ~[?:1.8.0_66]
  2016-08-31 13:15:54,280 [main] INFO  - CassandraHostRetryService  - Downed Host Retry service started with queue size -1 and retry delay 10s
  2016-08-31 13:15:54,282 [main] INFO  - JmxMonitor                 - Registering JMX me.prettyprint.cassandra.service_TestCluster:ServiceType=hector,MonitorType=hector
  2016-08-31 13:15:54,355 [Thrift:2] INFO  - MigrationManager           - Drop Keyspace 'rob'
  2016-08-31 13:16:03,475 [StorageServiceShutdownHook] INFO  - ThriftServer               - Stop listening to thrift clients
  2016-08-31 13:16:03,476 [Thread-2] INFO  - GenericApplicationContext  - Closing org.springframework.context.support.GenericApplicationContext@153d0f5: startup date [Wed Aug 31 13:15:37 CEST 2016]; root of context hierarchy
  </code></pre>
  
  <p>In log I can see it drops Keyspace after 1 successful test and then there is some timeout and NoHostAvailableException. How should I fix this error ?</p>
  
  <p>EDIT:</p>
  
  <p>in <code>CassandraUnitDependencyInjectionTestExecutionListener</code> I can see:</p>
  
  <pre><code>if (Boolean.TRUE.equals(testContext.getAttribute(DependencyInjectionTestExecutionListener.REINJECT_DEPENDENCIES_ATTRIBUTE))) {
    if (LOGGER.isDebugEnabled()) {
      LOGGER.debug("Cleaning and reloading server for test context [" + testContext + "].");
    }
    cleanServer();
    startServer(testContext);
  }
  </code></pre>
  
  <p>How I can change this property to false ?</p>