diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/DeploymentTargetModifier.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/DeploymentTargetModifier.java index e3950d3306..f7fc8cfc06 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/DeploymentTargetModifier.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/DeploymentTargetModifier.java @@ -25,6 +25,7 @@ import org.jboss.logging.Logger; import java.util.List; +import java.util.Objects; import static org.keycloak.testsuite.arquillian.AppServerTestEnricher.getAppServerQualifier; /** @@ -51,9 +52,15 @@ public class DeploymentTargetModifier extends AnnotationDeploymentScenarioGenera if (appServerQualifier != null && !appServerQualifier.isEmpty()) { for (DeploymentDescription deployment : deployments) { - if (deployment.getTarget() == null || !deployment.getTarget().getName().startsWith(appServerQualifier)) { + final boolean containerMatches = deployment.getTarget() != null && deployment.getTarget().getName().startsWith(appServerQualifier); + + if (deployment.getTarget() == null || Objects.equals(deployment.getTarget().getName(), "_DEFAULT_")) { log.debug("Setting target container for " + deployment.getName() + ": " + appServerQualifier); deployment.setTarget(new TargetDescription(appServerQualifier)); + } else if (! containerMatches) { + throw new RuntimeException("Inconsistency found: target container for " + deployment.getName() + + " is set to " + deployment.getTarget().getName() + + " but the test class targets " + appServerQualifier); } } } diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/drone/HtmlUnitScreenshots.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/drone/HtmlUnitScreenshots.java index 5c6097ef95..1036d9184a 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/drone/HtmlUnitScreenshots.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/drone/HtmlUnitScreenshots.java @@ -39,7 +39,7 @@ public class HtmlUnitScreenshots { public void configureExtension(@Observes ScreenshooterExtensionConfigured event) { ScreenshooterConfiguration conf = configuration.get(); - if (System.getProperty("browser").equals("htmlUnit")) { + if (System.getProperty("browser", "htmlUnit").equals("htmlUnit")) { conf.setProperty("takeWhenTestFailed", "false"); log.info("Screenshots disabled as htmlUnit is used"); } else { diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/AbstractServletsAdapterTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/AbstractServletsAdapterTest.java index 235d15f8e0..744486793c 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/AbstractServletsAdapterTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/AbstractServletsAdapterTest.java @@ -31,6 +31,7 @@ import java.io.IOException; import java.net.URL; import java.util.List; +import org.junit.Assert; import static org.keycloak.testsuite.auth.page.AuthRealm.DEMO; import static org.keycloak.testsuite.util.IOUtil.loadRealm; @@ -74,7 +75,10 @@ public abstract class AbstractServletsAdapterTest extends AbstractAdapterTest { String webInfPath = baseSAMLPath + name + "/WEB-INF/"; URL keycloakSAMLConfig = AbstractServletsAdapterTest.class.getResource(webInfPath + "keycloak-saml.xml"); + Assert.assertNotNull("keycloak-saml.xml should be in " + webInfPath, keycloakSAMLConfig); + URL webXML = AbstractServletsAdapterTest.class.getResource(baseSAMLPath + webXMLPath); + Assert.assertNotNull("web.xml should be in " + baseSAMLPath + webXMLPath, keycloakSAMLConfig); WebArchive deployment = ShrinkWrap.create(WebArchive.class, name + ".war") .addClasses(servletClasses) diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/cluster/AbstractSAMLAdapterClusterTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/cluster/AbstractSAMLAdapterClusterTest.java index 3a87cdc694..ce95631d62 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/cluster/AbstractSAMLAdapterClusterTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/cluster/AbstractSAMLAdapterClusterTest.java @@ -55,7 +55,7 @@ import org.openqa.selenium.support.PageFactory; import org.openqa.selenium.support.ui.WebDriverWait; import static org.hamcrest.Matchers.*; -import static org.junit.Assert.assertThat; +import static org.keycloak.testsuite.AbstractAuthTest.createUserRepresentation; import static org.keycloak.testsuite.admin.Users.setPasswordFor; import static org.keycloak.testsuite.arquillian.AppServerTestEnricher.getNearestSuperclassWithAnnotation; import static org.keycloak.testsuite.auth.page.AuthRealm.DEMO; diff --git a/testsuite/integration-arquillian/tests/other/adapters/jboss/wildfly10/pom.xml b/testsuite/integration-arquillian/tests/other/adapters/jboss/wildfly10/pom.xml index 62c011cf01..c34b924f9f 100644 --- a/testsuite/integration-arquillian/tests/other/adapters/jboss/wildfly10/pom.xml +++ b/testsuite/integration-arquillian/tests/other/adapters/jboss/wildfly10/pom.xml @@ -48,6 +48,7 @@ wildfly10 + 2.0.0.Final \ No newline at end of file diff --git a/testsuite/integration-arquillian/tests/other/adapters/jboss/wildfly10/src/test/java/org/keycloak/testsuite/adapter/cluster/Wildfly10SAMLAdapterClusterTest.java b/testsuite/integration-arquillian/tests/other/adapters/jboss/wildfly10/src/test/java/org/keycloak/testsuite/adapter/cluster/Wildfly10SAMLAdapterClusterTest.java index f62f320ade..5a2644846e 100644 --- a/testsuite/integration-arquillian/tests/other/adapters/jboss/wildfly10/src/test/java/org/keycloak/testsuite/adapter/cluster/Wildfly10SAMLAdapterClusterTest.java +++ b/testsuite/integration-arquillian/tests/other/adapters/jboss/wildfly10/src/test/java/org/keycloak/testsuite/adapter/cluster/Wildfly10SAMLAdapterClusterTest.java @@ -40,13 +40,13 @@ import static org.keycloak.testsuite.adapter.AbstractServletsAdapterTest.samlSer @AppServerContainer("app-server-wildfly10") public class Wildfly10SAMLAdapterClusterTest extends AbstractSAMLAdapterClusterTest { - @TargetsContainer(value = "app-server-wildfly-" + NODE_1_NAME) + @TargetsContainer(value = "app-server-wildfly10-" + 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-wildfly-" + NODE_2_NAME) + @TargetsContainer(value = "app-server-wildfly10-" + NODE_2_NAME) @Deployment(name = EmployeeServletDistributable.DEPLOYMENT_NAME + "_2", managed = false) protected static WebArchive employee2() { return employee();