-
1. Re: Multi-deployment Test Cases
aslak Nov 30, 2012 3:30 AM (in response to meetoblivion)John Ament wrote:
@Deployment(testable=false,order=1)
public static JavaArchive[] createTestArchive() {
return {ShrinkWrap.create(JavaArchive.class, "test1.jar")..,
ShrinkWrap.create(JavaArchive.class, "test2.jar")..,
ShrinkWrap.create(JavaArchive.class, "test3.jar")..};
}
@Deployment(order=2)
public static JavaArchive createTestArchive() {
return ShrinkWrap.create(JavaArchive.class, "test4.jar")..;
}
One issue is that the name has to be specified with multiple deployments - can the name be derived by archive.getName() ?
It could work if all archive.getName() is unique. Deployment.name is used to match with @OperatesOnDeployment. In a clustered setup you would have two archives with the same name targets for two different containers.
Look at the DeploymentScenarioGenerator SPI:
The AnnotationDeploymentScenarioGenerator is the default impl: