kikocis/java-driver public
Changesets · Branches · Tags · Compare
| Changeset | 3981e916b2aac273ea2a454fa879a405006a8c6285a4e0c997c76f21115d68f8 |
|---|---|
| Author | Andrew Tolbert <andrew.tolbert@datastax.com> · 2015-10-26 13:34 -05:00 |
| Committer | Andrew Tolbert <andrew.tolbert@datastax.com> · 2015-11-04 15:03 -06:00 |
| Parents | 659a94ae9fce |
1 file changed
modified driver-core/src/test/java/com/datastax/driver/core/ClusterInitTest.java +7 −7
| @@ -41,12 +41,10 @@ | ||
| 41 | 41 | |
| 42 | 42 | import com.datastax.driver.core.exceptions.NoHostAvailableException; |
| 43 | 43 | import com.datastax.driver.core.policies.ConstantReconnectionPolicy; |
| 44 | -import com.datastax.driver.core.utils.CassandraVersion; | |
| 45 | 44 | |
| 46 | -import static com.datastax.driver.core.Assertions.*; | |
| 45 | +import static com.datastax.driver.core.Assertions.assertThat; | |
| 46 | +import static com.datastax.driver.core.Assertions.fail; | |
| 47 | 47 | import static com.datastax.driver.core.FakeHost.Behavior.THROWING_CONNECT_TIMEOUTS; |
| 48 | -import static com.datastax.driver.core.Host.State.DOWN; | |
| 49 | -import static com.datastax.driver.core.Host.State.UP; | |
| 50 | 48 | import static com.datastax.driver.core.HostDistance.LOCAL; |
| 51 | 49 | import static com.datastax.driver.core.TestUtils.nonDebouncingQueryOptions; |
| 52 | 50 | |
| @@ -58,7 +56,6 @@ | ||
| 58 | 56 | * causing timeouts, we want to ensure that the driver does not wait multiple times on the same host. |
| 59 | 57 | */ |
| 60 | 58 | @Test(groups = "short") |
| 61 | - @CassandraVersion(major=2.0, description = "Scassandra currently broken with protocol version 1.") | |
| 62 | 59 | public void should_handle_failing_or_missing_contact_points() throws UnknownHostException { |
| 63 | 60 | Cluster cluster = null; |
| 64 | 61 | Scassandra scassandra = null; |
| @@ -128,9 +125,12 @@ | ||
| 128 | 125 | verify(socketOptions, atLeast(6)).getKeepAlive(); |
| 129 | 126 | verify(socketOptions, atMost(7)).getKeepAlive(); |
| 130 | 127 | |
| 131 | - assertThat(cluster).host(realHostAddress).isNotNull().hasState(UP); | |
| 128 | + assertThat(cluster).host(realHostAddress).isNotNull().isUp(); | |
| 129 | + // It is likely but not guaranteed that a host is marked down at this point. | |
| 130 | + // It should eventually be marked down as Cluster.Manager.triggerOnDown should be | |
| 131 | + // called and submit a task that marks the host down. | |
| 132 | 132 | for (FakeHost failingHost : failingHosts) { |
| 133 | - assertThat(cluster).host(failingHost.address).hasState(DOWN); | |
| 133 | + assertThat(cluster).host(failingHost.address).goesDownWithin(10, TimeUnit.SECONDS); | |
| 134 | 134 | assertThat(cluster).host(failingHost.address).isReconnectingFromDown(); |
| 135 | 135 | } |
| 136 | 136 | assertThat(cluster).host(missingHostAddress).isNull(); |