Elffuss BraidHub

kikocis/java-driver public

Don't set enable_user_defined_functions unless 2.2+.
Changeset7462e7d19397bf4e7778c0cc0e7e01774325bfda60f97eb53da7e416da00d85d
AuthorAndrew Tolbert <andrew.tolbert@datastax.com> · 2015-07-16 12:48 -05:00
CommitterAndrew Tolbert <andrew.tolbert@datastax.com> · 2015-07-16 12:48 -05:00
Parentsada2b55e1ff7

Browse the files at this changeset

2 files changed

modified driver-core/src/test/java/com/datastax/driver/core/CCMBridge.java +8 −7
@@ -449,13 +449,14 @@
449449 try {
450450 ProtocolVersion protocolVersion = TestUtils.getDesiredProtocolVersion();
451451
452- ccmBridge = CCMBridge.builder("test-class")
453- .withoutNodes()
454- .notStarted()
455- .withCassandraConfiguration("enable_user_defined_functions",
456- // Only enable user defined functions if protocol version is >= 4.
457- Boolean.toString(protocolVersion.compareTo(ProtocolVersion.V4) >= 0))
458- .build();
452+ CCMBridge.Builder builder = CCMBridge.builder("test-class")
453+ .withoutNodes()
454+ .notStarted();
455+
456+ if(protocolVersion.compareTo(ProtocolVersion.V4) >= 0) {
457+ builder = builder.withCassandraConfiguration("enable_user_defined_functions", "true");
458+ }
459+ ccmBridge = builder.build();
459460
460461 ports = new int[5];
461462 for (int i = 0; i < 5; i++) {
modified driver-core/src/test/java/com/datastax/driver/core/SchemaChangesTest.java +7 −6
@@ -42,12 +42,13 @@
4242
4343 @BeforeClass(groups = "short")
4444 public void setup() {
45- ccm = CCMBridge.builder("schemaChangesTest")
46- .withNodes(1)
47- .withCassandraConfiguration("enable_user_defined_functions",
48- // Only enable user defined functions if protocol version is >= 4.
49- Boolean.toString(TestUtils.getDesiredProtocolVersion().compareTo(ProtocolVersion.V4) >= 0))
50- .build();
45+ CCMBridge.Builder builder = CCMBridge.builder("schemaChangesTest")
46+ .withNodes(1);
47+
48+ if(TestUtils.getDesiredProtocolVersion().compareTo(ProtocolVersion.V4) >= 0) {
49+ builder = builder.withCassandraConfiguration("enable_user_defined_functions", "true");
50+ }
51+ ccm = builder.build();
5152
5253 cluster = Cluster.builder().addContactPoint(CCMBridge.ipOfNode(1)).build();
5354 cluster2 = Cluster.builder().addContactPoint(CCMBridge.ipOfNode(1)).build();