Search in sources :

Example 6 with Launch

use of io.quarkus.test.junit.main.Launch in project keycloak by keycloak.

the class LoggingDistTest method testKeycloakLogFileCreated.

@Test
@EnabledOnOs(value = { OS.LINUX, OS.MAC }, disabledReason = "different shell escaping behaviour on Windows.")
@Launch({ "start-dev", "--log=console,file" })
void testKeycloakLogFileCreated(RawDistRootPath path) {
    Path logFilePath = Paths.get(path.getDistRootPath() + File.separator + LoggingPropertyMappers.DEFAULT_LOG_PATH);
    File logFile = new File(logFilePath.toString());
    assertTrue(logFile.isFile(), "Log file does not exist!");
}
Also used : RawDistRootPath(org.keycloak.it.utils.RawDistRootPath) Path(java.nio.file.Path) File(java.io.File) EnabledOnOs(org.junit.jupiter.api.condition.EnabledOnOs) DistributionTest(org.keycloak.it.junit5.extension.DistributionTest) Test(org.junit.jupiter.api.Test) Launch(io.quarkus.test.junit.main.Launch)

Example 7 with Launch

use of io.quarkus.test.junit.main.Launch in project keycloak by keycloak.

the class LoggingDistTest method testLogLevelSettingsAppliedWhenJsonEnabled.

@Test
@EnabledOnOs(value = { OS.LINUX, OS.MAC }, disabledReason = "different shell escaping behaviour on Windows.")
@Launch({ "start-dev", "--log-level=off,org.keycloak:debug,org.infinispan:info", "--log-console-output=json" })
void testLogLevelSettingsAppliedWhenJsonEnabled(LaunchResult result) {
    CLIResult cliResult = (CLIResult) result;
    assertFalse(cliResult.getOutput().contains("\"loggerName\":\"io.quarkus\",\"level\":\"INFO\")"));
    assertTrue(cliResult.getOutput().contains("\"loggerName\":\"org.keycloak.quarkus.runtime.storage.database.jpa.QuarkusJpaConnectionProviderFactory\",\"level\":\"DEBUG\""));
    assertTrue(cliResult.getOutput().contains("\"loggerName\":\"org.infinispan.CONTAINER\",\"level\":\"INFO\""));
}
Also used : CLIResult(org.keycloak.it.junit5.extension.CLIResult) EnabledOnOs(org.junit.jupiter.api.condition.EnabledOnOs) DistributionTest(org.keycloak.it.junit5.extension.DistributionTest) Test(org.junit.jupiter.api.Test) Launch(io.quarkus.test.junit.main.Launch)

Example 8 with Launch

use of io.quarkus.test.junit.main.Launch in project keycloak by keycloak.

the class QuarkusPropertiesAutoBuildDistTest method testWrappedBuildPropertyTriggersBuildButGetsIgnoredWhenSetByQuarkus.

@Test
@BeforeStartDistribution(EnableDatasourceMetrics.class)
@Launch({ "start", "--auto-build", "--http-enabled=true", "--hostname-strict=false", "--cache=local" })
@Order(8)
void testWrappedBuildPropertyTriggersBuildButGetsIgnoredWhenSetByQuarkus(LaunchResult result) {
    CLIResult cliResult = (CLIResult) result;
    cliResult.assertBuild();
    when().get("/metrics").then().statusCode(404);
}
Also used : CLIResult(org.keycloak.it.junit5.extension.CLIResult) TestMethodOrder(org.junit.jupiter.api.TestMethodOrder) Order(org.junit.jupiter.api.Order) DistributionTest(org.keycloak.it.junit5.extension.DistributionTest) Test(org.junit.jupiter.api.Test) BeforeStartDistribution(org.keycloak.it.junit5.extension.BeforeStartDistribution) Launch(io.quarkus.test.junit.main.Launch)

Example 9 with Launch

use of io.quarkus.test.junit.main.Launch in project keycloak by keycloak.

the class QuarkusPropertiesDistTest method testIgnoreQuarkusPropertyFromKeycloakConf.

@Test
@BeforeStartDistribution(UpdateConsoleLogLevelToInfoFromKeycloakConf.class)
@Launch({ "build" })
@Order(5)
void testIgnoreQuarkusPropertyFromKeycloakConf(LaunchResult result) {
    CLIResult cliResult = (CLIResult) result;
    assertTrue(cliResult.getOutput().contains("INFO"));
    cliResult.assertBuild();
}
Also used : CLIResult(org.keycloak.it.junit5.extension.CLIResult) TestMethodOrder(org.junit.jupiter.api.TestMethodOrder) Order(org.junit.jupiter.api.Order) DistributionTest(org.keycloak.it.junit5.extension.DistributionTest) Test(org.junit.jupiter.api.Test) BeforeStartDistribution(org.keycloak.it.junit5.extension.BeforeStartDistribution) Launch(io.quarkus.test.junit.main.Launch)

Example 10 with Launch

use of io.quarkus.test.junit.main.Launch in project keycloak by keycloak.

the class QuarkusPropertiesDistTest method testPropertyEnabledAtRuntime.

@Test
@BeforeStartDistribution(QuarkusPropertiesDistTest.UpdateConsoleLogLevelToWarnFromQuarkusProps.class)
@Launch({ "start", "--http-enabled=true", "--hostname-strict=false" })
@Order(2)
void testPropertyEnabledAtRuntime(LaunchResult result) {
    CLIResult cliResult = (CLIResult) result;
    assertFalse(cliResult.getOutput().contains("INFO"));
}
Also used : CLIResult(org.keycloak.it.junit5.extension.CLIResult) TestMethodOrder(org.junit.jupiter.api.TestMethodOrder) Order(org.junit.jupiter.api.Order) DistributionTest(org.keycloak.it.junit5.extension.DistributionTest) Test(org.junit.jupiter.api.Test) BeforeStartDistribution(org.keycloak.it.junit5.extension.BeforeStartDistribution) Launch(io.quarkus.test.junit.main.Launch)

Aggregations

Launch (io.quarkus.test.junit.main.Launch)102 Test (org.junit.jupiter.api.Test)101 CLIResult (org.keycloak.it.junit5.extension.CLIResult)98 DistributionTest (org.keycloak.it.junit5.extension.DistributionTest)70 Order (org.junit.jupiter.api.Order)37 TestMethodOrder (org.junit.jupiter.api.TestMethodOrder)37 CLITest (org.keycloak.it.junit5.extension.CLITest)23 BeforeStartDistribution (org.keycloak.it.junit5.extension.BeforeStartDistribution)19 EnabledOnOs (org.junit.jupiter.api.condition.EnabledOnOs)14 File (java.io.File)3 Path (java.nio.file.Path)3 RawDistRootPath (org.keycloak.it.utils.RawDistRootPath)3 StartCommandTest (org.keycloak.it.cli.StartCommandTest)2 Pattern (java.util.regex.Pattern)1 KeepServerAlive (org.keycloak.it.junit5.extension.KeepServerAlive)1 PostgreSQLTest (org.keycloak.it.storage.database.PostgreSQLTest)1