Skip to content

Commit 26ca703

Browse files
committed
Merge branch '3.1.x' into 3.x
2 parents 9d97a3c + 6055f07 commit 26ca703

28 files changed

Lines changed: 359 additions & 369 deletions

driver-core/src/test/java/com/datastax/driver/core/AggregateMetadataTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ public void should_parse_and_format_aggregate_with_udts() {
185185
@Test(groups = "short")
186186
@CassandraVersion("2.2.0")
187187
public void should_parse_and_format_aggregate_with_composite_type_literal_initcond() {
188-
VersionNumber ver = VersionNumber.parse(CCMBridge.getCassandraVersion());
188+
VersionNumber ver = ccm().getCassandraVersion();
189189
if (ver.getMajor() == 3) {
190190
if ((ver.getMinor() >= 1 && ver.getMinor() < 4) || (ver.getMinor() == 0 && ver.getPatch() < 4)) {
191191
throw new SkipException("Requires C* 2.2.X, 3.0.4+ or 3.4.X+");
@@ -206,7 +206,7 @@ public void should_parse_and_format_aggregate_with_composite_type_literal_initco
206206
@Test(groups = "short")
207207
@CassandraVersion("3.4")
208208
public void should_parse_and_format_aggregate_with_composite_type_hex_initcond() {
209-
VersionNumber ver = VersionNumber.parse(CCMBridge.getCassandraVersion());
209+
VersionNumber ver = ccm().getCassandraVersion();
210210
if ((ver.getMinor() >= 1 && ver.getMinor() < 4)) {
211211
throw new SkipException("Requires 3.0.4+ or 3.4.X+");
212212
}

driver-core/src/test/java/com/datastax/driver/core/AuthenticationTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public class AuthenticationTest extends CCMTestsSupport {
4141
public void sleepIf12() {
4242
// For C* 1.2, sleep before attempting to connect as there is a small delay between
4343
// user being created.
44-
if (ccm().getVersion().getMajor() < 2) {
44+
if (ccm().getCassandraVersion().getMajor() < 2) {
4545
Uninterruptibles.sleepUninterruptibly(1, TimeUnit.SECONDS);
4646
}
4747
}

driver-core/src/test/java/com/datastax/driver/core/CCMAccess.java

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,21 @@ enum Workload {cassandra, solr, hadoop, spark, cfs, graph}
3232
String getClusterName();
3333

3434
/**
35-
* Returns the Cassandra version of this CCM cluster.
35+
* Returns the Cassandra version of this CCM cluster. If {@link #getDSEVersion()} is non-null it is assumed
36+
* that this value is only used for representing the compatible Cassandra version for that DSE version.
3637
* <p/>
37-
* By default the version is equal to {@link CCMBridge#getCassandraVersion()}.
3838
*
3939
* @return The version of this CCM cluster.
4040
*/
41-
VersionNumber getVersion();
41+
VersionNumber getCassandraVersion();
42+
43+
/**
44+
* Returns the DSE version of this CCM cluster if this is a DSE cluster, otherwise null.
45+
* <p/>
46+
*
47+
* @return The version of this CCM cluster.
48+
*/
49+
VersionNumber getDSEVersion();
4250

4351
/**
4452
* @return The config directory for this CCM cluster.
@@ -236,4 +244,19 @@ enum Workload {cassandra, solr, hadoop, spark, cfs, graph}
236244
*/
237245
void waitForDown(int node);
238246

247+
/**
248+
* @return The target protocolVersion to use when connecting to this CCM cluster.
249+
* <p/>
250+
* This should be based on the highest protocol version that both the cluster and driver support.
251+
* <p/>
252+
* For example, C* 2.0.17 should return {@link ProtocolVersion#V2} since C* supports up to V2 and the driver
253+
* supports that version.
254+
*/
255+
ProtocolVersion getProtocolVersion();
256+
257+
/**
258+
* @param maximumAllowed The maximum protocol version to use.
259+
* @return The target protocolVersion or maximumAllowed if {@link #getProtocolVersion} is greater.
260+
*/
261+
ProtocolVersion getProtocolVersion(ProtocolVersion maximumAllowed);
239262
}

0 commit comments

Comments
 (0)