Elffuss BraidHub

kikocis/java-driver public

Various test fixes for 3.0

Motivation:

Many tests are failing when using recent versions of C* or DSE.

Modifications:

1) Bump the default C* version to 3.8
2) Redesign @CassandraVersion and @DseVersion to be able to fully accept
tick-tock releases and correctly compare them.
3) Reduce log verbosity for Scassandra tests
4) Prevent thrift from being enabled for C* >= 4.0
5) Fix decommission tests with C* >= 3.12

This commit contains contributions by Andrew Tolbert (@tolbertam).

Result:

All tests should pass.
Changeset3faae1558f5403425c8549f022e2e55ccfc086d9d237f0a1576b526c9317f88a
AuthorAlexandre Dutra <adutra@users.noreply.github.com> · 2017-02-07 20:28 +01:00
CommitterAndrew Tolbert <andrew.tolbert@datastax.com> · 2017-02-13 16:04 -06:00
Parents8b63ad1da6ad

Browse the files at this changeset

75 files changed

modified driver-core/src/test/java/com/datastax/driver/core/AggregateMetadataTest.java +3 −3
@@ -24,7 +24,7 @@
2424 import static com.datastax.driver.core.DataType.text;
2525 import static com.datastax.driver.core.TestUtils.serializeForDynamicCompositeType;
2626
27-@CassandraVersion(major = 2.2)
27+@CassandraVersion("2.2.0")
2828 @CCMConfig(config = "enable_user_defined_functions:true")
2929 public class AggregateMetadataTest extends CCMTestsSupport {
3030
@@ -183,7 +183,7 @@
183183 * @since 3.0.1
184184 */
185185 @Test(groups = "short")
186- @CassandraVersion(major = 2.2)
186+ @CassandraVersion("2.2.0")
187187 public void should_parse_and_format_aggregate_with_composite_type_literal_initcond() {
188188 VersionNumber ver = VersionNumber.parse(CCMBridge.getCassandraVersion());
189189 if (ver.getMajor() == 3) {
@@ -204,7 +204,7 @@
204204 * @since 3.0.1
205205 */
206206 @Test(groups = "short")
207- @CassandraVersion(major = 3.0, minor = 4)
207+ @CassandraVersion("3.4")
208208 public void should_parse_and_format_aggregate_with_composite_type_hex_initcond() {
209209 VersionNumber ver = VersionNumber.parse(CCMBridge.getCassandraVersion());
210210 if ((ver.getMinor() >= 1 && ver.getMinor() < 4)) {
modified driver-core/src/test/java/com/datastax/driver/core/AsyncQueryTest.java +1 −1
@@ -166,7 +166,7 @@
166166 }
167167
168168 @Test(groups = "short")
169- @CassandraVersion(major = 2.0, description = "Paging is not supported until 2.0")
169+ @CassandraVersion(value = "2.0.0", description = "Paging is not supported until 2.0")
170170 public void should_fail_when_auto_paging_on_io_thread() throws Exception {
171171 for (int i = 0; i < 1000; i++) {
172172 Statement statement = new SimpleStatement("select v from asyncquerytest.foo where k = 1");
modified driver-core/src/test/java/com/datastax/driver/core/AsyncResultSetTest.java +1 −1
@@ -27,7 +27,7 @@
2727
2828 import static org.assertj.core.api.Assertions.assertThat;
2929
30-@CassandraVersion(major = 2.0, description = "uses paging")
30+@CassandraVersion(value = "2.0.0", description = "uses paging")
3131 public class AsyncResultSetTest extends CCMTestsSupport {
3232
3333 @Override
modified driver-core/src/test/java/com/datastax/driver/core/BatchStatementTest.java +1 −1
@@ -71,7 +71,7 @@
7171 }
7272
7373 @Test(groups = "short")
74- @CassandraVersion(major = 2.0, minor = 9, description = "This will only work with C* 2.0.9 (CASSANDRA-7337)")
74+ @CassandraVersion(value = "2.0.9", description = "This will only work with C* 2.0.9 (CASSANDRA-7337)")
7575 public void casBatchTest() {
7676 PreparedStatement st = session().prepare("INSERT INTO test (k, v) VALUES (?, ?) IF NOT EXISTS");
7777
modified driver-core/src/test/java/com/datastax/driver/core/CCMBridge.java +48 −5
@@ -281,6 +281,21 @@
281281 }
282282 }
283283
284+ /**
285+ * @return {@link VersionNumber} representation of {@link CCMBridge#getCassandraVersion()}
286+ */
287+ public static VersionNumber getCassandraVersionNumber() {
288+ return VersionNumber.parse(getCassandraVersion());
289+ }
290+
291+ /**
292+ * @param compareVersion The given version to compare with.
293+ * @return Whether or not the configured cassandra version is greater than or equal to the given version.
294+ */
295+ public static boolean isCassandraVersionAtLeast(String compareVersion) {
296+ return getCassandraVersionNumber().compareTo(VersionNumber.parse(compareVersion)) >= 0;
297+ }
298+
284299 /**
285300 * @return The configured DSE version if '-Ddse=true' specified, otherwise null.
286301 */
@@ -292,6 +307,22 @@
292307 }
293308 }
294309
310+ /**
311+ * @return {@link VersionNumber} representation of {@link CCMBridge#getDSEVersion()}
312+ */
313+ public static VersionNumber getDSEVersionNumber() {
314+ return VersionNumber.parse(getDSEVersion());
315+ }
316+
317+ /**
318+ * @param compareVersion The given version to compare with.
319+ * @return Whether or not the configured dse version is greater than or equal to the given version.
320+ */
321+ public static boolean isDSEVersionAtLeast(String compareVersion) {
322+ VersionNumber dseVersion = getDSEVersionNumber();
323+ return dseVersion != null && dseVersion.compareTo(VersionNumber.parse(compareVersion)) >= 0;
324+ }
325+
295326 /**
296327 * @return Whether or not DSE was configured via '-Ddse=true'.
297328 */
@@ -549,7 +580,12 @@
549580 @Override
550581 public void decommission(int n) {
551582 logger.debug(String.format("Decommissioning: node %s (%s%s:%s) from %s", n, TestUtils.IP_PREFIX, n, binaryPort, this));
552- execute(CCM_COMMAND + " node%d decommission", n);
583+ // Special case for C* 3.12+, DSE 5.1+, force decommission (see CASSANDRA-12510)
584+ String cmd = CCM_COMMAND + " node%d decommission";
585+ if ((!isDSE() && isCassandraVersionAtLeast("3.12")) || (isDSE() && isDSEVersionAtLeast("5.1"))) {
586+ cmd += " --force";
587+ }
588+ execute(cmd, n);
553589 }
554590
555591 @Override
@@ -908,6 +944,12 @@
908944 int storagePort = Integer.parseInt(cassandraConfiguration.get("storage_port").toString());
909945 int thriftPort = Integer.parseInt(cassandraConfiguration.get("rpc_port").toString());
910946 int binaryPort = Integer.parseInt(cassandraConfiguration.get("native_transport_port").toString());
947+ if (!isThriftSupported(dse, version)) {
948+ // remove thrift configuration
949+ cassandraConfiguration.remove("start_rpc");
950+ cassandraConfiguration.remove("rpc_port");
951+ cassandraConfiguration.remove("thrift_prepared_statements_cache_size_mb");
952+ }
911953 final CCMBridge ccm = new CCMBridge(clusterName, dse, version, storagePort, thriftPort, binaryPort, joinJvmArgs(), nodes);
912954
913955 Runtime.getRuntime().addShutdownHook(new Thread() {
@@ -921,10 +963,7 @@
921963 ccm.updateConfig(cassandraConfiguration);
922964 if (dse) {
923965 Map<String, Object> dseConfiguration = Maps.newLinkedHashMap(this.dseConfiguration);
924- /* TODO: Use version passed in if present, there is currently a conflation of C* and DSE versions
925- * when it comes to this that don't want to disturb. No tests are currently using withVersion with
926- * dse, so its not an issue at the moment. */
927- if (VersionNumber.parse(CCMBridge.getDSEVersion()).getMajor() >= 5) {
966+ if (dse && version.getMajor() >= 5) {
928967 // randomize DSE specific ports if dse present and greater than 5.0
929968 dseConfiguration.put("lease_netty_server_port", RANDOM_PORT);
930969 dseConfiguration.put("internode_messaging_options.port", RANDOM_PORT);
@@ -941,6 +980,10 @@
941980 return ccm;
942981 }
943982
983+ private static boolean isThriftSupported(boolean dse, VersionNumber version) {
984+ return dse || version.compareTo(VersionNumber.parse("4.0")) < 0;
985+ }
986+
944987 public int weight() {
945988 // the weight is simply function of the number of nodes
946989 int totalNodes = 0;
modified driver-core/src/test/java/com/datastax/driver/core/ConditionalUpdateTest.java +1 −1
@@ -24,7 +24,7 @@
2424 /**
2525 * Test {@link ResultSet#wasApplied()} for conditional updates.
2626 */
27-@CassandraVersion(major = 2.0, description = "Conditional Updates requires 2.0+.")
27+@CassandraVersion(value = "2.0.0", description = "Conditional Updates requires 2.0+.")
2828 public class ConditionalUpdateTest extends CCMTestsSupport {
2929
3030 @Override
modified driver-core/src/test/java/com/datastax/driver/core/ControlConnectionTest.java +1 −1
@@ -86,7 +86,7 @@
8686 * Therefore we use two different driver instances in this test.
8787 */
8888 @Test(groups = "short")
89- @CassandraVersion(major = 2.1)
89+ @CassandraVersion("2.1.0")
9090 public void should_parse_UDT_definitions_when_using_default_protocol_version() {
9191 // First driver instance: create UDT
9292 Cluster cluster = register(Cluster.builder()
modified driver-core/src/test/java/com/datastax/driver/core/CustomPayloadTest.java +1 −11
@@ -33,7 +33,7 @@
3333 import static org.assertj.core.api.Assertions.assertThat;
3434 import static org.assertj.core.api.Fail.fail;
3535
36-@CassandraVersion(major = 2.2)
36+@CassandraVersion("2.2.0")
3737 @CCMConfig(jvmArgs = "-Dcassandra.custom_query_handler_class=org.apache.cassandra.cql3.CustomPayloadMirroringQueryHandler")
3838 public class CustomPayloadTest extends CCMTestsSupport {
3939
@@ -85,8 +85,6 @@
8585
8686 /**
8787 * Ensures that an incoming payload is propagated from prepared to bound statements.
88- *
89- * @throws Exception
9088 */
9189 @Test(groups = "short")
9290 public void should_propagate_incoming_payload_to_bound_statement() throws Exception {
@@ -113,8 +111,6 @@
113111 /**
114112 * Ensures that an incoming payload is overridden by an explicitly set outgoing payload
115113 * when propagated to bound statements.
116- *
117- * @throws Exception
118114 */
119115 @Test(groups = "short")
120116 public void should_override_incoming_payload_when_outgoing_payload_explicitly_set_on_preparing_statement() throws Exception {
@@ -141,8 +137,6 @@
141137 /**
142138 * Ensures that payloads can still be set individually on bound statements
143139 * if the prepared statement does not have a default payload.
144- *
145- * @throws Exception
146140 */
147141 @Test(groups = "short")
148142 public void should_not_set_any_payload_on_bound_statement() throws Exception {
@@ -171,8 +165,6 @@
171165
172166 /**
173167 * Ensures that a custom payload is propagated throughout pages.
174- *
175- * @throws Exception
176168 */
177169 @Test(groups = "short")
178170 public void should_echo_custom_payload_when_paginating() throws Exception {
@@ -253,8 +245,6 @@
253245
254246 /**
255247 * Ensures that when debugging custom payloads, the driver will print appropriate log messages.
256- *
257- * @throws Exception
258248 */
259249 @Test(groups = "short")
260250 public void should_print_log_message_when_level_trace() throws Exception {
modified driver-core/src/test/java/com/datastax/driver/core/CustomTypeTest.java +1 −2
@@ -19,7 +19,6 @@
1919 import org.testng.annotations.Test;
2020
2121 import java.nio.ByteBuffer;
22-import java.util.ArrayList;
2322 import java.util.List;
2423 import java.util.Map;
2524
@@ -153,7 +152,7 @@
153152 * @test_category metadata
154153 */
155154 @Test(groups = "short")
156- @CassandraVersion(major = 2.1)
155+ @CassandraVersion("2.1.0")
157156 public void should_handle_udt_with_custom_type() {
158157 // Given: a UDT with custom types, and a table using it.
159158 session().execute("CREATE TYPE custom_udt (regular int, c1 'DynamicCompositeType(s => UTF8Type, i => Int32Type)', c2 'LongType')");
modified driver-core/src/test/java/com/datastax/driver/core/DataTypeCqlNameParserTest.java +1 −1
@@ -23,7 +23,7 @@
2323 import static com.datastax.driver.core.DataTypeCqlNameParser.parse;
2424 import static com.datastax.driver.core.Metadata.quote;
2525
26-@CassandraVersion(major = 3.0)
26+@CassandraVersion("3.0")
2727 public class DataTypeCqlNameParserTest extends CCMTestsSupport {
2828
2929 @Test(groups = "short")
modified driver-core/src/test/java/com/datastax/driver/core/DataTypeIntegrationTest.java +1 −2
@@ -36,7 +36,6 @@
3636 * (protocol > v2 only) and a prepared statement.
3737 * This is repeated with a large number of datatypes.
3838 */
39-@CCMConfig(clusterProvider = "createClusterBuilderNoDebouncing")
4039 public class DataTypeIntegrationTest extends CCMTestsSupport {
4140 private static final Logger logger = LoggerFactory.getLogger(DataTypeIntegrationTest.class);
4241
@@ -71,7 +70,7 @@
7170 }
7271
7372 @Test(groups = "long")
74- @CassandraVersion(major = 2.0, description = "Uses parameterized simple statements, which are only available with protocol v2")
73+ @CassandraVersion(value = "2.0", description = "Uses parameterized simple statements, which are only available with protocol v2")
7574 public void should_insert_and_retrieve_data_with_parameterized_simple_statements() {
7675 should_insert_and_retrieve_data(StatementType.SIMPLE_WITH_PARAM);
7776 }
modified driver-core/src/test/java/com/datastax/driver/core/DirectCompressionTest.java +1 −1
@@ -40,7 +40,7 @@
4040 * @expected_result session established and queries made successfully using it.
4141 */
4242 @Test(groups = "short")
43- @CassandraVersion(major = 2.0)
43+ @CassandraVersion("2.0.0")
4444 public void should_function_with_lz4_compression() throws Exception {
4545 compressionTest(ProtocolOptions.Compression.LZ4);
4646 }
modified driver-core/src/test/java/com/datastax/driver/core/FunctionMetadataTest.java +3 −2
@@ -19,10 +19,11 @@
1919 import org.testng.annotations.Test;
2020
2121 import static com.datastax.driver.core.Assertions.assertThat;
22-import static com.datastax.driver.core.DataType.*;
22+import static com.datastax.driver.core.DataType.cint;
23+import static com.datastax.driver.core.DataType.map;
2324 import static org.assertj.core.api.Assertions.entry;
2425
25-@CassandraVersion(major = 2.2)
26+@CassandraVersion("2.2.0")
2627 @CCMConfig(config = "enable_user_defined_functions:true")
2728 public class FunctionMetadataTest extends CCMTestsSupport {
2829
modified driver-core/src/test/java/com/datastax/driver/core/HeapCompressionTest.java +1 −1
@@ -47,7 +47,7 @@
4747 * @expected_result session established and queries made successfully using it.
4848 */
4949 @Test(groups = "isolated")
50- @CassandraVersion(major = 2.0)
50+ @CassandraVersion("2.0.0")
5151 public void should_function_with_lz4_compression() throws Exception {
5252 compressionTest(ProtocolOptions.Compression.LZ4);
5353 }
modified driver-core/src/test/java/com/datastax/driver/core/HostMetadataIntegrationTest.java +1 −1
@@ -42,7 +42,7 @@
4242 * @see HostMetadataIntegrationTest#should_parse_dse_workload_and_version_if_available()
4343 */
4444 @Test(groups = "long")
45- @DseVersion(major = 5.0)
45+ @DseVersion("5.0.0")
4646 public void test_mixed_dse_workload() {
4747 CCMBridge.Builder builder = CCMBridge.builder()
4848 .withNodes(3)
modified driver-core/src/test/java/com/datastax/driver/core/IndexMetadataTest.java +9 −9
@@ -32,7 +32,7 @@
3232 import static com.datastax.driver.core.DataType.*;
3333 import static com.datastax.driver.core.IndexMetadata.Kind.*;
3434
35-@CassandraVersion(major = 1.2)
35+@CassandraVersion("1.2.0")
3636 public class IndexMetadataTest extends CCMTestsSupport {
3737
3838 /**
@@ -103,7 +103,7 @@
103103 }
104104
105105 @Test(groups = "short")
106- @CassandraVersion(major = 2.1, description = "index names with quoted identifiers and collection indexes not supported until 2.1")
106+ @CassandraVersion(value = "2.1", description = "index names with quoted identifiers and collection indexes not supported until 2.1")
107107 public void should_create_metadata_for_values_index_on_mixed_case_column() {
108108 // 3.0 assumes the 'values' keyword if index on a collection
109109 String createValuesIndex = ccm().getVersion().getMajor() > 2 ?
@@ -123,7 +123,7 @@
123123 }
124124
125125 @Test(groups = "short")
126- @CassandraVersion(major = 2.1)
126+ @CassandraVersion("2.1.0")
127127 public void should_create_metadata_for_index_on_map_values() {
128128 // 3.0 assumes the 'values' keyword if index on a collection
129129 String createValuesIndex = ccm().getVersion().getMajor() > 2 ?
@@ -143,7 +143,7 @@
143143 }
144144
145145 @Test(groups = "short")
146- @CassandraVersion(major = 2.1)
146+ @CassandraVersion("2.1.0")
147147 public void should_create_metadata_for_index_on_map_keys() {
148148 String createKeysIndex = String.format("CREATE INDEX map_keys_index ON %s.indexing (keys(map_keys));", keyspace);
149149 session().execute(createKeysIndex);
@@ -160,7 +160,7 @@
160160 }
161161
162162 @Test(groups = "short")
163- @CassandraVersion(major = 2.1, minor = 3)
163+ @CassandraVersion("2.1.3")
164164 public void should_create_metadata_for_full_index_on_map() {
165165 String createFullIndex = String.format("CREATE INDEX map_full_index ON %s.indexing (full(map_full));", keyspace);
166166 session().execute(createFullIndex);
@@ -177,7 +177,7 @@
177177 }
178178
179179 @Test(groups = "short")
180- @CassandraVersion(major = 2.1, minor = 3)
180+ @CassandraVersion("2.1.3")
181181 public void should_create_metadata_for_full_index_on_set() {
182182 String createFullIndex = String.format("CREATE INDEX set_full_index ON %s.indexing (full(set_full));", keyspace);
183183 session().execute(createFullIndex);
@@ -194,7 +194,7 @@
194194 }
195195
196196 @Test(groups = "short")
197- @CassandraVersion(major = 2.1, minor = 3)
197+ @CassandraVersion("2.1.3")
198198 public void should_create_metadata_for_full_index_on_list() {
199199 String createFullIndex = String.format("CREATE INDEX list_full_index ON %s.indexing (full(list_full));", keyspace);
200200 session().execute(createFullIndex);
@@ -211,7 +211,7 @@
211211 }
212212
213213 @Test(groups = "short")
214- @CassandraVersion(major = 2.2)
214+ @CassandraVersion("2.2.0")
215215 public void should_create_metadata_for_index_on_map_entries() {
216216 String createEntriesIndex = String.format("CREATE INDEX map_entries_index ON %s.indexing (entries(map_entries));", keyspace);
217217 session().execute(createEntriesIndex);
@@ -228,7 +228,7 @@
228228 }
229229
230230 @Test(groups = "short")
231- @CassandraVersion(major = 3.0)
231+ @CassandraVersion("3.0")
232232 public void should_allow_multiple_indexes_on_map_column() {
233233 String createEntriesIndex = String.format("CREATE INDEX map_all_entries_index ON %s.indexing (entries(map_all));", keyspace);
234234 session().execute(createEntriesIndex);
modified driver-core/src/test/java/com/datastax/driver/core/LargeDataTest.java +2 −14
@@ -180,11 +180,9 @@
180180
181181 /**
182182 * Test a wide row of size 1,000,000
183- *
184- * @throws Throwable
185183 */
186184 @Test(groups = "stress")
187- @CassandraVersion(major = 2.0, minor = 0, description = "< 2.0 is skipped as 1.2 does not handle reading wide rows well.")
185+ @CassandraVersion(value = "2.0.0", description = "< 2.0 is skipped as 1.2 does not handle reading wide rows well.")
188186 public void wideRows() throws Throwable {
189187 session().execute(String.format(CREATE_KEYSPACE_SIMPLE_FORMAT, "large_data", 1));
190188 session().execute("USE large_data");
@@ -194,11 +192,9 @@
194192
195193 /**
196194 * Test a batch that writes a row of size 4,000 (just below the error threshold for 2.2).
197- *
198- * @throws Throwable
199195 */
200196 @Test(groups = "stress")
201- @CassandraVersion(major = 2.0, minor = 0, description = "< 2.0 is skipped as 1.2 does not handle large batches well.")
197+ @CassandraVersion(value = "2.0.0", description = "< 2.0 is skipped as 1.2 does not handle large batches well.")
202198 public void wideBatchRows() throws Throwable {
203199 session().execute(String.format(CREATE_KEYSPACE_SIMPLE_FORMAT, "large_data", 1));
204200 session().execute("USE large_data");
@@ -208,8 +204,6 @@
208204
209205 /**
210206 * Test a wide row of size 1,000,000 consisting of a ByteBuffer
211- *
212- * @throws Throwable
213207 */
214208 @Test(groups = "stress")
215209 public void wideByteRows() throws Throwable {
@@ -221,8 +215,6 @@
221215
222216 /**
223217 * Test a row with a single extra large text value
224- *
225- * @throws Throwable
226218 */
227219 @Test(groups = "stress")
228220 public void largeText() throws Throwable {
@@ -234,8 +226,6 @@
234226
235227 /**
236228 * Creates a table with 330 columns
237- *
238- * @throws Throwable
239229 */
240230 @Test(groups = "stress")
241231 public void wideTable() throws Throwable {
@@ -255,8 +245,6 @@
255245
256246 /**
257247 * Tests 10 random tests consisting of the other methods in this class
258- *
259- * @throws Throwable
260248 */
261249 @Test(groups = "duration")
262250 @CCMConfig(numberOfNodes = 3)
modified driver-core/src/test/java/com/datastax/driver/core/MaterializedViewMetadataTest.java +1 −1
@@ -22,7 +22,7 @@
2222 import static com.datastax.driver.core.ClusteringOrder.DESC;
2323 import static com.datastax.driver.core.DataType.cint;
2424
25-@CassandraVersion(major = 3)
25+@CassandraVersion("3.0")
2626 public class MaterializedViewMetadataTest extends CCMTestsSupport {
2727
2828 /**
modified driver-core/src/test/java/com/datastax/driver/core/PagingStateTest.java +3 −3
@@ -25,7 +25,7 @@
2525
2626 import static org.assertj.core.api.Assertions.assertThat;
2727
28-@CassandraVersion(major = 2.0)
28+@CassandraVersion("2.0.0")
2929 public class PagingStateTest extends CCMTestsSupport {
3030
3131 private static final Logger logger = LoggerFactory.getLogger(PagingStateTest.class);
@@ -141,7 +141,7 @@
141141 * from the first query.
142142 */
143143 @Test(groups = "short")
144- @CassandraVersion(major = 2.0)
144+ @CassandraVersion("2.0.0")
145145 public void should_be_able_to_use_state_with_bound_statement() {
146146 PreparedStatement prepared = session().prepare("SELECT v from test where k=?");
147147 BoundStatement bs = prepared.bind(KEY);
@@ -164,7 +164,7 @@
164164 * @expected_result A failure is thrown when setting paging state on a different {@link BoundStatement}.
165165 */
166166 @Test(groups = "short", expectedExceptions = {PagingStateException.class})
167- @CassandraVersion(major = 2.0)
167+ @CassandraVersion("2.0.0")
168168 public void should_not_be_able_to_use_state_with_different_bound_statement() {
169169 PreparedStatement prepared = session().prepare("SELECT v from test where k=?");
170170 BoundStatement bs0 = prepared.bind(KEY);
modified driver-core/src/test/java/com/datastax/driver/core/PreparedStatementTest.java +6 −6
@@ -485,7 +485,7 @@
485485 * @since 2.2.0
486486 */
487487 @Test(groups = "short")
488- @CassandraVersion(major = 2.0)
488+ @CassandraVersion("2.0.0")
489489 public void should_not_allow_unbound_value_on_batch_statement_when_protocol_lesser_than_v4() {
490490 Cluster cluster = register(Cluster.builder()
491491 .addContactPoints(getContactPoints())
@@ -515,7 +515,7 @@
515515 * @since 2.2.0
516516 */
517517 @Test(groups = "short")
518- @CassandraVersion(major = 2.2)
518+ @CassandraVersion("2.2.0")
519519 public void should_not_create_tombstone_when_unbound_value_on_bound_statement_and_protocol_v4() {
520520 PreparedStatement prepared = session().prepare("INSERT INTO " + SIMPLE_TABLE + " (k, i) VALUES (?, ?)");
521521 BoundStatement st1 = prepared.bind();
@@ -545,7 +545,7 @@
545545 * @since 2.2.0
546546 */
547547 @Test(groups = "short")
548- @CassandraVersion(major = 2.2)
548+ @CassandraVersion("2.2.0")
549549 public void should_unset_value_by_index() {
550550 PreparedStatement prepared = session().prepare("INSERT INTO " + SIMPLE_TABLE + " (k, i) VALUES (?, ?)");
551551 BoundStatement bound = prepared.bind();
@@ -576,7 +576,7 @@
576576 * @since 2.2.0
577577 */
578578 @Test(groups = "short")
579- @CassandraVersion(major = 2.2)
579+ @CassandraVersion("2.2.0")
580580 public void should_unset_value_by_name() {
581581 PreparedStatement prepared = session().prepare("INSERT INTO " + SIMPLE_TABLE + " (k, i) VALUES (:k, :i)");
582582 BoundStatement bound = prepared.bind();
@@ -608,7 +608,7 @@
608608 * @since 2.2.0
609609 */
610610 @Test(groups = "short")
611- @CassandraVersion(major = 2.2)
611+ @CassandraVersion("2.2.0")
612612 public void should_not_create_tombstone_when_unbound_value_on_batch_statement_and_protocol_v4() {
613613 PreparedStatement prepared = session().prepare("INSERT INTO " + SIMPLE_TABLE + " (k, i) VALUES (?, ?)");
614614 BoundStatement st1 = prepared.bind();
@@ -661,7 +661,7 @@
661661 * @since 2.2.0
662662 */
663663 @Test(groups = "short")
664- @CassandraVersion(major = 2.0)
664+ @CassandraVersion("2.0.0")
665665 public void should_create_tombstone_when_null_value_on_batch_statement() {
666666 PreparedStatement prepared = session().prepare("INSERT INTO " + SIMPLE_TABLE + " (k, i) VALUES (?, ?)");
667667 BoundStatement st1 = prepared.bind();
modified driver-core/src/test/java/com/datastax/driver/core/QueryLoggerTest.java +22 −22
@@ -171,7 +171,7 @@
171171 }
172172
173173 @Test(groups = "short")
174- @CassandraVersion(major = 2.0)
174+ @CassandraVersion("2.0.0")
175175 public void should_log_batch_statements() throws Exception {
176176 // given
177177 normal.setLevel(DEBUG);
@@ -202,7 +202,7 @@
202202 }
203203
204204 @Test(groups = "short")
205- @CassandraVersion(major = 2.0)
205+ @CassandraVersion("2.0.0")
206206 public void should_log_unlogged_batch_statements() throws Exception {
207207 // given
208208 normal.setLevel(DEBUG);
@@ -233,7 +233,7 @@
233233 }
234234
235235 @Test(groups = "short")
236- @CassandraVersion(major = 2.0)
236+ @CassandraVersion("2.0.0")
237237 public void should_log_counter_batch_statements() throws Exception {
238238 // Create a special table for testing with counters.
239239 session().execute(
@@ -376,7 +376,7 @@
376376 // Tests with query parameters (log level TRACE)
377377
378378 @Test(groups = "short")
379- @CassandraVersion(major = 2.0)
379+ @CassandraVersion("2.0.0")
380380 public void should_log_non_null_named_parameter_bound_statements() throws Exception {
381381 // given
382382 normal.setLevel(TRACE);
@@ -426,7 +426,7 @@
426426 }
427427
428428 @Test(groups = "short")
429- @CassandraVersion(major = 2.0)
429+ @CassandraVersion("2.0.0")
430430 public void should_log_non_null_positional_parameter_simple_statements() throws Exception {
431431 // given
432432 normal.setLevel(TRACE);
@@ -470,7 +470,7 @@
470470 }
471471
472472 @Test(groups = "short")
473- @CassandraVersion(major = 2.0)
473+ @CassandraVersion("2.0.0")
474474 public void should_log_null_parameter_simple_statements() throws Exception {
475475 // given
476476 normal.setLevel(TRACE);
@@ -491,7 +491,7 @@
491491 }
492492
493493 @Test(groups = "short")
494- @CassandraVersion(major = 3.0)
494+ @CassandraVersion("3.0")
495495 public void should_log_unset_parameter() throws Exception {
496496 // given
497497 normal.setLevel(TRACE);
@@ -514,7 +514,7 @@
514514 }
515515
516516 @Test(groups = "short")
517- @CassandraVersion(major = 2.0)
517+ @CassandraVersion("2.0.0")
518518 public void should_log_bound_statement_parameters_inside_batch_statement() throws Exception {
519519 // given
520520 normal.setLevel(TRACE);
@@ -541,7 +541,7 @@
541541 }
542542
543543 @Test(groups = "short")
544- @CassandraVersion(major = 2.0)
544+ @CassandraVersion("2.0.0")
545545 public void should_log_simple_statement_parameters_inside_batch_statement() throws Exception {
546546 // given
547547 normal.setLevel(TRACE);
@@ -596,7 +596,7 @@
596596 }
597597
598598 @Test(groups = "short")
599- @CassandraVersion(major = 2.0)
599+ @CassandraVersion("2.0.0")
600600 public void should_log_all_parameter_types_simple_statements() throws Exception {
601601 // given
602602 normal.setLevel(TRACE);
@@ -648,7 +648,7 @@
648648 .doesNotContain(query);
649649 }
650650
651- @CassandraVersion(major = 2.0)
651+ @CassandraVersion("2.0.0")
652652 @Test(groups = "short")
653653 public void should_show_total_statements_for_batches_even_if_query_truncated() throws Exception {
654654 // given
@@ -695,7 +695,7 @@
695695 .doesNotContain(TRUNCATED_OUTPUT);
696696 }
697697
698- @CassandraVersion(major = 2.0)
698+ @CassandraVersion("2.0.0")
699699 @Test(groups = "short")
700700 public void should_truncate_parameter_when_max_length_exceeded_bound_statements() throws Exception {
701701 // given
@@ -720,7 +720,7 @@
720720 .doesNotContain("123456");
721721 }
722722
723- @CassandraVersion(major = 2.0)
723+ @CassandraVersion("2.0.0")
724724 @Test(groups = "short")
725725 public void should_truncate_parameter_when_max_length_exceeded_simple_statements() throws Exception {
726726 // given
@@ -767,7 +767,7 @@
767767 }
768768
769769 @Test(groups = "short")
770- @CassandraVersion(major = 2.0)
770+ @CassandraVersion("2.0.0")
771771 public void should_truncate_blob_parameter_when_max_length_exceeded_simple_statements() throws Exception {
772772 // given
773773 normal.setLevel(TRACE);
@@ -813,7 +813,7 @@
813813 }
814814
815815 @Test(groups = "short")
816- @CassandraVersion(major = 2.0)
816+ @CassandraVersion("2.0.0")
817817 public void should_not_truncate_parameter_when_max_length_unlimited_simple_statements() throws Exception {
818818 // given
819819 normal.setLevel(TRACE);
@@ -860,7 +860,7 @@
860860 }
861861
862862 @Test(groups = "short")
863- @CassandraVersion(major = 2.0)
863+ @CassandraVersion("2.0.0")
864864 public void should_not_log_exceeding_number_of_parameters_simple_statements() throws Exception {
865865 // given
866866 normal.setLevel(TRACE);
@@ -883,7 +883,7 @@
883883 }
884884
885885 @Test(groups = "short")
886- @CassandraVersion(major = 2.1)
886+ @CassandraVersion("2.1.0")
887887 public void should_not_log_exceeding_number_of_parameters_simple_statements_with_named_values() throws Exception {
888888 // given
889889 normal.setLevel(TRACE);
@@ -909,7 +909,7 @@
909909 }
910910
911911 @Test(groups = "short")
912- @CassandraVersion(major = 2.0)
912+ @CassandraVersion("2.0.0")
913913 public void should_not_log_exceeding_number_of_parameters_in_batch_statement_bound_statements() throws Exception {
914914 // given
915915 normal.setLevel(TRACE);
@@ -939,7 +939,7 @@
939939 }
940940
941941 @Test(groups = "short")
942- @CassandraVersion(major = 2.0)
942+ @CassandraVersion("2.0.0")
943943 public void should_not_log_exceeding_number_of_parameters_in_batch_statement_simple_statements() throws Exception {
944944 // given
945945 normal.setLevel(TRACE);
@@ -991,7 +991,7 @@
991991 }
992992
993993 @Test(groups = "short")
994- @CassandraVersion(major = 2.0)
994+ @CassandraVersion("2.0.0")
995995 public void should_log_all_parameters_when_max_unlimited_simple_statements() throws Exception {
996996 // given
997997 normal.setLevel(TRACE);
@@ -1013,7 +1013,7 @@
10131013 }
10141014
10151015 @Test(groups = "short")
1016- @CassandraVersion(major = 2.1)
1016+ @CassandraVersion("2.1.0")
10171017 public void should_log_all_parameters_when_max_unlimited_simple_statements_with_named_values() throws Exception {
10181018 // given
10191019 normal.setLevel(TRACE);
@@ -1037,7 +1037,7 @@
10371037 .contains("42");
10381038 }
10391039
1040- @CassandraVersion(major = 2.0)
1040+ @CassandraVersion("2.0.0")
10411041 @Test(groups = "short")
10421042 public void should_log_wrapped_bound_statement() throws Exception {
10431043 // given
modified driver-core/src/test/java/com/datastax/driver/core/QueryTimestampTest.java +1 −1
@@ -27,7 +27,7 @@
2727 /**
2828 * Tests the behavior of client-provided timestamps with protocol v3.
2929 */
30-@CassandraVersion(major = 2.1)
30+@CassandraVersion("2.1.0")
3131 public class QueryTimestampTest extends CCMTestsSupport {
3232
3333 private volatile long timestampFromGenerator;
modified driver-core/src/test/java/com/datastax/driver/core/RecommissionedNodeTest.java +1 −1
@@ -145,7 +145,7 @@
145145 }
146146
147147 @Test(groups = "long")
148- @CassandraVersion(major = 2.0)
148+ @CassandraVersion("2.0.0")
149149 public void should_ignore_node_that_does_not_support_protocol_version_on_session_init() throws Exception {
150150 // Simulate the bug before starting the cluster
151151 mainCcmBuilder = CCMBridge.builder().withNodes(2);
modified driver-core/src/test/java/com/datastax/driver/core/SchemaChangesTest.java +12 −12
@@ -209,7 +209,7 @@
209209
210210 @SuppressWarnings("RedundantCast")
211211 @Test(groups = "short", dataProvider = "existingKeyspaceName")
212- @CassandraVersion(major = 2.1)
212+ @CassandraVersion("2.1.0")
213213 public void should_notify_of_udt_creation(String keyspace) {
214214 session1.execute(String.format("CREATE TYPE %s.type1(i int)", keyspace));
215215 for (SchemaChangeListener listener : listeners) {
@@ -223,7 +223,7 @@
223223 }
224224
225225 @Test(groups = "short", dataProvider = "existingKeyspaceName")
226- @CassandraVersion(major = 2.1)
226+ @CassandraVersion("2.1.0")
227227 public void should_notify_of_udt_update(String keyspace) {
228228 session1.execute(String.format("CREATE TYPE %s.type1(i int)", keyspace));
229229 session1.execute(String.format("ALTER TYPE %s.type1 ADD j int", keyspace));
@@ -240,7 +240,7 @@
240240
241241 @SuppressWarnings("RedundantCast")
242242 @Test(groups = "short", dataProvider = "existingKeyspaceName")
243- @CassandraVersion(major = 2.1)
243+ @CassandraVersion("2.1.0")
244244 public void should_notify_of_udt_drop(String keyspace) {
245245 session1.execute(String.format("CREATE TYPE %s.type1(i int)", keyspace));
246246 session1.execute(String.format("DROP TYPE %s.type1", keyspace));
@@ -254,7 +254,7 @@
254254 }
255255
256256 @Test(groups = "short", dataProvider = "existingKeyspaceName")
257- @CassandraVersion(major = 2.2)
257+ @CassandraVersion("2.2.0")
258258 public void should_notify_of_function_creation(String keyspace) {
259259 session1.execute(String.format("CREATE FUNCTION %s.\"ID\"(i int) RETURNS NULL ON NULL INPUT RETURNS int LANGUAGE java AS 'return i;'", keyspace));
260260 for (SchemaChangeListener listener : listeners) {
@@ -270,7 +270,7 @@
270270 }
271271
272272 @Test(groups = "short", dataProvider = "existingKeyspaceName")
273- @CassandraVersion(major = 2.2)
273+ @CassandraVersion("2.2.0")
274274 public void should_notify_of_function_update(String keyspace) {
275275 session1.execute(String.format("CREATE FUNCTION %s.\"ID\"(i int) RETURNS NULL ON NULL INPUT RETURNS int LANGUAGE java AS 'return i;'", keyspace));
276276 for (SchemaChangeListener listener : listeners) {
@@ -297,7 +297,7 @@
297297 }
298298
299299 @Test(groups = "short", dataProvider = "existingKeyspaceName")
300- @CassandraVersion(major = 2.2)
300+ @CassandraVersion("2.2.0")
301301 public void should_notify_of_function_drop(String keyspace) {
302302 session1.execute(String.format("CREATE FUNCTION %s.\"ID\"(i int) RETURNS NULL ON NULL INPUT RETURNS int LANGUAGE java AS 'return i;'", keyspace));
303303 session1.execute(String.format("DROP FUNCTION %s.\"ID\"", keyspace));
@@ -314,7 +314,7 @@
314314 }
315315
316316 @Test(groups = "short", dataProvider = "existingKeyspaceName")
317- @CassandraVersion(major = 2.2)
317+ @CassandraVersion("2.2.0")
318318 public void should_notify_of_aggregate_creation(String keyspace) {
319319 session1.execute(String.format("CREATE FUNCTION %s.\"PLUS\"(s int, v int) RETURNS NULL ON NULL INPUT RETURNS int LANGUAGE java"
320320 + " AS 'return s+v;'", keyspace));
@@ -332,7 +332,7 @@
332332 }
333333
334334 @Test(groups = "short", dataProvider = "existingKeyspaceName")
335- @CassandraVersion(major = 2.2)
335+ @CassandraVersion("2.2.0")
336336 public void should_notify_of_aggregate_update(String keyspace) {
337337 session1.execute(String.format("CREATE FUNCTION %s.\"PLUS\"(s int, v int) RETURNS NULL ON NULL INPUT RETURNS int LANGUAGE java"
338338 + " AS 'return s+v;'", keyspace));
@@ -361,7 +361,7 @@
361361 }
362362
363363 @Test(groups = "short", dataProvider = "existingKeyspaceName")
364- @CassandraVersion(major = 2.2)
364+ @CassandraVersion("2.2.0")
365365 public void should_notify_of_aggregate_drop(String keyspace) {
366366 session1.execute(String.format("CREATE FUNCTION %s.\"PLUS\"(s int, v int) RETURNS NULL ON NULL INPUT RETURNS int LANGUAGE java"
367367 + " AS 'return s+v;'", keyspace));
@@ -380,7 +380,7 @@
380380 }
381381
382382 @Test(groups = "short", dataProvider = "existingKeyspaceName")
383- @CassandraVersion(major = 3.0)
383+ @CassandraVersion("3.0")
384384 public void should_notify_of_view_creation(String keyspace) {
385385 session1.execute(String.format("CREATE TABLE %s.table1 (pk int PRIMARY KEY, c int)", keyspace));
386386 session1.execute(String.format("CREATE MATERIALIZED VIEW %s.mv1 AS SELECT c FROM %s.table1 WHERE c IS NOT NULL PRIMARY KEY (pk, c)", keyspace, keyspace));
@@ -395,7 +395,7 @@
395395 }
396396
397397 @Test(groups = "short", dataProvider = "existingKeyspaceName")
398- @CassandraVersion(major = 3.0)
398+ @CassandraVersion("3.0")
399399 public void should_notify_of_view_update(String keyspace) {
400400 session1.execute(String.format("CREATE TABLE %s.table1 (pk int PRIMARY KEY, c int)", keyspace));
401401 session1.execute(String.format("CREATE MATERIALIZED VIEW %s.mv1 AS SELECT c FROM %s.table1 WHERE c IS NOT NULL PRIMARY KEY (pk, c) WITH compaction = { 'class' : 'SizeTieredCompactionStrategy' }", keyspace, keyspace));
@@ -424,7 +424,7 @@
424424 }
425425
426426 @Test(groups = "short", dataProvider = "existingKeyspaceName")
427- @CassandraVersion(major = 3.0)
427+ @CassandraVersion("3.0")
428428 public void should_notify_of_view_drop(String keyspace) {
429429 session1.execute(String.format("CREATE TABLE %s.table1 (pk int PRIMARY KEY, c int)", keyspace));
430430 session1.execute(String.format("CREATE MATERIALIZED VIEW %s.mv1 AS SELECT c FROM %s.table1 WHERE c IS NOT NULL PRIMARY KEY (pk, c)", keyspace, keyspace));
modified driver-core/src/test/java/com/datastax/driver/core/SimpleStatementIntegrationTest.java +5 −5
@@ -35,7 +35,7 @@
3535 }
3636
3737 @Test(groups = "short")
38- @CassandraVersion(major = 2.1)
38+ @CassandraVersion("2.1.0")
3939 public void should_execute_query_with_named_values() {
4040 // Given
4141 SimpleStatement statement = new SimpleStatement("SELECT * FROM users WHERE id = :id and id2 = :id2",
@@ -50,7 +50,7 @@
5050 }
5151
5252 @Test(groups = "short", expectedExceptions = InvalidQueryException.class)
53- @CassandraVersion(major = 2.1)
53+ @CassandraVersion("2.1.0")
5454 public void should_fail_if_query_with_named_values_but_missing_parameter() {
5555 // Given a Statement missing named parameters.
5656 SimpleStatement statement = new SimpleStatement("SELECT * FROM users WHERE id = :id and id2 = :id2",
@@ -64,7 +64,7 @@
6464 }
6565
6666 @Test(groups = "short", expectedExceptions = InvalidQueryException.class)
67- @CassandraVersion(major = 2.1)
67+ @CassandraVersion("2.1.0")
6868 public void should_fail_if_query_with_named_values_but_using_wrong_type() {
6969 // Given a Statement using a named parameter with the wrong value for the type (id is of type int, using double)
7070 SimpleStatement statement = new SimpleStatement("SELECT * FROM users WHERE id = :id and id2 = :id2",
@@ -98,7 +98,7 @@
9898 }
9999
100100 @Test(groups = "short", expectedExceptions = UnsupportedFeatureException.class)
101- @CassandraVersion(major = 2.0)
101+ @CassandraVersion("2.0.0")
102102 public void should_fail_if_query_with_named_values_if_protocol_is_V2() {
103103 if (ccm().getVersion().getMajor() >= 3) {
104104 throw new SkipException("Skipping since Cassandra 3.0+ does not support protocol v2");
@@ -107,7 +107,7 @@
107107 }
108108
109109 @Test(groups = "short", expectedExceptions = UnsupportedFeatureException.class)
110- @CassandraVersion(major = 2.0)
110+ @CassandraVersion("2.0.0")
111111 public void should_fail_if_query_with_named_values_if_protocol_is_V1() {
112112 if (ccm().getVersion().getMajor() >= 3) {
113113 throw new SkipException("Skipping since Cassandra 3.0+ does not support protocol v1");
modified driver-core/src/test/java/com/datastax/driver/core/SingleConnectionPoolTest.java +1 −1
@@ -25,7 +25,7 @@
2525
2626 import static org.testng.Assert.fail;
2727
28-@CassandraVersion(major = 2.1)
28+@CassandraVersion("2.1.0")
2929 public class SingleConnectionPoolTest extends CCMTestsSupport {
3030
3131 @Test(groups = "short")
modified driver-core/src/test/java/com/datastax/driver/core/StatementWrapperTest.java +3 −3
@@ -87,7 +87,7 @@
8787 assertThat(retryPolicy.customStatementsHandled.get()).isEqualTo(1);
8888 }
8989
90- @CassandraVersion(major = 2.0)
90+ @CassandraVersion("2.0.0")
9191 @Test(groups = "short")
9292 public void should_execute_wrapped_simple_statement() {
9393 session().execute(new CustomStatement(new SimpleStatement(INSERT_QUERY, "key_simple", 1)));
@@ -106,7 +106,7 @@
106106 assertThat(rs.one().getInt("v")).isEqualTo(1);
107107 }
108108
109- @CassandraVersion(major = 2.0)
109+ @CassandraVersion("2.0.0")
110110 @Test(groups = "short")
111111 public void should_execute_wrapped_batch_statement() {
112112 BatchStatement batchStatement = new BatchStatement();
@@ -118,7 +118,7 @@
118118 assertThat(rs.one().getInt("v")).isEqualTo(1);
119119 }
120120
121- @CassandraVersion(major = 2.0)
121+ @CassandraVersion("2.0.0")
122122 @Test(groups = "short")
123123 public void should_add_wrapped_batch_statement_to_batch_statement() {
124124 BatchStatement batchStatementForWrapping = new BatchStatement();
modified driver-core/src/test/java/com/datastax/driver/core/TableMetadataTest.java +2 −2
@@ -407,7 +407,7 @@
407407 * @jira_ticket CASSANDRA-9424
408408 */
409409 @Test(groups = "short")
410- @CassandraVersion(major = 3.0)
410+ @CassandraVersion("3.0")
411411 public void should_parse_new_compression_options() {
412412 // given
413413 String cql = String.format("CREATE TABLE %s.new_compression_options (\n"
@@ -475,7 +475,7 @@
475475 * @test_category metadata
476476 */
477477 @Test(groups = "short")
478- @CassandraVersion(major = 3.0)
478+ @CassandraVersion("3.0")
479479 public void should_parse_extensions_from_table_options() throws Exception {
480480 // given
481481 // create a simple table and retrieve it's metadata from system_schema.tables.
modified driver-core/src/test/java/com/datastax/driver/core/TestListener.java +28 −29
@@ -20,6 +20,7 @@
2020 import org.testng.*;
2121 import org.testng.internal.ConstructorOrMethod;
2222
23+import java.lang.reflect.AnnotatedElement;
2324 import java.lang.reflect.Method;
2425 import java.util.concurrent.TimeUnit;
2526
@@ -87,27 +88,29 @@
8788
8889 Class<?> clazz = testNgMethod.getInstance().getClass();
8990 if (clazz != null) {
90- if (clazz.isAnnotationPresent(CassandraVersion.class)) {
91- CassandraVersion cassandraVersion = clazz.getAnnotation(CassandraVersion.class);
92- cassandraVersionCheck(cassandraVersion);
93- }
94- if (clazz.isAnnotationPresent(DseVersion.class)) {
95- DseVersion dseVersion = clazz.getAnnotation(DseVersion.class);
96- dseVersionCheck(dseVersion);
97- }
91+ do {
92+ if (scanAnnotatedElement(clazz))
93+ break;
94+ } while (!(clazz = clazz.getSuperclass()).equals(Object.class));
9895 }
99-
10096 Method method = constructorOrMethod.getMethod();
10197 if (method != null) {
102- if (method.isAnnotationPresent(CassandraVersion.class)) {
103- CassandraVersion cassandraVersion = method.getAnnotation(CassandraVersion.class);
104- cassandraVersionCheck(cassandraVersion);
105- }
106- if (method.isAnnotationPresent(DseVersion.class)) {
107- DseVersion dseVersion = method.getAnnotation(DseVersion.class);
108- dseVersionCheck(dseVersion);
109- }
98+ scanAnnotatedElement(method);
99+ }
100+ }
101+
102+ private boolean scanAnnotatedElement(AnnotatedElement element) {
103+ if (element.isAnnotationPresent(CassandraVersion.class)) {
104+ CassandraVersion cassandraVersion = element.getAnnotation(CassandraVersion.class);
105+ cassandraVersionCheck(cassandraVersion);
106+ return true;
107+ }
108+ if (element.isAnnotationPresent(DseVersion.class)) {
109+ DseVersion dseVersion = element.getAnnotation(DseVersion.class);
110+ dseVersionCheck(dseVersion);
111+ return true;
110112 }
113+ return false;
111114 }
112115
113116 @Override
@@ -116,29 +119,25 @@
116119 }
117120
118121 private static void cassandraVersionCheck(CassandraVersion version) {
119- versionCheck(CCMBridge.getCassandraVersion(), version.major(), version.minor(), version.description());
122+ versionCheck(CCMBridge.getCassandraVersionNumber(), VersionNumber.parse(version.value()), version.description());
120123 }
121124
122125 private static void dseVersionCheck(DseVersion version) {
123126 if (CCMBridge.isDSE()) {
124- versionCheck(CCMBridge.getDSEVersion(), version.major(), version.minor(), version.description());
127+ versionCheck(CCMBridge.getDSEVersionNumber(), VersionNumber.parse(version.value()), version.description());
125128 } else {
126129 throw new SkipException("Skipping test because not configured for DataStax Enterprise cluster.");
127130 }
128131 }
129132
130- private static void versionCheck(String version, double majorCheck, int minorCheck, String skipString) {
131- if (version == null) {
133+ private static void versionCheck(VersionNumber current, VersionNumber required, String skipString) {
134+ if (current == null) {
132135 throw new SkipException("Skipping test because provided version is null");
133136 } else {
134- String[] versionArray = version.split("\\.|-");
135- double major = Double.parseDouble(versionArray[0] + "." + versionArray[1]);
136- // If there is no minor version, assume latest version of whatever was provided.
137- int minor = versionArray.length >= 3 ? Integer.parseInt(versionArray[2]) : Integer.MAX_VALUE;
138-
139- if (major < majorCheck || (major == majorCheck && minor < minorCheck)) {
140- throw new SkipException("Version >= " + majorCheck + "." + minorCheck + " required. " +
141- "Description: " + skipString);
137+ if (current.compareTo(required) < 0) {
138+ throw new SkipException(
139+ String.format("Version >= %s required, but found %s. Justification: %s",
140+ required, current, skipString));
142141 }
143142 }
144143 }
modified driver-core/src/test/java/com/datastax/driver/core/TokenIntegrationTest.java +1 −1
@@ -191,7 +191,7 @@
191191 * </ol>
192192 */
193193 @Test(groups = "short")
194- @CassandraVersion(major = 2)
194+ @CassandraVersion("2.0")
195195 public void should_get_token_from_row_and_set_token_in_query_with_binding_and_aliasing() {
196196 Row row = session().execute("SELECT token(i) AS t FROM foo WHERE i = 1").one();
197197 Token token = row.getToken("t");
modified driver-core/src/test/java/com/datastax/driver/core/TracingTest.java +1 −1
@@ -26,7 +26,7 @@
2626
2727 import static org.assertj.core.api.Assertions.assertThat;
2828
29-@CassandraVersion(major = 2.0)
29+@CassandraVersion("2.0.0")
3030 public class TracingTest extends CCMTestsSupport {
3131
3232 private static final String KEY = "tracing_test";
modified driver-core/src/test/java/com/datastax/driver/core/TupleTest.java +1 −1
@@ -27,7 +27,7 @@
2727 import static org.testng.Assert.assertEquals;
2828 import static org.testng.Assert.fail;
2929
30-@CassandraVersion(major = 2.1)
30+@CassandraVersion("2.1.0")
3131 public class TupleTest extends CCMTestsSupport {
3232
3333 ProtocolVersion protocolVersion = TestUtils.getDesiredProtocolVersion();
modified driver-core/src/test/java/com/datastax/driver/core/TypeCodecCollectionsIntegrationTest.java +1 −1
@@ -33,7 +33,7 @@
3333 import static com.google.common.collect.Sets.newHashSet;
3434 import static org.assertj.core.api.Assertions.assertThat;
3535
36-@CassandraVersion(major = 2.0)
36+@CassandraVersion("2.0.0")
3737 public class TypeCodecCollectionsIntegrationTest extends CCMTestsSupport {
3838
3939 private final String insertQuery = "INSERT INTO \"myTable2\" (c_int, l_int, l_bigint, s_float, s_double, m_varint, m_decimal) VALUES (?, ?, ?, ?, ?, ?, ?)";
modified driver-core/src/test/java/com/datastax/driver/core/TypeCodecEncapsulationIntegrationTest.java +1 −1
@@ -102,7 +102,7 @@
102102 }
103103
104104 @Test(groups = "short")
105- @CassandraVersion(major = 2.0)
105+ @CassandraVersion("2.0.0")
106106 public void should_use_custom_codecs_with_simple_statements() {
107107 session().execute(insertQuery,
108108 n_int,
modified driver-core/src/test/java/com/datastax/driver/core/TypeCodecNestedCollectionsIntegrationTest.java +1 −1
@@ -35,7 +35,7 @@
3535 * Validates that nested collections are properly encoded,
3636 * even if some inner type requires a custom codec.
3737 */
38-@CassandraVersion(major = 2.1)
38+@CassandraVersion("2.1.0")
3939 public class TypeCodecNestedCollectionsIntegrationTest extends CCMTestsSupport {
4040
4141 private final String insertQuery = "INSERT INTO \"myTable\" (pk, v) VALUES (?, ?)";
modified driver-core/src/test/java/com/datastax/driver/core/TypeCodecNestedUDTAndTupleIntegrationTest.java +1 −1
@@ -28,7 +28,7 @@
2828 *
2929 * @jira_ticket JAVA-847
3030 */
31-@CassandraVersion(major = 2.1)
31+@CassandraVersion("2.1.0")
3232 public class TypeCodecNestedUDTAndTupleIntegrationTest extends CCMTestsSupport {
3333
3434 @Override
modified driver-core/src/test/java/com/datastax/driver/core/TypeCodecNumbersIntegrationTest.java +1 −1
@@ -52,7 +52,7 @@
5252 }
5353
5454 @Test(groups = "short")
55- @CassandraVersion(major = 2.0)
55+ @CassandraVersion("2.0.0")
5656 public void should_use_defaut_codecs_with_simple_statements() {
5757 session().execute(insertQuery, n_int, n_bigint, n_float, n_double, n_varint, n_decimal);
5858 ResultSet rows = session().execute(selectQuery, n_int, n_bigint);
modified driver-core/src/test/java/com/datastax/driver/core/TypeCodecTupleIntegrationTest.java +1 −1
@@ -23,7 +23,7 @@
2323 import static com.datastax.driver.core.DataType.cfloat;
2424 import static org.assertj.core.api.Assertions.assertThat;
2525
26-@CassandraVersion(major = 2.1)
26+@CassandraVersion("2.1.0")
2727 public class TypeCodecTupleIntegrationTest extends CCMTestsSupport {
2828
2929 private final String insertQuery = "INSERT INTO users (id, name, location) VALUES (?, ?, ?)";
modified driver-core/src/test/java/com/datastax/driver/core/TypeCodecUDTIntegrationTest.java +1 −1
@@ -26,7 +26,7 @@
2626
2727 import static org.assertj.core.api.Assertions.assertThat;
2828
29-@CassandraVersion(major = 2.1)
29+@CassandraVersion("2.1.0")
3030 public class TypeCodecUDTIntegrationTest extends CCMTestsSupport {
3131
3232 private final String insertQuery = "INSERT INTO users (id, name, address) VALUES (?, ?, ?)";
modified driver-core/src/test/java/com/datastax/driver/core/UnresolvedUserTypeTest.java +1 −1
@@ -23,7 +23,7 @@
2323 import static com.datastax.driver.core.Assertions.assertThat;
2424 import static com.datastax.driver.core.DataType.*;
2525
26-@CassandraVersion(major = 3.0)
26+@CassandraVersion("3.0")
2727 public class UnresolvedUserTypeTest extends CCMTestsSupport {
2828
2929 @Override
modified driver-core/src/test/java/com/datastax/driver/core/UserTypesTest.java +1 −1
@@ -36,7 +36,7 @@
3636 import static org.testng.Assert.assertEquals;
3737 import static org.testng.Assert.assertNotEquals;
3838
39-@CassandraVersion(major = 2.1)
39+@CassandraVersion("2.1.0")
4040 public class UserTypesTest extends CCMTestsSupport {
4141
4242 private final static List<DataType> DATA_TYPE_PRIMITIVES = new ArrayList<DataType>(DataType.allPrimitiveTypes(TestUtils.getDesiredProtocolVersion()));
modified driver-core/src/test/java/com/datastax/driver/core/WarningsTest.java +1 −1
@@ -24,7 +24,7 @@
2424 import static org.assertj.core.api.Assertions.assertThat;
2525
2626 @CCMConfig(config = {"batch_size_warn_threshold_in_kb:5"})
27-@CassandraVersion(major = 2.2)
27+@CassandraVersion("2.2.0")
2828 public class WarningsTest extends CCMTestsSupport {
2929
3030 @Override
modified driver-core/src/test/java/com/datastax/driver/core/exceptions/FunctionExecutionExceptionTest.java +1 −1
@@ -20,7 +20,7 @@
2020 import com.datastax.driver.core.utils.CassandraVersion;
2121 import org.testng.annotations.Test;
2222
23-@CassandraVersion(major = 2.2)
23+@CassandraVersion("2.2.0")
2424 @CCMConfig(config = "enable_user_defined_functions:true")
2525 public class FunctionExecutionExceptionTest extends CCMTestsSupport {
2626
modified driver-core/src/test/java/com/datastax/driver/core/querybuilder/QueryBuilder21ExecutionTest.java +1 −1
@@ -25,7 +25,7 @@
2525 import static com.datastax.driver.core.Assertions.assertThat;
2626 import static com.datastax.driver.core.querybuilder.QueryBuilder.*;
2727
28-@CassandraVersion(major = 2.1)
28+@CassandraVersion("2.1.0")
2929 public class QueryBuilder21ExecutionTest extends CCMTestsSupport {
3030
3131 @Override
modified driver-core/src/test/java/com/datastax/driver/core/querybuilder/QueryBuilderExecutionTest.java +3 −3
@@ -205,7 +205,7 @@
205205 * @since 3.0.1
206206 */
207207 @Test(groups = "short")
208- @CassandraVersion(major = 3.2)
208+ @CassandraVersion("3.2")
209209 public void should_support_cast_function_on_column() {
210210 //when
211211 ResultSet r = session().execute(select().cast("f", DataType.cint()).as("fint").column("i").from(TABLE2).where(eq("k", "cast_t")));
@@ -248,7 +248,7 @@
248248 * @since 3.0.1
249249 */
250250 @Test(groups = "short")
251- @CassandraVersion(major = 3.2)
251+ @CassandraVersion("3.2")
252252 public void should_support_fcall_on_cast_column() {
253253 //when
254254 ResultSet ar = session().execute(select().fcall("avg", cast(column("i"), DataType.cfloat())).as("iavg").from(TABLE2).where(eq("k", "cast_t")));
@@ -273,7 +273,7 @@
273273 * @since 3.0.1
274274 */
275275 @Test(groups = "short")
276- @CassandraVersion(major = 3.6)
276+ @CassandraVersion("3.6")
277277 public void should_retrieve_using_like_operator_on_table_with_sasi_index() {
278278 //given
279279 String table = "s_table";
modified driver-core/src/test/java/com/datastax/driver/core/querybuilder/QueryBuilderITest.java +2 −2
@@ -208,7 +208,7 @@
208208 }
209209
210210 @Test(groups = "short")
211- @CassandraVersion(major = 2.0, minor = 7, description = "DELETE..IF EXISTS only supported in 2.0.7+ (CASSANDRA-5708)")
211+ @CassandraVersion(value = "2.0.7", description = "DELETE..IF EXISTS only supported in 2.0.7+ (CASSANDRA-5708)")
212212 public void conditionalDeletesTest() throws Exception {
213213 session().execute(String.format("INSERT INTO %s.test_int (k, a, b) VALUES (1, 1, 1)", keyspace));
214214
@@ -234,7 +234,7 @@
234234 }
235235
236236 @Test(groups = "short")
237- @CassandraVersion(major = 2.0, minor = 13, description = "Allow IF EXISTS for UPDATE statements (CASSANDRA-8610)")
237+ @CassandraVersion(value = "2.0.13", description = "Allow IF EXISTS for UPDATE statements (CASSANDRA-8610)")
238238 public void conditionalUpdatesTest() throws Exception {
239239 session().execute(String.format("INSERT INTO %s.test_int (k, a, b) VALUES (1, 1, 1)", keyspace));
240240
modified driver-core/src/test/java/com/datastax/driver/core/querybuilder/QueryBuilderTest.java +0 −2
@@ -20,7 +20,6 @@
2020 import com.datastax.driver.core.exceptions.InvalidQueryException;
2121 import com.datastax.driver.core.exceptions.InvalidTypeException;
2222 import com.datastax.driver.core.utils.Bytes;
23-import com.datastax.driver.core.utils.CassandraVersion;
2423 import com.google.common.collect.ImmutableList;
2524 import com.google.common.collect.ImmutableMap;
2625 import com.google.common.collect.Lists;
@@ -861,7 +860,6 @@
861860 }
862861
863862 @Test(groups = "unit")
864- @CassandraVersion(major = 2.1, minor = 3)
865863 public void should_handle_nested_collections() {
866864 String query;
867865 Statement statement;
modified driver-core/src/test/java/com/datastax/driver/core/querybuilder/QueryBuilderTupleExecutionTest.java +1 −1
@@ -29,7 +29,7 @@
2929 import static org.assertj.core.api.Assertions.assertThat;
3030 import static org.testng.Assert.assertEquals;
3131
32-@CassandraVersion(major = 2.1, minor = 3)
32+@CassandraVersion("2.1.3")
3333 public class QueryBuilderTupleExecutionTest extends CCMTestsSupport {
3434
3535 @Test(groups = "short")
modified driver-core/src/test/java/com/datastax/driver/core/querybuilder/QueryBuilderUDTExecutionTest.java +1 −1
@@ -29,7 +29,7 @@
2929 import static org.assertj.core.api.Assertions.assertThat;
3030 import static org.testng.Assert.assertEquals;
3131
32-@CassandraVersion(major = 2.1, minor = 3)
32+@CassandraVersion("2.1.3")
3333 public class QueryBuilderUDTExecutionTest extends CCMTestsSupport {
3434
3535 @Override
modified driver-core/src/test/java/com/datastax/driver/core/schemabuilder/SchemaBuilderIT.java +2 −2
@@ -32,7 +32,7 @@
3232 public class SchemaBuilderIT extends CCMTestsSupport {
3333
3434 @Test(groups = "short")
35- @CassandraVersion(major = 2.1, minor = 2)
35+ @CassandraVersion("2.1.2")
3636 public void should_modify_table_metadata() {
3737 // Create a table
3838 session().execute(SchemaBuilder.createTable("ks", "TableMetadata")
@@ -128,7 +128,7 @@
128128 }
129129
130130 @Test(groups = "short")
131- @CassandraVersion(major = 2.1)
131+ @CassandraVersion("2.1.0")
132132 public void should_create_a_table_and_a_udt() {
133133 // Create a UDT and a table
134134 session().execute(SchemaBuilder.createType("MyUDT")
modified driver-core/src/test/java/com/datastax/driver/core/utils/CassandraVersion.java +3 −7
@@ -22,19 +22,15 @@
2222 * <p>Annotation for a Class or Method that defines a Cassandra Version requirement. If the cassandra version in use
2323 * does not meet the version requirement, the test is skipped.</p>
2424 *
25- * @see {@link com.datastax.driver.core.TestListener#beforeInvocation(org.testng.IInvokedMethod, org.testng.ITestResult)} for usage.
25+ * @see com.datastax.driver.core.TestListener#beforeInvocation(org.testng.IInvokedMethod, org.testng.ITestResult)
2626 */
2727 @Retention(RetentionPolicy.RUNTIME)
2828 public @interface CassandraVersion {
29- /**
30- * @return The major version required to execute this test, i.e. "2.0"
31- */
32- double major();
3329
3430 /**
35- * @return The minor version required to execute this test, i.e. "0"
31+ * @return The minimum version required to execute this test, i.e. "2.0.13"
3632 */
37- int minor() default 0;
33+ String value();
3834
3935 /**
4036 * @return The description returned if this version requirement is not met.
modified driver-core/src/test/java/com/datastax/driver/core/utils/DseVersion.java +3 −7
@@ -22,19 +22,15 @@
2222 * <p>Annotation for a Class or Method that defines a DataStax Enterprise Version requirement.
2323 * If the version in use does not meet the version requirement or DSE is not used, the test is skipped.</p>
2424 *
25- * @see {@link com.datastax.driver.core.TestListener#beforeInvocation(org.testng.IInvokedMethod, org.testng.ITestResult)} for usage.
25+ * @see com.datastax.driver.core.TestListener#beforeInvocation(org.testng.IInvokedMethod, org.testng.ITestResult)
2626 */
2727 @Retention(RetentionPolicy.RUNTIME)
2828 public @interface DseVersion {
29- /**
30- * @return The major version required to execute this test, i.e. "4.8"
31- */
32- double major() default 0.0;
3329
3430 /**
35- * @return The minor version required to execute this test, i.e. "3"
31+ * @return The minimum version required to execute this test, i.e. "2.0.13"
3632 */
37- int minor() default 0;
33+ String value();
3834
3935 /**
4036 * @return The description returned if this version requirement is not met.
modified driver-core/src/test/resources/log4j.properties +1 −0
@@ -20,6 +20,7 @@
2020 # Adjust Scassandra's log level
2121 # (it seems some messages are conditioned by log4j.properties and others by reference.conf, so we need both)
2222 log4j.logger.org.scassandra=ERROR
23+log4j.logger.spray.can=ERROR
2324 # Useful loggers when debugging Scassandra tests
2425 #log4j.logger.org.scassandra.cql=ERROR
2526 #log4j.logger.org.scassandra.server.cqlmessages=ERROR
modified driver-extras/src/test/java/com/datastax/driver/extras/codecs/date/SimpleDateCodecsTest.java +1 −1
@@ -33,7 +33,7 @@
3333 import static com.google.common.collect.Lists.newArrayList;
3434 import static org.assertj.core.api.Assertions.assertThat;
3535
36-@CassandraVersion(major = 2.2)
36+@CassandraVersion("2.2.0")
3737 public class SimpleDateCodecsTest extends CCMTestsSupport {
3838
3939 @Override
modified driver-extras/src/test/java/com/datastax/driver/extras/codecs/enums/EnumCodecsTest.java +1 −1
@@ -43,7 +43,7 @@
4343 * and ints (with EnumOrdinalCodec).
4444 * It also validates that both codecs may coexist in the same CodecRegistry.
4545 */
46-@CassandraVersion(major = 2.1)
46+@CassandraVersion("2.1.0")
4747 public class EnumCodecsTest extends CCMTestsSupport {
4848
4949 private final String insertQuery = "INSERT INTO t1 (pk, foo, foos, bar, bars, foobars, tup, udt) VALUES (?, ?, ?, ?, ?, ?, ?, ?)";
modified driver-extras/src/test/java/com/datastax/driver/extras/codecs/guava/OptionalCodecTest.java +1 −1
@@ -69,7 +69,7 @@
6969 * @since 2.2.0
7070 */
7171 @Test(groups = "short")
72- @CassandraVersion(major = 2.2)
72+ @CassandraVersion("2.2.0")
7373 public void should_map_unset_value_to_absent() {
7474 PreparedStatement insertPrep = session().prepare(this.insertStmt);
7575 PreparedStatement selectPrep = session().prepare(this.selectStmt);
modified driver-extras/src/test/java/com/datastax/driver/extras/codecs/jdk8/Jdk8TimeCodecsTest.java +1 −1
@@ -41,7 +41,7 @@
4141 import static com.google.common.collect.Sets.newHashSet;
4242 import static org.assertj.core.api.Assertions.assertThat;
4343
44-@CassandraVersion(major = 2.2)
44+@CassandraVersion("2.2.0")
4545 public class Jdk8TimeCodecsTest extends CCMTestsSupport {
4646
4747 @Override
modified driver-extras/src/test/java/com/datastax/driver/extras/codecs/jdk8/OptionalCodecTest.java +1 −1
@@ -69,7 +69,7 @@
6969 * @since 2.2.0
7070 */
7171 @Test(groups = "short")
72- @CassandraVersion(major = 2.2)
72+ @CassandraVersion("2.2.0")
7373 public void should_map_unset_value_to_empty() {
7474 PreparedStatement insertPrep = session().prepare(this.insertStmt);
7575 PreparedStatement selectPrep = session().prepare(this.selectStmt);
modified driver-extras/src/test/java/com/datastax/driver/extras/codecs/joda/JodaTimeCodecsTest.java +1 −1
@@ -42,7 +42,7 @@
4242 import static java.util.concurrent.TimeUnit.NANOSECONDS;
4343 import static org.assertj.core.api.Assertions.assertThat;
4444
45-@CassandraVersion(major = 2.2)
45+@CassandraVersion("2.2.0")
4646 public class JodaTimeCodecsTest extends CCMTestsSupport {
4747
4848 @Override
modified driver-extras/src/test/java/com/datastax/driver/extras/codecs/json/JacksonJsonCodecTest.java +1 −1
@@ -81,7 +81,7 @@
8181 }
8282
8383 @Test(groups = "short")
84- @CassandraVersion(major = 2.0)
84+ @CassandraVersion("2.0.0")
8585 public void should_use_custom_codec_with_simple_statements() {
8686 session().execute(insertQuery, notAJsonString, alice, bobAndCharlie);
8787 ResultSet rows = session().execute(selectQuery, notAJsonString, alice);
modified driver-extras/src/test/java/com/datastax/driver/extras/codecs/json/Jsr353JsonCodecTest.java +5 −5
@@ -82,7 +82,7 @@
8282 }
8383
8484 @Test(groups = "short", dataProvider = "Jsr353JsonCodecTest")
85- @CassandraVersion(major = 2.0)
85+ @CassandraVersion("2.0.0")
8686 public void should_use_custom_codec_with_simple_statements(JsonStructure object) throws IOException {
8787 session().execute(insertQuery, notAJsonString, object);
8888 ResultSet rows = session().execute(selectQuery, notAJsonString, object);
@@ -133,13 +133,13 @@
133133 @Test(groups = "short", dataProvider = "Jsr353JsonCodecTest")
134134 public void should_use_custom_codec_with_prepared_statements_2(JsonStructure object) throws IOException {
135135 session().execute(session().prepare(insertQuery).bind()
136- .setString(0, notAJsonString)
137- .set(1, object, JsonStructure.class)
136+ .setString(0, notAJsonString)
137+ .set(1, object, JsonStructure.class)
138138 );
139139 PreparedStatement ps = session().prepare(selectQuery);
140140 ResultSet rows = session().execute(ps.bind()
141- .setString(0, notAJsonString)
142- .set(1, object, JsonStructure.class)
141+ .setString(0, notAJsonString)
142+ .set(1, object, JsonStructure.class)
143143 );
144144 Row row = rows.one();
145145 assertRow(row, object);
modified driver-mapping/src/test/java/com/datastax/driver/mapping/MapperAccessorParamsTest.java +1 −1
@@ -41,7 +41,7 @@
4141 }
4242
4343 @Test(groups = "short")
44- @CassandraVersion(major = 2.0, description = "Uses named parameters")
44+ @CassandraVersion(value = "2.0", description = "Uses named parameters")
4545 public void should_allow_less_parameters_than_bind_markers_if_there_are_repeated_names() {
4646 UserPhoneAccessor accessor = new MappingManager(session())
4747 .createAccessor(UserPhoneAccessor.class);
modified driver-mapping/src/test/java/com/datastax/driver/mapping/MapperAccessorTest.java +1 −1
@@ -52,7 +52,7 @@
5252 }
5353
5454 @Test(groups = "short")
55- @CassandraVersion(major = 2.0)
55+ @CassandraVersion("2.0.0")
5656 public void should_allow_null_argument_in_accessor_when_set_by_name() {
5757 FooAccessor accessor = new MappingManager(session())
5858 .createAccessor(FooAccessor.class);
modified driver-mapping/src/test/java/com/datastax/driver/mapping/MapperComputedFieldsTest.java +6 −6
@@ -61,7 +61,7 @@
6161 }
6262
6363 @Test(groups = "short")
64- @CassandraVersion(major = 2.0)
64+ @CassandraVersion("2.0.0")
6565 void should_save_and_get_entity_with_computed_fields() {
6666 long writeTime = System.currentTimeMillis() * 1000;
6767 User newUser = new User("testlogin2", "blah");
@@ -87,7 +87,7 @@
8787 }
8888
8989 @Test(groups = "short")
90- @CassandraVersion(major = 2.0)
90+ @CassandraVersion("2.0.0")
9191 void should_add_aliases_for_fields_in_select_queries() {
9292 BoundStatement bs = (BoundStatement) userMapper.getQuery("test");
9393 assertThat(bs.preparedStatement().getQueryString())
@@ -95,7 +95,7 @@
9595 }
9696
9797 @Test(groups = "short")
98- @CassandraVersion(major = 2.0)
98+ @CassandraVersion("2.0.0")
9999 public void should_map_aliased_resultset_to_objects() {
100100 Statement getQuery = userMapper.getQuery("testlogin");
101101 getQuery.setConsistencyLevel(ConsistencyLevel.QUORUM);
@@ -108,7 +108,7 @@
108108 }
109109
110110 @Test(groups = "short")
111- @CassandraVersion(major = 2.0)
111+ @CassandraVersion("2.0.0")
112112 void should_map_unaliased_resultset_to_objects() {
113113 UserAccessor userAccessor = mappingManager.createAccessor(UserAccessor.class);
114114 ResultSet rs = userAccessor.all();
@@ -120,7 +120,7 @@
120120 }
121121
122122 @Test(groups = "short", expectedExceptions = CodecNotFoundException.class)
123- @CassandraVersion(major = 2.0)
123+ @CassandraVersion("2.0.0")
124124 void should_fail_if_computed_field_is_not_right_type() {
125125 Mapper<User_WrongComputedType> mapper = mappingManager.mapper(User_WrongComputedType.class);
126126
@@ -128,7 +128,7 @@
128128 }
129129
130130 @Test(groups = "short", expectedExceptions = IllegalArgumentException.class)
131- @CassandraVersion(major = 2.0)
131+ @CassandraVersion("2.0.0")
132132 void should_fail_if_computed_field_marked_with_column_annotation() {
133133 mappingManager.mapper(User_WrongAnnotationForComputed.class);
134134 }
modified driver-mapping/src/test/java/com/datastax/driver/mapping/MapperCustomCodecTest.java +1 −1
@@ -33,7 +33,7 @@
3333 import static org.assertj.core.api.Assertions.assertThat;
3434 import static org.assertj.core.api.Assertions.fail;
3535
36-@CassandraVersion(major = 2.1)
36+@CassandraVersion("2.1.0")
3737 @SuppressWarnings("unused")
3838 public class MapperCustomCodecTest extends CCMTestsSupport {
3939
modified driver-mapping/src/test/java/com/datastax/driver/mapping/MapperDefaultKeyspaceTest.java +1 −1
@@ -31,7 +31,7 @@
3131 /**
3232 * Tests usage of mapping annotations without specifying a keyspace.
3333 */
34-@CassandraVersion(major = 2.1)
34+@CassandraVersion("2.1.0")
3535 @SuppressWarnings("unused")
3636 public class MapperDefaultKeyspaceTest extends CCMTestsSupport {
3737
modified driver-mapping/src/test/java/com/datastax/driver/mapping/MapperMaterializedViewTest.java +1 −1
@@ -26,7 +26,7 @@
2626 import static org.assertj.core.api.Assertions.assertThat;
2727
2828 @SuppressWarnings("unused")
29-@CassandraVersion(major = 3.0)
29+@CassandraVersion("3.0")
3030 public class MapperMaterializedViewTest extends CCMTestsSupport {
3131
3232 @Override
modified driver-mapping/src/test/java/com/datastax/driver/mapping/MapperNestedCollectionsTest.java +1 −1
@@ -31,7 +31,7 @@
3131
3232 import static com.datastax.driver.core.Assertions.assertThat;
3333
34-@CassandraVersion(major = 2.1, minor = 3)
34+@CassandraVersion("2.1.3")
3535 @SuppressWarnings("unused")
3636 public class MapperNestedCollectionsTest extends CCMTestsSupport {
3737
modified driver-mapping/src/test/java/com/datastax/driver/mapping/MapperOptionTest.java +10 −10
@@ -51,7 +51,7 @@
5151 }
5252
5353 @Test(groups = "short")
54- @CassandraVersion(major = 2.0)
54+ @CassandraVersion("2.0.0")
5555 void should_use_save_options() throws Exception {
5656 Long tsValue = futureTimestamp();
5757 mapper.save(new User(42, "helloworld"), Option.timestamp(tsValue), Option.tracing(true));
@@ -61,7 +61,7 @@
6161 }
6262
6363 @Test(groups = "short")
64- @CassandraVersion(major = 2.0)
64+ @CassandraVersion("2.0.0")
6565 void should_use_delete_options() {
6666 User todelete = new User(45, "todelete");
6767 mapper.save(todelete);
@@ -72,7 +72,7 @@
7272 }
7373
7474 @Test(groups = "short", expectedExceptions = {IllegalArgumentException.class})
75- @CassandraVersion(major = 2.0)
75+ @CassandraVersion("2.0.0")
7676 void should_use_get_options() {
7777 User user = new User(45, "toget");
7878 mapper.save(user);
@@ -90,7 +90,7 @@
9090 }
9191
9292 @Test(groups = "short")
93- @CassandraVersion(major = 2.0)
93+ @CassandraVersion("2.0.0")
9494 void should_use_options_only_once() {
9595 Long tsValue = futureTimestamp();
9696 mapper.save(new User(43, "helloworld"), Option.timestamp(tsValue));
@@ -101,7 +101,7 @@
101101 }
102102
103103 @Test(groups = "short")
104- @CassandraVersion(major = 2.0)
104+ @CassandraVersion("2.0.0")
105105 void should_use_default_options() {
106106 mapper.setDefaultSaveOptions(Option.timestamp(644746L), Option.ttl(76324));
107107 BoundStatement bs = (BoundStatement) mapper.saveQuery(new User(46, "rjhrgce"));
@@ -134,7 +134,7 @@
134134 }
135135
136136 @Test(groups = "short")
137- @CassandraVersion(major = 2.0)
137+ @CassandraVersion("2.0.0")
138138 void should_prioritize_option_over_model_consistency() {
139139 // Generate Write Query and ensure User model writeConsistency is used.
140140 User user = new User(1859, "Steve");
@@ -155,7 +155,7 @@
155155 }
156156
157157 @Test(groups = "short")
158- @CassandraVersion(major = 2.0)
158+ @CassandraVersion("2.0.0")
159159 void should_use_explicit_options_over_default_options() {
160160 long defaultTimestamp = futureTimestamp();
161161 long explicitTimestamp = futureTimestamp();
@@ -171,7 +171,7 @@
171171 * Cover all versions of save() to check that methods that call each other properly propagate the options
172172 */
173173 @Test(groups = "short")
174- @CassandraVersion(major = 2.0)
174+ @CassandraVersion("2.0.0")
175175 void should_use_save_options_for_all_variants() throws ExecutionException, InterruptedException {
176176 Long timestamp = futureTimestamp();
177177 User user = new User(42, "helloworld");
@@ -210,7 +210,7 @@
210210 }
211211
212212 @Test(groups = "short")
213- @CassandraVersion(major = 2.0)
213+ @CassandraVersion("2.0.0")
214214 void should_use_get_options_for_all_variants() throws InterruptedException {
215215 try {
216216 mapper.get(42, Option.consistencyLevel(TWO));
@@ -251,7 +251,7 @@
251251 }
252252
253253 @Test(groups = "short")
254- @CassandraVersion(major = 2.0)
254+ @CassandraVersion("2.0.0")
255255 void should_use_delete_options_for_all_variants() throws InterruptedException {
256256 User user = new User(42, "helloworld");
257257
modified driver-mapping/src/test/java/com/datastax/driver/mapping/MapperPrimitiveTypes22Test.java +1 −1
@@ -27,7 +27,7 @@
2727
2828 import static org.testng.Assert.assertEquals;
2929
30-@CassandraVersion(major = 2.2)
30+@CassandraVersion("2.2.0")
3131 public class MapperPrimitiveTypes22Test extends CCMTestsSupport {
3232
3333 @Override
modified driver-mapping/src/test/java/com/datastax/driver/mapping/MapperTest.java +5 −5
@@ -311,7 +311,7 @@
311311 }
312312
313313 @Test(groups = "short")
314- @CassandraVersion(major = 2.0)
314+ @CassandraVersion("2.0.0")
315315 public void testDynamicEntity() throws Exception {
316316 MappingManager manager = new MappingManager(session());
317317
@@ -440,7 +440,7 @@
440440 * @test_category object_mapper
441441 */
442442 @Test(groups = "short")
443- @CassandraVersion(major = 2.0)
443+ @CassandraVersion("2.0.0")
444444 public void should_flag_statement_as_idempotent() {
445445 MappingManager manager = new MappingManager(session());
446446 PostAccessor post = manager.createAccessor(PostAccessor.class);
@@ -457,7 +457,7 @@
457457 * @test_category object_mapper
458458 */
459459 @Test(groups = "short")
460- @CassandraVersion(major = 2.0)
460+ @CassandraVersion("2.0.0")
461461 public void should_flag_statement_as_non_idempotent() {
462462 MappingManager manager = new MappingManager(session());
463463 PostAccessor post = manager.createAccessor(PostAccessor.class);
@@ -474,7 +474,7 @@
474474 * @test_category object_mapper
475475 */
476476 @Test(groups = "short")
477- @CassandraVersion(major = 2.0)
477+ @CassandraVersion("2.0.0")
478478 public void should_flag_statement_with_null_idempotence() {
479479 MappingManager manager = new MappingManager(session());
480480 PostAccessor post = manager.createAccessor(PostAccessor.class);
@@ -490,7 +490,7 @@
490490 * @test_category object_mapper
491491 */
492492 @Test(groups = "short")
493- @CassandraVersion(major = 2.0)
493+ @CassandraVersion("2.0.0")
494494 public void should_flag_all_mapper_generated_statements_as_idempotent() {
495495 MappingManager manager = new MappingManager(session());
496496 Mapper<User> mapper = manager.mapper(User.class);
modified driver-mapping/src/test/java/com/datastax/driver/mapping/MapperUDTCollectionsTest.java +1 −1
@@ -34,7 +34,7 @@
3434 * Tests mapping of collections of UDTs.
3535 */
3636 @SuppressWarnings("unused")
37-@CassandraVersion(major = 2.1)
37+@CassandraVersion("2.1.0")
3838 public class MapperUDTCollectionsTest extends CCMTestsSupport {
3939
4040 @Override
modified driver-mapping/src/test/java/com/datastax/driver/mapping/MapperUDTTest.java +1 −1
@@ -38,7 +38,7 @@
3838 import static org.testng.Assert.*;
3939
4040 @SuppressWarnings({"unused", "WeakerAccess"})
41-@CassandraVersion(major = 2.1)
41+@CassandraVersion("2.1.0")
4242 @CreateCCM(PER_METHOD)
4343 public class MapperUDTTest extends CCMTestsSupport {
4444
modified driver-mapping/src/test/java/com/datastax/driver/mapping/UDTFieldMapperTest.java +1 −1
@@ -27,7 +27,7 @@
2727 import java.util.HashMap;
2828 import java.util.Map;
2929
30-@CassandraVersion(major = 2.1)
30+@CassandraVersion("2.1.0")
3131 @CCMConfig(createCluster = false)
3232 @SuppressWarnings("unused")
3333 public class UDTFieldMapperTest extends CCMTestsSupport {
modified pom.xml +1 −1
@@ -46,7 +46,7 @@
4646
4747 <properties>
4848 <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
49- <cassandra.version>3.2.1</cassandra.version>
49+ <cassandra.version>3.8</cassandra.version>
5050 <java.version>1.6</java.version>
5151 <log4j.version>1.2.17</log4j.version>
5252 <slf4j-log4j12.version>1.7.6</slf4j-log4j12.version>