Search in sources :

Example 1 with UnsupportedProtocolVersionException

use of com.datastax.driver.core.exceptions.UnsupportedProtocolVersionException in project java-driver by datastax.

the class ProtocolVersionRenegotiationTest method should_fail_when_beta_allowed_and_too_high.

/**
 * @jira_ticket JAVA-1367
 */
@Test(groups = "short")
public void should_fail_when_beta_allowed_and_too_high() throws Exception {
    if (ccm().getCassandraVersion().compareTo(VersionNumber.parse("3.10")) >= 0) {
        throw new SkipException("Server supports protocol protocol V5 beta");
    }
    UnsupportedProtocolVersionException e = connectWithUnsupportedBetaVersion();
    assertThat(e.getUnsupportedVersion()).isEqualTo(V5);
}
Also used : SkipException(org.testng.SkipException) UnsupportedProtocolVersionException(com.datastax.driver.core.exceptions.UnsupportedProtocolVersionException) Test(org.testng.annotations.Test)

Example 2 with UnsupportedProtocolVersionException

use of com.datastax.driver.core.exceptions.UnsupportedProtocolVersionException in project java-driver by datastax.

the class ProtocolVersionRenegotiationTest method should_fail_when_version_provided_and_too_low_3_8_plus.

/**
 * @jira_ticket JAVA-1367
 */
@Test(groups = "short")
@CassandraVersion("3.8")
public void should_fail_when_version_provided_and_too_low_3_8_plus() throws Exception {
    UnsupportedProtocolVersionException e = connectWithUnsupportedVersion(V1);
    assertThat(e.getUnsupportedVersion()).isEqualTo(V1);
    // post-CASSANDRA-11464: server replies with client's version
    assertThat(e.getServerVersion()).isEqualTo(V1);
}
Also used : UnsupportedProtocolVersionException(com.datastax.driver.core.exceptions.UnsupportedProtocolVersionException) Test(org.testng.annotations.Test) CassandraVersion(com.datastax.driver.core.utils.CassandraVersion)

Example 3 with UnsupportedProtocolVersionException

use of com.datastax.driver.core.exceptions.UnsupportedProtocolVersionException in project java-driver by datastax.

the class ProtocolVersionRenegotiationTest method should_fail_when_version_provided_and_too_high.

/**
 * @jira_ticket JAVA-1367
 */
@Test(groups = "short")
public void should_fail_when_version_provided_and_too_high() throws Exception {
    if (ccm().getCassandraVersion().compareTo(VersionNumber.parse("2.2")) >= 0) {
        throw new SkipException("Server supports protocol V4");
    }
    UnsupportedProtocolVersionException e = connectWithUnsupportedVersion(V4);
    assertThat(e.getUnsupportedVersion()).isEqualTo(V4);
    // pre-CASSANDRA-11464: server replies with its own version
    assertThat(e.getServerVersion()).isEqualTo(protocolVersion);
}
Also used : SkipException(org.testng.SkipException) UnsupportedProtocolVersionException(com.datastax.driver.core.exceptions.UnsupportedProtocolVersionException) Test(org.testng.annotations.Test)

Aggregations

UnsupportedProtocolVersionException (com.datastax.driver.core.exceptions.UnsupportedProtocolVersionException)3 Test (org.testng.annotations.Test)3 SkipException (org.testng.SkipException)2 CassandraVersion (com.datastax.driver.core.utils.CassandraVersion)1