Search in sources :

Example 81 with CommandResult

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

the class SetHealthCheckServiceConfigurationTest method thresholdGoodBelowMinimumCausesError.

@Test
public void thresholdGoodBelowMinimumCausesError() {
    CommandResult result = asadmin("set-healthcheck-service-configuration", "--service", "gc", "--enabled", "true", "--threshold-good", "-1");
    assertUnacceptableParameter("thresholdGood", result);
    assertContains("Good threshold is a percentage so must be greater than zero", result.getOutput());
}
Also used : CommandResult(org.glassfish.embeddable.CommandResult) Test(org.junit.Test)

Example 82 with CommandResult

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

the class SetHealthCheckServiceConfigurationTest method thresholdCriticalDynamicAffectsConfigAndService.

@Test
public void thresholdCriticalDynamicAffectsConfigAndService() {
    ensureHealthChecksAreEnabled();
    CommandResult result = asadmin("set-healthcheck-service-configuration", "--service", "gc", "--enabled", "true", "--threshold-critical", "88", "--dynamic", "true");
    assertSuccess(result);
    GarbageCollectorChecker gcConfig = config.getCheckerByType(garbageCollection.getCheckerType());
    assertEquals(88, Integer.parseInt(gcConfig.getProperty(HealthCheckConstants.THRESHOLD_CRITICAL).getValue()));
    GarbageCollectorHealthCheck activeService = (GarbageCollectorHealthCheck) service.getCheck(gcConfig.getName());
    assertEquals(88, activeService.getOptions().getThresholdCritical());
}
Also used : GarbageCollectorHealthCheck(fish.payara.nucleus.healthcheck.preliminary.GarbageCollectorHealthCheck) GarbageCollectorChecker(fish.payara.nucleus.healthcheck.configuration.GarbageCollectorChecker) CommandResult(org.glassfish.embeddable.CommandResult) Test(org.junit.Test)

Example 83 with CommandResult

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

the class SetHazelcastConfigurationTest method autoIncrementPort.

@Test
public void autoIncrementPort() {
    CommandResult result = asadmin("set-hazelcast-configuration", "--autoIncrementPort", "true");
    assertSuccess(result);
    assertTrue(config.getAutoIncrementPort());
    result = asadmin("set-hazelcast-configuration", "--autoIncrementPort", "false");
    assertSuccess(result);
    assertFalse(config.getAutoIncrementPort());
}
Also used : CommandResult(org.glassfish.embeddable.CommandResult) Test(org.junit.Test)

Example 84 with CommandResult

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

the class SetHazelcastConfigurationTest method dataGridEncryptionWarning.

@Test
public void dataGridEncryptionWarning() {
    CommandResult result = asadmin("set-hazelcast-configuration", "--encryptdatagrid", "true");
    assertWarning(result);
    assertContains("Could not find datagrid-key", result.getOutput());
    result = asadmin("set-hazelcast-configuration", "--encryptdatagrid", "false");
    assertSuccess(result);
}
Also used : CommandResult(org.glassfish.embeddable.CommandResult) Test(org.junit.Test)

Example 85 with CommandResult

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

the class SetHealthCheckNotifierConfigurationTest method notifierNamesAreAccepted.

@Test
public void notifierNamesAreAccepted() {
    final String[] names;
    if (ServerOperations.isServer()) {
        names = new String[] { "log-notifier", "jms-notifier", "cdieventbus-notifier", "eventbus-notifier" };
    } else {
        names = new String[] { "log-notifier", "cdieventbus-notifier", "eventbus-notifier" };
    }
    for (String notiferName : names) {
        CommandResult result = asadmin("set-healthcheck-configuration", "--enableNotifiers", notiferName, "--enabled", "true");
        // just check the name got accepted
        assertSuccess(result);
    }
}
Also used : 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