An Arquillian container adapter (DeployableContainer implementation) that can start and stop a local JBoss AS 7.1 or JBoss EAP 6.0 process and run tests on it over a remote protocol (effectively in a different JVM).

Container Injection Support Matrix

@EJB

@EJB (no-interface)

@Inject (CDI)

@Resource

@PersistenceContext / @PersistenceUnit

The JBoss AS 7 container adapters also support OSGi Bundle / Context injection in OSGi modules and Module Contexts/ServiceController when developing Modules (only when using the jmx-as7 protocol).

Configuration

Default Protocol: jmx-as7

Container Configuration Options

Name

Type

Default

Description

jbossHome

String

$JBOSS_HOME

The JBoss configuration to start.

javaHome

String

$JAVA_HOME

The Java runtime to use to start the server.

modulePath

String

$module.path

The location of the module repository.

javaVmArguments

String

-Xmx512m -XX:MaxPermSize=128m

JVM arguments used to start the server.

startupTimeoutInSeconds

int

30

Time to wait before throwing Exception on server startup.

outputToConsole

boolean

true

Should the server startup console log be piped to the console

serverConfig

String

standalone.xml

Which server configuration file to startup with

managementAddress

String

127.0.0.1

The ip address of the running server instances manage interface

managementPort

int

9999

The management port for deployment

allowConnectingToRunningServer

boolean

false

If true, if a running AS is found on managementPort, it is used; if false, fails.

username

String

null

The username for the ManagementRealm (not required by default)

password

String

null

The password for the ManagementRealm (not required by default)

Example Maven profile:

By default, the JBoss AS 7 container adapters execute tests over JMX. If the test relies on CDI scopes to be active, they will not work on this protocol. You can configure Arquillian to run tests using the Servlet protocol instead, which is the default for most other Arquillian Java EE adapters.

First, you need to add the Servlet protocol dependency to the Maven profile. The version of the Servlet protocol dependency is managed by the Arquillian BOM, which you should have configured in the dependency management section.

Next, you need to set the default protocol in the arquillian.xml descriptor:

At the moment, this setting changes the default protocol for all container adapters. There's an open issue for making the default protocol configurable per container adapter (see ARQ-579).

MacOS with Java 7If you are on Mac OS with Java 7 you might get the following error while running tests:

This is an issue in Java 7, and you can work around this by adding a VM paramter.