KEYCLOAK-7473 app-server-eap provider

This commit is contained in:
vramik 2018-05-31 10:44:40 +02:00 committed by Pavel Drozd
parent bb5dc4c473
commit a5c0cbc3b4
56 changed files with 416 additions and 695 deletions

View file

@ -26,8 +26,8 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>integration-arquillian-servers-app-server-eap</artifactId> <artifactId>integration-arquillian-servers-app-server-eap</artifactId>
<packaging>pom</packaging> <packaging>jar</packaging>
<name>App Server - JBoss - EAP</name> <name>App Server - EAP</name>
<properties> <properties>
<app.server.jboss>eap</app.server.jboss> <app.server.jboss>eap</app.server.jboss>
@ -43,4 +43,15 @@
<skip.elytron.adapter.installation>false</skip.elytron.adapter.installation> <skip.elytron.adapter.installation>false</skip.elytron.adapter.installation>
</properties> </properties>
<dependencies>
<dependency>
<groupId>org.keycloak.testsuite</groupId>
<artifactId>integration-arquillian-servers-app-server-spi</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.wildfly.arquillian</groupId>
<artifactId>wildfly-arquillian-container-managed</artifactId>
</dependency>
</dependencies>
</project> </project>

View file

@ -0,0 +1,160 @@
/*
* Copyright 2018 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.arquillian.eap.container;
import java.util.ArrayList;
import java.util.List;
import org.jboss.arquillian.core.spi.Validate;
import org.jboss.as.arquillian.container.managed.ManagedDeployableContainer;
import org.jboss.shrinkwrap.descriptor.spi.node.Node;
import org.keycloak.testsuite.arquillian.container.AppServerContainerSPI;
/**
* @author <a href="mailto:vramik@redhat.com">Vlasta Ramik</a>
*/
public class EAPAppServerProvider implements AppServerContainerSPI {
private Node configuration;
private static final String containerName = "eap";
private final String appServerHome;
private final String appServerJavaHome;
private final String appServerPortOffset;
private final String managementProtocol;
private final String managementPort;
private final String startupTimeoutInSeconds;
public EAPAppServerProvider() {
appServerHome = System.getProperty("app.server.home");
appServerJavaHome = System.getProperty("app.server.java.home");
appServerPortOffset = System.getProperty("app.server.port.offset");
managementProtocol = System.getProperty("app.server.management.protocol");
managementPort = System.getProperty("app.server.management.port");
startupTimeoutInSeconds = System.getProperty("app.server.startup.timeout");
Validate.notNullOrEmpty(appServerHome, "app.server.home is not set.");
Validate.notNullOrEmpty(appServerJavaHome, "app.server.java.home is not set.");
Validate.notNullOrEmpty(appServerPortOffset, "app.server.port.offset is not set.");
Validate.notNullOrEmpty(managementProtocol, "app.server.management.protocol is not set.");
Validate.notNullOrEmpty(managementPort, "app.server.management.port is not set.");
Validate.notNullOrEmpty(startupTimeoutInSeconds, "app.server.startup.timeout is not set.");
}
@Override
public String getName() {
return containerName;
}
@Override
public List<Node> getContainers() {
List<Node> containers = new ArrayList<>();
containers.add(standaloneContainer());
containers.add(clusterGroup());
return containers;
}
private void createChild(String name, String text) {
configuration.createChild("property").attribute("name", name).text(text);
}
private Node standaloneContainer() {
Node container = new Node("container");
container.attribute("mode", "manual");
container.attribute("qualifier", AppServerContainerSPI.APP_SERVER + "-" + containerName);
configuration = container.createChild("configuration");
createChild("enabled", "true");
createChild("adapterImplClass", ManagedDeployableContainer.class.getName());
createChild("jbossHome", appServerHome);
createChild("javaHome", appServerJavaHome);
createChild("jbossArguments",
"-Djboss.socket.binding.port-offset=" + appServerPortOffset + " " +
System.getProperty("adapter.test.props", "")
);
createChild("javaVmArguments",
System.getProperty("app.server.jboss.jvm.debug.args", "") + " " +
System.getProperty("app.server.memory.settings", "") + " " +
"-Djava.net.preferIPv4Stack=true"
);
createChild("managementProtocol", managementProtocol);
createChild("managementPort", managementPort);
createChild("startupTimeoutInSeconds", startupTimeoutInSeconds);
return container;
}
private Node clusterGroup() {
Node group = new Node("group");
group.attribute("qualifier", "app-server-eap-clustered");
addHaNodeContainer(group, 1);
addHaNodeContainer(group, 2);
return group;
}
private void addHaNodeContainer(Node group, int number) {
String portOffset = System.getProperty("app.server." + number + ".port.offset");
String managementPort = System.getProperty("app.server." + number + ".management.port");
Validate.notNullOrEmpty(portOffset, "app.server." + number + ".port.offset is not set.");
Validate.notNullOrEmpty(managementPort, "app.server." + number + ".management.port is not set.");
Node container = group.createChild("container");
container.attribute("mode", "manual");
container.attribute("qualifier", AppServerContainerSPI.APP_SERVER + "-" + containerName + "-ha-node-" + number);
configuration = container.createChild("configuration");
createChild("enabled", "true");
createChild("adapterImplClass", ManagedDeployableContainer.class.getName());
createChild("jbossHome", appServerHome);
createChild("javaHome", appServerJavaHome);
//cleanServerBaseDir cannot be used until WFARQ-44 is fixed
// createChild("cleanServerBaseDir", appServerHome + "/standalone-ha-node-" + number);
createChild("serverConfig", "standalone-ha.xml");
createChild("jbossArguments",
"-Djboss.server.base.dir=" + appServerHome + "/standalone-ha-node-" + number + " " +
"-Djboss.socket.binding.port-offset=" + portOffset + " " +
"-Djboss.node.name=ha-node-" + number + " " +
getCrossDCProperties(number, portOffset) +
System.getProperty("adapter.test.props", "")
);
createChild("javaVmArguments",
"-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=790" + number + " " +
System.getProperty("app.server.memory.settings", "") + " " +
"-Djava.net.preferIPv4Stack=true"
);
createChild("managementProtocol", managementProtocol);
createChild("managementPort", managementPort);
createChild("startupTimeoutInSeconds", startupTimeoutInSeconds);
}
private String getCrossDCProperties(int number, String portOffset) {
if (System.getProperty("cache.server") == null || System.getProperty("cache.server").equals("undefined")) {
return "";
}
String cacheHotrodPortString = System.getProperty("cache.server." + number + ".port.offset");
Validate.notNullOrEmpty(cacheHotrodPortString, "cache.server." + number + ".port.offset is not set.");
int tcppingPort = 7600 + Integer.parseInt(portOffset);
int cacheHotrodPort = 11222 + Integer.parseInt(cacheHotrodPortString);
//properties used in servers/app-server/jboss/common/cli/configure-crossdc-config.cli
return "-Dtcpping.port=" + tcppingPort + " -Dcache.hotrod.port=" + cacheHotrodPort + " ";
}
}

View file

@ -340,134 +340,51 @@
<version>${wildfly.core.version}</version> <version>${wildfly.core.version}</version>
</dependency> </dependency>
</dependencies> </dependencies>
<!--todo move the build section higher probably-->
<build> <build>
<plugins> <plugins>
<plugin> <plugin>
<groupId>org.commonjava.maven.plugins</groupId> <groupId>org.commonjava.maven.plugins</groupId>
<artifactId>directory-maven-plugin</artifactId> <artifactId>directory-maven-plugin</artifactId>
<executions>
<execution>
<id>keycloak-parent-basedir</id>
<goals>
<goal>directory-of</goal>
</goals>
<phase>initialize</phase>
<configuration>
<property>keycloak-parent.basedir</property>
<project>
<groupId>org.keycloak</groupId>
<artifactId>keycloak-parent</artifactId>
</project>
</configuration>
</execution>
</executions>
</plugin> </plugin>
</plugins>
</build>
</profile>
<profile>
<id>app-server-eap</id>
<activation>
<property>
<name>app.server</name>
<value>eap</value>
</property>
</activation>
<properties>
<app.server>eap</app.server> <!--in case the profile is called directly-->
<app.server.skip.unpack>false</app.server.skip.unpack>
</properties>
<dependencies>
<dependency>
<groupId>org.keycloak.testsuite</groupId>
<artifactId>integration-arquillian-servers-app-server-eap</artifactId>
<version>${project.version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.wildfly.arquillian</groupId>
<artifactId>wildfly-arquillian-container-managed</artifactId>
</dependency>
<!--required by creaper-core-->
<dependency>
<groupId>org.wildfly.core</groupId>
<artifactId>wildfly-cli</artifactId>
<scope>test</scope>
<version>${wildfly.core.version}</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin> <plugin>
<artifactId>maven-dependency-plugin</artifactId> <groupId>org.commonjava.maven.plugins</groupId>
<executions> <artifactId>directory-maven-plugin</artifactId>
<execution>
<id>example-wars</id>
<phase>generate-test-resources</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.keycloak.testsuite</groupId>
<artifactId>hello-world-authz-service</artifactId>
<version>${project.version}</version>
<type>war</type>
</artifactItem>
<artifactItem>
<groupId>org.keycloak.testsuite</groupId>
<artifactId>photoz-html5-client</artifactId>
<version>${project.version}</version>
<type>war</type>
</artifactItem>
<artifactItem>
<groupId>org.keycloak.testsuite</groupId>
<artifactId>photoz-restful-api</artifactId>
<version>${project.version}</version>
<type>war</type>
</artifactItem>
<artifactItem>
<groupId>org.keycloak.testsuite</groupId>
<artifactId>servlet-authz-app</artifactId>
<version>${project.version}</version>
<type>war</type>
</artifactItem>
<artifactItem>
<groupId>org.keycloak.testsuite</groupId>
<artifactId>servlet-policy-enforcer</artifactId>
<version>${project.version}</version>
<type>war</type>
</artifactItem>
<artifactItem>
<groupId>org.keycloak.testsuite</groupId>
<artifactId>integration-arquillian-test-apps-cors-angular-product</artifactId>
<version>${project.version}</version>
<type>war</type>
</artifactItem>
<artifactItem>
<groupId>org.keycloak.testsuite</groupId>
<artifactId>integration-arquillian-test-apps-cors-database-service</artifactId>
<version>${project.version}</version>
<type>war</type>
</artifactItem>
</artifactItems>
<outputDirectory>${examples.home}</outputDirectory>
<overWriteIfNewer>true</overWriteIfNewer>
<!--<skip>${skip.example.tests}</skip>-->
</configuration>
</execution>
<execution>
<id>test-apps-realms</id>
<phase>generate-test-resources</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.keycloak.testsuite</groupId>
<artifactId>integration-arquillian-test-apps-dist</artifactId>
<version>${project.version}</version>
<type>zip</type>
<includes>**/*realm.json,**/*authz-service.json,**/testsaml.json,**/*-keycloak.json</includes>
</artifactItem>
</artifactItems>
<outputDirectory>${examples.home}</outputDirectory>
<overWriteIfNewer>true</overWriteIfNewer>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<executions>
<execution>
<id>example-realms</id>
<phase>generate-test-resources</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${examples.home}/example-realms</outputDirectory>
<overWriteIfNewer>true</overWriteIfNewer>
<resources>
<resource>
<directory>${examples.basedir}</directory>
<filtering>true</filtering>
<includes>
<include>**/*.json</include>
</includes>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin> </plugin>
</plugins> </plugins>
</build> </build>

View file

@ -23,4 +23,7 @@ public interface ContainerConstants {
public static final String APP_SERVER_WILDFLY = APP_SERVER_PREFIX + "wildfly"; public static final String APP_SERVER_WILDFLY = APP_SERVER_PREFIX + "wildfly";
public static final String APP_SERVER_WILDFLY_CLUSTER = APP_SERVER_WILDFLY + "-ha-node-1;" + APP_SERVER_WILDFLY + "-ha-node-2"; public static final String APP_SERVER_WILDFLY_CLUSTER = APP_SERVER_WILDFLY + "-ha-node-1;" + APP_SERVER_WILDFLY + "-ha-node-2";
public static final String APP_SERVER_EAP = APP_SERVER_PREFIX + "eap";
public static final String APP_SERVER_EAP_CLUSTER = APP_SERVER_EAP + "-ha-node-1;" + APP_SERVER_EAP + "-ha-node-2";
} }

View file

@ -1,18 +1,43 @@
/* /*
* To change this license header, choose License Headers in Project Properties. * Copyright 2018 Red Hat, Inc. and/or its affiliates
* To change this template file, choose Tools | Templates * and other contributors as indicated by the @author tags.
* and open the template in the editor. *
* 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.util; package org.keycloak.testsuite.util;
import org.jboss.logging.Logger;
import org.junit.Assume; import org.junit.Assume;
import org.keycloak.testsuite.arquillian.AuthServerTestEnricher; import org.keycloak.testsuite.arquillian.AuthServerTestEnricher;
public class ContainerAssume { public class ContainerAssume {
private static final Logger log = Logger.getLogger(ContainerAssume.class);
public static void assumeNotAuthServerUndertow() { public static void assumeNotAuthServerUndertow() {
Assume.assumeFalse("Doesn't work on auth-server-undertow", Assume.assumeFalse("Doesn't work on auth-server-undertow",
AuthServerTestEnricher.AUTH_SERVER_CONTAINER.equals(AuthServerTestEnricher.AUTH_SERVER_CONTAINER_DEFAULT)); AuthServerTestEnricher.AUTH_SERVER_CONTAINER.equals(AuthServerTestEnricher.AUTH_SERVER_CONTAINER_DEFAULT));
} }
public static void assumeNotAppServerUndertow() {
log.warn("TODO: Not stable on app-server-undertow. "
+ "It throws: KC-SERVICES0057: Logout for client '${CLIENT_NAME}' failed\n"
+ "org.apache.http.NoHttpResponseException: localhost:8280 failed to respond");
Assume.assumeFalse("Not stable on app-server-undertow. "
+ "It throws: KC-SERVICES0057: Logout for client '${CLIENT_NAME}' failed\n"
+ "org.apache.http.NoHttpResponseException: localhost:8280 failed to respond",
System.getProperty("app.server", "undertow").equals("undertow"));
}
} }

View file

@ -47,7 +47,6 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.concurrent.TimeoutException; import java.util.concurrent.TimeoutException;
import org.junit.Assume;
/** /**
* <code>@AppServerContainer</code> is needed for stopping recursion in * <code>@AppServerContainer</code> is needed for stopping recursion in
@ -234,16 +233,6 @@ public abstract class AbstractAdapterTest extends AbstractAuthTest {
} }
} }
protected void assumeNotOnAppServerUndertow() {
log.warn("TODO: Not stable on app-server-undertow. "
+ "It throws: KC-SERVICES0057: Logout for client '${CLIENT_NAME}' failed\n"
+ "org.apache.http.NoHttpResponseException: localhost:8280 failed to respond");
Assume.assumeFalse("Not stable on app-server-undertow. "
+ "It throws: KC-SERVICES0057: Logout for client '${CLIENT_NAME}' failed\n"
+ "org.apache.http.NoHttpResponseException: localhost:8280 failed to respond",
System.getProperty("app.server", "undertow").equals("undertow"));
}
public static void addContextXml(Archive archive, String contextPath) { public static void addContextXml(Archive archive, String contextPath) {
try { try {
String contextXmlContent = IOUtils.toString(tomcatContext.openStream(), "UTF-8") String contextXmlContent = IOUtils.toString(tomcatContext.openStream(), "UTF-8")

View file

@ -38,11 +38,12 @@ import java.util.List;
import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertTrue;
import static org.keycloak.testsuite.adapter.example.authorization.AbstractBaseServletAuthzAdapterTest.RESOURCE_SERVER_ID;
/** /**
* @author <a href="mailto:psilva@redhat.com">Pedro Igor</a> * @author <a href="mailto:psilva@redhat.com">Pedro Igor</a>
*/ */
public abstract class AbstractServletAuthzFunctionalAdapterTest extends AbstractBaseServletAuthzAdapterTest { public abstract class AbstractServletAuthzAdapterTest extends AbstractBaseServletAuthzAdapterTest {
@Test @Test
public void testCanNotAccessWhenEnforcing() throws Exception { public void testCanNotAccessWhenEnforcing() throws Exception {

View file

@ -47,6 +47,7 @@ import static org.keycloak.testsuite.util.IOUtil.loadRealm;
* @author <a href="mailto:psilva@redhat.com">Pedro Igor</a> * @author <a href="mailto:psilva@redhat.com">Pedro Igor</a>
*/ */
@AppServerContainer(ContainerConstants.APP_SERVER_WILDFLY) @AppServerContainer(ContainerConstants.APP_SERVER_WILDFLY)
@AppServerContainer(ContainerConstants.APP_SERVER_EAP)
public class DefaultAuthzConfigAdapterTest extends AbstractExampleAdapterTest { public class DefaultAuthzConfigAdapterTest extends AbstractExampleAdapterTest {
private static final String REALM_NAME = "hello-world-authz"; private static final String REALM_NAME = "hello-world-authz";

View file

@ -31,6 +31,7 @@ import org.keycloak.testsuite.arquillian.containers.ContainerConstants;
* @author <a href="mailto:psilva@redhat.com">Pedro Igor</a> * @author <a href="mailto:psilva@redhat.com">Pedro Igor</a>
*/ */
@AppServerContainer(ContainerConstants.APP_SERVER_WILDFLY) @AppServerContainer(ContainerConstants.APP_SERVER_WILDFLY)
@AppServerContainer(ContainerConstants.APP_SERVER_EAP)
public class PermissiveModeAdapterTest extends AbstractBaseServletAuthzAdapterTest { public class PermissiveModeAdapterTest extends AbstractBaseServletAuthzAdapterTest {
@Deployment(name = RESOURCE_SERVER_ID, managed = false) @Deployment(name = RESOURCE_SERVER_ID, managed = false)

View file

@ -29,6 +29,7 @@ import org.keycloak.testsuite.arquillian.containers.ContainerConstants;
* @author <a href="mailto:psilva@redhat.com">Pedro Igor</a> * @author <a href="mailto:psilva@redhat.com">Pedro Igor</a>
*/ */
@AppServerContainer(ContainerConstants.APP_SERVER_WILDFLY) @AppServerContainer(ContainerConstants.APP_SERVER_WILDFLY)
@AppServerContainer(ContainerConstants.APP_SERVER_EAP)
public class PhotozExampleLazyLoadPathsAdapterTest extends AbstractPhotozExampleAdapterTest { public class PhotozExampleLazyLoadPathsAdapterTest extends AbstractPhotozExampleAdapterTest {
@Deployment(name = PhotozClientAuthzTestApp.DEPLOYMENT_NAME) @Deployment(name = PhotozClientAuthzTestApp.DEPLOYMENT_NAME)

View file

@ -28,6 +28,7 @@ import org.keycloak.testsuite.arquillian.containers.ContainerConstants;
* @author <a href="mailto:psilva@redhat.com">Pedro Igor</a> * @author <a href="mailto:psilva@redhat.com">Pedro Igor</a>
*/ */
@AppServerContainer(ContainerConstants.APP_SERVER_WILDFLY) @AppServerContainer(ContainerConstants.APP_SERVER_WILDFLY)
@AppServerContainer(ContainerConstants.APP_SERVER_EAP)
public class PhotozExampleNoLazyLoadPathsAdapterTest extends AbstractPhotozExampleAdapterTest { public class PhotozExampleNoLazyLoadPathsAdapterTest extends AbstractPhotozExampleAdapterTest {
@Deployment(name = PhotozClientAuthzTestApp.DEPLOYMENT_NAME) @Deployment(name = PhotozClientAuthzTestApp.DEPLOYMENT_NAME)

View file

@ -29,7 +29,8 @@ import org.keycloak.testsuite.arquillian.containers.ContainerConstants;
* @author <a href="mailto:psilva@redhat.com">Pedro Igor</a> * @author <a href="mailto:psilva@redhat.com">Pedro Igor</a>
*/ */
@AppServerContainer(ContainerConstants.APP_SERVER_WILDFLY) @AppServerContainer(ContainerConstants.APP_SERVER_WILDFLY)
public class ServletAuthzCIPAdapterTest extends AbstractServletAuthzFunctionalAdapterTest { @AppServerContainer(ContainerConstants.APP_SERVER_EAP)
public class ServletAuthzCIPAdapterTest extends AbstractServletAuthzAdapterTest {
@Deployment(name = RESOURCE_SERVER_ID, managed = false) @Deployment(name = RESOURCE_SERVER_ID, managed = false)
public static WebArchive deployment() throws IOException { public static WebArchive deployment() throws IOException {

View file

@ -31,7 +31,8 @@ import org.keycloak.testsuite.arquillian.containers.ContainerConstants;
* @author <a href="mailto:psilva@redhat.com">Pedro Igor</a> * @author <a href="mailto:psilva@redhat.com">Pedro Igor</a>
*/ */
@AppServerContainer(ContainerConstants.APP_SERVER_WILDFLY) @AppServerContainer(ContainerConstants.APP_SERVER_WILDFLY)
public class ServletCacheDisabledAdapterTest extends AbstractServletAuthzFunctionalAdapterTest { @AppServerContainer(ContainerConstants.APP_SERVER_EAP)
public class ServletAuthzCacheDisabledAdapterTest extends AbstractServletAuthzAdapterTest {
@Deployment(name = RESOURCE_SERVER_ID, managed = false) @Deployment(name = RESOURCE_SERVER_ID, managed = false)
public static WebArchive deployment() throws IOException { public static WebArchive deployment() throws IOException {

View file

@ -30,7 +30,8 @@ import org.keycloak.testsuite.arquillian.containers.ContainerConstants;
* @author <a href="mailto:psilva@redhat.com">Pedro Igor</a> * @author <a href="mailto:psilva@redhat.com">Pedro Igor</a>
*/ */
@AppServerContainer(ContainerConstants.APP_SERVER_WILDFLY) @AppServerContainer(ContainerConstants.APP_SERVER_WILDFLY)
public class ServletCacheLifespanAdapterTest extends AbstractServletAuthzFunctionalAdapterTest { @AppServerContainer(ContainerConstants.APP_SERVER_EAP)
public class ServletAuthzCacheLifespanAdapterTest extends AbstractServletAuthzAdapterTest {
@Deployment(name = RESOURCE_SERVER_ID, managed = false) @Deployment(name = RESOURCE_SERVER_ID, managed = false)
public static WebArchive deployment() throws IOException { public static WebArchive deployment() throws IOException {
@ -60,7 +61,7 @@ public class ServletCacheLifespanAdapterTest extends AbstractServletAuthzFunctio
permission.addResource(resource.getName()); permission.addResource(resource.getName());
permission.addPolicy("Deny Policy"); permission.addPolicy("Deny Policy");
permission = getAuthorizationResource().permissions().resource().create(permission).readEntity(ResourcePermissionRepresentation.class); getAuthorizationResource().permissions().resource().create(permission).readEntity(ResourcePermissionRepresentation.class);
login("alice", "alice"); login("alice", "alice");
assertWasNotDenied(); assertWasNotDenied();

View file

@ -29,7 +29,8 @@ import org.keycloak.testsuite.arquillian.containers.ContainerConstants;
* @author <a href="mailto:psilva@redhat.com">Pedro Igor</a> * @author <a href="mailto:psilva@redhat.com">Pedro Igor</a>
*/ */
@AppServerContainer(ContainerConstants.APP_SERVER_WILDFLY) @AppServerContainer(ContainerConstants.APP_SERVER_WILDFLY)
public class ServletAuthzLazyLoadPathsAdapterTest extends AbstractServletAuthzFunctionalAdapterTest { @AppServerContainer(ContainerConstants.APP_SERVER_EAP)
public class ServletAuthzLazyLoadPathsAdapterTest extends AbstractServletAuthzAdapterTest {
@Deployment(name = RESOURCE_SERVER_ID, managed = false) @Deployment(name = RESOURCE_SERVER_ID, managed = false)
public static WebArchive deployment() throws IOException { public static WebArchive deployment() throws IOException {

View file

@ -27,11 +27,12 @@ import org.keycloak.testsuite.arquillian.containers.ContainerConstants;
* @author <a href="mailto:psilva@redhat.com">Pedro Igor</a> * @author <a href="mailto:psilva@redhat.com">Pedro Igor</a>
*/ */
@AppServerContainer(ContainerConstants.APP_SERVER_WILDFLY) @AppServerContainer(ContainerConstants.APP_SERVER_WILDFLY)
public class ServletAuthzAdapterTest extends AbstractServletAuthzFunctionalAdapterTest { @AppServerContainer(ContainerConstants.APP_SERVER_EAP)
public class ServletAuthzNoLazyLoadPathsAdapterTest extends AbstractServletAuthzAdapterTest {
@Deployment(name = RESOURCE_SERVER_ID, managed = false) @Deployment(name = RESOURCE_SERVER_ID, managed = false)
public static WebArchive deployment() throws IOException { public static WebArchive deployment() throws IOException {
return exampleDeployment(RESOURCE_SERVER_ID); return exampleDeployment(RESOURCE_SERVER_ID);
} }
} }

View file

@ -53,6 +53,7 @@ import org.openqa.selenium.By;
* @author <a href="mailto:psilva@redhat.com">Pedro Igor</a> * @author <a href="mailto:psilva@redhat.com">Pedro Igor</a>
*/ */
@AppServerContainer(ContainerConstants.APP_SERVER_WILDFLY) @AppServerContainer(ContainerConstants.APP_SERVER_WILDFLY)
@AppServerContainer(ContainerConstants.APP_SERVER_EAP)
public class ServletPolicyEnforcerTest extends AbstractExampleAdapterTest { public class ServletPolicyEnforcerTest extends AbstractExampleAdapterTest {
protected static final String REALM_NAME = "servlet-policy-enforcer-authz"; protected static final String REALM_NAME = "servlet-policy-enforcer-authz";

View file

@ -57,6 +57,7 @@ import static org.keycloak.testsuite.util.WaitUtils.waitUntilElement;
* Created by fkiss. * Created by fkiss.
*/ */
@AppServerContainer(ContainerConstants.APP_SERVER_WILDFLY) @AppServerContainer(ContainerConstants.APP_SERVER_WILDFLY)
@AppServerContainer(ContainerConstants.APP_SERVER_EAP)
public class CorsExampleAdapterTest extends AbstractExampleAdapterTest { public class CorsExampleAdapterTest extends AbstractExampleAdapterTest {
public static final String CORS = "cors"; public static final String CORS = "cors";

View file

@ -49,6 +49,7 @@ import org.wildfly.extras.creaper.core.online.operations.Operations;
* @author <a href="mailto:psilva@redhat.com">Pedro Igor</a> * @author <a href="mailto:psilva@redhat.com">Pedro Igor</a>
*/ */
@AppServerContainer(ContainerConstants.APP_SERVER_WILDFLY) @AppServerContainer(ContainerConstants.APP_SERVER_WILDFLY)
@AppServerContainer(ContainerConstants.APP_SERVER_EAP)
public class ConsoleProtectionTest extends AbstractAdapterTest { public class ConsoleProtectionTest extends AbstractAdapterTest {
// Javascript browser needed KEYCLOAK-4703 // Javascript browser needed KEYCLOAK-4703

View file

@ -90,6 +90,7 @@ import static org.keycloak.testsuite.arquillian.DeploymentTargetModifier.AUTH_SE
*/ */
@AppServerContainer(ContainerConstants.APP_SERVER_UNDERTOW) @AppServerContainer(ContainerConstants.APP_SERVER_UNDERTOW)
@AppServerContainer(ContainerConstants.APP_SERVER_WILDFLY) @AppServerContainer(ContainerConstants.APP_SERVER_WILDFLY)
@AppServerContainer(ContainerConstants.APP_SERVER_EAP)
public class BrokerLinkAndTokenExchangeTest extends AbstractServletsAdapterTest { public class BrokerLinkAndTokenExchangeTest extends AbstractServletsAdapterTest {
public static final String CHILD_IDP = "child"; public static final String CHILD_IDP = "child";
public static final String PARENT_IDP = "parent-idp"; public static final String PARENT_IDP = "parent-idp";

View file

@ -74,6 +74,7 @@ import static org.keycloak.testsuite.admin.ApiUtil.createUserAndResetPasswordWit
*/ */
@AppServerContainer(ContainerConstants.APP_SERVER_UNDERTOW) @AppServerContainer(ContainerConstants.APP_SERVER_UNDERTOW)
@AppServerContainer(ContainerConstants.APP_SERVER_WILDFLY) @AppServerContainer(ContainerConstants.APP_SERVER_WILDFLY)
@AppServerContainer(ContainerConstants.APP_SERVER_EAP)
public class ClientInitiatedAccountLinkTest extends AbstractServletsAdapterTest { public class ClientInitiatedAccountLinkTest extends AbstractServletsAdapterTest {
public static final String CHILD_IDP = "child"; public static final String CHILD_IDP = "child";
public static final String PARENT_IDP = "parent-idp"; public static final String PARENT_IDP = "parent-idp";

View file

@ -24,6 +24,7 @@ import org.keycloak.testsuite.arquillian.containers.ContainerConstants;
@AppServerContainer(ContainerConstants.APP_SERVER_UNDERTOW) @AppServerContainer(ContainerConstants.APP_SERVER_UNDERTOW)
@AppServerContainer(ContainerConstants.APP_SERVER_WILDFLY) @AppServerContainer(ContainerConstants.APP_SERVER_WILDFLY)
@AppServerContainer(ContainerConstants.APP_SERVER_EAP)
@UseServletFilter(filterName = "oidc-filter", filterClass = "org.keycloak.adapters.servlet.KeycloakOIDCFilter", @UseServletFilter(filterName = "oidc-filter", filterClass = "org.keycloak.adapters.servlet.KeycloakOIDCFilter",
filterDependency = "org.keycloak:keycloak-servlet-filter-adapter", skipPattern = "/error.html") filterDependency = "org.keycloak:keycloak-servlet-filter-adapter", skipPattern = "/error.html")
public class DemoFilterServletAdapterTest extends DemoServletsAdapterTest { public class DemoFilterServletAdapterTest extends DemoServletsAdapterTest {

View file

@ -131,6 +131,7 @@ import static org.keycloak.testsuite.util.WaitUtils.waitForPageToLoad;
*/ */
@AppServerContainer(ContainerConstants.APP_SERVER_UNDERTOW) @AppServerContainer(ContainerConstants.APP_SERVER_UNDERTOW)
@AppServerContainer(ContainerConstants.APP_SERVER_WILDFLY) @AppServerContainer(ContainerConstants.APP_SERVER_WILDFLY)
@AppServerContainer(ContainerConstants.APP_SERVER_EAP)
public class DemoServletsAdapterTest extends AbstractServletsAdapterTest { public class DemoServletsAdapterTest extends AbstractServletsAdapterTest {
// Javascript browser needed KEYCLOAK-4703 // Javascript browser needed KEYCLOAK-4703

View file

@ -80,6 +80,7 @@ import static org.keycloak.testsuite.util.WaitUtils.waitUntilElement;
*/ */
@AppServerContainer(ContainerConstants.APP_SERVER_UNDERTOW) @AppServerContainer(ContainerConstants.APP_SERVER_UNDERTOW)
@AppServerContainer(ContainerConstants.APP_SERVER_WILDFLY) @AppServerContainer(ContainerConstants.APP_SERVER_WILDFLY)
@AppServerContainer(ContainerConstants.APP_SERVER_EAP)
public class OIDCPublicKeyRotationAdapterTest extends AbstractServletsAdapterTest { public class OIDCPublicKeyRotationAdapterTest extends AbstractServletsAdapterTest {
@Page @Page

View file

@ -37,6 +37,7 @@ import static org.keycloak.testsuite.util.WaitUtils.waitUntilElement;
*/ */
@AppServerContainer(ContainerConstants.APP_SERVER_UNDERTOW) @AppServerContainer(ContainerConstants.APP_SERVER_UNDERTOW)
@AppServerContainer(ContainerConstants.APP_SERVER_WILDFLY) @AppServerContainer(ContainerConstants.APP_SERVER_WILDFLY)
@AppServerContainer(ContainerConstants.APP_SERVER_EAP)
public class OfflineServletsAdapterTest extends AbstractServletsAdapterTest { public class OfflineServletsAdapterTest extends AbstractServletsAdapterTest {
@Rule @Rule

View file

@ -12,6 +12,7 @@ import org.keycloak.testsuite.arquillian.containers.ContainerConstants;
* @author mhajas * @author mhajas
*/ */
@AppServerContainer(ContainerConstants.APP_SERVER_WILDFLY) @AppServerContainer(ContainerConstants.APP_SERVER_WILDFLY)
@AppServerContainer(ContainerConstants.APP_SERVER_EAP)
@UseServletFilter(filterName = "saml-filter", filterClass = "org.keycloak.adapters.saml.servlet.SamlFilter", @UseServletFilter(filterName = "saml-filter", filterClass = "org.keycloak.adapters.saml.servlet.SamlFilter",
filterDependency = "org.keycloak:keycloak-saml-servlet-filter-adapter") filterDependency = "org.keycloak:keycloak-saml-servlet-filter-adapter")
public class SAMLFilterServletAdapterTest extends SAMLServletsAdapterTest { public class SAMLFilterServletAdapterTest extends SAMLServletsAdapterTest {

View file

@ -151,6 +151,7 @@ import static org.keycloak.testsuite.util.WaitUtils.*;
* @author mhajas * @author mhajas
*/ */
@AppServerContainer(ContainerConstants.APP_SERVER_WILDFLY) @AppServerContainer(ContainerConstants.APP_SERVER_WILDFLY)
@AppServerContainer(ContainerConstants.APP_SERVER_EAP)
public class SAMLServletsAdapterTest extends AbstractServletsAdapterTest { public class SAMLServletsAdapterTest extends AbstractServletsAdapterTest {
@Page @Page
protected BadClientSalesPostSigServlet badClientSalesPostSigServletPage; protected BadClientSalesPostSigServlet badClientSalesPostSigServletPage;

View file

@ -29,11 +29,13 @@ import org.keycloak.testsuite.adapter.page.ProductPortalSubsystem;
import org.keycloak.testsuite.arquillian.annotation.AppServerContainer; import org.keycloak.testsuite.arquillian.annotation.AppServerContainer;
import org.keycloak.testsuite.arquillian.containers.ContainerConstants; import org.keycloak.testsuite.arquillian.containers.ContainerConstants;
import static org.junit.Assert.assertTrue; import static org.hamcrest.Matchers.containsString;
import static org.junit.Assert.assertThat;
import static org.keycloak.testsuite.util.URLAssert.assertCurrentUrlEquals; import static org.keycloak.testsuite.util.URLAssert.assertCurrentUrlEquals;
import static org.keycloak.testsuite.util.URLAssert.assertCurrentUrlStartsWithLoginUrlOf; import static org.keycloak.testsuite.util.URLAssert.assertCurrentUrlStartsWithLoginUrlOf;
@AppServerContainer(ContainerConstants.APP_SERVER_WILDFLY) @AppServerContainer(ContainerConstants.APP_SERVER_WILDFLY)
@AppServerContainer(ContainerConstants.APP_SERVER_EAP)
public class SecuredDeploymentsAdapterTest extends AbstractServletsAdapterTest { public class SecuredDeploymentsAdapterTest extends AbstractServletsAdapterTest {
@Page @Page
@ -62,15 +64,17 @@ public class SecuredDeploymentsAdapterTest extends AbstractServletsAdapterTest {
customerPortalSubsystem.navigateTo(); customerPortalSubsystem.navigateTo();
assertCurrentUrlStartsWithLoginUrlOf(testRealmPage); assertCurrentUrlStartsWithLoginUrlOf(testRealmPage);
testRealmLoginPage.form().login("bburke@redhat.com", "password"); testRealmLoginPage.form().login("bburke@redhat.com", "password");
String pageSource = driver.getPageSource(); assertPageContains("Bill Burke");
log.debug(pageSource); assertPageContains("Stian Thorgersen");
assertTrue(pageSource.contains("Bill Burke") && pageSource.contains("Stian Thorgersen"));
productPortalSubsystem.navigateTo(); productPortalSubsystem.navigateTo();
assertCurrentUrlEquals(productPortalSubsystem); assertCurrentUrlEquals(productPortalSubsystem);
pageSource = driver.getPageSource(); assertPageContains("iPhone");
log.debug(pageSource); assertPageContains("iPad");
assertTrue(pageSource.contains("iPhone") && pageSource.contains("iPad"));
} }
private void assertPageContains(String string) {
String pageSource = driver.getPageSource();
assertThat(pageSource, containsString(string));
}
} }

View file

@ -35,6 +35,7 @@ import org.keycloak.testsuite.auth.page.account.Sessions;
import org.keycloak.testsuite.auth.page.login.Login; import org.keycloak.testsuite.auth.page.login.Login;
import org.keycloak.testsuite.arquillian.annotation.AppServerContainer; import org.keycloak.testsuite.arquillian.annotation.AppServerContainer;
import org.keycloak.testsuite.arquillian.containers.ContainerConstants; import org.keycloak.testsuite.arquillian.containers.ContainerConstants;
import org.keycloak.testsuite.util.ContainerAssume;
import org.keycloak.testsuite.util.SecondBrowser; import org.keycloak.testsuite.util.SecondBrowser;
import org.openqa.selenium.By; import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebDriver;
@ -51,6 +52,7 @@ import static org.keycloak.testsuite.util.URLAssert.assertCurrentUrlStartsWithLo
*/ */
@AppServerContainer(ContainerConstants.APP_SERVER_UNDERTOW) @AppServerContainer(ContainerConstants.APP_SERVER_UNDERTOW)
@AppServerContainer(ContainerConstants.APP_SERVER_WILDFLY) @AppServerContainer(ContainerConstants.APP_SERVER_WILDFLY)
@AppServerContainer(ContainerConstants.APP_SERVER_EAP)
public class SessionServletAdapterTest extends AbstractServletsAdapterTest { public class SessionServletAdapterTest extends AbstractServletsAdapterTest {
@Page @Page
@ -124,7 +126,7 @@ public class SessionServletAdapterTest extends AbstractServletsAdapterTest {
//KEYCLOAK-741 //KEYCLOAK-741
@Test @Test
public void testSessionInvalidatedAfterFailedRefresh() { public void testSessionInvalidatedAfterFailedRefresh() {
assumeNotOnAppServerUndertow(); ContainerAssume.assumeNotAppServerUndertow();
RealmRepresentation testRealmRep = testRealmResource().toRepresentation(); RealmRepresentation testRealmRep = testRealmResource().toRepresentation();
ClientResource sessionPortalRes = null; ClientResource sessionPortalRes = null;
for (ClientRepresentation clientRep : testRealmResource().clients().findAll()) { for (ClientRepresentation clientRep : testRealmResource().clients().findAll()) {
@ -182,7 +184,7 @@ public class SessionServletAdapterTest extends AbstractServletsAdapterTest {
//KEYCLOAK-1216 //KEYCLOAK-1216
@Test @Test
public void testAccountManagementSessionsLogout() { public void testAccountManagementSessionsLogout() {
assumeNotOnAppServerUndertow(); ContainerAssume.assumeNotAppServerUndertow();
// login as bburke // login as bburke
loginAndCheckSession(testRealmLoginPage); loginAndCheckSession(testRealmLoginPage);
testRealmSessions.navigateTo(); testRealmSessions.navigateTo();

View file

@ -55,6 +55,7 @@ import org.keycloak.testsuite.auth.page.login.PageWithLoginUrl;
import org.keycloak.testsuite.federation.UserMapStorageFactory; import org.keycloak.testsuite.federation.UserMapStorageFactory;
import org.keycloak.testsuite.pages.ConsentPage; import org.keycloak.testsuite.pages.ConsentPage;
import org.keycloak.testsuite.runonserver.RunOnServerDeployment; import org.keycloak.testsuite.runonserver.RunOnServerDeployment;
import org.keycloak.testsuite.util.ContainerAssume;
import static org.keycloak.testsuite.arquillian.DeploymentTargetModifier.AUTH_SERVER_CURRENT; import static org.keycloak.testsuite.arquillian.DeploymentTargetModifier.AUTH_SERVER_CURRENT;
import static org.keycloak.testsuite.util.URLAssert.assertCurrentUrlEquals; import static org.keycloak.testsuite.util.URLAssert.assertCurrentUrlEquals;
@ -66,6 +67,7 @@ import static org.keycloak.testsuite.util.URLAssert.assertCurrentUrlStartsWithLo
*/ */
@AppServerContainer(ContainerConstants.APP_SERVER_UNDERTOW) @AppServerContainer(ContainerConstants.APP_SERVER_UNDERTOW)
@AppServerContainer(ContainerConstants.APP_SERVER_WILDFLY) @AppServerContainer(ContainerConstants.APP_SERVER_WILDFLY)
@AppServerContainer(ContainerConstants.APP_SERVER_EAP)
public class UserStorageConsentTest extends AbstractServletsAdapterTest { public class UserStorageConsentTest extends AbstractServletsAdapterTest {
@Page @Page
@ -144,7 +146,7 @@ public class UserStorageConsentTest extends AbstractServletsAdapterTest {
*/ */
@Test @Test
public void testLogin() throws Exception { public void testLogin() throws Exception {
assumeNotOnAppServerUndertow(); ContainerAssume.assumeNotAppServerUndertow();
testingClient.server().run(UserStorageConsentTest::setupConsent); testingClient.server().run(UserStorageConsentTest::setupConsent);
UserRepresentation memuser = new UserRepresentation(); UserRepresentation memuser = new UserRepresentation();

View file

@ -33,12 +33,16 @@ import static org.keycloak.testsuite.adapter.AbstractServletsAdapterTest.samlSer
* @author hmlnarik * @author hmlnarik
*/ */
@AppServerContainer(ContainerConstants.APP_SERVER_WILDFLY_CLUSTER) @AppServerContainer(ContainerConstants.APP_SERVER_WILDFLY_CLUSTER)
@AppServerContainer(ContainerConstants.APP_SERVER_EAP_CLUSTER)
public class SAMLAdapterClusterTest extends AbstractSAMLAdapterClusteredTest { public class SAMLAdapterClusterTest extends AbstractSAMLAdapterClusteredTest {
@TargetsContainer(value = TARGET_CONTAINER_NODE_1) @TargetsContainer(value = TARGET_CONTAINER_NODE_1)
@Deployment(name = EmployeeServletDistributable.DEPLOYMENT_NAME, managed = false) @Deployment(name = EmployeeServletDistributable.DEPLOYMENT_NAME, managed = false)
protected static WebArchive employee() { protected static WebArchive employee() {
return samlServletDeployment(EmployeeServletDistributable.DEPLOYMENT_NAME, EmployeeServletDistributable.DEPLOYMENT_NAME + "/WEB-INF/web.xml", SendUsernameServlet.class); return samlServletDeployment(
EmployeeServletDistributable.DEPLOYMENT_NAME,
EmployeeServletDistributable.DEPLOYMENT_NAME + "/WEB-INF/web.xml",
SendUsernameServlet.class);
} }
@TargetsContainer(value = TARGET_CONTAINER_NODE_2) @TargetsContainer(value = TARGET_CONTAINER_NODE_2)

View file

@ -37,6 +37,7 @@ import static org.keycloak.testsuite.adapter.AbstractServletsAdapterTest.samlSer
* @author hmlnarik * @author hmlnarik
*/ */
@AppServerContainer(ContainerConstants.APP_SERVER_WILDFLY_CLUSTER) @AppServerContainer(ContainerConstants.APP_SERVER_WILDFLY_CLUSTER)
@AppServerContainer(ContainerConstants.APP_SERVER_EAP_CLUSTER)
public class SAMLAdapterCrossDCTest extends AbstractSAMLAdapterClusteredTest { public class SAMLAdapterCrossDCTest extends AbstractSAMLAdapterClusteredTest {
@BeforeClass @BeforeClass

View file

@ -1,65 +0,0 @@
<?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 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.keycloak.testsuite</groupId>
<artifactId>integration-arquillian-tests-adapters-jboss</artifactId>
<version>4.0.0.Final-SNAPSHOT</version>
</parent>
<artifactId>integration-arquillian-tests-adapters-eap</artifactId>
<name>Adapter Tests - JBoss - EAP</name>
<properties>
<app.server>eap</app.server>
</properties>
<dependencies>
<dependency>
<groupId>org.wildfly.extras.creaper</groupId>
<artifactId>creaper-core</artifactId>
<scope>test</scope>
<version>1.6.1</version>
<exclusions>
<exclusion>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.wildfly.core</groupId>
<artifactId>wildfly-cli</artifactId>
<scope>test</scope>
<version>${wildfly.core.version}</version>
</dependency>
<dependency>
<groupId>org.wildfly.core</groupId>
<artifactId>wildfly-controller-client</artifactId>
<scope>test</scope>
<version>${wildfly.core.version}</version>
</dependency>
</dependencies>
</project>

View file

@ -1,29 +0,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.
*/
package org.keycloak.testsuite.adapter;
import org.keycloak.testsuite.adapter.servlet.ClientInitiatedAccountLinkTest;
import org.keycloak.testsuite.arquillian.annotation.AppServerContainer;
/**
*
* @author <a href="mailto:vramik@redhat.com">Vlastislav Ramik</a>
*/
@AppServerContainer("app-server-eap")
public class EAPClientInitiatedAccountLinkTest extends ClientInitiatedAccountLinkTest {
}

View file

@ -1,13 +0,0 @@
package org.keycloak.testsuite.adapter;
import org.keycloak.testsuite.adapter.servlet.DemoServletsAdapterTest;
import org.keycloak.testsuite.arquillian.annotation.AppServerContainer;
/**
*
* @author tkyjovsk
*/
@AppServerContainer("app-server-eap")
public class EAPOIDCAdapterTest extends DemoServletsAdapterTest {
}

View file

@ -1,28 +0,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.
*/
package org.keycloak.testsuite.adapter;
import org.keycloak.testsuite.adapter.servlet.OIDCPublicKeyRotationAdapterTest;
import org.keycloak.testsuite.arquillian.annotation.AppServerContainer;
/**
* @author <a href="mailto:mposolda@redhat.com">Marek Posolda</a>
*/
@AppServerContainer("app-server-eap")
public class EAPOIDCPublicKeyRotationAdapterTest extends OIDCPublicKeyRotationAdapterTest {
}

View file

@ -1,13 +0,0 @@
package org.keycloak.testsuite.adapter;
import org.keycloak.testsuite.adapter.servlet.SessionServletAdapterTest;
import org.keycloak.testsuite.arquillian.annotation.AppServerContainer;
/**
*
* @author tkyjovsk
*/
@AppServerContainer("app-server-eap")
public class EAPOIDCSessionAdapterTest extends SessionServletAdapterTest {
}

View file

@ -1,11 +0,0 @@
package org.keycloak.testsuite.adapter;
import org.keycloak.testsuite.adapter.servlet.OfflineServletsAdapterTest;
import org.keycloak.testsuite.arquillian.annotation.AppServerContainer;
/**
* @author <a href="mailto:bruno@abstractj.org">Bruno Oliveira</a>.
*/
@AppServerContainer("app-server-eap")
public class EAPOfflineServletsAdapterTest extends OfflineServletsAdapterTest {
}

View file

@ -1,12 +0,0 @@
package org.keycloak.testsuite.adapter;
import org.keycloak.testsuite.adapter.servlet.SAMLServletsAdapterTest;
import org.keycloak.testsuite.arquillian.annotation.AppServerContainer;
/**
* @author mhajas
*/
@AppServerContainer("app-server-eap")
public class EAPSAMLAdapterTest extends SAMLServletsAdapterTest {
}

View file

@ -1,11 +0,0 @@
package org.keycloak.testsuite.adapter;
import org.keycloak.testsuite.adapter.servlet.SAMLFilterServletAdapterTest;
import org.keycloak.testsuite.arquillian.annotation.AppServerContainer;
/**
* @author mhajas
*/
@AppServerContainer("app-server-eap")
public class EAPSAMLFilterAdapterTest extends SAMLFilterServletAdapterTest {
}

View file

@ -1,13 +0,0 @@
package org.keycloak.testsuite.adapter;
import org.keycloak.testsuite.adapter.servlet.SecuredDeploymentsAdapterTest;
import org.keycloak.testsuite.arquillian.annotation.AppServerContainer;
/**
*
* @author tkyjovsk
*/
@AppServerContainer("app-server-eap")
public class EAPSecuredDeploymentsAdapterTest extends SecuredDeploymentsAdapterTest {
}

View file

@ -1,55 +0,0 @@
/*
* Copyright 2017 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.adapter.cluster;
import org.keycloak.testsuite.adapter.page.EmployeeServletDistributable;
import org.keycloak.testsuite.arquillian.annotation.*;
import org.keycloak.testsuite.adapter.AbstractSAMLAdapterClusteredTest;
import org.keycloak.testsuite.adapter.servlet.SendUsernameServlet;
import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.container.test.api.TargetsContainer;
import org.jboss.shrinkwrap.api.spec.WebArchive;
/**
*
* @author hmlnarik
*/
@AppServerContainer("app-server-eap")
public class EAPSAMLAdapterClusterTest extends AbstractSAMLAdapterClusteredTest {
@TargetsContainer(value = "app-server-eap-" + NODE_1_NAME)
@Deployment(name = EmployeeServletDistributable.DEPLOYMENT_NAME, managed = false)
protected static WebArchive employee() {
return samlServletDeployment(EmployeeServletDistributable.DEPLOYMENT_NAME, EmployeeServletDistributable.DEPLOYMENT_NAME + "/WEB-INF/web.xml", SendUsernameServlet.class);
}
@TargetsContainer(value = "app-server-eap-" + NODE_2_NAME)
@Deployment(name = EmployeeServletDistributable.DEPLOYMENT_NAME + "_2", managed = false)
protected static WebArchive employee2() {
return employee();
}
@Override
protected void prepareServerDirectories() throws Exception {
prepareServerDirectory("standalone-cluster", "standalone-" + NODE_1_NAME);
prepareServerDirectory("standalone-cluster", "standalone-" + NODE_2_NAME);
}
}

View file

@ -1,30 +0,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.
*/
package org.keycloak.testsuite.adapter.example.authorization;
import org.keycloak.testsuite.adapter.example.authorization.DefaultAuthzConfigAdapterTest;
import org.keycloak.testsuite.arquillian.annotation.AppServerContainer;
/**
*
* @author tkyjovsk
*/
@AppServerContainer("app-server-eap")
//@AdapterLibsLocationProperty("adapter.libs.wildfly")
public class EAPDefaultAuthzConfigAdapterTest extends DefaultAuthzConfigAdapterTest {
}

View file

@ -1,30 +0,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.
*/
package org.keycloak.testsuite.adapter.example.authorization;
import org.jboss.arquillian.container.test.api.RunAsClient;
import org.keycloak.testsuite.arquillian.annotation.AppServerContainer;
/**
*
* @author tkyjovsk
*/
@RunAsClient
@AppServerContainer("app-server-eap")
public class EAPPermissiveModeAdapterTest extends PermissiveModeAdapterTest {
}

View file

@ -1,30 +0,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.
*/
package org.keycloak.testsuite.adapter.example.authorization;
import org.keycloak.testsuite.adapter.example.authorization.AbstractPhotozExampleAdapterTest;
import org.keycloak.testsuite.arquillian.annotation.AppServerContainer;
/**
*
* @author tkyjovsk
*/
@AppServerContainer("app-server-eap")
//@AdapterLibsLocationProperty("adapter.libs.wildfly")
public class EAPPhotozExampleAdapterTest extends AbstractPhotozExampleAdapterTest {
}

View file

@ -1,31 +0,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.
*/
package org.keycloak.testsuite.adapter.example.authorization;
import org.jboss.arquillian.container.test.api.RunAsClient;
import org.keycloak.testsuite.arquillian.annotation.AppServerContainer;
/**
*
* @author tkyjovsk
*/
@RunAsClient
@AppServerContainer("app-server-eap")
//@AdapterLibsLocationProperty("adapter.libs.wildfly")
public class EAPServletAuthzAdapterTest extends AbstractServletAuthzFunctionalAdapterTest {
}

View file

@ -1,12 +0,0 @@
package org.keycloak.testsuite.adapter.example.cors;
import org.keycloak.testsuite.arquillian.annotation.AppServerContainer;
/**
*
* @author tkyjovsk
*/
@AppServerContainer("app-server-eap")
public class EAPCorsExampleAdapterTest extends CorsExampleAdapterTest {
}

View file

@ -1,62 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ 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.
-->
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
version="3.0">
<distributable/>
<absolute-ordering/>
<module-name>%CONTEXT_PATH%</module-name>
<servlet-mapping>
<servlet-name>javax.ws.rs.core.Application</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
<error-page>
<location>/error.html</location>
</error-page>
<security-constraint>
<web-resource-collection>
<web-resource-name>Application</web-resource-name>
<url-pattern>/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>manager</role-name>
</auth-constraint>
</security-constraint>
<login-config>
<auth-method>KEYCLOAK-SAML</auth-method>
<realm-name>demo</realm-name>
</login-config>
<security-role>
<role-name>manager</role-name>
</security-role>
<context-param>
<param-name>keycloak.sessionIdMapperUpdater.classes</param-name>
<param-value>org.keycloak.adapters.saml.wildfly.infinispan.InfinispanSessionCacheIdMapperUpdater</param-value>
</context-param>
</web-app>

View file

@ -25,6 +25,6 @@ import org.keycloak.testsuite.arquillian.annotation.AppServerContainer;
*/ */
@RunAsClient @RunAsClient
@AppServerContainer("app-server-eap6") @AppServerContainer("app-server-eap6")
public class EAP6ServletAuthzAdapterTest extends AbstractServletAuthzFunctionalAdapterTest { public class EAP6ServletAuthzAdapterTest extends AbstractServletAuthzAdapterTest {
} }

View file

@ -71,12 +71,6 @@
</dependencies> </dependencies>
</profile> </profile>
<profile>
<id>app-server-eap</id>
<modules>
<module>eap</module>
</modules>
</profile>
<profile> <profile>
<id>app-server-eap6</id> <id>app-server-eap6</id>
<modules> <modules>

View file

@ -1,28 +0,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.
*/
package org.keycloak.testsuite.adapter.example.authorization;
import org.keycloak.testsuite.arquillian.annotation.AppServerContainer;
/**
*
* @author tkyjovsk
*/
@AppServerContainer("app-server-remote")
public class RemoteDefaultAuthzConfigAdapterTest extends DefaultAuthzConfigAdapterTest {
}

View file

@ -1,28 +0,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.
*/
package org.keycloak.testsuite.adapter.example.authorization;
import org.keycloak.testsuite.arquillian.annotation.AppServerContainer;
/**
*
* @author tkyjovsk
*/
@AppServerContainer("app-server-remote")
public class RemotePhotozExampleAdapterTest extends AbstractPhotozExampleAdapterTest {
}

View file

@ -1,30 +0,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.
*/
package org.keycloak.testsuite.adapter.example.authorization;
import org.jboss.arquillian.container.test.api.RunAsClient;
import org.keycloak.testsuite.arquillian.annotation.AppServerContainer;
/**
*
* @author tkyjovsk
*/
@RunAsClient
@AppServerContainer("app-server-remote")
public class RemoteServletAuthzAdapterTest extends ServletAuthzAdapterTest {
}

View file

@ -26,6 +26,6 @@ import org.keycloak.testsuite.arquillian.annotation.AppServerContainer;
@RunAsClient @RunAsClient
@AppServerContainer("app-server-wildfly10") @AppServerContainer("app-server-wildfly10")
//@AdapterLibsLocationProperty("adapter.libs.wildfly") //@AdapterLibsLocationProperty("adapter.libs.wildfly")
public class Wildfly10ServletAuthzAdapterTest extends AbstractServletAuthzFunctionalAdapterTest { public class Wildfly10ServletAuthzAdapterTest extends AbstractServletAuthzAdapterTest {
} }

View file

@ -204,6 +204,83 @@
<skip>${app.server.skip.unpack}</skip> <skip>${app.server.skip.unpack}</skip>
</configuration> </configuration>
</execution> </execution>
<execution>
<id>example-wars</id>
<phase>generate-test-resources</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<skip>${app.server.skip.unpack}</skip>
<artifactItems>
<artifactItem>
<groupId>org.keycloak.testsuite</groupId>
<artifactId>hello-world-authz-service</artifactId>
<version>${project.version}</version>
<type>war</type>
</artifactItem>
<artifactItem>
<groupId>org.keycloak.testsuite</groupId>
<artifactId>photoz-html5-client</artifactId>
<version>${project.version}</version>
<type>war</type>
</artifactItem>
<artifactItem>
<groupId>org.keycloak.testsuite</groupId>
<artifactId>photoz-restful-api</artifactId>
<version>${project.version}</version>
<type>war</type>
</artifactItem>
<artifactItem>
<groupId>org.keycloak.testsuite</groupId>
<artifactId>servlet-authz-app</artifactId>
<version>${project.version}</version>
<type>war</type>
</artifactItem>
<artifactItem>
<groupId>org.keycloak.testsuite</groupId>
<artifactId>servlet-policy-enforcer</artifactId>
<version>${project.version}</version>
<type>war</type>
</artifactItem>
<artifactItem>
<groupId>org.keycloak.testsuite</groupId>
<artifactId>integration-arquillian-test-apps-cors-angular-product</artifactId>
<version>${project.version}</version>
<type>war</type>
</artifactItem>
<artifactItem>
<groupId>org.keycloak.testsuite</groupId>
<artifactId>integration-arquillian-test-apps-cors-database-service</artifactId>
<version>${project.version}</version>
<type>war</type>
</artifactItem>
</artifactItems>
<outputDirectory>${examples.home}</outputDirectory>
<overWriteIfNewer>true</overWriteIfNewer>
</configuration>
</execution>
<execution>
<id>test-apps-realms</id>
<phase>generate-test-resources</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<skip>${app.server.skip.unpack}</skip>
<artifactItems>
<artifactItem>
<groupId>org.keycloak.testsuite</groupId>
<artifactId>integration-arquillian-test-apps-dist</artifactId>
<version>${project.version}</version>
<type>zip</type>
<includes>**/*realm.json,**/*authz-service.json,**/testsaml.json,**/*-keycloak.json</includes>
</artifactItem>
</artifactItems>
<outputDirectory>${examples.home}</outputDirectory>
<overWriteIfNewer>true</overWriteIfNewer>
</configuration>
</execution>
</executions> </executions>
</plugin> </plugin>
<plugin> <plugin>
@ -247,6 +324,27 @@
</resources> </resources>
</configuration> </configuration>
</execution> </execution>
<execution>
<id>example-realms</id>
<phase>generate-test-resources</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<skip>${app.server.skip.unpack}</skip>
<outputDirectory>${examples.home}/example-realms</outputDirectory>
<overWriteIfNewer>true</overWriteIfNewer>
<resources>
<resource>
<directory>${examples.basedir}</directory>
<filtering>true</filtering>
<includes>
<include>**/*.json</include>
</includes>
</resource>
</resources>
</configuration>
</execution>
</executions> </executions>
</plugin> </plugin>
<plugin> <plugin>
@ -405,6 +503,26 @@
</properties> </properties>
</configuration> </configuration>
</plugin> </plugin>
<plugin>
<groupId>org.commonjava.maven.plugins</groupId>
<artifactId>directory-maven-plugin</artifactId>
<executions>
<execution>
<id>keycloak-parent-basedir</id>
<goals>
<goal>directory-of</goal>
</goals>
<phase>initialize</phase>
<configuration>
<property>keycloak-parent.basedir</property>
<project>
<groupId>org.keycloak</groupId>
<artifactId>keycloak-parent</artifactId>
</project>
</configuration>
</execution>
</executions>
</plugin>
</plugins> </plugins>
</pluginManagement> </pluginManagement>
<plugins> <plugins>