@BeforeClass(groups = {"short", "long"}) public void beforeTestClass() { scassandra = TestUtils.createScassandraServer(); scassandra.start(); primingClient = scassandra.primingClient(); activityClient = scassandra.activityClient(); currentClient = scassandra.currentClient(); hostAddress = new InetSocketAddress(ip, scassandra.getBinaryPort()); }
scassandra.node(1).currentClient().closeConnection(CLOSE, controlSocket);
/** * Ensures that if all connections fail to a host on pool init that the host is marked down. * * @jira_ticket JAVA-544 * @test_category connection:connection_pool * @since 2.0.11 */ @Test(groups = "short") public void should_mark_host_down_if_all_connections_fail_on_init() { // Prevent any connections on node 2. scassandra.node(2).currentClient().disableListener(); createCluster(8, 8); // Node 2 should be in a down state while node 1 stays up. assertThat(cluster).host(2).goesDownWithin(10, SECONDS); assertThat(cluster).host(1).isUp(); // Node 2 should come up as soon as it is able to reconnect. scassandra.node(2).currentClient().enableListener(); assertThat(cluster).host(2).comesUpWithin(2, SECONDS); }
@BeforeClass(groups = {"short", "long"}) public void beforeTestClass() { scassandra = TestUtils.createScassandraServer(); scassandra.start(); primingClient = scassandra.primingClient(); activityClient = scassandra.activityClient(); currentClient = scassandra.currentClient(); hostAddress = new InetSocketAddress(ip, scassandra.getBinaryPort()); }
scassandra.node(1).currentClient().closeConnection(CLOSE, controlSocket);
/** * Ensures that if all connections fail to a host on pool init that the host is marked down. * * @jira_ticket JAVA-544 * @test_category connection:connection_pool * @since 2.0.11 */ @Test(groups = "short") public void should_mark_host_down_if_all_connections_fail_on_init() { // Prevent any connections on node 2. scassandra.node(2).currentClient().disableListener(); createCluster(8, 8); // Node 2 should be in a down state while node 1 stays up. assertThat(cluster).host(2).goesDownWithin(10, SECONDS); assertThat(cluster).host(1).isUp(); // Node 2 should come up as soon as it is able to reconnect. scassandra.node(2).currentClient().enableListener(); assertThat(cluster).host(2).comesUpWithin(2, SECONDS); }