Interface Deployer
-
public interface DeployerThe Deployer interface describes how to deploy manually controlledDeployment's during test execution.By default
Deployment's are managed by Arquillian, which mean Arquillian will perform the deploy and undeploy operations for you automatically in the background. In some cases you might want a more fine grained control over the deployment lifecycle. e.g. You might need to test some kind of auto discovery feature of your application that happens during startup? In this case you can define aDeploymentto not beDeployment.managed()= false and use the Deployer to manually deploy and undeploy them at your own will.Usage Example:
@Deployment(name = "X", managed = false) public static WebArchive create() { return ShrinkWrap.create(WebArchive.class); } @ArquillianResource private Deployer deployer; @Test @RunAsClient public void shouldDeployX() { deployer.deploy("X"); }- Version:
- $Revision: $
- Author:
- Aslak Knutsen
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voiddeploy(String name)Deploy the named deployment.InputStreamgetDeployment(String name)Get the Deployment byte content.voidundeploy(String name)UnDeploy a named deployment.
The operation will block until deploy is complete.
-
-
-
Method Detail
-
deploy
void deploy(String name)
Deploy the named deployment.
The operation will block until deploy is complete.NOTE: If you want to run a test in a container, you cannot deploy a deployment from this test on the same container that the test is running in.
This is NOT correct for a test running in a container:
@Test @OperatesOnDeployment("X") public void deployTest() { deployer.deploy("X"); }If you run the test in this way for the very first deployment the test will be launched on the client side. If you try to redeploy a deployment from the container an exception will be thrown. In these cases please use the annotation
RunAsClienteither on the test method or on the whole test class to be sure, that the test is running on the client side.NOTE: You can still (re)deploy a deployment on a different container than the test is running in.
This IS correct for a test running in a container:
@Test @OperatesOnDeployment("X") public void deployTest() { deployer.deploy("Y"); }- Parameters:
name- The name of the deployment
-
getDeployment
InputStream getDeployment(String name)
Get the Deployment byte content.- Parameters:
name- The name of the Deployment as defined by Deployment- Returns:
- a Zipped Stream of the Archive
-
undeploy
void undeploy(String name)
UnDeploy a named deployment.
The operation will block until deploy is complete.- Parameters:
name- The name of the deployment
-
-