use of org.glassfish.embeddable.CommandResult in project Payara by payara.
the class SetHealthCheckServiceConfigurationTest method stuckThreadsThresholdUnitAffectsConfigButNotService.
@Test
public void stuckThreadsThresholdUnitAffectsConfigButNotService() {
CommandResult result = asadmin("set-healthcheck-service-configuration", "--service", "st", "--enabled", "true", "--stuck-threads-threshold-unit", TimeUnit.DAYS.name());
assertSuccess(result);
StuckThreadsChecker stConfig = config.getCheckerByType(stuckThreads.getCheckerType());
assertEquals(TimeUnit.DAYS.name(), stConfig.getThresholdTimeUnit());
StuckThreadsHealthCheck activeService = (StuckThreadsHealthCheck) service.getCheck(stConfig.getName());
if (activeService != null) {
assertNotEquals(TimeUnit.DAYS, activeService.getOptions().getUnitStuck());
}
}
use of org.glassfish.embeddable.CommandResult in project Payara by payara.
the class SetHealthCheckServiceConfigurationTest method stuckThreadsThresholdUnitDynamicAffectsConfigButNotService.
@Test
public void stuckThreadsThresholdUnitDynamicAffectsConfigButNotService() {
ensureHealthChecksAreEnabled();
CommandResult result = asadmin("set-healthcheck-service-configuration", "--service", "st", "--enabled", "true", "--stuck-threads-threshold-unit", TimeUnit.HOURS.name(), "--dynamic", "true");
assertSuccess(result);
StuckThreadsChecker stConfig = config.getCheckerByType(stuckThreads.getCheckerType());
assertEquals(TimeUnit.HOURS.name(), stConfig.getThresholdTimeUnit());
StuckThreadsHealthCheck activeService = (StuckThreadsHealthCheck) service.getCheck(stConfig.getName());
assertEquals(TimeUnit.HOURS, activeService.getOptions().getUnitStuck());
}
use of org.glassfish.embeddable.CommandResult in project Payara by payara.
the class SetHealthCheckServiceConfigurationTest method enabledAffectsConfigButNotService.
@Test
public void enabledAffectsConfigButNotService() {
CommandResult result = asadmin("set-healthcheck-service-configuration", "--service", "gc", "--enabled", "true");
assertSuccess(result);
Checker gcConfig = config.getCheckerByType(garbageCollection.getCheckerType());
assertTrue(gcConfig.getEnabled());
result = asadmin("set-healthcheck-service-configuration", "--service", "gc", "--enabled", "false");
assertFalse(gcConfig.getEnabled());
}
use of org.glassfish.embeddable.CommandResult in project Payara by payara.
the class SetHealthCheckServiceConfigurationTest method thresholdWarningAffectsConfigButNotService.
@Test
public void thresholdWarningAffectsConfigButNotService() {
CommandResult result = asadmin("set-healthcheck-service-configuration", "--service", "gc", "--enabled", "true", "--threshold-warning", "99");
assertSuccess(result);
GarbageCollectorChecker gcConfig = config.getCheckerByType(garbageCollection.getCheckerType());
assertEquals(99, Integer.parseInt(gcConfig.getProperty(HealthCheckConstants.THRESHOLD_WARNING).getValue()));
GarbageCollectorHealthCheck activeService = (GarbageCollectorHealthCheck) service.getCheck(gcConfig.getName());
assertNotEquals(99, activeService.getOptions().getThresholdWarning());
}
use of org.glassfish.embeddable.CommandResult in project Payara by payara.
the class SetHealthCheckServiceConfigurationTest method thresholdWarningAboveMaximumCausesError.
@Test
public void thresholdWarningAboveMaximumCausesError() {
CommandResult result = asadmin("set-healthcheck-service-configuration", "--service", "gc", "--enabled", "true", "--threshold-warning", "101");
assertUnacceptableParameter("thresholdWarning", result);
assertContains("Wanring threshold is a percentage so must be less than 100", result.getOutput());
}
Aggregations