We've covered how a container gets selected, but how does Arquillian know how to locate or communicate with the container? That's where configuration comes in.
You can come a long way with default values, but at some point you may need to customize some of the container settings to fit your environment. Let's see how this can be done with Arquillian.
Arquillian will look for configuration settings in a file named arquillian.xml in the root of your classpath. If it exists it will be auto loaded, else default values will be used. This file is not a requirement.
Let's imagine that we're working for the company example.com and in our environment we have two servers; test.example.com and hudson.example.com. test.example.com is the JBoss instance we use for our integration tests and hudson.example.com is our continuous integration server that we want to run our integration suite from. By default, Arquillian will use localhost, so we need to tell it to use test.example.com to run the tests. The JBoss AS container by default use the Servlet protocol, so we have to override the default configuration.
<?xml version="1.0"?>
<arquillian xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://jboss.org/schema/arquillian"
xsi:schemaLocation="http://jboss.org/schema/arquillian http://www.jboss.org/schema/arquillian/arquillian_1_0.xsd">
<container qualifier="jbossas" default="true">
<configuration>
<property name="providerUrl">jnp://test.example.com:1099</property>
</configuration>
<protocol type="Servlet 3.0">
<property name="host">test.example.com</property>
<property name="port">8181</property>
</protocol>
</container>
</arquillian>
That should do it! Here we use the JBoss AS 6.0 Remote container which default use the Servlet 3.0 protocol implementation. We override the default Servlet configuration to say that the http requests for this container can be executed over test.example.com:8181, but we also need to configure the container so it knows where to deploy our archives. We could for example have configured the Servlet protocol to communicate with a Apache server in front of the JBoss AS Server if we wanted to. Each container has different configuration options.
For a complete overview of all the containers and their configuration options, see the container adapters appendix.