How to use a custom server configuration file for Arquillian

In this quick article we will learn how to provide a custom server configuration file to Arquillian Testing framework.

A simple and effective way to use a custom standalone.xml (or its variants) in Arquillian is to pass it via the System Properties contained in javaVmArguments of arquillian.xml.

Here’s an example of it:

<container qualifier="jbossas-managed"  default="true" >

  <configuration>

  <property name="jbossHome">${jbossHome}</property>

  <property name="outputToConsole">true</property>

  <property name="allowConnectingToRunningServer">true</property>

  <property name="javaVmArguments">-Xmx512m -XX:MaxPermSize=256m -Djboss.bind.address=${arquillian.localAddress}
                -Dserver-config=${project.basedir}/src/test/resources/test-standalone.xml
            </property>
  </configuration>
  </container>

Recommended Articles

Arquillian Tutorial: Setting Up Jakarta EE Project with Maven

Learn how to set up an Arquillian project for Jakarta EE using Maven. Simplify integration testing with Java middleware.

Arquillian Integration Testing Framework: A Comprehensive Guide to WAR and JAR Deployments

Master the art of Arquillian integration testing with our in-depth guide. Learn how to create, deploy, and manage WAR and JAR files using the framework.

Mastering Arquillian Resource Injection for Efficient Server Resource Management in Java Enterprise Applications

Learn how to leverage Arquillian's @ArquillianResource annotation to expose internal objects like Containers and Deployments in your tests, ensuring efficient server resource management.

Debugging Arquillian Tests with Eclipse IDE

Learn how to debug Arquillian test cases using Eclipse IDE, including remote socket debugging and managed profiles.