JBoss Community Archive (Read Only)

Arquillian

Protocol selection

A protocol is how Arquillian talks and executes the tests inside the container. For ease of development and configuration a container defines a default protocol that will be used if no other is specified. You can override this default behavior by defining the @OverProtocol annotation on your @Deployment method.

@Deployment @OverProtocol("MyCustomProtocol")
public static WebArchive createDep1() {}

@Test
public void testExecutedUsingCustomProtocol() {}

When testExecutedUsingCustomProtocol is executed, instead of using the containers protocol which is defined by default, Arquillian will use MyCustomProtocol to communicate with the container. Since this is defined on Deployment level, you can have different test methods which operate on different deployments and therefore being executed using different protocols. This can be useful when for instance a protocols packaging requirements hinder how you define your archive, or you simply can not communicate with the container using the default protocol due to e.g. firewall settings.

Arquillian only supports Servlet 2.5 and Servlet 3.0 at this time. EJB 3.0 and 3.1 are planned. But you might implement your own Protocol. For doing this, please see the Complete Protocol Reference for the better knowing what is currently supported.

JBoss.org Content Archive (Read Only), exported from JBoss Community Documentation Editor at 2020-03-10 09:40:17 UTC, last content change 2012-11-09 15:22:58 UTC.