15

I've tried to learn the JBoss Arquillian, by following the formal document and got confused about the configuration, the arquillian.xml. Since it is mentioned once here.

Even I also found that there is a specific configuration describes at the container adapters section. It does not cover all elements/properties, e.g. engine and its property list, defaultProtocol, extension and group.

I'm worried and wondered, if there is any further or full explanation for this configuration file or not. Could you please help to shed some light on this configuration?

assylias
  • 321,522
  • 82
  • 660
  • 783
Charlee Chitsuk
  • 8,847
  • 2
  • 56
  • 71

1 Answers1

10

There's no single page in the Arquillian Reference Guide that contains your answer. This is partly because of the modular and extensible nature of Arquillian - extension can have their own configuration elements and properties.

To start with, the properties for containers are in the Container Adapters Section. Every adapter has it's own page where the container configuration is detailed. For instance, JBoss AS 7 has it's own page for it's container configuration (see the Configuration section on the page), and so do other containers.

Usually, you wouldn't need to configure the protocol yourself, for the values are usually managed by Arquillian, and usually do not require any overrides to be provided via arquillian.xml. But if you need them, they're in the Protocols section and in the child pages.

A group is merely a collection of containers, to used in cases where the container does not support clustering by default. You merely need to list multiple container configurations in a group element, as shown here.

Extension configuration is typically found in the Extensions child-pages.

The defaultProtocol element does not have any page of it's own. It is used to override the protocol specified by a container adapter, for all tests. There are only a few cases where you would need to use this element, most notably when you need to use the Servlet protocol instead of the JMX protocol for JBoss AS 7 (because the Servlet protocol of Arquillian is a more widely used and tested protocol than the JMX one).

A typical use of defaultProtocol would look like:

<defaultProtocol type="Servlet 3.0" />

where the type is the name of the protocol - "Servlet 2.5" and "Servlet 3.0" are valid values. You may also need to add the protocol dependency to your classpath when you change the default protocol of the container.

Vineet Reynolds
  • 76,006
  • 17
  • 150
  • 174
  • Thank you very much for your kindly explanation. – Charlee Chitsuk Apr 17 '12 at 00:55
  • 1
    I don't get the `default="true"` attribute of the `container` element. All I know is that it is required to be there for a container to actually work, but if I have multiple **different** containers, then having `default="true"` on each one or none will crash Arquillian. The configuration of containers is a real hastle and albeit needed to get a working test case. Yet this part of Arquillian is least documented of all parts if you ask me. Tried to read that new book too, but it sucks big time. Making me go even more insecure. – Martin Andersson Jan 31 '14 at 19:55
  • 2
    The [schema file](http://www.jboss.org/schema/arquillian/arquillian_1_0.xsd) has at least some documentation in it. – Martin Andersson Jan 31 '14 at 20:11
  • @vineet-reynolds https://docs.jboss.org/author/display/ARQ/ prefix are now read-only archived -links. Do you have insight into where they have moved too? – Bae Sep 21 '20 at 07:02