use of com.datastax.oss.driver.api.testinfra.DseRequirement in project java-driver by datastax.
the class ProtocolVersionInitialNegotiationIT method should_use_explicitly_provided_dse_v1.
@DseRequirement(min = "5.1", description = "Only DSE in [5.1,*[ has DSE_V1 supported")
@Test
public void should_use_explicitly_provided_dse_v1() {
DriverConfigLoader loader = SessionUtils.configLoaderBuilder().withString(DefaultDriverOption.PROTOCOL_VERSION, "DSE_V1").build();
try (CqlSession session = SessionUtils.newSession(ccm, loader)) {
assertThat(session.getContext().getProtocolVersion()).isEqualTo(DseProtocolVersion.DSE_V1);
session.execute("select * from system.local");
}
}
use of com.datastax.oss.driver.api.testinfra.DseRequirement in project java-driver by datastax.
the class ProtocolVersionInitialNegotiationIT method should_use_explicitly_provided_dse_v2.
@DseRequirement(min = "6.0", description = "Only DSE in [6.0,*[ has DSE_V2 supported")
@Test
public void should_use_explicitly_provided_dse_v2() {
DriverConfigLoader loader = SessionUtils.configLoaderBuilder().withString(DefaultDriverOption.PROTOCOL_VERSION, "DSE_V2").build();
try (CqlSession session = SessionUtils.newSession(ccm, loader)) {
assertThat(session.getContext().getProtocolVersion()).isEqualTo(DseProtocolVersion.DSE_V2);
session.execute("select * from system.local");
}
}
use of com.datastax.oss.driver.api.testinfra.DseRequirement in project java-driver by datastax.
the class ProtocolVersionInitialNegotiationIT method should_downgrade_to_v3_dse.
@DseRequirement(max = "5.0", description = "Only DSE in [*,5.0[ has V3 as its highest version")
@Test
public void should_downgrade_to_v3_dse() {
try (CqlSession session = SessionUtils.newSession(ccm)) {
assertThat(session.getContext().getProtocolVersion().getCode()).isEqualTo(3);
session.execute("select * from system.local");
}
}
use of com.datastax.oss.driver.api.testinfra.DseRequirement in project java-driver by datastax.
the class ProtocolVersionInitialNegotiationIT method should_not_downgrade_if_server_supports_latest_version_dse.
/**
* Note that this test will need to be updated as new protocol versions are introduced.
*/
@DseRequirement(min = "6.0", description = "Only DSE in [6.0,*[ has DSE_V2 supported")
@Test
public void should_not_downgrade_if_server_supports_latest_version_dse() {
try (CqlSession session = SessionUtils.newSession(ccm)) {
assertThat(session.getContext().getProtocolVersion()).isEqualTo(ProtocolVersion.DSE_V2);
session.execute("select * from system.local");
}
}
use of com.datastax.oss.driver.api.testinfra.DseRequirement in project java-driver by datastax.
the class ProtocolVersionInitialNegotiationIT method should_downgrade_to_dse_v1.
@DseRequirement(min = "5.1", max = "6.0", description = "Only DSE in [5.1,6.0[ has DSE_V1 as its highest version")
@Test
public void should_downgrade_to_dse_v1() {
try (CqlSession session = SessionUtils.newSession(ccm)) {
assertThat(session.getContext().getProtocolVersion()).isEqualTo(DseProtocolVersion.DSE_V1);
session.execute("select * from system.local");
}
}
Aggregations