Elffuss BraidHub

kikocis/java-driver public

Provide version in serialize call in TokenAwarePolicyTest.
Changeset160713304998f9101d61c3e1e69341c5c9104f2886c9127dfcadfe47b1c1bbbc
AuthorAndrew Tolbert <andrew.tolbert@datastax.com> · 2015-12-02 09:35 -06:00
CommitterAndrew Tolbert <andrew.tolbert@datastax.com> · 2015-12-02 09:35 -06:00
Parentsc1334e48fa02

Browse the files at this changeset

1 file changed

modified driver-core/src/test/java/com/datastax/driver/core/policies/TokenAwarePolicyTest.java +6 −4
@@ -41,6 +41,7 @@
4141 import static com.datastax.driver.core.Assertions.assertThat;
4242 import static com.datastax.driver.core.TestUtils.CREATE_KEYSPACE_SIMPLE_FORMAT;
4343 import static com.datastax.driver.core.TestUtils.SIMPLE_KEYSPACE;
44+import static com.datastax.driver.core.TestUtils.getDesiredProtocolVersion;
4445 import static com.datastax.driver.core.TestUtils.nonQuietClusterCloseOptions;
4546
4647 public class TokenAwarePolicyTest {
@@ -95,7 +96,7 @@
9596 // given: A routing key that falls in the token range of node 6.
9697
9798 // Encodes into murmur hash '4874351301193663061' which should belong be owned by node 6 with replicas 7 and 8.
98- ByteBuffer routingKey = DataType.text().serialize("This is some sample text");
99+ ByteBuffer routingKey = DataType.text().serialize("This is some sample text", getDesiredProtocolVersion());
99100
100101 // then: The replicas resolved from the cluster metadata must match node 6 and its replicas.
101102 List<Host> replicas = Lists.newArrayList(cluster.getMetadata().getReplicas("keyspace", routingKey));
@@ -161,7 +162,7 @@
161162 Session session = cluster.connect();
162163
163164 // Encodes into murmur hash '4557949199137838892' which should belong be owned by node 3.
164- ByteBuffer routingKey = DataType.text().serialize("should_choose_proper_host_based_on_routing_key");
165+ ByteBuffer routingKey = DataType.text().serialize("should_choose_proper_host_based_on_routing_key", getDesiredProtocolVersion());
165166 SimpleStatement statement = new SimpleStatement("select * from table where k=5")
166167 .setRoutingKey(routingKey)
167168 .setKeyspace("keyspace");
@@ -207,7 +208,8 @@
207208 Session session = cluster.connect();
208209
209210 // Encodes into murmur hash '-8124212968526248339' which should belong to 1:1 in DC1 and 2:1 in DC2.
210- ByteBuffer routingKey = DataType.text().serialize("should_choose_host_in_local_dc_when_using_network_topology_strategy_and_dc_aware");
211+ ByteBuffer routingKey = DataType.text().serialize("should_choose_host_in_local_dc_when_using_network_topology_strategy_and_dc_aware",
212+ getDesiredProtocolVersion());
211213 SimpleStatement statement = new SimpleStatement("select * from table where k=5")
212214 .setRoutingKey(routingKey)
213215 .setKeyspace("keyspace");
@@ -250,7 +252,7 @@
250252
251253 // when: A query is made with a routing key and both hosts having that key's token are down.
252254 // Encodes into murmur hash '6444339665561646341' which should belong to node 4.
253- ByteBuffer routingKey = DataType.text().serialize("should_use_other_nodes_when_replicas_having_token_are_down");
255+ ByteBuffer routingKey = DataType.text().serialize("should_use_other_nodes_when_replicas_having_token_are_down", getDesiredProtocolVersion());
254256 SimpleStatement statement = new SimpleStatement("select * from table where k=5")
255257 .setRoutingKey(routingKey)
256258 .setKeyspace("keyspace");