use of org.neo4j.causalclustering.discovery.Cluster in project neo4j by neo4j.
the class ClusterOverviewIT method shouldDiscoverRemovalOfReadReplicas.
@Test
public void shouldDiscoverRemovalOfReadReplicas() throws Exception {
// given
clusterRule.withNumberOfCoreMembers(3);
clusterRule.withNumberOfReadReplicas(3);
Cluster cluster = clusterRule.startCluster();
for (int coreServerId = 0; coreServerId < 3; coreServerId++) {
assertEventualOverview(cluster, containsRole(READ_REPLICA, 3), coreServerId);
}
// when
cluster.removeReadReplicaWithMemberId(0);
cluster.removeReadReplicaWithMemberId(1);
for (int coreServerId = 0; coreServerId < 3; coreServerId++) {
// then
assertEventualOverview(cluster, containsRole(READ_REPLICA, 1), coreServerId);
}
}
use of org.neo4j.causalclustering.discovery.Cluster in project neo4j by neo4j.
the class ClusterOverviewIT method shouldDiscoverRemovalOfCoreMembers.
@Test
public void shouldDiscoverRemovalOfCoreMembers() throws Exception {
// given
clusterRule.withNumberOfCoreMembers(5);
clusterRule.withNumberOfReadReplicas(0);
Cluster cluster = clusterRule.startCluster();
for (int coreServerId = 0; coreServerId < 5; coreServerId++) {
assertEventualOverview(cluster, allOf(containsRole(LEADER, 1), containsRole(FOLLOWER, 4)), coreServerId);
}
// when
cluster.removeCoreMemberWithMemberId(0);
cluster.removeCoreMemberWithMemberId(1);
for (int coreServerId = 2; coreServerId < 5; coreServerId++) {
// then
assertEventualOverview(cluster, allOf(containsRole(LEADER, 1), containsRole(FOLLOWER, 2)), coreServerId);
}
}
Aggregations