kikocis/java-driver public
Changesets · Branches · Tags · Compare
| Changeset | 3faae1558f5403425c8549f022e2e55ccfc086d9d237f0a1576b526c9317f88a |
|---|---|
| Author | Alexandre Dutra <adutra@users.noreply.github.com> · 2017-02-07 20:28 +01:00 |
| Committer | Andrew Tolbert <andrew.tolbert@datastax.com> · 2017-02-13 16:04 -06:00 |
| Parents | 8b63ad1da6ad |
75 files changed
modified driver-core/src/test/java/com/datastax/driver/core/AggregateMetadataTest.java +3 −3
| @@ -24,7 +24,7 @@ | ||
| 24 | 24 | import static com.datastax.driver.core.DataType.text; |
| 25 | 25 | import static com.datastax.driver.core.TestUtils.serializeForDynamicCompositeType; |
| 26 | 26 | |
| 27 | -@CassandraVersion(major = 2.2) | |
| 27 | +@CassandraVersion("2.2.0") | |
| 28 | 28 | @CCMConfig(config = "enable_user_defined_functions:true") |
| 29 | 29 | public class AggregateMetadataTest extends CCMTestsSupport { |
| 30 | 30 | |
| @@ -183,7 +183,7 @@ | ||
| 183 | 183 | * @since 3.0.1 |
| 184 | 184 | */ |
| 185 | 185 | @Test(groups = "short") |
| 186 | - @CassandraVersion(major = 2.2) | |
| 186 | + @CassandraVersion("2.2.0") | |
| 187 | 187 | public void should_parse_and_format_aggregate_with_composite_type_literal_initcond() { |
| 188 | 188 | VersionNumber ver = VersionNumber.parse(CCMBridge.getCassandraVersion()); |
| 189 | 189 | if (ver.getMajor() == 3) { |
| @@ -204,7 +204,7 @@ | ||
| 204 | 204 | * @since 3.0.1 |
| 205 | 205 | */ |
| 206 | 206 | @Test(groups = "short") |
| 207 | - @CassandraVersion(major = 3.0, minor = 4) | |
| 207 | + @CassandraVersion("3.4") | |
| 208 | 208 | public void should_parse_and_format_aggregate_with_composite_type_hex_initcond() { |
| 209 | 209 | VersionNumber ver = VersionNumber.parse(CCMBridge.getCassandraVersion()); |
| 210 | 210 | 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 @@ | ||
| 166 | 166 | } |
| 167 | 167 | |
| 168 | 168 | @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") | |
| 170 | 170 | public void should_fail_when_auto_paging_on_io_thread() throws Exception { |
| 171 | 171 | for (int i = 0; i < 1000; i++) { |
| 172 | 172 | 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 @@ | ||
| 27 | 27 | |
| 28 | 28 | import static org.assertj.core.api.Assertions.assertThat; |
| 29 | 29 | |
| 30 | -@CassandraVersion(major = 2.0, description = "uses paging") | |
| 30 | +@CassandraVersion(value = "2.0.0", description = "uses paging") | |
| 31 | 31 | public class AsyncResultSetTest extends CCMTestsSupport { |
| 32 | 32 | |
| 33 | 33 | @Override |
modified driver-core/src/test/java/com/datastax/driver/core/BatchStatementTest.java +1 −1
| @@ -71,7 +71,7 @@ | ||
| 71 | 71 | } |
| 72 | 72 | |
| 73 | 73 | @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)") | |
| 75 | 75 | public void casBatchTest() { |
| 76 | 76 | PreparedStatement st = session().prepare("INSERT INTO test (k, v) VALUES (?, ?) IF NOT EXISTS"); |
| 77 | 77 |
modified driver-core/src/test/java/com/datastax/driver/core/CCMBridge.java +48 −5
| @@ -281,6 +281,21 @@ | ||
| 281 | 281 | } |
| 282 | 282 | } |
| 283 | 283 | |
| 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 | + | |
| 284 | 299 | /** |
| 285 | 300 | * @return The configured DSE version if '-Ddse=true' specified, otherwise null. |
| 286 | 301 | */ |
| @@ -292,6 +307,22 @@ | ||
| 292 | 307 | } |
| 293 | 308 | } |
| 294 | 309 | |
| 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 | + | |
| 295 | 326 | /** |
| 296 | 327 | * @return Whether or not DSE was configured via '-Ddse=true'. |
| 297 | 328 | */ |
| @@ -549,7 +580,12 @@ | ||
| 549 | 580 | @Override |
| 550 | 581 | public void decommission(int n) { |
| 551 | 582 | 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); | |
| 553 | 589 | } |
| 554 | 590 | |
| 555 | 591 | @Override |
| @@ -908,6 +944,12 @@ | ||
| 908 | 944 | int storagePort = Integer.parseInt(cassandraConfiguration.get("storage_port").toString()); |
| 909 | 945 | int thriftPort = Integer.parseInt(cassandraConfiguration.get("rpc_port").toString()); |
| 910 | 946 | 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 | + } | |
| 911 | 953 | final CCMBridge ccm = new CCMBridge(clusterName, dse, version, storagePort, thriftPort, binaryPort, joinJvmArgs(), nodes); |
| 912 | 954 | |
| 913 | 955 | Runtime.getRuntime().addShutdownHook(new Thread() { |
| @@ -921,10 +963,7 @@ | ||
| 921 | 963 | ccm.updateConfig(cassandraConfiguration); |
| 922 | 964 | if (dse) { |
| 923 | 965 | 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) { | |
| 928 | 967 | // randomize DSE specific ports if dse present and greater than 5.0 |
| 929 | 968 | dseConfiguration.put("lease_netty_server_port", RANDOM_PORT); |
| 930 | 969 | dseConfiguration.put("internode_messaging_options.port", RANDOM_PORT); |
| @@ -941,6 +980,10 @@ | ||
| 941 | 980 | return ccm; |
| 942 | 981 | } |
| 943 | 982 | |
| 983 | + private static boolean isThriftSupported(boolean dse, VersionNumber version) { | |
| 984 | + return dse || version.compareTo(VersionNumber.parse("4.0")) < 0; | |
| 985 | + } | |
| 986 | + | |
| 944 | 987 | public int weight() { |
| 945 | 988 | // the weight is simply function of the number of nodes |
| 946 | 989 | int totalNodes = 0; |
modified driver-core/src/test/java/com/datastax/driver/core/ConditionalUpdateTest.java +1 −1
| @@ -24,7 +24,7 @@ | ||
| 24 | 24 | /** |
| 25 | 25 | * Test {@link ResultSet#wasApplied()} for conditional updates. |
| 26 | 26 | */ |
| 27 | -@CassandraVersion(major = 2.0, description = "Conditional Updates requires 2.0+.") | |
| 27 | +@CassandraVersion(value = "2.0.0", description = "Conditional Updates requires 2.0+.") | |
| 28 | 28 | public class ConditionalUpdateTest extends CCMTestsSupport { |
| 29 | 29 | |
| 30 | 30 | @Override |
modified driver-core/src/test/java/com/datastax/driver/core/ControlConnectionTest.java +1 −1
| @@ -86,7 +86,7 @@ | ||
| 86 | 86 | * Therefore we use two different driver instances in this test. |
| 87 | 87 | */ |
| 88 | 88 | @Test(groups = "short") |
| 89 | - @CassandraVersion(major = 2.1) | |
| 89 | + @CassandraVersion("2.1.0") | |
| 90 | 90 | public void should_parse_UDT_definitions_when_using_default_protocol_version() { |
| 91 | 91 | // First driver instance: create UDT |
| 92 | 92 | Cluster cluster = register(Cluster.builder() |
modified driver-core/src/test/java/com/datastax/driver/core/CustomPayloadTest.java +1 −11
| @@ -33,7 +33,7 @@ | ||
| 33 | 33 | import static org.assertj.core.api.Assertions.assertThat; |
| 34 | 34 | import static org.assertj.core.api.Fail.fail; |
| 35 | 35 | |
| 36 | -@CassandraVersion(major = 2.2) | |
| 36 | +@CassandraVersion("2.2.0") | |
| 37 | 37 | @CCMConfig(jvmArgs = "-Dcassandra.custom_query_handler_class=org.apache.cassandra.cql3.CustomPayloadMirroringQueryHandler") |
| 38 | 38 | public class CustomPayloadTest extends CCMTestsSupport { |
| 39 | 39 | |
| @@ -85,8 +85,6 @@ | ||
| 85 | 85 | |
| 86 | 86 | /** |
| 87 | 87 | * Ensures that an incoming payload is propagated from prepared to bound statements. |
| 88 | - * | |
| 89 | - * @throws Exception | |
| 90 | 88 | */ |
| 91 | 89 | @Test(groups = "short") |
| 92 | 90 | public void should_propagate_incoming_payload_to_bound_statement() throws Exception { |
| @@ -113,8 +111,6 @@ | ||
| 113 | 111 | /** |
| 114 | 112 | * Ensures that an incoming payload is overridden by an explicitly set outgoing payload |
| 115 | 113 | * when propagated to bound statements. |
| 116 | - * | |
| 117 | - * @throws Exception | |
| 118 | 114 | */ |
| 119 | 115 | @Test(groups = "short") |
| 120 | 116 | public void should_override_incoming_payload_when_outgoing_payload_explicitly_set_on_preparing_statement() throws Exception { |
| @@ -141,8 +137,6 @@ | ||
| 141 | 137 | /** |
| 142 | 138 | * Ensures that payloads can still be set individually on bound statements |
| 143 | 139 | * if the prepared statement does not have a default payload. |
| 144 | - * | |
| 145 | - * @throws Exception | |
| 146 | 140 | */ |
| 147 | 141 | @Test(groups = "short") |
| 148 | 142 | public void should_not_set_any_payload_on_bound_statement() throws Exception { |
| @@ -171,8 +165,6 @@ | ||
| 171 | 165 | |
| 172 | 166 | /** |
| 173 | 167 | * Ensures that a custom payload is propagated throughout pages. |
| 174 | - * | |
| 175 | - * @throws Exception | |
| 176 | 168 | */ |
| 177 | 169 | @Test(groups = "short") |
| 178 | 170 | public void should_echo_custom_payload_when_paginating() throws Exception { |
| @@ -253,8 +245,6 @@ | ||
| 253 | 245 | |
| 254 | 246 | /** |
| 255 | 247 | * Ensures that when debugging custom payloads, the driver will print appropriate log messages. |
| 256 | - * | |
| 257 | - * @throws Exception | |
| 258 | 248 | */ |
| 259 | 249 | @Test(groups = "short") |
| 260 | 250 | 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 @@ | ||
| 19 | 19 | import org.testng.annotations.Test; |
| 20 | 20 | |
| 21 | 21 | import java.nio.ByteBuffer; |
| 22 | -import java.util.ArrayList; | |
| 23 | 22 | import java.util.List; |
| 24 | 23 | import java.util.Map; |
| 25 | 24 | |
| @@ -153,7 +152,7 @@ | ||
| 153 | 152 | * @test_category metadata |
| 154 | 153 | */ |
| 155 | 154 | @Test(groups = "short") |
| 156 | - @CassandraVersion(major = 2.1) | |
| 155 | + @CassandraVersion("2.1.0") | |
| 157 | 156 | public void should_handle_udt_with_custom_type() { |
| 158 | 157 | // Given: a UDT with custom types, and a table using it. |
| 159 | 158 | 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 @@ | ||
| 23 | 23 | import static com.datastax.driver.core.DataTypeCqlNameParser.parse; |
| 24 | 24 | import static com.datastax.driver.core.Metadata.quote; |
| 25 | 25 | |
| 26 | -@CassandraVersion(major = 3.0) | |
| 26 | +@CassandraVersion("3.0") | |
| 27 | 27 | public class DataTypeCqlNameParserTest extends CCMTestsSupport { |
| 28 | 28 | |
| 29 | 29 | @Test(groups = "short") |
modified driver-core/src/test/java/com/datastax/driver/core/DataTypeIntegrationTest.java +1 −2
| @@ -36,7 +36,6 @@ | ||
| 36 | 36 | * (protocol > v2 only) and a prepared statement. |
| 37 | 37 | * This is repeated with a large number of datatypes. |
| 38 | 38 | */ |
| 39 | -@CCMConfig(clusterProvider = "createClusterBuilderNoDebouncing") | |
| 40 | 39 | public class DataTypeIntegrationTest extends CCMTestsSupport { |
| 41 | 40 | private static final Logger logger = LoggerFactory.getLogger(DataTypeIntegrationTest.class); |
| 42 | 41 | |
| @@ -71,7 +70,7 @@ | ||
| 71 | 70 | } |
| 72 | 71 | |
| 73 | 72 | @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") | |
| 75 | 74 | public void should_insert_and_retrieve_data_with_parameterized_simple_statements() { |
| 76 | 75 | should_insert_and_retrieve_data(StatementType.SIMPLE_WITH_PARAM); |
| 77 | 76 | } |
modified driver-core/src/test/java/com/datastax/driver/core/DirectCompressionTest.java +1 −1
| @@ -40,7 +40,7 @@ | ||
| 40 | 40 | * @expected_result session established and queries made successfully using it. |
| 41 | 41 | */ |
| 42 | 42 | @Test(groups = "short") |
| 43 | - @CassandraVersion(major = 2.0) | |
| 43 | + @CassandraVersion("2.0.0") | |
| 44 | 44 | public void should_function_with_lz4_compression() throws Exception { |
| 45 | 45 | compressionTest(ProtocolOptions.Compression.LZ4); |
| 46 | 46 | } |
modified driver-core/src/test/java/com/datastax/driver/core/FunctionMetadataTest.java +3 −2
| @@ -19,10 +19,11 @@ | ||
| 19 | 19 | import org.testng.annotations.Test; |
| 20 | 20 | |
| 21 | 21 | 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; | |
| 23 | 24 | import static org.assertj.core.api.Assertions.entry; |
| 24 | 25 | |
| 25 | -@CassandraVersion(major = 2.2) | |
| 26 | +@CassandraVersion("2.2.0") | |
| 26 | 27 | @CCMConfig(config = "enable_user_defined_functions:true") |
| 27 | 28 | public class FunctionMetadataTest extends CCMTestsSupport { |
| 28 | 29 |
modified driver-core/src/test/java/com/datastax/driver/core/HeapCompressionTest.java +1 −1
| @@ -47,7 +47,7 @@ | ||
| 47 | 47 | * @expected_result session established and queries made successfully using it. |
| 48 | 48 | */ |
| 49 | 49 | @Test(groups = "isolated") |
| 50 | - @CassandraVersion(major = 2.0) | |
| 50 | + @CassandraVersion("2.0.0") | |
| 51 | 51 | public void should_function_with_lz4_compression() throws Exception { |
| 52 | 52 | compressionTest(ProtocolOptions.Compression.LZ4); |
| 53 | 53 | } |
modified driver-core/src/test/java/com/datastax/driver/core/HostMetadataIntegrationTest.java +1 −1
| @@ -42,7 +42,7 @@ | ||
| 42 | 42 | * @see HostMetadataIntegrationTest#should_parse_dse_workload_and_version_if_available() |
| 43 | 43 | */ |
| 44 | 44 | @Test(groups = "long") |
| 45 | - @DseVersion(major = 5.0) | |
| 45 | + @DseVersion("5.0.0") | |
| 46 | 46 | public void test_mixed_dse_workload() { |
| 47 | 47 | CCMBridge.Builder builder = CCMBridge.builder() |
| 48 | 48 | .withNodes(3) |
modified driver-core/src/test/java/com/datastax/driver/core/IndexMetadataTest.java +9 −9
| @@ -32,7 +32,7 @@ | ||
| 32 | 32 | import static com.datastax.driver.core.DataType.*; |
| 33 | 33 | import static com.datastax.driver.core.IndexMetadata.Kind.*; |
| 34 | 34 | |
| 35 | -@CassandraVersion(major = 1.2) | |
| 35 | +@CassandraVersion("1.2.0") | |
| 36 | 36 | public class IndexMetadataTest extends CCMTestsSupport { |
| 37 | 37 | |
| 38 | 38 | /** |
| @@ -103,7 +103,7 @@ | ||
| 103 | 103 | } |
| 104 | 104 | |
| 105 | 105 | @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") | |
| 107 | 107 | public void should_create_metadata_for_values_index_on_mixed_case_column() { |
| 108 | 108 | // 3.0 assumes the 'values' keyword if index on a collection |
| 109 | 109 | String createValuesIndex = ccm().getVersion().getMajor() > 2 ? |
| @@ -123,7 +123,7 @@ | ||
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | @Test(groups = "short") |
| 126 | - @CassandraVersion(major = 2.1) | |
| 126 | + @CassandraVersion("2.1.0") | |
| 127 | 127 | public void should_create_metadata_for_index_on_map_values() { |
| 128 | 128 | // 3.0 assumes the 'values' keyword if index on a collection |
| 129 | 129 | String createValuesIndex = ccm().getVersion().getMajor() > 2 ? |
| @@ -143,7 +143,7 @@ | ||
| 143 | 143 | } |
| 144 | 144 | |
| 145 | 145 | @Test(groups = "short") |
| 146 | - @CassandraVersion(major = 2.1) | |
| 146 | + @CassandraVersion("2.1.0") | |
| 147 | 147 | public void should_create_metadata_for_index_on_map_keys() { |
| 148 | 148 | String createKeysIndex = String.format("CREATE INDEX map_keys_index ON %s.indexing (keys(map_keys));", keyspace); |
| 149 | 149 | session().execute(createKeysIndex); |
| @@ -160,7 +160,7 @@ | ||
| 160 | 160 | } |
| 161 | 161 | |
| 162 | 162 | @Test(groups = "short") |
| 163 | - @CassandraVersion(major = 2.1, minor = 3) | |
| 163 | + @CassandraVersion("2.1.3") | |
| 164 | 164 | public void should_create_metadata_for_full_index_on_map() { |
| 165 | 165 | String createFullIndex = String.format("CREATE INDEX map_full_index ON %s.indexing (full(map_full));", keyspace); |
| 166 | 166 | session().execute(createFullIndex); |
| @@ -177,7 +177,7 @@ | ||
| 177 | 177 | } |
| 178 | 178 | |
| 179 | 179 | @Test(groups = "short") |
| 180 | - @CassandraVersion(major = 2.1, minor = 3) | |
| 180 | + @CassandraVersion("2.1.3") | |
| 181 | 181 | public void should_create_metadata_for_full_index_on_set() { |
| 182 | 182 | String createFullIndex = String.format("CREATE INDEX set_full_index ON %s.indexing (full(set_full));", keyspace); |
| 183 | 183 | session().execute(createFullIndex); |
| @@ -194,7 +194,7 @@ | ||
| 194 | 194 | } |
| 195 | 195 | |
| 196 | 196 | @Test(groups = "short") |
| 197 | - @CassandraVersion(major = 2.1, minor = 3) | |
| 197 | + @CassandraVersion("2.1.3") | |
| 198 | 198 | public void should_create_metadata_for_full_index_on_list() { |
| 199 | 199 | String createFullIndex = String.format("CREATE INDEX list_full_index ON %s.indexing (full(list_full));", keyspace); |
| 200 | 200 | session().execute(createFullIndex); |
| @@ -211,7 +211,7 @@ | ||
| 211 | 211 | } |
| 212 | 212 | |
| 213 | 213 | @Test(groups = "short") |
| 214 | - @CassandraVersion(major = 2.2) | |
| 214 | + @CassandraVersion("2.2.0") | |
| 215 | 215 | public void should_create_metadata_for_index_on_map_entries() { |
| 216 | 216 | String createEntriesIndex = String.format("CREATE INDEX map_entries_index ON %s.indexing (entries(map_entries));", keyspace); |
| 217 | 217 | session().execute(createEntriesIndex); |
| @@ -228,7 +228,7 @@ | ||
| 228 | 228 | } |
| 229 | 229 | |
| 230 | 230 | @Test(groups = "short") |
| 231 | - @CassandraVersion(major = 3.0) | |
| 231 | + @CassandraVersion("3.0") | |
| 232 | 232 | public void should_allow_multiple_indexes_on_map_column() { |
| 233 | 233 | String createEntriesIndex = String.format("CREATE INDEX map_all_entries_index ON %s.indexing (entries(map_all));", keyspace); |
| 234 | 234 | session().execute(createEntriesIndex); |
modified driver-core/src/test/java/com/datastax/driver/core/LargeDataTest.java +2 −14
| @@ -180,11 +180,9 @@ | ||
| 180 | 180 | |
| 181 | 181 | /** |
| 182 | 182 | * Test a wide row of size 1,000,000 |
| 183 | - * | |
| 184 | - * @throws Throwable | |
| 185 | 183 | */ |
| 186 | 184 | @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.") | |
| 188 | 186 | public void wideRows() throws Throwable { |
| 189 | 187 | session().execute(String.format(CREATE_KEYSPACE_SIMPLE_FORMAT, "large_data", 1)); |
| 190 | 188 | session().execute("USE large_data"); |
| @@ -194,11 +192,9 @@ | ||
| 194 | 192 | |
| 195 | 193 | /** |
| 196 | 194 | * Test a batch that writes a row of size 4,000 (just below the error threshold for 2.2). |
| 197 | - * | |
| 198 | - * @throws Throwable | |
| 199 | 195 | */ |
| 200 | 196 | @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.") | |
| 202 | 198 | public void wideBatchRows() throws Throwable { |
| 203 | 199 | session().execute(String.format(CREATE_KEYSPACE_SIMPLE_FORMAT, "large_data", 1)); |
| 204 | 200 | session().execute("USE large_data"); |
| @@ -208,8 +204,6 @@ | ||
| 208 | 204 | |
| 209 | 205 | /** |
| 210 | 206 | * Test a wide row of size 1,000,000 consisting of a ByteBuffer |
| 211 | - * | |
| 212 | - * @throws Throwable | |
| 213 | 207 | */ |
| 214 | 208 | @Test(groups = "stress") |
| 215 | 209 | public void wideByteRows() throws Throwable { |
| @@ -221,8 +215,6 @@ | ||
| 221 | 215 | |
| 222 | 216 | /** |
| 223 | 217 | * Test a row with a single extra large text value |
| 224 | - * | |
| 225 | - * @throws Throwable | |
| 226 | 218 | */ |
| 227 | 219 | @Test(groups = "stress") |
| 228 | 220 | public void largeText() throws Throwable { |
| @@ -234,8 +226,6 @@ | ||
| 234 | 226 | |
| 235 | 227 | /** |
| 236 | 228 | * Creates a table with 330 columns |
| 237 | - * | |
| 238 | - * @throws Throwable | |
| 239 | 229 | */ |
| 240 | 230 | @Test(groups = "stress") |
| 241 | 231 | public void wideTable() throws Throwable { |
| @@ -255,8 +245,6 @@ | ||
| 255 | 245 | |
| 256 | 246 | /** |
| 257 | 247 | * Tests 10 random tests consisting of the other methods in this class |
| 258 | - * | |
| 259 | - * @throws Throwable | |
| 260 | 248 | */ |
| 261 | 249 | @Test(groups = "duration") |
| 262 | 250 | @CCMConfig(numberOfNodes = 3) |
modified driver-core/src/test/java/com/datastax/driver/core/MaterializedViewMetadataTest.java +1 −1
| @@ -22,7 +22,7 @@ | ||
| 22 | 22 | import static com.datastax.driver.core.ClusteringOrder.DESC; |
| 23 | 23 | import static com.datastax.driver.core.DataType.cint; |
| 24 | 24 | |
| 25 | -@CassandraVersion(major = 3) | |
| 25 | +@CassandraVersion("3.0") | |
| 26 | 26 | public class MaterializedViewMetadataTest extends CCMTestsSupport { |
| 27 | 27 | |
| 28 | 28 | /** |
modified driver-core/src/test/java/com/datastax/driver/core/PagingStateTest.java +3 −3
| @@ -25,7 +25,7 @@ | ||
| 25 | 25 | |
| 26 | 26 | import static org.assertj.core.api.Assertions.assertThat; |
| 27 | 27 | |
| 28 | -@CassandraVersion(major = 2.0) | |
| 28 | +@CassandraVersion("2.0.0") | |
| 29 | 29 | public class PagingStateTest extends CCMTestsSupport { |
| 30 | 30 | |
| 31 | 31 | private static final Logger logger = LoggerFactory.getLogger(PagingStateTest.class); |
| @@ -141,7 +141,7 @@ | ||
| 141 | 141 | * from the first query. |
| 142 | 142 | */ |
| 143 | 143 | @Test(groups = "short") |
| 144 | - @CassandraVersion(major = 2.0) | |
| 144 | + @CassandraVersion("2.0.0") | |
| 145 | 145 | public void should_be_able_to_use_state_with_bound_statement() { |
| 146 | 146 | PreparedStatement prepared = session().prepare("SELECT v from test where k=?"); |
| 147 | 147 | BoundStatement bs = prepared.bind(KEY); |
| @@ -164,7 +164,7 @@ | ||
| 164 | 164 | * @expected_result A failure is thrown when setting paging state on a different {@link BoundStatement}. |
| 165 | 165 | */ |
| 166 | 166 | @Test(groups = "short", expectedExceptions = {PagingStateException.class}) |
| 167 | - @CassandraVersion(major = 2.0) | |
| 167 | + @CassandraVersion("2.0.0") | |
| 168 | 168 | public void should_not_be_able_to_use_state_with_different_bound_statement() { |
| 169 | 169 | PreparedStatement prepared = session().prepare("SELECT v from test where k=?"); |
| 170 | 170 | BoundStatement bs0 = prepared.bind(KEY); |
modified driver-core/src/test/java/com/datastax/driver/core/PreparedStatementTest.java +6 −6
| @@ -485,7 +485,7 @@ | ||
| 485 | 485 | * @since 2.2.0 |
| 486 | 486 | */ |
| 487 | 487 | @Test(groups = "short") |
| 488 | - @CassandraVersion(major = 2.0) | |
| 488 | + @CassandraVersion("2.0.0") | |
| 489 | 489 | public void should_not_allow_unbound_value_on_batch_statement_when_protocol_lesser_than_v4() { |
| 490 | 490 | Cluster cluster = register(Cluster.builder() |
| 491 | 491 | .addContactPoints(getContactPoints()) |
| @@ -515,7 +515,7 @@ | ||
| 515 | 515 | * @since 2.2.0 |
| 516 | 516 | */ |
| 517 | 517 | @Test(groups = "short") |
| 518 | - @CassandraVersion(major = 2.2) | |
| 518 | + @CassandraVersion("2.2.0") | |
| 519 | 519 | public void should_not_create_tombstone_when_unbound_value_on_bound_statement_and_protocol_v4() { |
| 520 | 520 | PreparedStatement prepared = session().prepare("INSERT INTO " + SIMPLE_TABLE + " (k, i) VALUES (?, ?)"); |
| 521 | 521 | BoundStatement st1 = prepared.bind(); |
| @@ -545,7 +545,7 @@ | ||
| 545 | 545 | * @since 2.2.0 |
| 546 | 546 | */ |
| 547 | 547 | @Test(groups = "short") |
| 548 | - @CassandraVersion(major = 2.2) | |
| 548 | + @CassandraVersion("2.2.0") | |
| 549 | 549 | public void should_unset_value_by_index() { |
| 550 | 550 | PreparedStatement prepared = session().prepare("INSERT INTO " + SIMPLE_TABLE + " (k, i) VALUES (?, ?)"); |
| 551 | 551 | BoundStatement bound = prepared.bind(); |
| @@ -576,7 +576,7 @@ | ||
| 576 | 576 | * @since 2.2.0 |
| 577 | 577 | */ |
| 578 | 578 | @Test(groups = "short") |
| 579 | - @CassandraVersion(major = 2.2) | |
| 579 | + @CassandraVersion("2.2.0") | |
| 580 | 580 | public void should_unset_value_by_name() { |
| 581 | 581 | PreparedStatement prepared = session().prepare("INSERT INTO " + SIMPLE_TABLE + " (k, i) VALUES (:k, :i)"); |
| 582 | 582 | BoundStatement bound = prepared.bind(); |
| @@ -608,7 +608,7 @@ | ||
| 608 | 608 | * @since 2.2.0 |
| 609 | 609 | */ |
| 610 | 610 | @Test(groups = "short") |
| 611 | - @CassandraVersion(major = 2.2) | |
| 611 | + @CassandraVersion("2.2.0") | |
| 612 | 612 | public void should_not_create_tombstone_when_unbound_value_on_batch_statement_and_protocol_v4() { |
| 613 | 613 | PreparedStatement prepared = session().prepare("INSERT INTO " + SIMPLE_TABLE + " (k, i) VALUES (?, ?)"); |
| 614 | 614 | BoundStatement st1 = prepared.bind(); |
| @@ -661,7 +661,7 @@ | ||
| 661 | 661 | * @since 2.2.0 |
| 662 | 662 | */ |
| 663 | 663 | @Test(groups = "short") |
| 664 | - @CassandraVersion(major = 2.0) | |
| 664 | + @CassandraVersion("2.0.0") | |
| 665 | 665 | public void should_create_tombstone_when_null_value_on_batch_statement() { |
| 666 | 666 | PreparedStatement prepared = session().prepare("INSERT INTO " + SIMPLE_TABLE + " (k, i) VALUES (?, ?)"); |
| 667 | 667 | BoundStatement st1 = prepared.bind(); |
modified driver-core/src/test/java/com/datastax/driver/core/QueryLoggerTest.java +22 −22
| @@ -171,7 +171,7 @@ | ||
| 171 | 171 | } |
| 172 | 172 | |
| 173 | 173 | @Test(groups = "short") |
| 174 | - @CassandraVersion(major = 2.0) | |
| 174 | + @CassandraVersion("2.0.0") | |
| 175 | 175 | public void should_log_batch_statements() throws Exception { |
| 176 | 176 | // given |
| 177 | 177 | normal.setLevel(DEBUG); |
| @@ -202,7 +202,7 @@ | ||
| 202 | 202 | } |
| 203 | 203 | |
| 204 | 204 | @Test(groups = "short") |
| 205 | - @CassandraVersion(major = 2.0) | |
| 205 | + @CassandraVersion("2.0.0") | |
| 206 | 206 | public void should_log_unlogged_batch_statements() throws Exception { |
| 207 | 207 | // given |
| 208 | 208 | normal.setLevel(DEBUG); |
| @@ -233,7 +233,7 @@ | ||
| 233 | 233 | } |
| 234 | 234 | |
| 235 | 235 | @Test(groups = "short") |
| 236 | - @CassandraVersion(major = 2.0) | |
| 236 | + @CassandraVersion("2.0.0") | |
| 237 | 237 | public void should_log_counter_batch_statements() throws Exception { |
| 238 | 238 | // Create a special table for testing with counters. |
| 239 | 239 | session().execute( |
| @@ -376,7 +376,7 @@ | ||
| 376 | 376 | // Tests with query parameters (log level TRACE) |
| 377 | 377 | |
| 378 | 378 | @Test(groups = "short") |
| 379 | - @CassandraVersion(major = 2.0) | |
| 379 | + @CassandraVersion("2.0.0") | |
| 380 | 380 | public void should_log_non_null_named_parameter_bound_statements() throws Exception { |
| 381 | 381 | // given |
| 382 | 382 | normal.setLevel(TRACE); |
| @@ -426,7 +426,7 @@ | ||
| 426 | 426 | } |
| 427 | 427 | |
| 428 | 428 | @Test(groups = "short") |
| 429 | - @CassandraVersion(major = 2.0) | |
| 429 | + @CassandraVersion("2.0.0") | |
| 430 | 430 | public void should_log_non_null_positional_parameter_simple_statements() throws Exception { |
| 431 | 431 | // given |
| 432 | 432 | normal.setLevel(TRACE); |
| @@ -470,7 +470,7 @@ | ||
| 470 | 470 | } |
| 471 | 471 | |
| 472 | 472 | @Test(groups = "short") |
| 473 | - @CassandraVersion(major = 2.0) | |
| 473 | + @CassandraVersion("2.0.0") | |
| 474 | 474 | public void should_log_null_parameter_simple_statements() throws Exception { |
| 475 | 475 | // given |
| 476 | 476 | normal.setLevel(TRACE); |
| @@ -491,7 +491,7 @@ | ||
| 491 | 491 | } |
| 492 | 492 | |
| 493 | 493 | @Test(groups = "short") |
| 494 | - @CassandraVersion(major = 3.0) | |
| 494 | + @CassandraVersion("3.0") | |
| 495 | 495 | public void should_log_unset_parameter() throws Exception { |
| 496 | 496 | // given |
| 497 | 497 | normal.setLevel(TRACE); |
| @@ -514,7 +514,7 @@ | ||
| 514 | 514 | } |
| 515 | 515 | |
| 516 | 516 | @Test(groups = "short") |
| 517 | - @CassandraVersion(major = 2.0) | |
| 517 | + @CassandraVersion("2.0.0") | |
| 518 | 518 | public void should_log_bound_statement_parameters_inside_batch_statement() throws Exception { |
| 519 | 519 | // given |
| 520 | 520 | normal.setLevel(TRACE); |
| @@ -541,7 +541,7 @@ | ||
| 541 | 541 | } |
| 542 | 542 | |
| 543 | 543 | @Test(groups = "short") |
| 544 | - @CassandraVersion(major = 2.0) | |
| 544 | + @CassandraVersion("2.0.0") | |
| 545 | 545 | public void should_log_simple_statement_parameters_inside_batch_statement() throws Exception { |
| 546 | 546 | // given |
| 547 | 547 | normal.setLevel(TRACE); |
| @@ -596,7 +596,7 @@ | ||
| 596 | 596 | } |
| 597 | 597 | |
| 598 | 598 | @Test(groups = "short") |
| 599 | - @CassandraVersion(major = 2.0) | |
| 599 | + @CassandraVersion("2.0.0") | |
| 600 | 600 | public void should_log_all_parameter_types_simple_statements() throws Exception { |
| 601 | 601 | // given |
| 602 | 602 | normal.setLevel(TRACE); |
| @@ -648,7 +648,7 @@ | ||
| 648 | 648 | .doesNotContain(query); |
| 649 | 649 | } |
| 650 | 650 | |
| 651 | - @CassandraVersion(major = 2.0) | |
| 651 | + @CassandraVersion("2.0.0") | |
| 652 | 652 | @Test(groups = "short") |
| 653 | 653 | public void should_show_total_statements_for_batches_even_if_query_truncated() throws Exception { |
| 654 | 654 | // given |
| @@ -695,7 +695,7 @@ | ||
| 695 | 695 | .doesNotContain(TRUNCATED_OUTPUT); |
| 696 | 696 | } |
| 697 | 697 | |
| 698 | - @CassandraVersion(major = 2.0) | |
| 698 | + @CassandraVersion("2.0.0") | |
| 699 | 699 | @Test(groups = "short") |
| 700 | 700 | public void should_truncate_parameter_when_max_length_exceeded_bound_statements() throws Exception { |
| 701 | 701 | // given |
| @@ -720,7 +720,7 @@ | ||
| 720 | 720 | .doesNotContain("123456"); |
| 721 | 721 | } |
| 722 | 722 | |
| 723 | - @CassandraVersion(major = 2.0) | |
| 723 | + @CassandraVersion("2.0.0") | |
| 724 | 724 | @Test(groups = "short") |
| 725 | 725 | public void should_truncate_parameter_when_max_length_exceeded_simple_statements() throws Exception { |
| 726 | 726 | // given |
| @@ -767,7 +767,7 @@ | ||
| 767 | 767 | } |
| 768 | 768 | |
| 769 | 769 | @Test(groups = "short") |
| 770 | - @CassandraVersion(major = 2.0) | |
| 770 | + @CassandraVersion("2.0.0") | |
| 771 | 771 | public void should_truncate_blob_parameter_when_max_length_exceeded_simple_statements() throws Exception { |
| 772 | 772 | // given |
| 773 | 773 | normal.setLevel(TRACE); |
| @@ -813,7 +813,7 @@ | ||
| 813 | 813 | } |
| 814 | 814 | |
| 815 | 815 | @Test(groups = "short") |
| 816 | - @CassandraVersion(major = 2.0) | |
| 816 | + @CassandraVersion("2.0.0") | |
| 817 | 817 | public void should_not_truncate_parameter_when_max_length_unlimited_simple_statements() throws Exception { |
| 818 | 818 | // given |
| 819 | 819 | normal.setLevel(TRACE); |
| @@ -860,7 +860,7 @@ | ||
| 860 | 860 | } |
| 861 | 861 | |
| 862 | 862 | @Test(groups = "short") |
| 863 | - @CassandraVersion(major = 2.0) | |
| 863 | + @CassandraVersion("2.0.0") | |
| 864 | 864 | public void should_not_log_exceeding_number_of_parameters_simple_statements() throws Exception { |
| 865 | 865 | // given |
| 866 | 866 | normal.setLevel(TRACE); |
| @@ -883,7 +883,7 @@ | ||
| 883 | 883 | } |
| 884 | 884 | |
| 885 | 885 | @Test(groups = "short") |
| 886 | - @CassandraVersion(major = 2.1) | |
| 886 | + @CassandraVersion("2.1.0") | |
| 887 | 887 | public void should_not_log_exceeding_number_of_parameters_simple_statements_with_named_values() throws Exception { |
| 888 | 888 | // given |
| 889 | 889 | normal.setLevel(TRACE); |
| @@ -909,7 +909,7 @@ | ||
| 909 | 909 | } |
| 910 | 910 | |
| 911 | 911 | @Test(groups = "short") |
| 912 | - @CassandraVersion(major = 2.0) | |
| 912 | + @CassandraVersion("2.0.0") | |
| 913 | 913 | public void should_not_log_exceeding_number_of_parameters_in_batch_statement_bound_statements() throws Exception { |
| 914 | 914 | // given |
| 915 | 915 | normal.setLevel(TRACE); |
| @@ -939,7 +939,7 @@ | ||
| 939 | 939 | } |
| 940 | 940 | |
| 941 | 941 | @Test(groups = "short") |
| 942 | - @CassandraVersion(major = 2.0) | |
| 942 | + @CassandraVersion("2.0.0") | |
| 943 | 943 | public void should_not_log_exceeding_number_of_parameters_in_batch_statement_simple_statements() throws Exception { |
| 944 | 944 | // given |
| 945 | 945 | normal.setLevel(TRACE); |
| @@ -991,7 +991,7 @@ | ||
| 991 | 991 | } |
| 992 | 992 | |
| 993 | 993 | @Test(groups = "short") |
| 994 | - @CassandraVersion(major = 2.0) | |
| 994 | + @CassandraVersion("2.0.0") | |
| 995 | 995 | public void should_log_all_parameters_when_max_unlimited_simple_statements() throws Exception { |
| 996 | 996 | // given |
| 997 | 997 | normal.setLevel(TRACE); |
| @@ -1013,7 +1013,7 @@ | ||
| 1013 | 1013 | } |
| 1014 | 1014 | |
| 1015 | 1015 | @Test(groups = "short") |
| 1016 | - @CassandraVersion(major = 2.1) | |
| 1016 | + @CassandraVersion("2.1.0") | |
| 1017 | 1017 | public void should_log_all_parameters_when_max_unlimited_simple_statements_with_named_values() throws Exception { |
| 1018 | 1018 | // given |
| 1019 | 1019 | normal.setLevel(TRACE); |
| @@ -1037,7 +1037,7 @@ | ||
| 1037 | 1037 | .contains("42"); |
| 1038 | 1038 | } |
| 1039 | 1039 | |
| 1040 | - @CassandraVersion(major = 2.0) | |
| 1040 | + @CassandraVersion("2.0.0") | |
| 1041 | 1041 | @Test(groups = "short") |
| 1042 | 1042 | public void should_log_wrapped_bound_statement() throws Exception { |
| 1043 | 1043 | // given |
modified driver-core/src/test/java/com/datastax/driver/core/QueryTimestampTest.java +1 −1
| @@ -27,7 +27,7 @@ | ||
| 27 | 27 | /** |
| 28 | 28 | * Tests the behavior of client-provided timestamps with protocol v3. |
| 29 | 29 | */ |
| 30 | -@CassandraVersion(major = 2.1) | |
| 30 | +@CassandraVersion("2.1.0") | |
| 31 | 31 | public class QueryTimestampTest extends CCMTestsSupport { |
| 32 | 32 | |
| 33 | 33 | private volatile long timestampFromGenerator; |
modified driver-core/src/test/java/com/datastax/driver/core/RecommissionedNodeTest.java +1 −1
| @@ -145,7 +145,7 @@ | ||
| 145 | 145 | } |
| 146 | 146 | |
| 147 | 147 | @Test(groups = "long") |
| 148 | - @CassandraVersion(major = 2.0) | |
| 148 | + @CassandraVersion("2.0.0") | |
| 149 | 149 | public void should_ignore_node_that_does_not_support_protocol_version_on_session_init() throws Exception { |
| 150 | 150 | // Simulate the bug before starting the cluster |
| 151 | 151 | mainCcmBuilder = CCMBridge.builder().withNodes(2); |
modified driver-core/src/test/java/com/datastax/driver/core/SchemaChangesTest.java +12 −12
| @@ -209,7 +209,7 @@ | ||
| 209 | 209 | |
| 210 | 210 | @SuppressWarnings("RedundantCast") |
| 211 | 211 | @Test(groups = "short", dataProvider = "existingKeyspaceName") |
| 212 | - @CassandraVersion(major = 2.1) | |
| 212 | + @CassandraVersion("2.1.0") | |
| 213 | 213 | public void should_notify_of_udt_creation(String keyspace) { |
| 214 | 214 | session1.execute(String.format("CREATE TYPE %s.type1(i int)", keyspace)); |
| 215 | 215 | for (SchemaChangeListener listener : listeners) { |
| @@ -223,7 +223,7 @@ | ||
| 223 | 223 | } |
| 224 | 224 | |
| 225 | 225 | @Test(groups = "short", dataProvider = "existingKeyspaceName") |
| 226 | - @CassandraVersion(major = 2.1) | |
| 226 | + @CassandraVersion("2.1.0") | |
| 227 | 227 | public void should_notify_of_udt_update(String keyspace) { |
| 228 | 228 | session1.execute(String.format("CREATE TYPE %s.type1(i int)", keyspace)); |
| 229 | 229 | session1.execute(String.format("ALTER TYPE %s.type1 ADD j int", keyspace)); |
| @@ -240,7 +240,7 @@ | ||
| 240 | 240 | |
| 241 | 241 | @SuppressWarnings("RedundantCast") |
| 242 | 242 | @Test(groups = "short", dataProvider = "existingKeyspaceName") |
| 243 | - @CassandraVersion(major = 2.1) | |
| 243 | + @CassandraVersion("2.1.0") | |
| 244 | 244 | public void should_notify_of_udt_drop(String keyspace) { |
| 245 | 245 | session1.execute(String.format("CREATE TYPE %s.type1(i int)", keyspace)); |
| 246 | 246 | session1.execute(String.format("DROP TYPE %s.type1", keyspace)); |
| @@ -254,7 +254,7 @@ | ||
| 254 | 254 | } |
| 255 | 255 | |
| 256 | 256 | @Test(groups = "short", dataProvider = "existingKeyspaceName") |
| 257 | - @CassandraVersion(major = 2.2) | |
| 257 | + @CassandraVersion("2.2.0") | |
| 258 | 258 | public void should_notify_of_function_creation(String keyspace) { |
| 259 | 259 | session1.execute(String.format("CREATE FUNCTION %s.\"ID\"(i int) RETURNS NULL ON NULL INPUT RETURNS int LANGUAGE java AS 'return i;'", keyspace)); |
| 260 | 260 | for (SchemaChangeListener listener : listeners) { |
| @@ -270,7 +270,7 @@ | ||
| 270 | 270 | } |
| 271 | 271 | |
| 272 | 272 | @Test(groups = "short", dataProvider = "existingKeyspaceName") |
| 273 | - @CassandraVersion(major = 2.2) | |
| 273 | + @CassandraVersion("2.2.0") | |
| 274 | 274 | public void should_notify_of_function_update(String keyspace) { |
| 275 | 275 | session1.execute(String.format("CREATE FUNCTION %s.\"ID\"(i int) RETURNS NULL ON NULL INPUT RETURNS int LANGUAGE java AS 'return i;'", keyspace)); |
| 276 | 276 | for (SchemaChangeListener listener : listeners) { |
| @@ -297,7 +297,7 @@ | ||
| 297 | 297 | } |
| 298 | 298 | |
| 299 | 299 | @Test(groups = "short", dataProvider = "existingKeyspaceName") |
| 300 | - @CassandraVersion(major = 2.2) | |
| 300 | + @CassandraVersion("2.2.0") | |
| 301 | 301 | public void should_notify_of_function_drop(String keyspace) { |
| 302 | 302 | session1.execute(String.format("CREATE FUNCTION %s.\"ID\"(i int) RETURNS NULL ON NULL INPUT RETURNS int LANGUAGE java AS 'return i;'", keyspace)); |
| 303 | 303 | session1.execute(String.format("DROP FUNCTION %s.\"ID\"", keyspace)); |
| @@ -314,7 +314,7 @@ | ||
| 314 | 314 | } |
| 315 | 315 | |
| 316 | 316 | @Test(groups = "short", dataProvider = "existingKeyspaceName") |
| 317 | - @CassandraVersion(major = 2.2) | |
| 317 | + @CassandraVersion("2.2.0") | |
| 318 | 318 | public void should_notify_of_aggregate_creation(String keyspace) { |
| 319 | 319 | session1.execute(String.format("CREATE FUNCTION %s.\"PLUS\"(s int, v int) RETURNS NULL ON NULL INPUT RETURNS int LANGUAGE java" |
| 320 | 320 | + " AS 'return s+v;'", keyspace)); |
| @@ -332,7 +332,7 @@ | ||
| 332 | 332 | } |
| 333 | 333 | |
| 334 | 334 | @Test(groups = "short", dataProvider = "existingKeyspaceName") |
| 335 | - @CassandraVersion(major = 2.2) | |
| 335 | + @CassandraVersion("2.2.0") | |
| 336 | 336 | public void should_notify_of_aggregate_update(String keyspace) { |
| 337 | 337 | session1.execute(String.format("CREATE FUNCTION %s.\"PLUS\"(s int, v int) RETURNS NULL ON NULL INPUT RETURNS int LANGUAGE java" |
| 338 | 338 | + " AS 'return s+v;'", keyspace)); |
| @@ -361,7 +361,7 @@ | ||
| 361 | 361 | } |
| 362 | 362 | |
| 363 | 363 | @Test(groups = "short", dataProvider = "existingKeyspaceName") |
| 364 | - @CassandraVersion(major = 2.2) | |
| 364 | + @CassandraVersion("2.2.0") | |
| 365 | 365 | public void should_notify_of_aggregate_drop(String keyspace) { |
| 366 | 366 | session1.execute(String.format("CREATE FUNCTION %s.\"PLUS\"(s int, v int) RETURNS NULL ON NULL INPUT RETURNS int LANGUAGE java" |
| 367 | 367 | + " AS 'return s+v;'", keyspace)); |
| @@ -380,7 +380,7 @@ | ||
| 380 | 380 | } |
| 381 | 381 | |
| 382 | 382 | @Test(groups = "short", dataProvider = "existingKeyspaceName") |
| 383 | - @CassandraVersion(major = 3.0) | |
| 383 | + @CassandraVersion("3.0") | |
| 384 | 384 | public void should_notify_of_view_creation(String keyspace) { |
| 385 | 385 | session1.execute(String.format("CREATE TABLE %s.table1 (pk int PRIMARY KEY, c int)", keyspace)); |
| 386 | 386 | 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 @@ | ||
| 395 | 395 | } |
| 396 | 396 | |
| 397 | 397 | @Test(groups = "short", dataProvider = "existingKeyspaceName") |
| 398 | - @CassandraVersion(major = 3.0) | |
| 398 | + @CassandraVersion("3.0") | |
| 399 | 399 | public void should_notify_of_view_update(String keyspace) { |
| 400 | 400 | session1.execute(String.format("CREATE TABLE %s.table1 (pk int PRIMARY KEY, c int)", keyspace)); |
| 401 | 401 | 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 @@ | ||
| 424 | 424 | } |
| 425 | 425 | |
| 426 | 426 | @Test(groups = "short", dataProvider = "existingKeyspaceName") |
| 427 | - @CassandraVersion(major = 3.0) | |
| 427 | + @CassandraVersion("3.0") | |
| 428 | 428 | public void should_notify_of_view_drop(String keyspace) { |
| 429 | 429 | session1.execute(String.format("CREATE TABLE %s.table1 (pk int PRIMARY KEY, c int)", keyspace)); |
| 430 | 430 | 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 @@ | ||
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | @Test(groups = "short") |
| 38 | - @CassandraVersion(major = 2.1) | |
| 38 | + @CassandraVersion("2.1.0") | |
| 39 | 39 | public void should_execute_query_with_named_values() { |
| 40 | 40 | // Given |
| 41 | 41 | SimpleStatement statement = new SimpleStatement("SELECT * FROM users WHERE id = :id and id2 = :id2", |
| @@ -50,7 +50,7 @@ | ||
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | @Test(groups = "short", expectedExceptions = InvalidQueryException.class) |
| 53 | - @CassandraVersion(major = 2.1) | |
| 53 | + @CassandraVersion("2.1.0") | |
| 54 | 54 | public void should_fail_if_query_with_named_values_but_missing_parameter() { |
| 55 | 55 | // Given a Statement missing named parameters. |
| 56 | 56 | SimpleStatement statement = new SimpleStatement("SELECT * FROM users WHERE id = :id and id2 = :id2", |
| @@ -64,7 +64,7 @@ | ||
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | @Test(groups = "short", expectedExceptions = InvalidQueryException.class) |
| 67 | - @CassandraVersion(major = 2.1) | |
| 67 | + @CassandraVersion("2.1.0") | |
| 68 | 68 | public void should_fail_if_query_with_named_values_but_using_wrong_type() { |
| 69 | 69 | // Given a Statement using a named parameter with the wrong value for the type (id is of type int, using double) |
| 70 | 70 | SimpleStatement statement = new SimpleStatement("SELECT * FROM users WHERE id = :id and id2 = :id2", |
| @@ -98,7 +98,7 @@ | ||
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | @Test(groups = "short", expectedExceptions = UnsupportedFeatureException.class) |
| 101 | - @CassandraVersion(major = 2.0) | |
| 101 | + @CassandraVersion("2.0.0") | |
| 102 | 102 | public void should_fail_if_query_with_named_values_if_protocol_is_V2() { |
| 103 | 103 | if (ccm().getVersion().getMajor() >= 3) { |
| 104 | 104 | throw new SkipException("Skipping since Cassandra 3.0+ does not support protocol v2"); |
| @@ -107,7 +107,7 @@ | ||
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | @Test(groups = "short", expectedExceptions = UnsupportedFeatureException.class) |
| 110 | - @CassandraVersion(major = 2.0) | |
| 110 | + @CassandraVersion("2.0.0") | |
| 111 | 111 | public void should_fail_if_query_with_named_values_if_protocol_is_V1() { |
| 112 | 112 | if (ccm().getVersion().getMajor() >= 3) { |
| 113 | 113 | 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 @@ | ||
| 25 | 25 | |
| 26 | 26 | import static org.testng.Assert.fail; |
| 27 | 27 | |
| 28 | -@CassandraVersion(major = 2.1) | |
| 28 | +@CassandraVersion("2.1.0") | |
| 29 | 29 | public class SingleConnectionPoolTest extends CCMTestsSupport { |
| 30 | 30 | |
| 31 | 31 | @Test(groups = "short") |
modified driver-core/src/test/java/com/datastax/driver/core/StatementWrapperTest.java +3 −3
| @@ -87,7 +87,7 @@ | ||
| 87 | 87 | assertThat(retryPolicy.customStatementsHandled.get()).isEqualTo(1); |
| 88 | 88 | } |
| 89 | 89 | |
| 90 | - @CassandraVersion(major = 2.0) | |
| 90 | + @CassandraVersion("2.0.0") | |
| 91 | 91 | @Test(groups = "short") |
| 92 | 92 | public void should_execute_wrapped_simple_statement() { |
| 93 | 93 | session().execute(new CustomStatement(new SimpleStatement(INSERT_QUERY, "key_simple", 1))); |
| @@ -106,7 +106,7 @@ | ||
| 106 | 106 | assertThat(rs.one().getInt("v")).isEqualTo(1); |
| 107 | 107 | } |
| 108 | 108 | |
| 109 | - @CassandraVersion(major = 2.0) | |
| 109 | + @CassandraVersion("2.0.0") | |
| 110 | 110 | @Test(groups = "short") |
| 111 | 111 | public void should_execute_wrapped_batch_statement() { |
| 112 | 112 | BatchStatement batchStatement = new BatchStatement(); |
| @@ -118,7 +118,7 @@ | ||
| 118 | 118 | assertThat(rs.one().getInt("v")).isEqualTo(1); |
| 119 | 119 | } |
| 120 | 120 | |
| 121 | - @CassandraVersion(major = 2.0) | |
| 121 | + @CassandraVersion("2.0.0") | |
| 122 | 122 | @Test(groups = "short") |
| 123 | 123 | public void should_add_wrapped_batch_statement_to_batch_statement() { |
| 124 | 124 | BatchStatement batchStatementForWrapping = new BatchStatement(); |
modified driver-core/src/test/java/com/datastax/driver/core/TableMetadataTest.java +2 −2
| @@ -407,7 +407,7 @@ | ||
| 407 | 407 | * @jira_ticket CASSANDRA-9424 |
| 408 | 408 | */ |
| 409 | 409 | @Test(groups = "short") |
| 410 | - @CassandraVersion(major = 3.0) | |
| 410 | + @CassandraVersion("3.0") | |
| 411 | 411 | public void should_parse_new_compression_options() { |
| 412 | 412 | // given |
| 413 | 413 | String cql = String.format("CREATE TABLE %s.new_compression_options (\n" |
| @@ -475,7 +475,7 @@ | ||
| 475 | 475 | * @test_category metadata |
| 476 | 476 | */ |
| 477 | 477 | @Test(groups = "short") |
| 478 | - @CassandraVersion(major = 3.0) | |
| 478 | + @CassandraVersion("3.0") | |
| 479 | 479 | public void should_parse_extensions_from_table_options() throws Exception { |
| 480 | 480 | // given |
| 481 | 481 | // 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 @@ | ||
| 20 | 20 | import org.testng.*; |
| 21 | 21 | import org.testng.internal.ConstructorOrMethod; |
| 22 | 22 | |
| 23 | +import java.lang.reflect.AnnotatedElement; | |
| 23 | 24 | import java.lang.reflect.Method; |
| 24 | 25 | import java.util.concurrent.TimeUnit; |
| 25 | 26 | |
| @@ -87,27 +88,29 @@ | ||
| 87 | 88 | |
| 88 | 89 | Class<?> clazz = testNgMethod.getInstance().getClass(); |
| 89 | 90 | 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)); | |
| 98 | 95 | } |
| 99 | - | |
| 100 | 96 | Method method = constructorOrMethod.getMethod(); |
| 101 | 97 | 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; | |
| 110 | 112 | } |
| 113 | + return false; | |
| 111 | 114 | } |
| 112 | 115 | |
| 113 | 116 | @Override |
| @@ -116,29 +119,25 @@ | ||
| 116 | 119 | } |
| 117 | 120 | |
| 118 | 121 | 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()); | |
| 120 | 123 | } |
| 121 | 124 | |
| 122 | 125 | private static void dseVersionCheck(DseVersion version) { |
| 123 | 126 | if (CCMBridge.isDSE()) { |
| 124 | - versionCheck(CCMBridge.getDSEVersion(), version.major(), version.minor(), version.description()); | |
| 127 | + versionCheck(CCMBridge.getDSEVersionNumber(), VersionNumber.parse(version.value()), version.description()); | |
| 125 | 128 | } else { |
| 126 | 129 | throw new SkipException("Skipping test because not configured for DataStax Enterprise cluster."); |
| 127 | 130 | } |
| 128 | 131 | } |
| 129 | 132 | |
| 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) { | |
| 132 | 135 | throw new SkipException("Skipping test because provided version is null"); |
| 133 | 136 | } 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)); | |
| 142 | 141 | } |
| 143 | 142 | } |
| 144 | 143 | } |
modified driver-core/src/test/java/com/datastax/driver/core/TokenIntegrationTest.java +1 −1
| @@ -191,7 +191,7 @@ | ||
| 191 | 191 | * </ol> |
| 192 | 192 | */ |
| 193 | 193 | @Test(groups = "short") |
| 194 | - @CassandraVersion(major = 2) | |
| 194 | + @CassandraVersion("2.0") | |
| 195 | 195 | public void should_get_token_from_row_and_set_token_in_query_with_binding_and_aliasing() { |
| 196 | 196 | Row row = session().execute("SELECT token(i) AS t FROM foo WHERE i = 1").one(); |
| 197 | 197 | Token token = row.getToken("t"); |
modified driver-core/src/test/java/com/datastax/driver/core/TracingTest.java +1 −1
| @@ -26,7 +26,7 @@ | ||
| 26 | 26 | |
| 27 | 27 | import static org.assertj.core.api.Assertions.assertThat; |
| 28 | 28 | |
| 29 | -@CassandraVersion(major = 2.0) | |
| 29 | +@CassandraVersion("2.0.0") | |
| 30 | 30 | public class TracingTest extends CCMTestsSupport { |
| 31 | 31 | |
| 32 | 32 | 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 @@ | ||
| 27 | 27 | import static org.testng.Assert.assertEquals; |
| 28 | 28 | import static org.testng.Assert.fail; |
| 29 | 29 | |
| 30 | -@CassandraVersion(major = 2.1) | |
| 30 | +@CassandraVersion("2.1.0") | |
| 31 | 31 | public class TupleTest extends CCMTestsSupport { |
| 32 | 32 | |
| 33 | 33 | ProtocolVersion protocolVersion = TestUtils.getDesiredProtocolVersion(); |
modified driver-core/src/test/java/com/datastax/driver/core/TypeCodecCollectionsIntegrationTest.java +1 −1
| @@ -33,7 +33,7 @@ | ||
| 33 | 33 | import static com.google.common.collect.Sets.newHashSet; |
| 34 | 34 | import static org.assertj.core.api.Assertions.assertThat; |
| 35 | 35 | |
| 36 | -@CassandraVersion(major = 2.0) | |
| 36 | +@CassandraVersion("2.0.0") | |
| 37 | 37 | public class TypeCodecCollectionsIntegrationTest extends CCMTestsSupport { |
| 38 | 38 | |
| 39 | 39 | 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 @@ | ||
| 102 | 102 | } |
| 103 | 103 | |
| 104 | 104 | @Test(groups = "short") |
| 105 | - @CassandraVersion(major = 2.0) | |
| 105 | + @CassandraVersion("2.0.0") | |
| 106 | 106 | public void should_use_custom_codecs_with_simple_statements() { |
| 107 | 107 | session().execute(insertQuery, |
| 108 | 108 | n_int, |
modified driver-core/src/test/java/com/datastax/driver/core/TypeCodecNestedCollectionsIntegrationTest.java +1 −1
| @@ -35,7 +35,7 @@ | ||
| 35 | 35 | * Validates that nested collections are properly encoded, |
| 36 | 36 | * even if some inner type requires a custom codec. |
| 37 | 37 | */ |
| 38 | -@CassandraVersion(major = 2.1) | |
| 38 | +@CassandraVersion("2.1.0") | |
| 39 | 39 | public class TypeCodecNestedCollectionsIntegrationTest extends CCMTestsSupport { |
| 40 | 40 | |
| 41 | 41 | 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 @@ | ||
| 28 | 28 | * |
| 29 | 29 | * @jira_ticket JAVA-847 |
| 30 | 30 | */ |
| 31 | -@CassandraVersion(major = 2.1) | |
| 31 | +@CassandraVersion("2.1.0") | |
| 32 | 32 | public class TypeCodecNestedUDTAndTupleIntegrationTest extends CCMTestsSupport { |
| 33 | 33 | |
| 34 | 34 | @Override |
modified driver-core/src/test/java/com/datastax/driver/core/TypeCodecNumbersIntegrationTest.java +1 −1
| @@ -52,7 +52,7 @@ | ||
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | @Test(groups = "short") |
| 55 | - @CassandraVersion(major = 2.0) | |
| 55 | + @CassandraVersion("2.0.0") | |
| 56 | 56 | public void should_use_defaut_codecs_with_simple_statements() { |
| 57 | 57 | session().execute(insertQuery, n_int, n_bigint, n_float, n_double, n_varint, n_decimal); |
| 58 | 58 | 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 @@ | ||
| 23 | 23 | import static com.datastax.driver.core.DataType.cfloat; |
| 24 | 24 | import static org.assertj.core.api.Assertions.assertThat; |
| 25 | 25 | |
| 26 | -@CassandraVersion(major = 2.1) | |
| 26 | +@CassandraVersion("2.1.0") | |
| 27 | 27 | public class TypeCodecTupleIntegrationTest extends CCMTestsSupport { |
| 28 | 28 | |
| 29 | 29 | 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 @@ | ||
| 26 | 26 | |
| 27 | 27 | import static org.assertj.core.api.Assertions.assertThat; |
| 28 | 28 | |
| 29 | -@CassandraVersion(major = 2.1) | |
| 29 | +@CassandraVersion("2.1.0") | |
| 30 | 30 | public class TypeCodecUDTIntegrationTest extends CCMTestsSupport { |
| 31 | 31 | |
| 32 | 32 | 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 @@ | ||
| 23 | 23 | import static com.datastax.driver.core.Assertions.assertThat; |
| 24 | 24 | import static com.datastax.driver.core.DataType.*; |
| 25 | 25 | |
| 26 | -@CassandraVersion(major = 3.0) | |
| 26 | +@CassandraVersion("3.0") | |
| 27 | 27 | public class UnresolvedUserTypeTest extends CCMTestsSupport { |
| 28 | 28 | |
| 29 | 29 | @Override |
modified driver-core/src/test/java/com/datastax/driver/core/UserTypesTest.java +1 −1
| @@ -36,7 +36,7 @@ | ||
| 36 | 36 | import static org.testng.Assert.assertEquals; |
| 37 | 37 | import static org.testng.Assert.assertNotEquals; |
| 38 | 38 | |
| 39 | -@CassandraVersion(major = 2.1) | |
| 39 | +@CassandraVersion("2.1.0") | |
| 40 | 40 | public class UserTypesTest extends CCMTestsSupport { |
| 41 | 41 | |
| 42 | 42 | 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 @@ | ||
| 24 | 24 | import static org.assertj.core.api.Assertions.assertThat; |
| 25 | 25 | |
| 26 | 26 | @CCMConfig(config = {"batch_size_warn_threshold_in_kb:5"}) |
| 27 | -@CassandraVersion(major = 2.2) | |
| 27 | +@CassandraVersion("2.2.0") | |
| 28 | 28 | public class WarningsTest extends CCMTestsSupport { |
| 29 | 29 | |
| 30 | 30 | @Override |
modified driver-core/src/test/java/com/datastax/driver/core/exceptions/FunctionExecutionExceptionTest.java +1 −1
| @@ -20,7 +20,7 @@ | ||
| 20 | 20 | import com.datastax.driver.core.utils.CassandraVersion; |
| 21 | 21 | import org.testng.annotations.Test; |
| 22 | 22 | |
| 23 | -@CassandraVersion(major = 2.2) | |
| 23 | +@CassandraVersion("2.2.0") | |
| 24 | 24 | @CCMConfig(config = "enable_user_defined_functions:true") |
| 25 | 25 | public class FunctionExecutionExceptionTest extends CCMTestsSupport { |
| 26 | 26 |
modified driver-core/src/test/java/com/datastax/driver/core/querybuilder/QueryBuilder21ExecutionTest.java +1 −1
| @@ -25,7 +25,7 @@ | ||
| 25 | 25 | import static com.datastax.driver.core.Assertions.assertThat; |
| 26 | 26 | import static com.datastax.driver.core.querybuilder.QueryBuilder.*; |
| 27 | 27 | |
| 28 | -@CassandraVersion(major = 2.1) | |
| 28 | +@CassandraVersion("2.1.0") | |
| 29 | 29 | public class QueryBuilder21ExecutionTest extends CCMTestsSupport { |
| 30 | 30 | |
| 31 | 31 | @Override |
modified driver-core/src/test/java/com/datastax/driver/core/querybuilder/QueryBuilderExecutionTest.java +3 −3
| @@ -205,7 +205,7 @@ | ||
| 205 | 205 | * @since 3.0.1 |
| 206 | 206 | */ |
| 207 | 207 | @Test(groups = "short") |
| 208 | - @CassandraVersion(major = 3.2) | |
| 208 | + @CassandraVersion("3.2") | |
| 209 | 209 | public void should_support_cast_function_on_column() { |
| 210 | 210 | //when |
| 211 | 211 | ResultSet r = session().execute(select().cast("f", DataType.cint()).as("fint").column("i").from(TABLE2).where(eq("k", "cast_t"))); |
| @@ -248,7 +248,7 @@ | ||
| 248 | 248 | * @since 3.0.1 |
| 249 | 249 | */ |
| 250 | 250 | @Test(groups = "short") |
| 251 | - @CassandraVersion(major = 3.2) | |
| 251 | + @CassandraVersion("3.2") | |
| 252 | 252 | public void should_support_fcall_on_cast_column() { |
| 253 | 253 | //when |
| 254 | 254 | 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 @@ | ||
| 273 | 273 | * @since 3.0.1 |
| 274 | 274 | */ |
| 275 | 275 | @Test(groups = "short") |
| 276 | - @CassandraVersion(major = 3.6) | |
| 276 | + @CassandraVersion("3.6") | |
| 277 | 277 | public void should_retrieve_using_like_operator_on_table_with_sasi_index() { |
| 278 | 278 | //given |
| 279 | 279 | String table = "s_table"; |
modified driver-core/src/test/java/com/datastax/driver/core/querybuilder/QueryBuilderITest.java +2 −2
| @@ -208,7 +208,7 @@ | ||
| 208 | 208 | } |
| 209 | 209 | |
| 210 | 210 | @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)") | |
| 212 | 212 | public void conditionalDeletesTest() throws Exception { |
| 213 | 213 | session().execute(String.format("INSERT INTO %s.test_int (k, a, b) VALUES (1, 1, 1)", keyspace)); |
| 214 | 214 | |
| @@ -234,7 +234,7 @@ | ||
| 234 | 234 | } |
| 235 | 235 | |
| 236 | 236 | @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)") | |
| 238 | 238 | public void conditionalUpdatesTest() throws Exception { |
| 239 | 239 | session().execute(String.format("INSERT INTO %s.test_int (k, a, b) VALUES (1, 1, 1)", keyspace)); |
| 240 | 240 |
modified driver-core/src/test/java/com/datastax/driver/core/querybuilder/QueryBuilderTest.java +0 −2
| @@ -20,7 +20,6 @@ | ||
| 20 | 20 | import com.datastax.driver.core.exceptions.InvalidQueryException; |
| 21 | 21 | import com.datastax.driver.core.exceptions.InvalidTypeException; |
| 22 | 22 | import com.datastax.driver.core.utils.Bytes; |
| 23 | -import com.datastax.driver.core.utils.CassandraVersion; | |
| 24 | 23 | import com.google.common.collect.ImmutableList; |
| 25 | 24 | import com.google.common.collect.ImmutableMap; |
| 26 | 25 | import com.google.common.collect.Lists; |
| @@ -861,7 +860,6 @@ | ||
| 861 | 860 | } |
| 862 | 861 | |
| 863 | 862 | @Test(groups = "unit") |
| 864 | - @CassandraVersion(major = 2.1, minor = 3) | |
| 865 | 863 | public void should_handle_nested_collections() { |
| 866 | 864 | String query; |
| 867 | 865 | Statement statement; |
modified driver-core/src/test/java/com/datastax/driver/core/querybuilder/QueryBuilderTupleExecutionTest.java +1 −1
| @@ -29,7 +29,7 @@ | ||
| 29 | 29 | import static org.assertj.core.api.Assertions.assertThat; |
| 30 | 30 | import static org.testng.Assert.assertEquals; |
| 31 | 31 | |
| 32 | -@CassandraVersion(major = 2.1, minor = 3) | |
| 32 | +@CassandraVersion("2.1.3") | |
| 33 | 33 | public class QueryBuilderTupleExecutionTest extends CCMTestsSupport { |
| 34 | 34 | |
| 35 | 35 | @Test(groups = "short") |
modified driver-core/src/test/java/com/datastax/driver/core/querybuilder/QueryBuilderUDTExecutionTest.java +1 −1
| @@ -29,7 +29,7 @@ | ||
| 29 | 29 | import static org.assertj.core.api.Assertions.assertThat; |
| 30 | 30 | import static org.testng.Assert.assertEquals; |
| 31 | 31 | |
| 32 | -@CassandraVersion(major = 2.1, minor = 3) | |
| 32 | +@CassandraVersion("2.1.3") | |
| 33 | 33 | public class QueryBuilderUDTExecutionTest extends CCMTestsSupport { |
| 34 | 34 | |
| 35 | 35 | @Override |
modified driver-core/src/test/java/com/datastax/driver/core/schemabuilder/SchemaBuilderIT.java +2 −2
| @@ -32,7 +32,7 @@ | ||
| 32 | 32 | public class SchemaBuilderIT extends CCMTestsSupport { |
| 33 | 33 | |
| 34 | 34 | @Test(groups = "short") |
| 35 | - @CassandraVersion(major = 2.1, minor = 2) | |
| 35 | + @CassandraVersion("2.1.2") | |
| 36 | 36 | public void should_modify_table_metadata() { |
| 37 | 37 | // Create a table |
| 38 | 38 | session().execute(SchemaBuilder.createTable("ks", "TableMetadata") |
| @@ -128,7 +128,7 @@ | ||
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | @Test(groups = "short") |
| 131 | - @CassandraVersion(major = 2.1) | |
| 131 | + @CassandraVersion("2.1.0") | |
| 132 | 132 | public void should_create_a_table_and_a_udt() { |
| 133 | 133 | // Create a UDT and a table |
| 134 | 134 | session().execute(SchemaBuilder.createType("MyUDT") |
modified driver-core/src/test/java/com/datastax/driver/core/utils/CassandraVersion.java +3 −7
| @@ -22,19 +22,15 @@ | ||
| 22 | 22 | * <p>Annotation for a Class or Method that defines a Cassandra Version requirement. If the cassandra version in use |
| 23 | 23 | * does not meet the version requirement, the test is skipped.</p> |
| 24 | 24 | * |
| 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) | |
| 26 | 26 | */ |
| 27 | 27 | @Retention(RetentionPolicy.RUNTIME) |
| 28 | 28 | public @interface CassandraVersion { |
| 29 | - /** | |
| 30 | - * @return The major version required to execute this test, i.e. "2.0" | |
| 31 | - */ | |
| 32 | - double major(); | |
| 33 | 29 | |
| 34 | 30 | /** |
| 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" | |
| 36 | 32 | */ |
| 37 | - int minor() default 0; | |
| 33 | + String value(); | |
| 38 | 34 | |
| 39 | 35 | /** |
| 40 | 36 | * @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 @@ | ||
| 22 | 22 | * <p>Annotation for a Class or Method that defines a DataStax Enterprise Version requirement. |
| 23 | 23 | * If the version in use does not meet the version requirement or DSE is not used, the test is skipped.</p> |
| 24 | 24 | * |
| 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) | |
| 26 | 26 | */ |
| 27 | 27 | @Retention(RetentionPolicy.RUNTIME) |
| 28 | 28 | 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; | |
| 33 | 29 | |
| 34 | 30 | /** |
| 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" | |
| 36 | 32 | */ |
| 37 | - int minor() default 0; | |
| 33 | + String value(); | |
| 38 | 34 | |
| 39 | 35 | /** |
| 40 | 36 | * @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 @@ | ||
| 20 | 20 | # Adjust Scassandra's log level |
| 21 | 21 | # (it seems some messages are conditioned by log4j.properties and others by reference.conf, so we need both) |
| 22 | 22 | log4j.logger.org.scassandra=ERROR |
| 23 | +log4j.logger.spray.can=ERROR | |
| 23 | 24 | # Useful loggers when debugging Scassandra tests |
| 24 | 25 | #log4j.logger.org.scassandra.cql=ERROR |
| 25 | 26 | #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 @@ | ||
| 33 | 33 | import static com.google.common.collect.Lists.newArrayList; |
| 34 | 34 | import static org.assertj.core.api.Assertions.assertThat; |
| 35 | 35 | |
| 36 | -@CassandraVersion(major = 2.2) | |
| 36 | +@CassandraVersion("2.2.0") | |
| 37 | 37 | public class SimpleDateCodecsTest extends CCMTestsSupport { |
| 38 | 38 | |
| 39 | 39 | @Override |
modified driver-extras/src/test/java/com/datastax/driver/extras/codecs/enums/EnumCodecsTest.java +1 −1
| @@ -43,7 +43,7 @@ | ||
| 43 | 43 | * and ints (with EnumOrdinalCodec). |
| 44 | 44 | * It also validates that both codecs may coexist in the same CodecRegistry. |
| 45 | 45 | */ |
| 46 | -@CassandraVersion(major = 2.1) | |
| 46 | +@CassandraVersion("2.1.0") | |
| 47 | 47 | public class EnumCodecsTest extends CCMTestsSupport { |
| 48 | 48 | |
| 49 | 49 | 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 @@ | ||
| 69 | 69 | * @since 2.2.0 |
| 70 | 70 | */ |
| 71 | 71 | @Test(groups = "short") |
| 72 | - @CassandraVersion(major = 2.2) | |
| 72 | + @CassandraVersion("2.2.0") | |
| 73 | 73 | public void should_map_unset_value_to_absent() { |
| 74 | 74 | PreparedStatement insertPrep = session().prepare(this.insertStmt); |
| 75 | 75 | 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 @@ | ||
| 41 | 41 | import static com.google.common.collect.Sets.newHashSet; |
| 42 | 42 | import static org.assertj.core.api.Assertions.assertThat; |
| 43 | 43 | |
| 44 | -@CassandraVersion(major = 2.2) | |
| 44 | +@CassandraVersion("2.2.0") | |
| 45 | 45 | public class Jdk8TimeCodecsTest extends CCMTestsSupport { |
| 46 | 46 | |
| 47 | 47 | @Override |
modified driver-extras/src/test/java/com/datastax/driver/extras/codecs/jdk8/OptionalCodecTest.java +1 −1
| @@ -69,7 +69,7 @@ | ||
| 69 | 69 | * @since 2.2.0 |
| 70 | 70 | */ |
| 71 | 71 | @Test(groups = "short") |
| 72 | - @CassandraVersion(major = 2.2) | |
| 72 | + @CassandraVersion("2.2.0") | |
| 73 | 73 | public void should_map_unset_value_to_empty() { |
| 74 | 74 | PreparedStatement insertPrep = session().prepare(this.insertStmt); |
| 75 | 75 | 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 @@ | ||
| 42 | 42 | import static java.util.concurrent.TimeUnit.NANOSECONDS; |
| 43 | 43 | import static org.assertj.core.api.Assertions.assertThat; |
| 44 | 44 | |
| 45 | -@CassandraVersion(major = 2.2) | |
| 45 | +@CassandraVersion("2.2.0") | |
| 46 | 46 | public class JodaTimeCodecsTest extends CCMTestsSupport { |
| 47 | 47 | |
| 48 | 48 | @Override |
modified driver-extras/src/test/java/com/datastax/driver/extras/codecs/json/JacksonJsonCodecTest.java +1 −1
| @@ -81,7 +81,7 @@ | ||
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 | @Test(groups = "short") |
| 84 | - @CassandraVersion(major = 2.0) | |
| 84 | + @CassandraVersion("2.0.0") | |
| 85 | 85 | public void should_use_custom_codec_with_simple_statements() { |
| 86 | 86 | session().execute(insertQuery, notAJsonString, alice, bobAndCharlie); |
| 87 | 87 | 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 @@ | ||
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | @Test(groups = "short", dataProvider = "Jsr353JsonCodecTest") |
| 85 | - @CassandraVersion(major = 2.0) | |
| 85 | + @CassandraVersion("2.0.0") | |
| 86 | 86 | public void should_use_custom_codec_with_simple_statements(JsonStructure object) throws IOException { |
| 87 | 87 | session().execute(insertQuery, notAJsonString, object); |
| 88 | 88 | ResultSet rows = session().execute(selectQuery, notAJsonString, object); |
| @@ -133,13 +133,13 @@ | ||
| 133 | 133 | @Test(groups = "short", dataProvider = "Jsr353JsonCodecTest") |
| 134 | 134 | public void should_use_custom_codec_with_prepared_statements_2(JsonStructure object) throws IOException { |
| 135 | 135 | 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) | |
| 138 | 138 | ); |
| 139 | 139 | PreparedStatement ps = session().prepare(selectQuery); |
| 140 | 140 | 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) | |
| 143 | 143 | ); |
| 144 | 144 | Row row = rows.one(); |
| 145 | 145 | assertRow(row, object); |
modified driver-mapping/src/test/java/com/datastax/driver/mapping/MapperAccessorParamsTest.java +1 −1
| @@ -41,7 +41,7 @@ | ||
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | @Test(groups = "short") |
| 44 | - @CassandraVersion(major = 2.0, description = "Uses named parameters") | |
| 44 | + @CassandraVersion(value = "2.0", description = "Uses named parameters") | |
| 45 | 45 | public void should_allow_less_parameters_than_bind_markers_if_there_are_repeated_names() { |
| 46 | 46 | UserPhoneAccessor accessor = new MappingManager(session()) |
| 47 | 47 | .createAccessor(UserPhoneAccessor.class); |
modified driver-mapping/src/test/java/com/datastax/driver/mapping/MapperAccessorTest.java +1 −1
| @@ -52,7 +52,7 @@ | ||
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | @Test(groups = "short") |
| 55 | - @CassandraVersion(major = 2.0) | |
| 55 | + @CassandraVersion("2.0.0") | |
| 56 | 56 | public void should_allow_null_argument_in_accessor_when_set_by_name() { |
| 57 | 57 | FooAccessor accessor = new MappingManager(session()) |
| 58 | 58 | .createAccessor(FooAccessor.class); |
modified driver-mapping/src/test/java/com/datastax/driver/mapping/MapperComputedFieldsTest.java +6 −6
| @@ -61,7 +61,7 @@ | ||
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | @Test(groups = "short") |
| 64 | - @CassandraVersion(major = 2.0) | |
| 64 | + @CassandraVersion("2.0.0") | |
| 65 | 65 | void should_save_and_get_entity_with_computed_fields() { |
| 66 | 66 | long writeTime = System.currentTimeMillis() * 1000; |
| 67 | 67 | User newUser = new User("testlogin2", "blah"); |
| @@ -87,7 +87,7 @@ | ||
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | @Test(groups = "short") |
| 90 | - @CassandraVersion(major = 2.0) | |
| 90 | + @CassandraVersion("2.0.0") | |
| 91 | 91 | void should_add_aliases_for_fields_in_select_queries() { |
| 92 | 92 | BoundStatement bs = (BoundStatement) userMapper.getQuery("test"); |
| 93 | 93 | assertThat(bs.preparedStatement().getQueryString()) |
| @@ -95,7 +95,7 @@ | ||
| 95 | 95 | } |
| 96 | 96 | |
| 97 | 97 | @Test(groups = "short") |
| 98 | - @CassandraVersion(major = 2.0) | |
| 98 | + @CassandraVersion("2.0.0") | |
| 99 | 99 | public void should_map_aliased_resultset_to_objects() { |
| 100 | 100 | Statement getQuery = userMapper.getQuery("testlogin"); |
| 101 | 101 | getQuery.setConsistencyLevel(ConsistencyLevel.QUORUM); |
| @@ -108,7 +108,7 @@ | ||
| 108 | 108 | } |
| 109 | 109 | |
| 110 | 110 | @Test(groups = "short") |
| 111 | - @CassandraVersion(major = 2.0) | |
| 111 | + @CassandraVersion("2.0.0") | |
| 112 | 112 | void should_map_unaliased_resultset_to_objects() { |
| 113 | 113 | UserAccessor userAccessor = mappingManager.createAccessor(UserAccessor.class); |
| 114 | 114 | ResultSet rs = userAccessor.all(); |
| @@ -120,7 +120,7 @@ | ||
| 120 | 120 | } |
| 121 | 121 | |
| 122 | 122 | @Test(groups = "short", expectedExceptions = CodecNotFoundException.class) |
| 123 | - @CassandraVersion(major = 2.0) | |
| 123 | + @CassandraVersion("2.0.0") | |
| 124 | 124 | void should_fail_if_computed_field_is_not_right_type() { |
| 125 | 125 | Mapper<User_WrongComputedType> mapper = mappingManager.mapper(User_WrongComputedType.class); |
| 126 | 126 | |
| @@ -128,7 +128,7 @@ | ||
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | @Test(groups = "short", expectedExceptions = IllegalArgumentException.class) |
| 131 | - @CassandraVersion(major = 2.0) | |
| 131 | + @CassandraVersion("2.0.0") | |
| 132 | 132 | void should_fail_if_computed_field_marked_with_column_annotation() { |
| 133 | 133 | mappingManager.mapper(User_WrongAnnotationForComputed.class); |
| 134 | 134 | } |
modified driver-mapping/src/test/java/com/datastax/driver/mapping/MapperCustomCodecTest.java +1 −1
| @@ -33,7 +33,7 @@ | ||
| 33 | 33 | import static org.assertj.core.api.Assertions.assertThat; |
| 34 | 34 | import static org.assertj.core.api.Assertions.fail; |
| 35 | 35 | |
| 36 | -@CassandraVersion(major = 2.1) | |
| 36 | +@CassandraVersion("2.1.0") | |
| 37 | 37 | @SuppressWarnings("unused") |
| 38 | 38 | public class MapperCustomCodecTest extends CCMTestsSupport { |
| 39 | 39 |
modified driver-mapping/src/test/java/com/datastax/driver/mapping/MapperDefaultKeyspaceTest.java +1 −1
| @@ -31,7 +31,7 @@ | ||
| 31 | 31 | /** |
| 32 | 32 | * Tests usage of mapping annotations without specifying a keyspace. |
| 33 | 33 | */ |
| 34 | -@CassandraVersion(major = 2.1) | |
| 34 | +@CassandraVersion("2.1.0") | |
| 35 | 35 | @SuppressWarnings("unused") |
| 36 | 36 | public class MapperDefaultKeyspaceTest extends CCMTestsSupport { |
| 37 | 37 |
modified driver-mapping/src/test/java/com/datastax/driver/mapping/MapperMaterializedViewTest.java +1 −1
| @@ -26,7 +26,7 @@ | ||
| 26 | 26 | import static org.assertj.core.api.Assertions.assertThat; |
| 27 | 27 | |
| 28 | 28 | @SuppressWarnings("unused") |
| 29 | -@CassandraVersion(major = 3.0) | |
| 29 | +@CassandraVersion("3.0") | |
| 30 | 30 | public class MapperMaterializedViewTest extends CCMTestsSupport { |
| 31 | 31 | |
| 32 | 32 | @Override |
modified driver-mapping/src/test/java/com/datastax/driver/mapping/MapperNestedCollectionsTest.java +1 −1
| @@ -31,7 +31,7 @@ | ||
| 31 | 31 | |
| 32 | 32 | import static com.datastax.driver.core.Assertions.assertThat; |
| 33 | 33 | |
| 34 | -@CassandraVersion(major = 2.1, minor = 3) | |
| 34 | +@CassandraVersion("2.1.3") | |
| 35 | 35 | @SuppressWarnings("unused") |
| 36 | 36 | public class MapperNestedCollectionsTest extends CCMTestsSupport { |
| 37 | 37 |
modified driver-mapping/src/test/java/com/datastax/driver/mapping/MapperOptionTest.java +10 −10
| @@ -51,7 +51,7 @@ | ||
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | @Test(groups = "short") |
| 54 | - @CassandraVersion(major = 2.0) | |
| 54 | + @CassandraVersion("2.0.0") | |
| 55 | 55 | void should_use_save_options() throws Exception { |
| 56 | 56 | Long tsValue = futureTimestamp(); |
| 57 | 57 | mapper.save(new User(42, "helloworld"), Option.timestamp(tsValue), Option.tracing(true)); |
| @@ -61,7 +61,7 @@ | ||
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | @Test(groups = "short") |
| 64 | - @CassandraVersion(major = 2.0) | |
| 64 | + @CassandraVersion("2.0.0") | |
| 65 | 65 | void should_use_delete_options() { |
| 66 | 66 | User todelete = new User(45, "todelete"); |
| 67 | 67 | mapper.save(todelete); |
| @@ -72,7 +72,7 @@ | ||
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | @Test(groups = "short", expectedExceptions = {IllegalArgumentException.class}) |
| 75 | - @CassandraVersion(major = 2.0) | |
| 75 | + @CassandraVersion("2.0.0") | |
| 76 | 76 | void should_use_get_options() { |
| 77 | 77 | User user = new User(45, "toget"); |
| 78 | 78 | mapper.save(user); |
| @@ -90,7 +90,7 @@ | ||
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | @Test(groups = "short") |
| 93 | - @CassandraVersion(major = 2.0) | |
| 93 | + @CassandraVersion("2.0.0") | |
| 94 | 94 | void should_use_options_only_once() { |
| 95 | 95 | Long tsValue = futureTimestamp(); |
| 96 | 96 | mapper.save(new User(43, "helloworld"), Option.timestamp(tsValue)); |
| @@ -101,7 +101,7 @@ | ||
| 101 | 101 | } |
| 102 | 102 | |
| 103 | 103 | @Test(groups = "short") |
| 104 | - @CassandraVersion(major = 2.0) | |
| 104 | + @CassandraVersion("2.0.0") | |
| 105 | 105 | void should_use_default_options() { |
| 106 | 106 | mapper.setDefaultSaveOptions(Option.timestamp(644746L), Option.ttl(76324)); |
| 107 | 107 | BoundStatement bs = (BoundStatement) mapper.saveQuery(new User(46, "rjhrgce")); |
| @@ -134,7 +134,7 @@ | ||
| 134 | 134 | } |
| 135 | 135 | |
| 136 | 136 | @Test(groups = "short") |
| 137 | - @CassandraVersion(major = 2.0) | |
| 137 | + @CassandraVersion("2.0.0") | |
| 138 | 138 | void should_prioritize_option_over_model_consistency() { |
| 139 | 139 | // Generate Write Query and ensure User model writeConsistency is used. |
| 140 | 140 | User user = new User(1859, "Steve"); |
| @@ -155,7 +155,7 @@ | ||
| 155 | 155 | } |
| 156 | 156 | |
| 157 | 157 | @Test(groups = "short") |
| 158 | - @CassandraVersion(major = 2.0) | |
| 158 | + @CassandraVersion("2.0.0") | |
| 159 | 159 | void should_use_explicit_options_over_default_options() { |
| 160 | 160 | long defaultTimestamp = futureTimestamp(); |
| 161 | 161 | long explicitTimestamp = futureTimestamp(); |
| @@ -171,7 +171,7 @@ | ||
| 171 | 171 | * Cover all versions of save() to check that methods that call each other properly propagate the options |
| 172 | 172 | */ |
| 173 | 173 | @Test(groups = "short") |
| 174 | - @CassandraVersion(major = 2.0) | |
| 174 | + @CassandraVersion("2.0.0") | |
| 175 | 175 | void should_use_save_options_for_all_variants() throws ExecutionException, InterruptedException { |
| 176 | 176 | Long timestamp = futureTimestamp(); |
| 177 | 177 | User user = new User(42, "helloworld"); |
| @@ -210,7 +210,7 @@ | ||
| 210 | 210 | } |
| 211 | 211 | |
| 212 | 212 | @Test(groups = "short") |
| 213 | - @CassandraVersion(major = 2.0) | |
| 213 | + @CassandraVersion("2.0.0") | |
| 214 | 214 | void should_use_get_options_for_all_variants() throws InterruptedException { |
| 215 | 215 | try { |
| 216 | 216 | mapper.get(42, Option.consistencyLevel(TWO)); |
| @@ -251,7 +251,7 @@ | ||
| 251 | 251 | } |
| 252 | 252 | |
| 253 | 253 | @Test(groups = "short") |
| 254 | - @CassandraVersion(major = 2.0) | |
| 254 | + @CassandraVersion("2.0.0") | |
| 255 | 255 | void should_use_delete_options_for_all_variants() throws InterruptedException { |
| 256 | 256 | User user = new User(42, "helloworld"); |
| 257 | 257 |
modified driver-mapping/src/test/java/com/datastax/driver/mapping/MapperPrimitiveTypes22Test.java +1 −1
| @@ -27,7 +27,7 @@ | ||
| 27 | 27 | |
| 28 | 28 | import static org.testng.Assert.assertEquals; |
| 29 | 29 | |
| 30 | -@CassandraVersion(major = 2.2) | |
| 30 | +@CassandraVersion("2.2.0") | |
| 31 | 31 | public class MapperPrimitiveTypes22Test extends CCMTestsSupport { |
| 32 | 32 | |
| 33 | 33 | @Override |
modified driver-mapping/src/test/java/com/datastax/driver/mapping/MapperTest.java +5 −5
| @@ -311,7 +311,7 @@ | ||
| 311 | 311 | } |
| 312 | 312 | |
| 313 | 313 | @Test(groups = "short") |
| 314 | - @CassandraVersion(major = 2.0) | |
| 314 | + @CassandraVersion("2.0.0") | |
| 315 | 315 | public void testDynamicEntity() throws Exception { |
| 316 | 316 | MappingManager manager = new MappingManager(session()); |
| 317 | 317 | |
| @@ -440,7 +440,7 @@ | ||
| 440 | 440 | * @test_category object_mapper |
| 441 | 441 | */ |
| 442 | 442 | @Test(groups = "short") |
| 443 | - @CassandraVersion(major = 2.0) | |
| 443 | + @CassandraVersion("2.0.0") | |
| 444 | 444 | public void should_flag_statement_as_idempotent() { |
| 445 | 445 | MappingManager manager = new MappingManager(session()); |
| 446 | 446 | PostAccessor post = manager.createAccessor(PostAccessor.class); |
| @@ -457,7 +457,7 @@ | ||
| 457 | 457 | * @test_category object_mapper |
| 458 | 458 | */ |
| 459 | 459 | @Test(groups = "short") |
| 460 | - @CassandraVersion(major = 2.0) | |
| 460 | + @CassandraVersion("2.0.0") | |
| 461 | 461 | public void should_flag_statement_as_non_idempotent() { |
| 462 | 462 | MappingManager manager = new MappingManager(session()); |
| 463 | 463 | PostAccessor post = manager.createAccessor(PostAccessor.class); |
| @@ -474,7 +474,7 @@ | ||
| 474 | 474 | * @test_category object_mapper |
| 475 | 475 | */ |
| 476 | 476 | @Test(groups = "short") |
| 477 | - @CassandraVersion(major = 2.0) | |
| 477 | + @CassandraVersion("2.0.0") | |
| 478 | 478 | public void should_flag_statement_with_null_idempotence() { |
| 479 | 479 | MappingManager manager = new MappingManager(session()); |
| 480 | 480 | PostAccessor post = manager.createAccessor(PostAccessor.class); |
| @@ -490,7 +490,7 @@ | ||
| 490 | 490 | * @test_category object_mapper |
| 491 | 491 | */ |
| 492 | 492 | @Test(groups = "short") |
| 493 | - @CassandraVersion(major = 2.0) | |
| 493 | + @CassandraVersion("2.0.0") | |
| 494 | 494 | public void should_flag_all_mapper_generated_statements_as_idempotent() { |
| 495 | 495 | MappingManager manager = new MappingManager(session()); |
| 496 | 496 | 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 @@ | ||
| 34 | 34 | * Tests mapping of collections of UDTs. |
| 35 | 35 | */ |
| 36 | 36 | @SuppressWarnings("unused") |
| 37 | -@CassandraVersion(major = 2.1) | |
| 37 | +@CassandraVersion("2.1.0") | |
| 38 | 38 | public class MapperUDTCollectionsTest extends CCMTestsSupport { |
| 39 | 39 | |
| 40 | 40 | @Override |
modified driver-mapping/src/test/java/com/datastax/driver/mapping/MapperUDTTest.java +1 −1
| @@ -38,7 +38,7 @@ | ||
| 38 | 38 | import static org.testng.Assert.*; |
| 39 | 39 | |
| 40 | 40 | @SuppressWarnings({"unused", "WeakerAccess"}) |
| 41 | -@CassandraVersion(major = 2.1) | |
| 41 | +@CassandraVersion("2.1.0") | |
| 42 | 42 | @CreateCCM(PER_METHOD) |
| 43 | 43 | public class MapperUDTTest extends CCMTestsSupport { |
| 44 | 44 |
modified driver-mapping/src/test/java/com/datastax/driver/mapping/UDTFieldMapperTest.java +1 −1
| @@ -27,7 +27,7 @@ | ||
| 27 | 27 | import java.util.HashMap; |
| 28 | 28 | import java.util.Map; |
| 29 | 29 | |
| 30 | -@CassandraVersion(major = 2.1) | |
| 30 | +@CassandraVersion("2.1.0") | |
| 31 | 31 | @CCMConfig(createCluster = false) |
| 32 | 32 | @SuppressWarnings("unused") |
| 33 | 33 | public class UDTFieldMapperTest extends CCMTestsSupport { |
modified pom.xml +1 −1
| @@ -46,7 +46,7 @@ | ||
| 46 | 46 | |
| 47 | 47 | <properties> |
| 48 | 48 | <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> |
| 49 | - <cassandra.version>3.2.1</cassandra.version> | |
| 49 | + <cassandra.version>3.8</cassandra.version> | |
| 50 | 50 | <java.version>1.6</java.version> |
| 51 | 51 | <log4j.version>1.2.17</log4j.version> |
| 52 | 52 | <slf4j-log4j12.version>1.7.6</slf4j-log4j12.version> |