DATACASS-70 - Fixed Table Lifecycle test with new Unit test strategy.

This commit is contained in:
David Webb
2014-01-16 00:58:05 -05:00
parent a7b886c35e
commit 4ac4d1df29
2 changed files with 19 additions and 0 deletions

View File

@@ -81,7 +81,11 @@ public abstract class AbstractEmbeddedCassandraIntegrationTest {
}
public void connect() {
if (connect && !connected()) {
log.info("Connecting to Cassandra");
cluster = cluster();
if (keyspace() == null) {

View File

@@ -18,6 +18,9 @@ package org.springframework.cassandra.test.integration.core.cql.generator;
import static org.springframework.cassandra.test.integration.core.cql.generator.CqlTableSpecificationAssertions.assertNoTable;
import static org.springframework.cassandra.test.integration.core.cql.generator.CqlTableSpecificationAssertions.assertTable;
import org.cassandraunit.CassandraCQLUnit;
import org.cassandraunit.dataset.cql.ClassPathCQLDataSet;
import org.junit.Rule;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -39,6 +42,18 @@ public class TableLifecycleIntegrationTest extends AbstractEmbeddedCassandraInte
CreateTableCqlGeneratorTests.MultipleOptionsTest createTableTest = new CreateTableCqlGeneratorTests.MultipleOptionsTest();
public TableLifecycleIntegrationTest() {
super("tlit");
clear = true;
}
// This only ensures the keyspace exists before each test, while using a static session from the parent object.
// TODO - DW Make this better.
@Rule
public CassandraCQLUnit cassandraCQLUnit = new CassandraCQLUnit(new ClassPathCQLDataSet(
"cassandraOperationsTest-cql-dataload.cql", this.keyspace), CASSANDRA_CONFIG, CASSANDRA_HOST,
CASSANDRA_NATIVE_PORT);
@Test
public void testDrop() {