JBoss Community Archive (Read Only)

Arquillian Old

Multiple Deployments

Sometimes a single Deployment is not enough, and you need to specify more then one to get your test done. Maybe you want to test communication between two different web applications? Arquillian supports this as well. Simple just add more @Deployment methods to the test class and your done. You can use the @Deployment.order if they need to be deployed in a specific order. When dealing with multiple in container deployments you need to specify which Deployment context the individual test methods should run in. You do this by adding a name to the deployment by using the @Deployment.name and refer to that name on the test method by adding @OperateOnDeployment("deploymentName").

@Deployment(name = "dep1", order = 1)
public static WebArchive createDep1() {}

@Deployment(name = "dep2", order = 2)
public static WebArchive createDep2() {}

@Test @OperateOnDeployment("dep1")
public void testRunningInDep1() {}

@Test @OperateOnDeployment("dep2")
public void testRunningInDep2() {}
JBoss.org Content Archive (Read Only), exported from JBoss Community Documentation Editor at 2020-03-10 12:19:01 UTC, last content change 2011-04-16 15:40:30 UTC.