use of org.glassfish.embeddable.CommandResult in project Payara by payara.
the class SetHealthCheckConfigurationTest method historicalTraceStoreSizeBelowMinimumCausesError.
@Test
public void historicalTraceStoreSizeBelowMinimumCausesError() {
CommandResult result = asadmin("set-healthcheck-configuration", "--enabled", "true", "--historical-trace-store-size", "0");
assertUnacceptableParameter("historicalTraceStoreSize", result);
assertTrue(result.getOutput().contains("Store size must be greater than 0"));
}
use of org.glassfish.embeddable.CommandResult in project Payara by payara.
the class SetHealthCheckConfigurationTest method historicalTraceStoreTimeoutDynamicAffectsConfigAndService.
@Test
public void historicalTraceStoreTimeoutDynamicAffectsConfigAndService() {
CommandResult result = asadmin("set-healthcheck-configuration", "--enabled", "true", "--historical-trace-store-timeout", "42", "--dynamic", "true");
assertSuccess(result);
assertEquals(42, Integer.parseInt(config.getHistoricalTraceStoreTimeout()));
assertEquals(42, getHistoricalTraceStoreTimeout().longValue());
}
use of org.glassfish.embeddable.CommandResult in project Payara by payara.
the class SetHealthCheckConfigurationTest method enabledAffectsConfigButNotService.
@Test
public void enabledAffectsConfigButNotService() {
boolean enabled = service.isEnabled();
asadmin("set-healthcheck-configuration", "--enabled", "false");
assertFalse(config.getEnabled());
CommandResult result = asadmin("set-healthcheck-configuration", "--enabled", "true");
assertSuccess(result);
assertTrue(config.getEnabled());
assertUnchanged(enabled, service.isEnabled());
result = asadmin("set-healthcheck-configuration", "--enabled", "false");
assertSuccess(result);
assertFalse(config.getEnabled());
assertUnchanged(enabled, service.isEnabled());
}
use of org.glassfish.embeddable.CommandResult in project Payara by payara.
the class SetHealthCheckServiceConfigurationTest method hogginThreadsRetryCountDynamicAffectsConfigAndService.
@Test
public void hogginThreadsRetryCountDynamicAffectsConfigAndService() {
ensureHealthChecksAreEnabled();
CommandResult result = asadmin("set-healthcheck-service-configuration", "--service", "ht", "--enabled", "true", "--hogging-threads-retry-count", "24", "--dynamic", "true");
assertSuccess(result);
HoggingThreadsChecker htConfig = config.getCheckerByType(hoggingThreads.getCheckerType());
assertEquals(24, Integer.parseInt(htConfig.getRetryCount()));
HoggingThreadsHealthCheck checkTask = (HoggingThreadsHealthCheck) service.getCheck(htConfig.getName());
assertEquals(24, checkTask.getOptions().getRetryCount());
}
use of org.glassfish.embeddable.CommandResult in project Payara by payara.
the class SetHealthCheckServiceConfigurationTest method stuckThreadsThresholdAffectsConfigButNotError.
@Test
public void stuckThreadsThresholdAffectsConfigButNotError() {
CommandResult result = asadmin("set-healthcheck-service-configuration", "--service", "st", "--enabled", "true", "--stuck-threads-threshold", "13");
assertSuccess(result);
StuckThreadsChecker stConfig = config.getCheckerByType(stuckThreads.getCheckerType());
assertEquals(13, Integer.parseInt(stConfig.getThreshold()));
StuckThreadsHealthCheck activeService = (StuckThreadsHealthCheck) service.getCheck(stConfig.getName());
if (activeService != null) {
assertNotEquals(Long.valueOf(13), activeService.getOptions().getTimeStuck());
}
}
Aggregations