Skip to content

Instantly share code, notes, and snippets.

@aslakknutsen
Created April 7, 2011 22:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aslakknutsen/908934 to your computer and use it in GitHub Desktop.
Save aslakknutsen/908934 to your computer and use it in GitHub Desktop.
Before/After
@RunWith(Arquillian.class)
public class BeforeAfterTest {
@Deployment(name = "X") @TargetsContainer("A")
public static void WebArchive create1() {}
@Deployment(name = "Y") @TargetsContainer("B")
public static void WebArchive create1() {}
// executed incontainer with testInContainerOnContainerA
@Before @OperateOnDeployment("X")
public void beforeInContainerWhenTestRunAgainstX() {}
// executed on client with testAsClientInContextOfDeploymentX
@Before @RunAsClient @OperateOnDeployment("X")
public void beforeOnClientWhenTestRunAgainstX() {}
// executed incontainer with testInContainerOnContainerB
@Before @OperateOnDeployment("Y")
public void beforeInContainerWhenTestRunAgainstY() {}
@Test @OperateOnDeployment("X")
public void testInContainerOnContainerA() {}
@Test @OperateOnDeployment("Y")
public void testInContainerOnContainerB() {}
@Test @RunAsClient @OperateOnDeployment("X")
public void testAsClientInContextOfDeploymentX() {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment