Class CassandraTestInstance

java.lang.Object
eu.europeana.cloud.test.CassandraTestInstance

public final class CassandraTestInstance extends Object
  • Method Details

    • getPort

      public static int getPort()
    • getInstance

      public static CassandraTestInstance getInstance(String keyspaceSchemaCql, String keyspace)
      Thread safe singleton of Cassandra test instance with initialized keyspace.
      Parameters:
      keyspaceSchemaCql - cql file of keyspace definition
      keyspace - keyspace name
      Returns:
      cassandra test instance
    • truncateAllData

      public static void truncateAllData(boolean hard)
      Truncate all tables from all keyspaces.
      Parameters:
      hard - if is true then empty tables are truncated (this slow down process because it require disk flushes)
    • getSession

      public static com.datastax.driver.core.Session getSession(String keyspace)
    • print

      public static void print()
      Print how many data is in each table.
    • initKeyspaceIfNeeded

      public void initKeyspaceIfNeeded(String keyspaceSchemaCql, String keyspace)
    • clean

      public void clean()
      Clean embedded Casandra and throw out keyspaces.