Created
May 8, 2012 22:46
-
-
Save mojavelinux/2640101 to your computer and use it in GitHub Desktop.
Arquillian test with deployment defined on static field
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@RunWith(Arquillian.class) | |
public class AGreeterTest { | |
@Deployment | |
public static JavaArchive archive = ShrinkWrap.create(JavaArchive.class) | |
.addClasses(Greeter.class, PhraseBuilder.class) | |
.addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml"); | |
@Inject | |
Greeter greeter; | |
@Test | |
public void should_create_greeting() { | |
Assert.assertEquals("Hello, Earthling!", greeter.createGreeting("Earthling")); | |
greeter.greet(System.out, "Earthling"); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@RunWith(Arquillian.class) | |
public class BGreeterTest { | |
@Deployment | |
public static JavaArchive archive; | |
static { | |
archive = ShrinkWrap.create(JavaArchive.class) | |
.addClasses(Greeter.class, PhraseBuilder.class) | |
.addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml"); | |
} | |
@Inject | |
Greeter greeter; | |
@Test | |
public void should_create_greeting() { | |
Assert.assertEquals("Hello, Earthling!", greeter.createGreeting("Earthling")); | |
greeter.greet(System.out, "Earthling"); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@RunWith(Arquillian.class) | |
public class CGreeterTest { | |
@Deployment | |
public static JavaArchive archive = Deployments.createGreeterDeployment(); | |
@Inject | |
Greeter greeter; | |
@Test | |
public void should_create_greeting() { | |
Assert.assertEquals("Hello, Earthling!", greeter.createGreeting("Earthling")); | |
greeter.greet(System.out, "Earthling"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment