Skip to content

Commit

Permalink
Merge pull request #174 from jamezp/WFARQ-74
Browse files Browse the repository at this point in the history
[WFARQ-74] Switch around the abstracted container configurations so t…
  • Loading branch information
jamezp authored Aug 4, 2020
2 parents 479be05 + 8a0ffc2 commit 35e2cbd
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
import java.util.List;
import java.util.Scanner;

import org.jboss.arquillian.container.spi.ConfigurationException;
import org.jboss.arquillian.container.spi.client.deployment.Validate;

/**
* The container configuration for a managed WildFly based container.
*
Expand All @@ -27,13 +30,15 @@
* @since 3.0.0
*/
@SuppressWarnings({"unused", "MagicNumber", "InstanceVariableMayNotBeInitialized"})
public class CommonManagedContainerConfiguration extends DistributionContainerConfiguration {
public class CommonManagedContainerConfiguration extends CommonContainerConfiguration {

/**
* Default timeout value waiting on ports is 10 seconds
*/
private static final Integer DEFAULT_VALUE_WAIT_FOR_PORTS_TIMEOUT_SECONDS = 10;

private String javaHome = System.getenv("JAVA_HOME");

private int startupTimeoutInSeconds = 60;

private int stopTimeoutInSeconds = 60;
Expand All @@ -46,6 +51,21 @@ public class CommonManagedContainerConfiguration extends DistributionContainerCo

private Integer waitForPortsTimeoutInSeconds;

@Override
public void validate() throws ConfigurationException {
super.validate();
if (javaHome != null)
Validate.configurationDirectoryExists(javaHome, "javaHome '" + javaHome + "' must exist");
}

public String getJavaHome() {
return javaHome;
}

public void setJavaHome(String javaHome) {
this.javaHome = javaHome;
}

public void setStartupTimeoutInSeconds(int startupTimeoutInSeconds) {
this.startupTimeoutInSeconds = startupTimeoutInSeconds;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,15 @@
*
* @author <a href="mailto:[email protected]">Andrew Lee Rubinger</a>
*/
public class DistributionContainerConfiguration extends CommonContainerConfiguration {
public class DistributionContainerConfiguration extends CommonManagedContainerConfiguration {

private String jbossHome = System.getenv("JBOSS_HOME");

private String javaHome = System.getenv("JAVA_HOME");

private String modulePath = System.getProperty("module.path");

private String bundlePath = System.getProperty("bundle.path");

public DistributionContainerConfiguration() {
// if no javaHome is set use java.home of already running jvm
if (javaHome == null || javaHome.isEmpty()) {
javaHome = System.getProperty("java.home");
}
// if no jbossHome is set use jboss.home of already running jvm
if (jbossHome == null || jbossHome.isEmpty()) {
jbossHome = System.getProperty("jboss.home");
Expand All @@ -59,21 +53,6 @@ public void setJbossHome(String jbossHome) {
this.jbossHome = jbossHome;
}

/**
* @return the javaHome
*/
public String getJavaHome() {
return javaHome;
}

/**
* @param javaHome
* the javaHome to set
*/
public void setJavaHome(String javaHome) {
this.javaHome = javaHome;
}

public String getModulePath() {
return modulePath;
}
Expand All @@ -97,7 +76,5 @@ public void validate() throws ConfigurationException {
super.validate();
if (jbossHome != null)
Validate.configurationDirectoryExists(jbossHome, "jbossHome '" + jbossHome + "' must exist");
if (javaHome != null)
Validate.configurationDirectoryExists(javaHome, "javaHome '" + javaHome + "' must exist");
}
}
5 changes: 5 additions & 0 deletions container-bootable/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,11 @@
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skip>true</skip>
<systemProperties>
<!-- This is not used by the bootable container. This is only set for testing we fixed
WFARQ-74. -->
<jboss.home>${jboss.home}</jboss.home>
</systemProperties>
</configuration>
<executions>
<execution>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@
*/
package org.jboss.as.arquillian.container.managed;

import org.jboss.as.arquillian.container.CommonManagedContainerConfiguration;
import org.jboss.as.arquillian.container.DistributionContainerConfiguration;

/**
* The managed container configuration
*
* @author <a href="mailto:[email protected]">Aslak Knutsen</a>
* @author [email protected]
*/
public class ManagedContainerConfiguration extends CommonManagedContainerConfiguration {
public class ManagedContainerConfiguration extends DistributionContainerConfiguration {

private String javaVmArguments = System.getProperty("jboss.options");

Expand Down

0 comments on commit 35e2cbd

Please sign in to comment.