Elffuss BraidHub

kikocis/java-driver public

Merge pull request #457 from datastax/custom_payload_test_fix

Fix CustomPayloadTest failing when run in suite.
Changeset98c95c343dd27146ae5188b3b5d49067bcc6300b190a088a04289dc30c800e8c
AuthorOlivier Michallat <olim7t@users.noreply.github.com> · 2015-10-08 10:34 +02:00
CommitterOlivier Michallat <olim7t@users.noreply.github.com> · 2015-10-08 10:34 +02:00
Parents95f9c7c6fd5f, 24da556aef21

Browse the files at this changeset

1 file changed

modified driver-core/src/test/java/com/datastax/driver/core/CCMBridge.java +11 −3
@@ -402,10 +402,11 @@
402402 // One cluster for the whole test class
403403 public static abstract class PerClassSingleNodeCluster {
404404
405- protected static CCMBridge ccmBridge;
405+ private static CCMBridge ccmBridge;
406406 private static boolean erroredOut;
407407 private static boolean clusterInitialized=false;
408408 private static AtomicLong ksNumber;
409+ private static final String jvmArgs = "-Dcassandra.custom_query_handler_class=org.apache.cassandra.cql3.CustomPayloadMirroringQueryHandler";
409410 protected String keyspace;
410411
411412 protected static InetSocketAddress hostAddress;
@@ -463,8 +464,7 @@
463464 ports[i] = TestUtils.findAvailablePort(11000 + i);
464465 }
465466
466- ccmBridge.bootstrapNodeWithPorts(1, ports[0], ports[1], ports[2], ports[3], ports[4],
467- "-Dcassandra.custom_query_handler_class=org.apache.cassandra.cql3.CustomPayloadMirroringQueryHandler");
467+ ccmBridge.bootstrapNodeWithPorts(1, ports[0], ports[1], ports[2], ports[3], ports[4], jvmArgs);
468468 ksNumber = new AtomicLong(0);
469469 erroredOut = false;
470470 hostAddress = new InetSocketAddress(InetAddress.getByName(IP_PREFIX + 1), ports[2]);
@@ -528,6 +528,14 @@
528528 }
529529 }
530530
531+ protected void stop() {
532+ ccmBridge.stop();
533+ }
534+
535+ protected void start() {
536+ ccmBridge.start(1, jvmArgs);
537+ }
538+
531539 }
532540
533541 public static class CCMCluster {