diff --git a/testsuite/integration-arquillian/tests/adapters/as7/pom.xml b/testsuite/integration-arquillian/tests/adapters/as7/pom.xml
index b63ae88213..88e4732302 100644
--- a/testsuite/integration-arquillian/tests/adapters/as7/pom.xml
+++ b/testsuite/integration-arquillian/tests/adapters/as7/pom.xml
@@ -23,12 +23,6 @@
org.wildfly
wildfly-arquillian-container-managed
-
-
- org.jboss.as
- jboss-as-arquillian-container-managed
- ${as7.version}
-
org.jboss.as
jboss-as-dist
diff --git a/testsuite/integration-arquillian/tests/adapters/eap6/pom.xml b/testsuite/integration-arquillian/tests/adapters/eap6/pom.xml
index cc82d36128..c74baa64a3 100644
--- a/testsuite/integration-arquillian/tests/adapters/eap6/pom.xml
+++ b/testsuite/integration-arquillian/tests/adapters/eap6/pom.xml
@@ -19,16 +19,16 @@
-
+
-
+
org.jboss.as
jboss-as-dist
diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/ContainersTestEnricher.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/ContainersTestEnricher.java
index 2512d1c321..b2175d32a9 100644
--- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/ContainersTestEnricher.java
+++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/ContainersTestEnricher.java
@@ -127,60 +127,7 @@ public class ContainersTestEnricher {
alreadyStopped = true;
}
- if (!alreadyInstalled && !skipInstallAdapters && isJBossBased(container)) {
- String jbossCliPath = jbossHomePath + "/bin/jboss-cli.sh";
- String adapterScriptPathArg = "--file=" + jbossHomePath + "/bin/adapter-install.cli";
- String samlAdapterScriptPathArg = "--file=" + jbossHomePath + "/bin/adapter-install-saml.cli";
- String managementPort = container.getContainerConfiguration().getContainerProperties().get("managementPort");
- String controllerArg = "--controller=localhost:" + managementPort;
-
- log.info("Installing adapter to app server via cli script");
- execCommand(new String[]{"/bin/sh", jbossCliPath, "--connect", adapterScriptPathArg, controllerArg});
- log.info("Installing saml adapter to app server via cli script");
- execCommand(new String[]{"/bin/sh", jbossCliPath, "--connect", samlAdapterScriptPathArg, controllerArg});
- log.info("Restarting container");
- execCommand(new String[]{"/bin/sh", jbossCliPath, "--connect", "--command=:reload", controllerArg});
- pause(5000);
- log.info("Container restarted");
- checkServerLog(jbossHomePath);
- if (container.getName().startsWith("app-server")) {
- alreadyInstalled = true;
- }
- }
- }
-
- private void execCommand(String... command) throws IOException, InterruptedException {
- Process process = Runtime.getRuntime().exec(command);
-
- if (process.waitFor(10, TimeUnit.SECONDS)) {
- if (process.exitValue() != 0) {
- throw new RuntimeException("Adapter installation failed. Process exitValue: "
- + process.exitValue() + "; \n" + getOutput(process.getErrorStream())
- + "");
- }
- log.debug("process.isAlive(): " + process.isAlive());
- } else {
- process.destroyForcibly();
- throw new RuntimeException("Timeout after 10 seconds.");
- }
- }
-
- private String getOutput(InputStream is) throws IOException {
- BufferedReader reader = new BufferedReader(new InputStreamReader(is));
- StringBuilder builder = new StringBuilder();
- while (reader.ready()) {
- builder.append(reader.readLine());
- }
- return builder.toString();
- }
-
- private boolean isJBossBased(Container container) {
- if (container == null) {
- return false;
- }
- return container.getName().matches("a.*-server-wildfly")
- || container.getName().matches("a.*-server-eap.")
- || container.getName().equals("app-server-as7");
+ installAdapters(container);
}
/*
@@ -326,4 +273,60 @@ public class ContainersTestEnricher {
return "http://localhost:" + Integer.parseInt(System.getProperty("app.server.http.port", "8280"));
}
+ private void installAdapters(Container container) throws InterruptedException, IOException {
+ if (!alreadyInstalled && !skipInstallAdapters && isJBossBased(container)) {
+ String jbossCliPath = jbossHomePath + "/bin/jboss-cli.sh";
+ String adapterScriptPathArg = "--file=" + jbossHomePath + "/bin/adapter-install.cli";
+ String samlAdapterScriptPathArg = "--file=" + jbossHomePath + "/bin/adapter-install-saml.cli";
+ String managementPort = container.getContainerConfiguration().getContainerProperties().get("managementPort");
+ String controllerArg = "--controller=localhost:" + managementPort;
+
+ log.info("Installing adapter to app server via cli script");
+ execCommand(new String[]{"/bin/sh", jbossCliPath, "--connect", adapterScriptPathArg, controllerArg});
+ log.info("Installing saml adapter to app server via cli script");
+ execCommand(new String[]{"/bin/sh", jbossCliPath, "--connect", samlAdapterScriptPathArg, controllerArg});
+ log.info("Restarting container");
+ execCommand(new String[]{"/bin/sh", jbossCliPath, "--connect", "--command=:reload", controllerArg});
+ pause(5000);
+ log.info("Container restarted");
+ checkServerLog(jbossHomePath);
+ if (container.getName().startsWith("app-server")) {
+ alreadyInstalled = true;
+ }
+ }
+ }
+
+ private void execCommand(String... command) throws IOException, InterruptedException {
+ Process process = Runtime.getRuntime().exec(command);
+
+ if (process.waitFor(10, TimeUnit.SECONDS)) {
+ if (process.exitValue() != 0) {
+ throw new RuntimeException("Adapter installation failed. Process exitValue: "
+ + process.exitValue() + "; \n" + getOutput(process.getErrorStream())
+ + "");
+ }
+ log.debug("process.isAlive(): " + process.isAlive());
+ } else {
+ process.destroyForcibly();
+ throw new RuntimeException("Timeout after 10 seconds.");
+ }
+ }
+
+ private String getOutput(InputStream is) throws IOException {
+ BufferedReader reader = new BufferedReader(new InputStreamReader(is));
+ StringBuilder builder = new StringBuilder();
+ while (reader.ready()) {
+ builder.append(reader.readLine());
+ }
+ return builder.toString();
+ }
+
+ private boolean isJBossBased(Container container) {
+ if (container == null) {
+ return false;
+ }
+ return container.getName().matches("a.*-server-wildfly")
+ || container.getName().matches("a.*-server-eap.")
+ || container.getName().equals("app-server-as7");
+ }
}