From 7c6a0039431124699e750f5a5d5867803c60bd7e Mon Sep 17 00:00:00 2001 From: Matthew Adams Date: Thu, 21 Nov 2013 08:02:02 -0600 Subject: [PATCH] removed duplicate tests --- .../generator/AlterTableCqlGeneratorTest.java | 27 ----------- .../CreateTableCqlGeneratorTest.java | 47 ------------------- .../generator/DropTableCqlGeneratorTest.java | 18 ------- 3 files changed, 92 deletions(-) delete mode 100644 src/test/java/org/springframework/cassandra/test/unit/cql/generator/AlterTableCqlGeneratorTest.java delete mode 100644 src/test/java/org/springframework/cassandra/test/unit/cql/generator/CreateTableCqlGeneratorTest.java delete mode 100644 src/test/java/org/springframework/cassandra/test/unit/cql/generator/DropTableCqlGeneratorTest.java diff --git a/src/test/java/org/springframework/cassandra/test/unit/cql/generator/AlterTableCqlGeneratorTest.java b/src/test/java/org/springframework/cassandra/test/unit/cql/generator/AlterTableCqlGeneratorTest.java deleted file mode 100644 index a153248d8..000000000 --- a/src/test/java/org/springframework/cassandra/test/unit/cql/generator/AlterTableCqlGeneratorTest.java +++ /dev/null @@ -1,27 +0,0 @@ -package org.springframework.cassandra.test.unit.cql.generator; - -import static org.springframework.cassandra.core.keyspace.TableOperations.alterTable; - -import org.junit.Test; -import org.springframework.cassandra.core.cql.generator.AlterTableCqlGenerator; -import org.springframework.cassandra.core.keyspace.AlterTableSpecification; - -import com.datastax.driver.core.DataType; - -public class AlterTableCqlGeneratorTest { - - @Test - public void testAlterTableBuilder() throws Exception { - String name = "mytable"; - DataType addedType = DataType.timeuuid(); - String addedName = "added_column"; - DataType alteredType = DataType.text(); - String alteredName = "altered_column"; - String droppedName = "dropped"; - - AlterTableSpecification alter = alterTable().name(name).add(addedName, addedType).alter(alteredName, alteredType) - .drop(droppedName); - AlterTableCqlGenerator generator = new AlterTableCqlGenerator(alter); - System.out.println(generator.toCql()); - } -} diff --git a/src/test/java/org/springframework/cassandra/test/unit/cql/generator/CreateTableCqlGeneratorTest.java b/src/test/java/org/springframework/cassandra/test/unit/cql/generator/CreateTableCqlGeneratorTest.java deleted file mode 100644 index 84eb3e04d..000000000 --- a/src/test/java/org/springframework/cassandra/test/unit/cql/generator/CreateTableCqlGeneratorTest.java +++ /dev/null @@ -1,47 +0,0 @@ -package org.springframework.cassandra.test.unit.cql.generator; - -import static junit.framework.Assert.assertEquals; -import static org.springframework.cassandra.core.keyspace.MapBuilder.map; -import static org.springframework.cassandra.core.keyspace.TableOperations.createTable; -import static org.springframework.cassandra.core.keyspace.TableOption.BLOOM_FILTER_FP_CHANCE; -import static org.springframework.cassandra.core.keyspace.TableOption.CACHING; -import static org.springframework.cassandra.core.keyspace.TableOption.COMMENT; -import static org.springframework.cassandra.core.keyspace.TableOption.COMPACTION; -import static org.springframework.cassandra.core.keyspace.TableOption.CompactionOption.TOMBSTONE_THRESHOLD; - -import org.junit.Test; -import org.springframework.cassandra.core.cql.generator.CreateTableCqlGenerator; -import org.springframework.cassandra.core.keyspace.CreateTableSpecification; -import org.springframework.cassandra.core.keyspace.TableOption.CachingOption; - -import com.datastax.driver.core.DataType; - -public class CreateTableCqlGeneratorTest { - - @Test - public void createTableTest() { - String name = "my\"\"table"; - DataType type0 = DataType.text(); - String partKey0 = "partitionKey0"; - String partition1 = "partitionKey1"; - String primary0 = "primary0"; - DataType type1 = DataType.text(); - String column1 = "column1"; - DataType type2 = DataType.bigint(); - String column2 = "column2"; - Object comment = "this is a comment"; - Object bloom = "0.00075"; - Object caching = CachingOption.KEYS_ONLY; - - CreateTableSpecification create = createTable().ifNotExists().name(name).partitionKeyColumn(partKey0, type0) - .partitionKeyColumn(partition1, type0).primaryKeyColumn(primary0, type0).column(column1, type1) - .column(column2, type2).with(COMMENT, comment).with(BLOOM_FILTER_FP_CHANCE, bloom) - .with(COMPACTION, map().entry(TOMBSTONE_THRESHOLD, "0.15")).with(CACHING, caching); - - CreateTableCqlGenerator generator = new CreateTableCqlGenerator(create); - String cql = generator.toCql(); - assertEquals( - "CREATE TABLE IF NOT EXISTS \"my\"\"table\" (partitionKey0 text, partitionKey1 text, primary0 text, column1 text, column2 bigint, PRIMARY KEY ((partitionKey0, partitionKey1), primary0) WITH CLUSTERING ORDER BY (primary0 ASC) AND comment = 'this is a comment' AND bloom_filter_fp_chance = 0.00075 AND compaction = { 'tombstone_threshold' : 0.15 } AND caching = keys_only;", - cql); - } -} diff --git a/src/test/java/org/springframework/cassandra/test/unit/cql/generator/DropTableCqlGeneratorTest.java b/src/test/java/org/springframework/cassandra/test/unit/cql/generator/DropTableCqlGeneratorTest.java deleted file mode 100644 index 3bb17916b..000000000 --- a/src/test/java/org/springframework/cassandra/test/unit/cql/generator/DropTableCqlGeneratorTest.java +++ /dev/null @@ -1,18 +0,0 @@ -package org.springframework.cassandra.test.unit.cql.generator; - -import static org.springframework.cassandra.core.keyspace.TableOperations.dropTable; - -import org.junit.Test; -import org.springframework.cassandra.core.cql.generator.DropTableCqlGenerator; -import org.springframework.cassandra.core.keyspace.DropTableSpecification; - -public class DropTableCqlGeneratorTest { - - @Test - public void testDropTableBuilder() throws Exception { - DropTableSpecification drop = dropTable().ifExists().name("mytable"); - - DropTableCqlGenerator generator = new DropTableCqlGenerator(drop); - System.out.println(generator.toCql()); - } -}