use of org.sonar.process.cluster.health.NodeHealth in project sonarqube by SonarSource.
the class AppNodeClusterCheckTest method status_YELLOW_when_two_GREEN_application_node_and_any_number_of_other_is_RED_or_GREEN.
@Test
public void status_YELLOW_when_two_GREEN_application_node_and_any_number_of_other_is_RED_or_GREEN() {
Set<NodeHealth> nodeHealths = of(// at least 1 RED
of(appNodeHealth(RED)), // 0 to 10 RED/GREEN
randomNumberOfAppNodeHealthOfAnyStatus(GREEN, RED), // 2 GREEN
nodeHealths(GREEN, GREEN)).flatMap(s -> s).collect(toSet());
Health check = underTest.check(nodeHealths);
assertThat(check).forInput(nodeHealths).hasStatus(Health.Status.YELLOW).andCauses("At least one application node is RED");
}
use of org.sonar.process.cluster.health.NodeHealth in project sonarqube by SonarSource.
the class AppNodeClusterCheckTest method status_YELLOW_when_two_GREEN_application_node_and_any_number_of_other_is_either_RED_or_YELLOW.
@Test
public void status_YELLOW_when_two_GREEN_application_node_and_any_number_of_other_is_either_RED_or_YELLOW() {
Set<NodeHealth> nodeHealths = of(// at least 1 RED
of(appNodeHealth(RED)), // at least 1 YELLOW
of(appNodeHealth(YELLOW)), // 0 to 10 RED/YELLOW/GREEN
randomNumberOfAppNodeHealthOfAnyStatus(RED, YELLOW, GREEN), // 2 GREEN
nodeHealths(GREEN, GREEN)).flatMap(s -> s).collect(toSet());
Health check = underTest.check(nodeHealths);
assertThat(check).forInput(nodeHealths).hasStatus(Health.Status.YELLOW).andCauses("At least one application node is YELLOW", "At least one application node is RED");
}
use of org.sonar.process.cluster.health.NodeHealth in project sonarqube by SonarSource.
the class AppNodeClusterCheckTest method status_GREEN_when_two_GREEN_application_node_and_any_number_of_other_is_GREEN.
@Test
public void status_GREEN_when_two_GREEN_application_node_and_any_number_of_other_is_GREEN() {
Set<NodeHealth> nodeHealths = of(// at least 1 extra GREEN
of(appNodeHealth(GREEN)), // 0 to 10 GREEN
randomNumberOfAppNodeHealthOfAnyStatus(GREEN), // 2 GREEN
nodeHealths(GREEN, GREEN)).flatMap(s -> s).collect(toSet());
Health check = underTest.check(nodeHealths);
assertThat(check).forInput(nodeHealths).hasStatus(Health.Status.GREEN).andCauses();
}
use of org.sonar.process.cluster.health.NodeHealth in project sonarqube by SonarSource.
the class AppNodeClusterCheckTest method status_RED_when_single_RED_application_node.
@Test
public void status_RED_when_single_RED_application_node() {
Set<NodeHealth> nodeHealths = nodeHealths(RED).collect(toSet());
Health check = underTest.check(nodeHealths);
assertThat(check).forInput(nodeHealths).hasStatus(Health.Status.RED).andCauses("Status of all application nodes is RED", "There should be at least two application nodes");
}
use of org.sonar.process.cluster.health.NodeHealth in project sonarqube by SonarSource.
the class AppNodeClusterCheckTest method status_YELLOW_when_one_RED_node_and_one_YELLOW_application_node.
@Test
public void status_YELLOW_when_one_RED_node_and_one_YELLOW_application_node() {
Set<NodeHealth> nodeHealths = nodeHealths(RED, YELLOW).collect(toSet());
Health check = underTest.check(nodeHealths);
assertThat(check).forInput(nodeHealths).hasStatus(Health.Status.YELLOW).andCauses("At least one application node is RED", "At least one application node is YELLOW");
}
Aggregations