Search in sources :

Example 6 with GarbageCollectorHealthCheck

use of fish.payara.nucleus.healthcheck.preliminary.GarbageCollectorHealthCheck in project Payara by payara.

the class SetHealthCheckServiceConfigurationTest method thresholdCriticalDynamicAffectsConfigAndService.

@Test
public void thresholdCriticalDynamicAffectsConfigAndService() {
    ensureHealthChecksAreEnabled();
    CommandResult result = asadmin("set-healthcheck-service-configuration", "--service", "gc", "--enabled", "true", "--threshold-critical", "88", "--dynamic", "true");
    assertSuccess(result);
    GarbageCollectorChecker gcConfig = config.getCheckerByType(garbageCollection.getCheckerType());
    assertEquals(88, Integer.parseInt(gcConfig.getProperty(HealthCheckConstants.THRESHOLD_CRITICAL).getValue()));
    GarbageCollectorHealthCheck activeService = (GarbageCollectorHealthCheck) service.getCheck(gcConfig.getName());
    assertEquals(88, activeService.getOptions().getThresholdCritical());
}
Also used : GarbageCollectorHealthCheck(fish.payara.nucleus.healthcheck.preliminary.GarbageCollectorHealthCheck) GarbageCollectorChecker(fish.payara.nucleus.healthcheck.configuration.GarbageCollectorChecker) CommandResult(org.glassfish.embeddable.CommandResult) Test(org.junit.Test)

Aggregations

GarbageCollectorChecker (fish.payara.nucleus.healthcheck.configuration.GarbageCollectorChecker)6 GarbageCollectorHealthCheck (fish.payara.nucleus.healthcheck.preliminary.GarbageCollectorHealthCheck)6 CommandResult (org.glassfish.embeddable.CommandResult)6 Test (org.junit.Test)6