|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT |
@Documented @Retention(value=RUNTIME) @Target(value={METHOD,FIELD,PARAMETER}) public @interface OperateOnDeployment
Defines that the target should operate within the context of the referenced deployment.
When using multiple Deployment
's within the same TestCase you need to specify which deployment the
individual test methods should operate on.
Within the context of a deployment you will have access to the meta data provided by the deployment and the container where it is deployed, e.g. URLs
Usage Example for test method:
@Deployment(name = "X")
public static WebArchive create() {
return ShrinkWrap.create(WebArchive.class)
.addClass(MyServletX.class);
}
@Deployment(name = "Y")
public static WebArchive create() {
return ShrinkWrap.create(WebArchive.class)
.addClass(MyServletY.class);
}
@Test @OperatesOnDeployment("X")
public void shouldExecuteInX() { ... }
@Test @OperatesOnDeployment("Y")
public void shouldExecuteInY() { ... }
Additionally you can reference another deployments metadata from within another context by qualifiing
OperateOnDeployment on ArquillianResource injection points.
Usage Example for ArquillianResource:
@Deployment(name = "X")
public static WebArchive create() {
return ShrinkWrap.create(WebArchive.class)
.addClass(MyServletX.class);
}
@Deployment(name = "Y")
public static WebArchive create() {
return ShrinkWrap.create(WebArchive.class)
.addClass(MyServletY.class);
}
@Test @OperatesOnDeployment("X")
public void shouldExecuteInX() { ... }
@Test @OperatesOnDeployment("Y") @RunAsClient
public void shouldExecuteInY(@ArquillianResource @OperateOnDeployment("X") URL deploymentXURLContext) { ... }
Required Element Summary | |
---|---|
String |
value
Refer to the deployment name this should operate on. |
Element Detail |
---|
public abstract String value
Deployment.name()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT |