0

I tried to run an EmbeddedCassandra.startEmbeddedCassandra() in my unit tests (with casandra-unit:4.3.1.0) and after the startEmbeddedCassandra() is called no errors is thrown but is still loading, no timeout added to the method is triggered.

NOTEs:

  • JAVA version 17
  • Running platform Windows
  • cassandra-driver-core: 3.11.3
  • com.datastax.oss dependencies (java-driver-core, java-driver-query-builder): 4.15.0

Does anyone has any idea?

Erick Ramirez
  • 13,964
  • 1
  • 18
  • 23
mihai
  • 41
  • 6
  • 1
    Looking at https://github.com/jsevellec/cassandra-unit and its issues, it is not compatible with Java 11 or higher, and the project also seems to be dormant. – Mark Rotteveel May 01 '23 at 10:35

2 Answers2

3

CassandraUnit embeds a cluster instance running Cassandra 3.11 which only works with Java 8.

Cassandra 4.0.0 added experimental support for Java 11 (CASSANDRA-9608), with full support added in C* 4.0.2 (CASSANDRA-16894).

Support for Java 17 is a work-in-progress (CASSANDRA-16895) slated for release at some point in the future. Cheers!

Erick Ramirez
  • 13,964
  • 1
  • 18
  • 23
3

You will never be able to run CassandraUnit with Cassandra3x with JDK17.

WHY

CassandraUnit runs as an embedded Cassandra node in the JDK. As such you need Cassandra to support the JVM as a prequisite. This is what Cassandra JVM support looks like at the moment.

  • Cassandra 3.11 is only supported up to JDK 8
  • Cassandra 4.x is only supported up to JDK 11
  • Cassandra 5.x should support JDK17 but will require a major version update.

Work Around

You need Cassandra to run outside of your JVM with Containers. The solution the most in use is TEST CONTAINERS and specially the Cassandra module or the genric one.

clunven
  • 1,360
  • 6
  • 13