Skip to content

Commit

Permalink
MAke JAVA_OPTS configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
kifj committed May 1, 2024
1 parent a178990 commit 5c2af16
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1087,6 +1087,7 @@
<GC_METASPACE_SIZE>256</GC_METASPACE_SIZE>
<MP_METRICS_TAGS>_app=stomp-test,version=1.8</MP_METRICS_TAGS>
<SERVICE_NAME>stomp-test</SERVICE_NAME>
<MP_HEALTH_EMPTY_LIVENESS_CHECKS_STATUS>DOWN</MP_HEALTH_EMPTY_LIVENESS_CHECKS_STATUS>
</env>
<serviceAccount>jgroups-kubeping-service-account</serviceAccount>
</resources>
Expand Down
9 changes: 7 additions & 2 deletions src/test/java/x1/arquillian/WildflyContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ public class WildflyContainer extends GenericContainer<WildflyContainer> {
private static final int MGMT_PORT = 9990;
private static final int DEBUG_PORT = 8787;

private static final String JAVA_OPTS = "-server -Xms64m -Xmx512m -XX:MetaspaceSize=96M -XX:MaxMetaspaceSize=256m -XX:+UseG1GC -XX:+UseStringDeduplication -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true";

public WildflyContainer() {
this("registry.x1/j7beck/x1-wildfly-profile:32.0.0.Final");
}
Expand Down Expand Up @@ -75,13 +77,16 @@ public WildflyContainer withConfigurationDirectory(String directory) {
}

public WildflyContainer withRemoteDebug() {
return withRemoteDebug(JAVA_OPTS);
}

public WildflyContainer withRemoteDebug(String javaOpts) {
if (Boolean.getBoolean("arquillian.remote.debug")) {
var suspend = Boolean.getBoolean("arquillian.remote.debug.suspend") ? "y" : "n";
LOGGER.info("Enable remote debugging on port {} with suspend={}", DEBUG_PORT, suspend);
addFixedExposedPort(DEBUG_PORT, DEBUG_PORT);
withEnv("JAVA_OPTS",
"-server -Xms64m -Xmx512m -XX:MetaspaceSize=96M -XX:MaxMetaspaceSize=256m -XX:+UseG1GC -XX:+UseStringDeduplication -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true -agentlib:jdwp=transport=dt_socket,address=*:"
+ DEBUG_PORT + ",server=y,suspend=" + suspend);
javaOpts + " -agentlib:jdwp=transport=dt_socket,address=*:" + DEBUG_PORT + ",server=y,suspend=" + suspend);
}
return this;
}
Expand Down
1 change: 1 addition & 0 deletions src/test/resources/wildfly-testcontainers.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ DB_PASSWORD=stocks
ETCD_SERVER=etcd
ETCD_PORT=2379
X1_SERVICE_REGISTRY_STAGE=docker
#MP_HEALTH_EMPTY_LIVENESS_CHECKS_STATUS=UP

0 comments on commit 5c2af16

Please sign in to comment.