Skip to content

Cassandra Test is a Java test framework for writing unit tests and integration tests against a Cassandra database.

License

Notifications You must be signed in to change notification settings

dananderson/cassandra-test

Repository files navigation

Cassandra Test

Build Status Maven Central codecov.io

Cassandra Test is a unit test and integration test framework featuring support for multiple test environments, schema management, table data loading and connection management.

@CassandraKeyspace(value = "testng_cassandra_test", schema = "classpath:sample-schema.cql")
@CassandraData("classpath:sample-data.cql")
public class TestNGSampleTest extends AbstractTestNGCassandraTest {

    @Test
    public void timeseriesRowCount() throws Exception {
        assertThat(getKeyspace().getTable("timeseries).getCount(), is(3L));
    }
}

Getting Cassandra Test

Cassandra Test modules are organized by the supported test environments: TestNG, JUnit and Spring Test. To include Cassandra Test in your project, choose the artifactId that matches your test environment.

TestNG

    <dependency>
      <groupId>org.unittested</groupId>
      <artifactId>cassandra-test-testng</artifactId>
      <version>1.0.1</version>
    </dependency>

JUnit

    <dependency>
      <groupId>org.unittested</groupId>
      <artifactId>cassandra-test-junit</artifactId>
      <version>1.0.1</version>
    </dependency>

Spring Test

    <dependency>
      <groupId>org.unittested</groupId>
      <artifactId>cassandra-test-spring</artifactId>
      <version>1.0.1</version>
    </dependency>

Compatibility

Cassandra Test has been built and tested with:

Technology Supported Versions
Datastax Java Driver 2.0.2+, 2.1.0+, 3.0.0+
Apache Cassandra 2.0.4+ 2.1.0+ 2.2.0+ 3.0.0+
Java 6+

License

Apache License, Version 2.0

Contributing

Pull requests for bug fixes and new features are welcome.

The following items are being considered for future releases of Cassandra Test.

  • Improve README documentation across the project.
  • Wiki documentation.
  • Create an example usage project.
  • Add method level annotations.
  • Investigate other data loading source file formats, including JSON, YAML, XML and CSV.
  • Investigate "golden" data for table data state verification.
  • Add plugins for schema management tools.
  • Investigate support for managing Cassandra instances with CCM, Embedded Cassandra and SCassandra.
  • Investigate negative testing tools to put Cassandra into bad states (node down, etc).
  • Performance: session cache, file read cache, etc.
  • Parallel test support (why?).

About

Cassandra Test is a Java test framework for writing unit tests and integration tests against a Cassandra database.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages