Search in sources :

Example 16 with CommandResult

use of org.glassfish.embeddable.CommandResult in project Payara by payara.

the class SetHealthCheckConfigurationTest method historicalTraceStoreSizeDynamicAffectsConfigAndService.

@Test
public void historicalTraceStoreSizeDynamicAffectsConfigAndService() {
    CommandResult result = asadmin("set-healthcheck-configuration", "--enabled", "true", "--historical-trace-store-size", "13", "--dynamic", "true");
    assertSuccess(result);
    assertEquals(13, Integer.parseInt(config.getHistoricalTraceStoreSize()));
    assertEquals(13, service.getHistoricalTraceStoreSize().intValue());
}
Also used : CommandResult(org.glassfish.embeddable.CommandResult) Test(org.junit.Test)

Example 17 with CommandResult

use of org.glassfish.embeddable.CommandResult in project Payara by payara.

the class SetHealthCheckConfigurationTest method historicalTraceEnabledDynamicAffectsConfigAndService.

@Test
public void historicalTraceEnabledDynamicAffectsConfigAndService() {
    CommandResult result = asadmin("set-healthcheck-configuration", "--enabled", "true", "--historical-trace-enabled", "true", "--dynamic", "true");
    assertSuccess(result);
    assertTrue(service.isHistoricalTraceEnabled());
    result = asadmin("set-healthcheck-configuration", "--enabled", "true", "--historical-trace-enabled", "false", "--dynamic", "true");
    assertSuccess(result);
    assertFalse(service.isHistoricalTraceEnabled());
}
Also used : CommandResult(org.glassfish.embeddable.CommandResult) Test(org.junit.Test)

Example 18 with CommandResult

use of org.glassfish.embeddable.CommandResult in project Payara by payara.

the class SetHealthCheckConfigurationTest method enabledDynamicAffectsConfigAndService.

@Test
public void enabledDynamicAffectsConfigAndService() {
    CommandResult result = asadmin("set-healthcheck-configuration", "--enabled", "true", "--dynamic", "true");
    assertSuccess(result);
    assertTrue(service.isEnabled());
    result = asadmin("set-healthcheck-configuration", "--enabled", "false", "--dynamic", "true");
    assertSuccess(result);
    assertFalse(service.isEnabled());
}
Also used : CommandResult(org.glassfish.embeddable.CommandResult) Test(org.junit.Test)

Example 19 with CommandResult

use of org.glassfish.embeddable.CommandResult in project Payara by payara.

the class SetHealthCheckConfigurationTest method historicalTraceStoreSizeAffectsConfigButNotService.

@Test
public void historicalTraceStoreSizeAffectsConfigButNotService() {
    Integer historicalTraceStoreSize = service.getHistoricalTraceStoreSize();
    CommandResult result = asadmin("set-healthcheck-configuration", "--enabled", "true", "--historical-trace-store-size", "13");
    assertSuccess(result);
    assertEquals(13, Integer.parseInt(config.getHistoricalTraceStoreSize()));
    assertEquals(historicalTraceStoreSize, service.getHistoricalTraceStoreSize());
}
Also used : CommandResult(org.glassfish.embeddable.CommandResult) Test(org.junit.Test)

Example 20 with CommandResult

use of org.glassfish.embeddable.CommandResult in project Payara by payara.

the class SetHealthCheckServiceConfigurationTest method hogginThreadsThresholdDynamicAffectsConfigAndService.

@Test
public void hogginThreadsThresholdDynamicAffectsConfigAndService() {
    ensureHealthChecksAreEnabled();
    CommandResult result = asadmin("set-healthcheck-service-configuration", "--service", "ht", "--enabled", "true", "--hogging-threads-threshold", "42", "--dynamic", "true");
    assertSuccess(result);
    HoggingThreadsChecker htConfig = config.getCheckerByType(hoggingThreads.getCheckerType());
    assertEquals(42, Integer.parseInt(htConfig.getThresholdPercentage()));
    HoggingThreadsHealthCheck checkTask = (HoggingThreadsHealthCheck) service.getCheck(htConfig.getName());
    assertEquals(Long.valueOf(42), checkTask.getOptions().getThresholdPercentage());
}
Also used : HoggingThreadsChecker(fish.payara.nucleus.healthcheck.configuration.HoggingThreadsChecker) HoggingThreadsHealthCheck(fish.payara.nucleus.healthcheck.preliminary.HoggingThreadsHealthCheck) CommandResult(org.glassfish.embeddable.CommandResult) Test(org.junit.Test)

Aggregations

CommandResult (org.glassfish.embeddable.CommandResult)85 Test (org.junit.Test)72 CommandRunner (org.glassfish.embeddable.CommandRunner)26 File (java.io.File)21 Deployer (org.glassfish.embeddable.Deployer)21 GlassFish (org.glassfish.embeddable.GlassFish)17 GlassFishProperties (org.glassfish.embeddable.GlassFishProperties)17 PrintStream (java.io.PrintStream)16 GarbageCollectorChecker (fish.payara.nucleus.healthcheck.configuration.GarbageCollectorChecker)12 HoggingThreadsChecker (fish.payara.nucleus.healthcheck.configuration.HoggingThreadsChecker)10 StuckThreadsChecker (fish.payara.nucleus.healthcheck.configuration.StuckThreadsChecker)10 JarFile (java.util.jar.JarFile)9 Checker (fish.payara.nucleus.healthcheck.configuration.Checker)6 GarbageCollectorHealthCheck (fish.payara.nucleus.healthcheck.preliminary.GarbageCollectorHealthCheck)6 HoggingThreadsHealthCheck (fish.payara.nucleus.healthcheck.preliminary.HoggingThreadsHealthCheck)4 StuckThreadsHealthCheck (fish.payara.nucleus.healthcheck.stuck.StuckThreadsHealthCheck)4 IOException (java.io.IOException)4 ArrayList (java.util.ArrayList)2 ServiceLocator (org.glassfish.hk2.api.ServiceLocator)2 ExecException (com.sun.enterprise.util.ExecException)1