Looking at the Arquillian documentation, I am aware that I can use the @ArquillianSuiteDeployment and @Deployment annotations to deploy my desired jars/wars to the container. Example:
@ArquillianSuiteDeployment
public class MyDeployer {
@Deployment(name = "myapp", order = 1, testable = false)
public static Archive<?> myDeploymentJar() {
final File file = Maven.configureResolver().fromFile(System.getProperty("settings.xml"))
.loadPomFromFile("pom.xml").resolve("com.myapp:test-app").withoutTransitivity()
.asSingleFile();
final JavaArchive jar = ShrinkWrap.createFromZipFile(JavaArchive.class, file);
final JavaArchive archive = ShrinkWrap.create(JavaArchive.class, "test-app.jar").merge(jar);
return archive;
}
}
Let's infer that I have two more jars that I would like to deploy, but never together during the same test, JAR-A and JAR-C.
@Test
@RunAsClient
public void testOne() {
// deploy JAR-A before all others, but do not deploy JAR-C
}
@Test
@RunAsClient
public void testTwo() {
// deploy JAR-C before all others, but do not deploy JAR-A
}
Is it possible to introduce a conditional @Deployment that would go along with my tests?