Created
April 15, 2012 15:09
-
-
Save mojavelinux/2393347 to your computer and use it in GitHub Desktop.
Basic Arquillian Test
This file contains hidden or 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
| import static org.junit.Assert.assertEquals; | |
| import javax.ejb.EJB; | |
| import org.jboss.arquillian.container.test.api.Deployment; | |
| import org.jboss.arquillian.junit.Arquillian; | |
| import org.jboss.shrinkwrap.api.ShrinkWrap; | |
| import org.jboss.shrinkwrap.api.spec.JavaArchive; | |
| import org.junit.Test; | |
| import org.junit.runner.RunWith; | |
| @RunWith(Arquillian.class) | |
| public class GreeterTest { | |
| @Deployment | |
| public static JavaArchive createDeployment() { | |
| return ShrinkWrap.create(JavaArchive.class) | |
| .addClass(Greeter.class) | |
| .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml"); | |
| } | |
| @Inject | |
| Greeter greeter; | |
| @Test | |
| public void should_create_greeting() { | |
| assertEquals("Hello, Earthling!", greeter.greet("Earthling")); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment