use of org.glassfish.embeddable.CommandResult in project Payara by payara.
the class SetHealthCheckServiceConfigurationTest method stuckThreadsThresholdDynamicAffectsConfigAndService.
@Test
public void stuckThreadsThresholdDynamicAffectsConfigAndService() {
ensureHealthChecksAreEnabled();
CommandResult result = asadmin("set-healthcheck-service-configuration", "--service", "st", "--enabled", "true", "--stuck-threads-threshold", "17", "--dynamic", "true");
assertSuccess(result);
StuckThreadsChecker stConfig = config.getCheckerByType(stuckThreads.getCheckerType());
assertEquals(17, Integer.parseInt(stConfig.getThreshold()));
StuckThreadsHealthCheck activeService = (StuckThreadsHealthCheck) service.getCheck(stConfig.getName());
assertEquals(Long.valueOf(17), activeService.getOptions().getTimeStuck());
}
use of org.glassfish.embeddable.CommandResult in project Payara by payara.
the class SetHealthCheckServiceConfigurationTest method timeUnitDynamicAffectsConfigAndService.
@Test
public void timeUnitDynamicAffectsConfigAndService() {
ensureHealthChecksAreEnabled();
CommandResult result = asadmin("set-healthcheck-service-configuration", "--service", "gc", "--enabled", "true", "--time-unit", TimeUnit.HOURS.name(), "--dynamic", "true");
assertSuccess(result);
Checker gcConfig = config.getCheckerByType(garbageCollection.getCheckerType());
assertEquals(TimeUnit.HOURS.name(), gcConfig.getUnit());
assertEquals(TimeUnit.HOURS, service.getCheck(gcConfig.getName()).getOptions().getUnit());
}
use of org.glassfish.embeddable.CommandResult in project Payara by payara.
the class SetHealthCheckServiceConfigurationTest method thresholdWarningDynamicAffectsConfigAndService.
@Test
public void thresholdWarningDynamicAffectsConfigAndService() {
ensureHealthChecksAreEnabled();
CommandResult result = asadmin("set-healthcheck-service-configuration", "--service", "gc", "--enabled", "true", "--threshold-warning", "88", "--dynamic", "true");
assertSuccess(result);
GarbageCollectorChecker gcConfig = config.getCheckerByType(garbageCollection.getCheckerType());
assertEquals(88, Integer.parseInt(gcConfig.getProperty(HealthCheckConstants.THRESHOLD_WARNING).getValue()));
GarbageCollectorHealthCheck activeService = (GarbageCollectorHealthCheck) service.getCheck(gcConfig.getName());
assertEquals(88, activeService.getOptions().getThresholdWarning());
}
use of org.glassfish.embeddable.CommandResult in project Payara by payara.
the class SetHealthCheckNotifierConfigurationTest method enabledDynamicAffectsConfigAndService.
@Test
public void enabledDynamicAffectsConfigAndService() {
ensureHealthChecksAreEnabled();
CommandResult result = asadmin("set-healthcheck-configuration", "--disableNotifiers", "log-notifier", "--enabled", "true", "--dynamic", "true");
assertSuccess(result);
assertFalse(isLogNotifierConfigEnabled.get());
assertFalse(isLogNotifierEnabled.get());
result = asadmin("set-healthcheck-configuration", "--enableNotifiers", "log-notifier", "--enabled", "false", "--dynamic", "true");
assertTrue(isLogNotifierConfigEnabled.get());
assertTrue(isLogNotifierEnabled.get());
}
use of org.glassfish.embeddable.CommandResult in project Payara by payara.
the class SetHealthCheckNotifierConfigurationTest method enabledAffectsConfigButNotService.
@Test
public void enabledAffectsConfigButNotService() {
boolean logEnabled = isLogNotifierEnabled.get();
CommandResult result = asadmin("set-healthcheck-configuration", "--disableNotifiers", "log-notifier", "--enabled", "true");
assertSuccess(result);
assertFalse(isLogNotifierConfigEnabled.get());
assertUnchanged(logEnabled, isLogNotifierEnabled.get());
result = asadmin("set-healthcheck-configuration", "--enableNotifiers", "log-notifier", "--enabled", "false");
assertTrue(isLogNotifierConfigEnabled.get());
assertUnchanged(logEnabled, isLogNotifierEnabled.get());
}
Aggregations