A DeployableContainer implementation that can connect to and run tests in a JBoss EAP 5.1 instance running locally or on a separate machine (effectively a different JVM). This implementation has no lifecycle support, so it can not be started or stopped.
Arquillian has adapters for the JBoss Application Server 5.1 (the community project), but does not have distinct adapters for the JBoss Enterprise Application Platform 5.1, the product based on the community project.
However, Arquillian can be configured to run tests on JBoss EAP 5.1 using a mix of JBoss AS 5.1 and JBoss AS 6.0 dependencies and by updating the JBoss EAP 5 profile service to disable authentication.
Container Injection Support Matrix
|@EJB||@EJB (no-interface)||@Inject (CDI)||@Inject (MC)||@PersistenceContext @PersistenceUnit|
If authentication is enabled in the JBoss EAP 5 profile service, Arquillian will be unable to deploy the archive. If that's the case, we'll need to disable it. (See the last section of this chapter to learn how to setup Arquillian to authenticate properly).
To disable authentication, edit the file deploy/profileservice-jboss-beans.xml and comment out the following beans nested within the ProfileServiceProxyFactory bean as shown:
Add the necessary Arquillian dependencies for executing the tests inside/against a JBoss EAP 5.1 server that has been started and is available via localhost. We'll use a Maven profile named arquillian-jboss-eap-5.1-remote.
Note that Arquillian with JBoss EAP 5.1 requires the JBoss AS 5.1 client, but the JBoss AS 6.0 profile service client.
The parent of the jboss-as-client dependency (jboss-as-parent) includes repository configuration for the old JBoss Maven repository (http://repository.jboss.org/maven2). Therefore, a mirror has to be configured in the Maven settings.xml file so that this repository is replaced with the new JBoss Nexus (Deprecated) repository (https://repository.jboss.org/nexus).
If you aren't able to disable the authentication on the profile service, you can instead configure Arquillian to authenticate properly.
If you haven't done so already, create an Arquillian configuration file, arquillian.xml, on the classpath (e.g., src/test/resources). Add the following container configuration for the JBoss EAP 5.1 adapter:
Next, create an authentication configuration file, auth.conf, on the classpath (e.g., src/test/resources).
Next, create a JNDI properties file, jndi.properties, on the classpath (e.g., src/test/resources) to set the authentication credentials and activate the configuration:
Finally, add a build element to the Maven profile defined above to set a system variable that activates the authentication configuration when the tests are run.
In summary, we added the contextFactory configuration property in arquillian.xml, an auth.conf file, a jndi.properties file and passed -Djava.security.auth.login.config= to the Maven Surefire plugin.
You can run the test in Eclipse using the the "Maven test" option provided by the Maven Integration for Eclipse plugin. The test will work just as it does from the commandline.
To run the test using the internal JUnit runner in Eclipse, you need to set java.security.auth.login.config needs in the Run Configuration for each test.