use of org.glassfish.embeddable.CommandResult in project Payara by payara.
the class SetHealthCheckServiceConfigurationTest method enabledDynamicAffectsConfigAndService.
@Test
public void enabledDynamicAffectsConfigAndService() {
ensureHealthChecksAreEnabled();
CommandResult result = asadmin("set-healthcheck-service-configuration", "--service", "gc", "--enabled", "true", "--dynamic", "true");
assertSuccess(result);
Checker gcConfig = config.getCheckerByType(garbageCollection.getCheckerType());
BaseHealthCheck<?, ?> check = service.getCheck(gcConfig.getName());
assertNotNull(check);
assertTrue(check.getOptions().isEnabled());
result = asadmin("set-healthcheck-service-configuration", "--service", "gc", "--enabled", "false", "--dynamic", "true");
assertFalse(check.getOptions().isEnabled());
}
use of org.glassfish.embeddable.CommandResult in project Payara by payara.
the class SetHealthCheckServiceConfigurationTest method timeUnitUnknownNameCausesError.
@Test
public void timeUnitUnknownNameCausesError() {
CommandResult result = asadmin("set-healthcheck-service-configuration", "--service", "gc", "--enabled", "true", "--time-unit", "YEARS");
assertUnacceptableParameter("time-unit", result);
assertContains("DAYS,HOURS,MICROSECONDS,MILLISECONDS,MINUTES,NANOSECONDS,SECONDS", result.getOutput());
}
use of org.glassfish.embeddable.CommandResult in project Payara by payara.
the class SetHealthCheckServiceConfigurationTest method hogginThreadsRetryCountAffectsConfigButNotService.
@Test
public void hogginThreadsRetryCountAffectsConfigButNotService() {
CommandResult result = asadmin("set-healthcheck-service-configuration", "--service", "ht", "--enabled", "true", "--hogging-threads-retry-count", "13");
assertSuccess(result);
HoggingThreadsChecker htConfig = config.getCheckerByType(hoggingThreads.getCheckerType());
assertEquals(13, Integer.parseInt(htConfig.getRetryCount()));
HoggingThreadsHealthCheck checkTask = (HoggingThreadsHealthCheck) service.getCheck(htConfig.getName());
assertNotEquals(13, checkTask.getOptions().getRetryCount());
}
use of org.glassfish.embeddable.CommandResult in project Payara by payara.
the class SetHealthCheckServiceConfigurationTest method timeUnitAffectsConfigButNotService.
@Test
public void timeUnitAffectsConfigButNotService() {
CommandResult result = asadmin("set-healthcheck-service-configuration", "--service", "gc", "--enabled", "true", "--time-unit", TimeUnit.DAYS.name());
assertSuccess(result);
Checker gcConfig = config.getCheckerByType(garbageCollection.getCheckerType());
assertEquals(TimeUnit.DAYS.name(), gcConfig.getUnit());
assertNotEquals(TimeUnit.DAYS, service.getCheck(gcConfig.getName()).getOptions().getUnit());
}
use of org.glassfish.embeddable.CommandResult in project Payara by payara.
the class SetHealthCheckServiceConfigurationTest method stuckThreadsThresholdUnitUnknownValueCausesError.
@Test
public void stuckThreadsThresholdUnitUnknownValueCausesError() {
CommandResult result = asadmin("set-healthcheck-service-configuration", "--service", "st", "--enabled", "true", "--stuck-threads-threshold-unit", "YEARS");
assertUnacceptableParameter("stuck-threads-threshold-unit", result);
}
Aggregations