Appendix. Masking multiple containers with Arquillian Chameleon

 

Testing against several containers (WildFly, Glassfish, Tomcat, and so on) or even switching between different modes (managed, remote, or embedded) invariably results in a bloated pom.xml file. You’ll encounter the following problems:

  • You need to register a specific dependency for each container and mode that you want to test against, which also requires several profiles.
  • In the case of a managed container, you need to download, install, and possibly configure the application server.

Chameleon containers (https://github.com/arquillian/arquillian-container-chameleon) can quickly adapt to your needs without requiring additional dependency configuration. To use this approach, do as you usually would in Arquillian, but add a Chameleon container to pom.xml instead of an application server–specific artifact:

<dependency>
  <groupId>org.jboss.arquillian.junit</groupId>
  <artifactId>arquillian-junit-container</artifactId>
  <scope>test</scope>
</dependency>
<dependency>
  <groupId>org.arquillian.container</groupId>
  <artifactId>arquillian-container-chameleon</artifactId>
  <version>1.0.0.Beta2</version>
  <scope>test</scope>
</dependency>

Then, add this configuration to arquillian.xml: