Elffuss BraidHub

kikocis/java-driver public

Update TokenAwarePolicy integration tests to use shuffleReplicas=false (JAVA-504).

This allows deterministic test results.
Changesetdd058c9e3c8fc4899148f33b63696014374a4292c2e1d838c95f3666b3223dc9
Authorolim7t <omichallat+github@gmail.com> · 2014-12-11 18:02 +01:00
Committerolim7t <omichallat+github@gmail.com> · 2014-12-11 18:02 +01:00
Parents125b3d45cbd8

Browse the files at this changeset

2 files changed

modified driver-core/src/test/java/com/datastax/driver/core/ConsistencyTest.java +14 −6
@@ -138,7 +138,7 @@
138138
139139 @Test(groups = "long")
140140 public void testRFTwoTokenAware() throws Throwable {
141- Cluster.Builder builder = Cluster.builder().withLoadBalancingPolicy(new TokenAwarePolicy(new RoundRobinPolicy()));
141+ Cluster.Builder builder = Cluster.builder().withLoadBalancingPolicy(new TokenAwarePolicy(new RoundRobinPolicy(), false));
142142 CCMBridge.CCMCluster c = CCMBridge.buildCluster(3, builder);
143143 try {
144144
@@ -235,7 +235,7 @@
235235
236236 @Test(groups = "long")
237237 public void testRFThreeTokenAware() throws Throwable {
238- Cluster.Builder builder = Cluster.builder().withLoadBalancingPolicy(new TokenAwarePolicy(new RoundRobinPolicy()));
238+ Cluster.Builder builder = Cluster.builder().withLoadBalancingPolicy(new TokenAwarePolicy(new RoundRobinPolicy(), false));
239239 CCMBridge.CCMCluster c = CCMBridge.buildCluster(3, builder);
240240 try {
241241
@@ -424,7 +424,9 @@
424424
425425 @Test(groups = "long")
426426 public void testRFTwoDowngradingCL() throws Throwable {
427- Cluster.Builder builder = Cluster.builder().withLoadBalancingPolicy(new TokenAwarePolicy(new RoundRobinPolicy())).withRetryPolicy(DowngradingConsistencyRetryPolicy.INSTANCE);
427+ Cluster.Builder builder = Cluster.builder()
428+ .withLoadBalancingPolicy(new TokenAwarePolicy(new RoundRobinPolicy(), false))
429+ .withRetryPolicy(DowngradingConsistencyRetryPolicy.INSTANCE);
428430 CCMBridge.CCMCluster c = CCMBridge.buildCluster(3, builder);
429431 try {
430432
@@ -483,7 +485,9 @@
483485
484486 @Test(groups = "long")
485487 public void testRFThreeTokenAwareDowngradingCL() throws Throwable {
486- Cluster.Builder builder = Cluster.builder().withLoadBalancingPolicy(new TokenAwarePolicy(new RoundRobinPolicy())).withRetryPolicy(DowngradingConsistencyRetryPolicy.INSTANCE);
488+ Cluster.Builder builder = Cluster.builder()
489+ .withLoadBalancingPolicy(new TokenAwarePolicy(new RoundRobinPolicy(), false))
490+ .withRetryPolicy(DowngradingConsistencyRetryPolicy.INSTANCE);
487491 testRFThreeDowngradingCL(builder);
488492 }
489493
@@ -549,7 +553,9 @@
549553
550554 @Test(groups = "long")
551555 public void testRFThreeDowngradingCLTwoDCs() throws Throwable {
552- Cluster.Builder builder = Cluster.builder().withLoadBalancingPolicy(new TokenAwarePolicy(new RoundRobinPolicy())).withRetryPolicy(DowngradingConsistencyRetryPolicy.INSTANCE);
556+ Cluster.Builder builder = Cluster.builder()
557+ .withLoadBalancingPolicy(new TokenAwarePolicy(new RoundRobinPolicy(), false))
558+ .withRetryPolicy(DowngradingConsistencyRetryPolicy.INSTANCE);
553559 CCMBridge.CCMCluster c = CCMBridge.buildCluster(3, 3, builder);
554560 try {
555561
@@ -646,7 +652,9 @@
646652
647653 @Test(groups = "long")
648654 public void testRFThreeDowngradingCLTwoDCsDCAware() throws Throwable {
649- Cluster.Builder builder = Cluster.builder().withLoadBalancingPolicy(new TokenAwarePolicy(new DCAwareRoundRobinPolicy("dc2"))).withRetryPolicy(DowngradingConsistencyRetryPolicy.INSTANCE);
655+ Cluster.Builder builder = Cluster.builder()
656+ .withLoadBalancingPolicy(new TokenAwarePolicy(new DCAwareRoundRobinPolicy("dc2"), false))
657+ .withRetryPolicy(DowngradingConsistencyRetryPolicy.INSTANCE);
650658 CCMBridge.CCMCluster c = CCMBridge.buildCluster(3, 3, builder);
651659 try {
652660
modified driver-core/src/test/java/com/datastax/driver/core/LoadBalancingPolicyTest.java +1 −1
@@ -406,7 +406,7 @@
406406
407407 @Test(groups = "long")
408408 public void tokenAwareWithRF2Test() throws Throwable {
409- Cluster.Builder builder = Cluster.builder().withLoadBalancingPolicy(new TokenAwarePolicy(new RoundRobinPolicy()));
409+ Cluster.Builder builder = Cluster.builder().withLoadBalancingPolicy(new TokenAwarePolicy(new RoundRobinPolicy(), false));
410410 CCMBridge.CCMCluster c = CCMBridge.buildCluster(2, builder);
411411 try {
412412