use of org.glassfish.embeddable.CommandResult 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());
}
use of org.glassfish.embeddable.CommandResult in project Payara by payara.
the class SetHealthCheckServiceConfigurationTest method timeAffectsConfigButNotService.
@Test
public void timeAffectsConfigButNotService() {
CommandResult result = asadmin("set-healthcheck-service-configuration", "--service", "gc", "--enabled", "true", "--time", "33");
assertSuccess(result);
Checker gcConfig = config.getCheckerByType(garbageCollection.getCheckerType());
assertEquals(33L, Long.parseLong(gcConfig.getTime()));
assertNotEquals(33L, service.getCheck(gcConfig.getName()).getOptions().getTime());
}
use of org.glassfish.embeddable.CommandResult in project Payara by payara.
the class SetHealthCheckServiceConfigurationTest method thresholdGoodAboveMaximumCausesError.
@Test
public void thresholdGoodAboveMaximumCausesError() {
CommandResult result = asadmin("set-healthcheck-service-configuration", "--service", "gc", "--enabled", "true", "--threshold-good", "101");
assertUnacceptableParameter("thresholdGood", result);
assertContains("Good threshold is a percentage so must be less than 100", result.getOutput());
}
use of org.glassfish.embeddable.CommandResult in project Payara by payara.
the class SetHealthCheckServiceConfigurationTest method hogginThreadsRetryCountBelowMinimumCausesError.
@Test
public void hogginThreadsRetryCountBelowMinimumCausesError() {
CommandResult result = asadmin("set-healthcheck-service-configuration", "--service", "ht", "--enabled", "true", "--hogging-threads-retry-count", "-1");
assertUnacceptableParameter("hogginThreadsRetryCount", result);
assertContains("Hogging threads retry count must be zero or more", result.getOutput());
}
use of org.glassfish.embeddable.CommandResult in project Payara by payara.
the class SetHealthCheckServiceConfigurationTest method hogginThreadsThresholdAboveMaximumCausesError.
@Test
public void hogginThreadsThresholdAboveMaximumCausesError() {
CommandResult result = asadmin("set-healthcheck-service-configuration", "--service", "ht", "--enabled", "true", "--hogging-threads-threshold", "101");
assertUnacceptableParameter("hogginThreadsThreshold", result);
assertContains("Hogging threads threshold is a percentage so must be less than 100", result.getOutput());
}
Aggregations