use of org.glassfish.embeddable.CommandResult in project Payara by payara.
the class SetHealthCheckServiceConfigurationTest method hogginThreadsThresholdAffectsConfigButNotService.
@Test
public void hogginThreadsThresholdAffectsConfigButNotService() {
CommandResult result = asadmin("set-healthcheck-service-configuration", "--service", "ht", "--enabled", "true", "--hogging-threads-threshold", "33");
assertSuccess(result);
HoggingThreadsChecker htConfig = config.getCheckerByType(hoggingThreads.getCheckerType());
assertEquals(33, Integer.parseInt(htConfig.getThresholdPercentage()));
HoggingThreadsHealthCheck checkTask = (HoggingThreadsHealthCheck) service.getCheck(htConfig.getName());
assertNotEquals(Long.valueOf(33), checkTask.getOptions().getThresholdPercentage());
}
use of org.glassfish.embeddable.CommandResult in project Payara by payara.
the class SetHealthCheckServiceConfigurationTest method hogginThreadsThresholdBelowMinumumCausesError.
@Test
public void hogginThreadsThresholdBelowMinumumCausesError() {
CommandResult result = asadmin("set-healthcheck-service-configuration", "--service", "ht", "--enabled", "true", "--hogging-threads-threshold", "-1");
assertUnacceptableParameter("hogginThreadsThreshold", result);
assertContains("Hogging threads 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 thresholdCriticalAboveMaximumCausesError.
@Test
public void thresholdCriticalAboveMaximumCausesError() {
CommandResult result = asadmin("set-healthcheck-service-configuration", "--service", "gc", "--enabled", "true", "--threshold-critical", "101");
assertUnacceptableParameter("thresholdCritical", result);
assertContains("Critical 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 assertServiceNamesAreAccepted.
private void assertServiceNamesAreAccepted(String[] serviceNames) {
for (String serviceName : serviceNames) {
CommandResult result = asadmin("set-healthcheck-service-configuration", "--service", serviceName, "--enabled", "true");
// just check the name got accepted
assertSuccess(result);
}
}
use of org.glassfish.embeddable.CommandResult 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());
}
Aggregations