From a5c0cbc3b4d855d983625979920513171c11bc53 Mon Sep 17 00:00:00 2001 From: vramik Date: Thu, 31 May 2018 10:44:40 +0200 Subject: [PATCH] KEYCLOAK-7473 app-server-eap provider --- .../servers/app-server/jboss/eap/pom.xml | 15 +- .../eap/container/EAPAppServerProvider.java | 160 ++++++++++++++++++ ...arquillian.container.AppServerContainerSPI | 1 + .../integration-arquillian/tests/base/pom.xml | 159 +++++------------ .../containers/ContainerConstants.java | 3 + .../testsuite/util/ContainerAssume.java | 31 +++- .../adapter/AbstractAdapterTest.java | 11 -- ...a => AbstractServletAuthzAdapterTest.java} | 3 +- .../DefaultAuthzConfigAdapterTest.java | 1 + .../PermissiveModeAdapterTest.java | 1 + ...PhotozExampleLazyLoadPathsAdapterTest.java | 1 + ...otozExampleNoLazyLoadPathsAdapterTest.java | 1 + .../ServletAuthzCIPAdapterTest.java | 3 +- ...ServletAuthzCacheDisabledAdapterTest.java} | 3 +- ...ServletAuthzCacheLifespanAdapterTest.java} | 5 +- .../ServletAuthzLazyLoadPathsAdapterTest.java | 3 +- ...rvletAuthzNoLazyLoadPathsAdapterTest.java} | 5 +- .../ServletPolicyEnforcerTest.java | 1 + .../example/cors/CorsExampleAdapterTest.java | 1 + .../example/hal/ConsoleProtectionTest.java | 1 + .../BrokerLinkAndTokenExchangeTest.java | 1 + .../ClientInitiatedAccountLinkTest.java | 1 + .../servlet/DemoFilterServletAdapterTest.java | 1 + .../servlet/DemoServletsAdapterTest.java | 1 + .../OIDCPublicKeyRotationAdapterTest.java | 1 + .../servlet/OfflineServletsAdapterTest.java | 1 + .../servlet/SAMLFilterServletAdapterTest.java | 1 + .../servlet/SAMLServletsAdapterTest.java | 1 + .../SecuredDeploymentsAdapterTest.java | 18 +- .../servlet/SessionServletAdapterTest.java | 6 +- .../servlet/UserStorageConsentTest.java | 4 +- .../cluster/SAMLAdapterClusterTest.java | 6 +- .../crossdc/SAMLAdapterCrossDCTest.java | 1 + .../tests/other/adapters/jboss/eap/pom.xml | 65 ------- .../EAPClientInitiatedAccountLinkTest.java | 29 ---- .../testsuite/adapter/EAPOIDCAdapterTest.java | 13 -- .../EAPOIDCPublicKeyRotationAdapterTest.java | 28 --- .../adapter/EAPOIDCSessionAdapterTest.java | 13 -- .../EAPOfflineServletsAdapterTest.java | 11 -- .../testsuite/adapter/EAPSAMLAdapterTest.java | 12 -- .../adapter/EAPSAMLFilterAdapterTest.java | 11 -- .../EAPSecuredDeploymentsAdapterTest.java | 13 -- .../cluster/EAPSAMLAdapterClusterTest.java | 55 ------ .../EAPDefaultAuthzConfigAdapterTest.java | 30 ---- .../EAPPermissiveModeAdapterTest.java | 30 ---- .../EAPPhotozExampleAdapterTest.java | 30 ---- .../EAPServletAuthzAdapterTest.java | 31 ---- .../cors/EAPCorsExampleAdapterTest.java | 12 -- .../employee-distributable/WEB-INF/web.xml | 62 ------- .../EAP6ServletAuthzAdapterTest.java | 2 +- .../tests/other/adapters/jboss/pom.xml | 6 - .../RemoteDefaultAuthzConfigAdapterTest.java | 28 --- .../RemotePhotozExampleAdapterTest.java | 28 --- .../RemoteServletAuthzAdapterTest.java | 30 ---- .../Wildfly10ServletAuthzAdapterTest.java | 2 +- .../integration-arquillian/tests/pom.xml | 118 +++++++++++++ 56 files changed, 416 insertions(+), 695 deletions(-) create mode 100644 testsuite/integration-arquillian/servers/app-server/jboss/eap/src/main/java/org/keycloak/testsuite/arquillian/eap/container/EAPAppServerProvider.java create mode 100644 testsuite/integration-arquillian/servers/app-server/jboss/eap/src/main/resources/META-INF/services/org.keycloak.testsuite.arquillian.container.AppServerContainerSPI rename testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/example/authorization/{AbstractServletAuthzFunctionalAdapterTest.java => AbstractServletAuthzAdapterTest.java} (98%) rename testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/example/authorization/{ServletCacheDisabledAdapterTest.java => ServletAuthzCacheDisabledAdapterTest.java} (95%) rename testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/example/authorization/{ServletCacheLifespanAdapterTest.java => ServletAuthzCacheLifespanAdapterTest.java} (91%) rename testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/example/authorization/{ServletAuthzAdapterTest.java => ServletAuthzNoLazyLoadPathsAdapterTest.java} (89%) delete mode 100644 testsuite/integration-arquillian/tests/other/adapters/jboss/eap/pom.xml delete mode 100644 testsuite/integration-arquillian/tests/other/adapters/jboss/eap/src/test/java/org/keycloak/testsuite/adapter/EAPClientInitiatedAccountLinkTest.java delete mode 100644 testsuite/integration-arquillian/tests/other/adapters/jboss/eap/src/test/java/org/keycloak/testsuite/adapter/EAPOIDCAdapterTest.java delete mode 100644 testsuite/integration-arquillian/tests/other/adapters/jboss/eap/src/test/java/org/keycloak/testsuite/adapter/EAPOIDCPublicKeyRotationAdapterTest.java delete mode 100644 testsuite/integration-arquillian/tests/other/adapters/jboss/eap/src/test/java/org/keycloak/testsuite/adapter/EAPOIDCSessionAdapterTest.java delete mode 100644 testsuite/integration-arquillian/tests/other/adapters/jboss/eap/src/test/java/org/keycloak/testsuite/adapter/EAPOfflineServletsAdapterTest.java delete mode 100644 testsuite/integration-arquillian/tests/other/adapters/jboss/eap/src/test/java/org/keycloak/testsuite/adapter/EAPSAMLAdapterTest.java delete mode 100644 testsuite/integration-arquillian/tests/other/adapters/jboss/eap/src/test/java/org/keycloak/testsuite/adapter/EAPSAMLFilterAdapterTest.java delete mode 100644 testsuite/integration-arquillian/tests/other/adapters/jboss/eap/src/test/java/org/keycloak/testsuite/adapter/EAPSecuredDeploymentsAdapterTest.java delete mode 100644 testsuite/integration-arquillian/tests/other/adapters/jboss/eap/src/test/java/org/keycloak/testsuite/adapter/cluster/EAPSAMLAdapterClusterTest.java delete mode 100644 testsuite/integration-arquillian/tests/other/adapters/jboss/eap/src/test/java/org/keycloak/testsuite/adapter/example/authorization/EAPDefaultAuthzConfigAdapterTest.java delete mode 100644 testsuite/integration-arquillian/tests/other/adapters/jboss/eap/src/test/java/org/keycloak/testsuite/adapter/example/authorization/EAPPermissiveModeAdapterTest.java delete mode 100644 testsuite/integration-arquillian/tests/other/adapters/jboss/eap/src/test/java/org/keycloak/testsuite/adapter/example/authorization/EAPPhotozExampleAdapterTest.java delete mode 100644 testsuite/integration-arquillian/tests/other/adapters/jboss/eap/src/test/java/org/keycloak/testsuite/adapter/example/authorization/EAPServletAuthzAdapterTest.java delete mode 100644 testsuite/integration-arquillian/tests/other/adapters/jboss/eap/src/test/java/org/keycloak/testsuite/adapter/example/cors/EAPCorsExampleAdapterTest.java delete mode 100644 testsuite/integration-arquillian/tests/other/adapters/jboss/eap/src/test/resources/adapter-test/keycloak-saml/employee-distributable/WEB-INF/web.xml delete mode 100644 testsuite/integration-arquillian/tests/other/adapters/jboss/remote/src/test/java/org/keycloak/testsuite/adapter/example/authorization/RemoteDefaultAuthzConfigAdapterTest.java delete mode 100644 testsuite/integration-arquillian/tests/other/adapters/jboss/remote/src/test/java/org/keycloak/testsuite/adapter/example/authorization/RemotePhotozExampleAdapterTest.java delete mode 100644 testsuite/integration-arquillian/tests/other/adapters/jboss/remote/src/test/java/org/keycloak/testsuite/adapter/example/authorization/RemoteServletAuthzAdapterTest.java diff --git a/testsuite/integration-arquillian/servers/app-server/jboss/eap/pom.xml b/testsuite/integration-arquillian/servers/app-server/jboss/eap/pom.xml index 6d49e9dd14..0ea88de2e3 100644 --- a/testsuite/integration-arquillian/servers/app-server/jboss/eap/pom.xml +++ b/testsuite/integration-arquillian/servers/app-server/jboss/eap/pom.xml @@ -26,8 +26,8 @@ 4.0.0 integration-arquillian-servers-app-server-eap - pom - App Server - JBoss - EAP + jar + App Server - EAP eap @@ -43,4 +43,15 @@ false + + + org.keycloak.testsuite + integration-arquillian-servers-app-server-spi + ${project.version} + + + org.wildfly.arquillian + wildfly-arquillian-container-managed + + diff --git a/testsuite/integration-arquillian/servers/app-server/jboss/eap/src/main/java/org/keycloak/testsuite/arquillian/eap/container/EAPAppServerProvider.java b/testsuite/integration-arquillian/servers/app-server/jboss/eap/src/main/java/org/keycloak/testsuite/arquillian/eap/container/EAPAppServerProvider.java new file mode 100644 index 0000000000..ee9b9ea3e2 --- /dev/null +++ b/testsuite/integration-arquillian/servers/app-server/jboss/eap/src/main/java/org/keycloak/testsuite/arquillian/eap/container/EAPAppServerProvider.java @@ -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 Vlasta Ramik + */ +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 getContainers() { + List 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 + " "; + } +} diff --git a/testsuite/integration-arquillian/servers/app-server/jboss/eap/src/main/resources/META-INF/services/org.keycloak.testsuite.arquillian.container.AppServerContainerSPI b/testsuite/integration-arquillian/servers/app-server/jboss/eap/src/main/resources/META-INF/services/org.keycloak.testsuite.arquillian.container.AppServerContainerSPI new file mode 100644 index 0000000000..641dd44835 --- /dev/null +++ b/testsuite/integration-arquillian/servers/app-server/jboss/eap/src/main/resources/META-INF/services/org.keycloak.testsuite.arquillian.container.AppServerContainerSPI @@ -0,0 +1 @@ +org.keycloak.testsuite.arquillian.eap.container.EAPAppServerProvider diff --git a/testsuite/integration-arquillian/tests/base/pom.xml b/testsuite/integration-arquillian/tests/base/pom.xml index ed6b5bf252..a062c5bd71 100644 --- a/testsuite/integration-arquillian/tests/base/pom.xml +++ b/testsuite/integration-arquillian/tests/base/pom.xml @@ -340,134 +340,51 @@ ${wildfly.core.version} - org.commonjava.maven.plugins directory-maven-plugin - - - keycloak-parent-basedir - - directory-of - - initialize - - keycloak-parent.basedir - - org.keycloak - keycloak-parent - - - - + + + + + app-server-eap + + + app.server + eap + + + + eap + false + + + + org.keycloak.testsuite + integration-arquillian-servers-app-server-eap + ${project.version} + runtime + + + org.wildfly.arquillian + wildfly-arquillian-container-managed + + + + org.wildfly.core + wildfly-cli + test + ${wildfly.core.version} + + + + - maven-dependency-plugin - - - example-wars - generate-test-resources - - copy - - - - - org.keycloak.testsuite - hello-world-authz-service - ${project.version} - war - - - org.keycloak.testsuite - photoz-html5-client - ${project.version} - war - - - org.keycloak.testsuite - photoz-restful-api - ${project.version} - war - - - org.keycloak.testsuite - servlet-authz-app - ${project.version} - war - - - org.keycloak.testsuite - servlet-policy-enforcer - ${project.version} - war - - - org.keycloak.testsuite - integration-arquillian-test-apps-cors-angular-product - ${project.version} - war - - - org.keycloak.testsuite - integration-arquillian-test-apps-cors-database-service - ${project.version} - war - - - ${examples.home} - true - - - - - test-apps-realms - generate-test-resources - - unpack - - - - - org.keycloak.testsuite - integration-arquillian-test-apps-dist - ${project.version} - zip - **/*realm.json,**/*authz-service.json,**/testsaml.json,**/*-keycloak.json - - - ${examples.home} - true - - - - - - maven-resources-plugin - - - example-realms - generate-test-resources - - copy-resources - - - ${examples.home}/example-realms - true - - - ${examples.basedir} - true - - **/*.json - - - - - - + org.commonjava.maven.plugins + directory-maven-plugin diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/containers/ContainerConstants.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/containers/ContainerConstants.java index 3f2432245a..39bd6d319e 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/containers/ContainerConstants.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/containers/ContainerConstants.java @@ -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_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"; } diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/util/ContainerAssume.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/util/ContainerAssume.java index f062264fa7..c42baa6f7e 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/util/ContainerAssume.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/util/ContainerAssume.java @@ -1,18 +1,43 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * 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.util; +import org.jboss.logging.Logger; import org.junit.Assume; import org.keycloak.testsuite.arquillian.AuthServerTestEnricher; public class ContainerAssume { + private static final Logger log = Logger.getLogger(ContainerAssume.class); + public static void assumeNotAuthServerUndertow() { Assume.assumeFalse("Doesn't work on auth-server-undertow", 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")); + } + } diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/AbstractAdapterTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/AbstractAdapterTest.java index 63cddce4de..d33734519b 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/AbstractAdapterTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/AbstractAdapterTest.java @@ -47,7 +47,6 @@ import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.concurrent.TimeoutException; -import org.junit.Assume; /** * @AppServerContainer 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) { try { String contextXmlContent = IOUtils.toString(tomcatContext.openStream(), "UTF-8") diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/example/authorization/AbstractServletAuthzFunctionalAdapterTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/example/authorization/AbstractServletAuthzAdapterTest.java similarity index 98% rename from testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/example/authorization/AbstractServletAuthzFunctionalAdapterTest.java rename to testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/example/authorization/AbstractServletAuthzAdapterTest.java index 98c06cb566..b8f977307d 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/example/authorization/AbstractServletAuthzFunctionalAdapterTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/example/authorization/AbstractServletAuthzAdapterTest.java @@ -38,11 +38,12 @@ import java.util.List; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; +import static org.keycloak.testsuite.adapter.example.authorization.AbstractBaseServletAuthzAdapterTest.RESOURCE_SERVER_ID; /** * @author Pedro Igor */ -public abstract class AbstractServletAuthzFunctionalAdapterTest extends AbstractBaseServletAuthzAdapterTest { +public abstract class AbstractServletAuthzAdapterTest extends AbstractBaseServletAuthzAdapterTest { @Test public void testCanNotAccessWhenEnforcing() throws Exception { diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/example/authorization/DefaultAuthzConfigAdapterTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/example/authorization/DefaultAuthzConfigAdapterTest.java index 8184367003..8a7d169943 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/example/authorization/DefaultAuthzConfigAdapterTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/example/authorization/DefaultAuthzConfigAdapterTest.java @@ -47,6 +47,7 @@ import static org.keycloak.testsuite.util.IOUtil.loadRealm; * @author Pedro Igor */ @AppServerContainer(ContainerConstants.APP_SERVER_WILDFLY) +@AppServerContainer(ContainerConstants.APP_SERVER_EAP) public class DefaultAuthzConfigAdapterTest extends AbstractExampleAdapterTest { private static final String REALM_NAME = "hello-world-authz"; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/example/authorization/PermissiveModeAdapterTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/example/authorization/PermissiveModeAdapterTest.java index c7649b0f33..f1d2cbc8c3 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/example/authorization/PermissiveModeAdapterTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/example/authorization/PermissiveModeAdapterTest.java @@ -31,6 +31,7 @@ import org.keycloak.testsuite.arquillian.containers.ContainerConstants; * @author Pedro Igor */ @AppServerContainer(ContainerConstants.APP_SERVER_WILDFLY) +@AppServerContainer(ContainerConstants.APP_SERVER_EAP) public class PermissiveModeAdapterTest extends AbstractBaseServletAuthzAdapterTest { @Deployment(name = RESOURCE_SERVER_ID, managed = false) diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/example/authorization/PhotozExampleLazyLoadPathsAdapterTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/example/authorization/PhotozExampleLazyLoadPathsAdapterTest.java index 795df94d23..77060b8420 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/example/authorization/PhotozExampleLazyLoadPathsAdapterTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/example/authorization/PhotozExampleLazyLoadPathsAdapterTest.java @@ -29,6 +29,7 @@ import org.keycloak.testsuite.arquillian.containers.ContainerConstants; * @author Pedro Igor */ @AppServerContainer(ContainerConstants.APP_SERVER_WILDFLY) +@AppServerContainer(ContainerConstants.APP_SERVER_EAP) public class PhotozExampleLazyLoadPathsAdapterTest extends AbstractPhotozExampleAdapterTest { @Deployment(name = PhotozClientAuthzTestApp.DEPLOYMENT_NAME) diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/example/authorization/PhotozExampleNoLazyLoadPathsAdapterTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/example/authorization/PhotozExampleNoLazyLoadPathsAdapterTest.java index b04f70a6ab..14c3a8ca7e 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/example/authorization/PhotozExampleNoLazyLoadPathsAdapterTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/example/authorization/PhotozExampleNoLazyLoadPathsAdapterTest.java @@ -28,6 +28,7 @@ import org.keycloak.testsuite.arquillian.containers.ContainerConstants; * @author Pedro Igor */ @AppServerContainer(ContainerConstants.APP_SERVER_WILDFLY) +@AppServerContainer(ContainerConstants.APP_SERVER_EAP) public class PhotozExampleNoLazyLoadPathsAdapterTest extends AbstractPhotozExampleAdapterTest { @Deployment(name = PhotozClientAuthzTestApp.DEPLOYMENT_NAME) diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/example/authorization/ServletAuthzCIPAdapterTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/example/authorization/ServletAuthzCIPAdapterTest.java index e57bb3f033..cce30953ae 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/example/authorization/ServletAuthzCIPAdapterTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/example/authorization/ServletAuthzCIPAdapterTest.java @@ -29,7 +29,8 @@ import org.keycloak.testsuite.arquillian.containers.ContainerConstants; * @author Pedro Igor */ @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) public static WebArchive deployment() throws IOException { diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/example/authorization/ServletCacheDisabledAdapterTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/example/authorization/ServletAuthzCacheDisabledAdapterTest.java similarity index 95% rename from testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/example/authorization/ServletCacheDisabledAdapterTest.java rename to testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/example/authorization/ServletAuthzCacheDisabledAdapterTest.java index 2d5b691148..ad78799826 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/example/authorization/ServletCacheDisabledAdapterTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/example/authorization/ServletAuthzCacheDisabledAdapterTest.java @@ -31,7 +31,8 @@ import org.keycloak.testsuite.arquillian.containers.ContainerConstants; * @author Pedro Igor */ @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) public static WebArchive deployment() throws IOException { diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/example/authorization/ServletCacheLifespanAdapterTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/example/authorization/ServletAuthzCacheLifespanAdapterTest.java similarity index 91% rename from testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/example/authorization/ServletCacheLifespanAdapterTest.java rename to testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/example/authorization/ServletAuthzCacheLifespanAdapterTest.java index 7845b7afc8..74a74de926 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/example/authorization/ServletCacheLifespanAdapterTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/example/authorization/ServletAuthzCacheLifespanAdapterTest.java @@ -30,7 +30,8 @@ import org.keycloak.testsuite.arquillian.containers.ContainerConstants; * @author Pedro Igor */ @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) public static WebArchive deployment() throws IOException { @@ -60,7 +61,7 @@ public class ServletCacheLifespanAdapterTest extends AbstractServletAuthzFunctio permission.addResource(resource.getName()); permission.addPolicy("Deny Policy"); - permission = getAuthorizationResource().permissions().resource().create(permission).readEntity(ResourcePermissionRepresentation.class); + getAuthorizationResource().permissions().resource().create(permission).readEntity(ResourcePermissionRepresentation.class); login("alice", "alice"); assertWasNotDenied(); diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/example/authorization/ServletAuthzLazyLoadPathsAdapterTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/example/authorization/ServletAuthzLazyLoadPathsAdapterTest.java index a1ae4cf510..bdce273f77 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/example/authorization/ServletAuthzLazyLoadPathsAdapterTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/example/authorization/ServletAuthzLazyLoadPathsAdapterTest.java @@ -29,7 +29,8 @@ import org.keycloak.testsuite.arquillian.containers.ContainerConstants; * @author Pedro Igor */ @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) public static WebArchive deployment() throws IOException { diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/example/authorization/ServletAuthzAdapterTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/example/authorization/ServletAuthzNoLazyLoadPathsAdapterTest.java similarity index 89% rename from testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/example/authorization/ServletAuthzAdapterTest.java rename to testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/example/authorization/ServletAuthzNoLazyLoadPathsAdapterTest.java index 3b14d7b79b..470ed04100 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/example/authorization/ServletAuthzAdapterTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/example/authorization/ServletAuthzNoLazyLoadPathsAdapterTest.java @@ -27,11 +27,12 @@ import org.keycloak.testsuite.arquillian.containers.ContainerConstants; * @author Pedro Igor */ @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) public static WebArchive deployment() throws IOException { return exampleDeployment(RESOURCE_SERVER_ID); } -} +} \ No newline at end of file diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/example/authorization/ServletPolicyEnforcerTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/example/authorization/ServletPolicyEnforcerTest.java index ab66b00110..d42e463702 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/example/authorization/ServletPolicyEnforcerTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/example/authorization/ServletPolicyEnforcerTest.java @@ -53,6 +53,7 @@ import org.openqa.selenium.By; * @author Pedro Igor */ @AppServerContainer(ContainerConstants.APP_SERVER_WILDFLY) +@AppServerContainer(ContainerConstants.APP_SERVER_EAP) public class ServletPolicyEnforcerTest extends AbstractExampleAdapterTest { protected static final String REALM_NAME = "servlet-policy-enforcer-authz"; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/example/cors/CorsExampleAdapterTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/example/cors/CorsExampleAdapterTest.java index 4c297baef9..13221332ea 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/example/cors/CorsExampleAdapterTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/example/cors/CorsExampleAdapterTest.java @@ -57,6 +57,7 @@ import static org.keycloak.testsuite.util.WaitUtils.waitUntilElement; * Created by fkiss. */ @AppServerContainer(ContainerConstants.APP_SERVER_WILDFLY) +@AppServerContainer(ContainerConstants.APP_SERVER_EAP) public class CorsExampleAdapterTest extends AbstractExampleAdapterTest { public static final String CORS = "cors"; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/example/hal/ConsoleProtectionTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/example/hal/ConsoleProtectionTest.java index e0e24092f7..f9e4c90798 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/example/hal/ConsoleProtectionTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/example/hal/ConsoleProtectionTest.java @@ -49,6 +49,7 @@ import org.wildfly.extras.creaper.core.online.operations.Operations; * @author Pedro Igor */ @AppServerContainer(ContainerConstants.APP_SERVER_WILDFLY) +@AppServerContainer(ContainerConstants.APP_SERVER_EAP) public class ConsoleProtectionTest extends AbstractAdapterTest { // Javascript browser needed KEYCLOAK-4703 diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/BrokerLinkAndTokenExchangeTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/BrokerLinkAndTokenExchangeTest.java index a214e1e8c0..186e0cfe2e 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/BrokerLinkAndTokenExchangeTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/BrokerLinkAndTokenExchangeTest.java @@ -90,6 +90,7 @@ import static org.keycloak.testsuite.arquillian.DeploymentTargetModifier.AUTH_SE */ @AppServerContainer(ContainerConstants.APP_SERVER_UNDERTOW) @AppServerContainer(ContainerConstants.APP_SERVER_WILDFLY) +@AppServerContainer(ContainerConstants.APP_SERVER_EAP) public class BrokerLinkAndTokenExchangeTest extends AbstractServletsAdapterTest { public static final String CHILD_IDP = "child"; public static final String PARENT_IDP = "parent-idp"; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/ClientInitiatedAccountLinkTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/ClientInitiatedAccountLinkTest.java index fec513220c..0c19734a24 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/ClientInitiatedAccountLinkTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/ClientInitiatedAccountLinkTest.java @@ -74,6 +74,7 @@ import static org.keycloak.testsuite.admin.ApiUtil.createUserAndResetPasswordWit */ @AppServerContainer(ContainerConstants.APP_SERVER_UNDERTOW) @AppServerContainer(ContainerConstants.APP_SERVER_WILDFLY) +@AppServerContainer(ContainerConstants.APP_SERVER_EAP) public class ClientInitiatedAccountLinkTest extends AbstractServletsAdapterTest { public static final String CHILD_IDP = "child"; public static final String PARENT_IDP = "parent-idp"; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/DemoFilterServletAdapterTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/DemoFilterServletAdapterTest.java index d5b5c274ec..2b712f4b12 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/DemoFilterServletAdapterTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/DemoFilterServletAdapterTest.java @@ -24,6 +24,7 @@ import org.keycloak.testsuite.arquillian.containers.ContainerConstants; @AppServerContainer(ContainerConstants.APP_SERVER_UNDERTOW) @AppServerContainer(ContainerConstants.APP_SERVER_WILDFLY) +@AppServerContainer(ContainerConstants.APP_SERVER_EAP) @UseServletFilter(filterName = "oidc-filter", filterClass = "org.keycloak.adapters.servlet.KeycloakOIDCFilter", filterDependency = "org.keycloak:keycloak-servlet-filter-adapter", skipPattern = "/error.html") public class DemoFilterServletAdapterTest extends DemoServletsAdapterTest { diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/DemoServletsAdapterTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/DemoServletsAdapterTest.java index 863120b080..b9ab5d92af 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/DemoServletsAdapterTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/DemoServletsAdapterTest.java @@ -131,6 +131,7 @@ import static org.keycloak.testsuite.util.WaitUtils.waitForPageToLoad; */ @AppServerContainer(ContainerConstants.APP_SERVER_UNDERTOW) @AppServerContainer(ContainerConstants.APP_SERVER_WILDFLY) +@AppServerContainer(ContainerConstants.APP_SERVER_EAP) public class DemoServletsAdapterTest extends AbstractServletsAdapterTest { // Javascript browser needed KEYCLOAK-4703 diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/OIDCPublicKeyRotationAdapterTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/OIDCPublicKeyRotationAdapterTest.java index 45dabae698..2c9a716bbc 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/OIDCPublicKeyRotationAdapterTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/OIDCPublicKeyRotationAdapterTest.java @@ -80,6 +80,7 @@ import static org.keycloak.testsuite.util.WaitUtils.waitUntilElement; */ @AppServerContainer(ContainerConstants.APP_SERVER_UNDERTOW) @AppServerContainer(ContainerConstants.APP_SERVER_WILDFLY) +@AppServerContainer(ContainerConstants.APP_SERVER_EAP) public class OIDCPublicKeyRotationAdapterTest extends AbstractServletsAdapterTest { @Page diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/OfflineServletsAdapterTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/OfflineServletsAdapterTest.java index 619de470e7..4bc8a3d8ee 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/OfflineServletsAdapterTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/OfflineServletsAdapterTest.java @@ -37,6 +37,7 @@ import static org.keycloak.testsuite.util.WaitUtils.waitUntilElement; */ @AppServerContainer(ContainerConstants.APP_SERVER_UNDERTOW) @AppServerContainer(ContainerConstants.APP_SERVER_WILDFLY) +@AppServerContainer(ContainerConstants.APP_SERVER_EAP) public class OfflineServletsAdapterTest extends AbstractServletsAdapterTest { @Rule diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/SAMLFilterServletAdapterTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/SAMLFilterServletAdapterTest.java index fdedc82696..86c1dc8de1 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/SAMLFilterServletAdapterTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/SAMLFilterServletAdapterTest.java @@ -12,6 +12,7 @@ import org.keycloak.testsuite.arquillian.containers.ContainerConstants; * @author mhajas */ @AppServerContainer(ContainerConstants.APP_SERVER_WILDFLY) +@AppServerContainer(ContainerConstants.APP_SERVER_EAP) @UseServletFilter(filterName = "saml-filter", filterClass = "org.keycloak.adapters.saml.servlet.SamlFilter", filterDependency = "org.keycloak:keycloak-saml-servlet-filter-adapter") public class SAMLFilterServletAdapterTest extends SAMLServletsAdapterTest { diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/SAMLServletsAdapterTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/SAMLServletsAdapterTest.java index 60525ec3e8..c6f4d757fd 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/SAMLServletsAdapterTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/SAMLServletsAdapterTest.java @@ -151,6 +151,7 @@ import static org.keycloak.testsuite.util.WaitUtils.*; * @author mhajas */ @AppServerContainer(ContainerConstants.APP_SERVER_WILDFLY) +@AppServerContainer(ContainerConstants.APP_SERVER_EAP) public class SAMLServletsAdapterTest extends AbstractServletsAdapterTest { @Page protected BadClientSalesPostSigServlet badClientSalesPostSigServletPage; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/SecuredDeploymentsAdapterTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/SecuredDeploymentsAdapterTest.java index 8ef8720c87..2d85cf6450 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/SecuredDeploymentsAdapterTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/SecuredDeploymentsAdapterTest.java @@ -29,11 +29,13 @@ import org.keycloak.testsuite.adapter.page.ProductPortalSubsystem; import org.keycloak.testsuite.arquillian.annotation.AppServerContainer; 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.assertCurrentUrlStartsWithLoginUrlOf; @AppServerContainer(ContainerConstants.APP_SERVER_WILDFLY) +@AppServerContainer(ContainerConstants.APP_SERVER_EAP) public class SecuredDeploymentsAdapterTest extends AbstractServletsAdapterTest { @Page @@ -62,15 +64,17 @@ public class SecuredDeploymentsAdapterTest extends AbstractServletsAdapterTest { customerPortalSubsystem.navigateTo(); assertCurrentUrlStartsWithLoginUrlOf(testRealmPage); testRealmLoginPage.form().login("bburke@redhat.com", "password"); - String pageSource = driver.getPageSource(); - log.debug(pageSource); - assertTrue(pageSource.contains("Bill Burke") && pageSource.contains("Stian Thorgersen")); + assertPageContains("Bill Burke"); + assertPageContains("Stian Thorgersen"); productPortalSubsystem.navigateTo(); assertCurrentUrlEquals(productPortalSubsystem); - pageSource = driver.getPageSource(); - log.debug(pageSource); - assertTrue(pageSource.contains("iPhone") && pageSource.contains("iPad")); + assertPageContains("iPhone"); + assertPageContains("iPad"); } + private void assertPageContains(String string) { + String pageSource = driver.getPageSource(); + assertThat(pageSource, containsString(string)); + } } diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/SessionServletAdapterTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/SessionServletAdapterTest.java index 3165a3365e..55924fc9f3 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/SessionServletAdapterTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/SessionServletAdapterTest.java @@ -35,6 +35,7 @@ import org.keycloak.testsuite.auth.page.account.Sessions; import org.keycloak.testsuite.auth.page.login.Login; import org.keycloak.testsuite.arquillian.annotation.AppServerContainer; import org.keycloak.testsuite.arquillian.containers.ContainerConstants; +import org.keycloak.testsuite.util.ContainerAssume; import org.keycloak.testsuite.util.SecondBrowser; import org.openqa.selenium.By; 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_WILDFLY) +@AppServerContainer(ContainerConstants.APP_SERVER_EAP) public class SessionServletAdapterTest extends AbstractServletsAdapterTest { @Page @@ -124,7 +126,7 @@ public class SessionServletAdapterTest extends AbstractServletsAdapterTest { //KEYCLOAK-741 @Test public void testSessionInvalidatedAfterFailedRefresh() { - assumeNotOnAppServerUndertow(); + ContainerAssume.assumeNotAppServerUndertow(); RealmRepresentation testRealmRep = testRealmResource().toRepresentation(); ClientResource sessionPortalRes = null; for (ClientRepresentation clientRep : testRealmResource().clients().findAll()) { @@ -182,7 +184,7 @@ public class SessionServletAdapterTest extends AbstractServletsAdapterTest { //KEYCLOAK-1216 @Test public void testAccountManagementSessionsLogout() { - assumeNotOnAppServerUndertow(); + ContainerAssume.assumeNotAppServerUndertow(); // login as bburke loginAndCheckSession(testRealmLoginPage); testRealmSessions.navigateTo(); diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/UserStorageConsentTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/UserStorageConsentTest.java index 0c1dc1a86d..5b40ce8c5d 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/UserStorageConsentTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/UserStorageConsentTest.java @@ -55,6 +55,7 @@ import org.keycloak.testsuite.auth.page.login.PageWithLoginUrl; import org.keycloak.testsuite.federation.UserMapStorageFactory; import org.keycloak.testsuite.pages.ConsentPage; 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.util.URLAssert.assertCurrentUrlEquals; @@ -66,6 +67,7 @@ import static org.keycloak.testsuite.util.URLAssert.assertCurrentUrlStartsWithLo */ @AppServerContainer(ContainerConstants.APP_SERVER_UNDERTOW) @AppServerContainer(ContainerConstants.APP_SERVER_WILDFLY) +@AppServerContainer(ContainerConstants.APP_SERVER_EAP) public class UserStorageConsentTest extends AbstractServletsAdapterTest { @Page @@ -144,7 +146,7 @@ public class UserStorageConsentTest extends AbstractServletsAdapterTest { */ @Test public void testLogin() throws Exception { - assumeNotOnAppServerUndertow(); + ContainerAssume.assumeNotAppServerUndertow(); testingClient.server().run(UserStorageConsentTest::setupConsent); UserRepresentation memuser = new UserRepresentation(); diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/cluster/SAMLAdapterClusterTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/cluster/SAMLAdapterClusterTest.java index 278c076df2..e0d6be836f 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/cluster/SAMLAdapterClusterTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/cluster/SAMLAdapterClusterTest.java @@ -33,12 +33,16 @@ import static org.keycloak.testsuite.adapter.AbstractServletsAdapterTest.samlSer * @author hmlnarik */ @AppServerContainer(ContainerConstants.APP_SERVER_WILDFLY_CLUSTER) +@AppServerContainer(ContainerConstants.APP_SERVER_EAP_CLUSTER) public class SAMLAdapterClusterTest extends AbstractSAMLAdapterClusteredTest { @TargetsContainer(value = TARGET_CONTAINER_NODE_1) @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); + return samlServletDeployment( + EmployeeServletDistributable.DEPLOYMENT_NAME, + EmployeeServletDistributable.DEPLOYMENT_NAME + "/WEB-INF/web.xml", + SendUsernameServlet.class); } @TargetsContainer(value = TARGET_CONTAINER_NODE_2) diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/crossdc/SAMLAdapterCrossDCTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/crossdc/SAMLAdapterCrossDCTest.java index 3050dabf63..df20436981 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/crossdc/SAMLAdapterCrossDCTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/crossdc/SAMLAdapterCrossDCTest.java @@ -37,6 +37,7 @@ import static org.keycloak.testsuite.adapter.AbstractServletsAdapterTest.samlSer * @author hmlnarik */ @AppServerContainer(ContainerConstants.APP_SERVER_WILDFLY_CLUSTER) +@AppServerContainer(ContainerConstants.APP_SERVER_EAP_CLUSTER) public class SAMLAdapterCrossDCTest extends AbstractSAMLAdapterClusteredTest { @BeforeClass diff --git a/testsuite/integration-arquillian/tests/other/adapters/jboss/eap/pom.xml b/testsuite/integration-arquillian/tests/other/adapters/jboss/eap/pom.xml deleted file mode 100644 index a82dec233e..0000000000 --- a/testsuite/integration-arquillian/tests/other/adapters/jboss/eap/pom.xml +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - 4.0.0 - - - org.keycloak.testsuite - integration-arquillian-tests-adapters-jboss - 4.0.0.Final-SNAPSHOT - - - integration-arquillian-tests-adapters-eap - - Adapter Tests - JBoss - EAP - - - eap - - - - - org.wildfly.extras.creaper - creaper-core - test - 1.6.1 - - - com.google.guava - guava - - - - - org.wildfly.core - wildfly-cli - test - ${wildfly.core.version} - - - org.wildfly.core - wildfly-controller-client - test - ${wildfly.core.version} - - - - \ No newline at end of file diff --git a/testsuite/integration-arquillian/tests/other/adapters/jboss/eap/src/test/java/org/keycloak/testsuite/adapter/EAPClientInitiatedAccountLinkTest.java b/testsuite/integration-arquillian/tests/other/adapters/jboss/eap/src/test/java/org/keycloak/testsuite/adapter/EAPClientInitiatedAccountLinkTest.java deleted file mode 100644 index 7f5b3923c5..0000000000 --- a/testsuite/integration-arquillian/tests/other/adapters/jboss/eap/src/test/java/org/keycloak/testsuite/adapter/EAPClientInitiatedAccountLinkTest.java +++ /dev/null @@ -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 Vlastislav Ramik - */ -@AppServerContainer("app-server-eap") -public class EAPClientInitiatedAccountLinkTest extends ClientInitiatedAccountLinkTest { - -} diff --git a/testsuite/integration-arquillian/tests/other/adapters/jboss/eap/src/test/java/org/keycloak/testsuite/adapter/EAPOIDCAdapterTest.java b/testsuite/integration-arquillian/tests/other/adapters/jboss/eap/src/test/java/org/keycloak/testsuite/adapter/EAPOIDCAdapterTest.java deleted file mode 100644 index 33154d7bf9..0000000000 --- a/testsuite/integration-arquillian/tests/other/adapters/jboss/eap/src/test/java/org/keycloak/testsuite/adapter/EAPOIDCAdapterTest.java +++ /dev/null @@ -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 { - -} diff --git a/testsuite/integration-arquillian/tests/other/adapters/jboss/eap/src/test/java/org/keycloak/testsuite/adapter/EAPOIDCPublicKeyRotationAdapterTest.java b/testsuite/integration-arquillian/tests/other/adapters/jboss/eap/src/test/java/org/keycloak/testsuite/adapter/EAPOIDCPublicKeyRotationAdapterTest.java deleted file mode 100644 index 408df9abc9..0000000000 --- a/testsuite/integration-arquillian/tests/other/adapters/jboss/eap/src/test/java/org/keycloak/testsuite/adapter/EAPOIDCPublicKeyRotationAdapterTest.java +++ /dev/null @@ -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 Marek Posolda - */ -@AppServerContainer("app-server-eap") -public class EAPOIDCPublicKeyRotationAdapterTest extends OIDCPublicKeyRotationAdapterTest { -} diff --git a/testsuite/integration-arquillian/tests/other/adapters/jboss/eap/src/test/java/org/keycloak/testsuite/adapter/EAPOIDCSessionAdapterTest.java b/testsuite/integration-arquillian/tests/other/adapters/jboss/eap/src/test/java/org/keycloak/testsuite/adapter/EAPOIDCSessionAdapterTest.java deleted file mode 100644 index dc9d55fdf0..0000000000 --- a/testsuite/integration-arquillian/tests/other/adapters/jboss/eap/src/test/java/org/keycloak/testsuite/adapter/EAPOIDCSessionAdapterTest.java +++ /dev/null @@ -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 { - -} diff --git a/testsuite/integration-arquillian/tests/other/adapters/jboss/eap/src/test/java/org/keycloak/testsuite/adapter/EAPOfflineServletsAdapterTest.java b/testsuite/integration-arquillian/tests/other/adapters/jboss/eap/src/test/java/org/keycloak/testsuite/adapter/EAPOfflineServletsAdapterTest.java deleted file mode 100644 index e17065e661..0000000000 --- a/testsuite/integration-arquillian/tests/other/adapters/jboss/eap/src/test/java/org/keycloak/testsuite/adapter/EAPOfflineServletsAdapterTest.java +++ /dev/null @@ -1,11 +0,0 @@ -package org.keycloak.testsuite.adapter; - -import org.keycloak.testsuite.adapter.servlet.OfflineServletsAdapterTest; -import org.keycloak.testsuite.arquillian.annotation.AppServerContainer; - -/** - * @author Bruno Oliveira. - */ -@AppServerContainer("app-server-eap") -public class EAPOfflineServletsAdapterTest extends OfflineServletsAdapterTest { -} diff --git a/testsuite/integration-arquillian/tests/other/adapters/jboss/eap/src/test/java/org/keycloak/testsuite/adapter/EAPSAMLAdapterTest.java b/testsuite/integration-arquillian/tests/other/adapters/jboss/eap/src/test/java/org/keycloak/testsuite/adapter/EAPSAMLAdapterTest.java deleted file mode 100644 index 569fc76a7e..0000000000 --- a/testsuite/integration-arquillian/tests/other/adapters/jboss/eap/src/test/java/org/keycloak/testsuite/adapter/EAPSAMLAdapterTest.java +++ /dev/null @@ -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 { - -} diff --git a/testsuite/integration-arquillian/tests/other/adapters/jboss/eap/src/test/java/org/keycloak/testsuite/adapter/EAPSAMLFilterAdapterTest.java b/testsuite/integration-arquillian/tests/other/adapters/jboss/eap/src/test/java/org/keycloak/testsuite/adapter/EAPSAMLFilterAdapterTest.java deleted file mode 100644 index 14d83b125c..0000000000 --- a/testsuite/integration-arquillian/tests/other/adapters/jboss/eap/src/test/java/org/keycloak/testsuite/adapter/EAPSAMLFilterAdapterTest.java +++ /dev/null @@ -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 { -} diff --git a/testsuite/integration-arquillian/tests/other/adapters/jboss/eap/src/test/java/org/keycloak/testsuite/adapter/EAPSecuredDeploymentsAdapterTest.java b/testsuite/integration-arquillian/tests/other/adapters/jboss/eap/src/test/java/org/keycloak/testsuite/adapter/EAPSecuredDeploymentsAdapterTest.java deleted file mode 100644 index d81eb0ff8a..0000000000 --- a/testsuite/integration-arquillian/tests/other/adapters/jboss/eap/src/test/java/org/keycloak/testsuite/adapter/EAPSecuredDeploymentsAdapterTest.java +++ /dev/null @@ -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 { - -} diff --git a/testsuite/integration-arquillian/tests/other/adapters/jboss/eap/src/test/java/org/keycloak/testsuite/adapter/cluster/EAPSAMLAdapterClusterTest.java b/testsuite/integration-arquillian/tests/other/adapters/jboss/eap/src/test/java/org/keycloak/testsuite/adapter/cluster/EAPSAMLAdapterClusterTest.java deleted file mode 100644 index fdd95dfcd5..0000000000 --- a/testsuite/integration-arquillian/tests/other/adapters/jboss/eap/src/test/java/org/keycloak/testsuite/adapter/cluster/EAPSAMLAdapterClusterTest.java +++ /dev/null @@ -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); - } - -} diff --git a/testsuite/integration-arquillian/tests/other/adapters/jboss/eap/src/test/java/org/keycloak/testsuite/adapter/example/authorization/EAPDefaultAuthzConfigAdapterTest.java b/testsuite/integration-arquillian/tests/other/adapters/jboss/eap/src/test/java/org/keycloak/testsuite/adapter/example/authorization/EAPDefaultAuthzConfigAdapterTest.java deleted file mode 100644 index ed1dba5367..0000000000 --- a/testsuite/integration-arquillian/tests/other/adapters/jboss/eap/src/test/java/org/keycloak/testsuite/adapter/example/authorization/EAPDefaultAuthzConfigAdapterTest.java +++ /dev/null @@ -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 { - -} diff --git a/testsuite/integration-arquillian/tests/other/adapters/jboss/eap/src/test/java/org/keycloak/testsuite/adapter/example/authorization/EAPPermissiveModeAdapterTest.java b/testsuite/integration-arquillian/tests/other/adapters/jboss/eap/src/test/java/org/keycloak/testsuite/adapter/example/authorization/EAPPermissiveModeAdapterTest.java deleted file mode 100644 index e2b86d67ef..0000000000 --- a/testsuite/integration-arquillian/tests/other/adapters/jboss/eap/src/test/java/org/keycloak/testsuite/adapter/example/authorization/EAPPermissiveModeAdapterTest.java +++ /dev/null @@ -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 { - -} diff --git a/testsuite/integration-arquillian/tests/other/adapters/jboss/eap/src/test/java/org/keycloak/testsuite/adapter/example/authorization/EAPPhotozExampleAdapterTest.java b/testsuite/integration-arquillian/tests/other/adapters/jboss/eap/src/test/java/org/keycloak/testsuite/adapter/example/authorization/EAPPhotozExampleAdapterTest.java deleted file mode 100644 index 07b9844fc5..0000000000 --- a/testsuite/integration-arquillian/tests/other/adapters/jboss/eap/src/test/java/org/keycloak/testsuite/adapter/example/authorization/EAPPhotozExampleAdapterTest.java +++ /dev/null @@ -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 { - -} diff --git a/testsuite/integration-arquillian/tests/other/adapters/jboss/eap/src/test/java/org/keycloak/testsuite/adapter/example/authorization/EAPServletAuthzAdapterTest.java b/testsuite/integration-arquillian/tests/other/adapters/jboss/eap/src/test/java/org/keycloak/testsuite/adapter/example/authorization/EAPServletAuthzAdapterTest.java deleted file mode 100644 index 0ff9905fd8..0000000000 --- a/testsuite/integration-arquillian/tests/other/adapters/jboss/eap/src/test/java/org/keycloak/testsuite/adapter/example/authorization/EAPServletAuthzAdapterTest.java +++ /dev/null @@ -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 { - -} diff --git a/testsuite/integration-arquillian/tests/other/adapters/jboss/eap/src/test/java/org/keycloak/testsuite/adapter/example/cors/EAPCorsExampleAdapterTest.java b/testsuite/integration-arquillian/tests/other/adapters/jboss/eap/src/test/java/org/keycloak/testsuite/adapter/example/cors/EAPCorsExampleAdapterTest.java deleted file mode 100644 index 06898e030c..0000000000 --- a/testsuite/integration-arquillian/tests/other/adapters/jboss/eap/src/test/java/org/keycloak/testsuite/adapter/example/cors/EAPCorsExampleAdapterTest.java +++ /dev/null @@ -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 { - -} \ No newline at end of file diff --git a/testsuite/integration-arquillian/tests/other/adapters/jboss/eap/src/test/resources/adapter-test/keycloak-saml/employee-distributable/WEB-INF/web.xml b/testsuite/integration-arquillian/tests/other/adapters/jboss/eap/src/test/resources/adapter-test/keycloak-saml/employee-distributable/WEB-INF/web.xml deleted file mode 100644 index b57928f585..0000000000 --- a/testsuite/integration-arquillian/tests/other/adapters/jboss/eap/src/test/resources/adapter-test/keycloak-saml/employee-distributable/WEB-INF/web.xml +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - - - - - %CONTEXT_PATH% - - - javax.ws.rs.core.Application - /* - - - - /error.html - - - - - Application - /* - - - manager - - - - - KEYCLOAK-SAML - demo - - - - manager - - - - keycloak.sessionIdMapperUpdater.classes - org.keycloak.adapters.saml.wildfly.infinispan.InfinispanSessionCacheIdMapperUpdater - - diff --git a/testsuite/integration-arquillian/tests/other/adapters/jboss/eap6/src/test/java/org/keycloak/testsuite/adapter/example/authorization/EAP6ServletAuthzAdapterTest.java b/testsuite/integration-arquillian/tests/other/adapters/jboss/eap6/src/test/java/org/keycloak/testsuite/adapter/example/authorization/EAP6ServletAuthzAdapterTest.java index f7ac21a528..5833b298ab 100644 --- a/testsuite/integration-arquillian/tests/other/adapters/jboss/eap6/src/test/java/org/keycloak/testsuite/adapter/example/authorization/EAP6ServletAuthzAdapterTest.java +++ b/testsuite/integration-arquillian/tests/other/adapters/jboss/eap6/src/test/java/org/keycloak/testsuite/adapter/example/authorization/EAP6ServletAuthzAdapterTest.java @@ -25,6 +25,6 @@ import org.keycloak.testsuite.arquillian.annotation.AppServerContainer; */ @RunAsClient @AppServerContainer("app-server-eap6") -public class EAP6ServletAuthzAdapterTest extends AbstractServletAuthzFunctionalAdapterTest { +public class EAP6ServletAuthzAdapterTest extends AbstractServletAuthzAdapterTest { } diff --git a/testsuite/integration-arquillian/tests/other/adapters/jboss/pom.xml b/testsuite/integration-arquillian/tests/other/adapters/jboss/pom.xml index c66b83a966..31038bc237 100644 --- a/testsuite/integration-arquillian/tests/other/adapters/jboss/pom.xml +++ b/testsuite/integration-arquillian/tests/other/adapters/jboss/pom.xml @@ -71,12 +71,6 @@ - - app-server-eap - - eap - - app-server-eap6 diff --git a/testsuite/integration-arquillian/tests/other/adapters/jboss/remote/src/test/java/org/keycloak/testsuite/adapter/example/authorization/RemoteDefaultAuthzConfigAdapterTest.java b/testsuite/integration-arquillian/tests/other/adapters/jboss/remote/src/test/java/org/keycloak/testsuite/adapter/example/authorization/RemoteDefaultAuthzConfigAdapterTest.java deleted file mode 100644 index 9cb10d5316..0000000000 --- a/testsuite/integration-arquillian/tests/other/adapters/jboss/remote/src/test/java/org/keycloak/testsuite/adapter/example/authorization/RemoteDefaultAuthzConfigAdapterTest.java +++ /dev/null @@ -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 { - -} diff --git a/testsuite/integration-arquillian/tests/other/adapters/jboss/remote/src/test/java/org/keycloak/testsuite/adapter/example/authorization/RemotePhotozExampleAdapterTest.java b/testsuite/integration-arquillian/tests/other/adapters/jboss/remote/src/test/java/org/keycloak/testsuite/adapter/example/authorization/RemotePhotozExampleAdapterTest.java deleted file mode 100644 index fff70229ef..0000000000 --- a/testsuite/integration-arquillian/tests/other/adapters/jboss/remote/src/test/java/org/keycloak/testsuite/adapter/example/authorization/RemotePhotozExampleAdapterTest.java +++ /dev/null @@ -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 { - -} diff --git a/testsuite/integration-arquillian/tests/other/adapters/jboss/remote/src/test/java/org/keycloak/testsuite/adapter/example/authorization/RemoteServletAuthzAdapterTest.java b/testsuite/integration-arquillian/tests/other/adapters/jboss/remote/src/test/java/org/keycloak/testsuite/adapter/example/authorization/RemoteServletAuthzAdapterTest.java deleted file mode 100644 index 3f790ab354..0000000000 --- a/testsuite/integration-arquillian/tests/other/adapters/jboss/remote/src/test/java/org/keycloak/testsuite/adapter/example/authorization/RemoteServletAuthzAdapterTest.java +++ /dev/null @@ -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 { - -} diff --git a/testsuite/integration-arquillian/tests/other/adapters/jboss/wildfly10/src/test/java/org/keycloak/testsuite/adapter/example/authorization/Wildfly10ServletAuthzAdapterTest.java b/testsuite/integration-arquillian/tests/other/adapters/jboss/wildfly10/src/test/java/org/keycloak/testsuite/adapter/example/authorization/Wildfly10ServletAuthzAdapterTest.java index ac7dcfc302..b97170c69a 100644 --- a/testsuite/integration-arquillian/tests/other/adapters/jboss/wildfly10/src/test/java/org/keycloak/testsuite/adapter/example/authorization/Wildfly10ServletAuthzAdapterTest.java +++ b/testsuite/integration-arquillian/tests/other/adapters/jboss/wildfly10/src/test/java/org/keycloak/testsuite/adapter/example/authorization/Wildfly10ServletAuthzAdapterTest.java @@ -26,6 +26,6 @@ import org.keycloak.testsuite.arquillian.annotation.AppServerContainer; @RunAsClient @AppServerContainer("app-server-wildfly10") //@AdapterLibsLocationProperty("adapter.libs.wildfly") -public class Wildfly10ServletAuthzAdapterTest extends AbstractServletAuthzFunctionalAdapterTest { +public class Wildfly10ServletAuthzAdapterTest extends AbstractServletAuthzAdapterTest { } diff --git a/testsuite/integration-arquillian/tests/pom.xml b/testsuite/integration-arquillian/tests/pom.xml index f38d99644a..e48e0da835 100755 --- a/testsuite/integration-arquillian/tests/pom.xml +++ b/testsuite/integration-arquillian/tests/pom.xml @@ -204,6 +204,83 @@ ${app.server.skip.unpack} + + example-wars + generate-test-resources + + copy + + + ${app.server.skip.unpack} + + + org.keycloak.testsuite + hello-world-authz-service + ${project.version} + war + + + org.keycloak.testsuite + photoz-html5-client + ${project.version} + war + + + org.keycloak.testsuite + photoz-restful-api + ${project.version} + war + + + org.keycloak.testsuite + servlet-authz-app + ${project.version} + war + + + org.keycloak.testsuite + servlet-policy-enforcer + ${project.version} + war + + + org.keycloak.testsuite + integration-arquillian-test-apps-cors-angular-product + ${project.version} + war + + + org.keycloak.testsuite + integration-arquillian-test-apps-cors-database-service + ${project.version} + war + + + ${examples.home} + true + + + + test-apps-realms + generate-test-resources + + unpack + + + ${app.server.skip.unpack} + + + org.keycloak.testsuite + integration-arquillian-test-apps-dist + ${project.version} + zip + **/*realm.json,**/*authz-service.json,**/testsaml.json,**/*-keycloak.json + + + ${examples.home} + true + + @@ -247,6 +324,27 @@ + + example-realms + generate-test-resources + + copy-resources + + + ${app.server.skip.unpack} + ${examples.home}/example-realms + true + + + ${examples.basedir} + true + + **/*.json + + + + + @@ -405,6 +503,26 @@ + + org.commonjava.maven.plugins + directory-maven-plugin + + + keycloak-parent-basedir + + directory-of + + initialize + + keycloak-parent.basedir + + org.keycloak + keycloak-parent + + + + +