kikocis/java-driver public
Changesets · Branches · Tags · Compare
| Changeset | 33a7fd42cbadf1ea0720f0ded85b400b01ab80315a45e91c7030c6e988dd91c7 |
|---|---|
| Author | Andrew Tolbert <andrew.tolbert@datastax.com> · 2016-03-10 16:57 -06:00 |
| Committer | olim7t <omichallat+github@gmail.com> · 2016-03-15 10:31 +01:00 |
| Parents | d95a45e479a7 |
3 files changed
modified driver-core/pom.xml +1 −0
| @@ -381,6 +381,7 @@ | ||
| 381 | 381 | <include>**/SSL*Test.java</include> |
| 382 | 382 | <include>**/UUIDsPID*.java</include> |
| 383 | 383 | <include>**/ControlConnectionTest.java</include> |
| 384 | + <include>**/ExtendedPeerCheckDisabledTest.java</include> | |
| 384 | 385 | </includes> |
| 385 | 386 | </configuration> |
| 386 | 387 | </plugin> |
modified driver-core/src/test/java/com/datastax/driver/core/ControlConnectionTest.java +2 −16
| @@ -225,7 +225,7 @@ | ||
| 225 | 225 | } |
| 226 | 226 | |
| 227 | 227 | @DataProvider |
| 228 | - public Object[][] disallowedNullColumnsInPeerData() { | |
| 228 | + public static Object[][] disallowedNullColumnsInPeerData() { | |
| 229 | 229 | return new Object[][]{ |
| 230 | 230 | {"host_id"}, |
| 231 | 231 | {"data_center"}, |
| @@ -325,20 +325,6 @@ | ||
| 325 | 325 | } |
| 326 | 326 | } |
| 327 | 327 | |
| 328 | - /** | |
| 329 | - * Validates that if the com.datastax.driver.EXTENDED_PEER_CHECK system property is set to false that a peer | |
| 330 | - * with null values for host_id, data_center, rack, tokens is not ignored. | |
| 331 | - * | |
| 332 | - * @test_category host:metadata | |
| 333 | - * @jira_ticket JAVA-852 | |
| 334 | - * @since 2.1.10 | |
| 335 | - */ | |
| 336 | - @Test(groups = "isolated", dataProvider = "disallowedNullColumnsInPeerData") | |
| 337 | - @CCMConfig(createCcm = false) | |
| 338 | - public void should_use_peer_if_extended_peer_check_is_disabled(String columns) { | |
| 339 | - System.setProperty("com.datastax.driver.EXTENDED_PEER_CHECK", "false"); | |
| 340 | - run_with_null_peer_info(columns, true); | |
| 341 | - } | |
| 342 | 328 | |
| 343 | 329 | /** |
| 344 | 330 | * Validates that if the com.datastax.driver.EXTENDED_PEER_CHECK system property is set to true that a peer |
| @@ -368,7 +354,7 @@ | ||
| 368 | 354 | run_with_null_peer_info(columns, false); |
| 369 | 355 | } |
| 370 | 356 | |
| 371 | - private void run_with_null_peer_info(String columns, boolean expectPeer2) { | |
| 357 | + static void run_with_null_peer_info(String columns, boolean expectPeer2) { | |
| 372 | 358 | // given: A cluster with peer 2 having a null rack. |
| 373 | 359 | ScassandraCluster.ScassandraClusterBuilder builder = ScassandraCluster.builder() |
| 374 | 360 | .withNodes(3); |
added driver-core/src/test/java/com/datastax/driver/core/ExtendedPeerCheckDisabledTest.java +36 −0
| @@ -0,0 +1,36 @@ | ||
| 1 | +/* | |
| 2 | + * Copyright (C) 2012-2015 DataStax Inc. | |
| 3 | + * | |
| 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); | |
| 5 | + * you may not use this file except in compliance with the License. | |
| 6 | + * You may obtain a copy of the License at | |
| 7 | + * | |
| 8 | + * http://www.apache.org/licenses/LICENSE-2.0 | |
| 9 | + * | |
| 10 | + * Unless required by applicable law or agreed to in writing, software | |
| 11 | + * distributed under the License is distributed on an "AS IS" BASIS, | |
| 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| 13 | + * See the License for the specific language governing permissions and | |
| 14 | + * limitations under the License. | |
| 15 | + */ | |
| 16 | +package com.datastax.driver.core; | |
| 17 | + | |
| 18 | +import org.testng.annotations.Test; | |
| 19 | + | |
| 20 | +public class ExtendedPeerCheckDisabledTest { | |
| 21 | + | |
| 22 | + /** | |
| 23 | + * Validates that if the com.datastax.driver.EXTENDED_PEER_CHECK system property is set to false that a peer | |
| 24 | + * with null values for host_id, data_center, rack, tokens is not ignored. | |
| 25 | + * | |
| 26 | + * @test_category host:metadata | |
| 27 | + * @jira_ticket JAVA-852 | |
| 28 | + * @since 2.1.10 | |
| 29 | + */ | |
| 30 | + @Test(groups = "isolated", dataProvider = "disallowedNullColumnsInPeerData", dataProviderClass = ControlConnectionTest.class) | |
| 31 | + @CCMConfig(createCcm = false) | |
| 32 | + public void should_use_peer_if_extended_peer_check_is_disabled(String columns) { | |
| 33 | + System.setProperty("com.datastax.driver.EXTENDED_PEER_CHECK", "false"); | |
| 34 | + ControlConnectionTest.run_with_null_peer_info(columns, true); | |
| 35 | + } | |
| 36 | +} |