Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
import com.datastax.oss.driver.api.core.UnsupportedProtocolVersionException;
import com.datastax.oss.driver.api.core.config.DefaultDriverOption;
import com.datastax.oss.driver.api.core.config.DriverConfigLoader;
import com.datastax.oss.driver.api.testinfra.ScyllaSkip;
import com.datastax.oss.driver.api.testinfra.ccm.CcmRule;
import com.datastax.oss.driver.api.testinfra.requirement.BackendRequirement;
import com.datastax.oss.driver.api.testinfra.requirement.BackendType;
Expand Down Expand Up @@ -77,6 +76,7 @@ public void should_downgrade_to_v3() {
minInclusive = "5.0",
maxExclusive = "5.1",
description = "Only DSE in [5.0,5.1[ has V4 as its highest version")
@BackendRequirement(type = BackendType.SCYLLA)
@Test
public void should_downgrade_to_v4() {
try (CqlSession session = SessionUtils.newSession(ccm)) {
Expand All @@ -90,9 +90,6 @@ public void should_downgrade_to_v4() {
minInclusive = "4.0-rc1",
description = "Only C* in [4.0-rc1,*[ has V5 as its highest version")
@Test
@ScyllaSkip(
description =
"@IntegrationTestDisabledScyllaFailure @IntegrationTestDisabledScyllaUnsupportedFunctionality @IntegrationTestDisabledScyllaProtocolV5")
public void should_downgrade_to_v5_oss() {
try (CqlSession session = SessionUtils.newSession(ccm)) {
assertThat(session.getContext().getProtocolVersion().getCode()).isEqualTo(5);
Expand Down Expand Up @@ -216,9 +213,6 @@ public void should_fail_if_provided_dse_v2_is_not_supported() {
minInclusive = "4.0",
description = "Only C* in [4.0,*[ has V5 supported")
@Test
@ScyllaSkip(
description =
"@IntegrationTestDisabledScyllaFailure @IntegrationTestDisabledScyllaUnsupportedFunctionality @IntegrationTestDisabledScyllaProtocolV5")
public void should_not_downgrade_if_server_supports_latest_version() {
try (CqlSession session = SessionUtils.newSession(ccm)) {
assertThat(session.getContext().getProtocolVersion()).isEqualTo(ProtocolVersion.V5);
Expand Down Expand Up @@ -247,6 +241,7 @@ public void should_not_downgrade_if_server_supports_latest_version_dse() {
type = BackendType.DSE,
minInclusive = "4.8",
description = "Only DSE in [4.8,*[ has V3 supported")
@BackendRequirement(type = BackendType.SCYLLA)
@Test
public void should_use_explicitly_provided_v3() {
DriverConfigLoader loader =
Expand All @@ -267,6 +262,7 @@ public void should_use_explicitly_provided_v3() {
type = BackendType.DSE,
minInclusive = "5.0",
description = "Only DSE in [5.0,*[ has V4 supported")
@BackendRequirement(type = BackendType.SCYLLA)
@Test
public void should_use_explicitly_provided_v4() {
DriverConfigLoader loader =
Expand All @@ -288,9 +284,6 @@ public void should_use_explicitly_provided_v4() {
minInclusive = "7.0",
description = "Only DSE in [7.0,*[ has V5 supported")
@Test
@ScyllaSkip(
description =
"@IntegrationTestDisabledScyllaFailure @IntegrationTestDisabledScyllaUnsupportedFunctionality @IntegrationTestDisabledScyllaProtocolV5")
public void should_use_explicitly_provided_v5() {
DriverConfigLoader loader =
SessionUtils.configLoaderBuilder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@
import com.datastax.oss.driver.api.core.config.DefaultDriverOption;
import com.datastax.oss.driver.api.core.config.DriverConfigLoader;
import com.datastax.oss.driver.api.core.session.SessionBuilder;
import com.datastax.oss.driver.api.testinfra.ScyllaSkip;
import com.datastax.oss.driver.api.testinfra.ccm.CcmBridge;
import com.datastax.oss.driver.api.testinfra.ccm.CustomCcmRule;
import com.datastax.oss.driver.api.testinfra.requirement.BackendType;
import com.datastax.oss.driver.api.testinfra.session.SessionUtils;
import com.datastax.oss.driver.internal.core.auth.PlainTextAuthProvider;
import com.datastax.oss.driver.shaded.guava.common.util.concurrent.Uninterruptibles;
Expand All @@ -41,16 +42,19 @@
import org.junit.ClassRule;
import org.junit.Test;

@ScyllaSkip(
description = "@IntegrationTestDisabledScyllaFailure @IntegrationTestDisabledScyllaJVMArgs")
public class PlainTextAuthProviderIT {

@ClassRule
public static final CustomCcmRule CCM_RULE =
CustomCcmRule.builder()
.withCassandraConfiguration("authenticator", "PasswordAuthenticator")
.withJvmArgs("-Dcassandra.superuser_setup_delay_ms=0")
.build();
@ClassRule public static final CustomCcmRule CCM_RULE = getCCMRule();

private static CustomCcmRule getCCMRule() {
CustomCcmRule.Builder builder =
CustomCcmRule.builder()
.withCassandraConfiguration("authenticator", "PasswordAuthenticator");
if (!CcmBridge.isDistributionOf(BackendType.SCYLLA)) {
builder = builder.withJvmArgs("-Dcassandra.superuser_setup_delay_ms=0");
}
return builder.build();
}

@BeforeClass
public static void sleepForAuth() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ public void should_not_leak_compressed_lz4() {
type = BackendType.CASSANDRA,
maxExclusive = "4.0.0",
description = "Snappy is not supported in OSS C* 4.0+ with protocol v5")
@BackendRequirement(type = BackendType.SCYLLA)
@Test
public void should_not_leak_compressed_snappy() {
DriverConfigLoader loader =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ public void should_execute_batch_of_bound_statements_with_variables() {

@Test
@BackendRequirement(type = BackendType.CASSANDRA, minInclusive = "2.2")
@BackendRequirement(type = BackendType.SCYLLA)
public void should_execute_batch_of_bound_statements_with_unset_values() {
// Build a batch of batchCount statements with bound statements, each with their own positional
// variables.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.assertj.core.api.Assumptions.assumeThat;
import static org.junit.Assert.assertThrows;

import com.datastax.oss.driver.api.core.CQL4SkipMetadataResolveMethod;
import com.datastax.oss.driver.api.core.ConsistencyLevel;
Expand All @@ -48,6 +49,7 @@
import com.datastax.oss.driver.api.core.metadata.token.Token;
import com.datastax.oss.driver.api.core.type.codec.TypeCodecs;
import com.datastax.oss.driver.api.testinfra.ScyllaSkip;
import com.datastax.oss.driver.api.testinfra.ccm.CcmBridge;
import com.datastax.oss.driver.api.testinfra.ccm.CcmRule;
import com.datastax.oss.driver.api.testinfra.ccm.SchemaChangeSynchronizer;
import com.datastax.oss.driver.api.testinfra.requirement.BackendRequirement;
Expand Down Expand Up @@ -301,7 +303,9 @@ public void should_use_page_size() {
}

@Test
@ScyllaSkip(description = "@IntegrationTestDisabledScyllaFailure")
@ScyllaSkip(description = "scylladb/scylla-driver#567 - fails by unknown reason")
@BackendRequirement(type = BackendType.CASSANDRA)
@BackendRequirement(type = BackendType.DSE)
public void should_propagate_attributes_when_preparing_a_simple_statement() {
CqlSession session = sessionRule.session();

Expand Down Expand Up @@ -381,6 +385,7 @@ public void should_propagate_attributes_when_preparing_a_simple_statement() {
// Test for JAVA-2066
@Test
@BackendRequirement(type = BackendType.CASSANDRA, minInclusive = "2.2")
@BackendRequirement(type = BackendType.SCYLLA)
public void should_compute_routing_key_when_indices_randomly_distributed() {
try (CqlSession session = SessionUtils.newSession(ccmRule, sessionRule.keyspace())) {

Expand All @@ -398,13 +403,26 @@ public void should_compute_routing_key_when_indices_randomly_distributed() {
}

@Test
@ScyllaSkip /* Skipping due to https://github.com/scylladb/scylla/issues/10956. */
public void should_set_all_occurrences_of_variable() {
CqlSession session = sessionRule.session();
PreparedStatement ps = session.prepare("INSERT INTO test3 (pk1, pk2, v) VALUES (:i, :i, :i)");

CqlIdentifier id = CqlIdentifier.fromCql("i");
ColumnDefinitions variableDefinitions = ps.getVariableDefinitions();
if (CcmBridge.isDistributionOf(BackendType.SCYLLA)) {
// Scylla has different behavior, see https://github.com/scylladb/scylladb/pull/10813 and for
// more details.
assertThat(variableDefinitions.allIndicesOf(id)).containsExactly(0);
assertThrows(
Exception.class, () -> should_set_all_occurrences_of_variable(ps.bind().setInt(id, 12)));
assertThrows(
Exception.class,
() ->
should_set_all_occurrences_of_variable(
ps.boundStatementBuilder().setInt(id, 12).build()));
return;
}

assertThat(variableDefinitions.allIndicesOf(id)).containsExactly(0, 1, 2);

should_set_all_occurrences_of_variable(ps.bind().setInt(id, 12));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
package com.datastax.oss.driver.core.cql;

import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.after;
import static org.mockito.Mockito.timeout;
import static org.mockito.Mockito.verify;

Expand All @@ -37,7 +38,7 @@
import com.datastax.oss.driver.api.core.cql.ResultSet;
import com.datastax.oss.driver.api.core.cql.SimpleStatement;
import com.datastax.oss.driver.api.core.cql.Statement;
import com.datastax.oss.driver.api.testinfra.ScyllaSkip;
import com.datastax.oss.driver.api.testinfra.ccm.CcmBridge;
import com.datastax.oss.driver.api.testinfra.ccm.CustomCcmRule;
import com.datastax.oss.driver.api.testinfra.ccm.SchemaChangeSynchronizer;
import com.datastax.oss.driver.api.testinfra.requirement.BackendRequirement;
Expand Down Expand Up @@ -72,6 +73,7 @@ public class ExecutionInfoWarningsIT {
// set the warn threshold to 5Kb (default is 64Kb in newer versions)
.withCassandraConfiguration("batch_size_warn_threshold_in_kb", "5")
.build();

private SessionRule<CqlSession> sessionRule =
SessionRule.builder(ccmRule)
.withConfigLoader(
Expand Down Expand Up @@ -131,9 +133,7 @@ public void cleanupLogger() {

@Test
@BackendRequirement(type = BackendType.CASSANDRA, minInclusive = "3.0")
@ScyllaSkip(
description =
"@IntegrationTestDisabledScyllaFailure @IntegrationTestDisabledScyllaDifferentText")
@BackendRequirement(type = BackendType.SCYLLA)
public void should_execute_query_and_log_server_side_warnings() {
final String query = "SELECT count(*) FROM test;";
Statement<?> st = SimpleStatement.builder(query).build();
Expand All @@ -142,6 +142,11 @@ public void should_execute_query_and_log_server_side_warnings() {
ExecutionInfo executionInfo = result.getExecutionInfo();
assertThat(executionInfo).isNotNull();
List<String> warnings = executionInfo.getWarnings();
if (CcmBridge.isDistributionOf(BackendType.SCYLLA)) {
assertThat(warnings).isEmpty();
verify(appender, after(100).times(0)).doAppend(loggingEventCaptor.capture());
return;
}
assertThat(warnings).isNotEmpty();
String warning = warnings.get(0);
assertThat(warning).isEqualTo("Aggregation query used without partition key");
Expand All @@ -158,9 +163,7 @@ public void should_execute_query_and_log_server_side_warnings() {

@Test
@BackendRequirement(type = BackendType.CASSANDRA, minInclusive = "3.0")
@ScyllaSkip(
description =
"@IntegrationTestDisabledScyllaFailure @IntegrationTestDisabledScyllaDifferentText")
@BackendRequirement(type = BackendType.SCYLLA)
public void should_execute_query_and_not_log_server_side_warnings() {
final String query = "SELECT count(*) FROM test;";
Statement<?> st =
Expand All @@ -170,6 +173,11 @@ public void should_execute_query_and_not_log_server_side_warnings() {
ExecutionInfo executionInfo = result.getExecutionInfo();
assertThat(executionInfo).isNotNull();
List<String> warnings = executionInfo.getWarnings();
if (CcmBridge.isDistributionOf(BackendType.SCYLLA)) {
assertThat(warnings).isEmpty();
verify(appender, after(100).times(0)).doAppend(loggingEventCaptor.capture());
return;
}
assertThat(warnings).isNotEmpty();
String warning = warnings.get(0);
assertThat(warning).isEqualTo("Aggregation query used without partition key");
Expand All @@ -179,9 +187,7 @@ public void should_execute_query_and_not_log_server_side_warnings() {

@Test
@BackendRequirement(type = BackendType.CASSANDRA, minInclusive = "2.2")
@ScyllaSkip(
description =
"@IntegrationTestDisabledScyllaFailure @IntegrationTestDisabledScyllaDifferentText")
@BackendRequirement(type = BackendType.SCYLLA)
public void should_expose_warnings_on_execution_info() {
// the default batch size warn threshold is 5 * 1024 bytes, but after CASSANDRA-10876 there must
// be multiple mutations in a batch to trigger this warning so the batch includes 2 different
Expand All @@ -198,6 +204,11 @@ public void should_expose_warnings_on_execution_info() {
ExecutionInfo executionInfo = result.getExecutionInfo();
assertThat(executionInfo).isNotNull();
List<String> warnings = executionInfo.getWarnings();
if (CcmBridge.isDistributionOf(BackendType.SCYLLA)) {
assertThat(warnings).isEmpty();
verify(appender, after(100).times(0)).doAppend(loggingEventCaptor.capture());
return;
}
assertThat(warnings).isNotEmpty();
// verify the log was generated
verify(appender, timeout(500).atLeast(1)).doAppend(loggingEventCaptor.capture());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,7 @@
type = BackendType.DSE,
minInclusive = "7.0",
description = "Feature not available in DSE yet")
@ScyllaSkip(
description =
"Scylla keeps negotiating protocol version v4, but \"Can't use nowInSeconds with protocol V4\". Remove skip once Scylla supports protocol version v5.")
@ScyllaSkip(description = "scylladb/java-driver#573 - to be enabled")
public class NowInSecondsIT {

private static final CcmRule CCM_RULE = CcmRule.getInstance();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
import com.datastax.oss.driver.api.core.cql.Row;
import com.datastax.oss.driver.api.core.cql.SimpleStatement;
import com.datastax.oss.driver.api.core.cql.Statement;
import com.datastax.oss.driver.api.testinfra.ScyllaSkip;
import com.datastax.oss.driver.api.testinfra.ccm.CcmRule;
import com.datastax.oss.driver.api.testinfra.ccm.SchemaChangeSynchronizer;
import com.datastax.oss.driver.api.testinfra.requirement.BackendRequirement;
Expand Down Expand Up @@ -89,13 +88,15 @@ public void setupSchema() {

@Test
@BackendRequirement(type = BackendType.CASSANDRA, minInclusive = "2.2")
@BackendRequirement(type = BackendType.SCYLLA)
public void should_reject_simple_statement_with_keyspace_in_protocol_v4() {
should_reject_statement_with_keyspace_in_protocol_v4(
SimpleStatement.newInstance("SELECT * FROM foo").setKeyspace(sessionRule.keyspace()));
}

@Test
@BackendRequirement(type = BackendType.CASSANDRA, minInclusive = "2.2")
@BackendRequirement(type = BackendType.SCYLLA)
public void should_reject_batch_statement_with_explicit_keyspace_in_protocol_v4() {
SimpleStatement statementWithoutKeyspace =
SimpleStatement.newInstance(
Expand All @@ -109,6 +110,7 @@ public void should_reject_batch_statement_with_explicit_keyspace_in_protocol_v4(

@Test
@BackendRequirement(type = BackendType.CASSANDRA, minInclusive = "2.2")
@BackendRequirement(type = BackendType.SCYLLA)
public void should_reject_batch_statement_with_inferred_keyspace_in_protocol_v4() {
SimpleStatement statementWithKeyspace =
SimpleStatement.newInstance(
Expand All @@ -135,9 +137,6 @@ private void should_reject_statement_with_keyspace_in_protocol_v4(Statement stat

@Test
@BackendRequirement(type = BackendType.CASSANDRA, minInclusive = "4.0")
@ScyllaSkip(
description =
"@IntegrationTestDisabledScyllaFailure @IntegrationTestDisabledScyllaUnsupportedFunctionality @IntegrationTestDisabledScyllaProtocolV5")
public void should_execute_simple_statement_with_keyspace() {
CqlSession session = sessionRule.session();
session.execute(
Expand All @@ -156,9 +155,6 @@ public void should_execute_simple_statement_with_keyspace() {

@Test
@BackendRequirement(type = BackendType.CASSANDRA, minInclusive = "4.0")
@ScyllaSkip(
description =
"@IntegrationTestDisabledScyllaFailure @IntegrationTestDisabledScyllaUnsupportedFunctionality @IntegrationTestDisabledScyllaProtocolV5")
public void should_execute_batch_with_explicit_keyspace() {
CqlSession session = sessionRule.session();
session.execute(
Expand All @@ -183,9 +179,6 @@ public void should_execute_batch_with_explicit_keyspace() {

@Test
@BackendRequirement(type = BackendType.CASSANDRA, minInclusive = "4.0")
@ScyllaSkip(
description =
"@IntegrationTestDisabledScyllaFailure @IntegrationTestDisabledScyllaUnsupportedFunctionality @IntegrationTestDisabledScyllaProtocolV5")
public void should_execute_batch_with_inferred_keyspace() {
CqlSession session = sessionRule.session();
session.execute(
Expand Down Expand Up @@ -218,9 +211,6 @@ public void should_execute_batch_with_inferred_keyspace() {

@Test
@BackendRequirement(type = BackendType.CASSANDRA, minInclusive = "4.0")
@ScyllaSkip(
description =
"@IntegrationTestDisabledScyllaFailure @IntegrationTestDisabledScyllaUnsupportedFunctionality @IntegrationTestDisabledScyllaProtocolV5")
public void should_prepare_statement_with_keyspace() {
CqlSession session = sessionRule.session();
PreparedStatement prepared =
Expand All @@ -241,9 +231,6 @@ public void should_prepare_statement_with_keyspace() {

@Test
@BackendRequirement(type = BackendType.CASSANDRA, minInclusive = "4.0")
@ScyllaSkip(
description =
"@IntegrationTestDisabledScyllaFailure @IntegrationTestDisabledScyllaUnsupportedFunctionality @IntegrationTestDisabledScyllaProtocolV5")
public void should_reprepare_statement_with_keyspace_on_the_fly() {
// Create a separate session because we don't want it to have a default keyspace
SchemaChangeSynchronizer.withLock(
Expand Down
Loading
Loading