From 30f348126c1fd532bf745924bb08033f57f11fc1 Mon Sep 17 00:00:00 2001 From: David Webb Date: Tue, 17 Dec 2013 11:14:45 -0500 Subject: [PATCH] IN PROGRESS - Split out full options integration test. --- ...eateTableCqlGeneratorIntegrationTests.java | 18 ------- .../TableOptionsIntegrationTest.java | 48 +++++++++++++++++++ 2 files changed, 48 insertions(+), 18 deletions(-) create mode 100644 spring-cassandra/src/test/java/org/springframework/cassandra/test/integration/core/cql/generator/TableOptionsIntegrationTest.java diff --git a/spring-cassandra/src/test/java/org/springframework/cassandra/test/integration/core/cql/generator/CreateTableCqlGeneratorIntegrationTests.java b/spring-cassandra/src/test/java/org/springframework/cassandra/test/integration/core/cql/generator/CreateTableCqlGeneratorIntegrationTests.java index e9b9be63d..63806cbc7 100644 --- a/spring-cassandra/src/test/java/org/springframework/cassandra/test/integration/core/cql/generator/CreateTableCqlGeneratorIntegrationTests.java +++ b/spring-cassandra/src/test/java/org/springframework/cassandra/test/integration/core/cql/generator/CreateTableCqlGeneratorIntegrationTests.java @@ -6,7 +6,6 @@ import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.cassandra.test.integration.AbstractEmbeddedCassandraIntegrationTest; -import org.springframework.cassandra.test.unit.core.cql.generator.CreateTableCqlGeneratorTests; import org.springframework.cassandra.test.unit.core.cql.generator.CreateTableCqlGeneratorTests.BasicTest; import org.springframework.cassandra.test.unit.core.cql.generator.CreateTableCqlGeneratorTests.CompositePartitionKeyTest; import org.springframework.cassandra.test.unit.core.cql.generator.CreateTableCqlGeneratorTests.CreateTableTest; @@ -58,21 +57,4 @@ public class CreateTableCqlGeneratorIntegrationTests { return new CompositePartitionKeyTest(); } } - - public static class TableOptionsIntegrationTest extends AbstractEmbeddedCassandraIntegrationTest { - - @Test - public void test() { - - CreateTableCqlGeneratorTests.MultipleOptionsTest optionsTest = new CreateTableCqlGeneratorTests.MultipleOptionsTest(); - - optionsTest.prepare(); - - log.info(optionsTest.cql); - - session.execute(optionsTest.cql); - - assertTable(optionsTest.specification, keyspace, session); - } - } } \ No newline at end of file diff --git a/spring-cassandra/src/test/java/org/springframework/cassandra/test/integration/core/cql/generator/TableOptionsIntegrationTest.java b/spring-cassandra/src/test/java/org/springframework/cassandra/test/integration/core/cql/generator/TableOptionsIntegrationTest.java new file mode 100644 index 000000000..b0d0bd92b --- /dev/null +++ b/spring-cassandra/src/test/java/org/springframework/cassandra/test/integration/core/cql/generator/TableOptionsIntegrationTest.java @@ -0,0 +1,48 @@ +/* + * Copyright 2011-2013 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.springframework.cassandra.test.integration.core.cql.generator; + +import static org.springframework.cassandra.test.integration.core.cql.generator.CqlTableSpecificationAssertions.assertTable; + +import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.cassandra.test.integration.AbstractEmbeddedCassandraIntegrationTest; +import org.springframework.cassandra.test.unit.core.cql.generator.CreateTableCqlGeneratorTests; + +/** + * Test CREATE TABLE for all Options and assert against C* TableMetaData + * + * @author David Webb + */ +public class TableOptionsIntegrationTest extends AbstractEmbeddedCassandraIntegrationTest { + + private final static Logger log = LoggerFactory.getLogger(TableOptionsIntegrationTest.class); + + @Test + public void test() { + + CreateTableCqlGeneratorTests.MultipleOptionsTest optionsTest = new CreateTableCqlGeneratorTests.MultipleOptionsTest(); + + optionsTest.prepare(); + + log.info(optionsTest.cql); + + session.execute(optionsTest.cql); + + assertTable(optionsTest.specification, keyspace, session); + } +} \ No newline at end of file