Add support for smoke test - clean start - standalone mode

This commit is contained in:
Vlasta Ramik 2016-05-17 13:46:48 +02:00
parent 92db7b3618
commit ef716b8b94
5 changed files with 116 additions and 3 deletions

View file

@ -183,7 +183,7 @@ public class AuthServerTestEnricher {
}
public void checkServerLogs(@Observes(precedence = -1) BeforeSuite event) throws IOException, InterruptedException {
boolean checkLog = System.getProperty("auth.server.log.check", "true").equals("true");
boolean checkLog = Boolean.parseBoolean(System.getProperty("auth.server.log.check", "true"));
if (checkLog && suiteContext.getAuthServerInfo().isJBossBased()) {
String jbossHomePath = suiteContext.getAuthServerInfo().getProperties().get("jbossHome");
LogChecker.checkJBossServerLog(jbossHomePath);

View file

@ -59,7 +59,7 @@
<property name="enabled">${auth.server.jboss}</property>
<property name="adapterImplClass">org.jboss.as.arquillian.container.managed.ManagedDeployableContainer</property>
<property name="jbossHome">${auth.server.home}</property>
<property name="serverConfig">standalone.xml</property>
<property name="serverConfig">${auth.server.config}</property>
<property name="jbossArguments">
-Djboss.socket.binding.port-offset=${auth.server.port.offset}
-Djboss.bind.address=0.0.0.0

View file

@ -0,0 +1,69 @@
<?xml version="1.0"?>
<!--
~ Copyright 2016 Red Hat, Inc. and/or its affiliates
~ and other contributors as indicated by the @author tags.
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.keycloak.testsuite</groupId>
<artifactId>integration-arquillian-tests-other</artifactId>
<version>2.0.0.CR1-SNAPSHOT</version>
</parent>
<artifactId>integration-arquillian-tests-smoke-clean-start</artifactId>
<name>Clean Start Tests</name>
<build>
<plugins>
<plugin>
<artifactId>maven-enforcer-plugin</artifactId>
<executions>
<execution>
<id>enforce-auth-server</id>
<phase>generate-test-resources</phase>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<requireProperty>
<property>auth.server</property>
<regex>(wildfly)|(eap)</regex>
<regexMessage>Tests require activation of profile "auth-server-wildfly" or "auth-server-eap".</regexMessage>
</requireProperty>
</rules>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>standalone</id>
</profile>
<profile>
<id>standalone-ha</id>
<properties>
<auth.server.config>standalone-ha.xml</auth.server.config>
</properties>
</profile>
</profiles>
</project>

View file

@ -0,0 +1,42 @@
/*
* Copyright 2016 Red Hat, Inc. and/or its affiliates
* and other contributors as indicated by the @author tags.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.keycloak.testsuite.clean.start;
import org.jboss.arquillian.container.test.api.RunAsClient;
import org.jboss.arquillian.junit.Arquillian;
import static org.junit.Assert.assertTrue;
import org.junit.Test;
import org.junit.runner.RunWith;
/**
* @author <a href="mailto:vramik@redhat.com">Vlastislav Ramik</a>
*/
@RunWith(Arquillian.class)
@RunAsClient
public class CleanStartTest {
@Test
public void cleanStartTest() {
//empty test - container is started via arquillian and logs are checked
//by org.keycloak.testsuite.arquillian.AuthServerTestEnricher#checkServerLogs
//verify that checkServerLogs is not skipped
assertTrue("checkServerLogs is skipped.", Boolean.parseBoolean(System.getProperty("auth.server.log.check", "true")));
}
}

View file

@ -155,6 +155,7 @@
<auth.server.ssl.required>${auth.server.ssl.required}</auth.server.ssl.required>
<auth.server.jboss.startup.timeout>${auth.server.jboss.startup.timeout}</auth.server.jboss.startup.timeout>
<auth.server.config.dir>${auth.server.config.dir}</auth.server.config.dir>
<auth.server.config>${auth.server.config}</auth.server.config>
<frontend.console.output>${frontend.console.output}</frontend.console.output>
<backends.console.output>${backend.console.output}</backends.console.output>
@ -194,7 +195,6 @@
<dependency>
<groupId>org.wildfly</groupId>
<artifactId>wildfly-arquillian-container-remote</artifactId>
<version>${arquillian-wildfly-container.version}</version>
</dependency>
</dependencies>
</profile>
@ -205,6 +205,7 @@
<auth.server>wildfly</auth.server>
<auth.server.jboss>true</auth.server.jboss>
<auth.server.undertow>false</auth.server.undertow>
<auth.server.config>standalone.xml</auth.server.config>
<auth.server.config.dir>${auth.server.home}/standalone/configuration</auth.server.config.dir>
<h2.version>1.3.173</h2.version>
</properties>
@ -222,6 +223,7 @@
<auth.server>eap</auth.server>
<auth.server.jboss>true</auth.server.jboss>
<auth.server.undertow>false</auth.server.undertow>
<auth.server.config>standalone.xml</auth.server.config>
<auth.server.config.dir>${auth.server.home}/standalone/configuration</auth.server.config.dir>
<h2.version>1.3.173</h2.version>
</properties>