use of org.glassfish.embeddable.CommandResult in project Payara by payara.
the class SetHealthCheckServiceConfigurationTest method thresholdWarningBelowMinimumCausesError.
@Test
public void thresholdWarningBelowMinimumCausesError() {
CommandResult result = asadmin("set-healthcheck-service-configuration", "--service", "gc", "--enabled", "true", "--threshold-warning", "-1");
assertUnacceptableParameter("thresholdWarning", result);
assertContains("Warning threshold is a percentage so must be greater than zero", result.getOutput());
}
use of org.glassfish.embeddable.CommandResult in project Payara by payara.
the class SetHealthCheckServiceConfigurationTest method timeDynamicAffectsConfigAndService.
@Test
public void timeDynamicAffectsConfigAndService() {
ensureHealthChecksAreEnabled();
CommandResult result = asadmin("set-healthcheck-service-configuration", "--service", "gc", "--enabled", "true", "--time", "42", "--dynamic", "true");
assertSuccess(result);
Checker gcConfig = config.getCheckerByType(garbageCollection.getCheckerType());
assertEquals(42L, Long.parseLong(gcConfig.getTime()));
assertEquals(42L, service.getCheck(gcConfig.getName()).getOptions().getTime());
}
use of org.glassfish.embeddable.CommandResult in project Payara by payara.
the class SetHealthCheckServiceConfigurationTest method stuckThreadsThresholdBelowMinumumCausesError.
@Test
public void stuckThreadsThresholdBelowMinumumCausesError() {
CommandResult result = asadmin("set-healthcheck-service-configuration", "--service", "st", "--enabled", "true", "--stuck-threads-threshold", "0");
assertUnacceptableParameter("stuckThreadsThreshold", result);
}
use of org.glassfish.embeddable.CommandResult in project Payara by payara.
the class SetHealthCheckServiceConfigurationTest method thresholdCriticalBelowMinimumCausesError.
@Test
public void thresholdCriticalBelowMinimumCausesError() {
CommandResult result = asadmin("set-healthcheck-service-configuration", "--service", "gc", "--enabled", "true", "--threshold-critical", "-1");
assertUnacceptableParameter("thresholdCritical", result);
assertContains("Critical threshold is a percentage so must be greater than zero", result.getOutput());
}
use of org.glassfish.embeddable.CommandResult 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());
}
Aggregations