Skip to end of metadata
Go to start of metadata

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 and in our environment we have two servers; and is the JBoss instance we use for our integration tests and 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 to run the tests. The JBoss AS container by default use the Servlet protocol, so we have to override the default configuration.

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, 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.
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.
  1. Jun 10, 2011

    The XML schema reference doesn't work that well for me inside IntelliJ IDEA.    I think it's because the target namespace in the XSD doesn't match the xmlns reference in the example.   Here is what works for me:

    So, basically instead of

  2. Feb 25, 2012

    This part is to terse to be helpful, please add the source of the configaration rules to allow adaption to other containers and some real world examples.

    For instance, how the arquillian.xml would look for a glassfish 3.1 embedded configuration?

    How and where to tell the glassfish embedded to find the jdbc driver to connect to a data source?

    How to configure a data source?

    what goes into the arquillian.xml and what has to be configured in the pom?

    Do the container configuration options have any relation with the arquillian.xml or are they pom only?

  3. Apr 12, 2013

    For me, to make the code completion works at NetBeans I needed to update the schema as follow:

    1. Jul 25, 2014

      It's not just NetBeans, it's any IDE because the schema location had changed.

      I updated the example, thanks for the tip! :)