Search in sources :

Example 1 with GarbageCollectorChecker

use of fish.payara.nucleus.healthcheck.configuration.GarbageCollectorChecker in project Payara by payara.

the class SetHealthCheckServiceConfigurationTest method thresholdWarningAffectsConfigButNotService.

@Test
public void thresholdWarningAffectsConfigButNotService() {
    CommandResult result = asadmin("set-healthcheck-service-configuration", "--service", "gc", "--enabled", "true", "--threshold-warning", "99");
    assertSuccess(result);
    GarbageCollectorChecker gcConfig = config.getCheckerByType(garbageCollection.getCheckerType());
    assertEquals(99, Integer.parseInt(gcConfig.getProperty(HealthCheckConstants.THRESHOLD_WARNING).getValue()));
    GarbageCollectorHealthCheck activeService = (GarbageCollectorHealthCheck) service.getCheck(gcConfig.getName());
    assertNotEquals(99, activeService.getOptions().getThresholdWarning());
}
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)

Example 2 with GarbageCollectorChecker

use of fish.payara.nucleus.healthcheck.configuration.GarbageCollectorChecker in project Payara by payara.

the class SetHealthCheckServiceConfigurationTest method thresholdGoodAffectsConfigButNotService.

@Test
public void thresholdGoodAffectsConfigButNotService() {
    CommandResult result = asadmin("set-healthcheck-service-configuration", "--service", "gc", "--enabled", "true", "--threshold-good", "33");
    assertSuccess(result);
    GarbageCollectorChecker gcConfig = config.getCheckerByType(garbageCollection.getCheckerType());
    assertEquals(33, Integer.parseInt(gcConfig.getProperty(HealthCheckConstants.THRESHOLD_GOOD).getValue()));
    GarbageCollectorHealthCheck activeService = (GarbageCollectorHealthCheck) service.getCheck(gcConfig.getName());
    assertNotEquals(33, activeService.getOptions().getThresholdGood());
}
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)

Example 3 with GarbageCollectorChecker

use of fish.payara.nucleus.healthcheck.configuration.GarbageCollectorChecker in project Payara by payara.

the class SetHealthCheckServiceConfigurationTest method thresholdWarningDynamicAffectsConfigAndService.

@Test
public void thresholdWarningDynamicAffectsConfigAndService() {
    ensureHealthChecksAreEnabled();
    CommandResult result = asadmin("set-healthcheck-service-configuration", "--service", "gc", "--enabled", "true", "--threshold-warning", "88", "--dynamic", "true");
    assertSuccess(result);
    GarbageCollectorChecker gcConfig = config.getCheckerByType(garbageCollection.getCheckerType());
    assertEquals(88, Integer.parseInt(gcConfig.getProperty(HealthCheckConstants.THRESHOLD_WARNING).getValue()));
    GarbageCollectorHealthCheck activeService = (GarbageCollectorHealthCheck) service.getCheck(gcConfig.getName());
    assertEquals(88, activeService.getOptions().getThresholdWarning());
}
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)

Example 4 with GarbageCollectorChecker

use of fish.payara.nucleus.healthcheck.configuration.GarbageCollectorChecker in project Payara by payara.

the class SetHealthCheckServiceConfigurationTest method thresholdCriticalAffectsConfigButNotService.

@Test
public void thresholdCriticalAffectsConfigButNotService() {
    CommandResult result = asadmin("set-healthcheck-service-configuration", "--service", "gc", "--enabled", "true", "--threshold-critical", "99");
    assertSuccess(result);
    GarbageCollectorChecker gcConfig = config.getCheckerByType(garbageCollection.getCheckerType());
    assertEquals(99, Integer.parseInt(gcConfig.getProperty(HealthCheckConstants.THRESHOLD_CRITICAL).getValue()));
    GarbageCollectorHealthCheck activeService = (GarbageCollectorHealthCheck) service.getCheck(gcConfig.getName());
    assertNotEquals(99, 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)

Example 5 with GarbageCollectorChecker

use of fish.payara.nucleus.healthcheck.configuration.GarbageCollectorChecker in project Payara by payara.

the class SetHealthCheckServiceConfigurationTest method thresholdGoodDynamicAffectsConfigAndService.

@Test
public void thresholdGoodDynamicAffectsConfigAndService() {
    ensureHealthChecksAreEnabled();
    CommandResult result = asadmin("set-healthcheck-service-configuration", "--service", "gc", "--enabled", "true", "--threshold-good", "22", "--dynamic", "true");
    assertSuccess(result);
    GarbageCollectorChecker gcConfig = config.getCheckerByType(garbageCollection.getCheckerType());
    assertEquals(22, Integer.parseInt(gcConfig.getProperty(HealthCheckConstants.THRESHOLD_GOOD).getValue()));
    GarbageCollectorHealthCheck activeService = (GarbageCollectorHealthCheck) service.getCheck(gcConfig.getName());
    assertEquals(22, activeService.getOptions().getThresholdGood());
}
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